diff --git a/index.html b/index.html index 93b6ab8..be9306d 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.a85d15f93a17d626f7d1.bundle.js b/js/app.a85d15f93a17d626f7d1.bundle.js deleted file mode 100644 index 9b36b33..0000000 --- a/js/app.a85d15f93a17d626f7d1.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,a)=>{const s=a(89),r=a(863),{lightningChart:i,AxisTickStrategies:n,Themes:d}=s,{createProgressiveTraceGenerator:o}=r,h=i({resourcesBaseUrl:new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"resources/"}).ChartXY({theme:d[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("TimeTickStrategy example").setPadding({right:40}),c=(h.getDefaultAxisX().setTickStrategy(n.Time),h.getDefaultAxisY(),h.addLineSeries({dataPattern:{pattern:"ProgressiveX"}})),g=(h.addLegendBox().add(h).setAutoDispose({type:"max-width",maxWidth:.3}),1e5);o().setNumberOfPoints(g).generate().toPromise().then((e=>{e=e.map((e=>({x:288e5*e.x/g,y:e.y}))),c.add(e)}))}},e=>{e.O(0,[502],(()=>(44,e(e.s=44)))),e.O()}]); \ No newline at end of file diff --git a/js/app.adcfccfc5c114af7027c.bundle.js b/js/app.adcfccfc5c114af7027c.bundle.js new file mode 100644 index 0000000..c263938 --- /dev/null +++ b/js/app.adcfccfc5c114af7027c.bundle.js @@ -0,0 +1 @@ +(self.webpackChunk=self.webpackChunk||[]).push([[524],{44:(e,t,a)=>{const s=a(377),r=a(613),{lightningChart:i,AxisTickStrategies:n,Themes:d}=s,{createProgressiveTraceGenerator:o}=r,h=i({resourcesBaseUrl:new URL(document.head.baseURI).origin+new URL(document.head.baseURI).pathname+"resources/"}).ChartXY({theme:d[new URLSearchParams(window.location.search).get("theme")||"darkGold"]||void 0}).setTitle("TimeTickStrategy example").setPadding({right:40}),c=(h.getDefaultAxisX().setTickStrategy(n.Time),h.getDefaultAxisY(),h.addLineSeries({dataPattern:{pattern:"ProgressiveX"}})),g=(h.addLegendBox().add(h).setAutoDispose({type:"max-width",maxWidth:.3}),1e5);o().setNumberOfPoints(g).generate().toPromise().then((e=>{e=e.map((e=>({x:288e5*e.x/g,y:e.y}))),c.add(e)}))}},e=>{e.O(0,[502],(()=>e(e.s=44))),e.O()}]); \ No newline at end of file diff --git a/js/vendor.84333698cb4abf09f0ae.bundle.js b/js/vendor.84333698cb4abf09f0ae.bundle.js new file mode 100644 index 0000000..bd8538d --- /dev/null +++ b/js/vendor.84333698cb4abf09f0ae.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.84333698cb4abf09f0ae.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[502],{243:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,TokenFactory:()=>h});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function r(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,r,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}var o=function(t){function e(i){var s,r="EventError: "+i+"}";return s=t.call(this,r)||this,Object.setPrototypeOf(s,e.prototype),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(Error),h=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},a=0,l=function(t,e){return new o("Event listener with "+t.token+" id does not exist at Eventer with "+e+" id.")},u=function(){function t(){this.id=++a,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),r=i||h(this.id,this.lastEventIndex+=1);return s?s.set(r,e):this.topics.set(t,new Map([[r,e]])),r},t.prototype.has=function(t,e){var i,s;if(e)return(u=this.topics.get(e))?(c=u.get(t))||l(t,this.id):new o("Eventer with "+t.ownerIndex+" does not have "+e+".");try{for(var h=r(this.topics),a=h.next();!a.done;a=h.next()){var u,c,d=n(a.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{a&&!a.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(a=this.topics.get(e))||!a.delete(t));try{for(var o=r(this.topics),h=o.next();!h.done;h=o.next()){var a,l=n(h.value,2);if(l[0],(a=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return!1},t.prototype.allOff=function(){return this.topics.clear(),this},t.prototype.topicOff=function(t){return this.topics.delete(t)},t.prototype.emit=function(t){for(var e=[],i=1;i{i.r(e),i.d(e,{DataGenerator:()=>l,DataHost:()=>a,Stream:()=>h,createDeltaFunctionGenerator:()=>A,createOHLCGenerator:()=>x,createParametricFunctionGenerator:()=>T,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>E,createSpectrumDataGenerator:()=>R,createTraceGenerator:()=>y,createWaterDropDataGenerator:()=>D,createWhiteNoiseGenerator:()=>b});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)e.hasOwnProperty(i)&&(t[i]=e[i])},s(t,e)};function r(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n=function(){return n=Object.assign||function(t){for(var e,i=1,s=arguments.length;i0||-1===this.batchesLeft)&&i.length>0&&(this.data=this.data.concat(i.map((function(e){return t.infiniteReset(e)}))),i.length0||-1===this.batchesLeft||-2===this.batchesLeft&&this.data.length>0;return this.continueHandler&&(t=!0===this.continueHandler()),t},t.prototype.runStream=function(){var t=this.checkStreamContinue();if(this.data&&this.data.length>0&&t){if(this.streamHandler){var e=this.consume();this.streamHandler(e)}setTimeout(this.runStream,this.interval)}else this.streamActive=!1;this.batchesLeft>0&&this.batchesLeft--},t.prototype.activateStream=function(){this.streamActive||(this.streamActive=!0,this.runStream())},t.prototype.push=function(t){Array.isArray(t)?this.data=this.data.concat(t):this.data.push(t),this.activateStream()},t.prototype.map=function(e){return this.outputStream=new t(n(n({},this.options),{repeat:!1}),this.infiniteReset),this.mapHandler=e,this.streamHandler=this._map,this.activateStream(),this.outputStream},t.prototype._map=function(t){if(this.mapHandler&&this.outputStream){var e=t.map(this.mapHandler);this.outputStream.push(e)}},t.prototype.forEach=function(t){this.forEachHandler=t,this.streamHandler=this._forEach,this.activateStream()},t.prototype._forEach=function(t){this.forEachHandler&&t.forEach(this.forEachHandler)},t}(),a=function(){function t(t,e){this.data=[],this.derivativeDataHosts=[],this.promisesToResolve=[],this.streamsToPush=[],this.infiniteReset=this.infiniteReset.bind(this),this.infiniteResetHandler=t;var i={interval:e.interval,batchSize:e.batchSize,repeat:void 0!==e.repeat&&e.repeat};this.streamOptions=Object.freeze(i)}return t.prototype.toStream=function(){var t=new h(this.streamOptions,this.infiniteReset);return this.frozenData?t.push(this.frozenData):this.streamsToPush.push(t),t},t.prototype.toPromise=function(){var t=this;return this.frozenData?Promise.resolve(this.frozenData):new Promise((function(e){t.promisesToResolve.push(e)}))},t.prototype.infiniteReset=function(t){return this.infiniteResetHandler(t,this.frozenData?this.frozenData:[])},t.prototype.push=function(t){var e,i;if(!this.frozenData)if(Array.isArray(t))try{for(var s=function(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.")}(t),r=s.next();!r.done;r=s.next()){var n=r.value;this.data.push(n)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}else this.data.push(t)},t.prototype.setData=function(t){this.data=t},t.prototype.freeze=function(){var t=this;this.frozenData||(this.frozenData=this.data,setTimeout((function(){t.promisesToResolve.forEach((function(e){return e(t.frozenData)})),t.promisesToResolve=[]}),0),setTimeout((function(){t.streamsToPush.forEach((function(e){return e.push(t.frozenData||[])})),t.streamsToPush=[]}),0),setTimeout((function(){t.handleDerivativeDataHosts()}),0),this.data=[])},t.prototype.getPointCount=function(){return this.frozenData?this.frozenData.length:0},t.prototype.handleDerivativeDataHosts=function(){var t=this;this.frozenData&&this.derivativeDataHosts.length>0&&(this.derivativeDataHosts.forEach((function(e){t.frozenData&&e.setData(t.frozenData),e.freeze()})),this.derivativeDataHosts=[])},t.prototype.setStreamInterval=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{interval:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamBatchSize=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{batchSize:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamRepeat=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{repeat:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t}();if("undefined"!=typeof window&&window.performance&&window.performance.now)o=window.performance.now.bind(window.performance);else try{o=Object(function(){var t=new Error("Cannot find module 'perf_hooks'");throw t.code="MODULE_NOT_FOUND",t}()).now}catch(t){throw new Error('Failed to detect "performance.now" API')}var l=function(){function t(t){this.options=t}return t.prototype.generate=function(){var t=new a(this.infiniteReset,{interval:500,batchSize:10,repeat:!1}),e=this.getPointCount(),i=this.generateChunks.bind(this,0,e,t);return setTimeout(i,0),t},t.prototype.generateChunks=function(t,e,i){for(var s=o(),r=[],n=0;o()-s<15&&t.5?this.offset+e:this.offset-e}return this.offset+this.options.dataMax>1?this.offset=1-this.options.dataMax:this.offset<0&&(this.offset=0),{x:t,y:this.offset+Math.random()*this.options.dataMax}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function d(){return new f({numberOfPoints:1e3})}var f=function(t){function e(e){var i=t.call(this,e)||this;i.previousPoint={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e={x:t,y:this.previousPoint.y+2*(Math.random()-.5)};return this.previousPoint=e,e},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function g(){return new m({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var m=function(t){function e(e){var i=t.call(this,e)||this;i.x=i.options.start;var s={samplingFunction:e.samplingFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setSamplingFunction=function(t){return new e(n(n({},this.options),{samplingFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.x,y:this.options.samplingFunction(this.x)};return this.x=this.x+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length*(e[e.length-1].x-e[e.length-2].x),y:t.y}},e}(l);function y(){return new p({numberOfPoints:1e3})}var p=function(t){function e(e){var i=t.call(this,e)||this;i.previous={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.previous.x+2*(Math.random()-.5),y:this.previous.y+2*(Math.random()-.5)};return this.previous=t,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function x(){return new S({numberOfPoints:1e3,startTimestamp:0,dataFreq:1,start:100,volatility:.1})}var S=function(t){function e(e){var i=t.call(this,e)||this;return i.prevPoint=[i.options.startTimestamp,i.options.start,i.options.start,i.options.start,i.options.start],i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setStartTimestamp=function(t){return new e(n(n({},this.options),{startTimestamp:t}))},e.prototype.setDataFrequency=function(t){return new e(n(n({},this.options),{dataFreq:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setVolatility=function(t){return new e(n(n({},this.options),{volatility:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e,i=this,s=this.options.startTimestamp+this.options.dataFreq*t,r=Math.random()>.5?1:-1,n=Array.from(Array(4)).map((function(t){var e=Math.random()*i.options.volatility*r;return i.prevPoint[4]+e<0&&(e*=-1),i.prevPoint[4]+e})).sort((function(t,e){return t-e}));return-1===r&&(n=[n[0],n[2],n[1],n[3]]),e=[s,n[1],n[3],n[0],n[2]],this.prevPoint=e,e},e.prototype.infiniteReset=function(t,e){return[t[0]+e.length*(e[e.length-1][0]-e[e.length-2][0]),t[1],t[2],t[3],t[4]]},e}(l);function A(){return new v({numberOfPoints:1e3,minGap:1,maxGap:-1,minAmplitude:.1,maxAmplitude:1,probability:.02})}var v=function(t){function e(e){var i=t.call(this,e)||this;i.lastSpike=0;var s={numberOfPoints:e.numberOfPoints,minGap:e.minGap,maxGap:e.maxGap,minAmplitude:e.minAmplitude,maxAmplitude:e.maxAmplitude,probability:e.probability};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setMinGap=function(t){return new e(n(n({},this.options),{minGap:t}))},e.prototype.setMaxGap=function(t){return new e(n(n({},this.options),{maxGap:t}))},e.prototype.setMinAmplitude=function(t){return new e(n(n({},this.options),{minAmplitude:t}))},e.prototype.setMaxAmplitude=function(t){return new e(n(n({},this.options),{maxAmplitude:t}))},e.prototype.setProbability=function(t){return new e(n(n({},this.options),{probability:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e=t-this.lastSpike,i={x:t,y:0};return(e>this.options.minGap||-1===this.options.minGap)&&(e1-this.options.probability&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t):e>=this.options.maxGap&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t)),i},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function b(){return new M({numberOfPoints:1e3})}var M=function(t){function e(e){var i=t.call(this,e)||this,s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(this.options?n(n({},this.options),{numberOfPoints:t}):{numberOfPoints:t})},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){return{x:t,y:2*(Math.random()-.5)}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function E(){return new w({inputData:[],samplingFrequency:50,step:0})}var w=function(t){function e(e){var i=t.call(this,e)||this;i.interval=1/(i.options.samplingFrequency||10);var s={inputData:e.inputData,samplingFrequency:e.samplingFrequency,step:e.step};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setInputData=function(t){return new e(n(n({},this.options),{inputData:t}))},e.prototype.setSamplingFrequency=function(t){return new e(n(n({},this.options),{samplingFrequency:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.options.inputData.length},e.prototype.generateDataPoint=function(t){return{timestamp:t*this.interval+t*this.options.step,data:this.options.inputData[t]}},e.prototype.infiniteReset=function(t,e){return{timestamp:t.timestamp+e[e.length-1].timestamp,data:t.data}},e}(l);function T(){return new k({xFunction:function(t){return 3*Math.cos(3*t)},yFunction:function(t){return 3*Math.sin(4*t)},start:0,end:1e3,step:.5})}var k=function(t){function e(e){var i=t.call(this,e)||this;i.t=i.options.start;var s={xFunction:e.xFunction,yFunction:e.yFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setXFunction=function(t){return new e(n(n({},this.options),{xFunction:t}))},e.prototype.setYFunction=function(t){return new e(n(n({},this.options),{yFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.options.xFunction(this.t),y:this.options.yFunction(this.t)};return this.t=this.t+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x,y:t.y}},e}(l),C={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function R(){return new I(C)}var I=function(t){function e(e){var i=t.call(this,e)||this,s={sampleSize:void 0!==e.sampleSize?e.sampleSize:C.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:C.numberOfSamples,variation:void 0!==e.variation?e.variation:C.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:C.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:C.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:C.narrowFactor2};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfSamples=function(t){return new e(n(n({},this.options),{numberOfSamples:t}))},e.prototype.setSampleSize=function(t){return new e(n(n({},this.options),{sampleSize:t}))},e.prototype.setVariation=function(t){return new e(n(n({},this.options),{variation:t}))},e.prototype.setFrequencyStability=function(t){return new e(n(n({},this.options),{frequencyStability:t}))},e.prototype.setNarrowFactor1=function(t){return new e(n(n({},this.options),{narrowFactor1:t}))},e.prototype.setNarrowFactor2=function(t){return new e(n(n({},this.options),{narrowFactor2:t}))},e.prototype.getPointCount=function(){return this.options.numberOfSamples},e.prototype.generateDataPoint=function(t){for(var e=100,i=this.options.variation,s=this.options.sampleSize,r=this.options.frequencyStability,n=s/8,o=s/2,h=new Array(s),a=0;as&&(n=s),(o+=(Math.random()-.5)*i/r/100*s)<0&&(o=0),o>s&&(o=s);var g,m=e/3*2,y=m/(f*f)*this.options.narrowFactor1,p=50/(f*f)*this.options.narrowFactor2;for(a=0;ae&&(l=e),(u=50-(d=.8*a-o)*d*p)<0&&(u=0),u>e&&(u=e),g=l+u,g+=g*(Math.random()-.5)*i/10,h[a]=(h[a]+g)/2,h[a]<0&&(h[a]=0),h[a]>e&&(h[a]=e),h[a]=.02*h[a];return h},e.prototype.infiniteReset=function(t,e){return t.slice()},e}(l),F={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function D(){return new L(F)}var L=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:F.rows,columns:void 0!==t.columns?t.columns:F.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:F.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:F.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:F.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:F.offsetLevel,volatility:void 0!==t.volatility?t.volatility:F.volatility};this.options=Object.freeze(e)}return t.prototype.setRows=function(e){return new t(n(n({},this.options),{rows:e}))},t.prototype.setColumns=function(e){return new t(n(n({},this.options),{columns:e}))},t.prototype.setWaterDrops=function(e){var i=e.map((function(t){return t.rowNormalized})),s=e.map((function(t){return t.columnNormalized})),r=e.map((function(t){return t.amplitude}));return new t(n(n({},this.options),{rowPositionsNormalized:i,columnPositionsNormalized:s,amplitudes:r}))},t.prototype.setOffsetLevel=function(e){return new t(n(n({},this.options),{offsetLevel:e}))},t.prototype.setVolatility=function(e){return new t(n(n({},this.options),{volatility:e}))},t.prototype.generate=function(){var t=this;return new Promise((function(e){return i=t,s=void 0,n=function(){var t,i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p,x,S;return function(t,e){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function h(n){return function(h){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]0&&m%1e3==0&&Date.now()-g>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:A.sent(),g=Date.now(),A.label=4;case 4:return x++,S+=d,[3,2];case 5:return y++,p+=f,[3,1];case 6:return e(c),[2]}}))},new((r=void 0)||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function h(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,h)}a((n=n.apply(i,s||[])).next())}));var i,s,r,n}))},t}()},570:t=>{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,m=e&&e.length,y=m?e[0]*s:t.length,p=i(t,0,y,s,!0),x=[];if(!p||p.next===p.prev)return x;if(m&&(p=function(t,e,s,r){var n,o,h,a=[];for(n=0,o=e.length;n80*s){n=h=t[0],o=a=t[1];for(var S=s;Sh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===T(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(E(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!p(s,s.next)&&0!==y(s.prev,s,s.next))s=s.next;else{if(E(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,m,y=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),E(t),t=m.next,y=m.next;else if((t=m)===y){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(y(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(y(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,m=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,A=d(m,p,e,i,s),v=d(x,S,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=A&&M&&M.z<=v;){if(b.x>=m&&b.x<=x&&b.y>=p&&b.y<=S&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=m&&M.x<=x&&M.y>=p&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=A;){if(b.x>=m&&b.x<=x&&b.y>=p&&b.y<=S&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=m&&M.x<=x&&M.y>=p&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&x(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),E(r),E(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&m(a,l)){var u=b(a,l);return a=s(a,a.next),u=s(u,u.next),r(a,e,i,n,o,h,0),void r(u,e,i,n,o,h,0)}l=l.next}a=a.next}while(a!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,o=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var h=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(h<=r&&h>o&&(o=h,i=s.x=s.x&&s.x>=u&&r!==s.x&&g(ni.x||s.x===i.x&&c(i,s)))&&(i=s,f=a)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=b(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function 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&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(v(t,e)&&v(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||p(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=A(y(t,e,i)),n=A(y(t,e,s)),o=A(y(i,s,t)),h=A(y(i,s,e));return r!==n&&o!==h||!(0!==r||!S(t,i,e))||!(0!==n||!S(t,s,e))||!(0!==o||!S(i,t,s))||!(0!==h||!S(i,e,s))}function S(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 A(t){return t>0?1:t<0?-1:0}function v(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new w(t.i,t.x,t.y),s=new w(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function M(t,e,i,s){var r=new w(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function E(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 T(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},568:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>w,Iterable:()=>ks,List:()=>ai,Map:()=>ze,OrderedMap:()=>bi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Wi,Record:()=>ms,Repeat:()=>bs,Seq:()=>J,Set:()=>Ni,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>ae,getIn:()=>ji,has:()=>he,hasIn:()=>Zi,hash:()=>pt,is:()=>ft,isAssociative:()=>E,isCollection:()=>S,isImmutable:()=>L,isIndexed:()=>M,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>_,isOrderedMap:()=>ct,isOrderedSet:()=>_i,isPlainObject:()=>re,isRecord:()=>D,isSeq:()=>I,isSet:()=>Pi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Ee,mergeDeep:()=>Te,mergeDeepWith:()=>ke,mergeWith:()=>we,remove:()=>ue,removeIn:()=>ye,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ts});var s="delete",r=5,n=1<>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?u(t)+e:e}function d(){return!0}function f(t,e,i){return(0===t&&!p(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return y(t,e,0)}function m(t,e){return y(t,e,e)}function y(t,e,i){return void 0===t?i:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[x])}var A="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[A])}var b="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[b])}function E(t){return v(t)||M(t)}var w=function(t){return S(t)?t:J(t)},T=function(t){function e(t){return v(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(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 S(t)&&!E(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=T,w.Indexed=k,w.Set=C;var R="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[R])}var F="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[F])}function L(t){return S(t)||D(t)}var P="@@__IMMUTABLE_ORDERED__@@";function _(t){return Boolean(t&&t[P])}var V=0,B=1,z=2,N="function"==typeof Symbol&&Symbol.iterator,O="@@iterator",U=N||O,G=function(t){this.next=t};function Y(t,e,i,s){var r=0===t?e:1===t?i:[e,i];return s?s.value=r:s={value:r,done:!1},s}function H(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!$(t)}function W(t){return t&&"function"==typeof t.next}function j(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(N&&t[N]||t[O]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=V,G.VALUES=B,G.ENTRIES=z,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[U]=function(){return this};var Z=Object.prototype.hasOwnProperty;function K(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 J=function(t){function e(t){return null==t?nt():L(t)?t.toSeq():function(t){var e,i,s=at(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,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new G((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return Y(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),q=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?v(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(J),Q=function(t){function e(t){return null==t?nt():S(t)?v(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ht(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(J),tt=function(t){function e(t){return(S(t)&&!E(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}(J);J.isSeq=I,J.Keyed=q,J.Set=tt,J.Indexed=Q,J.prototype[R]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new G((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return Y(t,n,i[n])}))},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 Z.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,r=s.length,n=0;n!==r;){var o=s[e?r-++n:n++];if(!1===t(i[o],o,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,r=s.length,n=0;return new G((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return Y(t,o,i[o])}))},e}(q);it.prototype[P]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=j(this._collection),s=0;if(W(i))for(var r;!(r=i.next()).done&&!1!==t(r.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=j(this._collection);if(!W(i))return new G(H);var s=0;return new G((function(){var e=i.next();return e.done?e:Y(t,s++,e.value)}))},e}(Q);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return K(t)?new et(t):X(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&_(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 yt=Object.prototype.valueOf;function pt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==yt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return mt(e)}(r);case"string":return r.length>Ct?(void 0===(s=Ft[i=r])&&(s=St(i),It===Rt&&(It=0,Ft={}),It++,Ft[i]=s),s):St(r);case"object":case"function":return function(t){var e;if(Et&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!vt){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=bt(),Et)Mt.set(t,e);else{if(void 0!==At&&!1===At(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)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}(r);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=bt(),wt[t]=e),e}(r);default:if("function"==typeof r.toString)return St(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function St(t){for(var e=0,i=0;i=0&&(a.get=function(e,i){return(e=c(this,e))>=0&&en)return{value:void 0,done:!0};var t=r.next();return s||e===B||t.done?t:Y(e,a-1,e===V?void 0:t.value[1],t)}))},a}function Ut(t,e,i,s){var r=Kt(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(z,n),a=!0,l=0;return new G((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:Y(r,l++,r===V?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===z?t:Y(r,n,u,t)}))},r}function Gt(t,e,i){var s=Kt(t);return s.__iterateUncached=function(r,n){if(n)return this.cacheResult().__iterate(r,n);var o=0,h=!1;return function t(a,l){a.__iterate((function(n,a){return(!e||l0}function Wt(t,e,i,s){var r=Kt(t),n=new et(i).map((function(t){return t.size}));return r.size=s?n.max():n.min(),r.__iterate=function(t,e){for(var i,s=this.__iterator(B,e),r=0;!(i=s.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var n=i.map((function(t){return t=w(t),j(r?t.reverse():t)})),o=0,h=!1;return new G((function(){var i;return h||(i=n.map((function(t){return t.next()})),h=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),h?{value:void 0,done:!0}:Y(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}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 Zt(t){return v(t)?T:M(t)?k:C}function Kt(t){return Object.create((v(t)?q:M(t)?Q:tt).prototype)}function Jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function qt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[i]=arguments[i+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Me(this,e,t)}function Me(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Re(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Re(e,i,t)}function Te(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 Re(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=J(i),h=J(n),M(o)===M(h)&&v(o)===v(h))?Re(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Re(t,e,i){if(!ne(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),r=t,n=s?k:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=Z.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=le(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ce(this,e,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ke(),(function(t){return Re(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ke(),(function(t){return Ce(t,e)}))}function Pe(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function _e(){return this.__ownerID?this:this.__ensureOwner(new l)}function Ve(){return this.__ensureOwner()}function Be(){return this.__altered}var ze=function(t){function e(e){return null==e?Ke():ut(e)&&!_(e)?e:Ke().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 Ke().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 Je(this,t,e)},e.prototype.remove=function(t){return Je(this,t,h)},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):Ke()},e.prototype.sort=function(t){return bi(Yt(this,t))},e.prototype.sortBy=function(t,e){return bi(Yt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(r,n){s.set(n,t.call(e,r,n,i))}))}))},e.prototype.__iterator=function(t,e){return new We(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?Ze(this.size,this._root,t,this.__hash):0===this.size?Ke():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ne=ze.prototype;Ne[lt]=!0,Ne[s]=Ne.remove,Ne.removeAll=Ne.deleteAll,Ne.setIn=me,Ne.removeIn=Ne.deleteIn=pe,Ne.update=Se,Ne.updateIn=Ae,Ne.merge=Ne.concat=ve,Ne.mergeWith=be,Ne.mergeDeep=Ie,Ne.mergeDeepWith=Fe,Ne.mergeIn=De,Ne.mergeDeepIn=Le,Ne.withMutations=Pe,Ne.wasAltered=Be,Ne.asImmutable=Ve,Ne["@@transducer/init"]=Ne.asMutable=_e,Ne["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ne["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new He(t,pt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return h&n?this.nodes[ei(h&n-1)].get(t+r,e,i,s):s},Ue.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=pt(s));var c=(0===e?i:i>>>e)&o,d=1<=ri)return function(t,e,i,s,r){for(var o=0,h=new Array(n),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=r,new Ge(t,o+1,h)}(t,y,f,c,x);if(g&&!x&&2===y.length&&Qe(y[1^m]))return y[1^m];if(g&&x&&1===y.length&&Qe(x))return x;var S=t&&t===this.ownerID,A=g?x?f:f^d:f|d,v=g?x?ii(y,m,x,S):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ge.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=pt(s));var u=(0===e?i:i>>>e)&o,c=n===h,d=this.nodes,f=d[u];if(c&&!f)return this;var g=qe(f,t,e+r,i,s,n,a,l);if(g===f)return this;var m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new He(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Qt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=mi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Si(t,e).set(0,i):Si(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=Ai(t._capacity)?s=yi(s,t.__ownerID,0,e,i,n):r=yi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Si(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=pi(this,t);if(!h)for(var u=0;u>>e&o;if(n>=this.array.length)return this;if(e>0){var h=this.array[n];if((s=h&&h.removeAfter(t,e-r,i))===h&&n===this.array.length-1)return this}var a=pi(this,t);return a.array.splice(n+1),s&&(a.array[n]=s),a};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Ai(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=yi(d,e,i-r,s,n,h);return f===d?t:((l=pi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=pi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function pi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=Ai(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Si(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=Ai(h),m=Ai(u);m>=1<g?new ui([],s):y;if(y&&m>g&&ar;S-=r){var A=g>>>S&o;x=x.array[A]=pi(x.array[A],s)}x.array[g>>>r&o]=y}if(u=m)a-=m,u-=m,c=r,d=null,p=p&&p.removeBefore(s,0,a);else if(a>n||m>>c&o;if(v!==m>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&m>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Mi(s,r)}bi.isOrderedMap=ct,bi.prototype[P]=!0,bi.prototype[s]=bi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[Ti])}var Ci=function(t){function e(t){return null==t?Di():ki(t)?t:Di().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var i=this._head;for(t=c(this,t);i&&t--;)i=i.next;return i?i.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:t[s],next:i};return this.__ownerID?(this.size=e,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&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):Fi(i,s)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Di()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Fi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fi(this.size,this._head,t,this.__hash):0===this.size?Di():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new et(this.toArray()).__iterate((function(e,s){return t(e,s,i)}),e);for(var s=0,r=this._head;r&&!1!==t(r.value,s++,this);)r=r.next;return s},e.prototype.__iterator=function(t,e){if(e)return new et(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new G((function(){if(s){var e=s.value;return s=s.next,Y(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Ri,Ii=Ci.prototype;function Fi(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Di(){return Ri||(Ri=Fi(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Pe,Ii.wasAltered=Be,Ii.asImmutable=Ve,Ii["@@transducer/init"]=Ii.asMutable=_e,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function Pi(t){return Boolean(t&&t[Li])}function _i(t){return Pi(t)&&_(t)}function Vi(t,e){if(t===e)return!0;if(!S(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||v(t)!==v(e)||M(t)!==M(e)||_(t)!==_(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!E(t);if(_(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&&ft(r[1],t)&&(i||ft(r[0],e))}))&&s.next().done}var r=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{r=!0;var n=t;t=e,e=n}var o=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!ft(e,t.get(s,h)):!ft(t.get(s,h),e))return o=!1,!1}));return o&&t.size===a}function Bi(t,e){var i=function(i){t.prototype[i]=e[i]};return Object.keys(e).forEach(i),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(i),t}function zi(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!ne(t))return t;t=J(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Ni=function(t){function e(e){return null==e?Hi():Pi(e)&&!_(e)?e:Hi().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Hi()},e.union=function(t){return(t=w(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Hi()},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,r=Gi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=e+3864292196^t)^e>>>16,2246822507),e=mt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(pt(t),pt(e))|0}:function(t,e){s=s+as(pt(t),pt(e))|0}:e?function(t){s=31*s+pt(t)|0}:function(t){s=s+pt(t)|0}),s)}(this))}});var Ji=w.prototype;Ji[x]=!0,Ji[U]=Ji.values,Ji.toJSON=Ji.toArray,Ji.__toStringMapper=oe,Ji.inspect=Ji.toSource=function(){return this.toString()},Ji.chain=Ji.flatMap,Ji.contains=Ji.includes,Bi(T,{flip:function(){return jt(this,Vt(this))},mapEntries:function(t,e){var i=this,s=0;return jt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return jt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var qi=T.prototype;qi[A]=!0,qi[U]=Ji.entries,qi.toJSON=Ki,qi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(k,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return jt(this,Nt(this,t,e,!1))},findIndex:function(t,e){var i=this.findEntry(t,e);return i?i[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return jt(this,zt(this,!1))},slice:function(t,e){return jt(this,Ot(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return 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 as(t,e){return t^e+2654435769+(t<<6)+(t>>2)}ts.has=Ji.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(q,qi),Bi(Q,Qi),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():_i(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(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ni);ls.isOrderedSet=_i;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(Ei()))}cs[P]=!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(D(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(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function Es(t,e,i,s,r,n){if("string"!=typeof i&&!L(i)&&(K(i)||X(i)||re(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==s&&r.push(s);var o=e.call(n,s,J(i).map((function(s,n){return Es(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return M(e)?e.toList():v(e)?e.toMap():e.toSet()}var Ts="4.3.7",ks=w;const Cs={version:Ts,Collection:w,Iterable:w,Seq:J,Map:ze,OrderedMap:bi,List:ai,Stack:Ci,Set:Ni,OrderedSet:ls,PairSorting:gs,Record:ms,Range:Wi,Repeat:bs,is:ft,fromJS:Ms,hash:pt,isImmutable:L,isCollection:S,isKeyed:v,isIndexed:M,isAssociative:E,isOrdered:_,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:Pi,isOrderedSet:_i,isRecord:D,get:ae,getIn:ji,has:he,hasIn:Zi,merge:Ee,mergeDeep:Te,mergeWith:we,mergeDeepWith:ke,remove:ue,removeIn:ye,set:ce,setIn:ge,update:xe,updateIn:de}},377:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(568),r=i(243),n=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),h=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(n);class a{constructor(){this.o=!0}u(){return this.o}}class l extends a{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}),y=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),p=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),S=x,A=(t,e)=>({left:void 0!==e.left?e.left:t.left,top:void 0!==e.top?e.top:t.top,right:void 0!==e.right?e.right:t.right,bottom:void 0!==e.bottom?e.bottom:t.bottom}),v=s.Record({type:"color",r:1,g:1,b:1,a:1});class b extends v{constructor(t){super(t)}toUint32(){return void 0!==this.C||(this.C=F(this.getR(),this.getG(),this.getB(),this.getA())),this.C}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.T||(this.T=new b({r:this.r+.45*(1-this.r),g:this.g+.45*(1-this.g),b:this.b+.45*(1-this.b),a:this.a<1?this.a+.45*(1-this.a):1})),this.T}getLighter(){return this.F||(this.F=new b({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.F}getDarker(){return this.I||(this.I=new b({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.I}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),E=(t,e,i,s=255)=>new b({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 b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255,a:Number(`0x${e.substring(6,8)}`)/255});case 6:return new b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255});case 4:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255,a:Number(`0x${e.charAt(3)}${e.charAt(3)}`)/255});case 3:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},T=(t,e=1,i=1)=>{let s,r,n;t/=360;const o=Math.floor(6*t),h=6*t-o,a=i*(1-e),l=i*(1-h*e),u=i*(1-(1-h)*e);switch(o%6){case 0:s=i,r=u,n=a;break;case 1:s=l,r=i,n=a;break;case 2:s=a,r=i,n=u;break;case 3:s=a,r=l,n=i;break;case 4:s=u,r=a,n=i;break;default:s=i,r=a,n=l}return new b({r:s,g:r,b:n})},k=t=>E(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),C={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"},R=new b({}),I=E(0,0,0,0),F=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,D=(t,e)=>t.value-e.value,L=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:E(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),P=t=>{const{steps:e}=t,i=e.length;e.sort(D);const[s,r]=i>0?[e[0].value,e[i-1].value]:[0,0],n=i>0?i-1:0,o=Array(n);for(let t=0;t0&&s!==r}};class _ extends L{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,P(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(P({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}getColors(t){if(Array.isArray(t)){if(Array.isArray(t[0])){const e=t,i=e.length,s=e[0].length,r=[...Array(i)].map((()=>Array(s)));for(let t=0;t=a&&t<=l){if(a===l)return i.color;const e=(t-i.value)/(h.value-i.value);return s=i.color,r=h.color,n=e,new b({r:s.r+(r.r-s.r)*n,g:s.g+(r.g-s.g)*n,b:s.b+(r.b-s.b)*n,a:s.a+(r.a-s.a)*n})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const V=s.Record({type:"fillstyle",fillType:"empty"});class B extends V{toString(){return"emptyFill"}}const z=new B,N=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:E(255,255,255)});class U extends O{}class G extends U{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getColor(){return this.get("color")}setA(t){return this.setColor(this.getColor().setA(t))}setR(t){return this.setColor(this.getColor().setR(t))}setG(t){return this.setColor(this.getColor().setG(t))}setB(t){return this.setColor(this.getColor().setB(t))}}const Y=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class H extends U{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const X=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),W=s.Record({type:"fillstyle",fillType:"palette",lut:new _({steps:[]}),lookUpProperty:"value"}),j=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),$={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=ee(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.D)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.R=n,this.eases=t.map((([t,e])=>s(t,e,i)))}V(){this.L.emit("start")}start(){return this.R.includes(this)||this.R.push(this),this}addNextAnimations(t){return t instanceof Array?t.forEach((t=>this.nextAnimations.push(t))):this.nextAnimations.push(t),this}NextAnimation(t,e,i=this.duration,s=this.easing){const r=new Z(t,e,i,s,this.R);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.L.on("start",t,e)}onAnimationEnd(t,e){return this.L.on("end",t,e)}onEveryAnimationEnd(t,e){return this.L.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.L.on("allEnd",t,e)}allOffAnimationEnd(){return this.L.topicOff("end"),this}allOffEveryAnimationEnd(){return this.L.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.L.topicOff("allEnd"),this}offAnimationEnd(t){return this.L.off(t,"end")}offEveryAnimationEnd(t){return this.L.off(t,"everyEnd")}offAllAnimationEnd(t){return this.L.off(t,"allEnd")}finish(t=!0){if(this.D=!0,this.R.splice(this.R.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.L.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.L.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.L.emit("end",e),this.L.emit("everyEnd",e)),e}t&&(this.L.emit("end",void 0),this.L.emit("everyEnd",void 0),this.L.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(wt):this.values.map(wt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let e=0;e{e>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const i=[];let s,r,n=0;const o=()=>{s=void 0;const h=Date.now();r=r||h,n=h-r,n/1e3>=1/e&&(r=Date.now()-n%(1e3/e),i.forEach((t=>{0===t.delta&&t.V(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=bt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=$.linear)=>(r,n,h=t)=>{const a=new Z(r,n,h,e,i).start();return s||(s=bt.requestAnimationFrame(o)),a}};var J,q;e.GradientShape=void 0,(J=e.GradientShape||(e.GradientShape={})).circle="circle",J.ellipse="ellipse",e.GradientExtent=void 0,(q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",q.closestCorner="closest-corner",q.farthestSide="farthest-side",q.farthestCorner="farthest-corner";const Q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class tt extends Q{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.")}toString(){return`radialGradientFill:${this.shape},${this.extent},${this.position.x},${this.position.y},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)}getColorStops(){return this.get("stops")}setPosition(t){return this.set("position",t)}getPosition(){return this.get("position")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}setExtent(t){return this.set("extent",t)}getExtent(){return this.get("extent")}}const et=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),it=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class st extends it{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?mi(t):t)}getAngle(t){return t?gi(this.get("angle")):this.get("angle")}}const rt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),nt=s.Record({type:"linestyle",lineType:"empty"}),ot=new class extends nt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}O(){return 0}setFillStyle(t){return this}getFillStyle(){return z}},ht=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class at{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new lt,this.y=new lt,this.z=new lt,this.L=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ge,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=n.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=n.x&&i{this.cellsAmount.y=t.reduce(Ge,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=n.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=n.y&&i{s.x.W(e),s.y.W(r)}}}U(){return this.G&&(this.G(),this.G=void 0),this}Y(t){return this.L.on("cell-resize",t)}H(t){return this.L.off(t,"cell-resize")}}class lt extends a{constructor(){super(...arguments),this.$=0,this.X=10,this.j=1}Z(){return this.o=!1,this}J(){return this.o=!0,this}getInnerStart(){return this.$}getInnerEnd(){return this.X}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}K(t,e){return this.$=t,this.X=e,this.q(),this}tt(t){return this.j=t,this.q(),this}it(t){return t/this.j}q(){const t=this.it(this.X-this.$),e=this.j;void 0!==this.st&&!1!==Ct(t,this.st)||(this.o=!0,this.et=e,this.st=t)}ht(){return this.st}rt(){return this.et}nt(){return this.Xnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ut({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new at({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ct=(t,e,i)=>e===i?t:i.ct(e.dt(t)),dt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Pi?e.x:e.x instanceof Pi?e.x.x:e.x.ft,r=e instanceof Pi?e.y:e.y instanceof Pi?e.y.y:e.y.ft,n=i instanceof Pi?i.x:i.x instanceof Pi?i.x.x:i.x.ft,o=i instanceof Pi?i.y:i.y instanceof Pi?i.y.y:i.y.ft;return{...t,x:ct(t.x,s,n),y:ct(t.y,r,o)}},ft=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.yt.At(t);if("world"===e.id&&"axes"===i.id)return e.chart.yt.St(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")},gt=(...t)=>{if(0===t.length)return{remove:kt};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,r,n)=>((i,s,r)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.vt(s,r,!1,i.getStopped(),"synchronizedAxis"))),e=!1)})(i,r,n)))));let s=!1;const r=t.map((e=>e.onStoppedStateChanged(((i,r)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,r)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(r[e])}))}}};class mt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,mt.prototype)}}class yt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&bt.alert(s),Object.setPrototypeOf(this,yt.prototype)}}class pt extends yt{constructor(t){super(t),Object.setPrototypeOf(this,pt.prototype)}}var xt,St,At,vt;e.UISpace=void 0,(xt=e.UISpace||(e.UISpace={}))[xt.Content=0]="Content",xt[xt.PaddedContent=1]="PaddedContent",xt[xt.PaddedBackground=2]="PaddedBackground",xt[xt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(St=e.UIVisibilityModes||(e.UIVisibilityModes={}))[St.never=0]="never",St[St.always=1]="always",St[St.whenHovered=2]="whenHovered",St[St.whenDragged=3]="whenDragged",St[St.whenNotDragged=4]="whenNotDragged",St[St.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,(vt=e.UIDirections||(e.UIDirections={}))[vt.Up=0]="Up",vt[vt.Right=1]="Right",vt[vt.Down=2]="Down",vt[vt.Left=3]="Left";const bt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Mt=(t,e)=>t.x===e.x&&t.y===e.y,Et=t=>t!==Le&&t!==Pe&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,wt=t=>t[1],Tt=t=>t.dispose(),kt=()=>{},Ct=(t,e)=>t===e,Rt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),It=t=>Array.prototype.concat.apply([],t),Ft=(t,e)=>void 0!==t?t:e,Dt=t=>t.xt(),Lt=t=>t.bt(),Pt=t=>t.Mt(),_t=t=>t._t(),Vt=t=>t.min.x,Bt=t=>t.max.x,zt=t=>t.min.y,Nt=t=>t.max.y,Ot=(t,e,i,s,r)=>{if(t.length>0){let n=r?s(r):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Gt=u(0,1),Yt=u(1,0),Ht=u(0,-1),Xt=u(-1,0),Wt=u(0,0),jt=t=>{switch(t){case e.UIDirections.Up:return Gt;case e.UIDirections.Right:return Yt;case e.UIDirections.Down:return Ht;case e.UIDirections.Left:return Xt;default:return Wt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Zt=t=>{t.stopPropagation(),t.preventDefault()},Kt=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let r=0;for(let e=0;e{if(!e){const e=t.length,i=new Float32Array(2*e);let s=0;for(let r=0;r{const e=t.length,i=new Float32Array(3*e);let s=0;for(let r=0;re=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},te=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ie=ee(Math.E),se=(t,e)=>{const i=e[t];return i?i():void 0},re=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iyi(hi(t,i))-yi(hi(e,i))))},ne=(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:E(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())),he=t=>255===t.getA()?t:t.setA(255),ae=(()=>{const t=E(0,0,0);return i=>(i=he(i),new tt({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:oe(i,t,.5)}]}))})(),le=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(et(t)||rt(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}j(t)}};return(e,i,s,r)=>{const n=[];if(r.fill&&n.push(r.fill),r.fill2&&n.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==z&&n.push(t)}if(r.point3D){const t=r.point3D;n.push(t.getFillStyle())}let o;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=n.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?(h=e)===(a=s)||h.getR()===a.getR()&&h.getG()===a.getG()&&h.getB()===a.getB()?ae(h):(h=he(h),a=he(a),new st({angle:0,stops:[{offset:0,color:a},{offset:.5,color:a},{offset:.5,color:h},{offset:1,color:h}]})):i.uiButtonFillStyle}else{const e=n.reduce(((e,i)=>e||t(i)),void 0);o=e?s?new G({color:e}):ae(e):i.uiButtonFillStyle}var h,a;e.setButtonOnFillStyle(o)}})(),ue=t=>{const e=t;if(j(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ce=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},de=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let r=s>=0?s:i.length;for(;r"function"==typeof t?t(e):t,ge=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),me=(t,e)=>e(),ye=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new G({color:E(255,255,255,1)});const pe=t=>t===_e||t.min.x===_e.min.x&&t.max.x===_e.max.x&&t.min.y===_e.min.y&&t.max.y===_e.max.y,xe=t=>Array.from(new Set(t)),Se=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,ve=(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))))))},be=(t,e)=>{throw new Error(e)},Me=()=>{const t=K((()=>{}));let e;return(i,s,r,n)=>{const o=null==n?void 0:n.onStart,h=null==n?void 0:n.onCompleted,a=(null==n?void 0:n.easing)||$.ease,l=(null==n?void 0:n.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else u=t(l,a)([[i,s]],(([t])=>{r(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),h&&u.onAnimationEnd(h)}},Ee=t=>{let e;return()=>e||(e=t(),e)},we=t=>{if(t===ot)return 0;const e=t.getThickness();return e<0?1:1*e},Te=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(s.shouldCrash)throw bt.alert(r),new Error(r);bt.console.warn(r)},ke=(t,e,i,s=0)=>{if(t{const t=new Map;return{wt:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ct(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.kt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Tt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ft(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.It(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Pt(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Dt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Lt(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.Rt(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Et(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.zt(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Vt(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ot(e,i,s)})),e),Nt:(e,i)=>{t.set(e,i)},Gt:()=>{t.clear()}}},Re={left:0,right:0,top:0,bottom:0},Ie=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),Fe=(t,e,i)=>{e&&e.Wt();const s=i();return{Ut:t,Wt:()=>{s.forEach((e=>t.Yt(e)))}}},De={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=>De.divide(t,De.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(De.dot(t,e)/(De.length(t)*De.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=De.dot(e,t),o=De.cross(e,t);return De.addVec(De.multiply(t,s),De.addVec(De.multiply(e,(1-s)*n),De.multiply(o,r)))},lerp:(t,e,i)=>(i=Rt(i,0,1),De.addVec(De.multiply(t,1-i),De.multiply(e,i))),equals:(t,e)=>Ct(t.x,e.x)&&Ct(t.y,e.y)&&Ct(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)})},Le=Number.MAX_SAFE_INTEGER,Pe=-Number.MAX_SAFE_INTEGER,_e=m(u(Le,Le),u(Pe,Pe)),Ve=m(f(Le,Le,Le),f(Pe,Pe,Pe)),Be=(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))},ze=(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),Oe=(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)))),Ue=t=>{const e=t.length;for(let i=0;ie+t,Ye=(t,e,i)=>{const s=hi(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=hi(i,t),o=(n.x*s.x+n.y*s.y)/r;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},He=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Xe=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},je=(t,e,i)=>oi(t,ni(hi(e,t),i)),$e=(t,e,i)=>De.addVec(t,De.multiply(De.subtractVec(e,t),i));function Ze(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:Le,y:Le},max:{x:Pe,y:Pe}};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},qe=(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 Qe(t,e,i,s){const r=t.x-s.x,n=t.y-s.y,o=s.x-i.x,h=i.y-s.y,a=h*r+o*n,l=(s.y-e.y)*r+(e.x-s.x)*n,u=h*(e.x-s.x)+o*(e.y-s.y);return u<0?a<=0&&l<=0&&a+l>=u:a>=0&&l>=0&&a+l<=u}function ti(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 ei(t,e){return u(t.x-e.x,t.y-e.y)}function ii(t){const e=ri(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function si(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ii(i);const s=Math.PI/2,r=i.x;return i.x=-Math.sin(s)*i.y,i.y=r*Math.sin(s),i}function ri(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function ni(t,e){return u(t.x*e,t.y*e)}function oi(t,e){return u(t.x+e.x,t.y+e.y)}function hi(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 li(t,e){return u(t.x/e.x,t.y/e.y)}function ui(t){return ni(t,-1)}function ci(t,e){return t.x*e.x+t.y*e.y}const di=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},fi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.x+(t-e.y)/s;return u(r,t)};function gi(t){return t*Math.PI/180}function mi(t){return 180*t/Math.PI}function yi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function pi(t){return u(Math.cos(t),Math.sin(t))}function xi(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 Si=(t,e,i,s)=>{let r,n,o,h;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,n=(s.y-i.y)/(s.x-i.x),h=n*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,r=(e.y-t.y)/(e.x-t.x),h=r*(o-t.x)+t.y):(r=(e.y-t.y)/(e.x-t.x),n=(s.y-i.y)/(s.x-i.x),o=(i.y-n*i.x+r*t.x-t.y)/(r-n),h=r*(o-t.x)+t.y),u(o,h)},Ai=(t,e)=>{const i=t.length,s=e.length,r=new Uint16Array(i+s);return r.set(t,0),r.set(e,i),r};class vi{constructor(){this.Ht=!0}getInnerStart(){return this.$}getInnerEnd(){return this.X}getInnerInterval(){return Math.abs(this.X-this.$)}K(t,e){return this.Ht=t!==this.$||e!==this.X,this.$=t,this.X=e,this}Z(){return this.Ht=!1,this}J(){return this.Ht=!0,this}}class bi extends vi{constructor(t,e,i,s){if(super(),this.$t=!0,this.Xt=!0,this.jt=[0,0],this.Zt=!0,this.Qt=t,this.Jt=e,this.Kt=i,this.qt=t,this.ti=e,s){const t=s.N(this.ii.bind(this));this.ii(s._()),this.si=()=>s.W(t)}}tt(t){return this.j=t,this.Xt=!0,this}ei(t){return this.jt=t.map(Math.abs),this.Zt=!0,this}hi(){return this.Qt/this.Kt*this.j+this.jt[0]}ri(){return(this.Qt+this.Jt)/this.Kt*this.j-this.jt[1]}ni(){return this.getCellSize()-this.oi()}ai(){return this.j}getCellSize(){return this.li(this.j)}oi(){return this.jt[0]+this.jt[1]}ui(){return this.jt}ii(t){this.Kt=t.reduce(Ge,0),this.Qt=t.reduce(((t,e,i)=>i>=this.qt?t:t+e),0),this.Jt=t.reduce(((t,e,i)=>i>=this.qt&&iki;return!n&&!o||!!r&&(e>t?{start:n?Ti:t,end:o?ki:e}:{start:o?ki:t,end:n?Ti:e})}dt(t){const e=this.hi(),i=this.ri(),s=Math.max(t,Ti);return e+(this.di.function(s)-this.fi.scaleStartLog)/this.fi.scaleIntervalLog*(i-e)}ct(t){const e=this.hi(),i=(t-e)/(this.ri()-e),s=this.fi.scaleStartLog+i*this.fi.scaleIntervalLog;return this.di.number**s}ci(){this.di&&this.Ai()}K(t,e){return super.K(t,e),this.di&&this.Ai(),this}ei(t){return super.ei(t),this.di&&this.Ai(),this}tt(t){return super.tt(t),this.di&&this.Ai(),this}gi(t){return this.di={internal:t,function:Ei(t),number:wi(t)},this}pi(){return this.di.internal}mi(t,e){const i=this.dt(t)+e;return this.ct(i)}yi(){return this.Xt||this.Ht||this.Zt||this.$t}Ai(){const t=this.di.function(this.$),e=this.di.function(this.X)-t,i=2*this.hi()/this.j-1,s=2*this.ri()/this.j-1-i;return this.fi={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.fi}Si(){return this.fi}}const Ei=t=>"e"===t?ie:ee(t),wi=t=>"e"===t?Math.E:t,Ti=.9*10**-4,ki=1.1*10**25,Ci=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Ri=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Be(s,10),0);return t.toFixed(r)},Ii={Numeric:(t,e)=>Ri(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let r="",n="";if(i>=1e3&&t>1e3){let e="";for(const i of Ci){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),n=i.prefix;break}}r=(s?"-":"")+e}else{let e=String(Math.floor(t));const n=Be(t,1e3);for(let t=1;t<=n;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}r=(s?"-":"")+e+(i<=10?((t,e)=>{if(0===e)return"";let i=(Math.abs(t)-Math.abs(Math.floor(t))).toString().substring(1);return i.length>e&&(i=i.substring(0,e+1)),i})(t,2-Be(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ei(s)(t);return`${s}${Fi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ei(s),n=Math.floor(r(t)),o=t/wi(s)**n;return`${Math.round(o)}×${s}${Fi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ei(s),n=Math.floor(r(t));return`${(t/wi(s)**n).toFixed(2)}×${s}${Fi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ei(s);if("e"===s)return`${Math.floor(r(t))}e`;const n=t.toString();if(t>1)return n;const o=Math.floor(r(t));return t.toFixed(Math.abs(o))}},Fi=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 Di extends bi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.xi=!1,this.bi=0,this.j=1e3,this.K(0,10),this.q()}yi(){return this.xi}ot(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.vi){const i=((t,e,i)=>{const s=((t,e)=>{if(ePe&&tPe){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),r=Math.min(i,s);return 10**Math.floor(Math.log10(r))}})(t,e);if(void 0!==s)return s*i})(t,e,this.getCellSize());if(void 0===i)return!1;if(o>i)return!0;const s=(e+t)/2,h=(r?i/2:n/2)*(t>e?-1:1);return{start:s-h,end:s+h}}const h=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>h)return!0;const a=(e+t)/2,l=(r?h/2:n/2)*(t>e?-1:1);return{start:a-l,end:a+l}}ci(){this.q()}dt(t){return this.hi()+(t-this.$)/(this.X-this.$)*(this.ri()-this.hi())}ct(t){return this.$+(t-this.hi())/(this.ri()-this.hi())*(this.X-this.$)}K(t,e){return super.K(t,e),this.q(),this}ei(t){return super.ei(t),this.q(),this}tt(t){return super.tt(t),this.Mi=Li(this.X-this.$,this.jt,this.j,this.Jt,this.Kt),this.q(),this}_i(){return this.vi=!0,this}wi(){return this.vi}Ci(){return Math.abs(this.ki)}Ti(){return this.Ci()/this.Mi}Fi(){return this.Ii}Pi(){return this.Di}getPixelSize(){return this.Mi}Si(){return this.fi}J(){return super.J(),this.xi=!0,this}Z(){return super.Z(),this.xi=!1,this}Bi(t,e=Ii.Numeric){return e(t,this)}Li(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Ri(t){return Li(t,this.jt,this.j,this.Jt,this.Kt)}q(){let t=this.$,e=this.X,i=0;this.vi&&(t=0,e=this.X-this.$,i=this.$);const s=e-t,r=Li(s,this.jt,this.j,this.Jt,this.Kt);this.Di=t-this.jt[0]*r,this.Ii=e+this.jt[1]*r;const n=this.Ii-this.Di,o=n-this.ki,h=Math.abs(o/r),a=s-this.bi,l=Math.abs(a/r);(!this.fi||h>=.4||l>=.4)&&(this.bi=s,this.ki=n,this.Mi=r,this.xi=!0);const u=this.ki*this.Kt/(2*this.Jt),c=-(this.Di-this.ki*this.Qt/this.Jt)-u,d=2*this.hi()/this.j-1,f=2*this.ri()/this.j-1-d;this.fi={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}mi(t,e){return t+this.Mi*e}}const Li=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Pi{Ei(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}Z(){return this.x.Z(),this.y.Z(),this}J(){return this.x.J(),this.y.J(),this}tt(t,e){return"object"==typeof t?(this.x.tt(t.x),this.y.tt(t.y)):(this.x.tt(t),this.y.tt(e)),this}ai(){return u(this.x.ai(),this.y.ai())}zi(t){return this.x.ei(t),this}Vi(t){return this.y.ei(t),this}oi(){return u(this.x.oi(),this.y.oi())}Oi(t,e){return this.x.K(t,e),this}Ni(t,e){return this.y.K(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.oi(),y:e-this.y.oi()}}Gi(){return this.x.yi()||this.y.yi()}}class _i extends Pi{constructor(){super(...arguments),this.Wi="LinearScaleXY"}ut(t,e,i,s){return this.x=new Di(t.x,e.x,i.x,s?s.x:void 0),this.y=new Di(t.y,e.y,i.y,s?s.y:void 0),this}wi(){return this.x.wi()||this.y.wi()}Ui(){return u(this.x.getPixelSize(),this.y.getPixelSize())}Si(){return{x:this.x.Si(),y:this.y.Si()}}mi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Yi(t,e,i,s){const r=this.Ui(),n=si(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Vi extends Pi{constructor(){super(...arguments),this.Wi="MixedScaleXY"}wi(){return!1}mi(t,e){const i=this.x.dt(t.x),s=this.y.dt(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ct(r.x),y:this.y.ct(r.y)}}Yi(t,e,i,s){const r={x:this.x.dt(t.x),y:this.y.dt(t.y)},n={x:this.x.dt(e.x),y:this.y.dt(e.y)},o=ii(hi(n,r)),h=si(n,r),a={x:r.x+o.x*s+h.x*i,y:r.y+o.y*s+h.y*i};return{x:this.x.ct(a.x),y:this.y.ct(a.y)}}Si(){const t=this.x.Si(),e=this.y.Si();return{uScaleStart:[this.x.$,this.y.$],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 Bi=(t,e)=>t instanceof Mi||e instanceof Mi?(new Vi).Ei(t,e):(new _i).Ei(t,e),zi=t=>"client"===t,Ni=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Oi=t=>"relative"===t,Ui=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Gi;e.HighlightModes=void 0,(Gi=e.HighlightModes||(e.HighlightModes={}))[Gi.noHighlighting=0]="noHighlighting",Gi[Gi.onHover=1]="onHover";class Yi{constructor(t,i,s,n){this.Hi=!0,this.$i=e.HighlightModes.onHover,this.Xi=!1,this.ji=!0,this.Zi=!1,this.L=new r.Eventer,this.Qi=[],this.Ji=[],this.onMouseEnter=t=>this.L.on("mouseEnter",t),this.onMouseLeave=t=>this.L.on("mouseLeave",t),this.onMouseClick=t=>this.L.on("mouseClick",t),this.onMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onMouseDown=t=>this.L.on("mouseDown",t),this.onMouseUp=t=>this.L.on("mouseUp",t),this.onMouseMove=t=>this.L.on("mouseMove",t),this.offMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offMouseClick=t=>this.L.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.L.off(t,"mouseDown"),this.offMouseUp=t=>this.L.off(t,"mouseUp"),this.offMouseMove=t=>this.L.off(t,"mouseMove"),this.offMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.L.off(t,"mouseWheel"),this.Ct=(t,i,s)=>{this.L.emit("mouseEnter",this,i),this.Zi=!0,this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.kt=(t,i,s)=>{this.L.emit("mouseLeave",this,i),this.Zi=!1,this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Dt=(t,e,i)=>{this.L.emit("mouseMove",this,e)},this.Tt=(t,e,i)=>this.L.emit("mouseClick",this,e),this.Ft=(t,e,i)=>this.L.emit("mouseDoubleClick",this,e),this.It=(t,e,i)=>this.L.emit("mouseDown",this,e),this.Pt=(t,e,i)=>this.L.emit("mouseUp",this,e),this.Lt=(t,e,i,s)=>{this.L.emit("mouseDragStart",this,e,i)},this.Bt=(t,e,i,s,r,n)=>{this.L.emit("mouseDrag",this,e,i,s,r)},this.Rt=(t,e,i,s,r)=>{this.L.emit("mouseDragStop",this,e,i,s)},this.Et=(t,e,i)=>{this.L.emit("mouseWheel",this,e)},this.zt=(t,i,s)=>{this.L.emit("touchStart",this,i),this.Zi=!0,this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.L.emit("touchMove",this,e)},this.Ot=(t,i,s)=>{this.L.emit("touchEnd",this,i),this.Zi=!1,this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ki=t,this.qi=i,this.ts=s,this.ss=new Map,this.es=n,this.hs=this.es.rs(this,{ns:{themeEffectEnabled:this.ts.effectsText},os:{}}),this.Ki.cs.us.ls(this,(t=>{this.ss.forEach(((e,i)=>i.ds(t))),this.Ji.forEach((e=>e.setHighlight(t))),this.Qi.forEach((e=>e.ds(t)))}),{animationEnabled:this.Ki.getAnimationsEnabled()})}fs(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.ss.set(t,{isText:s});const r=Array.from(this.ss);this.hs.ns.As(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.hs.os.As(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Hi).setVisible(this.ji).ds(this.Ki.cs.us.gs(this,!0)),i&&t.setMouseEnterEventHandler(this.Ct).setMouseLeaveEventHandler(this.kt).setMouseClickEventHandler(this.Tt).setMouseDoubleClickEventHandler(this.Ft).setMouseDownEventHandler(this.It).setMouseUpEventHandler(this.Pt).setMouseMoveEventHandler(this.Dt).setMouseDragStartEventHandler(this.Lt).setMouseDragEventHandler(this.Bt).setMouseDragStopEventHandler(this.Rt).setMouseWheelEventHandler(this.Et).setTouchStartEventHandler(this.zt).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.Ot);const n=t.onDispose((()=>{t.offDispose(n),this.ss.delete(t)}))}ps(t){this.Qi=t;const e=this.Ki.cs.us.gs(this,!0);t.forEach((t=>{t.ds(e).ys(this.ji)}))}setEffect(t){return this.hs.ns.Ss(t&&this.ts.effectsText),this.hs.os.Ss(t),this.Ki.cs.vs(),this}getEffect(){return this.hs.ns.xs()||this.hs.os.xs()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setIcon(t){return this.bs=t,this.Ki.cs.vs(),this}getIcon(){return this.bs}setName(t){return this.Ms=t,this.Ji.forEach((t=>t.setText(this.Ms))),this}getName(){return this.Ms}dispose(){return this.Xi||(this.Xi=!0,this.ss.forEach(((t,e)=>e.dispose())),this.qi(this),this.Ji.forEach((t=>{t.dispose()})),this.Ji.length=0,this.L.emit("dispose",this),this.Ki.cs.vs()),this}setVisible(t){return t===this.ji||(this.ji=t,this.ss.forEach(((e,i)=>i.setVisible(t))),this.Qi.forEach((e=>e.ys(t))),this.Ji.forEach((e=>e.setOn(t))),this.L.emit("visibleStateChanged",this,this.ji),this.Ki.cs.vs()),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}setHighlight(t){return this.Ki.cs.us._s(this,t),this.L.emit("highlight",this,t),this}getHighlight(){return this.Ki.cs.us.gs(this)}setAnimationHighlight(t){return this.Ki.cs.us.ws(this,t),this}getAnimationHighlight(){return this.Ki.cs.us.Cs(this)}setMouseInteractions(t){return this.Hi=t,this.ss.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ki.cs.vs(),this}getMouseInteractions(){return this.Hi}getIsUnderMouse(){return this.Zi}setHighlightOnHover(t){return this.$i=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.$i!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return ve(t,[this],{toggleVisibilityOnClick:e,label:this.Ms,style:void 0}),this.Ji.push(t),t.onDispose((()=>{const e=this.Ji.indexOf(t);e>=0&&this.Ji.splice(e,1)})),this}ks(){return this.bs}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}offDispose(t){return this.L.off(t,"dispose")}}class Hi extends Yi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ts=t,this.axis=s,this.ft=r,this.Fs=n,this.Is()}}const Xi=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let r=0;r{const e=t.length,i=new Array(e).fill(!1),s=(s,r)=>{for(let n=0;n=this.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)}}},$i=class{constructor(t,e,i,s=1,r=100){this.zs=t,this.Vs=e,this.Os=i,this.Ns=s,this.Gs=r}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=Xi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Qi{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*Rs,this.Qs=e.columns*Is}}var ts,es;e.OnScreenMenuButtonType=void 0,(ts=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[ts.ZoomIn=0]="ZoomIn",ts[ts.ZoomInX=1]="ZoomInX",ts[ts.ZoomInY=2]="ZoomInY",ts[ts.ZoomOut=3]="ZoomOut",ts[ts.ZoomOutX=4]="ZoomOutX",ts[ts.ZoomOutY=5]="ZoomOutY",ts[ts.ZoomToFit=6]="ZoomToFit",ts[ts.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(es=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[es.Circle=0]="Circle",es[es.Rectangle=1]="Rectangle",es[es.RoundedRectangle=2]="RoundedRectangle";const is={x:-43,y:0},ss={x:-65,y:0},rs={x:-86,y:0},ns={x:-107,y:-1},os={x:-128,y:-3},hs={x:-150,y:0},as={x:-171,y:0},ls={x:-276,y:0},us={x:-298,y:0},cs={x:0,y:0},ds={x:-21,y:0};class fs extends Qi{constructor(t,e,i,s){super(t,i),this.Js=bt.document.createElement("button"),this.Ks=bt.document.createElement("div"),this.qs=bt.document.createElement("label"),this.js=i,this.te=e,this.Ki=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const r=bt.document.createElement("div");this.ne(r),this.Js.onclick=this.onClick.bind(this),r.appendChild(this.Ks),r.appendChild(this.qs),this.Js.appendChild(r)}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||Fs,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}/${Ds})`,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 gs extends fs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ki=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}/${Ds})`,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 ms extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:-1,y:-1})}}class ys extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:-1,y:0})}}class ps extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),hs)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:0,y:-1})}}class xs extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:1,y:1})}}class Ss extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:1,y:0})}}class As extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),as)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:0,y:1})}}class vs extends gs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.le=ls,this.ue=us,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ki.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ki.setAnimationsEnabled(!0)}}class bs extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){this.Ki.forEachAxis((t=>{t.fit(!0)}))}}class Ms extends fs{constructor(t,e,i){super(t,e.shape||Ls,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),r=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),n=e.icon||"",o=e.label||"",h=e.opacity||"";this.ie(r,n,o,h),this.ye=e.action}onClick(){this.ye(this.Ki)}}class Es extends gs{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ki=i,this.Se=s,this.le=ds,this.ue=cs,this.ie(Ps,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Ps,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 ws;e.MouseStyles=void 0,(ws=e.MouseStyles||(e.MouseStyles={})).Move="move",ws.ResizeColumn="col-resize",ws.ResizeRow="row-resize",ws.Horizontal="ew-resize",ws.Vertical="ns-resize",ws.NorthWest="nw-resize",ws.NorthEast="ne-resize",ws.Copy="copy",ws.CrossHair="crosshair",ws.Default="default",ws.Help="help",ws.Restricted="not-allowed",ws.None="none",ws.Point="pointer",ws.Text="text",ws.Wait="wait",ws.ZoomIn="zoom-in",ws.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)},ks=new G({color:E(255,255,255,0)}),Cs=new Ji({thickness:1,fillStyle:ks}),Rs=60,Is=60,Fs="1.0",Ds="osm/osm-sprite-transparent.png",Ls=e.OnScreenMenuButtonShape.Circle,Ps="#363636";var _s;e.OSMPosition=void 0,(_s=e.OSMPosition||(e.OSMPosition={}))[_s.TopRight=0]="TopRight",_s[_s.TopLeft=1]="TopLeft",_s[_s.BottomLeft=2]="BottomLeft",_s[_s.BottomRight=3]="BottomRight";class Vs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Ms="Band",this.ve=0,this.xe=0,this.be=this.ts.bandFillStyle,this.Me=this.ts.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.ft).ke(this.be).Ce(this.Me).ds(this.getHighlight()),this.fs(this.we)}setValueStart(t){return this.ve=t,this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs(),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.vs(),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.vs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.ft).getInnerStart())).tt(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.ft).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.ds(e),this.Ts.vs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const r=dt(this.Ts.cs.De(s.x,s.y),this.Ts.cs.ft,this.ft),n=this.Fs.getWidth(r),o=this.axis.ft.dt(this.ve),h=this.axis.ft.dt(this.xe),a=(this.axis.ft.dt(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this._e)return;const h=this.Fs.getWidth(n);t?(this.ve=this.axis.ft.mi(this.ve,h),this.xe=this.axis.ft.mi(this.xe,h)):i?this.ve=this.axis.ft.mi(this.ve,h):this.xe=this.axis.ft.mi(this.xe,h),Zt(o),this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs()};this.onMouseMove(((i,r)=>{if(!this._e)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ki.engine.setMouseStyle(n,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ki.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this._e&&0===i&&r(0,0,0,n,e)}));const n=Wi(new $i(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Bs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Ms="Constant Line",this.S=0,this.Me=this.ts.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.ze(this.ft).Ee(this.Me).ds(this.getHighlight()),this.fs(this.Re)}setValue(t){return this.S=t,this.L.emit("valueChange",this,this.S),this.Ts.vs(),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.vs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.ft).getInnerStart())).Ve(this.Fs.toVec2(this.S,this.Fs.getHeight(this.ft).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.Me}),this}Pe(t,e){t.ds(e),this.Ts.vs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.ft.mi(this.S,this.Fs.getWidth(e)),this.L.emit("valueChange",this,this.S),this.Ts.vs(),Zt(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ki.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ki.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this._e&&this.Le&&0===s&&t(i,n)}));const i=Wi(new $i(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const zs={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?zs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:zs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?zs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,Us=t=>void 0!==t.Ge,Gs={We:Ii.Numeric},Ys=(t,e)=>[t,e],Hs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Ct(t,0)&&(t=0),Ct(e,0)&&(e=0);const n=[];let o=void 0!==s?((t,e,i)=>t-(t-i)%e)(t,i,s):t;if(i<=0)throw new Error(`_getRegularGreatKeyValues unit less than or equal to 0, unit: ${i}`);for(;o{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r},js=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,r,n,o,h,a)=>{if(r>=i)return;const l=e[r]||1;let u=!1,c=!1,d=1;return t&&(u="ignore"in t?"first"===t.ignore||"both"===t.ignore:u,c="ignore"in t?"last"===t.ignore||"both"===t.ignore:c,d="offset"in t&&void 0!==t.offset?t.offset:d),((t,e,i,s,r)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+r)%e==0))))(s,l,u,c,d)}},$s=(...t)=>{const e=t.length>0?t.length:0;return(i,s,r,n,o,h)=>{if(s>=e)return;const a=t[s]||1;return i.filter(((t,e)=>e%a==0))}},Zs=(t,e)=>{if(e.has(t))return e.get(t);const i=Ze(t.Ye.Ue());if(pe(i))return i;const s=t.He.mi(i.min,{x:-5,y:-5}),r=t.He.mi(i.min,{x:5,y:5}),n=t.He.mi(i.max,{x:-5,y:-5}),o=t.He.mi(i.max,{x:5,y:5}),h={min:{x:Math.min(s.x,r.x,n.x,o.x),y:Math.min(s.y,r.y,n.y,o.y)},max:{x:Math.max(s.x,r.x,n.x,o.x),y:Math.max(s.y,r.y,n.y,o.y)}};return e.set(t,h),h},Ks=t=>{const e=new Map;if(t!==Gs){for(const i of t.$e)e.set(i,new Map);for(const i of t.Xe)e.set(i,new Map)}return e};class Js{constructor(t,e,i,s,n,o,h){this.L=new r.Eventer,this.je=Gs,this.Ze=Ns.Empty,this.Qe=new Map,this.Je=new Map,this.Ke=zs.fitting,this.qe=!0,this.th=K((()=>this.chart.cs.vs()))(300,$.linear),this.ih=!0,this.ji=!0,this.sh=!1,this.eh=Pe,this.hh=!1,this.rh=!1,this.oh=Pe,this.ah=Pe,this.lh=Pe,this.uh=!1,this.dh=()=>{this.sh||void 0===this.Ke||this.chart.cs.vs(!0)},this.fh={},this.Ah=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Qe.get(e),l=(t?t.get(a):void 0)||this.gh(a,e);l.ph=!1;const u=this.mh(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.yh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.xh!==i||!!t.find((t=>t===e)))).map((t=>ze(e,Zs(t,a))?t:void 0)),m=p.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Os(t.xh)))&&(t=!1),t&&i.bh&&i.bh.Mh&&!1===i.bh.Mh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.je.We(t,this.ft),this._h=!0,this.wh=!0,this.chart=t,this.Ch=e,this.ts=s,this.kh=o,this.ft=i,this.Th=h,"logarithmic"===h.type&&this.setAnimationZoom($.logarithmic(wi(h.base))),this.Fh=o.numeric,this.Ih("Numeric"),this.Ph=i.getInnerStart(),this.Dh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setDefaultInterval(t,e){return this.Bh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.uh=!0,this.chart.cs.vs()),this}getDefaultInterval(){return this.Bh}getTitle(){return this.Rh.Lh()}setTitle(t){return this.Rh.Eh(t),this.chart.cs.vs(),this}getTitleFillStyle(){return this.Rh.zh()}setIntervalRestrictions(t){return this.Vh=t,this.chart.cs.vs(),this}getIntervalRestrictions(){return this.Vh}setTitleFillStyle(t){return this.Rh.ke(t),this.chart.cs.vs(),this}getTitleFont(){return this.Rh.Oh()}setTitleFont(t){return this.Rh.Nh(t),this.chart.cs.vs(),this}setTitleRotation(t){return this.Rh.Gh(t),this.chart.cs.vs(),this}getTitleRotation(){return this.Rh.Wh()}setTitleEffect(t){return this.Uh.Ss(t),this.chart.cs.vs(),this}getTitleEffect(){return this.Uh.xs()}Ih(t,e){if(this.Qe.size>0&&this.Yh(),"Empty"===t)this.je=Gs,this.Ze=t;else if("Numeric"===t){"Numeric"!==this.Ze&&(this.Fh=this.kh.numeric);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}else if("DateTime"===t){"DateTime"!==this.Ze&&(this.Fh=this.kh.datetime);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}else if("Time"===t){"Time"!==this.Ze&&(this.Fh=this.kh.time);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}return this.Je.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Je=Ks(this.je),this.chart.cs.vs(),this}$h(){return this.je}Xh(t){this.je=t,this.Je.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Je=Ks(this.je),this.chart.cs.vs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.vt(void 0!==e?e:this.Ph,void 0!==i?i:this.Dh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}vt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=!0,h=Math.abs(e-t);if(Math.abs(this.Dh-this.Ph),void 0!==this.je.jh&&this.je.jh>h){const i=(e+t)/2,s=this.je.jh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.je.Zh&&this.je.Zhe?-1:1);n={start:i-s,end:i+s}}const a=this.ft.ot(n.start,n.end,this.Ph,this.Dh,o);if(!1===a)return this;if(!0===a);else if(n=a,"zoomBandChart"===r)return this;let l;switch(r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return be(0,""),this}if(this.Qh&&this.Qh.finishAll(!1),this.th&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Qh||this.Qh.isOver()?this.th:this.Qh.NextAnimation.bind(this);this.Qh=e([[this.Ph,n.start],[this.Dh,n.end]],(([t,e])=>{this.Jh(t,e,o)}),t),this.Qh.onAnimationEnd((()=>{this.Qh=void 0,l&&(this.lh=bt.performance.now())})),this.Qh.onAnimationEnd((()=>this.setStopped(s)))}else this.Jh(n.start,n.end,o),this.setStopped(s),l&&(this.lh=bt.performance.now());return this}getInterval(){return{start:this.Ph,end:this.Dh}}setStopped(t){return t===this.sh||(t&&(this.Qh&&this.Qh.finishAll(!1),this.Qh=void 0),this.sh=t,this.L.emit("stoppedStateChanged",this,this.sh),this.eh=bt.performance.now(),this.chart.cs.vs()),this}getStopped(){return this.sh}onStoppedStateChanged(t){return this.L.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.L.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Kh(),s=this.Bh||ir,r="function"==typeof s?s({curStart:this.Ph,curEnd:this.Dh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.vt(void 0!==r.start?r.start:this.Ph,void 0!==r.end?r.end:this.Dh,void 0!==r.animate?r.animate:void 0===t||t,void 0!==r.stopAxisAfter?r.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.Ke=t,this.chart.cs.vs(),this}getScrollStrategy(){return this.Ke}setAnimationScroll(t){return this.qe=Boolean(t),this.chart.cs.vs(),this}setAnimationZoom(t,e=300){return this.Qh&&(this.Qh.finishAll(!1),this.Qh=void 0),this.th=t?K((()=>this.chart.cs.vs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ih=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom($.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ih}setVisible(t){const e=this.ji!==t;return this.ji=t,this.Rh.setVisible(t),this.qh((e=>{e.Ye.setVisible(t)})),e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onIntervalChange(t){return this.L.on("scaleChange",t)}offIntervalChange(t){return this.L.off(t,"scaleChange")}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}tr(t,e){const i=new Map;if(this.je===Gs||!this.ji)return this.Yh(),i;e=e||new Map;const s=this.ir(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.fh.physicalAxisSize=h;const a=Qs(this.je,r,n,this.Ph,this.Dh,h),l=[];if(this.sr(),l.push(...this.er(this.je,r,n,a,e,t,i)),this.hr(this.je,r,n,a,e,t,l,i),this.rr(),a)for(const[t,e]of this.Je){const i=a.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.fh.min=r,this.fh.max=n,this.fh.scaleInterval=o,this.fh.physicalAxisSize=h,i}nr(t){const e=t.xh.ar;t.Ye.Eh(e(t.S,this.ft)).Ds()}lr(t,e){const i=e.ur;t.Ye.ke(i.getLabelFillStyle()).Nh(i.getLabelFont()).Gh(i.getLabelRotation())}gh(t,e){const i=this.Je.get(e);let s=i.get(t);s?(i.delete(t),s.xh=e,s.ys(!0)):s=this.cr(t,e);const r=this.Qe.get(e)||new Map;return r.set(t,s),this.Qe.set(e,r),this.lr(s,e),s}mh(t,e){const i=this.dr(t,e);return this.nr(t),i}er(t,e,i,s,r,n,o){const h=[];for(const a of t.$e){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Qe.get(a),l=(t?t.get(s):void 0)||this.gh(s,a),u=this.mh(l,n),c=Zs(l,r);h.find((t=>ze(c,Zs(t,r))))&&l.Ye.setVisible(!1),l.ph=!1,o.set(l,u),h.push(l)}}return h}hr(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Xe){const t=s.get(u);if(!t)break;let c;if(void 0===a)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.bh){p=!1;break}const t=u.bh.Ar;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const y=this.yh(m.filter((t=>a.some((e=>Ct(t.S,e))))),g,u,d,n,h,e,i,r,o,l);!0!==y?t=t.concat(y):(d+=1,f=-1,t=[])}y=t,m.forEach((e=>{t.find((t=>t===e))||this.gr(e)}))}if(l=y,!p)break}}gr(t){const e=this.Qe.get(t.xh);null==e||e.delete(t.S);const i=this.Je.get(t.xh);i&&i.has(t.S)?t.dispose():i&&(t.ys(!1),i.set(t.S,t))}qh(t){for(const e of this.Qe.values())for(const i of e.values())t(i)}pr(t,e){for(const i of this.Qe.values())for(const s of i.values())e=t(e,s);return e}Yh(){this.Qe.forEach(((t,e)=>{t.forEach((t=>this.gr(t)))})),this.Qe.clear()}sr(){for(const t of this.Qe.values())for(const e of t.values())e.ph=!0}rr(){for(const t of this.Qe.values())for(const[e,i]of t.entries())i.ph&&(i.dispose(),t.delete(e))}ir(){const t=this.ft.getInnerStart()this.ft.getInnerStart()?this.ft.getInnerEnd():this.ft.getInnerStart();return m(t,e)}Sh(t,e){return!(t.ph||0===t.Ye.Lh().length||Os(e)&&!0!==e.mr)}yr(t,e){return this.je===Gs||(this.je.$e.forEach((i=>{e=t(e,i.ur)})),this.je.Xe.forEach((i=>{(t=>void 0!==t.ar)(i)&&(e=t(e,i.ur))}))),e}Kh(){let t=this.Ch.Sr();const e=this.Ch.vr();let i;if(void 0!==t&&Et(t)&&void 0!==e&&Et(e)&&("logarithmic"===this.Th.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&&Et(i.min)&&Et(i.max))return Ct(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}br(){if(!this._h)return 0;let t=0;const e=this.Ch.Mr();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this._h=t,this.chart.cs.vs(),this}_r(){var t;const e=this.hh;let i=!1;if(this.uh&&this.Bh){const t=this.Kh(),e="function"==typeof this.Bh?this.Bh({curStart:this.Ph,curEnd:this.Dh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Bh;this.setInterval(e),this.uh=!1}if(this.Ke&&!this.sh){const e=this.Kh();if(e){const s=this.Ph,r=this.Dh;let n=this.Ke.start(s,r,e.min,e.max),o=this.Ke.end(s,r,e.min,e.max);const h=null===(t=this.Ke.allowIntervalLengthChange)||void 0===t||t,a=er(this.Vh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Ct(s,n),u=!1===Ct(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.qe&&!this.wh)if(this.qe){t=!0;const e=l?this.wr(s,n):s,a=u?this.wr(r,o):r;if(!0===this.Jh(e,a,h)&&(l&&!1===Ct(e,n)||u&&!1===Ct(a,o))){this.chart.cs.vs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.rh=t>=1.4}}else t=!1;t||this.Jh(n,o,h),this.wh=!1}}}return i?(this.hh!==i&&(this.hh=i,this.oh=bt.performance.now()),this.Cr&&(clearTimeout(this.Cr),this.Cr=void 0)):!0===e&&void 0===this.Cr&&(this.rh=!1,this.Cr=setTimeout((()=>{!1!==this.hh&&(this.hh=!1,this.oh=bt.performance.now()),this.Cr=void 0,this.chart.cs.vs()}),200)),this}Jh(t,e,i){let s={start:t,end:e},r=!0;if(this.Vh){const t=this.Kh();s=er(this.Vh,t,s,{start:this.Ph,end:this.Dh},i)}const n=Math.abs(e-t),o=Math.abs(this.Dh-this.Ph);if(void 0!==this.je.jh&&this.je.jh>n){const n=(e+t)/2,h=(i?this.je.jh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.je.Zh&&this.je.Zhe?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.ft.ot(s.start,s.end,this.Ph,this.Dh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.br(),l=this.kr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.ft.ot(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Ph,this.Dh,!1),!!h&&(!0===h?this.ft.K(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.ft.K(s.start,s.end),this.Ph=s.start,this.Dh=s.end,this.L.emit("scaleChange",this,s.start,s.end),this.ah=bt.performance.now(),this.chart.cs.vs(),r)}Tr(){return this.hh}Fr(){return void 0!==this.Qh}}class qs{constructor(t,e,i,s,r=i.Dr(s).Pr(Re).Ir(Re).setMouseInteractions(!1)){this.ph=!1,this.Xi=!1,this.ss=[],this.xh=t,this.S=e,this.Br=i,this.He=s,this.Ye=r,this.ss.push(r)}ys(t){this.ss.forEach((e=>e.setVisible(t)))}dispose(){return this.Xi||(this.Xi=!0,this.ss.forEach((t=>t.dispose()))),this}}const Qs=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.$e){let t=n.Lr(e,i,s,r);t=tr(t),o.set(n,t)}let h;for(const s of t.Xe){let t;if(void 0===h)t=s.Lr(e,i,e,i);else{let r=[];const o=h.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=n/(o-1);if(void 0!==s.Rr&&s.Rr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),er=(t,e,i,s,r)=>{const n="function"==typeof t?t({curStart:s.start,curEnd:s.end,dataMin:null==e?void 0:e.min,dataMax:null==e?void 0:e.max}):t;if(!n)return i;const o={start:i.start,end:i.end};let h=Math.abs(i.end-i.start);if(void 0!==n.intervalMin&&hn.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*n.intervalMax,o.end=t+.5*Math.sign(i.end-t)*n.intervalMax}return h=Math.abs(i.end-i.start),void 0!==n.startMin&&(o.start=Math.max(o.start,n.startMin),r||Ct(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.startMax&&(o.start=Math.min(o.start,n.startMax),r||Ct(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMin&&(o.end=Math.max(o.end,n.endMin),r||Ct(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMax&&(o.end=Math.min(o.end,n.endMax),r||Ct(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},ir=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}},sr=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class rr extends sr{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 nr=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),or=new rr,hr=new class{getFillStyle(){return z}},ar=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new G,wireframeStyle:ot});class lr extends ar{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 ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),cr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new G});class dr extends cr{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 fr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),gr={Triangulated:lr,Pixelated:dr};class mr{constructor(t){this.Er=new Map,this.cs=t}ls(t,e,i){const s=i.animationEnabled;this.Er.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Er.delete(t),t.offDispose(r)}))}zr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Er.delete(t)})),t.offDispose(r)}));return{Vr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Er.set(t,r)},Or:()=>{s.forEach((t=>{this.Er.delete(t)})),s.length=0},Nr:t=>{i=t,s.forEach((t=>{this.ws(t,i)}))},Gr:()=>i}}_s(t,e){const i=this.Er.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.cs.vs())}gs(t,e=!1){const i=this.Er.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}ws(t,e){const i=this.Er.get(t);i&&(i.animationEnabled=e)}Cs(t){const e=this.Er.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Er.forEach(((i,s)=>{let r;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const n=i.curAnimationPositionMillis/s;r=i.curUnanimatedHighlightValue*Math.abs(Math.sin(n*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(r=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||r>0):r=0,i.curAnimationPositionMillis=0}else r=i.curUnanimatedHighlightValue;r!==i.curAnimatedHighlightValue&&(i.applyHighlight(r),i.curAnimatedHighlightValue=r)})),e&&this.cs.vs(!0)}}const yr=new Map,pr=(t,e)=>{const i=t.getSize(),s=t.getFamily(),r=t.getWeight(),n=t.getStyle(),o=t.getVariant(),h=`${n} ${o?"small-caps":"normal"} ${r} ${i}px ${s}`,a=`${h} ${e.toFixed(2)}`;let l=yr.get(a);return l||(l=((t,e,i,s)=>({font:t,properties:e,dpr:i,id:s}))(h,{type:"font",size:i,family:s,style:n,variant:o,weight:r},e,a),yr.set(a,l)),l};var xr,Sr;!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"}(xr||(xr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(Sr||(Sr={}));const Ar=t=>({container:t.Wr,scale:t.ft,setMouseStyle:(e,i)=>t.Ur(e,i),restoreMouseStyle:e=>t.Yr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.Hr(e,i),captureFrame:(e,i,s)=>t.$r(e,i,s),renderFrame:(e,i,s=!1)=>t.Xr(e,i,s),layout:()=>{t.jr(),t.Zr(),t.Jr.Qr(),t.vs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Kr(e,i),onRenderFrame:e=>t.qr(e),offRenderFrame:e=>t.tn(e)}),vr=[];let br;const Mr=()=>{if(void 0!==br){const t=bt.getComputedStyle(bt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));br.style.height=bt.innerHeight-e+"px",(()=>{for(let t=0;tthis.vs()),60),this.hn=u(0,0),this.rn=!1,this.nn=kt,this.an=()=>{},this.ln=[],this.un=-1,this.cn=[],this.dn=!0,this.Xi=!1,this.fn=!1,this.Zr=()=>{const{bottom:t,left:e}=this.Wr.getBoundingClientRect();return this.hn=u(Math.floor(e),Math.floor(t)),this},this.jr=()=>{this.An&&this.An()},this.Ur=(t,e)=>{if(!e){this.Wr.style.cursor=t;const e=this.un;return this.un+=1,this.cn.push([e,t]),e}return this.Yr(e),this.Ur(t)},this.Yr=t=>{const e=t?this.cn.findIndex((e=>e[0]===t)):-1;e>=0?(this.cn.splice(e,1),this.cn.length>0?this.Wr.style.cursor=this.cn[this.cn.length-1][1]:this.Wr.style.cursor="default"):(this.cn.push([0,"default"]),this.Wr.style.cursor="default")},this.gn=t=>(this.pn.M(t),this),this.mn=()=>this.pn._(),this.yn=()=>{this.nn&&this.nn(1e3/60),this.Sn(),this.vn(),this.an&&this.an()},this.xn=t=>(this.sn.set(t.bn(),t),this.sn=new Map([...this.sn.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Mn=t=>(this.sn.delete(t),this),this.Z=()=>(this.pn.o=!1,this),this.J=()=>(this.pn.o=!0,this),this._n=t=>{if(!this.dn)return;const e=this.wn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),r=this.Cn(t,{x:t.clientX,y:t.clientY});if(this.kn&&((null==r?void 0:r.entity)!==this.kn.entity||r.collectionMember!==this.kn.collectionMember)&&!this.Tn){this.kn.entity.Zi=!1;const e=this.kn.entity.Fn;e&&e(this.kn.entity,t,this.kn.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.Tn)if(r.entity.Zi){if(!i){const e=r.entity.In;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Zi=!0;const e=r.entity.Pn;e&&e(r.entity,t,r.collectionMember)}if(this.Tn){const i=this.Tn.entity.Dn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.Tn.entity,t,this.Tn.button,this.Tn.startLocation,s,this.Tn.collectionMember)}this.Bn=t,this.wn=t,this.Ln=s,this.kn=r},this.Rn=t=>{if(this.dn=!1,this.Ln=void 0,this.Bn=t,this.kn&&!this.En&&!this.Tn){this.kn.entity.Zi=!1;const e=this.kn.entity.Fn;e&&e(this.kn.entity,t,this.kn.collectionMember),this.kn=void 0}},this.zn=t=>{if(this.dn=!0,this.Bn=t,this.Tn&&t.buttons<=0){const e=this.Tn.entity.Vn;e&&e(this.Tn.entity,t,this.Tn.button,this.Tn.startLocation,this.Tn.collectionMember),this.Tn=void 0}if(this.En&&t.buttons<=0){const e=this.En.entity.On;e&&e(this.En.entity,t,this.En.collectionMember),this.En=void 0}},this.Nn=()=>this.Ln,this.Jr=t,this.ts=e.theme,this.Gn=i.Gn,this.Wn=i.Wn,this.Un=i.Un,this.Yn={Hn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${bt.location.origin}/resources`,$n:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,Xn:(()=>{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})(),jn:void 0===(null==e?void 0:e.interactable)||e.interactable,Zn:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=bt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Wr=t}else this.Wr=s;bt.addEventListener("resize",this.jr),this.ln.push((()=>{bt.removeEventListener("resize",this.jr)}))}else{if(void 0===br){const t=bt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",bt.document.body.appendChild(t),br=t,bt.addEventListener("resize",Mr)}let t=1;for(;null!==bt.document.getElementById(`chart-${t}`);)t+=1;this.Wr=bt.document.createElement("div"),this.Wr.id=`chart-${t}`,this.Wr.style.flex="1",this.Wr.style.height="100%",br.appendChild(this.Wr),Mr(),vr.push(this.jr),this.ln.push((()=>{br&&br.removeChild(this.Wr),vr.includes(this.jr)&&vr.splice(vr.indexOf(this.jr),1),0===vr.length&&br&&(bt.document.body.removeChild(br),br=void 0,bt.removeEventListener("resize",Mr))}))}if(bt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Wr&&this.jr()};this.Qn=new bt.ResizeObserver(t.bind(this)),this.Qn.observe(this.Wr)}""===this.Wr.style.position&&(this.Wr.style.position="relative"),this.Wr.style.boxSizing="content-box",this.Wr.addEventListener("fullscreenchange",this.jr),this.Wr.addEventListener("webkitfullscreenchange",this.jr);const n=e?e.maxFps:void 0;this.Jn=n?-1===n?-1:0!==n?1e3/n:0:0;const o=new Map;let h=!1;const a=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":o.set(i.pointerId,s);break;default:o.delete(i.pointerId),h=!1}switch(i.interactions=Array.from(o.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(h=!0)};this.Wr.onwheel=this.Kn(xr.wheel),this.Wr.oncontextmenu=this.Kn(xr.contextmenu),this.Wr.onclick=this.Kn(xr.click),this.Wr.ondblclick=this.Kn(xr.dbclick),this.Wr.onlostpointercapture=()=>{h=!1},this.Wr.ontouchmove=t=>{h&&t.preventDefault()},this.Wr.onpointerover=a(),this.Wr.onpointerenter=a(this.zn),this.Wr.onpointerdown=a(this.Kn(xr.mouseDown),this.qn(Sr.touchStart)),this.Wr.onpointermove=a(this._n,this.qn(Sr.touchMove)),this.Wr.onpointerup=a(this.Kn(xr.mouseUp),this.qn(Sr.touchEnd)),this.Wr.onpointercancel=a(),this.Wr.onpointerout=a(),this.Wr.onpointerleave=a(this.Rn,this.qn(Sr.touchEnd)),bt.addEventListener("scroll",this.Zr,{passive:!0}),this.pn=p(new b({r:0,g:0,b:0,a:0})),this.us=new mr(this)}io(t,e){var i,s,r,n;(null===(i=this.kn)||void 0===i?void 0:i.entity)===t.entity&&this.kn.collectionMember===t.collectionMember&&(this.kn=e),(null===(s=this.so)||void 0===s?void 0:s.entity)===t.entity&&this.so.collectionMember===t.collectionMember&&(this.so=e),(null===(r=this.En)||void 0===r?void 0:r.entity)===t.entity&&this.En.collectionMember===t.collectionMember&&(this.En={...e,event:this.En.event}),(null===(n=this.Tn)||void 0===n?void 0:n.entity)===t.entity&&this.Tn.collectionMember===t.collectionMember&&(this.Tn={...e,button:this.Tn.button,startLocation:this.Tn.startLocation})}eo(){this.fn=!0,this.nn=void 0,this.an=void 0}qr(t){return this.L.on("render",t)}tn(t){return this.L.off(t)}ho(){return this.ro}no(){return this.oo}setBackgroundFillStyle(t){return this.ao.ke(t),this}getBackgroundFillStyle(){return this.ao.zh()}setBackgroundStrokeStyle(t){return this.ao.Ce(t),this}getBackgroundStrokeStyle(){return this.ao.lo()}uo(t){return this.an=t,this}co(t){return this.nn=t,this}do(t){return this.sn.get(t)}fo(){return Array.from(this.sn.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Kn(t){return e=>this.Ao(t,e)}Ao(t,e){if(!this.dn)return;t===xr.contextmenu&&Zt(e);const i=this.De(e.clientX,e.clientY),s=this.Cn(e,{x:e.clientX,y:e.clientY});if(t===xr.mouseUp){if(this.Tn){const t=this.Tn.entity.Vn;if(t&&t(this.Tn.entity,e,this.Tn.button,this.Tn.startLocation,this.Tn.collectionMember),(null==s?void 0:s.entity)!==this.Tn.entity||s.collectionMember!==this.Tn.collectionMember){this.Tn.entity.Zi=!1;const t=this.Tn.entity.Fn;t&&t(this.Tn.entity,e,this.Tn.collectionMember)}this.Tn=void 0}if(this.En){const t=this.En.entity.getMouseInteractions()&&this.En.entity.On;t&&t(this.En.entity,e,this.En.collectionMember),this.En=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===xr.click?s.entity.po:t===xr.dbclick?s.entity.mo:t===xr.mouseDown?s.entity.yo:t===xr.wheel?s.entity.So:t===xr.contextmenu?s.entity.vo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===xr.mouseDown){this.En={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.En.event.button,i=s.entity.xo;i&&i(s.entity,e,t,s.collectionMember),this.Tn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Bn=e,this.Ln=i,this.kn=s}qn(t){return e=>this.bo(t,e)}bo(t,e){const i=e.interactions.length;if(this.Mo=e,this.so){const s=t===Sr.touchMove?this.so.entity._o:t===Sr.touchEnd?this.so.entity.wo:t===Sr.touchStart?this.so.entity.Co:void 0;s&&s(this.so.entity,e,this.so.collectionMember),t===Sr.touchEnd&&0===i&&(this.so.entity.Zi=!1,this.so=void 0)}else if(t===Sr.touchStart){for(let t=0;t{t()})),this.ln.length=0}}De(t,e){return u(t-this.hn.x,this.hn.y-e)}Hr(t,e){return u(t+this.hn.x,this.hn.y-e)}Do(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Bo(t){const e=this.Hr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const kr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x+n;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x-n;for(;lc&&l=c;)e[l].y>s&&(s=e[l].y),e[l].y({type:"verticalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y+n;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?Lr.Nearest:"nearest-x"===t?Lr.NearestX:"nearest-y"===t?Lr.NearestY:void 0;return void 0!==e?e:Lr.NearestX},_r=(t,e,i,s,r,n,o,h,a,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===Lr.Nearest)return Vr(t,e,n,o,c,d);if(i===Lr.NearestX||i===Lr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Lr.NearestX||"y"===a&&i===Lr.NearestY))return Nr(t,dt(e,o,n),a,l,c,d);if(i===Lr.NearestX)return Br(t,dt(e,o,n),h,c,d);if(i===Lr.NearestY)return zr(t,dt(e,o,n),h,c,d)}},Vr=(t,e,i,s,r,n)=>{let o,h=Number.MAX_VALUE;for(let a=r;a<=n;a+=1){const r=t[a];if(!Number.isNaN(r.x)&&!Number.isNaN(r.y)){const t=dt(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(e))return m;y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Le,s=m{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){if(i*(s?-1:1)<0&&m>r){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.L.on("dispose",t),this.offDispose=t=>this.L.off(t,"dispose"),this.cs=t,this.Oo=e,this.No=i,this.Go=Ur,Ur+=1,this.Wo=t.ts.highlightColorOffset}Uo(t){return void 0!==this.No.find((e=>e.type===t))}Yo(t,e){var i;return!!this.Uo(t)&&!0===e(null===(i=this.No.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.Xi||(this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Xi=!0,this.Oo(this),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}setVisible(t){const e=this.ji;return this.ji=t,!t&&e&&(this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Zi=!1),this}getVisible(){return this.ji}setMouseInteractions(t){const e=this.Lo._();return this.Lo.M(t),t||(e&&this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Zi=!1),this}getMouseInteractions(){return this.Lo._()}getIsUnderMouse(){return this.Zi}getIsGrabbed(){return this.Eo}setMouseMoveEventHandler(t){return this.In=t,this}setMouseEnterEventHandler(t){return this.Pn=t,this}setMouseLeaveEventHandler(t){return this.Fn=t,this}setMouseClickEventHandler(t){return this.po=t,this}setMouseDoubleClickEventHandler(t){return this.mo=t,this}setMouseDownEventHandler(t){return this.yo=t,this}setMouseUpEventHandler(t){return this.On=t,this}setMouseWheelEventHandler(t){return this.So=t,this}setMouseContextMenuEventHandler(t){return this.vo=t,this}setMouseDragEventHandler(t){return this.Dn=t,this}setMouseDragStartEventHandler(t){return this.xo=t,this}setMouseDragStopEventHandler(t){return this.Vn=t,this}setTouchStartEventHandler(t){return this.Co=t,this}setTouchMoveEventHandler(t){return this._o=t,this}setTouchEndEventHandler(t){return this.wo=t,this}Ho(t){return this.zo=t,this}$o(){return this.zo?this.zo:Yr}ds(t){return this.Vo=t,this}Xo(){return this.Vo}jo(t){return this.Wo=t,this}Zo(){return this.Wo}}const Yr=m(u(0,0),u(0,0));class Hr extends Gr{constructor(t,e,i,s){super(t,i,s),this.Qo=0,this.Ts=e,this.Ts.Jo=!0}Ko(t){return this.Qo===t||(this.Qo=t,this.Ts.Jo=!0),this}qo(){return this.Qo}}class Xr extends Hr{constructor(t,e,i,s,r){super(t,e,s,r),this.ta=!0,this.ft=i}}const Wr=(t,e,i)=>{if(i instanceof _i){const s=i.Ui(),r=ai(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.mi(u(t.min.x,t.min.y),ni(e,-1)),i.mi(u(t.max.x,t.max.y),e))},jr=(t,e)=>"function"==typeof e?e(t):e,$r=(t,e)=>!t||t!==e,Zr=t=>t!==z;class Kr extends Xr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.be=wr.fillStyle,this.cs=t}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}ia(){return $r(this.sa,this.be)}ea(){return((t,e)=>t===z&&e!==z)(this.sa,this.be)}ha(){return Zr(this.be)}ra(t){this.sa=t}}class Jr extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Me=wr.lineStyle,this.cs=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}lo(){return this.Me}na(){return!this.oa||this.oa!==this.Me}aa(t){return!this.oa||this.oa.getThickness()!==t}ha(){return this.Me!==ot||super.ha()}ea(){return(this.Me!==ot||this.be!==z)&&this.oa===ot&&this.sa===z}la(t){this.oa=t}}class qr extends Kr{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}tt(t){return this.size.M(t),this}}class Qr extends Kr{constructor(t,e,i,s,r,n=p(wr.font)){super(t,e,i,s,r),this.ua=p(""),this.ca=p(u(0,0)),this.da=p(0),this.fa=p(0),this.Aa=p(u(0,0)),this.ga=p(0),this.pa=p(or),this.ma=u(0,0),this.jt=p(x(1,1,1,1)),this.ya=p(S(4,4,4,4)),this.font=p(wr.font),this.Sa=!1,this.font=n}ha(){return Zr(this.be)&&this.ua._().length>0}ea(){return!1===this.Sa&&this.ha()}Eh(t){return this.ua.M(t),this}Lh(){return this.ua._()}Nh(t){return nr(t)?this.pa.M(t):this.pa.M(t(this.pa._())),this}Oh(){return this.pa._()}va(t){return this.pa.M(this.pa._().setFamily(t)),this}xa(){return this.pa._().getFamily()}ba(t){return this.pa.M(this.pa._().setSize(t)),this}Ma(){return this.pa._().getSize()}_a(t){return this.pa.M(this.pa._().setWeight(t)),this}wa(){return this.pa._().getWeight()}Ca(t){return this.pa.M(this.pa._().setStyle(t)),this}ka(){return this.pa._().getStyle()}Ta(t){return this.pa.M(this.pa._().setVariant(t)),this}Fa(){return this.pa._().getVariant()}Ie(t){return this.ca.M(t),this}Ia(){return this.ca._()}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}Pa(t,e){return this.Aa.M(u(t,e)),this}Da(){return this.Aa._()}Ba(t){return this.fa.M(t),this}La(){return this.fa._()}Ra(t){return this.da.M(t),this}Ea(){return this.da._()}za(t){return this.fa.M(t.x),this.da.M(t.y),this}Ir(t){return this.jt.M(t),this}Va(){return this.jt._()}Pr(t){return this.ya.M(t),this}Oa(){return this.ya._()}}class tn extends qr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Na=[],this.Ga=p(e.PointShape.Square),this.ga=p(0),this.Wa=p(!1),this.Ua=p(!1),this.Ya=p(!1),this.Ha=_e,this.$a=0,this.Xa=[],this.ja=0,this.Za=_e,this.Qa=Lr.Nearest,this.Ja=!1,this.Ka=void 0}qa(t){return this.Qa=t,this}tl(){return this.Xa}il(){return this.Na}sl(t){return this.Ga.M(t),this}el(){return this.Ga._()}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}hl(t){return this.Wa.M(t),this}rl(t){return this.Ua.M(t),this}nl(t){return this.Ya.M(t),this}ol(t,e){return Array.isArray(t)||(t=[t]),this.ja+=t.length,this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.Za&&(this.Za=e?Je(this.Za,e):void 0),this.Ka=void 0,this}Gt(){return this.Ja=!0,this.Na.length=0,this.$a=0,this.Ha=_e,this.Xa=[],this.ja=0,this.Ka=void 0,this}al(){return this.$a}ll(){return this.ja}}class en extends Jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=p(u(0,0)),this.j=p(u(100,100)),this.ga=p(0),this.ma=p(u(0,0)),this.ul=!1}Ds(){return this.cl(),this}Ie(t){const e=this.ca._();return t.x===e.x&&t.y===e.y||(this.ca.M(t),this.cl()),this}Ia(){return this.ca._()}dl(t){const e=this.ca._();return t!==e.x&&(this.ca.M(u(t,e.y)),this.cl()),this}fl(t){const e=this.ca._();return t!==e.y&&(this.ca.M(u(e.x,t)),this.cl()),this}tt(t){const e=this.j._();return t.x===e.x&&t.y===e.y||(this.j.M(u(t.x,t.y)),this.cl()),this}ai(){return this.j._()}Al(t){const e=this.j._();return t!==e.x&&(this.j.M(u(t,e.y)),this.cl()),this}pl(t){const e=this.j._();return t!==e.x&&(this.j.M(u(e.x,t)),this.cl()),this}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}ml(t){const e=this.ma._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.ul=!1,this.cl()):(this.ul=!0,this.ma.M(t))),this}cl(){if(!this.ul){const t=this.ca._(),e=this.j._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.ma._();i.x===s.x&&i.y===s.y||this.ma.M(i)}}}class sn extends Jr{constructor(){super(...arguments),this.Na=[],this.ca=p(u(0,0)),this.Ha=_e,this.yl=!1}Sl(t){return t=te(t),this.Na=t,this.yl=!0,this}vl(){return this.Na}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}}class rn extends sn{}class nn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ml=new Array,this._l=new Array,this.wl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ha=_e,this.Cl=0,this.kl=!1,this.Xa=[Array(),Array()],this.Tl=!1,this.Fl=(new G).setColor(E(42,171,240)),this.Ja=!1,this.Il=!1,this.Pl=!1}ol(t,e){const i=this.Cl-1,s=i>0&&!this.Tl;let[r,n]=s?[[this.Ml[i]],[this._l[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=ne(r,e,{canReturnB:!0}),n=ne(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Tl?(this.Xa[0]=ne(this.Xa[0],r,{canReturnB:!0}),this.Xa[1]=ne(this.Xa[1],n,{canReturnB:!0})):(this.Xa=[r,n],this.Tl=!0),this.Ha=Je(this.Ha,e||Je(Ze(r),Ze(n))),this}Gt(){return this.Ja=!0,this.Ml.length=0,this._l.length=0,this.Cl=0,this.Ha=_e,this}il(){return[this.Ml,this._l]}tl(){return[this.Xa[0],this.Xa[1]]}Dl(t){return this.wl.M(t),this}Bl(){return this.wl._()}Ll(t){return this.Fl="function"==typeof t?t(this.Fl):t,this}Rl(){return this.Fl}al(){return this.Cl-(Number(this.Il)+Number(this.Pl))}ll(){return this.Xa.length}El(t){return this.Il=t,this}zl(){return this.Il}Vl(t){return this.Pl=t,this}Ol(){return this.Pl}ea(){return this.sa===z&&this.Nl===z&&(this.be!==z||this.Fl!==z)}Gl(t){this.Nl=t}ha(){return this.Fl!==z||super.ha()}ia(){return super.ia()||!this.Nl||this.Nl!==this.Fl}}class on extends Jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=p(u(0,0)),this.Wl=p(0),this.Ii=p(360),this.Ul=p(100),this.Yl=p(100),this.Hl=p(0),this.$l=p(void 0),this.Xl=u(0,0),this.jl=u(0,0),this.Zl=u(0,0)}Ql(){return this.Ul._()}Jl(){return this.Yl._()}Ia(){return this.ca._()}Kl(){return this.Wl._()}Fi(){return this.Ii._()}ql(){return this.Hl._()}tu(){return this.$l._()}iu(){return this.Xl}su(){return this.jl}eu(){return this.Zl}Ie(t){return this.ca.M(t),this}hu(t){return this.Wl.M(t),this}Ve(t){return this.Ii.M(t),this}ru(t){return this.Yl.M(t),this.Ul.M(t),this}nu(t){return this.Ul.M(t),this}ou(t){return this.Yl.M(t),this}au(t){return this.Hl.M(t<0?0:t),this}lu(t){return this.$l.M(void 0!==t&&t<=0?void 0:t),this}}var hn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(hn||(hn={}));class an extends Xr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.uu=wr.lineStyle,this.engine=t}Ee(t){return this.uu=((t,e)=>"function"==typeof e?e(t):e)(this.uu,t),this}cu(){return this.uu}na(){return((t,e)=>!t||t!==e)(this.du,this.uu)}fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.du,t)}ea(){return((t,e)=>t===ot&&e!==ot)(this.du,this.uu)}ha(){return(t=>t!==ot&&t.getFillStyle()!==z)(this.uu)}Au(t){this.du=t}}class ln extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Di=u(0,0),this.Ii=u(0,0),this.gu=!1}M({min:t,max:e}){return t.x===this.Di.x&&t.y===this.Di.y&&e.x===this.Ii.x&&e.y===this.Ii.y||(this.gu=!0,this.Di=t,this.Ii=e),this}Pi(){return this.Di}Fi(){return this.Ii}Oe(t){return t.x===this.Di.x&&t.y===this.Di.y||(this.gu=!0,this.Di=t),this}Ve(t){return t.x===this.Ii.x&&t.y===this.Ii.y||(this.gu=!0,this.Ii=t),this}}class un extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.pu=void 0,this.mu=!1}}class cn extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.yu=[],this.Ha=_e,this.Xa=new Array,this.$a=0,this.Qa=Lr.NearestX,this.Ja=!1,this.Su=p(void 0),this.Il=!1,this.Pl=!1}vu(t){return this.Su.M(t),this}xu(){return this.Su._()}tl(){return this.Xa}il(){return this.yu}qa(t){return this.Qa=t,this}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.Ha=_e,this}al(){return this.$a-(Number(this.Il)+Number(this.Pl))}ll(){return this.Xa.length}El(t){return this.Il=t,this}zl(){return this.Il}Vl(t){return this.Pl=t,this}Ol(){return this.Pl}}const dn=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 fn{constructor(){this.ji=!0,this.L=new r.Eventer,this.bu=0,this.Ct=(t,e,i)=>{0===this.bu&&this.L.emit("mouseEnter",this,e),this.bu+=1},this.kt=(t,e,i)=>{this.bu-=1,this.bu<1&&(this.L.emit("mouseLeave",this,e),this.bu=0)},this.Tt=(t,e,i)=>{this.L.emit("mouseClick",this,e)},this.Ft=(t,e,i)=>{this.L.emit("mouseDoubleClick",this,e)},this.It=(t,e,i)=>{this.L.emit("mouseDown",this,e)},this.Pt=(t,e,i)=>{this.L.emit("mouseUp",this,e)},this.Dt=(t,e,i)=>{this.L.emit("mouseMove",this,e)},this.Lt=(t,e,i,s)=>{this.L.emit("mouseDragStart",this,e,i)},this.Bt=(t,e,i,s,r,n)=>{this.L.emit("mouseDrag",this,e,i,s,r)},this.Rt=(t,e,i,s,r)=>{this.L.emit("mouseDragStop",this,e,i,s)},this.Et=(t,e,i)=>{this.L.emit("mouseWheel",this,e)},this.zt=(t,e)=>{this.bu+=1,this.L.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.L.emit("touchMove",this,e)},this.Ot=(t,e)=>{this.bu-=1,this.L.emit("touchEnd",this,e)},this.Mu=t=>(t instanceof Xr?t.setMouseEnterEventHandler(this.Ct).setMouseLeaveEventHandler(this.kt).setMouseClickEventHandler(this.Tt).setMouseDoubleClickEventHandler(this.Ft).setMouseDownEventHandler(this.It).setMouseUpEventHandler(this.Pt).setMouseMoveEventHandler(this.Dt).setMouseDragEventHandler(this.Bt).setMouseDragStartEventHandler(this.Lt).setMouseDragStopEventHandler(this.Rt).setMouseWheelEventHandler(this.Et).setTouchStartEventHandler(this.zt).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.Ot):(t.onMouseEnter(this.Ct),t.onMouseLeave(this.kt),t.onMouseClick(this.Tt),t.onMouseDoubleClick(this.Ft),t.onMouseDown(this.It),t.onMouseUp(this.Pt),t.onMouseMove(this.Dt),t.onMouseDrag(this.Bt),t.onMouseDragStart(this.Lt),t.onMouseDragStop(this.Rt),t.onMouseWheel(this.Et),t.onTouchStart(this.zt),t.onTouchMove(this.Vt),t.onTouchEnd(this.Ot)),t)}onMouseEnter(t){return this.L.on("mouseEnter",t)}onMouseLeave(t){return this.L.on("mouseLeave",t)}onMouseClick(t){return this.L.on("mouseClick",t)}onMouseDoubleClick(t){return this.L.on("mouseDoubleClick",t)}onMouseDown(t){return this.L.on("mouseDown",t)}onMouseUp(t){return this.L.on("mouseUp",t)}onMouseMove(t){return this.L.on("mouseMove",t)}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}offMouseEnter(t){return this.L.off(t,"mouseEnter")}offMouseLeave(t){return this.L.off(t,"mouseLeave")}offMouseClick(t){return this.L.off(t,"mouseClick")}offMouseDoubleClick(t){return this.L.off(t,"mouseDoubleClick")}offMouseDown(t){return this.L.off(t,"mouseDown")}offMouseUp(t){return this.L.off(t,"mouseUp")}offMouseMove(t){return this.L.off(t,"mouseMove")}offMouseDragStart(t){return this.L.off(t,"mouseDragStart")}offMouseDrag(t){return this.L.off(t,"mouseDrag")}offMouseDragStop(t){return this.L.off(t,"mouseDragStop")}offMouseWheel(t){return this.L.off(t,"mouseWheel")}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}getIsUnderMouse(){return this.bu>0}setVisible(t){const e=this.ji!==t;return this.ji=t,e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}const gn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.mi(t.getPosition(),{x:r!==e.UIDraggingModes.onlyVertical?i.x:0,y:r!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,h=t.getSize(),a=t.getOrigin(),l=o.mi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},ai({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.mi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},ai({x:(a.x-1)/2,y:(a.y-1)/2},h)),c={x:Math.min(Math.max(n.x,l.x),u.x),y:Math.min(Math.max(n.y,l.y),u.y)};t.setPosition(c),Zt(s)}},mn=(t,e,i,s,r)=>{gn(t,r,e)},yn=(t,e,i,s,r)=>{gn(t,s,r)};class pn extends fn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.Xi=!1,this._u=void 0,this.wu=void 0,this.Cu=dn,this.ku=void 0,this.Lo=!0,this.Tu=()=>{const t="function"==typeof this.Cu?this.Cu(this):this.Cu;t&&(this.wu=this.Ts.cs.Ur(t))},this.Fu=()=>{this.Ts.cs.Yr(this.wu)},this.jt=x(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.Oo=s,this.ts=r,this.Ts.vs(),this.onMouseEnter(this.Tu),this.onMouseLeave(this.Fu),this.onMouseDrag(mn);const n=Wi(new $i(kt,yn,kt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.ts=r}setMouseInteractions(t){return this.Iu().forEach((e=>e.setMouseInteractions(t))),this.Lo=t,this}getMouseInteractions(){return this.Lo}setEffect(t){return this.hs=this.hs||this.Ts.cs.hs.rs(this,{Pu:{shapes:this.Iu()}}),this.hs.Pu.Ss(t),this}getEffect(){return!!this.hs&&this.hs.Pu.xs()}setAutoDispose(t){return this.ku=t,this.Ts.vs(),this}getAutoDispose(){return this.ku}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.jt.left+this.jt.right),this.size.y+(this.jt.bottom+this.jt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.jt="object"==typeof t?A(this.jt,t):{left:t,top:t,right:t,bottom:t},this.Ts.vs(),this}getMargin(){return this.jt}Fe(){if(this.ku){const t=this.size,e=this.renderingScale.ai(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.ku.type&&i.x>=this.ku.maxWidth||"max-height"===this.ku.type&&i.y>=this.ku.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.Xi||(this.Ts.vs(),this.Xi=!0,this.Oo(this),this.L.emit("dispose",this),this.Iu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Iu().forEach((e=>e.setVisible(t))),this.Ts.vs(),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.vs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.mi(this.position,ai({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.mi(r,ai({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.mi(r,{x:this.jt.left,y:this.jt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.mi(n,ai({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.vs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this._u=t,this.Ts.vs(),this}getDraggingMode(){return void 0!==this._u?this._u:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Cu=t,this}getMouseStyle(){return this.Cu}}class xn extends pn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.ya=x(),this.Du=0,this.Ts=t,this.Bu=s,this.backgroundElement=new this.Bu(this.Ts,this.renderingScale,this.scale,kt,n),this.Mu(this.backgroundElement)}Iu(){return this.backgroundElement.Iu()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.Xi||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.Lu(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.ya="object"==typeof t?A(this.ya,t):{left:t,top:t,right:t,bottom:t},this.Ts.vs(),this}getPadding(){return this.ya}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.ya.left+this.ya.right,i.y+this.ya.bottom+this.ya.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ru()+this.backgroundElement.Eu(),i.y+this.backgroundElement.zu()+this.backgroundElement.Vu())),i}getPosition(t=this.origin,i=e.UISpace.Everything){if(i===e.UISpace.Everything)return super.getPosition(t,i);const s=super.getPosition(u(-1,-1),e.UISpace.Everything),r=this.getMargin(),n=this.scale.mi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.mi(n,ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.mi(n,{x:this.backgroundElement.Ru(),y:this.backgroundElement.zu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.mi(o,ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.mi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.mi(a,ai({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.Du}setHighlight(t){return this.Du=Ae(t),this.backgroundElement.setHighlight(t),this.L.emit("highlight",this,t),this}}const Sn=t=>"setBackground"in t;class An extends fn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.S=0,this.Ou=1,this.Nu=!0,this.Gu=new rr,this.Wu=!0,this.Xi=!1,this.axisScale=s,this.renderingScale=r,this.Uu=o,this.Yu=h,this.Hu=a,this.Oo=l,this.$u=e,this.Xu=i,this.ju=this.Mu(this.$u.ze(this.renderingScale)),this.ts=u,this.Zu=this.Mu(this.Hu.Qu(this.Xu,this.renderingScale,n,kt,this.ts,!1).setOrigin(jt(this.Yu)).setDirection(this.Yu)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Zu.Ju?this.ju.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Zu.Ju?this.ju.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Zu.Ju&&this.ju.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.Xu.vs(),this.L.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.Ku=t,this.Xu.vs(),this}setTickLength(t){return this.Zu.setPointerLength(t),this.$u.vs(),this}getTickLength(){return this.Zu.getPointerLength()}setTickLabelPadding(t){return this.Zu.setTickLabelPadding(t),this.$u.vs(),this}setTickLabelRotation(t){return this.Zu.setTextRotation(t),this.$u.vs(),this}getTickLabelRotation(){return this.Zu.getTextRotation()}getTickLabelPadding(){return this.Zu.getTickLabelPadding()}setGridStrokeLength(t){return this.Ou=t,this.$u.vs(),this}getGridStrokeLength(){return this.Ou}setGridStrokeStyle(t){return this.ju.Ee(t),this.$u.vs(),this}getGridStrokeStyle(){return this.ju.cu()}dispose(){return this.Xi||(this.Xi=!0,this.ju.dispose(),this.Zu.dispose(),this.Oo(this),this.$u.cs.vs(),this.L.emit("dispose",this)),this}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setMarkerVisible(t){return this.Nu=t,this.Xu.vs(),this}getMarkerVisible(){return this.Nu}setMarker(t){return t(this.Zu),this.Xu.vs(),this}getMarker(){return this.Zu}setMouseInteractions(t){return this.Zu.setMouseInteractions(t),this.ju.setMouseInteractions(t),this}getMouseInteractions(){return this.ju.getMouseInteractions()}setAllocatesAxisSpace(t){return this.Wu=t,this.Xu.vs(),this}getAllocatesAxisSpace(){return this.Wu}isInScale(){return He(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}}class vn extends An{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,u,a,l),this.qu=!1,this.Oo=a,this.$u=e,this.Xu=i}dispose(){return this.qu=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.qu=!1;const t=ct(this.S,this.axisScale,this.Uu.getWidth(this.renderingScale));this.ju.setVisible(!0).Oe(this.Uu.toPoint(t,e)).Ve(this.Uu.toPoint(t,e-(s+i*this.Ou))),this.Nu?(this.Ku&&this.Zu.setText(this.Ku(this.S,this)),this.Zu.setVisible(!0).setPosition(this.Uu.toPoint(t,r))):this.Zu.setVisible(!1)}else this.ju.setVisible(!1),this.Zu.setVisible(!1);return this.Zu.Ds().Fe(),this}tc(){const t=this.Zu.Ds().getSize();return this.Uu.getHeight(t)}}const bn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Mn=(t,e)=>(le(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),En=(t,e,i)=>{i&&Sn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},wn={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}},Tn={background:void 0,setBackground(t){return{...this,background:t}}},kn={Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return En(o,r,n),o}},Cn={Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return En(o,r,n),o}};class Rn extends pn{constructor(){super(...arguments),this.ic=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.ic=t,this}getMouseInteractions(){return this.ic}Iu(){return[]}}class In extends Rn{onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}Lu(t){return this.size=t,this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return z}setStrokeStyle(){return this}getStrokeStyle(){return ot}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Fn extends pn{constructor(){super(...arguments),this.L=new r.Eventer,this.Du=0}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}getHighlight(){return this.Du}setHighlight(t){return this.Du=t,this.Iu().forEach((e=>e.ds(t))),this.L.emit("highlight",this,t),this.Ts.vs(),this}}class Dn extends Fn{}class Ln extends Dn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ts=t,this.Ga=this.Ts.sc(this.renderingScale,hn.Simple).setVisible(!1).ke(z).Ce(ot),this.Mu(this.Ga)}hc(){const t=this.rc();if(t.length>2){const e=Ze(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=oi(t,ni(e.min,-1));return this.scale.mi(this.position,oi(s,ai(ni(oi(this.origin,u(1,1)),-.5),i)))})).map((t=>dt(t,this.scale,this.renderingScale)));this.Ga.Sl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Ga&&this.Ga.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.Xi||this.hc(),this}Ds(){return this.hc(),super.Ds()}setVisible(t){return super.setVisible(t),this.Ga.setVisible(t),this}}const Pn=(t,e,i)=>t*(1-i)+e*i,_n=(t,e,i,s,r)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===r.value)return;const n=(t.x-i.point.x)/(r.point.x-i.point.x),o=(r.point.y-i.point.y)*n+i.point.y,h=(t.x-e.point.x)/(s.point.x-e.point.x),a=(s.point.y-e.point.y)*h+e.point.y,l=(t.y-a)/(o-a),u=Pn(i.value,r.value,n),c=Pn(e.value,s.value,h);return Pn(c,u,l)},Vn={warm:t=>e=>T(60/(t-1)*e,.8,.8),cold:t=>e=>T(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>T(360/t*e,.8,.8),reverseSpectrum:t=>e=>T(360/t*(t-e),.8,.8),flatUI:t=>e=>T(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return T(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return T(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return T(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return T(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return T(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>T(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return T(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return T(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),T(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return T(0,0,s);const r=e.getR()/255,n=e.getG()/255,o=e.getB()/255,h=Math.max(r,n,o),a=Math.min(r,n,o);let l=0;if(h!==a){const t=h-a;switch(h){case r:l=(n-o)/t+(nr=>n=>T(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Bn([{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=>Bn([{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=>Bn([{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=>Bn([{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=>Bn([{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=>Bn([{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)},Bn=(t,e,i)=>{const s=Nn(e,i),[r,n]=On(s,t),o=zn(t[r]),h=zn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Pn(o.h,h.h,a),s:Pn(o.s,h.s,a),v:Pn(o.v,h.v,a)};return T(l.h,l.s,l.v)},zn=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,r=Math.max(e,i,s),n=Math.min(e,i,s);let o=0;const h=r,a=r-n,l=0===r?0:a/r;if(r===n)o=0;else{switch(r){case e:o=(i-s)/a+(i{const i=e/t;return i<0?0:i>1?1:i},On=(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),Kn={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},Jn=s.Record({type:"linestyle",lineType:"dashed",pattern:Kn.DashedEqual,fillStyle:new G({color:E(255,255,255)}),thickness:1,patternScale:3});class qn extends Jn{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")}O(){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 Qn=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),to=s.Record({type:"icon",width:void 0,height:void 0,nc:void 0,oc:kt,ac:kt});class eo extends to{constructor(t,e,i,s){super({...s,nc:t,oc:e,ac:i})}dispose(){return this.ac(this),this}setWidth(t){const e=this.set("width",t);return this.oc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.oc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.oc(i),i}ai(){if(!this.nc)return{x:0,y:0};const t=this.nc.width,e=this.nc.height;if(0===t||0===e)return{x:0,y:0};const i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const io=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),so=s.Record({type:"glow",color:E(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class ro extends so{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 no{constructor(t){this.lc=0,this.uc=0,this.cc=0,this.dc=!1,this.fc=!0,this.Ac=!1,this.gc={warningDisplayed:!1,expandEvents:[]},this.L=new r.Eventer,this.fc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.mc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.yc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Sc=void 0!==(null==t?void 0:t.colors)&&t.colors,this.vc=void 0!==(null==t?void 0:t.ids)&&t.ids,this.xc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.bc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.Mc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this._c=!1!==(null==t?void 0:t.allowInputModification)}add(t){return Array.isArray(t)?this.appendJSON(t,{x:"x",y:"y"}):this.appendSample(t),this}addArraysXY(t,e){return this.appendSamples({xValues:t,yValues:e}),this}appendJSON(t,e={x:"x",y:"y"}){const i=t.length,s=e.x,r=e.y,n=e.lookupValue,o=e.size,h=e.rotation,a=e.color,l=e.id;let u,c,d,f,g,m,y;if(s){u=new this.Mc(i);for(let e=0;ea-1&&(this.lc=0,this.dc=!0),this.uc=Math.min(this.uc+1,a),this.cc+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:r,rotations:n,start:o,step:h}=t;let a=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(a=void 0!==a?a:0,l=void 0!==l?l:c-a,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:a,f=void 0!==t.offsetColors?t.offsetColors:a,g=void 0!==t.offsetIds?t.offsetIds:a,m=void 0!==t.offsetSizes?t.offsetSizes:a,y=void 0!==t.offsetRotations?t.offsetRotations:a,[p,x]=this.Bc(l,t.xValues,"x",o,h,a),[S,A]=this.Bc(l,t.yValues,"y",o,h,a),v=this.Pc(i),{samplesCacheX:b,samplesCacheY:M,samplesCacheLookup:E,samplesCacheColors:w,samplesCacheIDs:T,samplesCacheSize:k,samplesCacheRotation:C,maxSampleCount:R,dataPattern:I,incomingDataReplacedCache:F}=this.wc({appendCount:l,...0===x&&0===A&&0===a&&0===d&&0===f&&0===g&&0===m&&0===y?{incomingDataX:p,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:v,incomingDataSize:r,incomingDataRotation:n}:{}});if(!F&&I&&this.fc&&this.kc&&this.Tc){const t=p[x],i=S[A];if(!this.Fc(I,t,i)&&!this.Ac)return this.Ic(this.kc,this.Tc,co(p,x,x+l),co(S,A,A+l),co(e,d,d+l),co(v,f,f+l),co(s,g,g+l),co(r,m,m+l),co(n,y,y+l),I),this}const D=R-this.lc,L=Math.min(l,D);if(L>0&&(F||(lo(b,p,x,L,this.lc),lo(M,S,A,L,this.lc),e&&E&&lo(E,e,d,L,this.lc),s&&T&&lo(T,s,g,L,this.lc),v&&w&&lo(w,v,f,L,this.lc),r&&k&&lo(k,r,m,L,this.lc),n&&C&&lo(C,n,y,L,this.lc)),this.Dc(this.lc,this.lc+L-1),this.lc+=L,this.lc>R-1&&(this.lc=0,this.dc=!0)),this.uc=Math.min(this.uc+L,R),this.cc+=L,this.Lc(),l-L>0){const t={xValues:p?co(p,x+L,void 0):void 0,yValues:S?co(S,A+L,void 0):void 0,lookupValues:e?co(e,d+L,void 0):void 0,ids:s?co(s,g+L,void 0):void 0,colors:v?co(v,f+L,void 0):void 0,sizes:r?co(r,m+L,void 0):void 0,rotations:n?co(n,y+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.kc||this.Tc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.kc=this.kc||new this.Mc(i),this.kc.fill(t.x)),void 0!==t.y&&(this.Tc=this.Tc||new this.Mc(i),this.Tc.fill(t.y)),void 0!==t.lookupValue&&(this.Rc=this.Rc||new Float32Array(i),this.Rc.fill(t.lookupValue)),void 0!==t.color){const e=this.Pc([t.color]);e&&(this.Ec=this.Ec||new Uint32Array(i),this.Ec.fill(e[0]))}return void 0!==t.size&&(this.zc=this.zc||new Float32Array(i),this.zc.fill(t.size)),void 0!==t.rotation&&(this.Vc=this.Vc||new Float32Array(i),this.Vc.fill(t.rotation)),this.L.emit("cleared"),this}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a}=e;let l=e.offset,u=e.count;const c=i||s||r||n||o||h||a;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,y=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,x=this.Pc(n),S=this.cc-1,A=void 0!==this.Oc?Math.max(this.cc-this.Oc,0):0,v=t+u-1,b=Math.max(t,A),M=Math.min(v,S),E=M-b+1;if(this.cc>0&&E>0){const{samplesCacheX:e,samplesCacheY:n,samplesCacheColors:u,samplesCacheIDs:c,samplesCacheLookup:d,samplesCacheSize:S,samplesCacheRotation:v}=this.wc({appendCount:0}),w=e.length;if(void 0!==this.Oc&&this.dc&&this.cc%this.Oc!=0){const A=this.cc-this.cc%this.Oc,E=this.cc-1,T=this.cc-this.uc,k=A-1,C=Math.max(b,T),R=Math.min(M,k)-C+1;if(R>0){const A=C-t,b=oo(C,this.cc,w,this.lc);i&&lo(e,i,l+A,R,b),s&&lo(n,s,l+A,R,b),r&&d&&lo(d,r,f+A,R,b),o&&c&&lo(c,o,m+A,R,b),x&&u&&lo(u,x,g+A,R,b),h&&S&&lo(S,h,y+A,R,b),a&&v&&lo(v,a,p+A,R,b)}const I=Math.max(b,A),F=Math.min(M,E)-I+1;if(F>0){const A=I-t,b=oo(I,this.cc,w,this.lc);i&&lo(e,i,l+A,F,b),s&&lo(n,s,l+A,F,b),r&&d&&lo(d,r,f+A,F,b),o&&c&&lo(c,o,m+A,F,b),x&&u&&lo(u,x,g+A,F,b),h&&S&&lo(S,h,y+A,F,b),a&&v&&lo(v,a,p+A,F,b)}}else{const t=b-A;i&&lo(e,i,l,E,t),s&&lo(n,s,l,E,t),r&&d&&lo(d,r,f,E,t),o&&c&&lo(c,o,m,E,t),x&&u&&lo(u,x,g,E,t),h&&S&&lo(S,h,y,E,t),a&&v&&lo(v,a,p,E,t)}this.L.emit("cleared")}const w=t+u-1-S;if(w>0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:y+e,offsetRotations:p+e,count:w})}return this}alterSamplesByID(t,e){if(!this.vc)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Nc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Pc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.Mc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.Mc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Pc(e.colors),l=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,u=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,c=s.length,d=this.uc,f=this.cc-1,g=Math.max(f-d+1,0);for(let d=0;ds[oo(t,this.cc,c,this.lc)])),y=oo(m,this.cc,c,this.lc);s[y]===i&&(void 0!==e.x&&this.kc&&(this.kc[y]=e.x),void 0!==e.y&&this.Tc&&(this.Tc[y]=e.y),void 0!==e.lookupValue&&this.Rc&&(this.Rc[y]=e.lookupValue),void 0!==e.size&&this.zc&&(this.zc[y]=e.size),void 0!==e.rotation&&this.Vc&&(this.Vc[y]=e.rotation),void 0!==r&&this.Ec&&(this.Ec[y]=r),n&&this.kc&&(this.kc[y]=n[d]),o&&this.Tc&&(this.Tc[y]=o[d]),h&&this.Rc&&(this.Rc[y]=h[d]),a&&this.Ec&&(this.Ec[y]=a[d]),l&&this.zc&&(this.zc[y]=l[d]),u&&this.Vc&&(this.Vc[y]=u[d]))}return this.L.emit("cleared"),this}clear(){return this.lc=0,this.uc=0,this.cc=0,this.dc=!1,this.L.emit("cleared"),this}getSampleCount(){return this.uc}getNextSampleIndex(){return this.cc}setMaxSampleCount(t){if("object"==typeof t){this.Gc&&this.offMaxSampleCountExceeded(this.Gc);const e=t.max;this.Gc=this.onMaxSampleCountExceeded(((t,i,s,r)=>{if(void 0!==e&&s>=e)return;let n=2*s;void 0!==e&&(n=Math.min(n,e)),this.setMaxSampleCount(n)})),void 0===this.Oc&&this.setMaxSampleCount(1e5)}else if("number"==typeof t){const e=t;if(void 0!==this.Oc&&this.Oc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.kc||!this.Tc)return this.Oc=e,this;if(e===this.Oc)return this;if(this.dc&&0!==this.lc)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.Oc=e,this.uct+e.count),0),r=new this.Mc(s),n=new this.Mc(s),o=this.Sc?new Uint32Array(s):void 0,h=this.yc?new Float32Array(s):void 0,a=this.vc?new Uint32Array(s):void 0,l=this.xc?new Float32Array(s):void 0,u=this.bc?new Float32Array(s):void 0;let c=0;for(const t of i)r.set(this.kc.subarray(t.offset,t.offset+t.count),c),n.set(this.Tc.subarray(t.offset,t.offset+t.count),c),this.Sc&&o&&this.Ec&&o.set(this.Ec.subarray(t.offset,t.offset+t.count),c),this.yc&&h&&this.Rc&&h.set(this.Rc.subarray(t.offset,t.offset+t.count),c),this.vc&&a&&this.Nc&&a.set(this.Nc.subarray(t.offset,t.offset+t.count),c),this.xc&&l&&this.zc&&l.set(this.zc.subarray(t.offset,t.offset+t.count),c),this.bc&&u&&this.Vc&&u.set(this.Vc.subarray(t.offset,t.offset+t.count),c),c+=t.count;return{xValues:r,yValues:n,lookupValues:h,colors:o,ids:a,sizes:l,rotations:u}}onMaxSampleCountExceeded(t){return this.L.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.L.off(t)}Bc(t,e,i,s,r,n){if(void 0===e){const e=this.Cc();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.Mc(t);for(let e=0;et){e=s;break}const l={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:e};this.Ac=!0,this.appendSamples(l),this.Ac=!1}else{const l=t.length,u=this.uc,f=this.cc-1,g=Math.max(f-u+1,0),m=ao(d,g,f,(e=>t[oo(e,this.cc,l,this.lc)])),y=m-1,p=m+1,x=t[oo(m,this.cc,l,this.lc)],S=p<=this.cc-1?t[oo(p,this.cc,l,this.lc)]:void 0,A=void 0!==S&&S0){const e=void 0!==this.Oc&&this.dc?this.lc:0,i=this.uc-1,s=void 0!==this.Oc&&this.dc?0:void 0,r=void 0!==this.Oc&&this.dc?this.lc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-e)?[s,r]:[e,i];if(1+o-n>=2){let e,i,s=this.kc[n],r=this.Tc[n];for(let t=n+1;t<=o;t+=1){if(!1!==e){const i=this.kc[t],r=Math.sign(i-s);0!==r&&e&&e.direction!==r?e=!1:0===r||e||(e={direction:r}),s=i}if(!1!==i){const e=this.Tc[t],s=Math.sign(e-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=e}}t=e&&e.direction>0?Dr.ProgressiveX:e&&e.direction<0?Dr.RegressiveX:i&&i.direction>0?Dr.ProgressiveY:i&&i.direction<0?Dr.RegressiveY:void 0,this.mc={autoDetectResult:t},t&&bt.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}Fc(t,e,i){const s=this.Cc();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.gc.expandEvents.push({timestamp:i}),this.gc.expandEvents.length>5)return bt.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.gc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.wc(t)}const i=new this.Mc(e);i.set(this.kc),this.kc=i;const s=new this.Mc(e);if(s.set(this.Tc),this.Tc=s,this.yc){const t=new Float32Array(e);this.Rc&&t.set(this.Rc),this.Rc=t}if(this.vc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc),this.Nc=t}if(this.Sc){const t=new Uint32Array(e);this.Ec&&t.set(this.Ec),this.Ec=t}if(this.xc){const t=new Float32Array(e);this.zc&&t.set(this.zc),this.zc=t}if(this.bc){const t=new Float32Array(e);this.Vc&&t.set(this.Vc),this.Vc=t}return this.lc=this.uc,{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:e}}if(i>4*e){const t=new this.Mc(e);t.set(this.kc.subarray(0,this.uc)),this.kc=t;const i=new this.Mc(e);if(i.set(this.Tc.subarray(0,this.uc)),this.Tc=i,this.yc){const t=new Float32Array(e);this.Rc&&t.set(this.Rc.subarray(0,this.uc)),this.Rc=t}if(this.vc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc.subarray(0,this.uc)),this.Nc=t}if(this.Sc){const t=new Uint32Array(e);this.Ec&&t.set(this.Ec.subarray(0,this.uc)),this.Ec=t}if(this.xc){const t=new Float32Array(e);this.zc&&t.set(this.zc.subarray(0,this.uc)),this.zc=t}if(this.bc){const t=new Float32Array(e);this.Vc&&t.set(this.Vc.subarray(0,this.uc)),this.Vc=t}return{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:e}}return{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:i}}return t.appendCount+this.uc>this.Oc&&this.L.emit("maxSampleCountExceeded",this,this.uc,this.Oc,this.uc+t.appendCount),this.kc=this.kc||new this.Mc(this.Oc),this.Tc=this.Tc||new this.Mc(this.Oc),this.Rc=this.Rc||(this.yc?new Float32Array(this.Oc):void 0),this.Nc=this.Nc||(this.vc?new Uint32Array(this.Oc):void 0),this.Ec=this.Ec||(this.Sc?new Uint32Array(this.Oc):void 0),this.zc=this.zc||(this.xc?new Float32Array(this.Oc):void 0),this.Vc=this.Vc||(this.bc?new Float32Array(this.Oc):void 0),{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:this.Oc}}Hc(){if(!this.kc||!this.Tc||0===this.uc)return;if(void 0===this.Oc)return this.cc>0?{x:this.kc[0],y:this.Tc[0]}:void 0;if(!this.dc)return{x:this.kc[0],y:this.Tc[0]};let t=this.lc-this.uc;return t<0&&(t+=this.Oc),{x:this.kc[t],y:this.Tc[t]}}Cc(){if(!this.kc||!this.Tc||0===this.uc)return;if(void 0===this.Oc){const t=this.uc-1;return t>=0?{x:this.kc[t],y:this.Tc[t]}:void 0}let t=this.lc-1;return t<0&&(t+=this.Oc),{x:this.kc[t],y:this.Tc[t]}}$c(t,e,i,s){const r=this.Lc(),n=this.kc,o=this.Tc;if(!n||!o)return;const h=t=>({x:n[t],y:o[t],lookupValue:this.yc&&this.Rc?this.Rc[t]:void 0,id:this.vc&&this.Nc?this.Nc[t]:void 0,color:this.Sc&&this.Ec?this.Ec[t]:void 0,size:this.xc&&this.zc?this.zc[t]:void 0,rotation:this.bc&&this.Vc?this.Vc[t]:void 0}),a=n.length,l=this.uc,u=this.cc-1,c=Math.max(u-l+1,0);if(r){const i=this.Hc(),s=this.Cc();if(!(i&&s&&this.kc&&this.Tc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.kc:this.Tc,d="x"===o?this.kc:this.Tc,f=t[n],g=Math.min(i[n],s[n]),m=Math.max(i[n],s[n]);if(fm)return;const y=ao(f,c,u,(t=>l[oo(t,this.cc,a,this.lc)])),p=oo(y,this.cc,a,this.lc);if(!e)return h(p);const x=y-1,S=y+1,A=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?S<=u?oo(S,this.cc,a,this.lc):void 0:x>=c?oo(x,this.cc,a,this.lc):void 0;if(void 0===A)return;const v=l[p],b=d[p],M=l[A],E=d[A],w=Math.min(v,M),T=w===v?b:E,k=Math.max(v,M),C=Pn(T,k===v?b:E,(f-w)/(k-w));return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:C}:{x:C,y:f}}let d,f=Number.MAX_VALUE;const g=dt(t,i,s),m=this.uc-1;for(let t=0;t<=m;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ct(e,i.x,s.x),o=ct(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,ho=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=i.length,l=s-1,u=Math.max(l-r+1,0),c=ao(t,u,l,(t=>i[oo(t,s,a)])),d=ao(e,u,l,(t=>i[oo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),m=oo(f,s,a),y=oo(g,s,a);return m>y?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:y,dataRanges:[{offset:m,count:a-m},{offset:0,count:y+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:y,dataRanges:[{offset:m,count:y-m+1}]}},ao=(t,e,i,s)=>{const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t{const n=e.length;if(Array.isArray(e))for(let n=0;nvoid 0===t?void 0:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),co=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class fo extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ua="label",this.Ga=this.Ts.Dr(this.renderingScale).Eh(this.ua).ke(z).Ir(Re).Pr(Re),this.setMargin(5),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=dt(t,this.scale,this.renderingScale);return this.Ga.Ie(i),this}Ds(){this.Ga.Ds();const t=0===this.ua.length?u(0,0):this.Ga.Zc();return this.setContentSize(t),super.Ds()}setText(t){return this.ua=t,this.Ga.Eh(this.ua),this.Ts.vs(),this}getText(){return this.ua}setFont(t){return this.Ga.Nh(t),this.Ts.vs(),this}getFont(){return this.Ga.Oh()}setTextRotation(t){return this.Ga.Gh(t),this.Ts.vs(),this}getTextRotation(){return this.Ga.Wh()}}const go={...wn,...kn,uiElement:fo};class mo extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Qc=!1,this.fitTo=this.Lu.bind(this),this.setSize=this.fitTo,this.Ga=this.Ts.sc(e).ke(z).Ce(ot),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Fe(){const t=Ze([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>dt(t,this.scale,this.renderingScale))));return this.Qc?this.Ga.Sl([{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.Ga.Sl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Lu(t){return this.setContentSize(t),this.Ts.vs(),this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}}class yo extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Jc=u(0,0),this.Ga=t.Kc(e).hu(0).Ve(360).ke(z).Ce(ot),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.Ga.nu(t*this.renderingScale.Ui().x).ou(t*this.renderingScale.Ui().y).Ie(dt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).lu(255).Ds(),this}Lu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Jc=t,this.Ts.vs(),this}Ru(){return(this.getSize(e.UISpace.Content).x-this.Jc.x)/2}Eu(){return(this.getSize(e.UISpace.Content).x-this.Jc.x)/2}Vu(){return(this.getSize(e.UISpace.Content).y-this.Jc.y)/2}zu(){return(this.getSize(e.UISpace.Content).y-this.Jc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Jc=t,this}}class po extends Ln{constructor(t,e,i,s,r){super(t,e,i,hn.Simple,s,r),this.qc=p(u(0,0)),this.td=!1,this.Ts=t,this.hc()}rc(){const t=this.qc._();if(this.td){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.qc._().x*this.qc._().x/4+this.qc._().y*this.qc._().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),r=u(0,0),n=oi(r,oi(i,s)),o=oi(n,oi(s,ni(i,-1)));return[r,n,o,hi(o,oi(i,s))]}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Lu(t){return this.qc.M(t),this.td=!1,this.Ts.vs(),this}Ru(){return this.td?0:(this.getSize(e.UISpace.Content).x-this.qc._().x)/2}Eu(){return this.td?0:(this.getSize(e.UISpace.Content).x-this.qc._().x)/2}Vu(){return this.td?0:(this.getSize(e.UISpace.Content).y-this.qc._().y)/2}zu(){return this.td?0:(this.getSize(e.UISpace.Content).y-this.qc._().y)/2}fitTo(t){return this.qc.M(t),this.td=!0,this.Ts.vs(),this}}class xo extends Ln{constructor(t,i,s,r,n){super(t,i,s,hn.Simple,r,n),this.sd=p(u(0,0)),this.ed=p(10),this.hd=p(void 0),this.Yu=p(e.UIDirections.Right),this.hc()}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}setDirection(t){return this.Yu.M(t),this.Ts.vs(),this}getDirection(){return this.Yu._()}setPointerLength(t){return this.ed.M(t),this.Ts.vs(),this}getPointerLength(){return this.ed._()}setPointerAngle(t){return this.hd.M(t),this.Ts.vs(),this}getPointerAngle(){let t=this.hd._();if(void 0===t){const e=this.rd();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)}Lu(t){return this.sd.M(t),this.Ts.vs(),this}nd(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}od(){return $t(this.Yu._())?this.sd._().x:this.sd._().y}rd(){return $t(this.Yu._())?this.sd._().y:this.sd._().x}Ru(){switch(this.Yu._()){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.nd()-this.rd());default:return 0}}Eu(){switch(this.Yu._()){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.nd()-this.rd());default:return 0}}Vu(){switch(this.Yu._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.nd()-this.rd());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}zu(){switch(this.Yu._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.nd()-this.rd());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}rc(){const t=jt(this.Yu._()),e=si(u(0,0),t),i=this.getPointerLength(),s=this.nd(),r=this.od(),n=this.rd();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=oi(oi(o,ni(t,-i)),ni(e,s/2)),a=oi(h,ni(e,(n-s)/2)),l=oi(a,ni(t,-r)),c=oi(oi(o,ni(t,-i)),ni(e,-s/2)),d=oi(c,ni(e,-(n-s)/2)),f=oi(d,ni(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Ct(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class So extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Lu.bind(this),this.setSize=this.fitTo,this.ad=new no,this.Ga=this.Ts.fd(e).Ee(ot).dd(z).ud(z).ld(this.ad),this.Mu(this.Ga)}Iu(){return[this.Ga]}setShape(t){return this.Ga.Ad(t),this}getShape(){return this.Ga.gd()}setRotation(t){return this.Ga.pd(t),this}getRotation(){return this.Ga.md()}setFillStyle(t){return this.Ga.ud(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.yd()}Fe(){const t=dt(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.ad.clear(),i>0){const e=this.Ga.gd(),s=this.Ga.yd(),r=io(e)&&e,n=Zn(s)&&s;if(r){const t=i/r.ai().y;this.Ga.Sd(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.Ga.Sd(e)}}else this.Ga.Sd(i);this.ad.appendSample(t)}return this}Lu(t){return this.setContentSize(t),this.Ts.vs(),this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}}const Ao={...wn,...kn,uiElement:So};class vo extends Rn{setSize(t){return this.setContentSize(t),this.Ts.vs(),this}}class bo extends xn{constructor(){super(...arguments),this.vd=[],this.xd=0,this.bd=t=>{const e=this.vd.indexOf(t);e>=0&&this.vd.splice(e,1)}}getMembers(){return this.vd}getMemberCount(){return this.vd.length}setMinimumSize(t){return this.Md=t,this.Ts.vs(),this}getMinimumSize(){return this.Md}addElement(t,e=-1){const i=t.Qu(this.Ts,this.renderingScale,this.scale,this.bd,this.ts,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.vd.splice(e,0,i):this.vd.push(i),i.setVisible(this.getVisible()),this.Mu(i),this.Xi&&(me(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.vd.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.vd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof vo)),0),s=i>0?(this.size.x-this.xd)/i:0;return this.vd.reduce(((e,i)=>i instanceof vo?this.scale.mi({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 vo)),0),s=i>0?(this.size.y-this.xd)/i:0;return this.vd.reduce(((e,i)=>i instanceof vo?this.scale.mi({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},Do=Fo("Text",[]),Lo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.L.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.L.on("switch",(e=>t(this,e)))},offSwitch(t){return this.L.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()}},Po={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},_o={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()}},Vo={...wn,...Tn,background:mo,Qu(t,e,i,s,r,n){const o=new Mo(t,e,i,this.background,s,r),h=o.addElement(go,void 0),a=Object.assign(o,Io,{setTextLabel:h},Do,{stylableTexts:[h]});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),Bo={...wn,...Tn,background:xo,Qu(t,i,s,r,n,o){const h=new Mo(t,i,s,this.background,r,n),a=h.addElement(go,void 0),l=h.getBackground(),u=Object.assign(h,Io,{setTextLabel:a},Do,{stylableTexts:[a]},_o,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),a.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),a.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),a.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),a.setMargin({left:0})),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Ju="other",u.setPointerLength(n.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(n.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(n.uiTextFont).setTextFillStyle(n.uiTextFillStyle).setBackground((t=>t.setFillStyle(n.uiBackgroundFillStyle).setStrokeStyle(n.uiBackgroundStrokeStyle))),En(u,n,o),this.applyStylers(u,n)}};class zo extends pn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Bs=!1,this.L=new r.Eventer,this.wd=z,this.Cd=z,this.getOn=()=>this.Bs,this.kd=this.Mu(new So(this.Ts,this.renderingScale,this.scale,kt,o).setShape(s)),this.Cd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}Iu(){return[...this.kd.Iu()]}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setOn(t){return this.Bs=t,this.kd.setFillStyle(t?this.wd:this.Cd),this.Ts.vs(),this}setOffFillStyle(t){return this.Cd="function"==typeof t?t(this.Cd):t,this.Bs||this.kd.setFillStyle(this.Cd),this}getOffFillStyle(){return this.Cd}setSize(t){return this.kd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.kd.getSize()}setOnFillStyle(t){return this.wd="function"==typeof t?t(this.wd):t,this.Bs&&this.kd.setFillStyle(this.wd),this}getOnFillStyle(){return this.wd}setButtonShape(t){return this.kd.setShape(t),this.Ts.vs(),this}getButtonShape(){return this.kd.getShape()}Fe(){return super.Fe(),this.kd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.kd.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.kd.dispose(),this}setMouseInteractions(t){return this.kd.setMouseInteractions(t),this}getMouseInteractions(){return this.kd.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.kd.setHighlight(e),this.L.emit("highlight",this,t),this.Ts.vs(),this}getHighlight(){return this.kd.getHighlight()}}const No={...wn,uiElement:zo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return En(o,r,n),o}},Oo={...wn,...Tn,background:mo,buttonBuilder:No,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},Qu(t,i,s,r,n,o){const h=new Mo(t,i,s,this.background,r,n),a=h.addElement(Co);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Co);u.addGap();const c=u.addElement(go);u.addGap(),h.addGap();const d=Object.assign(h,Io,{setTextLabel:c},Do,{stylableTexts:[c]},Lo,{button:l},Po);let f;return d.onMouseClick(((t,e)=>{d.getLocked()||d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:5}),En(d,n,o),this.applyStylers(d,n)}}.addStyler(bn).addStyler(Mn);class Uo extends pn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Td=[],this.Fd=2,this.Id="",this.Pd=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Ri(t.value,e.min,e.max),this.Dd=0,this.Bd=0,this.Ld=!1,this.Ts=t,this.Rd=n,this.Ed=this.Mu(t.Te(e).Ce(ot)),this.zd=this.Mu(t.Dr(e).ke(r.uiTextFillStyle).Nh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Vd=140,this.Od=25):(this.Vd=160,this.Od=15)}Iu(){return[this.Ed,this.zd]}Nd(t){this.Gd=t;const e=Ho(t,"vertical"===this.Rd?0:90,this.Ld);return this.Ed.ke(e),this.Ts.vs(),this}Wd(){return this.Gd}Ud(t){return this.Vd=t,this.Ts.vs(),this}Yd(){return this.Vd}Hd(t){return this.Od=t,this.Ts.vs(),this}$d(){return this.Od}Xd(t){return this.Id=t,this.Ts.vs(),this}jd(){return this.Id}Zd(t){return this.Pd=t,this.Ts.vs(),this}setLUTDisplayProportionalSteps(t){if(this.Ld=t,this.Gd){const t=Ho(this.Gd,"vertical"===this.Rd?0:90,this.Ld);this.Ed.ke(t)}return this.Ts.vs(),this}getLUTDisplayProportionalSteps(){return this.Ld}setFillStyle(t){return this.zd.ke(t),this.Ts.vs(),this}getFillStyle(){return this.zd.zh()}setFont(t){return this.zd.Nh(t),this.Ts.vs(),this}getFont(){return this.zd.Oh()}setTextRotation(t){return this.Bd=t,this.zd.Gh(t),this.Ts.vs(),this}getTextRotation(){return this.zd.Wh()}Fe(){var t,i,s,r;if(super.Fe(),this.Xi||!this.getVisible())return this;const n=this.Gd;if(n){const o=this.renderingScale.Ui(),h=n.min,a=n.max;if("vertical"===this.Rd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=oi(s,{x:this.Ed.ai().x+this.Fd*o.x,y:0}),l={x:r.x,y:r.y+(this.Id.length>0?this.Dd*o.y+this.zd.ai().y:0)+.5*((null===(t=this.Td[0])||void 0===t?void 0:t.ai().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Td[this.Td.length-1])||void 0===i?void 0:i.ai().y)||0)};this.Ed.Ie({x:s.x,y:l.y}),this.zd.za({x:-1,y:-1}).Ie(r),n.getSteps().forEach(((t,e)=>{const i=je(l,u,this.Ld?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Td[e].za({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.Td.reduce(((t,e)=>Math.max(t,e.ai().y)),0),u=oi(t,{x:.5*((null===(s=this.Td[0])||void 0===s?void 0:s.ai().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Td[this.Td.length-1])||void 0===r?void 0:r.ai().x)||0)+(this.Id.length>0?this.Dd*o.x+this.zd.ai().x:0)),y:u.y},f={x:u.x,y:u.y+this.Fd*o.y};this.Ed.Ie(f),this.zd.za({x:1,y:1}).Ie(c),n.getSteps().forEach(((t,e)=>{const i=je(u,d,this.Ld?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Td[e].za({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.Gd&&this.getVisible()){const t=this.Gd.getSteps();for(let e=this.Td.length;eMath.max(t,e.Ds().Zc().x)),0),this.zd.Ds().Zc().x),s=(this.Id.length>0?this.Dd+this.zd.Ds().Zc().y:0)+e+.5*this.Td[0].Ds().Zc().y+.5*this.Td[this.Td.length-1].Ds().Zc().y;this.setContentSize({x:i,y:s})}else{const t=this.Vd,e=this.Od;this.Ed.tt({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Id.length>0?this.Dd+this.zd.Ds().Zc().x:0,.5*this.Td[this.Td.length-1].Ds().Zc().x),s=t+.5*this.Td[0].Ds().Zc().x+i,r=e+this.Fd+this.Td.reduce(((t,e)=>Math.max(t,e.Ds().Zc().y)),0);this.setContentSize({x:s,y:r})}}else this.Td.forEach((t=>t.dispose())),this.Td.length=0,this.zd.setVisible(!1),this.Ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.Ed.dispose(),this.Td.forEach(Tt),this.zd.dispose(),this}setMouseInteractions(t){return this.Ed.setMouseInteractions(t),this}getMouseInteractions(){return this.Ed.getMouseInteractions()}}const Go={lutElement:{},setLUT(t){return this.lutElement.Nd(t),this},getLUT(){return this.lutElement.Wd()},setLUTLength(t){return this.lutElement.Ud(t),this},getLUTLength(){return this.lutElement.Yd()},setLUTThickness(t){return this.lutElement.Hd(t),this},getLUTThickness(){return this.lutElement.$d()},setLookUpUnit(t){return this.lutElement.Xd(t),this},getLookUpUnit(){return this.lutElement.jd()},setLUTStepValueFormatter(t){return this.lutElement.Zd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Yo={...wn,...Tn,background:mo,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},Qu(t,e,i,s,r,n){const o=new Eo(t,e,i,this.background,s,r),h=o.addElement({Qu:()=>new Uo(t,e,i,kt,r,this.alignment)}),a=Object.assign(o,Do,{stylableTexts:[h]},Go,{lutElement:h});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),Ho=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new st({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-r)/n:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew Uo(t,i,s,kt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Io,{setTextLabel:c},Do,{stylableTexts:[c,d]},Fo("LUTText",[d]),Lo,{button:l},Go,{lutElement:d},Po);let g;return f.onMouseClick((()=>{f.getLocked()||f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:5}),this.applyStylers(f,n)}}.addStyler(bn).addStyler(Mn),Wo={alignment:null,title:null,entryStylers:null,legendBoxDisposed:null,entries:[],add(t,e){const i=!e||"object"!=typeof e||void 0===e.toggleVisibilityOnClick||e.toggleVisibilityOnClick,s=null==e?void 0:e.matchStyleExactly,r=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Qh?this.addChart(t,i,r,s):"attach"in t?this.addAttachable(t,i,r,s):t&&this.addDashboard(t,i,r,s)),this},addAttachable(t,e,i,s){const r=t.Wd&&t.Wd(),n=t.ks&&t.ks(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Xo.setAlignment(this.alignment):Oo;void 0!==n&&(t=t.setButtonShape(n)),h=t}const a=this.addElement(h);if(r&&"setLUT"in a){a.setLUT(r.lut);const t=r.lut.getUnits(),e=r.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";a.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(a))),this.entries.push({entry:a,component:t}),t.attach(a,e,o),e||a.setLocked(!0),this},addChart(t,e,i,s){return t.Qd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Qh)).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}},jo={alignment:"vertical",layoutBuilder:Co,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Ro:Co}},getAlignment(){return this.alignment},titleBuilder:Vo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},$o={...wn,...Tn,...jo,background:mo,Qu(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).Qu(t,e,i,s,r,!1);let h=Object.assign(o,Wo,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.Xi});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Co:Ro),l=a.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(r.legendTitleFillStyle).setTextFont(r.legendTitleFont);return a.addGap(),h=Object.assign(h,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),En(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Zo extends pn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.Jd=10,this.Kd=e.UIDirections.Up,this.qd=0,this.Ju="major",this.ua=this.Mu(t.Dr(this.renderingScale).Ir(Re).Pr(Re)),this.Re=this.Mu(t.ze(this.renderingScale))}Iu(){return[this.ua]}Fe(){if(super.Fe(),this.Xi)return this;const t=dt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.mi(t,{x:this.Kd===e.UIDirections.Right?-this.Jd:this.Kd===e.UIDirections.Left?this.Jd:0,y:this.Kd===e.UIDirections.Up?-this.Jd:this.Kd===e.UIDirections.Down?this.Jd:0}),s=this.renderingScale.mi(i,{x:this.Kd===e.UIDirections.Right?-this.qd:this.Kd===e.UIDirections.Left?this.qd:0,y:this.Kd===e.UIDirections.Up?-this.qd:this.Kd===e.UIDirections.Down?this.qd:0});return this.Re.Oe(t).Ve(i),this.ua.Ie(s).za(this.Kd===e.UIDirections.Up?{x:0,y:1}:this.Kd===e.UIDirections.Down?{x:0,y:-1}:this.Kd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.cu().getThickness();return this.size=this.Kd===e.UIDirections.Left||this.Kd===e.UIDirections.Right?{x:this.Jd+this.qd+this.ua.Ds().Zc().x,y:t}:{y:this.Jd+this.qd+this.ua.Ds().Zc().y,x:t},super.Ds()}dispose(){return super.dispose(),this.ua.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this.ua.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this.ua.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this.ua.getMouseInteractions()}getText(){return this.ua.Lh()}setTextFillStyle(t){return this.ua.ke(t),this.Ts.vs(),this}getTextFillStyle(){return this.ua.zh()}setTextFont(t){return this.ua.Nh(t),this}setTextRotation(t){return this.ua.Gh(t),this}getTextRotation(){return this.ua.Wh()}getTextFont(){return this.ua.Oh()}setText(t){return this.ua.Eh(t),this.Ts.vs(),this}setDirection(t){return this.Kd=t,this.Ts.vs(),this}getDirection(){return this.Kd}setPointerLength(t){return this.Jd=t,this.Ts.vs(),this}getPointerLength(){return this.Jd}setTickLabelPadding(t){return this.qd=t,this.Ts.vs(),this}getTickLabelPadding(){return this.qd}setTickStyle(t){return this.Re.Ee(t),this.Ts.vs(),this}getTickStyle(){return this.Re.cu()}}const Ko={...wn,Qu(t,e,i,s,r,n){const o=new Zo(t,e,i,s,r);return En(o,r,n),this.applyStylers(o,r)}}.addStyler(bn),Jo=Ko.addStyler(((t,e)=>(t.Ju="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)))),qo=Ko.addStyler(((t,e)=>(t.Ju="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)))),Qo=Oo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),th=$o.setAlignment("horizontal"),eh=$o.setAlignment("vertical"),ih={TextBox:Vo,CheckBox:Oo,ButtonBox:Qo,PointableTextBox:Bo,AxisTickMajor:Jo,AxisTickMinor:qo,LUTRange:Yo},sh={HorizontalLegendBox:th,VerticalLegendBox:eh},rh=(t,e)=>{if(Ni(t)){const i=e.Do(t);return{x:i.engineX,y:i.engineY}}return t},nh=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}},oh=(t,e,i,s=1)=>Rt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),hh=(t,e,i,s=1)=>{const r=i.dt(t),n=i.dt(e);return Rt(i.ct(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)},ah={tf:0,if:1,sf:2,ef:3,hf:4,rf:5,nf:6,af:7,lf:8,uf:9,cf:10,df:11,ff:12,Af:13,gf:14,pf:15,mf:16,yf:17,Sf:18,vf:19,xf:20,bf:21,Mf:22,_f:23};class lh extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.wf=r}}class uh extends Js{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,y,p,x){var S,A,v;super(d,c,a,y,p,{numeric:c.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:c.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:c.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},x),this.Cf=new Map,this.kf=void 0,this.Tf=0,this.Ff=[],this.If=[],this.Ke=zs.fitting,this.Pf=!0,this.Df=8,this.Bf=void 0,this.Lf=void 0,this.Rf=20,this.Ef=1,this.zf=!0,this.Vf=!0,this.Of=!0,this.Nf=!0,this.Gf=!0,this.Wf=!0,this.Uf=!0,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=this.Ch.defaultDragMouseStyle,this.jf=this.Ch.defaultDragMouseStyle,this.Zf=this.Ch.defaultDragMouseStyle,this.Qf=this.Ch.defaultDragMouseStyle,this.Jf=this.Ch.defaultDragMouseStyle,this.L=new r.Eventer,this.Kf=[],this.qf=t=>{const e=this.If.indexOf(t);e>=0&&this.If.splice(e,1)},this.tA=t=>(this.If.indexOf(t)<0&&this.If.push(t),this.qf),this.zt=(t,e)=>this.L.emit("axisAreaTouch",this,e),this.iA=Qt(this.Kf),this.onAxisInteractionAreaMouseClick=t=>this.L.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.L.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.L.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.L.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.L.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.L.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.L.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.L.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.L.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.L.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.L.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.L.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.L.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.L.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.L.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.L.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.L.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.L.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.L.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.L.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.L.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.L.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.L.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.L.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.L.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.L.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.L.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.L.off(t,"axisAreaTouchEnd"),this.Vd={relative:1},this.sA=0,this.eA=0,this.hA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().tc()):t,this.rA=t=>{const e=this.Ff.indexOf(t);-1!==e&&this.Ff.splice(e,1)},this.nA=(t,e)=>{this.L.emit("axisAreaDoubleClick",this,e),this.Nf&&(this.setStopped(!1),Zt(e))},this.oA=t=>{this.L.emit("axisAreaMouseEnter",this),(this.Vf||this.zf||this.Of||this.Nf)&&this.aA(t)},this.lA=t=>{this.uA(t),this.L.emit("axisAreaMouseLeave",this)},this.cA=(t,e,i)=>{var s,r;this.L.emit("axisAreaMouseDragStart",this,e,i);const n=Ft(null===(s=this.chart.dA.Hn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Ft(null===(r=this.chart.dA.Hn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Vf?(this.fA(t),Zt(e)):i===n&&this.zf&&(this.AA(t,h),Zt(e))},this.gA=(t,e,i,s,r)=>{var n,o;this.L.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Ft(null===(n=this.chart.dA.Hn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Ft(null===(o=this.chart.dA.Hn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Vf?(this.pA(t,r),Zt(e)):i===h&&this.zf&&(this.mA(t,s,l,r),Zt(e))},this.yA=(t,e,i,s)=>{var r,n;this.L.emit("axisAreaMouseDragStop",this,e,i,s);const o=Ft(null===(r=this.chart.dA.Hn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Ft(null===(n=this.chart.dA.Hn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Vf?(this.SA(t),Zt(e)):i===o&&this.zf&&(this.vA(t,s,a),Zt(e)),t.getIsUnderMouse()&&(this.Vf||this.zf||this.Of||this.Nf)&&this.aA(t)},this.xA=(t,e)=>{if(this.L.emit("axisAreaMouseWheel",this,e),this.Of){this.setStopped(!0);const t=this.Ch.getWidth(this.bA.cs.De(e.clientX,e.clientY)),i=this.ft.ct(t);this.zoom(i,ge(e)),Zt(e)}},this.MA=(t,e)=>this.L.emit("axisAreaMouseClick",this,e),this._A=(t,e)=>this.L.emit("axisAreaMouseDown",this,e),this.wA=(t,e)=>this.L.emit("axisAreaMouseUp",this,e),this.CA=(t,e)=>this.L.emit("axisAreaMouseMove",this,e),this.kA=(t,e,i)=>{this.L.emit("axisAreaTouchStart",this,i),this.zf&&(this.aA(t),this.AA(t,e),Zt(i))},this.TA=(t,e,i,s,r)=>{this.L.emit("axisAreaTouch",this,r),this.zf&&(this.mA(t,e,i,s),Zt(r))},this.FA=(t,e,i,s)=>{this.L.emit("axisAreaTouchEnd",this,s),this.zf&&(this.vA(t,e,i),this.uA(t),Zt(s))},this.IA=(t,e,i,s)=>{(this.Vf||this.Of)&&(this.aA(t),this.fA(t),Zt(s))},this.PA=(t,e,i,s,r,n)=>{if(this.Vf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.pA(t,e),Zt(n)}if(this.Of){const t=this.bA.cs.De(e.x,e.y),o=this.bA.cs.De(i.x,i.y),h=Math.abs(this.Ch.getWidth(hi(t,s))-this.Ch.getWidth(hi(o,r)))-Math.abs(this.Ch.getWidth(t)-this.Ch.getWidth(o)),a=this.ft.mi(this.Ph,-h),l=this.ft.mi(this.Dh,h);this.Jh(a,l,!0),Zt(n)}},this.DA=(t,e,i,s)=>{(this.Vf||this.Of)&&(this.SA(t),this.uA(t),Zt(s))},this.BA=(t,e)=>{(this.Gf||this.Wf)&&this.LA(t)},this.RA=(t,e)=>{this.EA(t)},this.zA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gf&&this.VA(t,s)},this.OA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gf&&this.NA(t,n,s,r)},this.GA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gf&&this.WA(t,n,s,r)},this.UA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gf||this.Wf)&&this.YA(t,r,s),(this.Gf||this.Wf)&&this.LA(t)},this.HA=(t,e)=>{this.Wf&&(this.setStopped(!0),this.zoom(this.Ph,ge(e)),Zt(e))},this.$A=(t,e)=>{this.Wf&&(this.setStopped(!0),this.zoom(this.Dh,ge(e)),Zt(e))},this.XA=(t,e,i)=>{this.Gf&&(this.LA(t),this.VA(t,e),Zt(i))},this.jA=(t,e,i,s,r)=>{this.Gf&&(this.NA(t,e,i,s),Zt(r))},this.ZA=(t,e,i,s,r)=>{this.Gf&&(this.WA(t,e,i,s),Zt(r))},this.QA=(t,e,i,s)=>{this.Gf&&(this.YA(t,e,i),this.EA(t),Zt(s))},this.JA=t,this.bA=i,this.KA=n,this.qA=o,this.chart=d,this.tg=g,this.ig=s,this.es=h,"logarithmic"===x.type&&this.chart.cs.Gn(ah.vf),m(this,this.tA),a.sg=this,this.eg=f,this.hg=this.eg>50?1:-1,this.rg=(v=this.Ch.toPoint(0,-this.hg),Math.abs(v.x)>=Math.abs(v.y)?v.x>=0?e.UIDirections.Right:e.UIDirections.Left:v.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.ng=l,this.og=this.ft instanceof Di?(new _i).Ei(this.Ch.toVec2(this.ft,this.ng)):(new Vi).Ei(this.Ch.toVec2(this.ft,this.ng)),this.ag=this.chart.pixelScale,this.lg=(new _i).Ei(this.Ch.toVec2(this.Ch.getWidth(this.ag),this.ng)),this.ug=this.bA.ze(this.og).setMouseInteractions(!1),this.cg=this.bA.ze(this.og).setMouseInteractions(!1),this.dg=this.bA.ze(this.og).setMouseInteractions(!1),this.Ag=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.gg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Ce(c.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.pg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.mg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Rh=this.ig.Dr(this.og).setMouseInteractions(!1).Gh(this.Ch.getTitleTextRotation(this.hg)).Pr(Re).Ir(Re),this.chart.cs.us.ls(this.Ag,(t=>this.Ag.ds(t)),{animationEnabled:this.ih}),this.chart.cs.us.ls(this.pg,(t=>this.pg.ds(t)),{animationEnabled:this.ih}),this.chart.cs.us.ls(this.mg,(t=>this.mg.ds(t)),{animationEnabled:this.ih});const b=Wi(new $i(this.kA,this.TA,this.FA,1),new Zi(this.IA,this.PA,this.DA),new ji(this.nA)),M=Wi(new $i(this.XA,this.jA,this.QA)),E=Wi(new $i(this.XA,this.ZA,this.QA));this.Ag.setMouseEnterEventHandler(this.oA).setMouseLeaveEventHandler(this.lA).setMouseDragStartEventHandler(this.cA).setMouseDragEventHandler(this.gA).setMouseDragStopEventHandler(this.yA).setMouseWheelEventHandler(this.xA).setMouseDoubleClickEventHandler(this.nA).setMouseClickEventHandler(this.MA).setMouseDownEventHandler(this._A).setMouseUpEventHandler(this.wA).setMouseMoveEventHandler(this.CA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.pg.setMouseEnterEventHandler(this.BA).setMouseLeaveEventHandler(this.RA).setMouseDragStartEventHandler(this.zA).setMouseDragEventHandler(this.OA).setMouseDragStopEventHandler(this.UA).setMouseWheelEventHandler(this.HA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.mg.setMouseEnterEventHandler(this.BA).setMouseLeaveEventHandler(this.RA).setMouseDragStartEventHandler(this.zA).setMouseDragEventHandler(this.GA).setMouseDragStopEventHandler(this.UA).setMouseWheelEventHandler(this.$A).setTouchStartEventHandler(E.onTouchStart).setTouchMoveEventHandler(E.onTouchMove).setTouchEndEventHandler(E.onTouchEnd),this.ug.Ee(c.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.cg.Ee(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.dg.Ee(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Rh.ke(c.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Nh(c.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.hs=h.rs(this,{}),this.Uh=this.hs.yg([this.Rh]).Ss(y.effectsText),this.Sg=null!==(S=c.getWidth({x:y.xAxisMarginAfterTicks,y:y.yAxisMarginAfterTicks}))&&void 0!==S?S:7,this.vg=null!==(A=c.getWidth({x:y.xAxisMarginAfterTitle,y:y.yAxisMarginAfterTitle}))&&void 0!==A?A:7}Tr(){return this.hh}Fr(){return void 0!==this.Qh}setTickStrategy(t,e){return super.Ih(t,e)}getTickStrategy(){return this.Ze}addBand(t=!0){const e=t?this.qA:this.KA,i=new Vs(e,this.chart,this.iA,this,this.og,this.Ch,this.ts,this.es);return this.Kf.push(i),i}addConstantLine(t=!0){const e=t?this.qA:this.KA,i=new Bs(e,this.chart,this.iA,this,this.og,this.Ch,this.ts,this.es);return this.Kf.push(i),i}xg(t){this.Kf.forEach(t)}bg(t){return this.Kf.map(t)}getHighlighters(){return this.Kf}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}wg(){return this.If}cr(t,e){return new lh(e,t,this.bA,this.og,this.og)}Yh(){if(this.Cf){for(const t of this.Cf)t[1].grid.dispose(),t[1].tick.dispose();this.Cf.clear()}super.Yh()}dr(t,e){const{tickStart:i}=e,s=t.xh.ur,r=i+s.getTickLength()*this.hg+s.getTickPadding()*this.hg;t.Ye.Ie(this.Ch.toPoint(t.S,r)).za(this.Ch.toPoint(s.getLabelAlignment(),-this.hg)).Gh(s.labelRotation).setVisible(this.getVisible())}Cg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.xh.ur,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.hg;return{gridStroke:{start:this.Ch.toPoint(t.S,r),end:this.Ch.toPoint(t.S,h)},tickStroke:{start:this.Ch.toPoint(t.S,n),end:this.Ch.toPoint(t.S,a)}}}wr(t,e){return"linear"===this.Th.type?oh(t,e,this.ft):hh(t,e,this.ft)}kg(t,e){return e instanceof Di?oh:hh}kr(t,e,i){if("logarithmic"!==this.Th.type){const s=this.ft.Ri(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ft;return{min:s.mi(t,-i),max:s.mi(e,i)}}Ds(){if(!this.ji)return{Tg:0,Fg:0,Od:0};const t=!(this.Qe.size>0),e=this.Rh&&this.Rh.Lh().length>0&&this.getTitleFillStyle()!==z,i=this.Ch.getHeight(e?this.chart.cs.Pg.Ig(this.getTitle(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.vg:0),s=this.je===Gs?new Map:Qs(this.je,Math.min(this.Ph,this.Dh),Math.max(this.Ph,this.Dh),this.Ph,this.Dh,0),r=this.ft;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.ur&&void 0!==t.ar)(i)){const s=Math.max(...e.map((e=>{if(!He(e,this.Ph,this.Dh))return 0;const s=this.chart.cs.Pg.Ig(i.ar(e,r),i.ur.labelFont,i.ur.labelRotation);return t||!s.isEstimate?this.Ch.getHeight(s):0})))+i.ur.tickLength+i.ur.tickPadding+i.ur.labelPadding;n=Math.max(n,s)}}));const o=this.Ff.reduce(this.hA,0);n=Math.max(n,o),n+=this.Sg;const h=Rt(i+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le);return this.Tf=h,{Tg:n,Fg:i,Od:h}}Fe(t){const e=this.getVisible()&&t.Dg>0;this.Bg=t;const i=this.ug.cu(),s=this.ft.getInnerStart()this.ft.getInnerStart()?this.ft.getInnerEnd():this.ft.getInnerStart(),n=i.getThickness()*this.hg/2,o=this.ng.getInnerInterval(),h=this.eg/100*o,a=h+t.Lg,l=o*this.hg,u=a+n;if(e||this.Yh(),this.je!==Gs&&e){const t=this.ft.ni();this.tr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.Qe){let s=this.Cf.get(e);if(!s)if(e.Ne)s={grid:this.JA[0].Rg(this.og).setMouseInteractions(!1),tick:this.JA[0].Rg(this.og).setMouseInteractions(!1)};else if("Eg"in e){const t=Array.from(this.Qe.keys()).filter((t=>"Eg"in t)).reverse().indexOf(e),i=this.JA[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.Rg(this.og).setMouseInteractions(!1),tick:i.Rg(this.og).setMouseInteractions(!1)}}if(s){s.grid.Gt(),s.tick.Gt();for(const[e,r]of i){const e=this.Cg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Vr().zg(e.gridStroke.start,e.gridStroke.end),s.tick.Vr().zg(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.ur.getGridStrokeStyle()),s.tick.Ee(e.ur.getTickStyle()),this.Cf.set(e,s)}}}const c=u,d=c+this.hg*t.Vg,f=this.Gf||this.Wf?Math.min(this.Rf,.25*t.Dg):0,g={start:this.Ch.toVec2(this.ft.mi(this.ft.getInnerStart(),f),c),end:this.Ch.toVec2(this.ft.mi(this.ft.getInnerEnd(),-f),d)},m=dt(this.Ch.toVec2(this.ft.getInnerStart(),d),this.og,this.ag),y=dt(g.start,this.og,this.ag),p=dt(g.end,this.og,this.ag),x=dt(this.Ch.toVec2(this.ft.getInnerEnd(),c),this.og,this.ag);this.ug.Oe(this.Ch.toPoint(s,a)).Ve(this.Ch.toPoint(r,a)).setVisible(e),this.cg.Oe(this.Ch.toPoint(this.ft.mi(this.ft.getInnerStart(),this.Df),a)).Ve(this.Ch.toPoint(this.ft.getInnerStart(),a)).setVisible(e),this.dg.Oe(this.Ch.toPoint(this.ft.mi(this.ft.getInnerEnd(),-this.Df),a)).Ve(this.Ch.toPoint(this.ft.getInnerEnd(),a)).setVisible(e);const S=a+t.Tg*this.hg;if(this.Rh.Ie(this.Ch.toPoint(this.Ch.getWidth(dt(ni(oi(m,x),.5),this.ag,this.og)),S)).za(this.Ch.toPoint(0,-1*this.hg)).setVisible(e),this.kf){const e=this.eg/100*o+t.Lg,i=-this.hg*o-t.Lg,s={start:this.Ch.toVec2(this.kf.min,u+this.hg*this.Tf),end:this.Ch.toVec2(this.kf.max,e+i)},r=dt(s.start,this.og,this.ag),n=dt(s.end,this.og,this.ag);this.gg.Ie(r).tt(hi(n,r)).setVisible(!0)}else this.gg.setVisible(!1);this.Ag.Ie(y).tt(hi(p,y)).setVisible(e),this.pg.Ie(m).tt(hi(y,m)).setVisible(e),this.mg.Ie(p).tt(hi(x,p)).setVisible(e);for(const i of this.Ff)i.update().plot(e,a,l,t.Lg,u);for(const t of this.Kf)t.Fe()}setLength(t){return this.Vd=t,this.chart.cs.vs(),this}getLength(){return this.Vd}setMargins(t,e){return this.sA=t,this.eA=e,this.chart.cs.vs(),this}getMargins(){return{start:this.sA,end:this.eA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.Og,...this.chart.Ng,...this.chart.Gg,...this.chart.Wg].find((t=>t.axis===this)))||void 0===t?void 0:t.iStack)&&void 0!==e?e:0}getParallelIndex(){var t,e;return null!==(e=null===(t=[...this.chart.Og,...this.chart.Ng,...this.chart.Gg,...this.chart.Wg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Ug(){const t=this.Bg;if(!t)return;const e=this.getVisible()&&t.Dg>0,i=this.ug.cu().getThickness()*this.hg/2,s=this.ng.getInnerInterval(),r=this.eg/100*s+t.Lg,n=s*this.hg,o=r+i;for(const i of this.Ff)i.update().plot(e,r,n,t.Lg,o);for(const t of this.Kf)t.Fe()}Yg(){return this.Tf}Hg(t,e){e=e||ih.AxisTickMajor;const i=new vn(this,t?this.JA[0]:this.ig,this.ig,this.ft,this.lg,this.lg,this.Ch,this.rg,this.rA,this.ts,e).setTextFormatter(this.formatValue);return this.Ff.push(i),i}aA(t){this.chart.cs.us._s(t,1),this.Bf=t.cs.Ur(this.Xf,this.Bf)}uA(t){this.chart.cs.us._s(t,0),t.cs.Yr(this.Bf)}fA(t){this.setStopped(!0),t.cs.Yr(this.Bf)}pA(t,e){const i=-this.Ch.getWidth(e);this.pan(i),this.Bf=t.cs.Ur(this.jf,this.Bf)}pan(t){const e=this.Ph,i=this.Dh,s=this.ft.mi(e,t),r=this.ft.mi(i,t);this.Jh(s,r,!1)}zoom(t,e){const i=this.ft.dt(this.Ph),s=this.ft.dt(this.Dh),r=this.ft.dt(t),n=Rt((r-i)/(s-i),0,1),o=.2*this.ft.ni(),h=n*this.Ef*o*-e,a=(1-n)*this.Ef*o*e,l=this.ft.mi(this.Ph,h),u=this.ft.mi(this.Dh,a);this.Jh(l,u,!0)}SA(t){this.kf=void 0,t.cs.Yr(this.Bf)}AA(t,e){this.setStopped(!0),t.cs.Yr(this.Bf),this.chart.cs.us._s(this.Ag,0)}mA(t,e,i,s){const r=dt(this.bA.cs.De(i.x,i.y),this.bA.cs.ft,this.og),n=Rt(this.Ch.getWidth(r),this.Ph,this.Dh),o=this.Ch.getWidth(dt(this.bA.cs.De(e.x,e.y),this.bA.cs.ft,this.og));Math.abs(this.ft.dt(n)-this.ft.dt(o))>10?(this.kf=m(Math.min(n,o),Math.max(n,o)),this.Bf=t.cs.Ur(this.Zf,this.Bf)):(this.kf=void 0,this.Bf=t.cs.Ur(this.Xf,this.Bf)),this.bA.vs()}vA(t,e,i){if(this.kf){const t=this.kf.min,e=this.kf.max,i=this.Dh{e.ys(t)}));for(const e of this.Cf.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.cs.vs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ih),this}}const ch={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},dh={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},fh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof uh&&"y"in t&&t.y instanceof uh),gh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new Ji,tickLength:7,tickStyle:new Ji,tickPadding:0,labelFont:new rr,labelFillStyle:new G,labelPadding:0,labelAlignment:0,labelRotation:0});class mh extends gh{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 yh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),ph=new mh({labelFillStyle:z,gridStrokeStyle:ot,tickStyle:ot}),xh=t=>yh(t)&&N(t.labelFillStyle)&&ht(t.gridStrokeStyle)&&ht(t.tickStyle),Sh=(t,e,i,s,r)=>(n,o)=>h=>{const a=new Date(h+n),l={year:o?a.getUTCFullYear():a.getFullYear(),monthIndex:o?a.getUTCMonth():a.getMonth(),day:o?a.getUTCDate():a.getDate(),hours:o?a.getUTCHours():a.getHours(),minutes:o?a.getUTCMinutes():a.getMinutes(),seconds:o?a.getUTCSeconds():a.getSeconds(),millis:o?a.getUTCMilliseconds():a.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return h;const c=l[e];r.includes("year")&&(l.year=Math.floor(l.year/i)*i),r.includes("monthIndex")&&(l.monthIndex=0),r.includes("day")&&(l.day=1),r.includes("hours")&&(l.hours=0),r.includes("minutes")&&(l.minutes=0),r.includes("seconds")&&(l.seconds=0),r.includes("millis")&&(l.millis=0);let d=(0===t?1:t)*i;return-1===t&&!1===u&&(d=0),0!==d&&(l[e]=i*(d>0?Math.floor((c+d)/i):Math.ceil((c+d)/i))),o?Date.UTC(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis)-n:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-n},Ah=(t,e,i,...s)=>Sh(-1,t,e,i,s),vh=(t,e,i,...s)=>Sh(-1,t,e,i,s),bh=(t,e,i,...s)=>Sh(0,t,e,i,s),Mh=(t,e,...i)=>Sh(1,t,e,void 0,i),Eh=t=>(e,i)=>s=>{const r=new Date(s+e),n=i?r.getUTCDay():r.getDay(),o=1===n&&0===(i?r.getUTCHours():r.getHours())&&0===(i?r.getUTCMinutes():r.getMinutes())&&0===r.getSeconds()&&0===r.getMilliseconds();if(0===t&&!0===o)return s;let h=i?r.getUTCDate():r.getDate();return-1===t&&1===n&&!1===o||(-1===t?h-=n>=2?n-1:n+6:h+=n>0?8-n:1),i?Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),h,0,0,0,0)-e:new Date(r.getFullYear(),r.getMonth(),h,0,0,0,0).getTime()-e},wh=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:$s(5,10,15,30)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:$s(5,10,15,30)},minorTicks:{amount:12,fitFunction:js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:$s(3,6,12)},minorTicks:{amount:8,fitFunction:js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:js({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:js({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Eh(-1),getNextKeyValueIncludingRef:Eh(0),getNextKeyValue:Eh(1),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:vh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,3)},minorTicks:{fitFunction:js(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:vh("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:bh("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:Mh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:vh("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:bh("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:Mh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,4)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:vh("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:bh("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:Mh("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:vh("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:bh("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:Mh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],Th=(t,e,i)=>{let s=((t,e)=>{const i=e-t;let s;for(let t=0;t(s,r,n,o)=>{const h=Th("great",s,r);if(void 0===h)return[];if("Decade"===h.label||"Century"===h.label||"Millennium"===h.label)return[];const a=o>n?s:r,l=(s+r)/2,u=o>n?r:s;if(wh.indexOf(h)<=wh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ws(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Xs(s,r,h.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,r,c);return"left"===i?void 0===d||He(d,l,u)?[a]:[d]:void 0!==d&&He(d,l,u)?[d]:[u]},Ch=(t,e,i)=>(s,r,n,o)=>{const h=Th(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ws(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Xs(s,r,h.unit,t,1)}else if("major"===t&&void 0!==h.majorTicks)a=!0===h.irregular?((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r})(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let r=t,n=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(r),s})(s,r,h.unit);else{if("minor"!==t||void 0===h.minorTicks)return[];if(!0===h.irregular)a=((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r})(s,r,h.getNextKeyValueIncludingRef(e,i),h.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return wh[wh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Hs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Rh=t=>(e,i,s,r,n,o)=>{const h=Th(t,n,o);if(void 0===h)return;let a;return"major"===t?a=h.majorTicks.fitFunction:h.minorTicks&&(a=h.minorTicks.fitFunction),a?a(e,i,s,r,n,o):void 0},Ih=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new mh,majorTickStyle:new mh,minorTickStyle:new mh,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),r=(t=>{const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)})(s);return`${new Intl.DateTimeFormat(i,{year:"numeric",month:"long"}).format(s)} Week ${r}`},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 Fh extends Ih{Hh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>wh.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]},`;bt.console.error(`Invalid Intl.DateTimeFormat ( locale: ${this.locale}, formatOptions {${e}} )`)}})),s=new Map;s.set("great",i("Great")),s.set("major",i("Major")),s.set("minor",i("Minor"));const r=t=>String(t),n=(t,i)=>(n,o)=>{let h=n+e;const a=o.getInnerStart(),l=o.getInnerEnd(),u=a>l,c=Th(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Ct(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(n):c.greatTicks.getReferenceKeyValue(e,this.utc)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(n):c.getNextKeyValue(e,this.utc)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[wh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ye:"Great ticks (directive)",Eg:0,Ge:!0,Lr:Ch("great",e,this.utc),Rr:void 0},{Ye:"Major ticks",Eg:1,ur:this.majorTickStyle,ar:n("major"),Lr:Ch("major",e,this.utc),bh:{Ar:Rh("major")},Rr:void 0}];xh(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",ur:this.greatTickStyle.setLabelAlignment(-1),ar:n("great","left"),Lr:kh(e,this.utc,"left"),Ne:!0,mr:!1}),o.push({Ye:"Great ticks (right)",ur:this.greatTickStyle.setLabelAlignment(1),ar:n("great","right"),Lr:kh(e,this.utc,"right"),Ne:!0,mr:!1})),xh(this.minorTickStyle)||h.push({Ye:"Minor ticks",Eg:2,ur:this.minorTickStyle,ar:n("minor"),Lr:Ch("minor",e,this.utc),bh:{Ar:Rh("minor"),Mh:(t,e,i,s,r,n)=>{const o=Th("minor",r,n);return!o||"Week"!==o.label}},Rr:void 0});const a=this.cursorFormatter;return{$e:o,Xe:h,We:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=new Date(e+t);return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(r)} `},jh:1e3,Zh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTickStyle(t){return this.setGreatTickStyle(t).setMajorTickStyle(t).setMinorTickStyle(t)}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return this.set("greatTickStyle",t(e))}return this.set("greatTickStyle",t)}getGreatTickStyle(){return this.get("greatTickStyle")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setUTC(t){return this.set("utc",t)}getUTC(){return this.get("utc")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}setFormatting(t,e,i){return this.withMutations((s=>s.set("formatOptionsGreatYear",t||this.formatOptionsGreatYear).set("formatOptionsGreatMonth",t||this.formatOptionsGreatMonth).set("formatOptionsGreatWeek",t||this.formatOptionsGreatWeek).set("formatOptionsGreatDay",t||this.formatOptionsGreatDay).set("formatOptionsGreatHour",t||this.formatOptionsGreatHour).set("formatOptionsGreatMinute",t||this.formatOptionsGreatMinute).set("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 Dh=(t,e)=>(i,s)=>{const r=s-i;if(e){const e=Math.log10(r/2);let n=10**Math.floor(e-t);const o=1/n;n=Math.round(n*o)/o;const h=Math.round(Math.floor(i/(10*n))*n*10*o)/o;return Xs(h,s,n,void 0,o)}const n=Math.log10(r);let o=10**Math.round(n-t);const h=1/o;return o=Math.round(o*h)/h,Hs(i,s,o,h)},Lh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Ph=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%3==0)):2===e?t.filter(((t,e)=>e%4==0)):3===e?t.filter(((t,e)=>e%5==0)):void 0,_h=js(void 0,2,5),Vh=(t,e,i,s,r,n)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,Bh=(t,e)=>{const i=Ei(t),s=wi(t);if(e)return(t,e)=>{const r=[],n=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=n-1;t<=o+1;t+=1){const e=s**t;r.push(e)}return r};const r=10===t?9:4;return(t,e)=>{const n=Math.round(i(t)),o=Math.round(i(e)),h=[],a=s**n,l=(s**o-a)/r;for(let i=1;i<=r;i+=1){const s=a+l*i;s>t&&sIi.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ii.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ii.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),n=[],o=[];xh(this.extremeTickStyle)||n.push({Ye:"Extreme ticks",ur:this.extremeTickStyle,ar:void 0===e?i:(t,s,r)=>i(e+t,s,r),Lr:Ys,Ne:!0,mr:!0}),o.push({Ye:"Major ticks",Eg:0,ur:this.majorTickStyle,ar:void 0===e?s:(t,i,r)=>s(e+t,i,r),Lr:"logarithmic"===t.type?Bh(t.base,!0):Dh(0,!0),bh:"logarithmic"===t.type?{Ar:Ph}:{Ar:Lh},Rr:void 0}),xh(this.minorTickStyle)||o.push({Ye:"Minor ticks",Eg:1,ur:this.minorTickStyle,ar:void 0===e?r:(t,i,s)=>r(e+t,i,s),Lr:"logarithmic"===t.type?Bh(t.base,!1):Dh(1,!1),bh:"logarithmic"===t.type?{Ar:Vh}:{Ar:_h},Rr:50});const h=this.cursorFormatter?this.cursorFormatter:Ii.Numeric;return{$e:n,Xe:o,We:void 0===e?h:(t,i,s)=>h(e+t,i,s),jh:1e-9,Zh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setExtremeTickStyle(t){if("function"==typeof t){const e=this.get("extremeTickStyle");return this.set("extremeTickStyle",t(e))}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setTickStyle(t){const e=this.setMajorTickStyle(t).setMinorTickStyle(t);return e.extremeTickStyle!==ph?e.setExtremeTickStyle(t):e}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setFormattingFunction(t){return this.withMutations((e=>e.set("extremeFormattingFunction",t).set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getExtremeFormattingFunction(){return this.get("extremeFormattingFunction")}setExtremeFormattingFunction(t){return this.set("extremeFormattingFunction",t)}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Oh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new mh,minorTickStyle:new mh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Uh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=9e4?"MajorMinutes":i>=10500?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Gh={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}${h}`}},Yh={MajorHours12:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,36e5,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Gh.hhmmss},MajorHours:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,6,12)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,3e5,1e6),fitKeyValues:js({},2,4,6)},defaultValueFormatter:Gh.hhmmss},MajorMinutes15:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Xs(t,e,9e5,void 0,1e6)),fitKeyValues:js({ignore:"first"},2)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,6e4,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Gh.hhmmss},MajorMinutes:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Xs(t,e,6e4,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,5e3,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Gh.hhmmss},MajorSeconds15:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Xs(t,e,15e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,1e3,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Gh.hhmmss},MajorSeconds:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Xs(t,e,1e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,100,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds100:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Xs(t,e,100,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,10,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds10:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Xs(t,e,10,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,1,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Xs(t,e,1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.1,1e6),fitKeyValues:js({},2)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Xs(t,e,.1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.01,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Xs(t,e,.01,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.001,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Xs(t,e,.001,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,100*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,10*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.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 Hh extends Oh{Hh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",Eg:0,ur:this.majorTickStyle,ar:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Uh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Yh[r].major.format)(t+e,i,s)},Lr:(t,e,i,s)=>{const r=Uh(i,s);return(0,Yh[r].major.getKeyValues)(t,e,i,s)},bh:{Ar:(t,e,i,s,r,n)=>{const o=Uh(r,n),h=Yh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Rr:void 0}];return yh(this.minorTickStyle)&&i.push({Ye:"Minor ticks",Eg:1,ur:this.minorTickStyle,ar:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Uh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Yh[r].minor.format)(t+e,i,s)},Lr:(t,e,i,s)=>{const r=Uh(i,s);return(0,Yh[r].minor.getKeyValues)(t,e,i,s)},bh:{Ar:(t,e,i,s,r,n)=>{const o=Uh(r,n),h=Yh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Rr:void 0}),{$e:[],Xe:i,We:this.cursorFormatter||((t,i,s)=>{const r=Uh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Yh[r].defaultValueFormatter(t+e,i,s)}),jh:1e-4,Zh:864e6}}setTickStyle(t){return this.setMajorTickStyle(t).setMinorTickStyle(t)}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTimeOrigin(t){return this.set("timeOrigin",t)}getTimeOrigin(){return this.get("timeOrigin")}setFormattingFunction(t){return this.withMutations((e=>e.set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Xh=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const r=t.captureFrame(i,s);if("image/png"!==i&&r.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(bt.navigator.msSaveBlob)bt.navigator.msSaveBlob(r,e);else{const t=bt.document.createElement("a");bt.document.body.appendChild(t);const i=bt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{bt.URL.revokeObjectURL(i),bt.document.body.removeChild(t)}),0)}},Wh=(t,i,s,r,n,o)=>{const h=t.Qu(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},jh=(t,e)=>{if("relative"===t)return e;if(t instanceof Pi)return t;const i=t.x instanceof Js?t.x.ft:t.x.x,s=t.y instanceof Js?t.y.ft:t.y.y;return Bi(i,s)},$h=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=fh(o)?o:Oi(o)?s:void 0;if(h&&zi(i)){const t=dt(n,h,r.ft);return r.Bo({engineX:t.x,engineY:t.y})}if(h&&Oi(i))return dt(n,h,s);if(h&&fh(i))return dt(n,h,i)}else{const i=t;if(Oi(e)){const t=r.Do(i);return dt({x:t.engineX,y:t.engineY},r.ft,s)}if(fh(e)){const t=e,s=r.Do(i);return dt({x:s.engineX,y:s.engineY},r.ft,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Zh{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.$g=[],this.Xg=[],this.L=new r.Eventer,this.jg=void 0,this.Zg=void 0,this.Qg=void 0,this.jt=x(0,0,0,0),this.Jg=!1,this.Xi=!1,this.Kg=()=>{this.qg=!0,this.tp.vs()},this.ip=t=>e=>{const i=this.$g.indexOf(e);-1!==i&&this.$g.splice(i,1),this.cs.vs(),t.U()},this.sp=t=>{const e=this.Xg.indexOf(t);-1!==e&&this.Xg.splice(e,1),this.cs.vs()},this.qg=!0,this.onInViewChange=t=>this.L.on("inViewChange",t),this.offInViewChange=t=>this.L.off(t,"inViewChange"),this.dA=t,this.ep=i,this.tp=s,this.removePanel=n,this.ts=e.cs.ts;const l=e.cs.ai();if(this.uiScale=i.d2({scaleXYConstructor:_i}).Oi(0,100).Ni(0,100).tt(l),this.pixelScale=i.d2({scaleXYConstructor:_i}).Oi(0,this.uiScale.x.getCellSize()).Ni(0,this.uiScale.y.getCellSize()).tt(l),this.engine=e.cs.hp,this.cs=e.cs.rp,this.hs=this.cs.hs.rs(this,{}),this.np=()=>e.op("unidentified ui"),this.ap=e.lp(),this.up=this.tp.Te(this.uiScale).Ie(u(0,0)).tt(u(100,100)).ke(o).Ce(h).setMouseMoveEventHandler(((t,e)=>this.L.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.L.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.L.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.L.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.L.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.L.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.L.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.L.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.L.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.L.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.L.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.L.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.L.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.L.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.Kg);this.cp=()=>a.off(t)}else{const t=e.cs.ko(this.Kg);this.dp=e.cs.To.bind(e.cs,t)}const c=e.cs.Io((t=>{this.Jg=t,this.L.emit("inViewChange",this,t)}));this.fp=e.cs.Po.bind(e.cs,c),this.jg=n}getTheme(){return this.ts}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.up.ke(t),this.tp.vs(),this}getBackgroundFillStyle(){return this.up.zh()}setBackgroundStrokeStyle(t){return this.up.Ce(t),this.tp.vs(),this}getBackgroundStrokeStyle(){return this.up.lo()}translateCoordinate(t,e,i){return $h(t,e,i,this.pixelScale,this.cs)}Ap(t){return this.$g.push(t),this.cs.vs(),t}gp(t){return this.Xg.push(t),this.cs.vs(),t}addUIElement(t=Vo,e=this.uiScale){e=jh(e,this.pixelScale);const i=this.np();return this.Ap(Wh(t,i,this.uiScale,e,this.ip(i),this.ts))}addLegendBox(t=$o,i=this.uiScale){i=jh(i,this.pixelScale);const s=this.gp(Wh(t,this.ap,this.uiScale,i,this.sp,this.ts));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.mi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.Xg}dispose(){return this.Xi||(this.Xi=!0,this.dp&&this.dp(),this.cp&&this.cp(),Kh(this.uiScale),Kh(this.pixelScale),this.fp&&this.fp(),this.Zg&&this.Zg(),this.tp.U(),this.ap.U(),this.$g.slice().forEach((t=>{t.dispose()})),this.Xg.slice().forEach((t=>{t.dispose()})),this.cs.vs(),this.jg&&this.jg(this),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}saveToFile(t,e,i){return Xh(this.engine,t,e,i),this}Ir(t){this.jt=t,this.Kg()}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}J(){return this.pixelScale.J(),this.uiScale.J(),this}Fe(t){if(this.qg){const t=this.tp.cs.ai(),e=t.x,i=t.y;this.uiScale.tt(e,i),this.pixelScale.tt(e,i);const s=[this.jt.left,this.jt.right],r=[this.jt.bottom,this.jt.top];this.uiScale.zi(s),this.uiScale.Vi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.Oi(0,n.x).zi(s).Ni(0,n.y).Vi(r),this.L.emit("resize",this,n.x,n.y,e,i)}this.qg=!1}pp(){for(let t=0;t{t.si&&t.si()};class Jh extends Zh{constructor(t,e,i,s,r,n){super(t,e,i,e.yp("uipanel bg",0),s,e.cs.ts.uiPanelBackgroundFillStyle,e.cs.ts.uiPanelBackgroundStrokeStyle,n),this.mp(r,this.pixelScale)}setMinimumSize(t){return this.Md=t,this.cs.vs(),this}getMinimumSize(){return this.Md}Fe(t){super.Fe(t),super.pp()}}const qh=x(10,10,10,10);class Qh extends Zh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Sp={},this.ya=qh,this.ih=!0,this.vp=e.xp("chart internal ui",0),this.bp=this.vp.Dr(this.uiScale).Eh("Chart").Ie(u(50,100)).za(u(0,1)).Nh(h).ke(a).setMouseInteractions(!1),this.Mp=this.hs.yg([this.bp]).Ss(this.ts.effectsText)}setAnimationsEnabled(t){return this.ih=t,this}getAnimationsEnabled(){return this.ih}setTitle(t){return this.bp.Eh(t),this.cs.vs(),this}getTitle(){return this.bp.Lh()}getTitleSize(){return this.bp.Ds().Zc()}setTitleFillStyle(t){return this.bp.ke(t),this.Kg(),this}getTitleFillStyle(){return this.bp.zh()}setTitleFont(t){return this.bp.Nh(t),this.Kg(),this}getTitleFont(){return this.bp.Oh()}setTitleRotation(t){return this.bp.Gh(t),this.cs.vs(),this}getTitleRotation(){return this.bp.Wh()}setTitleEffect(t){return this.Mp.Ss(t),this.cs.vs(),this}getTitleEffect(){return this.Mp.xs()}setTitleMargin(t){var e,i;return this.Sp="object"==typeof t?this.Sp?(e=this.Sp,{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.Kg(),this}getTitleMargin(){return this.Sp}setPadding(t){return this.ya="object"==typeof t?A(this.ya,t):{left:t,top:t,right:t,bottom:t},this.Kg(),this}getPadding(){return this.ya}_p(t){const e=t.wp(),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.vp.U(),this}}const ta={Cp:(t,e)=>t.zh()!==z&&0!==t.Lh().length&&t.getVisible()?t.Ds().Zc().y:0,kp(t,e){t.Ie(u(50,100)).Ir({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var ea;e.AutoCursorModes=void 0,(ea=e.AutoCursorModes||(e.AutoCursorModes={}))[ea.disabled=0]="disabled",ea[ea.snapToClosest=1]="snapToClosest",ea[ea.onHover=2]="onHover";const ia={Tp(t,i,s,r,n,o){let h;const a=t.getAutoCursorMode();if(!s&&a!==e.AutoCursorModes.disabled){const s=t.cs.Nn(),l=r.find((t=>t.getIsUnderMouse()));a===e.AutoCursorModes.snapToClosest&&n?(i||void 0!==l)&&(h=s&&n(s)):void 0===l||l.getCursorEnabled&&!l.getCursorEnabled()||(h=s&&o(l,s))}h?t.Fp.pointAt(h).setVisible(!0):t.Fp.setVisible(!1),t.Fp.Ds().Fe()},$c(t,e,i){if(e.xt.uiScale.x.ri()||e.yt.uiScale.y.ri())return;let s,r=Number.MAX_VALUE;for(const n of i)if(n.getCursorEnabled()&&n.getVisible()){const i=n.$c(e);if(i){const n=dt(i.location,i.scale,t.engine.scale),o=Xe(e,n);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()}))},Pp(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()}))}};class sa{constructor(t,e){this.Dp=t,this.Bp=e}alter(t){this.Lp=void 0!==this.Lp?this.Lp:this.Bp(),this.Rp=t,this.Dp(t)}resetValue(){void 0!==this.Rp&&(void 0!==this.Lp&&this.isAltered()&&this.Dp(this.Lp),this.Lp=void 0,this.Rp=void 0)}getNormalValue(){return void 0!==this.Lp?this.Lp:this.Bp()}isAltered(){return void 0!==this.Rp&&this.Bp()===this.Rp}}class ra{constructor(t,e){this.Ep=[],this.zp=t,this.ft=e}update(){return this.zp.getVisible()?!(this.Vp()&&(!this.Op()||(this.resetTable(),this.zp.Ds(),this.Vp()))&&(this.Np(),this.zp.Ds(),this.Vp()&&(this.resetTable(),this.zp.Ds(),1))):(this.Op()&&this.resetTable(),!0)}Op(){for(let t=0;t{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.zp,this.ft)}Gp(){return((t,i)=>{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.zp,this.ft)}Wp(){return((t,i)=>{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.zp,this.ft)}Yp(t){return this.Ep.push(t),t}}class na extends ra{constructor(){super(...arguments),this.ma=this.Yp(new sa((t=>this.zp.setOrigin(t)),(()=>this.zp.getOrigin())))}Np(){const t=this.ma.getNormalValue(),e=u(this.Gp()?-t.x:t.x,this.Wp()?-t.y:t.y);this.ma.alter(e)}}class oa extends ra{constructor(t,e,i,s){super(t,e),this.Hp=this.Yp(new sa((t=>this.zp.setTextFont((e=>e.setSize(t)))),(()=>this.zp.getTextFont().getSize()))),this.$p=i,this.Xp=s}Np(){const t=this.Hp.getNormalValue(),e=this.$p;if(enew na(t,e),FontSize:(t=5,e=5)=>(i,s)=>new oa(i,s,t,e)};class aa{constructor(){this.jp=[]}addRow(...t){return this.jp.push(t),this}}class la extends aa{Qu(){const t=this.jp;return this.jp=[],t}Zp(){return this.jp.length=0,this}}class ua extends To{constructor(){super(...arguments),this.Gu=this.ts.cursorResultTableTextFont,this.Bd=0,this.Qp=this.ts.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=r.getMembers().length;for(let n=0;n=e)r.getMembers()[n].dispose(),n-=1,i-=1;else if(void 0!==l&&l.length>0||u){for(let t=c.length;t{for(const e of Object.keys(h)){const i=h[e];t.set(e,i)}return t})):this.Gu,e=a||this.Qp,i=c[n];if(l){let s;i&&i instanceof fo?s=i:(i&&i.dispose(),s=r.addElement(go,n)),s.setFont(t).setFillStyle(e).setText(l).setTextRotation(this.Bd)}else if(u){let s;i&&i instanceof So?s=i:(i&&i.dispose(),s=r.addElement(Ao,n)),s.setFillStyle(e).setShape(u).setSize({y:t.size,x:t.size}),s.setMargin(5)}}else{for(let t=c.length;tt.setFillStyle(r.cursorResultTableFillStyle).setStrokeStyle(r.cursorResultTableStrokeStyle))).setTextFillStyle(r.cursorResultTableTextFillStyle).setTextFont(r.cursorResultTableTextFont),this.sm=ha.Flip(this.zp,this.scale)}dispose(){return this.im.dispose(),this.zp.dispose(),this}pointAt(t){return this.ca=t.scale===this.scale?t.location:dt(t.location,t.scale,this.scale),this.im.setPosition(this.ca),this.zp.setPosition(this.ca).setContent(t.resultTableContent),this.Ts.vs(),this}getPosition(){return this.ca}setVisible(t){return this.ji=t,this.Ts.vs(),this}getVisible(){return this.ji}setPointMarkerVisible(t){return this.Kp=t,this.Ts.vs(),this}getPointMarkerVisible(){return this.Kp}setPointMarker(t){return t(this.im),this.Ts.vs(),this}getPointMarker(){return this.im}setResultTableVisible(t){return this.qp=t,this.Ts.vs(),this}getResultTableVisible(){return this.qp}setResultTable(t){return t(this.zp),this.Ts.vs(),this}getResultTable(){return this.zp}setAutoFitStrategy(t){return this.sm&&this.sm.resetTable(),this.sm=t?t(this.zp,this.Ts.cs.ft):void 0,this.Ts.vs(),this}getAutoFitStrategy(){return void 0!==this.sm}Fe(){return this.sm&&this.sm.update(),this.zp.setVisible(this.Jg&&this.ji&&this.qp),this.im.setVisible(this.Jg&&this.ji&&this.Kp),this.im.Fe(),this.zp.Fe(),this}Ds(){return this.im.Ds(),this.zp.Ds(),this.Jg=((t,e,i=e)=>{const s=e!==i?dt(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.ca,this.scale),this}}class da extends ca{constructor(){super(...arguments),this.hm=!1}pointAt(t){return this.rm(t.fillStyle),super.pointAt(t)}rm(t){t&&this.hm&&this.zp.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.hm=t,this.Ts.vs(),this}getResultTableAutoTextStyle(){return this.hm}}class fa extends ca{setPosition(t){return this.ca=t,this.im.setPosition(t),this.zp.setPosition(t),this.Ts.vs(),this}}class ga{constructor(t,e=[]){this.nm=[],this.om=(t,e)=>(this.nm.forEach((i=>i(t,e))),t),this.tm=t,this.nm=e}}class ma extends ga{constructor(){super(...arguments),this.am=(t,e,i,s)=>this.om(new da(t,e,i,this.tm,s),s),this.addStyler=t=>new ma(this.tm,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ma(t,this.nm.map((t=>t)))}}class ya extends ga{constructor(){super(...arguments),this.lm=(t,e,i,s)=>this.om(new fa(t,e,i,this.tm,s),s),this.addStyler=t=>new ya(this.tm,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ya(t,this.nm.map((t=>t)))}}const pa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),xa=(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))),Sa=new ma(mo,[pa]),Aa=new ma(xo,[pa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof xo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),va=Sa,ba=Sa,Ma=Aa,Ea=new ya(mo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),wa=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:r});var Ta;e.SliceLabelIndices=void 0,(Ta=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Ta.LabelsInsideSlices=0]="LabelsInsideSlices",Ta[Ta.LabelsOnSides=1]="LabelsOnSides";const ka={SortByName:(t,e)=>t.getName().localeCompare(e.getName(),void 0,{numeric:!0}),SortByValueAscending:(t,e)=>t.getAnimatedValue()-e.getAnimatedValue(),SortByValueDescending:(t,e)=>e.getAnimatedValue()-t.getAnimatedValue(),None:()=>0},Ca={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Ra=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class Ia extends Yi{constructor(){super(...arguments),this.Ms="Slice",this.S=0}}const Fa=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class Da extends Ia{}class La extends Da{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.um=!1,this.dm=z,this.fm=z,this.Am=this.S,this.gm=this.um?1:0,this.pm=this.getVisible(),this.ym=K((()=>this.Ki.cs.vs())),this.Sm=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.bm=()=>{this.Mm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this._m=e.Kc(r).ds(this.getHighlight()),this.fs(this._m),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0}),this.onMouseClick(Fa),this.onTouchEnd(Fa)}setValue(t){return this.Ki.getAnimationsEnabled()?this.pm&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ki.getMultipleSliceExplosion()){const t=this.Ki.getSlices();for(let e=0;e{this.gm=t,this.Ki.cs.vs()})),this.Mm.onEveryAnimationEnd(this.bm),this.um=!this.um):!1!==this.Ki.getMultipleSliceExplosion()||t?(this.gm=this.um?0:1,this.um=!this.um):(this.gm=0,this.um=!this.um),this.Ki.cs.vs(),this}getExploded(){return this.um}setVisible(t){return this.pm=t,!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.dm=t,this.fm=i,this._m.ke(this.dm).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;toi(e,ni(pi(.5*(t.Kl()+t.Fi())*Math.PI/180),i)),_a=(t,e,i,s,r,n)=>{const o=t.length;let h=90;for(let a=0;a{const e=t.getSlices();for(let t=0;t{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.Wm=i.Um("pieChart bottom",0),this.Ym=i.Um("pieChart top",1),this.bp.Eh("Pie Chart"),this.mp(n,this.pixelScale),this.onBackgroundMouseDoubleClick(Va);const a=Wi(new ji(Va));this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.Hm=i.$m();const l=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=l.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new La(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);this.Bm+=1,i.setName(t);const s=this.ih;return this.ih=!1,i.setValue(e),this.ih=s,i.setEffect(this.Em),this.Xm(i),this.Cm.push(i),this.Gm(),i.setHighlightOnHover(this.Im),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){this.Dm="function"==typeof t?t(this.Dm):t;for(let t=0;te.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);if(this.Gd){const t=this.Gd;this.Cm.forEach((e=>{this.Xm(e,new G({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Cm[t]._m.setVisible(e),this.Cm[t].Ye.setVisible(e)}this.Cm=this.Cm.sort(this.km);const r=this.Cm.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;twa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e=this.Tm(t.index,t)){t.setStyle(e,this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return super.dispose(),this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Ym.U(),this.Wm.U(),this.Hm.U(),this}}const za={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Na=(...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 Oa extends Ba{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.jm=Ca.NamePlusValue,this.Qm=[],this.Jm=40,this.Km=5,this.qm=10,this.ty=this.ts.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t{const r=360*e[s],h=c-r,a=pi(gi(.5*(c+h))),l=a.x>=0?-1:1,d=oi(oi(i,ni(a,u+n)),{x:l*-o,y:0});c=h;const f={x:l,y:0};t.Ye.Ie(d).za(f),t.Ye.Ds();const g=Ze(t.Ye.Ue());return{position:d,alignment:f,shape:t.Ye,boundaries:g,sliceAngleVec:a,slice:t}})),f=[];for(let t=0;t{const s=t.slice._m,r=Pa(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=fi(t.position.y,r,i),o=t.position;this.iy([r,n,o])}))}getMinimumSize(){return u(500,300)}iy(t){let e;for(let t=0;t{if(qi(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?hr:new lr({size:e,fillStyle:i,shape:"sphere"})}return hr};class Ha{constructor(t,e,i,s){this.hy=[],this.ny=new Map,this.oy=t,this.ly=e,this.uy=i,this.Ay=s}gy(){this.uy&&this.uy();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.hy.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.oy(),this.hy.push(e));const n=[],o=e.py().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.ly(e,n,t.sharedProperties);i=ne(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.bd(t)}))})),s.forEach((t=>{t.dispose();const e=this.hy.indexOf(t);e<0?me(0,(()=>{})):this.hy.splice(e,1)})),r.forEach((t=>{const e=this.ny.get(t.Go);e&&t.collection.cs.io({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.ny.clear(),r.forEach((t=>{this.ny.set(t.Go,t)})),this.Ay&&this.Ay(this.hy,i)}}}my(){this.hy.forEach((t=>{t.dispose()})),this.hy.length=0}}class Xa{constructor(t){this.yy=[],this.Sy=t}gy(){return this.vy(),{add:()=>this.el(),finishPlot:()=>{this.xy()}}}el(){let t=this.yy.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Sy()},this.yy.push(t)),t.isFree=!1,t.shape}vy(){this.yy.forEach((t=>{t.isFree=!0}))}xy(){this.yy.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.yy.splice(this.yy.indexOf(t),1)}))}my(){this.yy.forEach((t=>t.shape.dispose())),this.yy.length=0}}class Wa{constructor(t,e,i,s,n,o,h,a,l,u){this.L=new r.Eventer,this.S=0,this.ji=!0,this.Xi=!1,this.vs=t,this.by=e,this.My=i,this._y=s,this.wy=n,this.Cy=o,this.Bd=h,this.Qp=a,this.ky=l,this.Ku=u}setValue(t){return t===this.S||(this.S=t,this.vs(),this.L.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.My="function"==typeof t?t(this.My):t,this.vs(),this}getTickStyle(){return this.My}setTickLength(t){return this._y=t,this.vs(),this}getTickLength(){return this._y}setGridStrokeStyle(t){return this.wy="function"==typeof t?t(this.wy):t,this.vs(),this}getGridStrokeStyle(){return this.wy}setTextPadding(t){return this.Cy=t,this.vs(),this}getTextPadding(){return this.Cy}setTextRotation(t){return this.Bd=t,this.vs(),this}getTextRotation(){return this.Bd}setTextFillStyle(t){return this.Qp="function"==typeof t?t(this.Qp):t,this.vs(),this}getTextFillStyle(){return this.Qp}setTextFont(t){return this.ky="function"==typeof t?t(this.ky):t,this.vs(),this}getTextFont(){return this.ky}setTextFormatter(t){return this.Ku=t,this.vs(),this}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}dispose(){return this.Xi||(this.Xi=!0,this.by(),this.vs(),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setVisible(t){const e=this.ji!==t;return this.ji=t,e&&(this.L.emit("visibleStateChanged",this,this.ji),this.vs()),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}class ja extends Js{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Ty({x:t.cs.ts.xAxis3DNumericTicks,y:t.cs.ts.yAxis3DNumericTicks,z:t.cs.ts.zAxis3DNumericTicks}),datetime:e.Ty({x:t.cs.ts.xAxis3DDateTimeTicks,y:t.cs.ts.yAxis3DDateTimeTicks,z:t.cs.ts.zAxis3DDateTimeTicks}),time:e.Ty({x:t.cs.ts.xAxis3DTimeTicks,y:t.cs.ts.yAxis3DTimeTicks,z:t.cs.ts.zAxis3DTimeTicks})},{type:"linear"}),this.Ff=[],this.Fy=()=>{},this.Iy=()=>{},this.Py=()=>{},this.Dy=()=>{},this.chart=t,this.yt=r,this.By=n,this.Ly=o,this.Ry=this.yt.ft;const l=this.Ch.Ty({x:this.ts.xAxis3DStrokeStyle,y:this.ts.yAxis3DStrokeStyle,z:this.ts.zAxis3DStrokeStyle});this.Ey=this.yt.sy([za.InternalUI]).Ee(l).zy(Ya(l)).setMouseInteractions(!1),this.Rh=this.By.Dr(this.Ly).setMouseInteractions(!1).ke(e.Ty({x:t.cs.ts.xAxis3DTitleFillStyle,y:t.cs.ts.yAxis3DTitleFillStyle,z:t.cs.ts.zAxis3DTitleFillStyle})).Nh(e.Ty({x:t.cs.ts.xAxis3DTitleFont,y:t.cs.ts.yAxis3DTitleFont,z:t.cs.ts.zAxis3DTitleFont})),this.Vy=new Xa((()=>this.By.Dr(this.Ly))),this.Oy=new Ha((()=>this.yt.Rg().setMouseInteractions(!1)),((t,e,i)=>(t.Gt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.ol(e)))))),this.hs=a,this.Uh=this.hs.yg([this.Rh]).Ss(s.effectsText),this.Ey.setMouseEnterEventHandler(this.Fy).setMouseLeaveEventHandler(this.Iy).setMouseDragEventHandler(this.Py).setMouseDragStopEventHandler(this.Dy),i.sg=this}setTickStrategy(t,e){return super.Ih(t,e)}getTickStrategy(){return this.Ze}addCustomTick(){const t=new Wa((()=>this.chart.cs.vs()),(()=>{const e=this.Ff.indexOf(t);e>=0&&this.Ff.splice(e,1)}),this.ts.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickLength,this.ts.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.ts.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Ff.push(t),this.chart.cs.vs(),t}setStrokeStyle(t){return this.Ey.Ee(t).zy(Ya(this.Ey.cu())),this.chart.cs.vs(),this}getStrokeStyle(){return this.Ey.cu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Ey.setVisible(t),!1===t&&(this.Oy.my(),this.Vy.my()),this.By.vs(),this}wg(){return this.chart.getSeries()}Ny(t){return Math.abs(this.ft.it(t)*this.yt.Gy(1))}kr(t,e,i){const s=Math.abs(this.ft.it(e-t)*this.yt.Gy(1));return{min:t-i*s,max:e+i*s}}cr(t,e){return new $a(e,t,this.By,this.Ly,this.yt)}dr(t,e){const i=this.Wy(e,t.S,t.xh.ur.tickLength,t.xh.ur.tickPadding);return t.Ye.Ie(i.labelPosition).za(i.labelAlignment),i}Wy(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ft.getInnerStart())/(this.ft.getInnerEnd()-this.ft.getInnerStart()),c=De.addVec($e(n,o,l),De.multiplyVec(De.multiply(h,this.yt.Gy(.5*this.Ey.cu().getThickness())),r)),d=De.addVec(c,De.multiplyVec(De.multiply(h,this.yt.Gy(i)),r)),f=this.yt.Uy(d)||u(0,0);return{labelPosition:oi(dt(f,this.chart.engine.scale,this.Ly),ni(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Yy(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ft.getInnerStart())/(this.ft.getInnerEnd()-this.ft.getInnerStart()),a=De.addVec($e(r,n,h),De.multiplyVec(De.multiply(o,this.yt.Gy(.5*this.Ey.cu().getThickness())),s)),l=De.addVec(a,De.multiplyVec(De.multiply(o,this.yt.Gy(10)),s)),c=this.yt.Uy(a)||u(0,0),d=this.yt.Uy(l)||u(0,0);return this.By.ze(this.Ly).Oe(c).Ve(d).Ee(new Ji({fillStyle:new G({color:T(120*i)}),thickness:1}))}wr(t,e){return Za(t,e,this.ft)}Fe(t){if(!this.ji)return;const e=Math.min(this.Ph,this.Dh),i=Math.max(this.Ph,this.Dh),s=this.Ry,r=f(s.x.ht(),s.y.ht(),s.z.ht());let n,o;this.Hy()?(n=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.Ch.$y(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Ch.Kd,a=this.yt.Uy(n)||u(0,0),l=this.yt.Uy(o)||u(0,0),c=$e(n,o,.5),d=De.addVec(c,De.multiplyVec(De.multiply(h,-1),r)),g=this.yt.Uy(c)||u(0,0),m=this.yt.Uy(d)||u(0,0),y=ii(hi(dt(g,this.chart.engine.scale,this.Ly),dt(m,this.chart.engine.scale,this.Ly)));this.Ey.Gt().ol([n,o]);const{gridlinePositionA:p,gridlinePositionB:x,gridlinePositionC:S}=this.Ch.Xy(t),A=t=>({x:-1===t.x?this.Ry.x.getInnerStart():1===t.x?this.Ry.x.getInnerEnd():0,y:-1===t.y?this.Ry.y.getInnerStart():1===t.y?this.Ry.y.getInnerEnd():0,z:-1===t.z?this.Ry.z.getInnerStart():1===t.z?this.Ry.z.getInnerEnd():0}),v=A(p),b=A(x),M=A(S),E={physicalAxisSize:ri(hi(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:y,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},w=this.tr(E),T=this.Oy.gy();for(const[t,e]of this.Qe)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.jy(E,e);T.add({Go:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.ur.tickStyle}),s.gridStroke&&T.add({Go:0,positions:s.gridStroke},{lineStyle:t.ur.gridStrokeStyle})}const k=this.Vy.gy(),C={x:0,y:0};this.Ff.forEach((t=>{if(!t.ji||t.Si)return;const s=this.Wy(E,t.S,t._y,t.Cy),r=this.jy(E,s),n=k.add().Ie(s.labelPosition).za(s.labelAlignment).ke(t.Qp).Nh(t.ky).Eh(t.Ku(t.S)).Gh(t.Bd).Ds().ai();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),T.add({Go:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.My}),r.gridStroke&&T.add({Go:0,positions:r.gridStroke},{lineStyle:t.wy})})),k.finishPlot(),T.finishPlot();const R=this.pr(((t,e)=>{const i=e.Ye.ai();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-a.y)/(l.x-a.x));this.Rh.za({x:0,y:0}).Gh(180*-I/Math.PI);const F=De.addVec(c,De.multiplyVec(De.multiply(h,this.yt.Gy(.5*this.Ey.cu().getThickness()+this.yr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),D=this.yt.Uy(F)||u(0,0),L=oi(dt(D,this.chart.engine.scale,this.Ly),oi(oi(ai(R,y),ni(y,this.yr(((t,e)=>Math.max(t,e.labelPadding)),0))),ai(ni(this.Rh.Ds().ai(),.5),y)));this.Rh.Ie(L),this.Ey.Zy={overrideFollowing:!1,skipMousePicking:!1}}jy(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Ct(h,0)||Ct(h,1)||(a=[this.Qy()?{...i,x:n.x}:this.Jy()?{...i,y:n.y}:this.Hy()?{...i,z:n.z}:{x:0,y:0,z:0},this.Qy()?{...s,x:n.x}:this.Jy()?{...s,y:n.y}:this.Hy()?{...s,z:n.z}:{x:0,y:0,z:0},this.Qy()?{...r,x:n.x}:this.Jy()?{...r,y:n.y}:this.Hy()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Yh(){super.Yh(),this.Oy.my(),this.Vy.my()}Qy(){return this.Ch.Qy()}Jy(){return this.Ch.Jy()}Hy(){return this.Ch.Hy()}}class $a extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ky=r}}const Za=(t,e,i)=>Rt(t+.1*(e-t)+Math.abs(i.ht())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Ka=(t,e,i,s)=>({Sr:()=>{const i=t();let s;for(const t of i){if(!t.qy())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},vr:()=>{const e=t();let s;for(const t of e){if(!t.qy())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Mr:()=>{const e=t();let i;for(const t of e){if(!t.qy())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Ja=t=>({...Ka(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Mr().y)),Ty:t=>t.y,$y:(t,e)=>({x:e.x,y:t.y,z:e.z}),Kd:f(-1,0,0),Xy: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)}},Qy:()=>!1,Jy:()=>!0,Hy:()=>!1}),qa=t=>({...Ka(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Mr().z)),Ty:t=>t.z,$y:(t,e)=>({x:e.x,y:e.y,z:t.z}),Kd:f(1,0,0),Xy: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)}},Qy:()=>!1,Jy:()=>!1,Hy:()=>!0});class Qa extends Yi{constructor(t,e,i,s,r){super(t,e,s,r),this.tS=Hn,this.iS=!0,this.sS=!0,this.Ki=t,this.yt=i,this.ss=new Map,this.onMouseWheel(this.Ki.eS),this.onMouseDrag(this.Ki.hS),this.onTouchStart(this.Ki.rS.onTouchStart),this.onTouchMove(this.Ki.rS.onTouchMove),this.onTouchEnd(this.Ki.rS.onTouchEnd)}setAutoScrollingEnabled(t){return this.iS=t,this.Ki.cs.vs(),this}getAutoScrollingEnabled(){return this.iS}setColorShadingStyle(t){return this.tS=t,this.ss.forEach(((e,i)=>i.nS(t))),this.yt.vs(),this}getColorShadingStyle(){return this.tS}setDepthTestEnabled(t){return this.sS=t,this.ss.forEach(((e,i)=>i.oS(t))),this.yt.vs(),this}getDepthTestEnabled(){return this.sS}aS(){}Fe(){}Ay(){}getXMax(){const t=this.Ga;return t?t.bt():void 0}getXMin(){const t=this.Ga;return t?t.xt():void 0}getYMax(){const t=this.Ga;return t?t._t():void 0}getYMin(){const t=this.Ga;return t?t.Mt():void 0}getZMax(){const t=this.Ga;return t?t.lS():void 0}getZMin(){const t=this.Ga;return t?t.uS():void 0}Mr(){const t=this.Ga;return t?f(t.xl(),t.bl(),t.cS()):f(0,0,0)}}class tl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Box Series 3D",this.dS=.25,this.fS=!1,this.Wd=()=>ue(this.be),this.be=fe(this.ts.boxSeries3DFillStyle,r),this.Ga=this.yt.gS().oS(this.sS).ke(this.be).AS(this.dS).ds(this.getHighlight()),this.fs(this.Ga)}invalidateData(t){const e=t.length;if(0===e)return this;this.fS&&this.Ki.cs.Gn(ah.xf);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;iue(this.uu.getFillStyle())}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Ga.Ee(e),this.yt.vs(),this}getStrokeStyle(){return this.uu}add(t){return this.fS&&this.Ki.cs.Gn(ah.xf),this.fS=!0,(t=Array.isArray(t)?t:[t])?(this.Ga.ol(t.slice()),this.yt.vs(),this):this}clear(){return this.Ga.Gt(),this}getPointAmount(){const t=this.Ga;return t.al()+t.ll()}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.uu}),this}}class il extends el{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Line Series 3D",this.uu=fe(s.lineSeries3DStrokeStyle,r),this.mS=wr.pointStyle3D,this.yS(this.uu),this.Ga=this.yt.sy([za.UserSeries]).oS(this.sS).Ee(this.uu).zy(this.mS).ds(this.getHighlight()),this.fs(this.Ga)}setStrokeStyle(t){super.setStrokeStyle(t),this.yS(this.uu);const e=this.mS;return this.Ga.zy(e),this}yS(t){const e=new gr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.mS=e}}class sl extends el{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Point Line Series 3D",this.Wd=()=>ue(this.uu.getFillStyle())||ue(this.mS.getFillStyle()),this.mS=fe(s.pointLineSeries3DPointStyle,r),this.uu=fe(s.lineSeries3DStrokeStyle,r),this.SS(),this.Ga=this.yt.sy([za.UserSeries]).oS(this.sS).Ee(this.uu).zy(this.mS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){return this.mS="function"==typeof t?t(this.mS):t,this.SS(),this.Ga.zy(this.mS),this.yt.vs(),this}getPointStyle(){return this.mS}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.uu,i=Math.abs(e.getThickness()),s=this.mS,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.mS=s.setSize(i)),this.SS();const n=this.mS;return this.Ga.zy(n),this.yt.vs(),this}SS(){const t=this.mS,e=t.getSize();this.mS=t.setSize(e)}Pe(t,e){t.ds(e),this.yt.vs()}}class rl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.fS=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.Ki.cs.Gn(ah.bf)}add(t){return this.fS&&this.Ki.cs.Gn(ah.xf),this.fS=!0,(t=Array.isArray(t)?t:[t])?(this.Ga.ol(t.slice()),this.yt.vs(),this):this}clear(){return this.Ga.Gt(),this}getPointAmount(){const t=this.Ga;return t.al()+t.ll()}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{point3D:this.vS}),this}}class nl extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ms="Point Series 3D",this.Wd=()=>ue(this.vS.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ki.getSeries().length;this.vS=fe(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Ga=this.yt.bS(h).oS(this.sS).xS(this.vS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){this.vS="function"==typeof t?t(this.vS):t;const e=this.vS;return this.Ga.xS(e),this.yt.vs(),this}getPointStyle(){return this.vS}}class ol extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ms="Point Cloud Series 3D",this.Wd=()=>ue(this.vS.getFillStyle());const o=this.Ki.getSeries().length;this.vS=fe(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Ga=this.yt.bS(h).xS(this.vS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){this.vS="function"==typeof t?t(this.vS):t;const e=this.vS;return this.Ga.xS(e),this.yt.vs(),this}getPointStyle(){return this.vS}}const hl={Triangulated:nl,Pixelated:ol};class al extends Qh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.MS=[],this._S=0,this.wS=t=>{const e=this.MS.indexOf(t);e>=0&&(this.MS.splice(e,1),this.L.emit("seriesDispose",this,t))},this.CS=()=>{this._S+=1},this.kS=()=>{this._S-=1},this.onSeriesBackgroundMouseEnter=t=>this.L.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.L.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.L.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.L.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.L.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.L.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.L.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.L.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.L.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.L.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.L.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.L.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.L.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.L.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.L.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.L.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.L.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.L.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.L.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.L.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.L.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.L.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.L.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.L.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.L.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.L.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.L.off(t,"touchEndSeriesBackground"),this.TS=this.hs.yg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.MS.forEach((e=>e.setAnimationHighlight(t))),this}FS(t,e){this.TS.As([e]),t.setMouseMoveEventHandler(((t,e)=>{this.L.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.L.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.L.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.L.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.L.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.L.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.L.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.L.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.L.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.L.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.L.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.L.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.L.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.L.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.IS.ke(t),this.cs.vs(),this}getSeriesBackgroundFillStyle(){return this.IS.zh()}setSeriesBackgroundStrokeStyle(t){return this.PS.Ce(t),this.cs.vs(),this}getSeriesBackgroundStrokeStyle(){return this.PS.lo()}setSeriesBackgroundEffect(t){return this.TS.Ss(t),this.cs.vs(),this}getSeriesBackgroundEffect(){return this.TS.xs()}DS(t){this.MS.push(t),t.onMouseEnter(this.CS),t.onMouseLeave(this.kS),void 0!==this.BS&&t.setHighlightOnHover(this.BS),this.L.emit("seriesAdded",this,t)}Qd(){return this.MS}LS(){return this._S}setSeriesHighlightOnHover(t){return this.BS=t,this.MS.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.MS.slice().forEach(Tt),super.dispose()}RS(t){return this.L.on("seriesAdded",t)}ES(t){return this.L.off(t)}zS(t){return this.L.on("seriesDispose",t)}VS(t){return this.L.off(t)}}const ll=De.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class ul{constructor(t,e,i,s){this.OS=!0,this.NS=!0,this.GS=2*-Math.PI/2160,this.WS=2*Math.PI/2160,this.US=.1,this.YS=1*Math.PI/180,this.HS=t,this.$S=e,this.XS=i,this.Uy=s}getDefaultCameraConfiguration(t){const e={direction:ll,location:De.multiply(ll,-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.jS(i,t):"wheel-zoom"===t.type?i=this.ZS(i,t):"rotate+zoom"===t.type?i=this.QS(i,t):"fixed-rotate"===t.type?i=this.JS(i,t):"move"===t.type&&(i=this.KS(i,t))})),this.OS?i=this.qS(t.boundingBox,i):this.NS&&(i=this.tv(t.boundingBox,i)),i}jS(t,e){const{rotation:i}=e,s=t.location,r=De.multiply(De.normalize(t.location),-1),{Right:n,Up:o}=this.sv(r);let h=s;const a=this.ev(r),l=i.x*this.GS*a;h=De.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.WS,a-this.YS);return 0!==u&&(h=De.rotateAroundAxis(h,n,u)),{location:h,direction:De.multiply(De.normalize(h),-1)}}ZS(t,e){const{deltaY:i}=e;this.OS&&this.hv(!1);const s=t.location,r=De.multiply(De.normalize(s),-1),n=i*this.US,o=De.length(s)*-n;return{direction:r,location:De.addVec(s,De.multiply(r,o))}}QS(t,e){const{rotation:i,cameraDistance:s}=e;this.OS&&this.hv(!1);let r=this.jS(t,{type:"rotate",rotation:i});const n=r.location,o=De.multiply(De.normalize(n),-1),h=De.multiply(o,-s);return r={direction:De.multiply(De.normalize(h),-1),location:h},r}JS(t,e){this.OS&&this.hv(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.sv(r),h=i.x*this.GS;let a=De.normalize(De.rotateAroundAxis(r,o,h));const l=i.y*this.WS;return a=De.normalize(De.rotateAroundAxis(a,n,l)),{location:s,direction:a}}KS(t,e){this.OS&&this.hv(!1),this.NS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.sv(n);return{location:De.addVec(r,De.multiply(n,.01*s),De.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};return this.OS?this.qS(t.boundingBox,e):this.tv(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};return this.OS?this.qS(t.boundingBox,e):this.tv(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};if(this.OS)return this.qS(t.boundingBox,e)}qS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.rv(t,s,100,20,1,i,5);const r=this.ev(s.direction);return s=this.nv(s,this.ov(t,s,100,1),r),s}rv(t,e,i,s,r,n,o){return cl(n,o,(t=>({direction:e.direction,location:De.multiply(e.direction,-t)})),(e=>this.av(t,e)),i,r,"linear",s)}ov(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.sv(e.direction),a=this.lv(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(a.bottom-a.top)>u&&(l=a.bottom({location:l.location,direction:De.normalize(De.lerp(l.direction,h,t))})),(e=>this.uv(t,e)),0,u,!0,i):dl(0,c,(t=>({location:l.location,direction:De.normalize(De.lerp(l.direction,o,t))})),(e=>this.uv(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:De.normalize(De.lerp(l.direction,n,t))})),(e=>this.cv(t,e)),0,u,!0,i):dl(0,c,(t=>({location:l.location,direction:De.normalize(De.lerp(l.direction,r,t))})),(e=>this.cv(t,e)),0,u,!0,i)),l}av(t,e){const i=this.lv(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}cv(t,e){const i=this.lv(t,!1,e);return Math.abs(i.left-i.right)}uv(t,e){const i=this.lv(t,!1,e);return Math.abs(i.top-i.bottom)}lv(t,e,i){const s=Ze(this.dv(t,e,i).map((t=>dt(t,this.HS,this.$S))));return{left:s.min.x,right:this.$S.x.getInnerEnd()-s.max.x,top:this.$S.y.getInnerEnd()-s.max.y,bottom:s.min.y}}dv(t,e,i){const s=this.XS,r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),n=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],h=e?16:4,a=(r.x+n.x)/2,l=(r.z+n.z)/2,u=Math.sqrt(2)*(n.x-a),c=Math.sqrt(2)*(n.z-l);return[r.y,n.y].forEach((t=>{for(let e=0;ethis.Uy(t,i))).filter((t=>void 0!==t))}tv(t,e){const i=De.length(e.location),s=this.fv(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)ue(this.be),this.tS=Gn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.be=fe(this.ts.surfaceGridSeries3DFillStyle,o),this.pv=fe(this.ts.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Yn=h,this.Ga=this.yt.yv(h).ke(this.be).mv(this.pv).nS(this.tS).ds(this.getHighlight()),this.fs(this.Ga),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}Sv(){const t=this.gv.start||{x:0,z:0};let e;e=this.gv.end?{x:(this.gv.end.x-t.x)/this.Yn.columns,z:(this.gv.end.z-t.z)/this.Yn.rows}:this.gv.step?this.gv.step:{x:1,z:1},this.Ga.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.Ga.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.Ga.xv().step}setEnd(t){return this.gv.end=t,this.Sv(),this}getEnd(){return this.Ga.xv().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ga.ke(this.be),this.yt.vs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.Ga.mv(this.pv),this.yt.vs(),this}getWireframeStyle(){return this.Ga.bv()}setIntensityInterpolation(t){return t=t||"disabled",this.Ga.Mv(t),this.yt.vs(),this}getIntensityInterpolation(){return this.Ga._v()}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),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.Yn.dataOrder?t.length:t[0].length,rows:"rows"===this.Yn.dataOrder?t.length:t[0].length},i="columns"===this.Yn.dataOrder?this.Yn.columns:this.Yn.rows,s="columns"===this.Yn.dataOrder?this.Yn.rows:this.Yn.columns;if(e.x>i||e.y>s){if(!0===this.Ki.dA.$n){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.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.`;bt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ei||e.y>s){if(!0===this.Ki.dA.$n){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.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.`;bt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;eue(this.be),this.Ki.cs.Gn(ah.xf),this.tS=Gn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.be=fe(this.ts.surfaceScrollingGridSeries3DFillStyle,o),this.pv=fe(this.ts.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Yn=h,this.Ga=this.yt.Fv(h).ke(this.be).mv(this.pv).nS(this.tS).ds(this.getHighlight()),this.fs(this.Ga),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}Sv(){const t=this.gv.start||{x:0,z:0};let e;e=this.gv.step?this.gv.step:{x:1,z:1},this.Ga.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.Ga.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.Ga.xv().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ga.ke(this.be),this.yt.vs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.Ga.mv(this.pv),this.yt.vs(),this}getWireframeStyle(){return this.Ga.bv()}setIntensityInterpolation(t){return t=t||"disabled",this.Ga.Mv(t),this.yt.vs(),this}getIntensityInterpolation(){return this.Ga._v()}clear(){return this.Ga.Gt(),this.yt.vs(),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.Yn.scrollDimension?this.Yn.rows:this.Yn.columns;if(i>s-1){if(!0===this.Ki.dA.$n){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Yn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ki.dA.$n){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Yn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(e)}const e=[];for(let t=0;ts?e=e.slice(0,s):i=i.slice(0,t)}}const s=e?e.length:null==i?void 0:i.length,r=e?e[0].length:null==i?void 0:i[0].length;return this.Ga.Iv({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.yt.vs(),this}setCullMode(t){return this.Ga.kv("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Ga.Tv()}aS(){}Fe(){}Ay(){}qy(){return this.iS&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}}const ml=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Sl),yl=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),pl={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)=>pl.multiply(t,pl.translation(e,i,s)),xRotate:(t,e)=>pl.multiply(t,pl.xRotation(e)),yRotate:(t,e)=>pl.multiply(t,pl.yRotation(e)),zRotate:(t,e)=>pl.multiply(t,pl.zRotation(e)),rotateXYZ(t,e){let i=pl.xRotate(t,e.x);return i=pl.yRotate(i,e.y),i=pl.zRotate(i,e.z),i},scale:(t,e,i,s)=>pl.multiply(t,pl.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],p=e[15],x=t[0],S=t[1],A=t[2],v=t[3],b=t[4],M=t[5],E=t[6],w=t[7],T=t[8],k=t[9],C=t[10],R=t[11],I=t[12],F=t[13],D=t[14],L=t[15],P=[];return P[0]=i*x+s*b+r*T+n*I,P[1]=i*S+s*M+r*k+n*F,P[2]=i*A+s*E+r*C+n*D,P[3]=i*v+s*w+r*R+n*L,P[4]=o*x+h*b+a*T+l*I,P[5]=o*S+h*M+a*k+l*F,P[6]=o*A+h*E+a*C+l*D,P[7]=o*v+h*w+a*R+l*L,P[8]=u*x+c*b+d*T+f*I,P[9]=u*S+c*M+d*k+f*F,P[10]=u*A+c*E+d*C+f*D,P[11]=u*v+c*w+d*R+f*L,P[12]=g*x+m*b+y*T+p*I,P[13]=g*S+m*M+y*k+p*F,P[14]=g*A+m*E+y*C+p*D,P[15]=g*v+m*w+y*R+p*L,P},inverse(t){const e=[],i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],y=t[14],p=t[15],x=d*p,S=y*f,A=a*p,v=y*l,b=a*f,M=d*l,E=r*p,w=y*n,T=r*f,k=d*n,C=r*l,R=a*n,I=u*m,F=g*c,D=o*m,L=g*h,P=o*c,_=u*h,V=i*m,B=g*s,z=i*c,N=u*s,O=i*h,U=o*s,G=x*h+v*c+b*m-(S*h+A*c+M*m),Y=S*s+E*c+k*m-(x*s+w*c+T*m),H=A*s+w*h+C*m-(v*s+E*h+R*m),X=M*s+T*h+R*c-(b*s+k*h+C*c),W=1/(i*G+o*Y+u*H+g*X);return e[0]=W*G,e[1]=W*Y,e[2]=W*H,e[3]=W*X,e[4]=W*(S*o+A*u+M*g-(x*o+v*u+b*g)),e[5]=W*(x*i+w*u+T*g-(S*i+E*u+k*g)),e[6]=W*(v*i+E*o+R*g-(A*i+w*o+C*g)),e[7]=W*(b*i+k*o+C*u-(M*i+T*o+R*u)),e[8]=W*(I*l+L*f+P*p-(F*l+D*f+_*p)),e[9]=W*(F*n+V*f+N*p-(I*n+B*f+z*p)),e[10]=W*(D*n+B*l+O*p-(L*n+V*l+U*p)),e[11]=W*(_*n+z*l+U*f-(P*n+N*l+O*f)),e[12]=W*(D*d+_*y+F*a-(P*y+I*a+L*d)),e[13]=W*(z*y+I*r+B*d-(V*d+N*y+F*r)),e[14]=W*(V*a+U*y+L*r-(O*y+D*r+B*a)),e[15]=W*(O*d+P*r+N*a-(z*a+U*d+_*r)),e},projectionPerspective(t,e,i,s){const r=1/Math.tan(t*Math.PI/180/2),n=1/(i-s);return[r/e,0,0,0,0,r,0,0,0,0,(i+s)*n,-1,0,0,i*s*n*2,0]},projectionOrthographic:(t,e,i,s,r,n)=>[2/(e-t),0,0,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(n-r),-(n+r)/(n-r),0,0,0,1]};class xl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Mesh Model 3D",this.Pv=new Float32Array,this.ft={x:1,y:1,z:1},this.Dv={x:0,y:0,z:0},this.Bv={x:0,y:0,z:0},this.Lv={x:0,y:0,z:0},this.Rv={x:0,y:0,z:0},this.Ha=Ve,this.Wd=()=>ue(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ki.getSeries().length;this.Ga=this.yt.Ev().oS(this.sS).ke(fe(this.ts.meshModel3DFillStyle||this.ts.pointSeriesFillStyle,o)).ds(this.getHighlight()),this.fs(this.Ga)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=Pe,n=Le,o=Pe,h=Le,a=Pe,l=Le;for(let t=0;t{const t=this.yt.qv();this.ix.tx(t),this.sx.tx(t);const e=this.hx.viewportChanged(this.nx());e&&this.ox(e),this.cs.vs()},this.hS=(t,e,i,s,r)=>{if(this.Jv){const t=r;this.Xv.push({type:"rotate",rotation:t}),this.cs.vs(),Zt(e)}},this.eS=(t,e)=>{if(this.Qv){if(this.Zv)Math.sign(this.Kv)!==Math.sign(e.deltaY)?this.Kv=ge(e):this.Kv+=ge(e);else{const t=ge(e);this.Xv.push({type:"wheel-zoom",deltaY:t})}this.cs.vs(),Zt(e)}},this.cs.Gn(ah.ff),this.bp.Eh("Chart3D"),this.lx=i.d3(),this.lx.x.K(-1,1),this.lx.y.K(-1,1),this.lx.z.K(-1,1),this.yt=e.ux("chart3D layer3D",0,this.lx),this.ix=e.Ax("chart3D series bg",0),this.sx=e.Um("chart3D axis ui",1),this.gx={x:new ja(this,(h=()=>this.MS,{...Ka(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Mr().x)),Ty:t=>t.x,$y:(t,e)=>({x:t.x,y:e.y,z:e.z}),Kd:f(0,-1,0),Xy: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)}},Qy:()=>!0,Jy:()=>!1,Hy:()=>!1}),this.lx.x,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs),y:new ja(this,Ja((()=>this.MS)),this.lx.y,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs),z:new ja(this,qa((()=>this.MS)),this.lx.z,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs)},this.mx=this.yt.sy([za.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.ts.chart3DBoundingBoxStrokeStyle),this.IS=this.ix.sc(this.engine.scale,hn.Simple).ke(this.ts.chart3DSeriesBackgroundFillStyle).Ce(ot).setMouseInteractions(!0),this.PS=this.ix.sc(this.engine.scale,hn.Simple).ke(z).Ce(this.ts.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.yx({x:1,y:1,z:1},!0),this.hx=new ul(this.engine.scale,this.pixelScale,this.lx,((t,e)=>(e&&this.ox(e),this.yt.Uy(t)))),this.Sx=this.hx.getDefaultCameraConfiguration(this.vx(this.xx)),this.ox(this.Sx),this.rS=Wi(new Zi(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.yt.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.Jv&&!this.Qv)return;const o=(a.locationOne.x-a.locationTwo.x)**2+(a.locationOne.y-a.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,l=De.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.Xv.push({type:"rotate+zoom",rotation:this.Jv?d:{x:0,y:0},cameraDistance:this.Qv?c:l}),this.cs.vs(),Zt(n)}),(t=>{})),new $i((t=>{}),((t,e,i,s,r)=>{if(this.Jv){const t=s;this.Xv.push({type:"rotate",rotation:t}),this.cs.vs(),Zt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.rS.onTouchStart),this.onBackgroundTouchMove(this.rS.onTouchMove),this.onBackgroundTouchEnd(this.rS.onTouchEnd),this.onSeriesBackgroundTouchStart(this.rS.onTouchStart),this.onSeriesBackgroundTouchMove(this.rS.onTouchMove),this.onSeriesBackgroundTouchEnd(this.rS.onTouchEnd),this.onBackgroundMouseDrag(this.hS),this.onBackgroundMouseWheel(this.eS),this.onBackgroundMouseDown(((t,e)=>{Zt(e)})),this.onSeriesBackgroundMouseDrag(this.hS),this.onSeriesBackgroundMouseWheel(this.eS),this.onSeriesBackgroundMouseDown(((t,e)=>{Zt(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.An),this.An(),this.mp(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||nl)(this,this.wS,this.yt,this.ts,this.cs.hs,t);return this.DS(e),e}addLineSeries(t){const e=new il(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointLineSeries(t){const e=new sl(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addSurfaceGridSeries(t){const e=new fl(this,this.wS,this.yt,t,this.ts,this.cs.hs);return this.DS(e),e}addSurfaceScrollingGridSeries(t){const e=new gl(this,this.wS,this.yt,t,this.ts,this.cs.hs);return this.DS(e),e}addBoxSeries(t){const e=new tl(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addMeshModel(t){const e=new xl(this,this.wS,this.yt,this.ts,t,this.cs.hs);return this.DS(e),e}translateCoordinate(t,e,i){if(ml(e)||ml(i)||yl(t)){if(ml(e)&&ml(i)&&yl(t)){if("axes"===e.id&&"world"===i.id)return this.yt.At(t);if("world"===e.id&&"axes"===i.id)return this.yt.St(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return $h(t,e,i,this.pixelScale,this.cs)}getDefaultAxisX(){return this.gx.x}getDefaultAxisY(){return this.gx.y}getDefaultAxisZ(){return this.gx.z}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}get axisZ(){return this.getDefaultAxisZ()}get zAxis(){return this.getDefaultAxisZ()}getDefaultAxes(){return[this.gx.x,this.gx.y,this.gx.z]}setCameraLocation(t){let e={location:t,direction:De.normalize(De.multiply(t,-1))};const i=this.hx.cameraLocationChanged(this.nx(e));return i&&(e=i),this.ox(e),this.cs.vs(),this}getCameraLocation(){return this.yt.getCameraLocation()}getCameraDirection(){return this.yt.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.hx.hv(t);const e=this.hx.cameraLocationChanged(this.nx());return e&&this.ox(e),this}getCameraAutomaticFittingEnabled(){return this.hx.Av()}onCameraChange(t){return this.L.on("cameraChange",t)}offCameraChange(t){return this.L.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.mx.Ee(t).zy(Ya(this.mx.cu())),this.yt.vs(),this}getBoundingBoxStrokeStyle(){return this.mx.cu()}setBoundingBox(t){return this.yx(t,!1),this}yx(t,e){this.xx=t;const i=this.vx(t);if(this.lx.x.tt(i.x),this.lx.y.tt(i.y),this.lx.z.tt(-i.z),!e){const t=this.hx.boundingBoxChanged(this.nx());t&&this.ox(t)}this.cs.vs()}getBoundingBox(){return this.xx}Fe(t){if(ta.kp(this.bp,this.Sp),0!==this.Kv){const e=this.Kv*t*.006;this.Xv.push({type:"wheel-zoom",deltaY:e}),this.Kv=Math.sign(this.Kv)*Math.max(Math.abs(this.Kv)-.01*t,0),0!==this.Kv&&this.cs.vs(!0)}const e=this.getCameraDirection();if(this.Xv.length>0){const t=this.hx.applyCameraInteractions(this.nx(),this.Xv);t&&this.ox(t),this.Xv.length=0}this.bx&&De.equals(this.bx.location,this.Sx.location)&&De.equals(this.bx.direction,this.Sx.direction)||this.L.emit("cameraChange",this,this.getCameraLocation()),this.bx=this.Sx,super.Fe(t);for(let t=0;tthis.yt.Uy(t))),o=this.yt.Uy(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=re(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.ln.length=0,this.lx.U(),this.yt.U(),this.sx.U(),this.ix.U(),super.dispose()}Z(){return this.lx.x.Z(),this.lx.y.Z(),this.lx.z.Z(),super.Z()}J(){return super.J()}ox(t){this.yt.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(De.addVec(t.location,De.multiply(t.direction,-this.jv))),this.Sx=t,this.cs.vs()}vx(t){return De.divide(t,De.length(t)/this.$v)}nx(t=this.Sx){return{boundingBox:this.vx(this.xx),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.Qv=t,this}getMouseInteractionZoom(){return this.Qv}setMouseInteractionRotate(t){return this.Jv=t,this}getMouseInteractionRotate(){return this.Jv}forEachAxis(t){return t(this.gx.x),t(this.gx.y),t(this.gx.z),this}getSeries(){return this.MS}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.Zv=!!t,this}getAnimationZoom(){return this.Zv}}const Al={Column:Co,Row:Ro};class vl extends Jh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Mx=new Map,this._x=this.addUIElement(Al.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(z).setStrokeStyle(ot)))}add(t,e){return(t instanceof Qh?[t]:t instanceof Ff?t.getCells().filter((t=>t.panel instanceof Qh)).map((t=>t.panel)):[]).forEach((t=>{const i=this._x.addElement(sh.VerticalLegendBox).setBackground((t=>t.setFillStyle(z).setStrokeStyle(ot))).add(t,e).setTitle(t.getTitle());this.Mx.set(t,i)})),this.cs.vs(),this}setLegendBoxes(t){return this.Mx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this._x.getSize()}}const bl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Ml=(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(),El=(t,e)=>{let i=e.geometry;return i=wl(t,e,i),i=Tl(t,e,i),i},wl=(t,e,i)=>{if(t===bl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===bl.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=Ze(It(i)),h=[];for(let e=0;ethis.L.on("mouseEnter",t),this.onMouseLeave=t=>this.L.on("mouseLeave",t),this.onMouseClick=t=>this.L.on("mouseClick",t),this.onMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onMouseDown=t=>this.L.on("mouseDown",t),this.onMouseUp=t=>this.L.on("mouseUp",t),this.onMouseMove=t=>this.L.on("mouseMove",t),this.offMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offMouseClick=t=>this.L.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.L.off(t,"mouseDown"),this.offMouseUp=t=>this.L.off(t,"mouseUp"),this.offMouseMove=t=>this.L.off(t,"mouseMove"),this.offMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.L.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.L.on("mapDataReady",t);return this.Dx&&bt.setTimeout((()=>t())),e},this.onViewChange=t=>this.L.on("viewChange",t),this.Bx=(t,e,i,s,r)=>{this.ft.x.tt(s).ei([this.jt.left+this.ya.left,this.jt.right+this.ya.right]),this.ft.y.tt(r).ei([this.jt.bottom+this.ya.bottom,this.jt.top+this.ya.top+ta.Cp(this.bp,this.Sp)]),this.Lx&&this.Rx(this.Ex,this.ft,this.Lx)},this.Ct=(t,i)=>{const s=i;if(!s||!this.Dx)return;const{iRegion:r,region:n}=this.zx(this.Dx,s);this.Tx!==e.AutoCursorModes.disabled&&(this.Vx(n,r),Zt(t)),this.Ix&&this.cs.us._s(n,!0),this.Ox=n,this.L.emit("mouseEnter",this,t)},this.kt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Nx(r,s),this.Ix&&this.cs.us._s(r,!1),this.Ox=void 0,this.L.emit("mouseLeave",this,t),t&&Zt(t)},this.Dt=(t,i)=>{const s=i;if(!s||!this.Dx)return;const{iRegion:r,region:n}=this.zx(this.Dx,s);this.Tx!==e.AutoCursorModes.disabled&&(this.Vx(n,r),Zt(t)),this.Ox=n,this.L.emit("mouseMove",this,t)},this.Tt=(t,e)=>this.L.emit("mouseClick",this,t),this.Ft=(t,e)=>this.L.emit("mouseDoubleClick",this,t),this.It=(t,e)=>this.L.emit("mouseDown",this,t),this.Pt=(t,e)=>this.L.emit("mouseUp",this,t),this.Lt=(t,e,i)=>{this.L.emit("mouseDragStart",this,t,e)},this.Bt=(t,e,i,s,r)=>{this.L.emit("mouseDrag",this,t,e,i,s)},this.Rt=(t,e,i,s)=>{this.L.emit("mouseDragStop",this,t,e,i)},this.Et=(t,e)=>{this.L.emit("mouseWheel",this,t)},this.zt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Vx(r,s),this.Ix&&this.cs.us._s(r,!0),this.Ox=r,this.L.emit("touchStart",this,t),Zt(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Vx(r,s),this.Ox=r,this.L.emit("touchMove",this,t),Zt(t)},this.Ot=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=void 0,this.Nx(r,s),this.Ix&&this.cs.us._s(r,!1),this.Ox=void 0,this.L.emit("touchEnd",this,t),Zt(t)},this.cs.Gn(ah.gf),this.ih=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.Wx=i.Um("mapChart plotting",0),this.onResize(this.Bx),this.bp.Eh("Map Chart");const a=Ft(o?o.autoCursorBuilder:void 0,Ea);this.Ux=a.lm(i.$m(),this.ft,this.ft,this.ts).setVisible(!1),this.Yx=this.hs.yg(),this.mp(n,this.uiScale),this.Hx=this.Wx.$x(this.ft).setMouseInteractions(this.Hi).setMouseEnterEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.kt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseDownEventHandler(((t,e,i)=>this.It(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Dt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Lt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Bt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Rt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Et(e,i))).setTouchStartEventHandler(((t,e,i)=>this.zt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Ot(e,i))).ke(this.ts.mapChartFillStyle).Ce(this.ts.mapChartStrokeStyle),this.Xx=this.Wx.$x(this.ft).setMouseInteractions(this.Hi).ke(this.ts.mapChartOutlierRegionFillStyle).Ce(this.ts.mapChartOutlierRegionStrokeStyle);const l=Ft(o&&o.type,bl.World);this.Ex=l,this.jx(l).then((()=>{this.L.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Ox}setFillStyle(t){return this.Hx.ke(t),this.cs.vs(),this}getFillStyle(){return this.Hx.zh()}setStrokeStyle(t){return this.Hx.Ce(t),this.cs.vs(),this}getStrokeStyle(){return this.Hx.lo()}setEffect(t){return this.Yx.Ss(t),this.cs.vs(),this}getEffect(){return this.Yx.xs()}setOutlierRegionFillStyle(t){return this.Xx.ke(t),this.cs.vs(),this}getOutlierRegionFillStyle(){return this.Xx.zh()}setOutlierRegionStrokeStyle(t){return this.Xx.Ce(t),this.cs.vs(),this}getOutlierRegionStrokeStyle(){return this.Xx.lo()}setSeparateRegionFillStyle(t){return this.Cx="function"==typeof t?t(this.Cx):t,this.wx.forEach((t=>t.ke(this.Cx))),this.cs.vs(),this}getSeparateRegionFillStyle(){return this.Cx}setSeparateRegionStrokeStyle(t){return this.kx="function"==typeof t?t(this.kx):t,this.wx.forEach((t=>t.Ce(this.kx))),this.cs.vs(),this}getSeparateRegionStrokeStyle(){return this.kx}invalidateRegionValues(t){if(!this.Dx||!this.Zx)return this.Qx=this.Qx||[],this.Qx.push(t),this;if("function"==typeof t)for(let e=0;e{t.Jx(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.Jx(e.value)}))}}return this.cs.vs(),this}setAutoCursor(t){return this.Ux&&t(this.Ux),this.cs.vs(),this}getAutoCursor(){return this.Ux}setAutoCursorMode(t){return this.Tx=t,this.cs.vs(),this}getAutoCursorMode(){return this.Tx}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}setMouseInteractions(t){return this.Hi=t,this.Hx.setMouseInteractions(t),this}getMouseInteractions(){return this.Hi}setHighlight(t){var e;return t=Ae(t),this.Fx=t,null===(e=this.Dx)||void 0===e||e.regions.forEach((e=>{this.cs.us._s(e,t)})),this.L.emit("highlight",this,t),this}getHighlight(){return this.Fx}setAnimationHighlight(t){var e;return null===(e=this.Dx)||void 0===e||e.regions.forEach((e=>{this.cs.us.ws(e,t)})),this}getAnimationHighlight(){var t;return this.cs.us.Cs(null===(t=this.Dx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Ix=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Ix}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}offMapDataReady(t){return this.L.off(t,"mapDataReady")}offViewChange(t){return this.L.off(t,"viewChange")}async jx(t){const e=await((t,e)=>{let i;if(t===bl.World)i="countries_world.json";else if(t===bl.NorthAmerica)i="countries_northAmerica.json";else if(t===bl.SouthAmerica)i="countries_southAmerica.json";else if(t===bl.Africa)i="countries_africa.json";else if(t===bl.Europe)i="countries_europe.json";else if(t===bl.Asia)i="countries_asia.json";else if(t===bl.USA)i="states_usa.json";else if(t===bl.Canada)i="territoriesProvinces_canada.json";else{if(t!==bl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw bt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return bt.fetch(s).then((t=>t.json())).catch((t=>{Te(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.dA.Xs);this.Zx=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=kl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.Xx.Vr().Sl(e);if(t===bl.USA){const t=25.8,e=29.7;this.wx.push(this.Wx.Te(this.ft).setMouseInteractions(!1).ke(this.Cx).Ce(this.kx).Ie({x:-126,y:t}).tt({x:10,y:e-t}),this.Wx.Te(this.ft).setMouseInteractions(!1).ke(this.Cx).Ce(this.kx).Ie({x:-113,y:t}).tt({x:7,y:e-t}))}const s=this.cs.us.zr(this.Hx,{animationEnabled:this.ih});for(let i=0;i{o.forEach((e=>e.ds(t)))}))}if(this.Yx.As([this.Hx]),this.Lx=i,this.Rx(t,this.ft,i),this.Dx=e,this.Qx){for(const t of this.Qx)this.invalidateRegionValues(t);this.Qx=void 0}this.cs.vs()}Rx(t,e,i){const s=Cl[t],r=e.x.getCellSize(),n=e.y.getCellSize()/r,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(ns){const t=(o.max.y-o.min.y)*(n/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.K(o.min.x,o.max.x),e.y.K(o.min.y,o.max.y);const h=this.ft.x.ui(),a=this.ft.y.ui();this.L.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:a[1],bottom:a[0],left:h[0],right:h[1]}})}Vx(t,e){this.Kx={region:t,iRegion:e},this.cs.vs()}Nx(t,e){this.Kx&&t===this.Kx.region&&(this.Kx=void 0,this.cs.vs())}zx(t,e){const i=Array.from(this.Px.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.ih=!t,this}getAnimationsEnabled(){return this.ih}getMinimumSize(){}Qd(){return[this]}Fe(t){super.Fe(t),super.pp(),ta.kp(this.bp,this.Sp);const e=y(this.ft.x.hi(),this.ft.y.hi(),this.ft.x.ni(),this.ft.y.ni());this.Wx.tx(e);const i=this.cs.Nn()||this.Gx;if(this.Kx&&i){const t=this.Zx&&this.Zx[this.Kx.iRegion];let e=dt(i,this.engine.scale,this.ft);e={x:Rt(e.x,this.ft.x.getInnerStart(),this.ft.x.getInnerEnd()),y:Rt(e.y,this.ft.y.getInnerStart(),this.ft.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.Kx.region.transform;this.Kx.region.outlier&&n&&(s=(s-n.translate.x-n.vertexBoundaries.min.x)/n.scale.x+n.vertexBoundaries.min.x,r=(r-n.translate.y-n.vertexBoundaries.min.y)/n.scale.y+n.vertexBoundaries.min.y),this.Ux.setPosition(e).setVisible(!0).getResultTable().setContent(this.Om(new la,this.Kx.region,t,s,r,this).Qu())}else this.Ux.setVisible(!1);return this.Ux.Ds().Fe(),this}dispose(){return this.Wx.U(),this.Ux.dispose(),Kh(this.ft),super.dispose()}Z(){return super.Z(),this.ft.Z(),this}J(){return super.J(),this.ft.J(),this}Wd(){return ue(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))),le(t,this.ts,i,{fill:this.getFillStyle()}),this}}const Il=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(Fl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Fl=(t,e)=>{const i=t>0,s=e>0;return`${[de(Math.abs(0|t),2),"° ",de(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[de(Math.abs(0|e),2),"° ",de(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class Dl extends Js{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.qx(i),s,r,{numeric:e.tb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.tb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.tb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.ib=n,this.sb=o,this.eb=h,this.hs=a,this.hb=i,this.rb=e.tb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Rh=h.Dr(i).setMouseInteractions(!1).Nh(e.tb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.tb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Uh=this.hs.yg([this.Rh]).Ss(s.effectsText)}setTickStrategy(t,e){return super.Ih(t,e)}setStrokeStyle(t){return this.rb="function"==typeof t?t(this.rb):t,this.sb.vs(),this}getStrokeStyle(){return this.rb}cr(t,e){return new Ll(e,t,this.hb,this.eb,this.nb(this.ib,this.hb),this.eb.ze(this.hb).setMouseInteractions(!1))}dr(t,e){const i=this.ob(this.hb,t);this.ab&&!1===this.ab(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(oi(this.lb(this.hb,t.S),i.padding)).za(i.alignment).Gh(i.rotation).Pa(i.offset.x,i.offset.y),this.ub(this.hb,t.cb,t.fb,t)}setMouseInteractions(t){return this}Fe(){this.tr({physicalAxisSize:0});const t=this.pr(((t,e)=>{const i=e.xh.ur,s=.5*this.rb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().Zc().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Ab(this.hb,this.rb,t),this.gb(this.hb,this.Rh,t),t}}class Ll extends qs{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.cb=r,this.fb=n,r.setMouseInteractions(!1),this.ss.push(r,n)}}class Pl extends Dl{constructor(t,e,i,s,r,n,o,h,a){super(t,_l((()=>this.wg())),e,i,s,r,n,o,h),this.Ey=this.sb.ze(this.hb).setMouseInteractions(!1),this.pb=a,this.setScrollStrategy(zs.expansion),this.setTickStrategy(Ns.Numeric),this.setTitle("Amplitude")}wg(){return this.pb()}wr(t,e){return oh(t,e,this.hb.y)}kr(t,e,i){const s=2*(e-t),r=this.hb.x.Ri(s);return{min:t-i*r,max:e+i*r}}lb(t,e){return{x:t.mb()?e-t.yb().start:t.yb().start-e,y:0}}nb(t,e){return t.Kc(e)}ub(t,e,i,s){const r=s.xh.ur,n=t.mb()?s.S-t.yb().start:t.yb().start-s.S;Ct(s.S,t.yb().start)||Ct(s.S,t.yb().end)?e.setVisible(!1):e.setVisible(!0).hu(0).Ve(360).lu(void 0).au(0).ru(n).lu(60).ke(z).Ce(r.gridStrokeStyle);const o=.5*this.rb.getThickness();i.Oe({x:n,y:-o*t.Ui().y}).Ve({x:n,y:-(o+r.tickLength)*t.Ui().y}).Ee(r.tickStyle)}ob(t,e){const i=e.xh.ur;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ui().y*-(.5*this.rb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Ab(t,e,i){const s=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;this.Ey.Oe({x:0,y:0}).Ve({x:s,y:0}).Ee(e)}gb(t,e,i){const s=t.mb()?(t.yb().start+t.yb().end)/2-t.yb().start:t.yb().start-(t.yb().start+t.yb().end)/2;e.za({x:0,y:1}).Ie({x:s,y:-i*t.Ui().y})}}const _l=t=>({...Ka(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),qx:t=>({getInnerStart:()=>t.yb().start,getInnerEnd:()=>t.yb().end,K:(e,i)=>t.Sb(e,i),ot:(e,i,s,r,n)=>t.y.ot(e,i,s,r,n)}),tb:t=>t.amplitude});class Vl extends Dl{constructor(t,e,i,s,r,n,o,h){super(t,zl,e,i,s,r,n,o,h),this.vb=90,this.xb=12,this.bb=Bl,this.Ey=this.sb.Kc(this.hb).setMouseInteractions(!1),this.ab=t=>{let e=180*(t.S-this.hb.Mb())/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.Ke=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.vb)}setTickStyle(t){return this._b="function"==typeof t?t(this._b):t,this.wb(),this.sb.vs(),this}getTickStyle(){return this._b}setTickFormattingFunction(t){return this.bb=t,this.wb(),this.sb.vs(),this}getTickFormattingFunction(){return this.bb}setClockwise(t){this.hb.Cb(t);const e=this.vb*Math.PI/180;return t?this.hb.kb(e+Math.PI/2):this.hb.kb(e-Math.PI/2),this.sb.vs(),this}getClockwise(){return!this.hb.Tb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.vb=t;const e=t*Math.PI/180;return this.getClockwise()?this.hb.kb(e+Math.PI/2):this.hb.kb(e-Math.PI/2),this.sb.vs(),this}getNorth(){return 180*this.hb.Mb()/Math.PI}setDivision(t){return this.xb=t,this.wb(),this.sb.vs(),this}getDivision(){return this.xb}wg(){return[]}wr(t,e){return e}kr(t,e,i){return{min:t,max:e}}lb(t,e){const i=t.Tb()?1:-1,s=t.Mb(),r=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}nb(t,e){return t.ze(e)}ub(t,e,i,s){const r=this._b,n=t.Tb()?1:-1,o=t.Mb(),h=(s.S-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).Ve(c);const d={x:c.x+a*r.tickLength*t.Ui().x,y:c.y+l*r.tickLength*t.Ui().y};i.Oe(c).Ve(d),e.Ee(r.gridStrokeStyle),i.Ee(r.tickStyle)}ob(t,e){const i=this._b,s=t.Tb()?1:-1,r=t.Mb();let n,o=(e.S-r)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;n=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const h=i.tickLength+i.tickPadding,a=Math.cos(o)*h*t.Ui().x,l=Math.sin(o)*h*t.Ui().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Ab(t,e,i){const s=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;this.Ey.hu(0).Ve(360).au(0).ru(s+.5*e.getThickness()*t.Ui().x).lu(360).ke(z).Ce(e)}gb(t,e,i){const s=t.Mb(),r=this.ob(t,{S:0+s}),n=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;e.za(r.alignment).Gh(r.rotation).Pa(r.offset.x,r.offset.y).Ie(oi({x:n,y:0},r.padding))}wb(){this.Xh({$e:[],Xe:[{Ye:"Radial ticks",Eg:0,ur:this._b,ar:this.bb,Lr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.xb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},bh:{Ar:()=>{},Mh:()=>!1},Rr:void 0}],We:Bl,jh:void 0,Zh:void 0})}}const Bl=(t,e,i)=>(180*t/Math.PI).toFixed(0),zl={Sr:()=>{},vr:()=>{},Mr:()=>{},qx:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,K:(t,e)=>{},ot:(e,i,s,r,n)=>t.x.ot(e,i,s,r,n)}),tb:t=>t.radial},Nl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Ol=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Ul extends Yi{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ms="Sector",this.Fb=0,this.Ib=1*Math.PI/2,this.Pb=void 0,this.Db=void 0,this.Ts=t,this.hb=s,this._m=this.Ts.Kc(this.hb).ds(this.getHighlight()),this.fs(this._m),this.be=r.polarSectorFillStyle,this.Me=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.Fb=Rt(t,0,360),this.Ts.vs(),this}getAngleStart(){return this.Fb}setAngleEnd(t){return this.Ib=Rt(t,0,360),this.Ts.vs(),this}getAngleEnd(){return this.Ib}setAmplitudeStart(t){return this.Pb=t,this.Ts.vs(),this}getAmplitudeStart(){return this.Pb}setAmplitudeEnd(t){return this.Db=t,this.Ts.vs(),this}getAmplitudeEnd(){return this.Db}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.vs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.vs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.hb.yb(),e=180*this.hb.Mb()/Math.PI,i=void 0!==this.Pb?Rt(this.Pb,t.start,t.end):t.start,s=void 0!==this.Db?Rt(this.Db,t.start,t.end):t.end,r=this.hb.mb()?i-t.start:t.start-i,n=this.hb.mb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.hb.Tb()?1:-1,l=Math.abs(this.Ib-this.Fb);this._m.hu((this.Fb-e)*a).Ve((this.Ib-e)*a).au(100*o/h).ru(h).ke(this.be).Ce(this.Me).lu(Math.ceil(l/2))}Pe(t,e){t.ds(e),this.Ts.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}}class Gl extends Yi{constructor(){super(...arguments),this.iS=!0,this.Bb=!0}setAutoScrollingEnabled(t){return this.iS=t,this.Ki.cs.vs(),this}getAutoScrollingEnabled(){return this.iS}aS(){}Fe(){}Ay(){}setCursorEnabled(t){return this.Bb=t,this}getCursorEnabled(){return this.Bb}}class Yl extends Gl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ts=t,this.Ki=e,this.scale=s}getAmplitudeMin(){return this.Lb?this.Lb.min:void 0}getAmplitudeMax(){return this.Lb?this.Lb.max:void 0}}const Hl=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s))},Xl=(t,e)=>{const i=[],s=e.yb().start,r=e.yb().end,n=e.mb(),o=e.Tb()?1:-1,h=e.Mb(),a=Math.abs(r-s),l=Math.min(s,r)+.001*a,u=Math.max(s,r)-.001*a;for(const e of t){const t=Rt(e.amplitude,l,u),r=e.angle*Math.PI/180-h,a=Math.cos(r*o)*(n?t-s:s-t),c=Math.sin(r*o)*(n?t-s:s-t),d=e.color;i.push({x:a,y:c,color:d})}return i},Wl=t=>{const e={min:Le,max:Pe};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},jl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),$l=(t,e)=>{let i=yi(t);for(e.Tb()||(i*=-1),i+=180*e.Mb()/Math.PI;i<0;)i+=360;i%=360;const s=ri(t),r=e.yb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Pn(r.start,r.end,s/n)}};class Zl extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.Ms="Heatmap Series",this.Rb=!0,this.fS=!1,this.Om=Kl,this.Wd=()=>ue(this.be);const h=this.Ki.getSeries().length;this.be=fe(this.ts.polarHeatmapSeriesFillStyle||this.ts.heatmapGridSeriesFillStyle,h);const a=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-a)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:a,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.Yn=u,this.Eb=t.zb(s,[],u).ke(this.be).ds(this.getHighlight()),this.fs(this.Eb);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.Lb={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),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.Yn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Yn.dataOrder?t.length:t[0].length},i="annuli"===this.Yn.dataOrder?this.Yn.annuli:this.Yn.sectors,s="annuli"===this.Yn.dataOrder?this.Yn.sectors:this.Yn.annuli;if(e.x>i||e.y>s){if(!0===this.Ki.dA.$n){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.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${h}, input ${e.primary}x${e.secondary} starting at [${i},${r}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const a=Math.max(s-o,0),l=e.primary-a,u=Math.max(n-h,0),c=[];for(let e=0;e0?-u:void 0);if(0===(t={iSector:t.iSector,iAnnulus:t.iAnnulus,values:c}).values.length||0===t.values[0].length)return this}this.Eb.wv({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Ts.vs(),this.fS=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Eb.ke(this.be),this.Ts.vs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}clear(){return this.Eb.Gt(),this.Ts.vs(),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.Eb.Mv(t),this.Ts.vs(),this}getIntensityInterpolation(){return this.Eb._v()}qy(){return this.iS&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=dt(t,this.Ki.engine.scale,this.scale),s=$l(i,this.scale),r=this.Rb?this.Eb.Vb(s):this.Eb.$c(s);if(r)return wa(Xl([r],this.scale)[0],this.scale,this.Om(new la,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ki.getAmplitudeAxis().formatValue).Qu(),this,this.be)}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),le(t,this.ts,i,{fill:this.be}),this}}const Kl=(t,e,i,s)=>{const r=e.getIcon();return r?t.addRow(r,e.getName()):t.addRow(e.getName()),t.addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1))};class Jl extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Line Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.Om=Hl,this.uu=fe(this.ts.polarLineSeriesStrokeStyle,n),this.Wb=t.sy(s,void 0,[za.UserSeries]).Ee(this.uu).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.Wb)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Wb.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.uu}setConnectDataAutomaticallyEnabled(t){return this.Gb=t,this.Ts.vs(),this}getConnectDataAutomaticallyEnabled(){return this.Gb}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){return this.Ub(t,this.Wb)}solveNearestFromScreen(t){return this.Ub(rh(t,this.Ki.cs),this.Wb)}Ub(t,e){const i=e.Yb(t);if(!i)return;const{angle:s,amplitude:r}=$l(i,this.scale);return wa(i,this.scale,this.Om(new la,this,s,r,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,this.uu.getFillStyle())}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.Gb?(t.push({...t[0]}),this.Wb.Vl(!0)):this.Wb.Vl(!1),this.Wb.Gt().ol(t).Ho(e),this.Nb=!1,this.Wb.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.uu}),this}}class ql extends Yl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Ms="Point Line Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.$b=3,this.ga=0,this.Xb=e.PointShape.Circle,this.Om=Hl,this.be=fe(this.ts.polarPointLineSeriesFillStyle,o),this.uu=fe(this.ts.polarPointLineSeriesStrokeStyle,o),this.Wb=t.sy(r,void 0,[za.UserSeries]).Ee(this.uu).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.Wb),this.jb=t.bS(r).ke(this.be).sl(this.Xb).tt(this.$b).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.jb)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Wb.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.uu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.jb.ke(e),this.Ts.vs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.$b=t,this.jb.tt(t),this.Ts.vs(),this}getPointSize(){return this.$b}setPointShape(t){return this.Xb=t,this.jb.sl(this.Xb),this}getPointShape(){return this.Xb}setPointRotation(t){return this.ga=t,this.jb.Gh(t),this.Ts.vs(),this}getPointRotation(){return this.ga}setConnectDataAutomaticallyEnabled(t){return this.Gb=t,this.Ts.vs(),this}getConnectDataAutomaticallyEnabled(){return this.Gb}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){return this.Ub(t,this.Wb)}solveNearestFromScreen(t){return this.Ub(rh(t,this.Ki.cs),this.Wb)}Ub(t,e){const i=e instanceof tn?e.$c(t):e.Yb(t);if(!i)return;const{angle:s,amplitude:r}=$l(i,this.scale);return wa(i,this.scale,this.Om(new la,this,s,r,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,"color"in i&&X(this.be)?new G({color:i.color}):this.be)}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.Gb?(t.push({...t[0]}),this.Wb.Vl(!0)):this.Wb.Vl(!1),this.Wb.Gt().ol(t).Ho(e),this.jb.Gt().ol(t).Ho(e),this.Nb=!1,this.Wb.Ds(),this.jb.Ds()}}ks(){return this.bs||this.Xb}}class Ql extends fn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Go=Ie(),this.L=new r.Eventer,this.Xi=!1,this.Zb=s,this.Qb=n,this.Jb=o,this.Kb=h,this.qb=a,this.Ts=t,this.scale=e,this.tM=i,this.ts=l}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}dispose(){return this.tM&&this.tM(this),this.Ts.cs.vs(),this.L.emit("dispose",this),this.Xi=!0,this}setVisible(t){return super.setVisible(t),this.Jb(),this.Ts.cs.vs(),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setMouseInteractions(t){return this.Kb(this,t),this}getMouseInteractions(){return this.qb(this)}}class tu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,y,p){super(t,e,i,s,r,n,o,h,p),this.iM=1,this.sM=1,this.Ts=t,this.scale=e,this.dimensionStrategy=a,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=y,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,y)),this.eM=this.ts.boxSeriesBodyFillStyle,this.hM=this.ts.boxSeriesBodyStrokeStyle,this.uu=this.ts.boxSeriesStrokeStyle,this.rM=this.ts.boxSeriesMedianStrokeStyle,this.Ds()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.iM=t,this.Ds(),this}getBodyWidth(){return this.iM}setBodyFillStyle(t){return this.eM="function"==typeof t?t(this.eM):t,this.Qb(),this}getBodyFillStyle(){return this.eM}setBodyStrokeStyle(t){return this.hM="function"==typeof t?t(this.hM):t,this.Qb(),this}getBodyStrokeStyle(){return this.hM}setTailWidth(t){return this.sM=t,this.Ds(),this}getTailWidth(){return this.sM}setStrokeStyle(t){return this.uu="function"==typeof t?t(this.uu):t,this.Qb(),this}getStrokeStyle(){return this.uu}setMedianStrokeStyle(t){return this.rM="function"==typeof t?t(this.rM):t,this.Qb(),this}getMedianStrokeStyle(){return this.rM}Ds(){this.Zb()}getDominantStyle(){return this.getBodyFillStyle()}}const eu=(t,e,i)=>{const s=e.ft,r=i.ft;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.hg&&(n=1-n),1===e.hg&&(o=1-o),u(o,n)};class iu extends fa{constructor(t,e,i,s,r,n,o,h){super(t,e,Bi(i.ft,s.ft),r,h),this.nM=!1,this.oM=!1,this.aM=!0,this.lM=!0,this.uM=!1,this.cM=!1,this.setGridStrokeYStyle=t=>(this.dM.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.dM.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.fM=n,this.AM=o,this.gM=this.axisX.Hg(!1,this.fM).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.dM=this.axisY.Hg(!1,this.AM).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.gM.dispose(),this.dM.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(dt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.gM.setValue(t.x),this.dM.setValue(t.y);const e=eu(u(this.gM.getValue(),this.dM.getValue()),this.axisX,this.axisY);return this.gM.setGridStrokeLength(this.uM?e.x:1),this.dM.setGridStrokeLength(this.cM?e.y:1),this}Fe(){this.gM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.nM),this.dM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.oM);const t=eu(u(this.gM.getValue(),this.dM.getValue()),this.axisX,this.axisY);return this.gM.setGridStrokeLength(this.uM?t.x:1),this.dM.setGridStrokeLength(this.cM?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.uM=t,this.Ts.vs(),this}getGridStrokeXCut(){return this.uM}setGridStrokeYCut(t){return this.cM=t,this.Ts.vs(),this}getGridStrokeYCut(){return this.cM}setGridStrokeXStyle(t){return this.gM.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.gM.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.nM=t,this.Ts.vs(),this}getTickMarkerXVisible(){return this.nM}setTickMarkerYVisible(t){return this.oM=t,this.Ts.vs(),this}getTickMarkerYVisible(){return this.oM}setTickMarkerX(t){return this.gM.setMarker(t),this}setTickMarkerY(t){return this.dM.setMarker(t),this}getTickMarkerX(){return this.gM.getMarker()}getTickMarkerY(){return this.dM.getMarker()}}class su extends da{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.uM=!1,this.cM=!1,this.pM=!1,this.mM=!1,this.yM=new Map,this.SM=new Map,this.nM=!0,this.oM=!0,this.tm=s,this.fM=r,this.AM=n,this.vM=o.cursorGridStrokeStyleX,this.xM=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.yM.forEach((t=>t.dispose())),this.SM.forEach((t=>t.dispose())),this.bM=void 0,this.MM=void 0,this}Fe(){return this.bM&&this.bM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.nM),this.MM&&this.MM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.oM),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof yu&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:r}=i,n=this.gh(s,!0),o=this.gh(r,!1);n!==this.bM&&this.bM&&this.bM.setVisible(!1),o!==this.MM&&this.MM&&this.MM.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=eu(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.uM?h.x:1),o.setGridStrokeLength(this.cM?h.y:1),this.bM=n,this.MM=o,super.pointAt(t)}rm(t){if(super.rm(t),t){const e=e=>e.setTextFillStyle(t);this.bM&&this.pM&&this.bM.setMarker(e),this.MM&&this.mM&&this.MM.setMarker(e)}}gh(t,e){let i=(e?this.yM:this.SM).get(t);return i||(e?(i=t.Hg(!1,this.fM),this.yM.set(t,i)):(i=t.Hg(!1,this.AM),this.SM.set(t,i)),this.lr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}lr(t,e){const i=e?this.vM:this.xM;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.nM:this.oM)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.uM=t,this.Ts.vs(),this}getGridStrokeXCut(){return this.uM}setGridStrokeYCut(t){return this.cM=t,this.Ts.vs(),this}getGridStrokeYCut(){return this.cM}setGridStrokeXStyle(t){return this.vM=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.yM.forEach((t=>t.setGridStrokeStyle(this.vM))),this}getGridStrokeXStyle(){return this.vM}setGridStrokeYStyle(t){return this.xM=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.SM.forEach((t=>t.setGridStrokeStyle(this.xM))),this}getGridStrokeYStyle(){return this.xM}setTickMarkerXVisible(t){return this.nM=t,this.Ts.vs(),this}getTickMarkerXVisible(){return this.nM}setTickMarkerYVisible(t){return this.oM=t,this.Ts.vs(),this}getTickMarkerYVisible(){return this.oM}setTickMarkerX(t){return this.yM.forEach((e=>e.setMarker(t))),this.fM=this.fM.addStyler(t),this.Ts.vs(),this}setTickMarkerY(t){return this.SM.forEach((e=>e.setMarker(t))),this.AM=this.AM.addStyler(t),this.Ts.vs(),this}setTickMarkerXAutoTextStyle(t){return this.pM=t,this.Ts.vs(),this}getTickMarkerXAutoTextStyle(){return this.pM}setTickMarkerYAutoTextStyle(t){return this.mM=t,this.Ts.vs(),this}getTickMarkerYAutoTextStyle(){return this.mM}}class ru extends ga{constructor(t,e,i,s){super(t,s),this.tm=t,this.fM=e,this.AM=i,this.nm=s}}class nu extends ru{constructor(){super(...arguments),this.am=(t,e,i,s)=>this.om(new su(t,e,i,this.tm,this.fM,this.AM,s),s),this.addStyler=t=>new nu(this.tm,this.fM,this.AM,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new nu(t,this.fM,this.AM,this.nm.map((t=>t)))}}class ou extends ru{constructor(){super(...arguments),this.lm=(t,e,i,s,r)=>this.om(new iu(t,e,i,s,this.tm,this.fM,this.AM,r),r),this.addStyler=t=>new ou(this.tm,this.fM,this.AM,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ou(t,this.fM,this.AM,this.nm.map((t=>t)))}}const hu=new nu(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{pa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),au=new ou(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{xa(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),lu=new ou(mo,ih.PointableTextBox,ih.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),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),uu=(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}},cu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class du{constructor(t,i,s,n,o,h){this._M=e.UIVisibilityModes.always,this.wM=e.UIVisibilityModes.always,this.Lo=!0,this.Xi=!1,this.CM=!1,this.kM=!1,this.ca=u(0,0),this._u=e.UIDraggingModes.draggable,this.wu=void 0,this.L=new r.Eventer,this.ji=!0,this.TM=(t,i,s)=>{this.CM=!0,this.Ts.vs();const r=this._u===e.UIDraggingModes.notDraggable?this._u:s||this._u;this.wu=this.Ts.cs.Ur(r===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:r===e.UIDraggingModes.draggable?e.MouseStyles.Move:r===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.FM=()=>{this.CM=!1,this.Ts.vs(),this.Ts.cs.Yr(this.wu)},this.IM=(t,e)=>{this.kM=!0,Zt(e),this.Ts.vs()},this.PM=(t,i)=>{if(this._u!==e.UIDraggingModes.notDraggable){const s=i||this._u,r=dt(this.Ts.cs.De(t.x,t.y),this.Ts.cs.ft,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?cu(r.x,this.scale.x):this.ca.x,s!==e.UIDraggingModes.onlyHorizontal?cu(r.y,this.scale.y):this.ca.y);return this.setPosition(n),!0}return!1},this.DM=(t,e)=>{this.kM=!1,Zt(e),this.Ts.vs()},this.onDispose=t=>this.L.on("dispose",t),this.offDispose=t=>this.L.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Ux=n,this.BM=o,this.ts=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.TM(t,e))),a.onMouseLeave(this.FM),a.onMouseDragStart(this.IM),a.onMouseDrag(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),a.onMouseDragStop(this.DM),a.onTouchStart(this.IM),a.onTouchMove(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),a.onTouchEnd(this.DM),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.ca)}setPosition(t){return this.ca=t,this.Ux.setPosition(t),this.L.emit("positionChange",this,this.ca),this}getPosition(){return this.ca}onPositionChange(t){return this.L.on("positionChange",t)}offPositionChange(t){return this.L.off(t,"positionChange")}setPointMarkerVisibility(t){return this._M=t,this.Ts.vs(),this}getPointMarkerVisibility(){return this._M}setResultTableVisibility(t){return this.wM=t,this.Ts.vs(),this}getResultTableVisibility(){return this.wM}setMouseInteractions(t){return this.Lo=t,this.Ux.getPointMarker().setMouseInteractions(t),this.Ux.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.Lo}setAutoFitStrategy(t){return this.Ux.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Ux.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return uu(this._M,this.CM,this.kM)?this.Ux.setPointMarkerVisible(!0):this.Ux.setPointMarkerVisible(!1),t&&uu(this.wM,this.CM,this.kM)?this.Ux.setResultTableVisible(!0):this.Ux.setResultTableVisible(!1),this.Ux.Fe(),this}Ds(){return this.Ux.Ds(),this}pointAt(t){return this.Ux.pointAt(t),this}dispose(){return this.Xi||(this.Xi=!0,this.BM(this),this.Ux.dispose(),this.L.emit("dispose")),this}isDisposed(){return this.Xi}setVisible(t){const e=this.ji!==t;return this.ji=t,this.Ux.setVisible(t),e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}setPointMarker(t){return this.Ux.setPointMarker(t),this}getPointMarker(){return this.Ux.getPointMarker()}setResultTable(t){return this.Ux.setResultTable(t),this}getResultTable(){return this.Ux.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this._u=t,this.Ts.vs(),this}getDraggingMode(){return this._u}}class fu extends du{constructor(t,i,s,r,n,o,h){super(t,i,Bi(s.ft,r.ft),n.lm(t,i,s,r,h),o,h),this.LM=e.UIVisibilityModes.always,this.RM=e.UIVisibilityModes.always,this.EM=e.UIVisibilityModes.always,this.zM=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Ux.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Ux.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=r,this.BM=o;const a=this.Ux.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.TM(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.FM),a.onMouseDragStart(this.IM),a.onMouseDrag(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i))),a.onMouseDragStop(this.DM),a.onTouchStart(this.IM),a.onTouchMove(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i)));const l=this.Ux.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.TM(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.FM),l.onMouseDragStart(this.IM),l.onMouseDrag(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i))),l.onMouseDragStop(this.DM),l.onTouchStart(this.IM),l.onTouchMove(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i)))}Fe(){const t=this.isAttached();return this.ji&&t&&uu(this.EM,this.CM,this.kM)?this.Ux.setTickMarkerXVisible(!0):this.Ux.setTickMarkerXVisible(!1),this.ji&&t&&uu(this.zM,this.CM,this.kM)?this.Ux.setTickMarkerYVisible(!0):this.Ux.setTickMarkerYVisible(!1),this.Ux.setGridStrokeXStyle(this.ji&&t&&uu(this.LM,this.CM,this.kM)?this.gridStrokeStyleX:ot),this.Ux.setGridStrokeYStyle(this.ji&&t&&uu(this.RM,this.CM,this.kM)?this.gridStrokeStyleY:ot),super.Fe()}setGridStrokeXVisibility(t){return this.LM=t,this.Ts.vs(),this}getGridStrokeXVisibility(){return this.LM}setGridStrokeYVisibility(t){return this.RM=t,this.Ts.vs(),this}getGridStrokeYVisibility(){return this.RM}setTickMarkerXVisibility(t){return this.EM=t,this.Ts.vs(),this}getTickMarkerXVisibility(){return this.EM}setTickMarkerYVisibility(t){return this.zM=t,this.Ts.vs(),this}getTickMarkerYVisibility(){return this.zM}setGridStrokeXCut(t){return this.Ux.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Ux.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Ux.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Ux.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Ux.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Ux.getGridStrokeYStyle()}setTickMarkerX(t){return this.Ux.setTickMarkerX(t),this}getTickMarkerX(){return this.Ux.getTickMarkerX()}setTickMarkerY(t){return this.Ux.setTickMarkerY(t),this}getTickMarkerY(){return this.Ux.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Ux.getTickMarkerX().setMouseInteractions(t),this.Ux.getTickMarkerY().setMouseInteractions(t),this}}class gu extends fu{}class mu extends gu{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.VM=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.VM=!1,this.Ts.vs(),this}Ds(){if(!this.VM){const t=this.owningSeries.solveNearestFromScreen(dt(this.ca,this.scale,this.Ts.cs.ft));t?(this.ca=dt(t.location,this.owningSeries.scale,this.scale),this.Ux.pointAt(t),this.VM=!0):this.Ux.setPosition(this.ca)}return super.Ds()}isAttached(){return this.VM}}class yu extends Gl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.OM=[],this.addMarker=(t=lu)=>{const e=new mu(this.NM(),this.Ki.uiScale,this,t,this.removeMarker,this.ts);return this.OM.push(e),e},this.removeMarker=t=>{const e=this.OM.indexOf(t);-1!==e&&this.OM.splice(e,1)},this.ss=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.NM=h,this.scale=Bi(s.ft,r.ft),this.GM=t.WM,t.WM+=1,this.UM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.YM),this.onMouseLeave(this.chart.HM),this.onMouseWheel(this.chart.eS),this.onMouseDragStart(this.chart.$M),this.onMouseDrag(this.chart.hS),this.onMouseDragStop(this.chart.XM),this.onTouchStart(this.chart.rS.onTouchStart),this.onTouchMove(this.chart.rS.onTouchMove),this.onTouchEnd(this.chart.rS.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}attacheAxis(){this.jM=this.axisXAttachHandler(this),this.ZM=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.Ko(this.GM)})),this.Ki.cs.vs(),this}dispose(){return super.dispose(),this.OM.slice().forEach((t=>t.dispose())),this.jM(this),this.ZM(this),this}QM(){for(let t=0;t{const r=t.length;let n=0;if(void 0!==e){const r=i-e;if(r>0){const e=t.slice(n,r);n+=r,s(e,!0)}}for(;nt)=>{const i=[];let s;for(let r=0;r{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const r=e.getIcon();return r?t.addRow(r,e.getName()):t.addRow(e.getName()),t.addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s))};class vu extends yu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.JM=[],this.yu=[],this.KM=0,this.Zi=!1,this.$i=e.HighlightModes.onHover,this.Om=Au,this.Ki.cs.Gn(ah.mf),this.qM=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.KM=void 0!==e&&e>0?e:0,this.Ts.vs(),this}add(t){if(0!==this.JM.length&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)?this.t_(t):this.t_([t]),this.yu.length>0){const t=this.yu[this.yu.length-1];this.i_={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.i_?this.i_.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.al()+e.ll()),this.yu.length)}clear(){this.s_=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.qM.getXMax(this.JM,this.s_)||0}getXMin(){return this.qM.getXMin(this.JM,this.s_)||0}getYMax(){return this.qM.getYMax(this.JM,this.s_)||0}getYMin(){return this.qM.getYMin(this.JM,this.s_)||0}Mr(){const t=u(0,0);for(const e of this.JM)t.x=Math.max(t.x,e.xl()),t.y=Math.max(t.y,e.bl());return t}e_(t,e,i,s){this.qM.e_(t,e,i,s,this.scale,(t=>{}))}aS(){super.aS();const t=this.JM.length;this.h_&&this.e_(this.JM,this.getPointAmount(),this.h_,this.KM),t!==this.JM.length&&this.QM()}Fe(){super.Fe();const t=this.getBoundaries();this.yu.length>0&&(this.r_(this.yu),this.yu=[]);for(const e of this.JM)e.Ho(t);return super.Fe()}Ay(){super.Ay(),this.s_=void 0,this.yu.length=0}t_(t){0!==t.length&&(this.s_?this.s_=Je(this.s_,Ze(t)):this.s_=Ze(t),this.L.emit("dataAdd",this,t,this.s_),this.yu=ne(this.yu,t,{canReturnB:!1}),this.Ts.vs())}n_(){return xu(this.JM)}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}}const bu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.c_.findIndex((e=>e===t));e>=0&&this.c_.splice(e,1),this.f_=!0,this.d_=void 0,this.Ts.vs()},this.Zb=()=>{this.d_=void 0,this.f_=!0,this.Ki.cs.vs()},this.Qb=()=>{this.f_=!0,this.Ki.cs.vs()},this.Jb=()=>{this.d_=void 0,this.f_=!0,this.chart.cs.vs()},this.Kb=(t,e)=>{this.setMouseInteractions(e)},this.A_=t=>this.getMouseInteractions()}Fe(){super.Fe(),this.f_&&(this.g_(this.c_),this.f_=!1)}clear(){return this.c_.slice().forEach(Tt),this.c_.length=0,this.f_=!0,this.d_=void 0,this.Ts.vs(),this}p_(t,e){void 0!==e?this.c_.splice(e,0,t):this.c_.push(t),this.f_=!0,this.m_&&this.m_(t),t.onMouseEnter(((t,e)=>this.Ct(t,e))),t.onMouseLeave(((t,e)=>this.kt(t,e))),t.onMouseClick(((t,e)=>this.Tt(t,e))),t.onMouseDoubleClick(((t,e)=>this.Ft(t,e))),t.onMouseDown(((t,e)=>this.It(t,e))),t.onMouseUp(((t,e)=>this.Pt(t,e))),t.onMouseMove(((t,e)=>this.Dt(t,e))),t.onMouseDragStart(((t,e,i)=>this.Lt(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.Bt(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.Rt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Et(t,e))),t.onTouchStart(((t,e)=>this.zt(t,e))),t.onTouchMove(((t,e)=>this.Vt(t,e))),t.onTouchEnd(((t,e)=>this.Ot(t,e))),this.Ts.vs()}qy(){return this.iS&&this.c_.length>0&&this.getVisible()}setDefaultStyle(t){this.m_=t,this.c_.forEach(t),t(this.y_);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.c_.filter((t=>t.getVisible())),this.v_,Xe);if(void 0!==i)return{location:dt(i[0],this.Ts.cs.ft,this.scale),scale:this.scale,resultTableContent:this.Om(new la,this,i[1]).Qu(),owner:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}getXMax(){return this.d_||(this.d_=this.x_()),this.d_.max.x}getXMin(){return this.d_||(this.d_=this.x_()),this.d_.min.x}getYMax(){return this.d_||(this.d_=this.x_()),this.d_.max.y}getYMin(){return this.d_||(this.d_=this.x_()),this.d_.min.y}Mr(){return u(0,0)}x_(){const t=m(c(Le,Le),c(Pe,Pe));for(let e=0;e0?this.c_[0].getDominantStyle():this.y_.getDominantStyle()})}}const Eu=(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 wu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Box Series",this.Om=Eu,this.b_=Ce(),this.v_=t=>dt(this.Fs.toPoint((t.start+t.end)/2,t.median),this.scale,this.Ts.cs.ft),this.Ki.cs.Gn(ah.Sf),this.Fs=a,this.y_=new tu(this.Ts,this.scale,this.tM,kt,kt,kt,kt,(t=>!1),this.Fs,0,0,0,0,0,0,0,this.ts).dispose(),this.M_=new Ha((()=>{const t=this.Ts.Rg(this.scale);return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.zg(e.start,e.end),i}))))),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){if(!(t instanceof _i||t instanceof Vi))throw new Error("BoxSeries only supports Linear Axes")}g_(t){const e=this.__.gy(),i=this.M_.gy();t.forEach((t=>{if(!t.getVisible())return;const s=this.Fs.toPoint((t.start+t.end-t.iM*(t.end-t.start))/2,t.lowerQuartile),r=this.Fs.toPoint((t.end-t.start)*t.iM,t.upperQuartile-t.lowerQuartile),n=this.Fs.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Fs.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Fs.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Fs.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Fs.toPoint((t.start+t.end-t.sM*(t.end-t.start))/2,t.lowerExtreme),u=this.Fs.toPoint((t.start+t.end+t.sM*(t.end-t.start))/2,t.lowerExtreme),c=this.Fs.toPoint((t.start+t.end-t.sM*(t.end-t.start))/2,t.upperExtreme),d=this.Fs.toPoint((t.start+t.end+t.sM*(t.end-t.start))/2,t.upperExtreme),f=this.Fs.toPoint((t.start+t.end-t.iM*(t.end-t.start))/2,t.median),g=this.Fs.toPoint((t.start+t.end+t.iM*(t.end-t.start))/2,t.median);e.add({Go:t.Go,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+r.y},{x:s.x+r.x,y:s.y+r.y},{x:s.x+r.x,y:s.y}],figure:t},{fillStyle:t.eM,strokeStyle:t.hM}),i.add({Go:0,start:n,end:o,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:h,end:a,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:l,end:u,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:c,end:d,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:f,end:g,figure:t},{strokeStyle:t.rM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new tu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.Fs,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.ts);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Tu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Ha=m(u(0,0),u(0,0)),this.Ts=t,this.scale=e,this.be=fe(a.ellipseSeriesFillStyle,l),this.Me=fe(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.dimensions=t,this.Ha=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class ku extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Ellipse Series",this.Om=(t,e,i)=>t.addRow(e.Ms).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.b_=Ce(),this.v_=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Tu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){if(!(t instanceof _i||t instanceof Vi))throw new Error("EllipseSeries only supports Linear Axes")}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],r=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=r;t+=1){const e=t/r*2*Math.PI,n=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:n,y:o})}const n=t.getFillStyle(),o=t.getStrokeStyle();e.add({Go:t.Go,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new Tu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Cu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.C_=[],this.Ha=_e,this.Ts=t,this.scale=e,this.be=fe(a.polygonSeriesFillStyle,l),this.Me=fe(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.C_=t,this.Ha=Ze(this.C_),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.C_}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Ru extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Polygon Series",this.Om=(t,e,i)=>t.addRow(e.getName()),this.b_=Ce(),this.v_=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Cu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Go:t.Go,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new Cu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Iu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.k_={x:0,y:0,width:0,height:0},this.T_={x1:0,y1:0,x2:0,y2:0},this.Ha=m(u(0,0),u(0,0)),this.be=fe(a.rectangleSeriesFillStyle,l),this.Ts=t,this.scale=e,this.Me=fe(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return"x"in t?(this.k_=t,this.T_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.T_=t,this.k_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Ha=Ze([this.k_,u(this.k_.x+this.k_.width,this.k_.y+this.k_.height)]),this.Zb(),this.Ts.vs(),this}getDimensionsPositionAndSize(){return this.k_}getDimensionsTwoPoints(){return this.T_}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Fu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Rectangle Series",this.Om=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.Ms).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.b_=Ce(),this.v_=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Iu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensionsTwoPoints(),s=[{x:i.x1,y:i.y1},{x:i.x1,y:i.y2},{x:i.x2,y:i.y2},{x:i.x2,y:i.y1}],r=t.getFillStyle(),n=t.getStrokeStyle();e.add({Go:t.Go,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Iu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Du extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Ha=m(u(0,0),u(0,0)),this.ts=a,this.Ts=t,this.scale=e,this.Me=fe(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.dimensions=t,this.Ha=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.Zb(),this.Ts.vs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){const t=this.Me;return t!==ot?t.getFillStyle():z}}class Lu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Segment Series",this.Om=(t,e,i)=>t.addRow(e.Ms).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.F_=Ce(),this.v_=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Du(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.M_=new Ha((()=>{const t=this.F_.wt(this.Ts.Rg(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.zg(e.start,e.end),this.F_.Nt(i,e.figure),i})))),(()=>{this.F_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.M_.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},r={x:i.endX,y:i.endY},n=t.getStrokeStyle();e.add({Go:t.Go,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Du(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}const Pu=(t,e,i)=>{const s=e.getIcon();return s?t.addRow(s,e.getName()):t.addRow(e.getName()),t.addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1))};class _u extends yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Heatmap Grid Series",this.Om=Pu,this.Rb=!1,this.gv={},this.Ki.cs.Gn(ah.yf),this.I_=a,this.ts=l;const d=c;this.be=fe(l.heatmapGridSeriesFillStyle,d),this.pv=fe(this.ts.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Yn=f,this.P_=this.Ts.D_(this.scale,[],f).ke(this.be).mv(this.pv).ds(this.getHighlight()),this.fs(this.P_),a.start&&this.setStart(a.start),a.end&&this.setEnd(a.end),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}Sv(){const t=this.gv.start||{x:0,y:0};let e;e=this.gv.end?{x:(this.gv.end.x-t.x)/this.Yn.columns,y:(this.gv.end.y-t.y)/this.Yn.rows}:this.gv.step?this.gv.step:{x:1,y:1},this.P_.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.P_.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.P_.xv().step}setEnd(t){return this.gv.end=t,this.Sv(),this}getEnd(){return this.P_.xv().end}clear(){return this.P_.Gt(),this.Ts.vs(),this.L.emit("dataClear",this),this}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.P_.mv(this.pv),this.Ts.vs(),this.L.emit("styleChange",this),this}getWireframeStyle(){return this.pv}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.P_.Mv(t),this.Ts.vs(),this.L.emit("styleChange",this),this}getIntensityInterpolation(){return this.P_._v()}qy(){return this.iS&&this.getVisible()}Wd(){return ue(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}B_(t){this.P_.B_().forEach((e=>{t.P_.wv(e)}))}u_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}L_(t){return this.L.on("styleChange",t)}R_(t){return this.L.off(t)}$c(t,e,i=this.Rb){const s=dt(t,this.Ts.cs.ft,this.scale),r=e?this.P_.getIsUnderMouse()?this.P_:void 0:this.P_;if(!r)return;const n=i?r.Vb(s):r.$c(s);if(n){const t={x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue};return{location:t,scale:this.scale,resultTableContent:this.Om(new la,this,t).Qu(),owner:this}}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}getXMax(){const t=this.P_;return t?t.bt():void 0}getXMin(){const t=this.P_;return t?t.xt():void 0}getYMax(){const t=this.P_;return t?t._t():void 0}getYMin(){const t=this.P_;return t?t.Mt():void 0}Mr(){const t=u(0,0);return t.x=Math.max(t.x,this.P_.xl()),t.y=Math.max(t.y,this.P_.bl()),t}UM(t){if(!(t instanceof _i))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.wi())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Pe(t,e){t.ds(e),this.Ts.vs()}Fe(){return super.Fe(),this.P_.Ho(this.getBoundaries()),this}}class Vu extends _u{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.fS=!1,this.Om=Pu}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Yn.dataOrder?t.length:t[0].length,rows:"rows"===this.Yn.dataOrder?t.length:t[0].length},i="columns"===this.Yn.dataOrder?this.Yn.columns:this.Yn.rows,s="columns"===this.Yn.dataOrder?this.Yn.rows:this.Yn.columns;if(e.x>i||e.y>s){if(!0===this.chart.dA.$n){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.dA.$n){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Yn.columns}x${this.Yn.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.`;bt.console.warn(i)}const i=Math.max(s-o,0),r=e.primary-i,a=Math.max(n-h,0),l=[];for(let e=0;e0?-a:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.P_.wv({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.L.emit("invalidateIntensity",this,t),this.Ts.vs(),this.fS=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.P_.ke(this.be),this.L.emit("styleChange",this),this.Ts.vs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}E_(t){return this.L.on("invalidateIntensity",t)}z_(t){return this.L.off(t)}}class Bu extends yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Scrolling Heatmap Grid Series",this.Om=Pu,this.Rb=!1,this.gv={},this.Ki.cs.Gn(ah.yf),this.Ki.cs.Gn(ah.xf);const d=c;this.be=fe(l.heatmapScrollingGridSeriesFillStyle,d),this.pv=fe(this.ts.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Yn=f,this.V_=this.Ts.O_(this.scale,[],f).ke(this.be).mv(this.pv).ds(this.getHighlight()),this.fs(this.V_),a.start&&this.setStart(a.start),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}Sv(){const t=this.gv.start||{x:0,y:0};let e;e=this.gv.step?this.gv.step:{x:1,y:1},this.V_.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.V_.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.V_.xv().step}clear(){return this.V_.Gt(),this.Ts.vs(),this}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.V_.mv(this.pv),this.Ts.vs(),this}getWireframeStyle(){return this.pv}setPixelInterpolationMode(t){return t=t||"disabled",this.V_.Mv(t),this.Ts.vs(),this}getPixelInterpolationMode(){return this.V_._v()}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.V_.vu(t),this.Ts.vs(),this}qy(){return this.iS&&this.getVisible()}Wd(){return ue(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}ke(t){return this.be="function"==typeof t?t(this.be):t,this.V_.ke(this.be),this.Ts.vs(),this}$c(t,e,i=this.Rb){const s=dt(t,this.Ts.cs.ft,this.scale),r=e?this.V_.getIsUnderMouse()?this.V_:void 0:this.V_;if(!r)return;const n=i?r.Vb(s):r.$c(s);return n?wa(n,this.scale,this.Om(new la,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).Qu(),this):void 0}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}UM(t){if(!(t instanceof _i))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.wi())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.V_.bt()||0}getXMin(){return this.V_.xt()||0}getYMax(){return this.V_._t()||0}getYMin(){return this.V_.Mt()||0}Mr(){const t=u(0,0);return t.x=Math.max(t.x,this.V_.xl()),t.y=Math.max(t.y,this.V_.bl()),t}Pe(t,e){t.ds(e),this.Ts.vs()}}class zu extends Bu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.Om=Pu}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Yn.scrollDimension?t.length:t[0].length,"rows"===this.Yn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Yn.resolution-1;if(s>r){if(!0===this.chart.dA.$n){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Yn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const s=[];for(let i=0;it.slice()},this.Rb=!0,this.U_=[],this.Y_=[],this.H_=!1,this.Wd=()=>ue(this.X_)||ue(this.j_),this.Z_=t=>{const e=t.length;if(this.JM.length>0){const i=this.JM.length-1,s=this.JM[i];if(e>0){const[e,i]=s.il(),[r,n]=s.tl();if((r?e.length+r.length:e.length)>=this.h_){const o=r&&r.length>0?r[r.length-1]:e[e.length-1],h=n&&n.length>0?n[n.length-1]:i[e.length-1],a=(o.x+t[0].position)/2,l=di(a,o,u(t[0].position,t[0].high)).y,c=di(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.ol(f,m(u(a,c),u(a,l))).Vl(!0),this.Q_([f].concat(t)).El(!0)}else s.ol(t)}}else e>0&&this.Q_(t)},this.J_=t=>{const e=this.U_,i=t.length;if(this.U_.length>0){if(i>0){const i=e[e.length-1],s=i.il(),r=i.tl();if(s.length+r.length>=this.h_){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=di(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ol(a,m(u(o,h),u(o,h))).Vl(!0),e.push(this.K_([a].concat(t),this.s_).El(!0))}else i.ol(t)}}else i>0&&e.push(this.K_(t))},this.q_=t=>{const e=this.Y_,i=t.length;if(this.Y_.length>0){if(i>0){const i=e[e.length-1],s=i.il(),r=i.tl();if(s.length+r.length>=this.h_){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=di(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ol(a,m(u(o,h),u(o,h))).Vl(!0),e.push(this.tw([a].concat(t)).El(!0))}else i.ol(t)}}else i>0&&e.push(this.tw(t))},this.iw=(t,e)=>{const i=t.Yb(e);if(i)return[dt(i[0],this.scale,this.Ts.cs.ft),dt(i[1],this.scale,this.Ts.cs.ft)]},this.sw=(t,e)=>{const i=t.ew(e);if(i)return[dt(i[0],this.scale,this.Ts.cs.ft),dt(i[1],this.scale,this.Ts.cs.ft)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.KM=void 0!==e&&e>0?e:0,this.Ts.vs(),this}clear(){for(let t=0;tt+e.al()+e.ll()),this.yu.length)}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.Om}getXMax(){return Ot(this.JM,Lt,Math.max,Bt,this.s_)||0}getXMin(){return Ot(this.JM,Dt,Math.min,Vt,this.s_)||0}getYMax(){return Ot(this.JM,_t,Math.max,Nt,this.s_)||0}getYMin(){return Ot(this.JM,Pt,Math.min,zt,this.s_)||0}Mr(){const t=u(0,0);for(const e of this.JM)t.x=Math.max(t.x,e.xl()),t.y=Math.max(t.y,e.bl());return t}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}UM(t){}t_(t,e,i){this.yu=ne(this.yu,t,{canReturnB:!1}),this.G_=ne(this.G_,e,{canReturnB:!1}),this.W_=ne(this.W_,i,{canReturnB:!1}),this.Ts.vs()}hw(t,e,i,s){this.rw(e,i,s),this.t_(Array.isArray(t)?t:[t],e,i)}rw(t,e,i){const s=Je(Ze(t),Ze(e));this.s_?this.s_=Je(this.s_,s):this.s_=s,i&&(this.s_=Je(this.s_,i))}nw(){const t=this.JM.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const r=Math.ceil(i/e),n=t.length-r;if(n>0&&s>0){const e=n-s>0?s:n;if(e>0){for(let i=0;i0?this.JM[this.JM.length-1]:void 0,i=e?e.il()[0].length+(e.tl()[0]?e.tl()[0].length:0):void 0;pu(t,i,this.h_,this.Z_)}aw(t){const e=this.U_.length>0?this.U_[this.U_.length-1].il().length+this.U_[this.U_.length-1].tl().length:void 0;pu(t,e,this.h_,this.J_)}lw(t,e){const i=this.U_.length>0?this.U_[this.U_.length-1].il().length+this.U_[this.U_.length-1].tl().length:void 0;pu(t,i,this.h_,this.J_),pu(e,i,this.h_,this.q_)}Q_(t,e){const i=this.Ts.uw(this.scale).ol(t,e).ke(this.X_).Ll(this.j_).Dl(this.wl).ds(this.getHighlight());return this.JM.push(i),this.fs(i),i}cw(t,e,i){const s=this.Ts.sy(this.scale,void 0,[za.UserSeries]).ol(t,i).setMouseInteractions(!1).Ee(e).ds(this.getHighlight());return this.fs(s),s}K_(t,e){return this.cw(t,this.dw,e)}tw(t,e){return this.cw(t,this.fw,e)}Aw(t){this.X_="function"==typeof t?t(this.X_):t;const e=this.X_;for(let t=0;t0){const t=this.JM.length,e=this.nw();this.e_(this.JM,this.h_,this.KM,e);const i=this.JM.length;this.U_.length>0&&this.e_(this.U_,this.h_,this.KM,e),this.Y_.length>0&&this.e_(this.Y_,this.h_,this.KM,e),t!==i&&this.QM(),this.H_=!0}}Fe(){if(super.Fe(),this.yu.length>0&&(this.ow(this.yu),this.Mw(this.G_,this.W_),this.H_=!0),this.H_){const t=this.getBoundaries();for(const e of this.JM)e.Ho(t);for(const e of this.U_)e.Ho(t);for(const e of this.Y_)e.Ho(t)}}Ay(){this.s_=void 0,this.yu.length=0,this.G_.length=0,this.W_.length=0}$c(t,e,i=this.Rb){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.JM,i?this.sw:this.iw);if(void 0!==s&&void 0!==s[0]){const t=dt(s[0][0],this.Ts.cs.ft,this.scale),e=dt(s[0][1],this.Ts.cs.ft,this.scale);return wa(t,this.scale,this.Om(new la,this,t.x,t.y,e.y).Qu(),this,s[1].zh())}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}const Ou=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r))};class Uu extends Nu{constructor(t,e,i,s,r,n,o,h,a=0,l,u){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Area Series",this.Om=Ou,this.Ki.cs.Gn(ah.mf),this._w=a}add(t){0!==this.JM.length&&this.Ki.cs.Gn(ah.xf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.ww(e),[i,s]=this.Cw(t);this.hw(t,i,s,m(u(Le,this._w),u(Pe,this._w)));const r=this.yu[this.yu.length-1];this.i_=r?{position:r.position,high:r.high,low:r.low}:void 0,this.L.emit("dataAdd",this,e,this.s_)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.i_?this.i_.position+e:0),this.add(Su(t,e,s)),this}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}}class Gu extends Uu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u);const c=t.getSeries().length;this.X_=fe(this.ts.areaSeriesBipolarHighFillStyle,c),this.dw=fe(this.ts.areaSeriesBipolarHighStrokeStyle,c),this.j_=fe(this.ts.areaSeriesBipolarLowFillStyle,c),this.fw=fe(this.ts.areaSeriesBipolarLowStrokeStyle,c)}ww(t){return this.kw(t)}Mw(t,e){return this.lw(t,e)}kw(t){let e=0;const i=[],s=t.length,r=this._w;return s>0&&(this.Tw&&(this.Tw.y<=r&&r<=t[0].y||this.Tw.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.Tw.x+t[0].x),r,r),e+=1),this.Tw=t[s-1],1===s?this.Fw(t[0],i,e):this.Iw(t,i)),i}Fw(t,e,i=0){return e[i]=d(t.x,t.y,this._w),i+1}Iw(t,e){let i=0,s=0;const r=t.length-1,n=this._w;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Pn(r.x,o.x,(h-t)/(s-t));e[i]=d(a,n,n),i+=1}e[i]=d(o.x,o.y,n),i+=1}return i}Cw(t){const e=t.length,i=Array(e),s=Array(e),r=this._w;for(let n=0;nr?(i[n]=u(e.position,e.high),s[n]=u(e.position,r)):e.hight[0]))}setPositiveFillStyle(t){return this.Aw(t),this}setNegativeFillStyle(t){return this.gw(t),this}setPositiveStrokeStyle(t){return this.mw(t),this}setNegativeStrokeStyle(t){return this.yw(t),this}getPositiveFillStyle(){return this.pw()}getNegativeFillStyle(){return this.Rl()}getPositiveStrokeStyle(){return this.Sw()}getNegativeStrokeStyle(){return this.xw()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.X_,fill2:this.j_,behavior:{colorStep:!0}}),super.attach(t,e,i)}}class Yu extends Uu{constructor(){super(...arguments),this.fw=ot}Mw(t){return this.aw(t)}Cw(t){const e=t.length,i=Array(e);for(let s=0;ss?d(t.x,s,s):d(t.x,t.y,s),i+1}Iw(t,e,i=0){let s=0;const r=t.length-1,n=this._w;for(;sn){const t=Si(u(Pe,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,n,n),i+=1}else e[i]=d(o.x,o.y,n),i+=1}else{const t=d(r.x,n,n);if(0!==i&&Ut(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=Si(u(Pe,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}n_(){return xu(this.JM,(t=>t[1]))}setFillStyle(t){return this.gw(t),this}getFillStyle(){return this.Rl()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.j_,stroke:this.dw}),super.attach(t,e,i)}}class Xu extends Yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u);const d=c;this.X_=fe(this.ts.areaSeriesPositiveFillStyle,d),this.j_=z,this.dw=fe(this.ts.areaSeriesPositiveStrokeStyle,d)}ww(t){return this.Dw(t)}Dw(t){const e=[];return 1===t.length?this.Fw(t[0],e):this.Iw(t,e),e}Fw(t,e,i=0){const s=this._w;return e[i]=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Ut(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=Si(u(Pe,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}n_(){return xu(this.JM,(t=>t[0]||[]))}setFillStyle(t){return this.Aw(t),this}getFillStyle(){return this.pw()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.X_,stroke:this.dw}),super.attach(t,e,i)}}const Wu={Positive:Xu,Negative:Hu,Bipolar:Gu},ju=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("High","",e.axisY.formatValue(s)).addRow("Low","",e.axisY.formatValue(r));class $u extends Nu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Area Range Series",this.Om=ju,this.Ki.cs.Gn(ah.mf);const c=u;this.X_=fe(this.ts.areaRangeSeriesFillStyle,c),this.dw=fe(this.ts.areaRangeSeriesStrokeStyle,c),this.j_=fe(this.ts.areaRangeSeriesFillStyleInverted,c),this.fw=fe(this.ts.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.hw(t,i,s);const r=this.yu[this.yu.length-1];return this.i_=r?{position:r.position,high:r.high,low:r.low}:void 0,this.L.emit("dataAdd",this,e,this.s_),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let r=s;r||(r=this.i_?this.i_.position+i:0),this.add(((t,e,i=1,s)=>{const r=void 0!==s?s:0,n=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],r=e.length;for(let t=0;t{const i=[],s=t.length,r=e;if(s>0){let e=0,n=t[0];i[e]=n,e+=1;for(let o=1;o{const i=t*t,s=i*t,r=1-t,n=r*r,o=n*r;return u(o*e[0].x+3*t*n*e[1].x+3*i*r*e[2].x+s*e[3].x,o*e[0].y+3*t*n*e[1].y+3*i*r*e[2].y+s*e[3].y)},qu=(t,e=32)=>{if(2===t.length)return[t[0],t[1]];const i=(t=>{const e=1e-5,i=t.length-1,s=Array(i);if(i>1){let r=u(0,0),n=u(0,0),o=u(0,0),h=ii(hi(t[1],t[0]));const a=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(a*r.x)):1,c=Math.abs(n.x)>e?Math.abs(i/(a*n.x)):1}f[1]=oi(ni(r,l),f[1]),f[2]=hi(f[2],ni(n,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,r=Array(s*e);let n=0;for(let t=0;t{if(this.JM.length>0){const e=this.JM[this.JM.length-1];if(t.length>0){const i=e.il(),s=e.tl(),r=i.length+s.length-+e.zl();if(r>=this.h_){const n=s.length>0?s[s.length-1]:i[e.zl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.ol(o,m(u(o.x,o.y),u(o.x,o.y))).Vl(!0),this.zw([o].concat(t)).El(!0)}else e.ol(t,this.s_)}}else t.length>0&&this.zw(t)},this.Vw=t=>{if(this.Rw.length>0){const e=this.Rw[this.Rw.length-1];t.length>0&&((e.il().length+e.tl().length)*this.Lw>=this.h_?this.Ow(t):e.ol(t))}else t.length>0&&this.Ow(t)},this.Nw=(t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Gw=(t,e)=>{const i=t.ew(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Yn=y,this.Xb=l,this.Ww=f,this.Uw=fe(c.pointLineSeriesFillStyle,g),this.uu=fe(this.ts.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}n_(){return xu(this.Rw)}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorSolveBasis(t){return this.Bw=t,this.JM.forEach((e=>e.qa(Pr(t)))),this.Rw.forEach((e=>e.qa(Pr(t)))),this.Ts.vs(),this}getCursorSolveBasis(){return this.Bw}Wd(){return ue(this.Uw)||ue(this.uu.getFillStyle())}ks(){return this.bs||this.Xb}UM(t){}Pe(t,e){t.ds(e),this.Ts.vs()}r_(t){const e=this.JM.length>0?this.JM[this.JM.length-1].il().length+this.JM[this.JM.length-1].tl().length-+this.JM[this.JM.length-1].zl():void 0;pu(t,e,this.h_,this.Ew),pu(t,e,this.h_,this.Vw)}Ow(t,e){const i=this.Ts.bS(this.scale).ol(t,e).setMouseInteractions(this.Hi).ke(this.Uw).sl(this.Xb).tt(this.$b).Gh(this.ga).hl(this.Wa).rl(this.Ua).nl(this.Ya).qa(Pr(this.Bw)).ds(this.getHighlight());return this.fs(i),this.Rw.push(i),i}zw(t,e){const i=this.Ts.sy(this.scale,void 0,[za.UserSeries,...this.Ww]).ol(t,e).setMouseInteractions(this.Hi).Ee(this.uu).qa(Pr(this.Bw)).ds(this.getHighlight());return this.fs(i),this.JM.push(i),i}attach(t,e=!0,i=!1){return le(t,this.ts,i,{stroke:this.uu,fill:this.Uw}),super.attach(t,e,i)}getPointAmount(){return this.Rw.reduce(((t,e)=>t+e.al()+e.ll()),this.yu.length)}clear(){super.clear();for(let t=0;t{}))}$c(t,e,i=this.Rb){const s=i?bu(t,e?this.JM.filter((t=>t.getIsUnderMouse())):this.JM,this.Gw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):bu(t,e?this.Rw.filter((t=>t.getIsUnderMouse())):this.Rw,this.Nw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(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=dt(s[0],this.Ts.cs.ft,this.scale),e=s[1]instanceof cn?s[1].cu():s[1].zh(),i=s[1]instanceof tn?s[1].zh():void 0,r=s[1]instanceof cn?s[1].cu().getFillStyle():void 0,n=X(e)?s[0].color?new G({color:s[0].color}):new G({color:e.getFallbackColor()}):void 0;return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,r||n||i)}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}const tc=(t,e)=>t.tl().length>=e?t.tl().slice(-e):Array.prototype.concat(t.il(),t.tl()).slice(-e),ec=(t,e,i)=>{const s=Array.prototype.concat(t.il(),t.tl()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Gt().ol(s).Ds()};class ic extends Qu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g){super(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g),this.Ms="Spline Series",this.Lw=32,this.h_=8e3,this.Yw=t=>{if(0===t.length)return;const e=this.Rw.length;if(e>0){const i=e>1,s=this.Rw[e-1];if(i){const i=Array.prototype.concat(s.il(),s.tl()),r=i.length;if(32*r>=this.h_){const i=tc(s,3),r=Array.prototype.concat(i,t),n=qu(r,32);ec(this.JM[e-1],n,32),this.zw(n.slice(66))}else if(r<5){const s=this.Rw[e-2],r=tc(s,3),n=Array.prototype.concat(r,i,t),o=qu(n,32),h=this.JM[e-1],a=o.slice(66);h.Gt().ol(a).Ds()}else{const i=this.JM[e-1],r=Array.prototype.concat(i.il(),i.tl()),n=tc(s,4),o=Array.prototype.concat(n,t),h=qu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Gt().ol(a).Ds()}}else{const i=Array.prototype.concat(s.il(),s.tl()),r=i.length,n=this.JM[e-1];if(32*r>=this.h_){const e=tc(s,3),i=Array.prototype.concat(e,t),r=qu(i,32);ec(this.JM[0],r,32),this.zw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=qu(e,32);n.Gt().ol(s).Ds()}else n.ol(t)}}else{const e=t.length>0?qu(t,32):t,i=Ze(e);this.zw(e,i)}this.Vw(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}r_(t){const e=this.Rw.length,i=this.Rw.length>0?this.Rw[e-1].il().length+this.Rw[e-1].tl().length:void 0;pu(t,i,Math.ceil(this.h_/this.Lw),this.Yw)}solveNearestFromScreen(t,e=this.Rb){if(e)return super.solveNearestFromScreen(rh(t,this.Ki.cs),e);const i=bu(rh(t,this.Ki.cs),this.Rw,this.Nw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(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=dt(i[0],this.Ts.cs.ft,this.scale);return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,i[1].zh())}}}class sc{constructor(){this.Wi="FreeformPattern",this.wl={type:"disabled",packager:(t,e,i)=>t.slice()}}e_(t,e,i,s,r,n){if(s>0){const r=Math.trunc((e-s)/i);if(r>0&&t.length>1){const e=t.splice(0,r);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},nc=s.Record({wl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class oc extends nc{e_(t,e,i,s,r,n){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.nw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.Mt();return t?Math.min(i,t):i},ac=(t,e)=>{const i=e._t();return t?Math.max(i,t):i};class lc extends oc{Hw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(ac,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(hc,e?e.min.y:void 0)}}const uc=(t,e)=>{const i=e.xt();return t?Math.min(i,t):i},cc=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class dc extends oc{Hw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(cc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(uc,e?e.min.x:void 0)}}const fc={horizontalProgressive:new class extends lc{constructor(){super({wl:kr()}),this.Wi="HorizontalProgressivePattern"}nw(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getXMin(t=[],e){return t.length>0&&t[0].al()>0?t[0].xt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",kr(rc(t)))}},horizontalRegressive:new class extends lc{constructor(){super({wl:Cr()}),this.Wi="HorizontalRegressivePattern"}nw(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].al()>0?t[0].bt():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].xt():void 0}setPrecision(t){return this.set("_columnPackaging",Cr(rc(t)))}},verticalProgressive:new class extends dc{constructor(){super({wl:Rr()}),this.Wi="VerticalProgressivePattern"}nw(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1]._t():void 0}getYMin(t=[],e){return t.length>0&&t[0].al()>0?t[0].Mt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Rr(rc(t)))}},verticalRegressive:new class extends dc{constructor(){super({wl:Ir()}),this.Wi="VerticalRegressivePattern"}nw(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].al()>0?t[0]._t():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].Mt():void 0}setPrecision(t){return this.set("_columnPackaging",Ir(rc(t)))}},freeform:new sc};class gc extends Qu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,y){super(t,e,i,s,r,n,o,h,fc.horizontalProgressive,a,c,d,f,g,y),this.Ms="Step Series",this.Ew=t=>{const e=this.JM.length>0?this.JM[this.JM.length-1].il().length+this.JM[this.JM.length-1].tl().length:void 0;pu(t,e,this.h_,this.$w)},this.$w=t=>{const e=t.length;if(this.JM.length>0){const i=this.JM[this.JM.length-1];if(e>0){const e=i.il(),s=i.tl(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Ku([r].concat(t),this.Xw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.h_?(i.ol(o,m(u(o.x,o.y),u(o.x,o.y))).Vl(!0),this.zw(h).El(!0),this.Ow(t)):i.ol(h)}}else e>0&&this.zw(Ku(t,this.Xw));this.Vw(t)},this.Xw=l,void 0===this.Ww.find((t=>"DataPattern"===t.type))&&this.Ww.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class mc extends yu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Ms="OHLC Series",this.jw=t=>t[4]>=t[1],this.d_=m(c(Le,Le),c(Pe,Pe)),this.Zw=[],this.Qw=!1,this.Jw=-1,this.Kw=[],this.qw=!0,this.tC=!1,this.iC=4,this.Om=(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.sC=[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.Ki.cs.Gn(ah.nf)}n_(){return this.Kw}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}qy(){return this.iS&&this.Kw.length>0&&this.getVisible()}eC(t){if(!(this.Kw.length<1))return[this.Kw[t][0],this.Kw[t][1],this.Kw[t][2],this.Kw[t][3],this.Kw[t][4]]}$c(t){if(0===this.Kw.length)return;const e=dt(t,this.Ts.cs.ft,this.scale).x,i=void 0!==this.getPackDataState();let s,r,n,o,h;if(i){const t=this.hC;if(!t)return;const i=ke(e,t.length-1,(e=>t[e][0])),a=void 0!==i&&t[i];if(!a)return;o=a[3],n=a[2],r=a[1],h=a[4],s=a[0]}else{const t=ke(e,this.Kw.length-1,(t=>this.Kw[t][0])),i=void 0!==t&&this.Kw[t];if(!i)return;s=i[0],r=i[1],n=i[2],o=i[3],h=i[4]}const a={position:s,open:r,high:n,low:o,close:h,isPacked:i};return{location:u(a.position,a.close),scale:this.scale,resultTableContent:this.Om(new la,this,a).Qu(),owner:this,isPacked:i,position:s,open:r,high:n,low:o,close:h}}UM(t){if(!(t.x instanceof Di))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.rC=t.x}Mr(){return u(5,5)}H_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.Ki.cs.Gn(ah.xf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.Qw=!0;const t=this.Kw.length,i=this.Zw.length,s=e.length;this.Kw.length=t+s,this.Zw.length=i+s;for(let r=0;rthis.sC[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Jw||this.Qw||this.tC)){this.tC=!1,this.Jw=t,this.Qw=!1,this.oC(),this.hC=[];const e=this.Kw.length;let i=this.Kw[0][0]-this.Kw[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Ka(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Mr().x))}),Ac=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Ka(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Mr().y))});class vc extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.JM=[],this.Ms="Line Series",this.Rb=!0,this.h_=void 0,this.Bw="nearest-x",this.Su=void 0,this.Wd=()=>ue(this.uu.getFillStyle()),this.FC=(t,e)=>{const i=t.Yb(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Gw=(t,e)=>{const i=t.ew(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Ww=c,this.Yn=f,this.uu=fe(this.ts.lineSeriesStrokeStyle,d),this.IC={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.uu="function"==typeof t?t(this.uu):t;const e=this.uu;for(let t=0;tt.vu(this.Su))),this.Ts.vs(),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorSolveBasis(t){return this.Bw=t,this.JM.forEach((e=>e.qa(Pr(t)))),this.Ts.vs(),this}getCursorSolveBasis(){return this.Bw}UM(t){}r_(t){let e=this.JM[0];e||(e=this.zw(),this.JM.push(e),this.fs(e)),e.ol(t,this.s_)}zw(){return this.Ts.sy(this.scale,this.IC,[za.UserSeries,...this.Ww]).Ee(this.uu).vu(this.Su).qa(Pr(this.Bw)).ds(this.getHighlight())}attach(t,e=!0,i=!1){return le(t,this.ts,i,{stroke:this.uu}),super.attach(t,e,i)}Pe(t,e){t.ds(e),this.Ts.vs()}e_(t,e,i,s){}$c(t,e,i=this.Rb){const s=bu(t,e?this.JM.filter((t=>t.getIsUnderMouse())):this.JM,i?this.Gw:this.FC,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(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=dt(s[0],this.Ts.cs.ft,this.scale),e=s[1].cu();return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}class bc extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new sc,l,u),this.JM=[],this.Ms="Point series",this.$b=5,this.ga=0,this.Wa=!1,this.Ua=!1,this.Ya=!1,this.h_=void 0,this.Nw=(t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Yn=d,this.Xb=a,this.be=fe(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}Wd(){return ue(this.be)}ks(){return this.bs||this.Xb}UM(t){}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.be}),super.attach(t,e)}Pe(t,e){t.ds(e),this.Ts.vs()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(let t=0;tt.getIsUnderMouse())):this.JM,this.Nw,Xe);if(void 0!==i){const t=dt(i[0],this.Ts.cs.ft,this.scale),e=i[1].zh(),s=X(e)?i[0].color?new G({color:i[0].color}):new G({color:e.getFallbackColor()}):e;return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,s)}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class Mc{constructor(t,e,i,s){this.PC=!1,this.L=new r.Eventer,this.chart=i,this.DC=s,this.Xs=t.Xs,this.te=s||Ls,this.BC=bt.document.createElement("div"),this.BC.style.position="absolute",this.BC.style.pointerEvents="none",bt.document.body.append(this.BC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.BC.style.left=`${t.left}px`,this.BC.style.top=`${t.top}px`,this.BC.style.width=`${t.width}px`,this.BC.style.height=`${t.height}px`};n(),i.onResize(n),this.LC(this.BC),this.RC(),this.EC(),this.zC(),this.VC(e),this.chart.OC().push(this)}LC(t){this.NC=bt.document.createElement("div"),this.NC.style.pointerEvents="all",t.append(this.NC),this.GC=bt.document.createElement("div"),this.WC=new Es(this.Xs,this.te,this.chart,this.GC),this.UC=bt.document.createElement("table"),this.UC.style.borderSpacing="0",this.NC.appendChild(this.WC.ae()),this.NC.appendChild(this.GC),this.GC.appendChild(this.UC)}EC(){let t=0,e=0,i=0,s=0,r=!1;this.PC=!1,this.NC.onmousedown=n=>{n=n||bt.event,i=n.clientX,s=n.clientY,r=!0,bt.document.onmouseup=t=>{this.PC?this.NC.addEventListener("click",Zt,!0):this.NC.removeEventListener("click",Zt,!0),r=!1,this.PC=!1,bt.document.onmouseup=null,bt.document.onmousemove=null},bt.document.onmousemove=n=>{n=n||bt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.PC=!0,this.NC.style.top=this.NC.offsetTop-e+"px",this.NC.style.left=this.NC.offsetLeft-t+"px",this.NC.style.removeProperty("right"),this.NC.style.removeProperty("bottom"))}}}zC(){let t=0,e=0,i=0,s=0,r=!1;this.NC.ontouchstart=n=>{n=n||bt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.NC.ontouchend=()=>{r=!1,bt.document.ontouchend=null,bt.document.ontouchmove=null},this.NC.ontouchmove=n=>{r&&(Zt(n),n=n||bt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.NC.style.top=this.NC.offsetTop-e+"px",this.NC.style.left=this.NC.offsetLeft-t+"px",this.NC.style.removeProperty("right"),this.NC.style.removeProperty("bottom"))}}}RC(){this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("left","10px"),this.NC.style.position="absolute",this.NC.style.display="flex",this.NC.style.alignItems="flex-start",this.GC.style.setProperty("display","none")}removePositionProperty(){this.NC.style.removeProperty("top"),this.NC.style.removeProperty("left"),this.NC.style.removeProperty("bottom"),this.NC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.NC.style.setProperty("bottom","10px"),this.NC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.NC.style.setProperty("bottom","10px"),this.NC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("right","10px")}}VC(t){for(let e=0;e[t.Xc((()=>{this.$C+=1,this.$C>1&&this.Ki.cs.Gn(ah.xf),this.Ki.cs.vs()})),t.jc((()=>this.Ki.cs.vs()))])),this.Ga.ld(t),this.chart.cs.vs()),this}getDataSet(){return this.ZC()}setStrokeStyle(t){return this.Ga.Ee(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.cu()}setAreaFillStyle(t){return this.Ga.dd(t),this.Ts.vs(),this}getAreaFillStyle(){return this.Ga.QC()}setPointFillStyle(t){return this.Ga.ud(t),this.Ts.vs(),this}getPointFillStyle(){return this.Ga.yd()}setPointSize(t){return this.Ga.Sd(t),this.Ts.vs(),this}getPointSize(){return this.Ga.JC()}setPointShape(t){return this.Ga.Ad(t),this.Ts.vs(),this}getPointShape(){return this.Ga.gd()}setPointRotation(t){return this.Ga.pd(t),this.Ts.vs(),this}getPointRotation(){return this.Ga.md()}setPointAlignment(t){return this.Ga.KC(t),this.Ki.cs.vs(),this}getPointAlignment(){return this.Ga.qC()}setCurvePreprocessing(t){return this.Ga.XC(t),this.Ts.vs(),this}getCurvePreprocessing(){return this.Ga.tk()}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}add(t){return this.ZC().add(t),this.Ts.vs(),this}addArraysXY(t,e){return this.ZC().addArraysXY(t,e),this.Ts.vs(),this}appendJSON(t,e){return this.ZC().appendJSON(t,e),this.Ts.vs(),this}appendSample(t){return this.ZC().appendSample(t),this.Ts.vs(),this}appendSamples(t){return this.ZC().appendSamples(t),this.Ts.vs(),this}fill(t){return this.ZC().fill(t),this.Ts.vs(),this}setSamples(t){return this.ZC().setSamples(t),this.Ts.vs(),this}alterSamples(t,e){return this.ZC().alterSamples(t,e),this.Ts.vs(),this}alterSamplesByID(t,e){return this.ZC().alterSamplesByID(t,e),this.Ts.vs(),this}getSampleCount(){return this.ZC().getSampleCount()}getNextSampleIndex(){return this.ZC().getNextSampleIndex()}clear(){return this.ZC().clear(),this.Ts.vs(),this}setMaxSampleCount(t){return this.ZC().setMaxSampleCount(t),this.Ts.vs(),this}getMaxSampleCount(){return this.ZC().getMaxSampleCount()}readBack(t){return this.ZC().readBack(t)}onMaxSampleCountExceeded(t){return this.ZC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.ZC().offMaxSampleCountExceeded(t)}ik(){return this.ZC()}Wd(){return ue(this.getPointFillStyle())||ue(this.getStrokeStyle().getFillStyle())||ue(this.getAreaFillStyle())}qy(){var t;const e=null===(t=this.ad)||void 0===t?void 0:t.Ut;return this.getAutoScrollingEnabled()&&void 0!==e&&e.cc>0}UM(t){}getXMax(){return this.Ga.bt()}getXMin(){return this.Ga.xt()}getYMax(){return this.Ga._t()}getYMin(){return this.Ga.Mt()}Mr(){return{x:this.Ga.xl(),y:this.Ga.bl()}}ZC(){if(!this.ad){const t=new no(this.Yn);t.Sc&&this.Ki.cs.Gn(ah.Mf),t.xc&&this.Ki.cs.Gn(ah.bf),this.ad=Fe(t,this.ad,(()=>[t.Xc((()=>{this.$C+=1,this.$C>1&&this.Ki.cs.Gn(ah.xf),this.Ki.cs.vs()})),t.jc((()=>{this.Ki.cs.vs()}))])),this.Ga.ld(t)}return this.ad.Ut}attach(t,e=!0,i=!1){super.attach(t,e,i);const s=this.getPointFillStyle(),r=this.getAreaFillStyle();return le(t,this.ts,i,{stroke:this.getStrokeStyle(),fill:s!==z?s:r}),super.attach(t,e)}ks(){return this.bs||this.getPointShape()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e,i=this.Rb){void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.ik(),r=dt(t,this.Ki.cs.ft,this.scale),n=!e||this.Ga.getIsUnderMouse()?s.$c(r,i,this.scale,this.Ki.pixelScale):void 0;if(void 0!==n){const t=[this.getStrokeStyle().getFillStyle(),this.getPointFillStyle(),this.getAreaFillStyle()];return wa(n,this.scale,this.Om(new la,this,n).Qu(),this,t.filter((t=>!N(t)))[0])}}solveNearestFromScreen(t,e=!1){return this.$c(rh(t,this.Ki.cs),!1,e)}}const wc=(t,e,i)=>{const s=e.getIcon();return s?t.addRow(s,e.getName()):t.addRow(e.getName()),t.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},Tc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.ft.tt(e),t.axis.ng.tt(i)})))),kc=u(10,10);var Cc;e.AxisPosition=void 0,(Cc=e.AxisPosition||(e.AxisPosition={}))[Cc.Top=0]="Top",Cc[Cc.Bottom=1]="Bottom",Cc[Cc.Left=2]="Left",Cc[Cc.Right=3]="Right";const Rc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Ic=t=>t.setStopped(!0),Fc=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Dc=(t,e)=>{const i="linear-highPrecision"===t.Th.type||"linear-highPrecision"===e.Th.type,s="logarithmic"===t.Th.type||"logarithmic"===e.Th.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Th.type}, y: ${e.Th.type})`;throw new Error(i)}};var Lc,Pc,_c;!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"}(Lc||(Lc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Pc||(Pc={}));class Vc extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("chartXY bg",0),r,i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.chartXYTitleFont,i.cs.ts.chartXYTitleFillStyle,h),this.sk=this.ep.d2({scaleXYConstructor:_i}),this.Og=[],this.Ng=[],this.Wg=[],this.Gg=[],this.ek=new Map,this.hk=!0,this.rk=!0,this.nk=!0,this.Ef=2,this.ak=!0,this.lk=!0,this.uk=[],this.ck=this.vp.Te(this.sk).ke(z).Ce(ot).setMouseInteractions(!1),this.dk=this.vp.ze(this.sk).Ee(ot).setMouseInteractions(!1),this.fk=this.vp.ze(this.sk).Ee(ot).setMouseInteractions(!1),this.Ak=this.ts.chartXYZoomingRectangleFillStyle,this.gk=this.ts.chartXYZoomingRectangleStrokeStyle,this.pk=this.ts.chartXYFittingRectangleFillStyle,this.mk=this.ts.chartXYFittingRectangleStrokeStyle,this.yk=e.MouseStyles.Default,this.Sk=e.MouseStyles.Move,this.vk=e.MouseStyles.ZoomIn,this.xk=e.MouseStyles.Default,this.bk=void 0,this.Mk=Bc,this.WM=0,this.Vm=e.AutoCursorModes.snapToClosest,this._k=Tc(this.Ng,this.Og),this.wk=Tc(this.Wg,this.Gg),this.Ck=(t,e,i,s,r)=>{this._k(s,r),this.wk(r,s),this.sk.tt(s,r),this.cs.vs()},this.kk=(t,e)=>{this.ek.set(t,e)},this.tg=t=>{const e=this.Ng.findIndex((e=>e.axis===t)),i=this.Og.findIndex((e=>e.axis===t)),s=this.Wg.findIndex((e=>e.axis===t)),r=this.Gg.findIndex((e=>e.axis===t));e>=0&&this.Ng.splice(e,1),i>=0&&this.Og.splice(i,1),s>=0&&this.Wg.splice(s,1),r>=0&&this.Gg.splice(r,1),this.ek.delete(t),this.cs.vs()},this.addAreaSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Dc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Wu.Positive)(this,this.wS,this.Wx,e,i,this.Tk(e),this.Tk(i),this.np,s,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length);return this.DS(r),r},this.addAreaRangeSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Dc(e,i);const s=new $u(this,this.wS,this.Wx,e,i,this.Tk(e),this.Tk(i),this.np,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length);return this.DS(s),s},this.Fk=!1,this.Ik=!1,this.YM=()=>{(this.hk||this.rk)&&(this.bk=this.engine.setMouseStyle(this.yk))},this.HM=()=>{this.Fk=!1,this.engine.restoreMouseStyle(this.bk)},this.$M=(t,e,i)=>{var s,r;const n=Ft(null===(s=this.dA.Hn)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Ft(null===(r=this.dA.Hn)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.bk);const h=this.vp.cs.De(e.clientX,e.clientY);i===n&&(this.hk||this.rk)?(this.Pk(t,h),Zt(e)):i===o&&this.ak&&(this.bk=this.engine.setMouseStyle(this.Sk),this.Ik=!0,Zt(e))},this.hS=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Ft(null===(n=this.dA.Hn)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Ft(null===(o=this.dA.Hn)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.hk||this.rk)?(this.Dk(t,s,h),Zt(e)):i===l&&this.ak&&(this.Bk(ni(r,-1)),Zt(e)),this.cs.vs()},this.XM=(t,e,i,s)=>{var r,n;const o=Ft(null===(r=this.dA.Hn)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Ft(null===(n=this.dA.Hn)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.hk||this.rk)){const i=u(e.clientX,e.clientY);this.Lk(t,s,i),Zt(e)}else i===h&&this.ak&&Zt(e);this.engine.restoreMouseStyle(this.bk),this.IS.getIsUnderMouse()&&(this.bk=this.engine.setMouseStyle(this.yk)),this.Fk=!1,this.Ik=!1},this.eS=(t,e)=>{if(this.nk){const t=this.vp.cs.De(e.clientX,e.clientY);this.Rk(t,u(ge(e),ge(e))),Zt(e)}},this.Ek=(t,e,i,s)=>{},this.zk=(t,e,i,s,r,n)=>{if(this.ak){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.Bk(t),Zt(n),this.Ik=!0}if(this.nk){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=hi(u(Math.abs(t.x-s.x-(o.x-r.x)),Math.abs(t.y-s.y-(o.y-r.y))),u(Math.abs(t.x-o.x),Math.abs(t.y-o.y)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.vt(t.ft.mi(t.getInterval().start,-h.x),t.ft.mi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.vt(t.ft.mi(t.getInterval().start,-h.y),t.ft.mi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Zt(n),this.Fk=!0}},this.Vk=(t,e,i,s)=>{this.Ik=!1,this.Fk=!1},this.Ok=(t,e,i)=>{(this.rk||this.hk)&&(this.Pk(t,e),Zt(i))},this.Nk=(t,e,i,s,r)=>{(this.rk||this.hk)&&(this.Dk(t,e,i),Zt(r))},this.Gk=(t,e,i,s)=>{(this.rk||this.hk)&&(this.Lk(t,e,i),Zt(s))},this.cs.Gn(ah.pf),this.setPadding({right:24}),this.Wk=i.Ax("chartXY series bg",Lc.seriesBackground),this.Uk=[Lc.gridLine0,Lc.gridLine1,Lc.gridLine2].map((t=>i.Yk(`chartXY gridline #${t}`,t))),this.KA=i.Yk("chartXY highlighters below",Lc.highlightersBelow),this.Wx=i.Um("chartXY plotting",Pc.plotting),this.qA=i.Um("chartXY highlighters above",Pc.highlightersAbove),this.bA=i.Um("chartXY fg",Pc.fg),this.sk.x.K(0,this.uiScale.x.getCellSize()-(this.jt.left+this.jt.right+this.ya.left+this.ya.right)),this.sk.y.K(0,this.uiScale.y.getCellSize()-(this.jt.bottom+this.jt.top+this.ya.bottom+this.ya.top)),this.sk.tt(this.uiScale.ai().x,this.uiScale.ai().y),this.IS=this.Wk.Te(this.sk).ke(this.ts.chartXYSeriesBackgroundFillStyle).Ce(ot),this.PS=this.bA.Te(this.sk).ke(z).Ce(this.ts.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.setSeriesBackgroundEffect(!1),this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,hu);this.Fp=a.am(this.Hm,this.sk,this.sk,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.Ck),this.bp.Eh("ChartXY"),this.rS=Wi(new $i(this.Ok,this.Nk,this.Gk,1),new Zi(this.Ek,this.zk,this.Vk)),this.onSeriesBackgroundMouseEnter(this.YM),this.onSeriesBackgroundMouseLeave(this.HM),this.onSeriesBackgroundMouseWheel(this.eS),this.onSeriesBackgroundMouseDragStart(this.$M),this.onSeriesBackgroundMouseDrag(this.hS),this.onSeriesBackgroundMouseDragStop(this.XM),this.onSeriesBackgroundTouchStart(this.rS.onTouchStart),this.onSeriesBackgroundTouchMove(this.rS.onTouchMove),this.onSeriesBackgroundTouchEnd(this.rS.onTouchEnd),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.mp(n,this.sk)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}getMinimumSize(){const t={x:0,y:0};t.x+=this.jt.left+this.jt.right+this.ya.left+this.ya.right,t.y+=this.jt.top+this.jt.bottom+this.ya.top+this.ya.bottom;const e=this.bp.Ds().Zc(),i=A(zc(this.Mk||Bc),this.Sp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Hk&&(t.x+=this.Hk.left,t.x+=this.Hk.right,t.y+=this.Hk.top,t.y+=this.Hk.bottom),t.x+=kc.x,t.y+=kc.y,t}addChartMarkerXY(t=au,e,i){const s=this.np(),r=new gu(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.ip(s),this.ts);return this.Ap(r),r}addAxisX(t){var e,i;const{opposite:s,type:r}=nh(t);let n;n="linear"===r.type?this.ep.d1({dimension:"x",scale1DConstructor:Di}):"linear-highPrecision"===r.type?this.ep.d1({dimension:"x",scale1DConstructor:Di})._i():this.ep.d1({dimension:"x",scale1DConstructor:Mi}).gi(r.base),n.tt(this.sk.x.ai());const o=s?this.Og:this.Ng,h=new uh(this.Uk,this.bA,this.vp,this.KA,this.qA,this.cs.hs,n,this.sk.y,(a=()=>h.wg(),{...ch,...Sc(a)}),this,s?100:0,this.tg,this.kk,this.ts,this.ih,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iStack:u,iParallel:l}),this.cs.vs(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=nh(t);let n;n="linear"===r.type?this.ep.d1({dimension:"y",scale1DConstructor:Di}):"linear-highPrecision"===r.type?this.ep.d1({dimension:"y",scale1DConstructor:Di})._i():this.ep.d1({dimension:"y",scale1DConstructor:Mi}).gi(r.base),n.tt(this.sk.y.ai());const o=s?this.Gg:this.Wg,h=new uh(this.Uk,this.bA,this.vp,this.KA,this.qA,this.cs.hs,n,this.sk.x,(a=()=>h.wg(),{...dh,...Ac(a)}),this,s?100:0,this.tg,this.kk,this.ts,this.ih,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iParallel:l,iStack:u}),this.cs.vs(),h}swapAxes(t,e){const i=[this.Ng,this.Wg,this.Gg,this.Og],s=i.find((e=>void 0!==e.find((e=>e.axis===t)))),r=i.find((t=>void 0!==t.find((t=>t.axis===e))));if(!s||!r)return this;if(s!==r)throw new Error("LightningChart JS ChartXY.swapAxes does not support swapping Axes that are on different sides.");const n=s.find((e=>e.axis===t)),o=s.find((t=>t.axis===e));if(!n||!o)return this;const h=n.iParallel,a=n.iStack;return n.iParallel=o.iParallel,n.iStack=o.iStack,o.iParallel=h,o.iStack=a,this.cs.vs(),this}dispose(){return this.Fp.dispose(),this.Wk.U(),this.Wx.U(),this.bA.U(),this.Uk.forEach((t=>t.U())),this.qA.U(),this.KA.U(),this.Hm.U(),this.OC().forEach((t=>t.dispose())),Kh(this.sk),this.Ng.slice().forEach((t=>t.axis.dispose())),this.Wg.slice().forEach((t=>t.axis.dispose())),this.Gg.slice().forEach((t=>t.axis.dispose())),this.Og.slice().forEach((t=>t.axis.dispose())),this.MS.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.Ng,...this.Og].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}getDefaultAxisY(){var t;return null===(t=[...this.Wg,...this.Gg].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):Rc;return It(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.Og.map((t=>t.axis));case e.AxisPosition.Bottom:return this.Ng.map((t=>t.axis));case e.AxisPosition.Left:return this.Wg.map((t=>t.axis));case e.AxisPosition.Right:return this.Gg.map((t=>t.axis))}})))}$k(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.Ng.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Og.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.Wg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Gg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.Mk=t,this.cs.vs(),this}getTitlePosition(){return this.Mk}Xk(t,e,i,s){const r=this.Mk||Bc;let n,o=A(zc(r),this.Sp);this.getTitleFillStyle()===z||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.bp.Ds().Zc();const h=Math.abs(s)+this.ya.bottom+this.jt.bottom,a=Math.abs(i)+this.ya.top+this.jt.top,l={left:Math.abs(t)+this.ya.left+this.jt.left,right:Math.abs(e)+this.ya.right+this.jt.right,top:a,bottom:h},u=this.uiScale.Ui(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Nc(r,u,l,n,o,this.ya);return this.bp.Ie(f).Ba(c).Ra(d),g}Fe(t){super.Fe(t);for(const t of this.MS)t.aS();for(const t of this.MS)t.Fe();const e=this.Wg.map((t=>t.axis._r().Ds())),i=this.Ng.map((t=>t.axis._r().Ds())),s=this.Og.map((t=>t.axis._r().Ds())),r=this.Gg.map((t=>t.axis._r().Ds()));let n=!1;this.forEachAxis((t=>{(t.Tr()||t.Fr())&&(n=!0)}));const o=this.Fk||this.Ik||!this.lk&&n;ia.Tp(this,this.IS.getIsUnderMouse(),o,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));const h=Oc(this.Wg,e),a=Oc(this.Ng,i),l=Oc(this.Og,s),c=Oc(this.Gg,r),d=this.Xk(h.thicknessTotal,c.thicknessTotal,l.thicknessTotal,a.thicknessTotal),f=this.sk.x.getCellSize()-(d.left+d.right),g=this.sk.y.getCellSize()-(d.bottom+d.top),m=[d.left,d.right],p=[d.bottom,d.top];this.sk.x.K(0,f),this.sk.y.K(0,g),this.sk.x.ei(m),this.sk.y.ei(p);const x=(t,e,i,s)=>{let r=0;t.groups.forEach((t=>{let n=0;const o=t.stacks.reduce(((t,e)=>Math.max(t,e.Tg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.sA+e.axis.eA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Vd?e.axis.Vd.pixels:0)),0),l=e-h-a;t.stacks.forEach((s=>{const h=s.axis,a=h.getVisible(),u=Math.max(e-n,0),c=Math.min(a?"pixels"in h.Vd?h.Vd.pixels:h.Vd.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.sA:0,f=a?i[1]+(e-n)-c-h.sA:0;h.ft.ei([d,f]),h.Fe({Tg:o,Fg:s.Fg,Dg:c,jk:n,Vg:o+s.Fg,Lg:r}),a&&(n+=c+h.sA+h.eA)})),r+=s*t.thicknessMax}))};x(h,g,p,-1),x(c,g,p,1),x(a,f,m,-1),x(l,f,m,1),this.Hk={left:h.thicknessTotal,top:l.thicknessTotal,right:c.thicknessTotal,bottom:a.thicknessTotal},this.IS.Ie(u(0,0)).tt(u(f,g)),this.PS.Ie(u(0,0)).tt(u(f,g));const S=y(this.sk.x.hi(),this.sk.y.hi(),this.sk.x.ni(),this.sk.y.ni());this.Wx.tx(S),this.KA.tx(S),this.qA.tx(S),this.Qg&&this.Qg(),this.Ng.forEach((t=>t.axis.Ug())),this.Og.forEach((t=>t.axis.Ug())),this.Wg.forEach((t=>t.axis.Ug())),this.Gg.forEach((t=>t.axis.Ug())),super.pp();for(const t of this.MS)t.Ay()}Z(){for(let t=0;t=10;n&&a&&h.x===s.x&&this.rk?(this.Fk=!0,this.ck.ke(this.pk).Ce(this.mk),this.dk.Ee(this.mk).Oe(s).Ve(r),this.fk.Ee(this.mk).Oe(u(s.x,r.y)).Ve(u(r.x,s.y)),this.bk=this.engine.setMouseStyle(this.xk,this.bk)):n&&a&&(this.hk||this.rk)?(this.Fk=!0,this.ck.ke(this.Ak).Ce(this.gk),this.dk.Ee(ot),this.fk.Ee(ot),this.bk=this.engine.setMouseStyle(this.vk,this.bk)):(this.Fk=!1,this.ck.Ce(ot).ke(z),this.dk.Ee(ot),this.fk.Ee(ot),this.engine.restoreMouseStyle(this.bk)),this.cs.vs()}Lk(t,e,i){if(this.Fk){const t=dt(this.engine.clientLocation2Engine(i.x,i.y),this.vp.cs.ft,this.sk),s=He(t.x,this.sk.x.getInnerStart(),this.sk.x.getInnerEnd())&&He(t.y,this.sk.y.getInnerStart(),this.sk.y.getInnerEnd()),r=i.x>=e.x||!this.rk?"zoom":"fit",n=this.ck.Ia(),o=oi(n,this.ck.ai()),h=Math.min(this.ck.ai().x,this.ck.ai().y)>=10;s&&h&&"zoom"===r&&this.hk?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=dt(n,this.sk,t.og).x,i=dt(o,this.sk,t.og).x;t.vt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=dt(n,this.sk,t.og).y,i=dt(o,this.sk,t.og).y;t.vt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.rk&&this.forEachAxis(Fc)}this.ck.Ce(ot).ke(z),this.dk.Ee(ot),this.fk.Ee(ot),this.cs.vs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}Bk(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(Ic),this.forEachAxisX((i=>{i.zoom(i.ft.ct(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ft.ct(t.y),e.y)}))}Rk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Ic(i),i.zoom(i.ft.ct(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Ic(i),i.zoom(i.ft.ct(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Qd(){const t=[];return this.forEachAxis((e=>e.xg((e=>t.push(e))))),super.Qd().concat(t)}OC(){return this.uk}me(){return this._p(this.Wx)}setAutoCursorEnabledDuringAxisAnimation(t){return this.lk=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.lk}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=fh(r)?r:Oi(r)?this.pixelScale:void 0;if(n&&zi(i)){const t=dt(s,n,this.engine.scale);return this.cs.Bo({engineX:t.x,engineY:t.y})}if(n&&Oi(i))return dt(s,n,this.pixelScale);if(n&&fh(i))return dt(s,n,i)}else{const i=t;if(Oi(e)){const t=this.cs.Do(i);return dt({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(fh(e)){const t=e,s=this.cs.Do(i);return dt({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,(_c=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",_c.RightTop="right-top",_c.LeftTop="left-top",_c.CenterBottom="center-bottom",_c.RightBottom="right-bottom",_c.LeftBottom="left-bottom",_c.SeriesCenterTop="series-center-top",_c.SeriesRightTop="series-right-top",_c.SeriesLeftTop="series-left-top",_c.SeriesCenterBottom="series-center-bottom",_c.SeriesRightBottom="series-right-bottom",_c.SeriesLeftBottom="series-left-bottom";const Bc=e.ChartXYTitlePositionOptions.CenterTop,zc=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 be(0,`Unexpected ChartXY title position selection ${t}`)},Nc=(t,e,i,s,r,n)=>{s.x,r.left,r.right;const o=s.y+r.bottom+r.top,h=(r.left-r.right)*e.x,a=(r.bottom-r.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-(n.top+r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i}}return be(0,`Unexpected ChartXY title position selection ${t}`)},Oc=(t,e)=>{const i=[];t.forEach(((t,s)=>{const r=e[s],n=i.find((e=>e.iParallel===t.iParallel));n?(n.stacks.push({...t,...r}),n.stacks.sort(((t,e)=>t.iStack-e.iStack))):i.push({iParallel:t.iParallel,stacks:[{...t,...r}]})}));const s=i.map((t=>{const e=t.stacks.reduce(((t,e)=>Math.max(t,e.Tg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Fg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Od)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Vd?e.axis.Vd.relative:0)),0);return{...t,ticksSizeMax:e,titleSizeMax:i,sumRelativeSize:r,thicknessMax:s}}));return s.sort(((t,e)=>t.iParallel-e.iParallel)),{groups:s,thicknessTotal:s.reduce(((t,e)=>t+e.thicknessMax),0)}};class Uc{constructor(t,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.L=new r.Eventer,this.Zk=[],this.Qk=new Map,this.MS=new Map,this.Jk=(t,e,i)=>{0!==this.MS.size&&void 0!==[...this.MS.values()].find((({series:t})=>!0===t.getVisible()))||this.Kk.vt(e,i,!1,!1,"zoomBandChart"),this.qk.cs.vs()},i.cs.Gn(ah.Af),this.dA=t,this.tT=(null==h?void 0:h.orientation)||"x",this.iT=void 0!==(null==h?void 0:h.useSharedValueAxis)&&h.useSharedValueAxis,this.sT=n,this.Uu="x"===this.tT?ch:dh;const l={...h,defaultAxisX:this.Uu.getWidth({x:null==h?void 0:h.defaultAxis,y:void 0}),defaultAxisY:this.Uu.getHeight({x:null==h?void 0:h.defaultAxis,y:void 0})};this.qk=new Vc(t,i,s,kt,o,l,a).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.qk.engine;const u=this.qk.getDefaultAxisX().setMouseInteractions(!1),c=this.qk.getDefaultAxisY().setMouseInteractions(!1);this.Kk=this.Uu.getWidth({x:u,y:c}).setScrollStrategy(zs.fitting).setAnimationScroll(!1).setStrokeStyle(ot).setTickStrategy(Ns.Empty),(null==h?void 0:h.useSharedValueAxis)?this.eT=this.Uu.getHeight({x:u,y:c}):this.Uu.getHeight({x:u,y:c}).dispose();const d=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new G({color:this.getTheme().isDark?E(0,0,0,180):E(255,255,255,180)});this.hT=[this.qk.bA.Te(this.Kk.og).ke(d).Ce(ot),this.qk.bA.Te(this.Kk.og).ke(d).Ce(ot)];const f=this.qk.bA.Rg(this.Kk.og).Ee(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.rT={collection:f,members:new Array(5).fill(0).map((t=>f.Vr()))};const g=this.getTheme(),m="function"==typeof g.zoomBandChartKnobFillStyle?g.zoomBandChartKnobFillStyle(this.dA.Xs):g.zoomBandChartKnobFillStyle||z;this.nT=[this.qk.bA.Te(this.qk.pixelScale).ke(m).Ce(ot),this.qk.bA.Te(this.qk.pixelScale).ke(m).Ce(ot)],this.oT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.aT()}add(t){var e,i,s,r,n;const o=this.Zk.map((t=>t.axis)),h="x"===this.tT?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Jk);this.Zk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Kk.Xh(h.$h()),this.lT&&this.lT.remove(),this.lT=gt(...this.Zk.map((t=>t.axis)))}const a=this.Uu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.iT)l=this.eT;else{const t=this.Qk.get(a);t?l=t:(l=this.Uu.getHeight({x:this.qk.addAxisX.bind(this.qk),y:this.qk.addAxisY.bind(this.qk)})(),this.uT(l)),this.Qk.set(a,l)}const u=this.Uu.getWidth({x:this.Kk,y:l}),c=this.Uu.getHeight({x:this.Kk,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.a_(r)));const n=t.l_((()=>e.clear()));f.push((()=>{t.u_(n)}))};if(t instanceof Ec)d=this.qk.addPointLineAreaSeries({...t.Yn,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.ik());else if(t instanceof vc||t instanceof mc){const i=this.qk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof vc?null===(e=t.Yn)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof vc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Gc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof Yu){const e=this.qk.addAreaSeries({xAxis:u,yAxis:c,baseline:t._w}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof bc){const e=this.qk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.Yn)||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 gc){const e=this.qk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.Yn)||void 0===s?void 0:s.pointShape,mode:t.Xw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ic){const e=this.qk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.Yn)||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 Qu){const e=this.qk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.Yn)||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 $u){const e=this.qk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.n_()),i=t.o_(((t,i)=>e.add(i)));f.push((()=>t.a_(i))),d=e;const s=t.l_((()=>e.clear()));f.push((()=>{t.u_(s)}))}else{if(!(t instanceof _u))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.qk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.I_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.B_(d);const s=t.E_(((t,i)=>e.invalidateIntensityValues(i))),r=t.L_(i);f.push((()=>{t.z_(s),t.R_(r)}));const n=t.l_((()=>e.clear()));f.push((()=>{t.u_(n)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const y=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(y)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.MS.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.MS.get(t);if(e){const{clearReferences:i}=e;i(),this.MS.delete(t),e.series.dispose();const s=this.Uu.getHeight({x:t.axisX,y:t.axisY}),r=this.Qk.get(s);r&&0===r.wg().length&&(this.Qk.delete(s),r.dispose())}const i="x"===this.tT?t.axisX:t.axisY;if(!Array.from(this.MS.keys()).find((t=>i===("x"===this.tT?t.axisX:t.axisY)))){const t=this.Zk.findIndex((t=>t.axis===i));this.Zk[t].deattach(),this.Zk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.hT.forEach((e=>e.ke(t))),this.qk.cs.vs(),this}getDefocusOverlayFillStyle(){return this.hT[0].zh()}setSplitterStrokeStyle(t){return this.rT.collection.Ee(t),this.qk.cs.vs(),this}getSplitterStrokeStyle(){return this.rT.collection.cu()}setKnobFillStyle(t){return this.nT.forEach((e=>e.ke(t))),this.qk.cs.vs(),this}getKnobFillStyle(){return this.nT[0].zh()}setKnobStrokeStyle(t){return this.nT.forEach((e=>e.Ce(t))),this.qk.cs.vs(),this}getKnobStrokeStyle(){return this.nT[0].lo()}setKnobSize(t){return this.oT=t,this.qk.cs.vs(),this}getKnobSize(){return this.oT}getDefaultAxisX(){return this.qk.getDefaultAxisX()}getDefaultAxisY(){return this.qk.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}uT(t){t.setTickStrategy(Ns.Empty).setMouseInteractions(!1).setNibStyle(ot).setStrokeStyle(ot)}aT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.getInterval();Math.abs(this.Kk.ft.dt(t)-this.Kk.ft.dt(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(h.start,h.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.Uu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const n="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.Uu.getWidth(this.qk.translateCoordinate(t,this.qk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),Zt(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=Wi(new $i(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.qk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.qk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.ft.mi(o.start,this.Uu.getWidth(t)),a=this.Kk.ft.mi(o.end,this.Uu.getWidth(t));i(h,a,!1),Zt(e)};this.qk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=Wi(new $i(void 0,((t,e,i,r,n)=>s(r,n))));this.qk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.getInterval(),a=this.Uu.getWidth(this.qk.translateCoordinate(e,this.qk.coordsAxis)),l=this.Kk.ft.dt(o.start),u=this.Kk.ft.dt(o.end),c=this.Kk.ft.dt(a),d=Rt((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Ef,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),y=Rt(this.Kk.ft.mi(o.start,g),h.start,h.end),p=Rt(this.Kk.ft.mi(o.end,m),h.start,h.end);i(y,p,!1),Zt(e)})),this.qk.onSeriesBackgroundTouchStart(r.onTouchStart),this.qk.onSeriesBackgroundTouchMove(r.onTouchMove),this.qk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.hT.forEach(((s,r)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const r="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.Uu.getWidth(this.qk.translateCoordinate(t,this.qk.coordsAxis)),o=r.getInterval(),h=this.Kk.getInterval(),a=Rt(n-(o.end-o.start)/2,Math.min(h.start,h.end),Math.max(h.start,h.end)-Math.abs(o.end-o.start)),l=a+(o.end-o.start);i(a,l,!0),Zt(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=Wi(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=bt.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)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.qk.getSizePixels()}onResize(t){return this.qk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.qk.offResize(t)}Ir(t){this.qk.Ir(t)}getMinimumSize(){return this.qk.getMinimumSize()}Z(){return this.qk.Z()}J(){return this.qk.J()}Fe(t){var e,i,s,r;const n=xe(Array.from(this.MS.keys()).map((t=>t.chart))),o="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.MS.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.tT){const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.eg?t.Yg():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.eg?t.Yg():0})),Math.max(t,i)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=n.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.qk.setPadding({left:i+(0===n.length?10:0),right:r+e+(0===n.length?10:0)})}else{const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.eg?t.Yg():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.eg?t.Yg():0})),Math.max(t,i)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=n.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.qk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.qk.Fe(t);const h=this.Kk.getInterval().start,a=this.Kk.getInterval().end,l=Rt(o?o.getInterval().start:h,h,a),u=Rt(o?o.getInterval().end:a,h,a),c=this.Uu.getHeight(this.qk.sk.getInnerIntervalPixels());this.hT[0].Ie(this.Uu.toPoint(h,0)).tt(this.Uu.toPoint(l-h,c)),this.hT[1].Ie(this.Uu.toPoint(u,0)).tt(this.Uu.toPoint(a-u,c)),this.rT.members[0].zg(this.Uu.toPoint(h,c),this.Uu.toPoint(l,c)),this.rT.members[1].zg(this.Uu.toPoint(l,c),this.Uu.toPoint(l,0)),this.rT.members[2].zg(this.Uu.toPoint(l,0),this.Uu.toPoint(u,0)),this.rT.members[3].zg(this.Uu.toPoint(u,0),this.Uu.toPoint(u,c)),this.rT.members[4].zg(this.Uu.toPoint(u,c),this.Uu.toPoint(a,c));const d=dt(this.Uu.toPoint(l,c/2),this.Kk.og,this.qk.pixelScale),f=dt(this.Uu.toPoint(u,c/2),this.Kk.og,this.qk.pixelScale),g=this.oT;this.nT[0].Ie({x:d.x-g.x/2,y:d.y-g.y/2}).tt({x:g.x,y:g.y}).Gh(this.Uu.getWidth({x:0,y:90})),this.nT[1].Ie({x:f.x-g.x/2,y:f.y-g.y/2}).tt({x:g.x,y:g.y}).Gh(this.Uu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.qk.setSeriesBackgroundFillStyle(t),this.qk.cs.vs(),this}getSeriesBackgroundFillStyle(){return this.qk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.qk.setSeriesBackgroundStrokeStyle(t),this.qk.cs.vs(),this}getSeriesBackgroundStrokeStyle(){return this.qk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.qk.setSeriesBackgroundEffect(t),this.qk.cs.vs(),this}getSeriesBackgroundEffect(){return this.qk.getSeriesBackgroundEffect()}getTheme(){return this.qk.getTheme()}setTitle(t){return this.qk.setTitle(t),this}getTitle(){return this.qk.getTitle()}setTitleFillStyle(t){return this.qk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.qk.getTitleFillStyle()}setTitleFont(t){return this.qk.setTitleFont(t),this}getTitleFont(){return this.qk.getTitleFont()}setTitleMargin(t){return this.qk.setTitleMargin(t),this}getTitleMargin(){return this.qk.getTitleMargin()}setPadding(t){return this.qk.setPadding(t),this}getPadding(){return this.qk.getPadding()}setBackgroundFillStyle(t){return this.qk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.qk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.qk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.qk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return $h(t,e,i,this.qk.pixelScale,this.qk.cs)}addUIElement(t,e){return this.qk.addUIElement(t,e)}addLegendBox(t,e){return this.qk.addLegendBox(t,e)}getLegendBoxes(){return this.qk.getLegendBoxes()}saveToFile(t,e,i){return this.qk.saveToFile(t,e,i),this}dispose(){return this.qk.dispose(),this.Qk.clear(),this.MS.clear(),this.sT(this),this}isDisposed(){return this.qk.isDisposed()}onDispose(t){return this.qk.onDispose((()=>t(this)))}offDispose(t){return this.qk.offDispose(t)}}const Gc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof vc||t instanceof Yu?t.getStrokeStyle().getFillStyle():t instanceof bc||t instanceof Qu?t.getPointFillStyle():void 0)(t);return e?new Ji({thickness:2,fillStyle:e}):void 0};class Yc extends Yl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Ms="Point Series",this.Ob=[],this.Nb=!1,this.$b=3,this.ga=0,this.Om=Hl,this.be=fe(this.ts.polarPointSeriesFillStyle,o),this.ad=new no({dataPattern:null}),this.Ga=t.fd(r).Ee(ot).dd(z).ud(this.be).Ad(e.PointShape.Circle).Sd(this.$b).ds(this.getHighlight()).ld(this.ad),this.fs(this.Ga)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setPointAlignment(t){return this.Ga.KC(t),this.Ki.cs.vs(),this}getPointAlignment(){return this.Ga.qC()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.Ga.ud(e),this.Ts.vs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.$b=t,this.Ga.Sd(t),this.Ts.vs(),this}getPointSize(){return this.$b}setPointShape(t){return this.Ga.Ad(t),this.Ki.cs.vs(),this}getPointShape(){return this.Ga.gd()}setPointRotation(t){return this.ga=t,this.Ga.pd(t),this.Ts.vs(),this}getPointRotation(){return this.ga}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=dt(t,this.Ki.cs.ft,this.scale),s=this.ad.$c(i,!1,this.scale,this.Ki.pixelScale);if(!s)return;const{angle:r,amplitude:n}=$l(s,this.scale);return wa(s,this.scale,this.Om(new la,this,r,n,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,"color"in s&&void 0!==s.color&&X(this.be)?new G({color:k(s.color)}):this.be)}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.ad.clear().add(t),this.Ga.Ho(e),this.Nb=!1,this.Ga.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}ks(){return this.bs||this.getPointShape()}}class Hc{constructor(t,e,i,s){this.L=new r.Eventer,this.cT=!1,this.Ki=t,this.dT=e,this.MS=i,this.Ga=s}setGeometry(t){return this.fT=t,this.cT=!0,this.Ki.cs.vs(),this}getGeometry(){return this.fT}setMouseInteractions(t){return this.Ga.setMouseInteractions(t),this}dispose(){return this.Ga.dispose(),this.dT(this),this.L.emit("dispose",this),this}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setVisible(t){const e=this.Ga.getVisible()!==t;return this.Ga.setVisible(t),e&&this.L.emit("visibleStateChanged",this,t),this.Ki.cs.vs(),this}getVisible(){return this.Ga.getVisible()}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}class Xc extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Polygon Series",this.AT=[],this.gT=[],this.Om=Hl,this.pT=t=>{const e=this.gT.indexOf(t);e>=0&&this.gT.splice(e,1);const i=this.AT.findIndex((e=>e===t.Ga));i>=0&&this.AT.splice(i,1),this.Ts.vs()},this.be=fe(this.ts.polarPolygonSeriesFillStyle,n),this.Me=fe(this.ts.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}addPolygon(){const t=new Hc(this.Ki,this.pT,this,this.mT());return this.gT.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.AT)t.ke(e);return this.Ts.vs(),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.AT)t.Ce(e);return this.Ts.vs(),this}getStrokeStyle(){return this.Me}qy(){return this.iS&&void 0!==this.gT.find((t=>void 0!==t.yT))&&this.getVisible()}Fe(){this.gT.forEach((t=>{(t.cT||this.scale.Hb())&&t.ST&&(t.Ga.Sl(Xl(t.ST,this.scale)),t.cT=!1,t.Ga.Ds())}))}aS(){super.aS();const t=m(Le,Pe);this.gT.forEach((e=>{if(!e.fT)return;const i=!e.cT&&e.ST?e.ST:jl(e.fT);e.ST=i;const s=!e.cT&&e.yT?e.yT:Wl(i);e.yT=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Lb=t}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=bu(t,this.AT,((t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,t.cs.ft)}),Xe);if(!i)return;const s=dt(i[0],i[1].cs.ft,this.scale),r=this.vT(i[1]);if(!r)return;const{angle:n,amplitude:o}=$l(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.Om(new la,this,n,o,this.Ki.getAmplitudeAxis().formatValue).Qu(),owner:this,fillStyle:this.be,polarPolygon:r}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}mT(){const t=this.Ts.sc(this.scale,hn.Simple).ke(this.be).Ce(this.Me).ds(this.getHighlight());return this.AT.push(t),this.fs(t),t}vT(t){return this.gT.find((e=>e.Ga===t))}}class Wc extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Area Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.xT=!1,this.Om=Hl,this.be=fe(this.ts.polarAreaSeriesFillStyle,n),this.Me=fe(this.ts.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}}class jc extends Wc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.bT=this.Ts.sc(this.scale,hn.Simple).ds(this.getHighlight()),this.fs(this.bT)}Fe(){if(this.Nb||this.scale.Hb()){const t=this.Ob,e=!0===this.Gb?Xl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Ct(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let r=0;const n=[];for(let t=i.angle+s;!Ct(t%360,e.angle%360);t+=s)if(n.push({angle:t,amplitude:0}),r+=1,r>360)return[];for(let t=0;t=this.MT.start}Cb(t){this._T=t,this.FT=!0}Tb(){return!1===this._T}kb(t){this.wT=t,this.FT=!0}Mb(){return this.wT}yi(){return this.xi}wi(){return!1}ut(t,e,i,s){return this.x=new Di(t.x,e.x,i.x,s?s.x:void 0),this.y=new Di(t.y,e.y,i.y,s?s.y:void 0),this}Si(){return this.fi}Hb(){return this.TT}DT(){return this.FT}Ui(){return this.IT}Z(){return this.o=!1,this.xi=!1,this.TT=!1,this.FT=!1,this}J(){return this.o=!0,this.xi=!0,this.TT=!0,this.FT=!0,this}tt(t,e){return"object"==typeof t?(this.j.x=t.x,this.j.y=t.y):(this.j.x=t,this.j.y=e),this.PT(),this}zi(t){return this.CT=t,this.PT(),this}Vi(t){return this.kT=t,this.PT(),this}oi(){return u(this.CT[0]+this.CT[1],this.kT[0]+this.kT[1])}ai(){return this.j}PT(){const t=this.MT,e=u(this.x.li(this.j.x),this.y.li(this.j.y)),i=this.CT[0]+this.CT[1],s=this.kT[0]+this.kT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.CT[0]+Math.max((r-2*o)/2,0),this.CT[1]+Math.max((r-2*o)/2,0)],a=[this.kT[0]+Math.max((n-2*o)/2,0),this.kT[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.tt(this.j.x).ei(h).K(-l,l),this.y.tt(this.j.y).ei(a).K(-l,l),this.IT={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.fi={x:this.x.Si(),y:this.y.Si()},this.J()}mi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Yi(t,e,i,s){const r=this.Ui(),n=si(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Zc extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("polarChart bg",0),r,i.cs.ts.polarChartBackgroundFillStyle,i.cs.ts.polarChartBackgroundStrokeStyle,i.cs.ts.polarChartTitleFont,i.cs.ts.polarChartTitleFillStyle,h),this.coordsClient="client",this.Kf=[],this.Lo=!0,this.Vm=e.AutoCursorModes.onHover,this.BT=(t,e,i,s,r)=>{this.hb.tt(s,r)},this.iA=Qt(this.Kf),this.LT=t=>{this.Kf.push(t)},this.RT=()=>this.MS,this.cs.Gn(ah.df),this.Wk=i.Ax("polarChart series bg",0),this.ET=i.Um("polarChart axis gridlines",0),this.zT=i.Um("polarChart series",1),this.VT=i.Um("polarChart axis lines",2),this.OT=i.Um("polarChart axis ticks",3),this.hb=s.d2({scaleXYConstructor:$c}),this.onResize(this.BT),this.bp.Eh("Polar Chart"),this.IS=this.Wk.Kc(this.hb).ke(this.ts.polarChartSeriesBackgroundFillStyle).Ce(ot).hu(0).Ve(360).au(0),this.PS=this.Wk.Kc(this.hb).ke(z).Ce(this.ts.polarChartSeriesBackgroundStrokeStyle).hu(0).Ve(360).au(0),super.FS(this.IS,this.PS),this.mp(n,this.pixelScale),this.NT=new Pl(this,this.hb,this.ts,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.ET,this.VT,this.OT,this.hs,this.RT),this.GT=new Vl(this,this.hb,this.ts,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.ET,this.VT,this.OT,this.hs),this.coordsAxis={axisAmplitude:this.NT,axisRadial:this.GT},this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,Ma);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(zi(r)){const t=dt(e,s,this.engine.scale);return this.cs.Bo({engineX:t.x,engineY:t.y})}if(Oi(r))return e;if(Nl(r)){const t=dt(e,s,this.hb);return $l(t,this.hb)}}else{const i=t,s=e;if(Ni(i)){if(Nl(s)){const t=this.cs.Do(i),e=dt({x:t.engineX,y:t.engineY},this.engine.scale,this.hb);return $l(e,this.hb)}if(zi(s))return i;if(Oi(s)){const t=this.cs.Do(i);return dt({x:t.engineX,y:t.engineY},this.cs.ft,this.pixelScale)}}else if(Ol(i)){if(Nl(s))return i;const t=Xl([i],this.hb)[0];if(zi(s)){const e=dt(t,this.hb,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.cs.Bo(i)}if(Oi(s))return dt(t,this.hb,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Jl(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointSeries(t){const e=new Yc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointLineSeries(t){const e=new ql(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addAreaSeries(t){const e=new jc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPolygonSeries(t){const e=new Xc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addHeatmapSeries(t){const e=new Zl(this.zT,this,this.wS,this.hb,this.ts,this.cs.hs,t);return this.DS(e),e}addSector(){const t=new Ul(this.zT,this,this.iA,this.hb,this.ts,this.cs.hs);return this.LT(t),t}getAmplitudeAxis(){return this.NT}get amplitudeAxis(){return this.NT}get axisAmplitude(){return this.NT}getRadialAxis(){return this.GT}get radialAxis(){return this.radialAxis}get axisRadial(){return this.radialAxis}Fe(t){var e,i;super.Fe(t),ta.kp(this.bp,this.Sp);for(const t of this.MS)t.aS();this.NT._r(),this.GT._r();for(const t of this.MS)t.Fe();for(let t=1;t<=2;t+=1){const e=this.NT.Fe(),i=this.GT.Fe(),s=ta.Cp(this.bp,this.Sp),r=[this.ya.left+i,this.ya.right+i],n=[this.ya.bottom+i,this.ya.top+i+s];this.hb.zi(r).Vi(n);const o=4;if(!(!this.WT||Math.abs(this.WT.amplitude-e)>=o||Math.abs(this.WT.radial-i)>=o)||1!==t){this.WT={amplitude:e,radial:i};break}}const s=this.hb.yb().start,r=this.hb.yb().end,n=this.hb.mb()?((null===(e=this.WT)||void 0===e?void 0:e.radial)||0)*this.hb.x.getPixelSize()+r-s:((null===(i=this.WT)||void 0===i?void 0:i.radial)||0)*this.hb.x.getPixelSize()+s-r;this.IS.ru(n).lu(360),this.PS.ru(n).lu(360);for(const t of this.Kf)t.Fe();ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));for(const t of this.MS)t.Ay();return super.pp(),this.UT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.NT.setAnimationsEnabled(t),this.GT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.Lo=t,this}getMouseInteractions(){return this.Lo}getMinimumSize(){return u(Kc,Kc)}UT(){}forEachAxis(t){return t(this.NT),t(this.GT),this}dispose(){return this.Kf.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wk.U(),this.ET.U(),this.zT.U(),this.VT.U(),this.OT.U(),this.Hm.U(),super.dispose()}Qd(){return[...this.MS,...this.Kf]}}const Kc=300;class Jc extends Ia{}class qc extends Jc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Ms="Slice",this.S=0,this.um=!1,this.YT=z,this.fm=z,this.Am=this.S,this.ym=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.bT=e.sc(r,hn.Simple).ds(this.getHighlight()),this.fs(this.bT),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.YT=t,this.fm=i,this.bT.ke(this.YT).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},ed=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=td(i,r.x),s=td(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),A=(i+c/u*(s-i))/2,g={x:a-A,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+A,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>g.x&&p.bT.Sl([g,d,f,m])}};class id extends Qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("funnelChart bg",0),r,i.cs.ts.funnelChartBackgroundFillStyle,i.cs.ts.funnelChartBackgroundStrokeStyle,i.cs.ts.funnelChartTitleFont,i.cs.ts.funnelChartTitleFillStyle,o),this.Cm=[],this.km=ka.None,this.Im=!0,this.Bm=0,this.HT=80,this.$T=20,this.XT=0,this.jT=e.FunnelSliceModes.VariableHeight,this.Em=!0,this.Vm=e.AutoCursorModes.onHover,this.Om=Ra,this.Nm=t=>{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.zm=this.ts.effectsText,this.Wm=i.Um("funnelChart bottom",0),this.Ym=i.Um("funnelChart top",1),this.bp.Eh("Funnel Chart"),this.Tm=this.ts.funnelChartSliceFillStylePalette,this.Fm=this.ts.funnelChartSliceStrokeStyle,this.Pm=this.ts.funnelChartSliceLabelFont,this.Dm=this.ts.funnelChartSliceLabelFillStyle,this.Hm=i.$m();const a=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.mp(n,this.pixelScale)}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new qc(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);return this.Bm+=1,i.setName(t),i.setValue(e),i.hs.ns.Ss(this.zm),i.hs.os.Ss(this.Em),this.Cm.push(i),this.cs.vs(),i.setHighlightOnHover(this.Im),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){return this.Dm="function"==typeof t?t(this.Dm):t,this.cs.vs(),this}getLabelFillStyle(){return this.Dm}setLabelFont(t){return this.Pm="function"==typeof t?t(this.Pm):t,this.cs.vs(),this}getLabelFont(){return this.Pm}setLabelEffect(t){return this.zm=t,this.Cm.forEach((e=>e.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);this.Cm=this.Cm.sort(this.km);for(let t=0,{length:e}=this.Cm;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;twa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e){t.setStyle(this.Gd?new G({color:this.Gd.getColors(t.getAnimatedValue())}):this.Tm(e,t),this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wm.U(),this.Ym.U(),this.Hm.U(),super.dispose()}}const sd=(t,i,s)=>{const r=t.vl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.FunnelLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},rd=t=>{const e=t.vl();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 nd extends id{constructor(){super(...arguments),this.jm=Ca.NamePlusValue,this.ZT=10,this.QT=e.FunnelLabelSide.Left,this.JT=e.SliceLabelIndices.LabelsOnSides,this.Qm=[],this.ty=this.ts.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t{const e=this.Cm.indexOf(t);e>=0&&this.Cm.splice(e,1)},this.cs.Gn(ah.uf),this.Ts=e.Um("gaugeChart layer",0),this.Ym=e.Um("gaugeChart top layer",1),this.bp.Eh("Gauge Chart"),this.mp(r,this.pixelScale);const h=Wi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.U(),this.Ym.U(),this.Cm.slice().forEach((t=>t.dispose())),super.dispose()}}class cd extends ud{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.jl=90,this.Zl=-270,this.tF={min:this.jl,max:this.Zl},this.iF=K((()=>this.Ts.vs())),this.sF=()=>{this.eF=void 0},this.hF=e.Um("radialGaugeChart bg arc",2),this.rF=this.Ts.Kc(this.pixelScale).ke(this.ts.gaugeChartEmptyGaugeFillStyle).Ce(this.ts.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.jl,s=this.Zl,r=this.tF;return this.getAnimationsEnabled()?this.nF(r,{min:t,max:e}):(r.min=t,r.max=e,this.jl=t,this.Zl=e),this.L.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.cs.vs(),this}getAngleInterval(){return{min:this.jl,max:this.Zl}}setGaugeFillStyle(t){return this.rF.ke(t),this.cs.vs(),this}setGaugeStrokeStyle(t){return this.rF.Ce(t),this.cs.vs(),this}nF(t,e,i){this.eF=this.iF(1e3,$.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.tF={min:t,max:e},this.jl=t,this.Zl=e,this.Ts.vs()})),this.eF.onEveryAnimationEnd(this.sF),i&&this.eF.onAnimationEnd(i)}onAngleIntervalChange(t){return this.L.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.L.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.hF.U(),this}}class dd extends Ia{oF(t){return this.L.on("valueChange",t)}aF(t){return this.L.on("valueIntervalChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}offIntervalChange(t){return this.L.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){le(t,this.ts,i,{fill:this.lF})}}class fd extends dd{onValueChange(t){return this.oF(t)}onIntervalChange(t){return this.aF(t)}}class gd extends fd{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.jl=0,this.Zl=0,this.uF=0,this.cF=0,this.dF=0,this.fF=100,this.AF=!0,this.Am=this.S,this.pm=this.getVisible(),this.ym=Me(),this.gF=t=>{this.Am=t,this.Ki.cs.vs()},this.pF=t,this.Br=e,this.Ki=i,this.scale=s,this.lF=this.ts.gaugeChartGaugeFillStyle,this._m=t.Kc(s).ke(this.lF).Ce(ot).ds(this.getHighlight()),this.fs(this._m),this.mF=e.Dr(s).ds(this.getHighlight()),this.fs(this.mF,{isText:!0}),this.yF=e.Dr(s).ds(this.getHighlight()),this.fs(this.yF,{isText:!0}),this.Ye=e.Dr(s).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0}),this.mF.ke(n.gaugeChartIntervalLabelsFillStyle).Nh(n.gaugeChartIntervalLabelsFont),this.yF.ke(n.gaugeChartIntervalLabelsFillStyle).Nh(n.gaugeChartIntervalLabelsFont),this.Ye.ke(n.gaugeChartValueLabelFillStyle).Nh(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ki.getDataLabelFormatter(),e=this.jl/90r&&(i=r);const n=this.Zl-e*this.cF,o=this.jl+e*this.uF,h=this.fF-this.dF,a=(0!==h?(n-o)/h:1/0)*(i-this.dF);this._m.hu(o).Ve(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ye.Eh(l)}SF(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.dF,{getInnerStart:()=>this.dF,getInnerEnd:()=>this.fF}):t.format(this.dF);return this.mF.Eh(e).Ds(),this.mF.ai()}vF(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.fF,{getInnerStart:()=>this.dF,getInnerEnd:()=>this.fF}):t.format(this.fF);return this.yF.Eh(e).Ds(),this.yF.ai()}setName(t){return super.setName(t),this.Ki.cs.vs(),this}setValue(t){const e=this.S;return this.Ki.getAnimationsEnabled()?this.pm&&this.ym(e,t,this.gF):this.Am=t,this.S=t,this.L.emit("valueChange",this,e,t),this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return this.pm=t,!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?this.ym(this.Am,0,this.gF,{onCompleted:()=>super.setVisible(!1)}):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(super.setVisible(!0),this.ym(this.Am,this.S,this.gF)):(this.Am=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.dF,s=this.fF;return this.L.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.dF=t,this.fF=e,this.Ki.cs.vs(),this}setIntervalLabelsFont(t){return this.mF.Nh(t),this.yF.Nh(t),this.Ki.cs.vs(),this}getIntervalLabelsFont(){return this.mF.Oh()}setIntervalLabelsFillStyle(t){return this.mF.ke(t),this.yF.ke(t),this.Ki.cs.vs(),this}getIntervalLabelsFillStyle(){return this.mF.zh()}setIntervalLabelsVisible(t){return t?(this.mF.setVisible(!0),this.yF.setVisible(!0)):(this.mF.setVisible(!1),this.yF.setVisible(!1)),this.AF=t,this}getIntervalLabelsVisible(){return this.AF}setAngleInterval(t,e){return this.jl=t,this.Zl=e,this.Ki.cs.vs(),this}setMinAngle(t){return this.jl=t,this.Ki.cs.vs(),this}setMaxAngle(t){return this.Zl=t,this.Ki.cs.vs(),this}setMarginInDegrees(t=this.uF,e=this.cF){return t!==this.uF&&(this.uF=t),e!==this.cF&&(this.cF=e),this.Ki.cs.vs(),this}setFillStyle(t){this.lF="function"==typeof t?t(this.lF):t;const e=this.lF;this._m.ke(e);for(let t=0;tr?25*s:25*r))){const o=Array(n+2),h=Math.PI;let a=0,l=0;const c=e*h/180,d=(i*h/180-c)/n;for(o[a]=u(t.x,t.y),a+=1;a<=n+1;)o[a]=u(t.x+s*Math.cos(c+l*d),t.y+r*Math.sin(c+l*d)),a+=1,l+=1;return[o,n]}class yd extends cd{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Od=20,this.MF=new Intl.NumberFormat,this._F=new Intl.NumberFormat,this.wF=!1,this.CF=5;const h=new gd(this.Ts,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);this.kF=h,this.Cm.push(h),this.setPadding(10)}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=Ze([this.kF.SF(),this.kF.vF()]),s=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.ya.left+i.max.x+.5*s.x,this.ya.bottom+i.max.y+.5*s.y),o=this.wF?this.TF(n,r):n,h=this.rF.Me.getThickness(),a=r-.5*h,l=r-this.Od;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.Od-h)/r);this.FF(o,l)&&(this.rF.ru(r).au(c),this.kF._m.ru(a).au(d));const f=.5*(g=r,(m=this.Zl-this.jl)/(2*Math.PI*g*(m/360))*h);var g,m;this.rF.hu(this.jl).Ve(this.Zl).Ie(o),this.kF._m.Ie(o),this.kF.Ye.Ie(o),this.Gd&&this.kF.setFillStyle(new G({color:this.Gd.getColors(this.kF.getAnimatedValue())})),this.kF.setMinAngle(this.jl).setMaxAngle(this.Zl).setMarginInDegrees(f,f).Fe();const y=this.rF.Ql();if(this.kF.getIntervalLabelsVisible()){this.IF(this.jl,this.Zl,o,y+this.CF);const t=this.kF.mF.Ds().Ue(),e=this.kF.yF.Ds().Ue();Ne(t,e)&&this.PF(t,e,o,y+this.CF)}}FF(t,e){const i=ni(this.kF.Ye.Ds().ai(),.5),s=t.x+e,r=t.x-e,n=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xn||t.y-i.y=0?i=-s:s=-i),[i,s]}TF(t,e){const[i]=md(t,this.jl,this.Zl,e,e),s=Ze(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return oi(hi(t,u(s.min.x+r,s.min.y+n)),t)}IF(t,e,i,s){const r=gi(t),n=gi(e);this.kF.mF.Ie(ti(u(i.x+s,i.y),i,-r)),this.kF.yF.Ie(ti(u(i.x+s,i.y),i,-n)),this.kF.mF.za(u(-Math.cos(r),-Math.sin(r))),this.kF.yF.za(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.kF}setAutoScaling(t){return this.wF=t,this.cs.vs(),this}getAutoScaling(){return this.wF}setDataLabelFormatter(t){return this._F=t,this.cs.vs(),this}getDataLabelFormatter(){return this._F}setIntervalLabelFormatter(t){return this.MF=t,this.cs.vs(),this}getIntervalLabelFormatter(){return this.MF}setIntervalLabelPadding(t){return this.CF=t,this.cs.vs(),this}getIntervalLabelPadding(){return this.CF}setThickness(t){return this.Od=t,this}setLUT(t){return this.Gd=t,this.cs.vs(),this}setDataLabelFont(t){return this.kF.Ye.Nh(t),this.cs.vs(),this}getDataLabelFont(){return this.kF.Ye.Oh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.kF.xF(t),this.cs.vs(),this}getDataLabelFillStyle(){return this.kF.bF()}Qd(){return this.Cm}dispose(){return this.kF.dispose(),super.dispose()}}class pd extends Ia{}class xd extends pd{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Ms="Slice",this.S=0,this.um=!1,this.YT=z,this.fm=z,this.Am=this.S,this.ym=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.bT=e.sc(r,hn.Simple).ds(this.getHighlight()),this.fs(this.bT),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.YT=t,this.fm=i,this.bT.ke(this.YT).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Ad=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Sd(i,r.x),s=Sd(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),A=(i+c/u*(s-i))/2,g={x:a-A,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+A,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>=g.x&&p.bT.Sl([g,d,f,m])}};class vd extends Qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("pyramidChart bg",0),r,i.cs.ts.pyramidChartBackgroundFillStyle,i.cs.ts.pyramidChartBackgroundStrokeStyle,i.cs.ts.pyramidChartTitleFont,i.cs.ts.pyramidChartTitleFillStyle,o),this.Cm=[],this.km=ka.None,this.Tm=this.ts.pyramidChartSliceFillStylePalette,this.Fm=this.ts.pyramidChartSliceStrokeStyle,this.Im=!0,this.Pm=this.ts.pyramidChartSliceLabelFont,this.Dm=this.ts.pyramidChartSliceLabelFillStyle,this.Bm=0,this.HT=0,this.$T=80,this.XT=0,this.jT=e.PyramidSliceModes.VariableHeight,this.Em=!0,this.Vm=e.AutoCursorModes.onHover,this.Om=Ra,this.Nm=t=>{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.zm=this.ts.effectsText,this.Wm=i.Um("pyramidChart bottom",0),this.Ym=i.Um("pyramidChart top",1),this.bp.Eh("Pyramid Chart"),this.Hm=i.$m();const a=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.mp(n,this.pixelScale),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new xd(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);return this.Bm+=1,i.setName(t),i.setValue(e),i.hs.ns.Ss(this.zm),i.hs.os.Ss(this.Em),this.Cm.push(i),this.cs.vs(),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){return this.Dm="function"==typeof t?t(this.Dm):t,this.cs.vs(),this}getLabelFillStyle(){return this.Dm}setLabelFont(t){return this.Pm="function"==typeof t?t(this.Pm):t,this.cs.vs(),this}getLabelFont(){return this.Pm}setLabelEffect(t){return this.zm=t,this.Cm.forEach((e=>e.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);this.Cm=this.Cm.sort(this.km);for(let t=0,{length:e}=this.Cm;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;twa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e){t.setStyle(this.Gd?new G({color:this.Gd.getColors(t.getAnimatedValue())}):this.Tm(e,t),this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wm.U(),this.Ym.U(),this.Hm.U(),super.dispose()}}const bd=(t,i,s)=>{const r=t.vl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.PyramidLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},Md=t=>{const e=t.vl();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 Ed extends vd{constructor(){super(...arguments),this.jm=Ca.NamePlusValue,this.ZT=10,this.QT=e.PyramidLabelSide.Left,this.JT=e.SliceLabelIndices.LabelsOnSides,this.Qm=[],this.ty=this.ts.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t(t.alignmentX=(r+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=r%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(r)*n,t.paddingY=Math.sin(r)*n,t),Rd=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Id;e.SpiderWebMode=void 0,(Id=e.SpiderWebMode||(e.SpiderWebMode={}))[Id.Normal=0]="Normal",Id[Id.Circle=1]="Circle";class Fd{constructor(t,e,i,s,n,o,h,a){this.L=new r.Eventer,this.BF=t,this.Br=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.LF=h,this.RF=a,this.EF=this.BF.ze(this.scale).setMouseInteractions(!1),this.zF=this.Br.Dr(this.scale).Eh(this.tag).setMouseInteractions(!1),this.VF=this.LF(this,this.BF.sy(this.scale,void 0,[za.InternalUI])).Ee(this.chart.getNibStyle()),this.RF.As([this.zF])}Zm(t,i,s,r,n,o,h){const a=i.length,l=i[s>0?s-1:a-1],c=i[s],d=i[s{const n=s/i,o=[];for(let h=-s/2;h<=s/2;h+=r){const r=n*(h/s)+e,a=u(t.x+Math.cos(r)*i,t.y+Math.sin(r)*i);o.push(a)}return o})(t,r,n,f)),h?this.zF.setVisible(!0).Ie(oi(c,u(h.paddingX,h.paddingY))).Ba(h.alignmentX).Ra(h.alignmentY):this.zF.setVisible(!1)}getLabelSize(){return this.zF.Nh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().ai()}dispose(){this.EF&&this.EF.dispose(),this.zF&&this.zF.dispose(),this.VF&&this.VF.dispose()}}const Dd=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Axis:","",s).addRow("Value:","",r(i))};class Ld extends Gl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Ms="Spider Series",this.yu=new Map,this.$i=e.HighlightModes.onHover,this.Om=Dd,this.$b=8,this.ga=0,this.OF=Me(),this.NF={},this.GF={},this.pm=this.getVisible(),this.WF=1,this.UF=((t,e)=>{const i=K((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||$.ease,u=(null==a?void 0:a.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?h&&n?(s=i(u,l)([[n,0]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(n=0,e(!1)):h?(e(!0),s=i(u,l)([[n,1]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0}))):(n=1,e(!0))}})((t=>{this.WF=t,this.Ts.cs.vs()}),(t=>{super.setVisible(t)})),this.Ki=t,this.Ts=i,this.Xb=r,this.YF=n,this.gx=o,this.HF=h,this.$F=a,this.scale=s,this.XF=fe(u.spiderSeriesFillStyle,c),this.jF=fe(u.spiderSeriesStrokeStyle,c),this.ZF=fe(u.spiderSeriesPointFillStyle,c)}qy(){return this.iS&&this.yu.size>0&&this.getVisible()}addPoints(...t){this.yu.size>0&&this.Ki.cs.Gn(ah.xf),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.OF(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.yu.set(s,r+t*(e-r)),this.Ts.cs.vs()}))}),{easing:this.NF.easing,durationMs:this.NF.durationMs,onStart:()=>{i=new Map(this.yu)}})}else for(let e=0;e=3&&(this.bT||(this.bT=this.Ts.sc(this.scale,hn.Simple).Ce(this.jF).ke(this.XF).ds(this.getHighlight()),this.fs(this.bT)),this.bT.Sl(t),this.jb||(this.jb=this.Ts.bS(this.scale).tt(this.$b).sl(this.Xb).Gh(this.ga).ke(this.ZF).ds(this.getHighlight()),this.fs(this.jb)),this.jb.Gt().ol(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.XF,stroke:this.jF}),this}ks(){return this.bs||this.Xb}QF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},_d=t=>Ze(t.zF.Ue()),Vd=t=>Ze(t.Ue()),Bd=(t,i,s,r)=>t.au(0).Ie(s).hu(90).Ve(-270).lu(i===e.SpiderWebMode.Circle?void 0:r.length),zd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Nd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Od=()=>{Nd.alignmentX=0,Nd.alignmentY=0,Nd.paddingX=0,Nd.paddingY=0};class Ud extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("spiderChart bg",0),r,i.cs.ts.spiderChartBackgroundFillStyle,i.cs.ts.spiderChartBackgroundStrokeStyle,i.cs.ts.spiderChartTitleFont,i.cs.ts.spiderChartTitleFillStyle,h),this.ya=x(20,20,20,20),this.axisScale=ut.d1({scale1DConstructor:Di,dimension:"x"}).K(0,1),this.gx=[],this.JF=[],this.KF=[],this.qF=zs.expansion,this.tI=!0,this.iI=Rd,this.sI=Cd,this.Lo=!0,this.eI=e.SpiderWebMode.Normal,this.hI=4,this.rI=this.ts.spiderChartWebStyle,this.nI=this.ts.spiderChartScaleLabelFillStyle,this.oI=this.ts.spiderChartScaleLabelFont,this.aI=5,this.lI=this.ts.spiderChartAxisLabelFillStyle,this.uI=this.ts.spiderChartAxisLabelFont,this.cI=5,this.dI=this.ts.spiderChartAxisStrokeStyle,this.fI=this.ts.spiderChartAxisNibStrokeStyle,this.Df=10,this.AI=x(),this.Vm=e.AutoCursorModes.onHover,this.hasAxis=t=>this.gx.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Bi(t,Ii.Numeric),this.gI=()=>{const t=this.gx.map(_d).concat(this.KF.map(Vd));return Ue(t)},this.pI=()=>this.mI.Kc(this.pixelScale).setMouseInteractions(!1),this.yI=t=>t.dispose(),this.SI=()=>this.bA.Dr(this.pixelScale).setMouseInteractions(!1),this.vI=t=>t.dispose(),this.xI=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.bI=(t,e)=>{let i,s;const r=()=>{void 0!==this.MI&&this.MI.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.qF,this.qF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.gx.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Pd(a,this.gx.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ri(hi(t.EF.Pi(),t.EF.Fi())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.K(i.min,l),Zt(o),this.cs.vs()}},o=()=>{if(i=void 0,void 0!==s)if(this.ih){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this._I(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),r=i.end(t.min,t.max,e.min,e.max);this.MI=this.tp.cs.en(300,$.ease)([[0,1]],(([e])=>{this.axisScale.K(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.MI.onAnimationEnd((()=>{this.MI=void 0,this.qF=i}))}else this.qF=s}else this.qF=s;s=void 0};e.setMouseEnterEventHandler(this.wI).setMouseLeaveEventHandler(this.CI).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Wi(new $i(((t,e,i)=>{this.wI(t),r(),Zt(i)}),n,((t,e,i,s)=>{this.CI(t),o(),Zt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.kI=t=>{this.tI&&!this.hasAxis(t)&&this.addAxis(t)},this.HF=(t,e)=>{for(const i of this.gx)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return je(i.EF.Pi(),i.EF.Fi(),t)}},this.$F=t=>{if(0===this.gx.length)return;const e=hi(dt(t,this.engine.scale,this.pixelScale),this.gx[0].EF.Pi()),i=Math.atan2(e.y,e.x);let s,r=Le;for(const t of this.gx){const e=hi(t.EF.Fi(),t.EF.Pi()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.Lo&&(t.Ee(this.fI),this.cs.vs())},this.CI=t=>{t.Ee(this.fI),this.cs.vs()},this.cs.Gn(ah.cf),this.Wk=i.Ax("spiderChart series bg",0),this.mI=i.Um("spiderChart web shapes",0),this.TI=i.Um("spiderChart axis bg",1),this.Wx=i.Um("spiderChart plotting",2),this.bA=i.Um("spiderChart fg",3),this.RF=this.hs.yg().Ss(this.ts.effectsText),this.bp.Eh("Spider Chart"),this.IS=this.Wk.Kc(this.pixelScale).ke(this.ts.spiderChartSeriesBackgroundFillStyle).Ce(ot).hu(90).Ve(-270).au(0),this.PS=this.Wk.Kc(this.pixelScale).ke(z).Ce(this.ts.spiderChartSeriesBackgroundStrokeStyle).hu(90).Ve(-270).au(0),super.FS(this.IS,this.PS),this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,Aa);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.mp(n,this.pixelScale)}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Fd(this.TI,this.bA,this.pixelScale,this,t,this.axisScale,this.bI,this.RF);this.gx.push(e)}}else t&&this.gx.push(t);return this.RF.As(this.gx.map((t=>t.zF))),this.cs.vs(),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.MS.length,r=new Ld(this,this.Wx,this.pixelScale,i,this.kI,this.gx,this.HF,this.$F,this.wS,this.ts,s,this.cs.hs);return this.DS(r),r}getSeriesCount(){return this.MS.length}setWebMode(t){return this.eI=t,this.cs.vs(),this}getWebMode(){return this.eI}setWebCount(t){return this.hI=t,this.cs.vs(),this}getWebCount(){return this.hI}setWebStyle(t){return this.rI="function"==typeof t?t(this.rI):t,this.cs.vs(),this}getWebStyle(){return this.rI}setScaleLabelStyle(t){return this.nI="function"==typeof t?t(this.nI):t,this.cs.vs(),this}getScaleLabelStyle(){return this.nI}setScaleLabelFont(t){return this.oI="function"==typeof t?t(this.oI):t,this.cs.vs(),this}getScaleLabelFont(){return this.oI}setScaleLabelPadding(t){return this.aI=t,this.cs.vs(),this}getScaleLabelPadding(){return this.aI}setScaleLabelStrategy(t){return this.iI=t,this.cs.vs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.cs.vs(),this}setAxisLabelStyle(t){return this.lI="function"==typeof t?t(this.lI):t,this.cs.vs(),this}getAxisLabelStyle(){return this.lI}setAxisLabelFont(t){return this.uI="function"==typeof t?t(this.uI):t,this.cs.vs(),this}getAxisLabelFont(){return this.uI}setAxisLabelEffect(t){return this.RF.Ss(t),this.cs.vs(),this}getAxisLabelEffect(){return this.RF.xs()}setAxisLabelPadding(t){return this.cI=t,this.cs.vs(),this}getAxisLabelPadding(){return this.cI}setAxisLabelStrategy(t){return this.sI=t,this.cs.vs(),this}setAxisStyle(t){return this.dI="function"==typeof t?t(this.dI):t,this.cs.vs(),this}getAxisStyle(){return this.dI}setNibStyle(t){return this.fI="function"==typeof t?t(this.fI):t,this.cs.vs(),this}getNibStyle(){return this.fI}setNibLength(t){return this.Df=t,this.cs.vs(),this}getNibLength(){return this.Df}setAutoAxis(t){return this.tI=t,this}getAutoAxis(){return this.tI}setMouseInteractions(t){return this.Lo=t,this}getMouseInteractions(){return this.Lo}setAxisScrollStrategy(t){return this.qF=t,this.cs.vs(),this}getAxisScrollStrategy(){return this.qF}setAxisInterval(t,e=0){return this.axisScale.K(e,t),this.cs.vs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp);const e=this.gx.length,i=ta.Cp(this.bp,this.Sp),s=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+i)),r=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.sI){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?r.right=Math.max(r.right,l.x+.5*(1-a.alignmentX)*h.x-t):r.left=Math.max(r.left,-l.x+.5*(a.alignmentX+1)*h.x-t),o>0?r.top=Math.max(r.top,l.y+.5*(1-a.alignmentY)*h.y-t):r.bottom=Math.max(r.bottom,-l.y+.5*(a.alignmentY+1)*h.y-t)}}if(this.qF){const t=this._I();if(void 0!==t){const e=this.qF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.qF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.K(e,i)}}const n=u(this.pixelScale.x.getInnerStart()+(r.left+this.pixelScale.x.getInnerInterval()-r.right)/2,this.pixelScale.y.getInnerStart()+(r.bottom+this.pixelScale.y.getInnerInterval()-r.top)/2),o=Math.min(s.x/2-(r.left+r.right)/2,s.y/2-(r.bottom+r.top)/2);this.AI=x(this.jt.left+this.ya.left+r.left,this.jt.top+this.ya.top+i+r.top,this.jt.right+this.ya.right+r.right,this.jt.bottom+this.ya.bottom+r.bottom),this.Zm(n,o);for(const t of this.MS)t.aS();for(const t of this.MS)t.Fe();super.pp(),ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));for(const t of this.MS)t.Ay()}dispose(){return this.Wk.U(),this.mI.U(),this.TI.U(),this.Wx.U(),this.bA.U(),this.Fp.dispose(),this.Hm.U(),super.dispose()}getMinimumSize(){return u(this.AI.left+this.AI.right+100,this.AI.bottom+this.AI.top+100)}Zm(t,e){const i=this.gx.length,s=[];for(let r=0;r{const a=t.length,l=n.length,u=e>0&&l>1;for(let l=0;l=a&&t.push(o());const h=t[l];Bd(h,i,s,n);const u=r*((l+1)/e);h.ru(u)}else l{const c=r.length,d=t.length;let f=0;if(void 0!==e)for(let a=0;a=d&&t.push(h());const e=t[f];f+=1;const s=(i-r)/i,c=je(n,o[a],s);e.Ie(oi(c,u(y.paddingX,y.paddingY))).Ba(y.alignmentX).Ra(y.alignmentY).Eh(l(s))}}}for(let e=f;e1;for(const s of this.gx)for(const r of this.MS){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Gd=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99998/e),o=Math.floor(99999/(e+1)),h=Math.floor(89999/(e+1)),a=510001+e*h;let l=0;return{FI:()=>{const e=t.II("dashboard ui",a+l);return l+=1,e},DI:()=>t.II("dashboard legend",51e4),BI:e=>{const a=1+e*i,l=100001+e*s,u=200002+e*r,c=300002+e*n,d=400001+e*o,f=510001+e*h;let g=0;return{cs:t,yp:(e,i)=>{const s=a+i;return t.II(e,s)},Ax:(e,i)=>{const s=l+i;return t.II(e,s)},Yk:(e,i)=>{const s=u+i;return t.II(e,s)},Um:(e,i)=>{const s=c+i;return t.II(e,s)},ux:(e,i,s)=>{const r=c+i;return t.LI(e,r,s)},xp:(e,i)=>{const s=d+i;return t.II(e,s)},op:e=>{const i=f+g,s=t.II(e,i);return g+=1,s},lp:()=>t.II("panel legend",500002+e),$m:()=>t.II("panel cursor",600001+e)}}}};class Yd{constructor(t){this.L=new r.Eventer,this.S=t}M(t){return this.S=t,this.L.emit("set",t),this}_(){return this.S}N(t){return this.L.on("set",t)}W(t){return this.L.off(t,"set")}}const Hd={dh:()=>{},sh:!1,eh:0,hh:!1,oh:0,rh:!1,ah:0,lh:0,Ke:zs.fitting},Xd=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,r,n,o,h)=>{const{type:a,data:l}=t;if(0===l.length)return;const u=[s,r];"spark-line"===a&&ef(t,e,u,n,o,h),"spark-bar"===a&&sf({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&sf({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&rf(t,e,u,n,o,h),"spark-pie"===a&&nf(t,e,u,n,o,h)},jd=(t,e,i,s)=>({x:Zd(t.x,e.x,i.x,s),y:Kd(t.y,e.y,i.y,s)}),$d=(t,e,i,s)=>({position:Zd(t.position,e.x,i.x,s),high:Kd(t.high,e.y,i.y,s),low:Kd(t.low,e.y,i.y,s)}),Zd=(t,e,i,s)=>{const r=Rt(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Kd=(t,e,i,s)=>{const r=Rt(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Jd=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&qd(a,e,i,r,n,o,h),"axis-band"===a.type&&Qd(a,i,r,n,o,h),"constant-line"===a.type&&tf(a,i,s,r,n,o,h)},qd=(t,i,s,r,n,o,h)=>{const{value:a,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===a&&(f=i[0]),"end"===a&&(f=i[i.length-1]),"min"===a){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof a||(f=jd(a,s,r,n),((t,e)=>{const i=e[0],s=e[1],r=t.x,n=t.y;return i.x<=r&&r<=i.x+s.x&&i.y<=n&&n<=i.y+s.y})(f,n)))&&o.pointSet.add().Gt().sl(void 0!==u?u:e.PointShape.Circle).Gh(d||0).tt(c||5).ke(l||h.sparkPointChartFillStyle).ol(f)},Qd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Pe,Le),f=u(Pe,Le);"x"===o&&(d=jd({x:h,y:Pe},e,i,s),f=jd({x:a,y:Le},e,i,s)),"y"===o&&(d=jd({x:Pe,y:h},e,i,s),f=jd({x:Le,y:a},e,i,s));const g=s[0],m=s[1],y=Rt(d.x,g.x,g.x+m.x),p=Rt(d.y,g.y,g.y+m.y),x=Rt(f.x,g.x,g.x+m.x),S=Rt(f.y,g.y,g.y+m.y);r.rect.add().dl(y).fl(p).tt(u(x-y,S-p)).ke(l||n.sparkChartBandFillStyle).Ce(c||n.sparkChartBandStrokeStyle).Ce(ot)},tf=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,y=[];if("y"===h&&d<=c&&c<=f){const t=jd(u(g,c),{x:g,y:d},s,r),e=jd(u(m,c),{x:g,y:d},s,r);y.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=jd(u(c,d),{x:g,y:d},s,r),e=jd(u(c,f),{x:g,y:d},s,r);y.push([t,e])}y.length>0&&n.line.add().Ee(l||o.sparkChartConstantLineStrokeStyle).Oe(y[0][0]).Ve(y[0][1])},ef=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.$n&&bt.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=Le,c=Pe,d=Le,f=Pe;for(let t=0;tjd(t,{x:u,y:d},g,i)));e.lineSet.add().ds(n).Ee(o||s.sparkLineChartStrokeStyle).Gt().ol(m),a&&Jd(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},sf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,y=f/d*1;let p=Le,x=Pe;if(g)p=-1,x=1;else for(const t of o)p=Math.min(p,t),x=Math.max(x,t);const S={x:0,y:g?-1:Math.min(0,p)},A={x:1*o.length+(o.length-1)*y,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*y,y:g?t>=m?1:0:t},r=jd({x:1*e+e*y,y:g?t>=m?0:-1:0},S,A,i),n=jd(s,S,A,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().ds(n).Ie(t.position).pl(t.height).Al(t.width).ke((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Ce(a||s.sparkBarChartStrokeStyle)}))},rf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.$n&&bt.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=Le,f=Pe,g=Le,m=Pe;for(let t=0;t{const{data:o,strokeStyle:h}=t,a=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=a.reduce(((t,e)=>t+e),0),d=jd(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;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().ds(n).Ie(d).ru(g).au(0).hu(m).Ve(m+r).ke(l[i]||fe(s.sparkPieChartFillStyle,i)).Ce(h||s.sparkPieChartStrokeStyle),m+=r}))};var of,hf,af;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(of||(of={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(hf||(hf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(af||(af={}));class lf extends fn{constructor(t,e,i,s,r){super(),this.Bs=!1,this.k_={x:0,y:0,height:20,width:20},this.RI={x:10,y:10},this.Ts=t,this.EI=r,this.zI=new mo(t,e,i,kt,s).setMouseInteractions(!0),this.VI=t.sc(e,hn.Simple).ke(s.dataGridScrollBarButtonArrowFillStyle).Ce(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Mu(this),this.zI.onMouseEnter((t=>t.setHighlight(1))),this.zI.onMouseLeave((t=>t.setHighlight(0)))}OI(){switch(this.EI){case af.Up:this.VI.Sl([{x:this.k_.x,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y-this.RI.y/2},{x:this.k_.x-this.RI.x/2,y:this.k_.y-this.RI.y/2}]);break;case af.Down:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x,y:this.k_.y-this.RI.y/2}]);break;case af.Left:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y},{x:this.k_.x+this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y-this.RI.y/2}]);break;case af.Right:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y},{x:this.k_.x-this.RI.x/2,y:this.k_.y-this.RI.y/2}])}}Ie(t){return this.k_.x=t.x,this.k_.y=t.y,this}Ia(){return u(this.k_.x,this.k_.y)}tt(t){return this.k_.height=t.x,this.k_.width=t.y,this}ai(){return{x:this.k_.height,y:this.k_.width}}onMouseDown(t){return this.zI.onMouseDown(t)}onMouseUp(t){return this.zI.onMouseUp(t)}setFillStyle(t){return this.zI.setFillStyle(t),this}getFillStyle(){return this.zI.getFillStyle()}setStrokeStyle(t){return this.zI.setStrokeStyle(t),this}getStrokeStyle(){return this.zI.getStrokeStyle()}Fe(){return this.zI.Fe(),this.OI(),this}Ds(){return this.zI.setSize(u(this.k_.height,this.k_.width)).setPosition(u(this.k_.x,this.k_.y)),this}setVisible(t){return this.zI.setVisible(t),this.VI.setVisible(t),this}dispose(){return this.zI.dispose(),this.VI.dispose(),this}setMouseInteractions(t){return this.zI.setMouseInteractions(t),this}getMouseInteractions(){return this.zI.getMouseInteractions()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}getHighlight(){return this.zI.getHighlight()}setHighlight(t){return this.zI.setHighlight(Ae(t)),this.L.emit("highlight",this,Boolean(t)),this.Ts.vs(),this}}const uf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class cf{constructor(t,i,s,n,o,h,a){this.qc={x:0,y:0},this.k_={x:0,y:0,height:0,width:0},this.L=new r.Eventer,this.NI={min:u(0,0),max:u(0,0)},this.CM=!1,this.kM=!1,this.GI={x:0,y:0},this.wu=void 0,this.WI=u(0,0),this.UI={x:0,y:0},this.YI=0,this.HI=15,this.TM=(t,i)=>{this.CM=!0,this.bA.vs();const s=this.$I.getDraggingMode();this.wu=this.bA.cs.Ur(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.XI&&clearInterval(this.XI)},this.FM=()=>{this.CM=!1,this.bA.vs(),this.bA.cs.Yr(this.wu)},this.IM=t=>(this.kM=!0,this.GI=dt(this.bA.cs.De(t.x,t.y),this.bA.cs.ft,this.scale),!0),this.jI=(t,e)=>(this.ZI(e),this.XI=setInterval((()=>this.ZI(e)),300),!0),this.QI=()=>(clearInterval(this.XI),!0),this.PM=(t,i)=>{const s=this.$I.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=dt(this.bA.cs.De(t.x,t.y),this.bA.cs.ft,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?uf(n.x,this.scale.x):this.k_.x,r!==e.UIDraggingModes.onlyHorizontal?uf(n.y,this.scale.y):this.k_.y),h=u(o.x-this.GI.x,o.y-this.GI.y),a=u(this.$I.getPosition().x+h.x,this.$I.getPosition().y+h.y),l=this.JI(a),c={x:Math.abs(this.WI.x-l.x),y:Math.abs(this.WI.y-l.y)};return this.KI(c),this.UI.y>h.y&&(this.GI=n),this.Fe(),!0}return!1},this.DM=(t,e)=>{this.kM=!1,Zt(e),this.bA.vs()},this.bA=t,this.tp=i,this.scale=n,this.contentScale=o,this.qI=a,this.tP=new lf(t,s,n,h,a===of.UpToDown?af.Up:af.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.iP=new lf(t,s,n,h,a===of.UpToDown?af.Down:af.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.$I=new mo(t,s,n,kt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===of.UpToDown?e.UIDraggingModes.onlyVertical:a===of.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.sP=new mo(i,s,n,kt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.$I.onMouseEnter(this.TM),this.$I.onMouseLeave(this.FM),this.$I.onMouseDragStart(((t,e)=>this.IM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onMouseDrag(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onMouseDragStop(this.DM),this.$I.onTouchStart(((t,e)=>this.IM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onTouchMove(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onTouchEnd(this.DM),this.tP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.iP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.tP.onMouseUp(((t,e)=>this.QI()&&Zt(e))),this.iP.onMouseUp(((t,e)=>this.QI()&&Zt(e))),this.sP.onMouseWheel(((t,e)=>this.eP(e))),this.$I.onMouseWheel(((t,e)=>this.eP(e))),this.sP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.sP.onMouseUp(((t,e)=>this.QI()&&Zt(e)))}hP(t){return this.k_=t,this}Al(t){return this.k_.width=t,this}rP(){return this.k_.width}nP(t){return this.WI=t,this}oP(t){return this.qc=t,this}aP(){return this.qc}lP(t){return this.HI=t,this}uP(){return this.qI}cP(t){let e;switch(this.qI){case of.UpToDown:return e=t>0?Math.min(this.WI.y-this.NI.max.y,this.UI.y+t):Math.max(0,this.UI.y+t),e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0);case of.LeftToRight:return e=Math.min(this.NI.max.x-this.WI.x,this.UI.x+t),e!==this.UI.x&&(this.KI({y:0,x:e}),this.Fe(),!0);default:return!1}}dP(t){let e;switch(this.qI){case of.UpToDown:return e=Math.max(0,this.UI.y-t),e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0);case of.LeftToRight:return e=t>0?Math.max(0,this.UI.x-t):Math.min(this.NI.max.x-this.WI.x,this.UI.x-t),e!==this.UI.x&&(this.KI({x:e,y:0}),this.Fe(),!0);default:return!0}}fP(t){switch(this.qI){case of.UpToDown:return this.L.on("scrollY",t);case of.LeftToRight:return this.L.on("scrollX",t)}return this.L.on("scrollY",t)}JI(t){switch(this.qI){case of.UpToDown:if(t.y>this.NI.min.y)return u(t.x,this.NI.min.y);if(t.ythis.NI.max.x)return u(this.NI.max.x,t.y)}return t}eP(t){t.deltaY>0&&this.AP()&&Zt(t),t.deltaY<0&&this.gP()&&Zt(t)}ZI(t){const e=dt(this.bA.cs.De(t.clientX,t.clientY),this.bA.cs.ft,this.scale);let i;const s=this.$I.getPosition(),r=this.$I.getSize();this.pP(e,s,r)?clearInterval(this.XI):(i=this.qI===of.UpToDown?u(0,e.y-s.y>0?this.HI:-this.HI):u(s.x-e.x>0?this.HI:-this.HI,0),(i.x>0||i.y>0)&&this.mP(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.yP(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}pP(t,e,i){return this.qI===of.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.k_.height?Math.min(this.WI.y-this.NI.max.y,this.UI.y+t):0,e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0)}case of.LeftToRight:{const e=Math.min(this.NI.max.x-this.WI.x,this.UI.x+t);return e!==this.UI.x&&(this.KI({y:0,x:e}),this.Fe(),!0)}default:return!1}}gP(){return this.mP(this.HI)}AP(){return this.yP(this.HI)}KI(t){if(t.x===this.UI.x&&t.y===this.UI.y)return;let e;switch(this.UI=t,this.qI){case of.UpToDown:e=this.UI.y*this.YI*this.contentScale.Ui().y,this.L.emit("scrollY",hf.Vertical,e),this.bA.cs.vs();break;case of.LeftToRight:e=this.UI.x*this.YI*this.contentScale.Ui().x,this.L.emit("scrollX",hf.Horizontal,e)}}setVisible(t){return this.tP.setVisible(t),this.iP.setVisible(t),this.sP.setVisible(t),this.$I.setVisible(t),this}dispose(){return this.tP.dispose(),this.iP.dispose(),this.sP.dispose(),this.$I.dispose(),this.XI&&clearInterval(this.XI),this}Ds(){switch(this.vP(),this.xP(),this.qI){case of.UpToDown:this.tP.Ie({x:this.k_.x,y:this.k_.y+this.k_.height-this.tP.ai().x/2}).tt(u(this.k_.width,this.k_.width)).Ds(),this.iP.Ie({x:this.k_.x,y:this.k_.y+10}).tt(u(this.k_.width,this.k_.width)).Ds(),this.sP.setSize({x:this.k_.width,y:this.k_.height-2*this.tP.ai().x}).setPosition({x:this.k_.x,y:this.k_.y+this.iP.ai().y+this.sP.getSize().y/2}),this.$I.setSize(u(this.k_.width,this.bP())),this.WI={x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2},this.SP({min:{x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2},max:{x:this.k_.x,y:this.iP.Ia().y+this.iP.ai().x/2+this.$I.getSize().y/2}});break;case of.LeftToRight:this.tP.Ie({x:this.k_.x,y:this.k_.y}).tt(u(this.k_.height,this.k_.height)).Ds(),this.iP.Ie({x:this.k_.x+this.k_.width-this.iP.ai().x,y:this.k_.y}).tt(u(this.k_.height,this.k_.height)).Ds(),this.sP.setSize({y:this.k_.height,x:this.k_.width-2*this.tP.ai().y}).setPosition({x:this.k_.x+this.tP.ai().x/2+this.sP.getSize().x/2,y:this.k_.y}),this.$I.setSize(u(this.bP(),this.k_.height)),this.WI={x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2,y:this.k_.y},this.SP({min:{x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2,y:this.k_.y},max:{x:this.iP.Ia().x-this.iP.ai().x/2-this.$I.getSize().x/2,y:this.k_.y}})}return this.MP(),this}vP(){switch(this.qI){case of.UpToDown:this._P()||this.setVisible(!1),this._P()&&this.setVisible(!0);break;case of.LeftToRight:this.wP()||this.setVisible(!1),this.wP()&&this.setVisible(!0)}}xP(){switch(this.qI){case of.UpToDown:this._P()||this.KI({x:0,y:0});break;case of.LeftToRight:this.wP()||this.KI({x:0,y:0})}}_P(){return this.qc.x>this.k_.height}wP(){return this.qc.y>this.k_.width}bP(){switch(this.qI){case of.UpToDown:return this.k_.height*(this.k_.height-2*this.tP.ai().x)/this.qc.x;case of.LeftToRight:return this.k_.width*(this.k_.width-2*this.tP.ai().y)/this.qc.y;default:return 0}}MP(){switch(this.qI){case of.UpToDown:this.YI=(this.qc.x-this.k_.height)/(this.NI.min.y-this.NI.max.y);break;case of.LeftToRight:this.YI=(this.qc.y-this.k_.width)/(this.NI.max.x-this.NI.min.x)}}Fe(){switch(this.tP.Fe(),this.iP.Fe(),this.sP.Fe(),this.qI){case of.UpToDown:this.$I.setPosition({x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2-this.UI.y}).Fe();break;case of.LeftToRight:this.$I.setPosition({y:this.k_.y,x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2+this.UI.x}).Fe()}return this}}class df{constructor(t,e,i,s,r,n,o){switch(this.bA=t,this.tp=e,this.scale=s,this.contentScale=r,o){case hf.Vertical:this.CP=this.kP(i,n,of.UpToDown);break;case hf.Horizontal:this.TP=this.kP(i,n,of.LeftToRight);break;case hf.Both:this.CP=this.kP(i,n,of.UpToDown),this.TP=this.kP(i,n,of.LeftToRight)}this.FP=Wi(new $i(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.TP)||void 0===n?void 0:n.dP(s.x))&&Zt(r),0!==s.y&&(null===(o=this.CP)||void 0===o?void 0:o.cP(s.y))&&Zt(r)})))}kP(t,e,i){return new cf(this.bA,this.tp,t,this.scale,this.contentScale,e,i)}rP(){return 20}oP(t){var e,i;return null===(e=this.CP)||void 0===e||e.oP(t),null===(i=this.TP)||void 0===i||i.oP(t),this}IP(t){var e;return null===(e=this.TP)||void 0===e||e.lP(t),this}PP(t){var e;return null===(e=this.CP)||void 0===e||e.lP(t),this}DP(t){const e=this.CP;return e&&e.eP(t),this}BP(t){return this.FP.onTouchStart(this,t),this}LP(t){return this.FP.onTouchMove(this,t),this}RP(t){return this.FP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.TP)||void 0===e||e.fP(t),null===(i=this.CP)||void 0===i||i.fP(t),this}dispose(){var t,e;return null===(t=this.CP)||void 0===t||t.dispose(),null===(e=this.TP)||void 0===e||e.dispose(),this}Fe(){var t,e;return null===(t=this.CP)||void 0===t||t.Fe(),null===(e=this.TP)||void 0===e||e.Fe(),this}Ds(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.CP)||void 0===t||t.hP({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.TP)||void 0===e||e.hP({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.CP)||void 0===i||i.Ds(),null===(s=this.TP)||void 0===s||s.Ds(),this}}class ff extends Qh{constructor(t,e,i,s,r,n){super(t,e,i,e.yp("dataGrid bg",0),s,e.cs.ts.dataGridBackgroundFillStyle,e.cs.ts.dataGridBackgroundStrokeStyle,e.cs.ts.dataGridTitleFont,e.cs.ts.dataGridTitleFillStyle,n),this.EP=[],this.zP=[],this.VP=[],this.OP=new Map,this.NP=!0,this.GP=!0,this.WP=!0,this.UP=!0,this.YP=!0,this.HP=!0,this.$P=!0,this.XP=!0,this.jP=!0,this.ZP=!0,this.QP=!0,this.JP=!0,this.KP=!0,this.qP=!0,this.tD=!0,this.iD=!0,this.sD=new Set,this.eD=new Set,this.hD=!0,this.rD=!0,this.nD=(t,e)=>{t.borders=void 0===e?xf:{...t.borders,...e},this.oD(t),this.JP=!0,this.cs.vs()},this.oD=t=>{t.borders&&(!1===t.borders.top&&this.aD(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.lD,bottom:!1}})),!1===t.borders.bottom&&this.aD(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.lD,top:!1}})),!1===t.borders.left&&this.aD(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.lD,right:!1}})),!1===t.borders.right&&this.aD(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.lD,left:!1}})),!0===t.borders.top&&this.aD(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.lD,bottom:!0}})),!0===t.borders.bottom&&this.aD(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.lD,top:!0}})),!0===t.borders.left&&this.aD(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.lD,right:!0}})),!0===t.borders.right&&this.aD(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.lD,left:!0}})))},this.uD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseEnter,i,e)},this.cD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseLeave,i,e)},this.dD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseClick,i,e)},this.fD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDoubleClick,i,e)},this.AD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDown,i,e)},this.gD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseUp,i,e)},this.pD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseMove,i,e)},this.mD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDrag,i,e)},this.yD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDragStart,i,e)},this.SD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDragStop,i,e)},this.vD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellMouseWheel,i,e),!e.defaultPrevented&&this.hD&&this.xD.DP(e))},this.bD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchStart,i,e),!e.defaultPrevented&&this.rD&&this.xD.BP(e))},this.MD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchMove,i,e),!e.defaultPrevented&&this.rD&&this.xD.LP(e))},this._D=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchEnd,i,e),!e.defaultPrevented&&this.rD&&this.xD.RP(e))},this.cs.Gn(ah.sf),this.bp.Eh("Data Grid"),this.wD=i.d2({scaleXYConstructor:_i}),this.wD.x.sg=Hd,this.CD=i.d2({scaleXYConstructor:_i}),this.kD={x:0,y:0},this.TD=this.ts.dataGridTextFont,this.FD=this.ts.dataGridTextFillStyle,this.lD={top:!0,bottom:!0,left:!0,right:!0},this.ID=this.ts.dataGridCellBackgroundFillStyle,this.PD=this.ts.dataGridBorderStrokeStyle,this.DD="left-center",this.BD={left:5,right:5,bottom:5,top:5},this.LD=e.Ax("dataGrid grid bg",0),this.RD=e.Ax("dataGrid cell bg",1),this.ED=e.Um("dataGrid cell content",0),this.zD=e.Um("dataGrid scrollbar bg",1),this.VD=e.Um("dataGrid scrollbar fg",2),this.xD=this.OD(),this.onBackgroundMouseWheel(((t,e)=>{this.hD&&this.xD.DP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.rD&&this.xD.BP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.rD&&this.xD.LP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.rD&&this.xD.RP(e)})),this.ND=this.LD.Te(this.wD).ke(this.ts.dataGridBackgroundFillStyle).Ce(ot).setMouseInteractions(!1),this.GD=this.ED.Rg(this.wD).setMouseInteractions(!1),this.WD=new Xa((()=>this.RD.Te(this.wD).setMouseInteractions(!0).setMouseEnterEventHandler(this.uD).setMouseLeaveEventHandler(this.cD).setMouseClickEventHandler(this.dD).setMouseDoubleClickEventHandler(this.fD).setMouseDownEventHandler(this.AD).setMouseUpEventHandler(this.gD).setMouseMoveEventHandler(this.pD).setMouseDragEventHandler(this.mD).setMouseDragStartEventHandler(this.yD).setMouseDragStopEventHandler(this.SD).setMouseWheelEventHandler(this.vD).setTouchStartEventHandler(this.bD).setTouchMoveEventHandler(this.MD).setTouchEndEventHandler(this._D))),this.UD=new Xa((()=>this.ED.Te(this.wD).setMouseInteractions(!1))),this.YD=new Xa((()=>this.ED.Dr(this.wD).setMouseInteractions(!1))),this.HD=new Xa((()=>this.ED.sy(this.wD,{},[za.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.$D=new Xa((()=>this.ED.ze(this.wD).setMouseInteractions(!1))),this.XD=new Xa((()=>this.ED.bS(this.wD).setMouseInteractions(!1))),this.jD=new Xa((()=>this.ED.Te(this.wD).setMouseInteractions(!1))),this.ZD=new Xa((()=>this.ED.uw(this.wD).setMouseInteractions(!1))),this.QD=new Xa((()=>this.ED.Kc(this.wD).setMouseInteractions(!1))),this.mp(r,this.uiScale),this.onResize((()=>{this.NP=!0,this.cs.vs(),this.wD.tt(this.pixelScale.ai()),this.CD.tt(this.pixelScale.ai())})),this.JD=this.hs.yg([this.ND])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Qd(){return[]}dispose(){return super.dispose(),this.LD.U(),this.RD.U(),this.ED.U(),this.zD.U(),this.VD.U(),Kh(this.wD),Kh(this.CD),this.xD.dispose(),this.YD.my(),this.WD.my(),this.UD.my(),this.HD.my(),this.$D.my(),this.XD.my(),this.jD.my(),this.ZD.my(),this.QD.my(),this}Z(){return super.Z(),this.wD.Z(),this.CD.Z(),this}J(){return super.J(),this.wD.J(),this.CD.J(),this}setBackgroundEffect(t){return this.JD.Ss(t),this.cs.vs(),this}getBackgroundEffect(){return this.JD.xs()}setInteractionScrollOnWheel(t){return this.hD=t,this}getInteractionScrollOnWheel(){return this.hD}setInteractionPanOnTouch(t){return this.rD=t,this}getInteractionPanOnTouch(){return this.rD}onCellMouseEnter(t){return this.L.on(gf.cellMouseEnter,t)}offCellMouseEnter(t){return this.L.off(t)}onCellMouseLeave(t){return this.L.on(gf.cellMouseLeave,t)}offCellMouseLeave(t){return this.L.off(t)}onCellMouseClick(t){return this.L.on(gf.cellMouseClick,t)}offCellMouseClick(t){return this.L.off(t)}onCellMouseDoubleClick(t){return this.L.on(gf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.L.off(t)}onCellMouseDown(t){return this.L.on(gf.cellMouseDown,t)}offCellMouseDown(t){return this.L.off(t)}onCellMouseUp(t){return this.L.on(gf.cellMouseUp,t)}offCellMouseUp(t){return this.L.off(t)}onCellMouseMove(t){return this.L.on(gf.cellMouseMove,t)}offCellMouseMove(t){return this.L.off(t)}onCellMouseDrag(t){return this.L.on(gf.cellMouseDrag,t)}offCellMouseDrag(t){return this.L.off(t)}onCellMouseDragStart(t){return this.L.on(gf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.L.off(t)}onCellMouseDragStop(t){return this.L.on(gf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.L.off(t)}onCellMouseWheel(t){return this.L.on(gf.cellMouseWheel,t)}offCellMouseWheel(t){return this.L.off(t)}onCellTouchStart(t){return this.L.on(gf.cellTouchStart,t)}offCellTouchStart(t){return this.L.off(t)}onCellTouchMove(t){return this.L.on(gf.cellTouchMove,t)}offCellTouchMove(t){return this.L.off(t)}onCellTouchEnd(t){return this.L.on(gf.cellTouchEnd,t)}offCellTouchEnd(t){return this.L.off(t)}setGridBackgroundFillStyle(t){return this.ND.ke(t),this.cs.vs(),this}getGridBackgroundFillStyle(){return this.ND.zh()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const n=i,o=s,h=r;let a=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.zP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.zP.splice(this.zP.indexOf(i),1):(i.min=e,i.max=e),this.HP=!0,this.cs.vs(),this}setRowHeight(t,e){let i=this.VP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.VP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.VP.splice(this.VP.indexOf(i),1):(i.min=e,i.max=e),this.HP=!0,this.cs.vs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.qD(t,(t=>this.tB(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.iB(t,(t=>this.tB(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=S(i,i,i,i)),this.aD(t,e,(t=>this.tB(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=S(t,t,t,t)),this.BD={...this.BD,...t},this.sB((t=>this.tB(t,this.BD))),this}setCellBorders(t,e,i){return this.aD(t,e,(t=>this.nD(t,i))),this}setRowBorders(t,e){return this.iB(t,(t=>this.nD(t,e))),this}setColumnBorders(t,e){return this.qD(t,(t=>this.nD(t,e))),this}setCellsBorders(t){return this.lD=void 0===t?xf:t,this.sB((t=>this.nD(t,this.lD))),this}setCellsBorderStrokeStyle(t){return this.PD="function"==typeof t?t(this.PD):t,this.qP=!0,this.cs.vs(),this}setColumnTextFillStyle(t,e){return this.qD(t,(t=>this.eB(t,e))),this}setRowTextFillStyle(t,e){return this.iB(t,(t=>this.eB(t,e))),this}setCellTextFillStyle(t,e,i){return this.aD(t,e,(t=>this.eB(t,i))),this}setCellsTextFillStyle(t){return this.FD="function"==typeof t?t(this.FD):t,this.sB((t=>this.eB(t,this.FD))),this}setColumnTextFont(t,e){return this.qD(t,(t=>this.hB(t,e))),this}setRowTextFont(t,e){return this.iB(t,(t=>this.hB(t,e))),this}setCellTextFont(t,e,i){return this.aD(t,e,(t=>this.hB(t,i))),this}setCellsTextFont(t){return this.TD="function"==typeof t?t(this.TD):t,this.sB((t=>this.hB(t,this.TD))),this}setColumnContentAlignment(t,e){return this.qD(t,(t=>this.rB(t,e))),this}setRowContentAlignment(t,e){return this.iB(t,(t=>this.rB(t,e))),this}setCellContentAlignment(t,e,i){return this.aD(t,e,(t=>this.rB(t,i))),this}setCellsContentAlignment(t){return this.DD=t,this.sB((t=>this.rB(t,this.DD))),this}setCellBackgroundFillStyle(t,e,i){return this.aD(t,e,(t=>this.nB(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.qD(t,(t=>this.nB(t,e))),this}setRowBackgroundFillStyle(t,e){return this.iB(t,(t=>this.nB(t,e))),this}setCellsBackgroundFillStyle(t){return this.ID="function"==typeof t?t(this.ID):t,this.sB((t=>this.nB(t,this.ID))),this}setCellHighlight(t,e,i){return this.aD(t,e,(t=>{t.highlight=Ae(i)})),this.KP=!0,this.cs.vs(),this}setColumnHighlight(t,e){const i=Ae(e);return this.qD(t,(t=>{t.highlight=i})),this.KP=!0,this.cs.vs(),this}setRowHighlight(t,e){const i=Ae(e);return this.iB(t,(t=>{t.highlight=i})),this.KP=!0,this.cs.vs(),this}removeCell(t,e){return this.aD(t,e,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.YP=!0,this.cs.vs(),this}removeRow(t){return this.iB(t,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.EP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.YP=!0,this.cs.vs(),this}removeColumn(t){return this.qD(t,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.EP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.YP=!0,this.cs.vs(),this}removeCells(){return this.EP.splice(0),this.YP=!0,this.cs.vs(),this}getColumnMax(){return 0===this.EP.length?0:this.EP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.EP.length?0:this.EP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=Math.round(this.PD.O()),i=e/2;let s=this.GP||this.WP||this.UP||this.YP||this.HP||this.$P||this.QP||this.JP||this.qP||this.iD;if(s){this.EP.forEach((t=>{this.eD.add(t.column)})),this.EP.forEach((t=>{this.sD.add(t.row)}));const t=this.YD.gy(),r=this.oB(i,t);t.finishPlot();const n=this.aB(this.eD.size,r),o=this.lB(this.sD.size,r),h=n.reduce(Ge,0)+e,a=o.reduce(Ge,0)+e,l=new Array(n.length+1).fill(0).map(((t,e)=>n.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===n[e])),e=this.uB.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.uB={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.WP||this.UP||this.YP||this.XP||this.jP||this.ZP||this.JP||this.KP||this.qP||this.NP||this.iD;if((r||this.tD)&&this.uB){const t=this.pixelScale.getInnerIntervalPixels(),s=ta.Cp(this.bp,this.Sp),n=[this.ya.left+i,this.ya.right+i],o=[this.ya.bottom+i,this.ya.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.ya.left,this.ya.right],l=[this.ya.bottom,this.ya.top+s],u={x:Math.round(t.x-a[0]-a[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.CD.zi(n).Vi(o).Oi(0,h.x).Ni(0,h.y),this.xD.oP({x:this.uB.dataGridHeight,y:this.uB.dataGridWidth}).Ds().Fe();const d={x:Math.round(this.kD.x),y:Math.round(Math.min(0,this.kD.y))};this.wD.zi(a).Vi(l).Oi(d.x,u.x+d.x).Ni(d.y,u.y+d.y),this.ND.Ie({x:c.x,y:c.y});const f={x:this.wD.x.hi(),y:this.wD.y.hi()+this.xD.rP(),width:this.wD.x.ni()+e-this.xD.rP(),height:this.wD.y.ni()+e};this.ED.tx(f),this.RD.tx(f),this.LD.tx(f);const g=this.uB,m=[{x:this.wD.x.getInnerStart(),y:this.wD.y.getInnerStart()},{x:this.wD.x.getInnerEnd(),y:this.wD.y.getInnerStart()},{x:this.wD.x.getInnerEnd(),y:this.wD.y.getInnerEnd()},{x:this.wD.x.getInnerStart(),y:this.wD.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]},r=Ne([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.cB(c,this.uB,e)}this.NP=!1,this.GP=!1,this.WP=!1,this.UP=!1,this.YP=!1,this.HP=!1,this.$P=!1,this.XP=!1,this.jP=!1,this.ZP=!1,this.QP=!1,this.JP=!1,this.KP=!1,this.qP=!1,this.tD=!1,this.iD=!1}oB(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.EP){const{content:r}=t,n={...this.BD,...t.padding};let o,h,a,l={x:0,y:0};if("string"==typeof r||"number"==typeof r){const i=String(r);o=e.add(),l=o.Eh(i).Nh(t.textFont||this.TD).Ds().Zc()}if(Xd(r)&&(h=r,l={x:200,y:50}),io(r)){const t=this.cs.dB(r);t.fB()?(a=r,l=a.ai()):t.AB((()=>{this.iD=!0,this.cs.vs()}))}if(o||h||a){n.top=Math.round(n.top),n.left=Math.round(n.left),n.right=Math.round(n.right),n.bottom=Math.round(n.bottom);const e={x:Math.round(l.x+n.left+n.right+s.left+s.right),y:Math.round(l.y+n.top+n.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:h,icon:a,cellPadding:n,cellMargin:s})}}return i}cB(t,i,s){const{dataGridWidth:r,dataGridHeight:n,cellsContentSizes:o,columnWidths:h,columnWidthsCumulative:a,rowHeights:l,rowHeightsCumulative:u}=i,c={x:r-s,y:-n+s};this.ND.tt(c),this.GD.Ee(this.PD),this.OP.clear();const d={cellBackground:this.WD.gy(),cellIconRect:this.UD.gy(),lineSet:this.HD.gy(),line:this.$D.gy(),pointSet:this.XD.gy(),rect:this.jD.gy(),junction:this.ZD.gy(),arc:this.QD.gy()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,y={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},x={x:p.x+m.left,y:p.y+m.bottom},S={x:x.x+g.left,y:x.y+g.bottom},A={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:A.x-m.left-m.right,y:A.y-m.top-m.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=pf(S,b,r.contentAlignment||this.DD);n.Ie(t[0]).za({x:t[1],y:t[2]}).ke(this.gB(r.textFillStyle||this.FD,r.content,this.FD)).ds(r.highlight)}const M=this.gB(r.backgroundFillStyle||this.ID,r.content);if(M!==z){const t=d.cellBackground.add();t.Ie(p).tt(A).ke(M).Ce(ot).ds(r.highlight),this.OP.set(t,y)}const E=r.borders||this.lD;if(E&&yf(p,A,E,s,f),o){const t=S,e=b;Wd(o,d,this.wD,t,e,this.ts,this.dA,r.highlight)}if(c){const t=c.ai(),i=pf(S,b,r.contentAlignment||this.DD);d.cellIconRect.add().Ie({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).tt(t).ke(new $n({source:c.nc,fitMode:e.ImageFitMode.Stretch})).Ce(ot).ds(r.highlight)}}this.GD.Gt();for(const t of f)this.GD.Vr().zg(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()}aB(t,e){const i=new Array(t).fill(0);for(const t of this.eD.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),r=this.zP.find((e=>e.column===t)),n=r?Rt(s,void 0!==r.min?r.min:Pe,void 0!==r.max?r.max:Le):s;i[t]=n}return i}lB(t,e){const i=new Array(t).fill(0);for(const t of this.sD.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),r=this.VP.find((e=>e.row===t)),n=r?Rt(s,void 0!==r.min?r.min:Pe,void 0!==r.max?r.max:Le):s;i[t]=n}return i}gB(t,e,i){if(j(t)){try{const i=Number(e);return new G({color:t.getPalette().getColors(i)})}catch(t){}return i||z}return t}eB(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.FD):e,this.ZP=!0,this.cs.vs()}hB(t,e){t.textFont="function"==typeof e?e(t.textFont||this.TD):e,this.QP=!0,this.cs.vs()}nB(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.ID):e,this.jP=!0,this.cs.vs()}rB(t,e){t.contentAlignment=e,this.XP=!0,this.cs.vs()}tB(t,e){t.padding={...t.padding,...e},this.$P=!0,this.cs.vs()}KD(t,e,i){let s=this.aD(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.EP.push(s),this.UP=!0),"string"==typeof s.content||"number"==typeof s.content?this.GP=!0:this.WP=!0,this.cs.vs()}sB(t){this.EP.forEach((e=>t(e)))}aD(t,e,i){const s=this.EP.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}qD(t,e){const i=this.EP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}iB(t,e){const i=this.EP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}OD(){return new df(this.VD,this.zD,this.CD,this.CD,this.wD,this.ts,hf.Both).onScroll(((t,e)=>{this.uB&&(t===hf.Vertical&&(this.kD.y=-e),t===hf.Horizontal&&(this.kD.x=e),this.tD=!0,this.cs.vs())})).IP(50).PP(12)}}const gf={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 mf;e.DataGridCellContentAlignmentOptions=void 0,(mf=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",mf.RightCenter="right-center",mf.LeftCenter="left-center",mf.RightTop="right-top",mf.LeftTop="left-top",mf.RightBottom="right-bottom",mf.LeftBottom="left-bottom",mf.CenterTop="center-top",mf.CenterBottom="center-bottom";const yf=(t,e,i,s,r)=>{const n={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},h={x:t.x+e.x,y:t.y},a={x:t.x+e.x,y:t.y+e.y};i.top&&r.push([o,a]),i.bottom&&r.push([n,h]),i.left&&r.push([n,o]),i.right&&r.push([h,a])},pf=(t,e,i)=>{const s=t.x,r=t.x+e.x,n=t.x+e.x/2,o=t.y+e.y,h=t.y,a=t.y+e.y/2;switch(i){case"left-center":return[u(s,a),-1,0];case"right-center":return[u(r,a),1,0];case"center":return[u(n,a),0,0];case"left-bottom":return[u(s,h),-1,-1];case"right-bottom":return[u(r,h),1,-1];case"center-bottom":return[u(n,h),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(r,o),1,1];case"center-top":return[u(n,o),0,1]}return be(0,`Unidentified DataGrid cell content alignment option: ${i}`)},xf={top:!1,bottom:!1,left:!1,right:!1};class Sf extends Js{constructor(t,e,i,s,r,n){super(t,{vr(){},Sr(){},Mr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.hs=n,this.Ts=r,this.Rh=r.Dr(t.pB).Nh(this.ts.barChartCategoryAxisTitleFont||this.ts.xAxisTitleFont).ke(this.ts.barChartCategoryAxisTitleFillStyle||this.ts.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getWidth({x:0,y:-90})),this.Uh=this.hs.yg([this.Rh]).Ss(e.effectsText),this.mB=r.ze(t.pB).Ee(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.mB.Ee(t),this.chart.cs.vs(),this}getStrokeStyle(){return this.mB.cu()}Ds(){if(!this.ji)return{Tg:0,Fg:0,Od:Rt(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)};const t=this.mB.cu().O()/2,e=this.chart.Fs.getHeight(this.Rh.Ds().Zc());return{Tg:t,Fg:e,Od:t+e}}Fe(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.mB.Oe(this.chart.Fs.toPoint(r.start,n.start)).Ve(this.chart.Fs.toPoint(r.end,n.start)).setVisible(this.ji),this.Rh.Ie(this.chart.Fs.toPoint(.5*(r.start+r.end),this.chart.valueAxis.ft.mi(n.start,-(t.Tg+s.labelMarginBeforeCategoryAxisPixels)))).za(this.chart.Fs.toPoint(0,1)).setVisible(this.ji)}setMouseInteractions(t){return this}cr(t,e){return new qs(e,t,this.Ts,this.chart.pB)}dr(t,e){return{}}wr(t,e){return e}kr(t,e,i){return{min:t,max:e}}}class Af extends Js{constructor(t,e,i,s,r,n,o){super(t,{vr:()=>{var e;if(t.yB){if("positive"===t.SB||"bipolar"===t.SB){if("after-bar"===(null===(e=t.vB)||void 0===e?void 0:e.position)){const e=this.ft.ni();return this.ft.mi(t.yB.max,Math.min(this.chart.Fs.getHeight(this.chart.xB())+t.vB.labelMargin,.3*e))}return t.yB.max}return t.bB?Rt(-1,-1e-6,t.yB.max):0}},Sr:()=>{var e;if(t.yB){if("negative"===t.SB||"bipolar"===t.SB){if("after-bar"===(null===(e=t.vB)||void 0===e?void 0:e.position)){const e=this.ft.ni();return this.ft.mi(t.yB.min,-Math.min(this.chart.Fs.getHeight(this.chart.xB())+t.vB.labelMargin,.3*e))}return t.yB.min}return t.bB?Rt(1,1e-6,t.yB.min):0}},Mr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.hs=n,this.Ts=r,this.Rh=r.Dr(t.pB).Nh(this.ts.barChartValueAxisTitleFont||this.ts.yAxisTitleFont).ke(this.ts.barChartValueAxisTitleFillStyle||this.ts.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getHeight({x:0,y:-90})),this.Uh=this.hs.yg([this.Rh]).Ss(e.effectsText),this.mB=r.ze(t.pB).Ee(e.barChartValueAxisStrokeStyle||this.ts.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.mB.Ee(t),this.chart.cs.vs(),this}getStrokeStyle(){return this.mB.cu()}setTickStrategy(t,e){return super.Ih(t,e)}Ds(t){if(!this.ji)return this.Yh(),{Tg:0,Fg:0,Od:Rt(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)};const e=this.chart.Fs.getWidth(this.chart.pB).ni(),i=this.ft.ni();this.tr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Qe.values())for(const e of t.values()){const t=e.xh.ur,i=this.chart.Fs.getWidth(e.Ye.Zc()),r=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,r)}const r=s+this.mB.cu().O()/2,n=this.chart.Fs.getWidth(this.Rh.Ds().Zc());return{Tg:r,Fg:n,Od:Rt(r+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)}}Fe(t){const e=this.getInterval();this.mB.Oe(this.chart.Fs.toPoint(-.5,this.Ph)).Ve(this.chart.Fs.toPoint(-.5,this.Dh)).setVisible(this.ji);const i="logarithmic"===this.Th.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Fs.toPoint(this.chart.categoryAxis.ft.mi(-.5,t.Tg*this.chart.Fs.MB),i),r=this.chart.Fs.toPoint(this.chart.Fs._B,0);this.Rh.Ie(s).za(r).setVisible(this.ji)}setMouseInteractions(t){return this}cr(t,e){return new qs(e,t,this.Ts,this.chart.pB)}dr(t,e){const i=t.xh.ur,s=this.chart.Fs.toPoint(-.5,t.S),r=this.chart.pB.mi(s,this.chart.Fs.toPoint(i.getTickLength()*this.chart.Fs.MB,0)),n=this.chart.pB.mi(s,this.chart.Fs.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Fs.MB,0)),o=this.chart.pB.mi(r,this.chart.Fs.toPoint(i.getTickPadding()*this.chart.Fs.MB,0));t.Ye.Ie(o).za(this.chart.Fs.toPoint(this.chart.Fs._B,i.getLabelAlignment())).Gh(i.getLabelRotation()),i.tickStyle!==ot&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==ot&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}wr(t,e){return"linear"===this.Th.type?oh(t,e,this.ft):hh(t,e,this.ft)}kr(t,e,i){return{min:t,max:e}}}class vf extends Gl{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Go=Ie(),this.S=0,this.wB=!1,this.chart=t,this.Ki=t,this.category=r,this.subCategory=n,this.Ms=r,this.be=fe(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Me=fe(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.Ki.CB()})),this.onDispose((()=>{this.Ki.CB(),this.Ki.kB.delete(this)}))}setValue(t){return this.wB=!0,this.S=t,this.Ki.CB(),this.Ki.cs.vs(),this.Ki.kB.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.Ki.CB(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ki.CB(),this}getStrokeStyle(){return this.Me}qy(){return this.iS}$c(t,e){return wa(t,this.Ki.engine.scale,this.Ki.Om(new la,this.category,this.S,this).Qu(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ki.setBarsEffect(t),this}}const bf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Mf=(t,e,i)=>{const s=t.Td.filter((t=>void 0!==t)),r=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),n=Math.ceil(r/(e/s.length));return n<=1?s:s.filter(((t,e)=>e%n==0))};class Ef extends al{constructor(t,i,s,r,n,o,h){var a;let l;super(t,i,s,i.yp("barChart bg",0),r,i.cs.ts.barChartBackgroundFillStyle||i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.barChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.barChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.barChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.TB=wf.Descending,this.FB=this.ts.barChartCategoryLabels,this.vB=this.ts.barChartValueLabelsAfterBars,this.IB=!1,this.b_=Ce(),this.PB=new Map,this.kB=new Map,this.SB="positive",this.DB="columns",this.BB=!0,this.LB=new Map,this.RB={speed:1},this.xm={speed:1},this.EB=.08,this.Vm=e.AutoCursorModes.snapToClosest,this.Om=(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 r=[];return s.subCategory&&s.subCategory.length>0&&r.push(s.subCategory),r.push(this.valueAxis.formatValue(i)),t.addRow(...r),t},this.An=(t,e,i,s,r)=>{this.pB.tt(s,r)},this.cs.Gn(ah.af),this.Fs="horizontal"===(null==h?void 0:h.type)?kf:Tf,this.bp.Eh("Bar Chart"),this.zB=i.Um("barChart plotting 1",0),this.VB=i.Um("barChart plotting 2",1),this.bB="logarithmic"===(null===(a=null==h?void 0:h.valueAxis)||void 0===a?void 0:a.type),this.bB?"horizontal"===this.Fs.OB?(l=s.d1({scale1DConstructor:Di,dimension:"y"}),this.pB=(new Vi).Ei(s.d1({scale1DConstructor:Mi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Di,dimension:"x"}),this.pB=(new Vi).Ei(l,s.d1({scale1DConstructor:Mi,dimension:"y"}))):(this.pB=s.d2({scaleXYConstructor:_i}),l=this.Fs.getWidth(this.pB)),this.NB=this.hs.yg(),this.__=new Ha((()=>this.b_.wt(this.zB.$x(this.pB).Ko(0))),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.bar),e.bar.ps([i]),i})))),(()=>{this.b_.Gt()}),(t=>{this.NB.As(t)})),this.IS=this.tp.Te(this.pB).ke(this.ts.barChartSeriesBackgroundFillStyle||z).Ce(ot),this.PS=this.tp.Te(this.pB).ke(z).Ce(this.ts.barChartSeriesBackgroundStrokeStyle||ot).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.categoryAxis=new Sf(this,this.ts,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),l,this.VB,this.hs);const u=nh(null==h?void 0:h.valueAxis);this.valueAxis=new Af(this,this.ts,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),this.Fs.getHeight(this.pB),this.VB,this.hs,u.type),this.GB=new Xa((()=>this.VB.Dr(this.pB).Pr(Re).Ir(Re).Ko(1))),this.WB=new Ha((()=>this.tp.Rg(this.pB).setMouseInteractions(!1)),((t,e,i)=>(t.Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Vr()).zg(e[0],e[1])))))),this.Hm=i.$m();const c=Ft(h?h.autoCursorBuilder:void 0,va);this.Fp=c.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.onResize(this.An),this.mp(n,this.pB),this.setAutoCursorMode(e.AutoCursorModes.onHover),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.RS(((t,e)=>{ia.Pp(this,e)}))}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}setBarsMargin(t){return this.EB=Rt(t,0,.49),this.IB=!0,this.cs.vs(),this}getBarsMargin(){return this.EB}setBarsEffect(t){return this.NB.Ss(t),this.cs.vs(),this}getBarsEffect(){return this.NB.xs()}setData(t){let e;if(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.UB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.UB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.UB("groups",i),this}UB(t,e){this.MS.length>0&&this.cs.Gn(ah.xf),this.DB=t,this.YB(e);const i=xe(e.map((t=>t.category))),s=i.length,r=xe(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.MS.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),n=r.includes(t.subCategory)?r.indexOf(t.subCategory):void 0;e=new vf(this,this.wS,this.ts,this.cs.hs,t.category,t.subCategory,Ft(n,s)),this.DS(e),this.LB.set(e,{category:s,valueStart:this.bB?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.MS.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.LB.delete(t))})),this.categoryAxis.setInterval(this.Fs.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.yB=0===this.MS.length?void 0:"stacks"!==t?this.MS.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Le,max:Pe}):{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.yB&&(this.SB=this.yB.min>=0?"positive":this.yB.max<=0?"negative":"bipolar",("bipolar"===this.SB||"negative"===this.SB)&&this.bB))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.YB(this.MS),this.PB.clear(),this.kB.clear(),this.IB=!0,this.cs.vs()}setCategoryLabels(t){const e="function"==typeof t?this.FB?t(this.FB):this.FB:t;return this.FB=e?{...this.ts.barChartCategoryLabels,...e}:void 0,this.PB.clear(),this.cs.vs(),this}getCategoryLabels(){return this.FB}setValueLabels(t){var e;const i="function"==typeof t?this.vB?t(this.vB):this.vB:t,s=(null==i?void 0:i.position)||(null===(e=this.vB)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.vB={...this.ts.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.vB={...this.ts.barChartValueLabelsInsideBars,...i}):this.vB=void 0,this.kB.clear(),this.cs.vs(),this}getValueLabels(){return this.vB}setLabelFittingEnabled(t){return this.BB=t,this.cs.vs(),this}getLabelFittingEnabled(){return this.BB}getBar(t,e){if(("groups"===this.DB||"stacks"===this.DB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.MS.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.MS}setSorting(t){return this.TB=t,this.YB(this.MS),this.cs.vs(),this}getSorting(){return this.TB}setAnimationCategoryPosition(t,e=1){return this.RB=t?{speed:e}:void 0,this.cs.vs(),this}setAnimationValues(t,e=1){return this.xm=t?{speed:e}:void 0,this.cs.vs(),this}translateCoordinate(t,e,i){if(i&&Ui(t)&&Oi(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Ni(t))r=this.cs.Do(t);else if(Ui(t)){const e=dt(t,this.pixelScale,this.cs.ft);r={engineX:e.x,engineY:e.y}}else{if(!bf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=dt(this.Fs.toPoint(t.iCategory,t.value),this.pB,this.cs.ft);r={engineX:e.x,engineY:e.y}}}if(zi(s))return this.cs.Bo(r);if("barChart"===s){const t=dt({x:r.engineX,y:r.engineY},this.cs.ft,this.pB);return{iCategory:this.Fs.getWidth(t),value:this.Fs.getHeight(t)}}if(Oi(s))return dt({x:r.engineX,y:r.engineY},this.cs.ft,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Qd(){if("columns"===this.DB)return this.MS;const t=xe(Se(this.MS.map((t=>t.subCategory))));return Se(t.map((t=>{const e=this.MS.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,r)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(r):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,r){return ve(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Fe(t){var e,i;super.Fe(t);const s=this.GB.gy(),r=this.WB.gy(),n=this.MS.filter((t=>t.getVisible()&&t.wB)),o=xe(n.map((t=>t.category))),h=xe(Se(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.RB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.RB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.ft,c=u instanceof Di?(t,e)=>{var i;return oh(t,e,u,(null===(i=this.xm)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return hh(t,e,u,(null===(i=this.xm)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.DB?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.bB?1e-6:0,valueEnd:t.value}}))):"groups"===this.DB?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.EB),r=this.EB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.bB?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.bB?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,r,n=this.LB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.RB&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+a*t+l*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.xm&&n.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-n.valueEnd);r=c(n.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-r)&&(r=i.valueEnd)}else r=i.valueEnd;this.LB.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.cs.vs(!0),s===n.category&&r===n.valueEnd||(this.IB=!0)})),ta.kp(this.bp,this.Sp);const f=n.length>0;this.categoryAxis._r(),this.valueAxis._r();const g=this.categoryAxis.setVisible(f).Ds(),m=this.valueAxis.setVisible(f).Ds(r),{labelMarginBeforeCategoryAxisPixels:y}=f?this.HB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Fe(g,s,r,{labelMarginBeforeCategoryAxisPixels:y}),this.valueAxis.Fe(m);const p=this.categoryAxis.getThickness(),x=Rt(g.Od+y,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Le),S={x:Math.min(this.pB.x.getInnerStart(),this.pB.x.getInnerEnd()),y:Math.min(this.pB.y.getInnerStart(),this.pB.y.getInnerEnd())},A=Math.max(this.pB.x.getInnerStart(),this.pB.x.getInnerEnd()),v=Math.max(this.pB.y.getInnerStart(),this.pB.y.getInnerEnd()),b={x:A-S.x,y:v-S.y};this.IS.Ie(S),this.IS.tt(b),this.PS.Ie(S),this.PS.tt(b),super.pp(),ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,void 0,((t,e)=>t.$c(e,!0)));const M=ta.Cp(this.bp,this.Sp);if(this.pB.Vi([this.jt.bottom+this.ya.bottom+("vertical"===this.Fs.OB?x:0),this.jt.top+this.ya.top+M+("horizontal"===this.Fs.OB?m.Od:0)]),this.pB.zi([this.jt.left+this.ya.left+this.Fs.getHeight({x,y:m.Od}),this.jt.right+this.ya.right]),this.zB.tx({x:this.pB.x.hi(),y:this.pB.y.hi(),width:this.pB.x.ni(),height:this.pB.y.ni()}),this.Qg&&this.Qg(),this.IB){const t=this.__.gy(),e="groups"===this.DB?1/(h.length+2*(h.length+1)*this.EB):1-2*this.EB;n.forEach((i=>{const s=this.LB.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Fs.toPoint(r,s.valueStart),this.Fs.toPoint(r,s.valueEnd),this.Fs.toPoint(n,s.valueEnd),this.Fs.toPoint(n,s.valueStart)];t.add({Go:i.Go,vertices:o,bar:i},{fillStyle:i.be,strokeStyle:i.Me})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.IB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(t),this.setAnimationValues(t),this.valueAxis.setAnimationsEnabled(t),this.categoryAxis.setAnimationsEnabled(t),this}solveNearest(t){}dispose(){return this.VB.U(),this.zB.U(),this.Fp.dispose(),this.Hm.U(),super.dispose()}YB(t){const e=this.TB;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)})))}HB(t,e,i,s){let r=0;const n=this.FB,o=this.vB,h=this.valueAxis.getInterval(),a=this.Fs.getWidth({x:this.pB.x.ni(),y:this.pB.y.ni()});if(n&&n.labelFillStyle!==z){const o=n.tickLength+n.labelMargin,l=this.Fs.toPoint(0,1),u={Td:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),r=n.formatter(t,s);if(!r)return;const a=i;return void 0!==a?{text:r,position:this.Fs.toPoint(a,this.valueAxis.ft.mi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.$B(t,s)}:void 0})),Gu:n.labelFont,ft:this.pB},c=u?this.BB?Mf(u,a,this.Fs.getWidth):u.Td:[];c.forEach((t=>{t&&i.add().Eh(t.text).Ie(t.position).za(t.alignment).Gh(t.rotation).ke(n.labelFillStyle).Nh(n.labelFont)})),n.tickStyle!==ot&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Fs.getWidth(t.position);s.add({positions:[this.Fs.toPoint(e,this.valueAxis.ft.getInnerStart()),this.Fs.toPoint(e,this.valueAxis.ft.mi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Fs.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==z){let t;"after-bar"===o.position?t={Td:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.LB.get(t);return void 0!==s?{text:i,position:this.Fs.toPoint(s.category,this.valueAxis.ft.mi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Fs.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.XB(t)}:void 0})),Gu:o.labelFont,ft:this.pB}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Td:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.LB.get(t);if(void 0===s)return;const r="bipolar"===this.SB?Math.sign(s.valueEnd):"negative"===this.SB?-1:1,n=this.Fs.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*r:"inside-bar-centered"===o.position?0:-1*r);return{text:i,position:this.Fs.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.ft.mi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.ft.mi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.XB(t)}})),Gu:o.labelFont,ft:this.pB}),t&&(t?this.BB?Mf(t,a,this.Fs.getWidth):t.Td:[]).forEach((t=>{t&&i.add().Eh(t.text).Ie(t.position).za(t.alignment).Gh(t.rotation).ke(o.labelFillStyle).Nh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}$B(t,e){if(!this.FB||this.FB.labelFillStyle===z)return{x:0,y:0};const i=this.PB.get(t);if(i)return i;const s=this.FB.formatter(t,e),r=this.cs.Pg.Ig(s,this.FB.labelFont,this.FB.labelRotation);return r.isEstimate?this.cs.vs(!0):this.PB.set(t,r),r}XB(t){if(!this.vB||this.vB.labelFillStyle===z)return{x:0,y:0};const e=this.kB.get(t);if(e)return e;const i=this.cs.Pg.Ig(this.vB.formatter(t,t.category,t.value),this.vB.labelFont,this.vB.labelRotation);return i.isEstimate?this.cs.vs(!0):this.kB.set(t,i),i}xB(){return this.MS.reduce(((t,e)=>{const i=this.XB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}CB(){this.IB=!0,this.cs.vs()}getMinimumSize(){return{x:200,y:200}}}const wf={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)},Tf={...ch,OB:"vertical",MB:-1,_B:1},kf={...dh,OB:"horizontal",MB:1,_B:-1},Cf=(t,e)=>e?t.x:t.y,Rf=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),If=(t,e,i,s,r,n)=>{const o=e.length,h=Math.sign(s),a=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)a.push(Cf(r,n)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=a.map((t=>0));let c=a[i-1]+s;for(let e=i;e>0&&eRf(t,h,n,e))).reduce(((t,e)=>Math.max(t,Cf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>Cf(r,n)-s||-1===h&&c<0+s){u.fill(0);break}if(e!==i&&(1===h?o>c:oa[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/Cf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Ff{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.Xi=!1,this.EP=new Array,this.L=new r.Eventer,this.jB=[],this.Xg=[],this.ZB=void 0,this.QB=!0,this.JB=!0,this.KB=!0,this.Jg=!1,this.qB=!0,this.tL=()=>{this.qB=!0,this.cs.vs()},this.iL=[],this.onInViewChange=t=>this.L.on("inViewChange",t),this.offInViewChange=t=>this.L.off(t,"inViewChange"),this.sL=t=>{for(let e=0;e{const e=this.jB.indexOf(t);e>=0&&this.jB.splice(e,1)},this.sp=t=>{const e=this.Xg.indexOf(t);e>=0&&this.Xg.splice(e,1)},this.hL=(t,e,i,s,r)=>{if(this.rL(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.EP.push(n),this.nL(n),this.QB=!0,t}throw new mt("Out of dashboard range.")},this.oL=e.numberOfRows,this.aL=e.numberOfColumns,this.dA=t,this.lL=e,this.uL=s;const o=this.aL*this.oL;this.cL={x:new Yd(new Array(this.aL).fill(1)),y:new Yd(new Array(this.oL).fill(1))},this.ts=i.ts,this.dL=this.ts.dashboardSplitterStyle,this.ih=!0!==(null==e?void 0:e.disableAnimations)&&!1!==(null==e?void 0:e.animationsEnabled),this.fL=Gd(i,o),this.AL=i.II("dashboard splitters",500001),this.NM=()=>this.fL.FI(),this.ap=this.fL.DI(),this.hs=i.hs.rs(this,{gL:{}}),this.hs.gL.Ss(this.ts.effectsDashboardSplitters);const h=i.ai();this.uiScale=ut.d2({scaleXYConstructor:_i}).Oi(0,100).Ni(0,100).tt(h),this.pixelScale=ut.d2({scaleXYConstructor:_i}).Oi(0,this.uiScale.x.getCellSize()).Ni(0,this.uiScale.y.getCellSize()).tt(h),this.pL=i.mL.bind(i),this.yL=i.SL.bind(i),this.vL=i.xL.bind(i),this.bL=i.ML.bind(i),this.ho=i.ho.bind(i),this.no=i.no.bind(i),this.engine=i.hp,this.cs=i.rp,i.ko((()=>this.tL())),i.vs();const a=i.Io((t=>{this.Jg=t,this.L.emit("inViewChange",this,t)}));this.fp=i.Po.bind(i,a),this._L(),this.setAnimationsEnabled(this.ih);const l=(t=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.L);this.createChartXY=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Vc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Ud(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Zc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:Oa;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:yd;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:nd;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Df(t,this.lL,this.ih),i=t&&t.type?t.type:Ed;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Jh(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new vl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Uc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Rl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Df(t,this.lL,this.ih),i=new Sl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Df(t,this.lL,this.ih),i=new ff(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Df(t,this.lL,this.ih),i=new Ef(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}wL(t,e){return t+e*this.aL}CL(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.aL:this.oL,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ut({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.aL,y:this.oL},e),d3:()=>new at({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.aL,y:this.oL},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.pL(t[0]),this.yL(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.vL(t[0]),this.bL(t[1]),this}getWidth(){return this.ho()}getHeight(){return this.no()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.AL.vs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.AL.vs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.ts}setSplitterStyle(t){const e=this.dL;return this.dL="function"==typeof t?t(this.dL):t,this.kL(e),this}getSplitterStyle(){return this.dL}setSplitterEffect(t){return this.hs.gL.Ss(t),this.cs.vs(),this}getSplitterEffect(){return this.hs.gL.xs()}setAnimationHighlight(t){return this.KB=t,this.iL.forEach((e=>this.cs.us.ws(e.line,t))),this}getAnimationHighlight(){return this.KB}kL(t){for(const t of this.iL)t.line.Ee(this.dL);this._L()}setColumnWidth(t,e){const i=this.cL.x._();return t>=0&&t=e.length)throw new mt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.cL.y._();return t>=0&&t=e.length)throw new mt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.L.on("resize",t)}offResize(t){return this.L.off(t,"resize")}TL(t,e,i){if(i&&Math.abs(t.x)>0)this.FL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.IL(e,t.y)}for(const t of this.EP)t.panel.J();this.tL()}IL(t,e){const i=If(this.EP,this.cL.y._(),t,e,this.pixelScale.ai(),!1);this.cL.y.M(i),this.tL()}FL(t,e){const i=If(this.EP,this.cL.x._(),t,e,this.pixelScale.ai(),!0);this.cL.x.M(i),this.tL()}PL(){this.iL.forEach((t=>t.line.dispose())),this.iL.length=0;for(let t=1;t<=this.aL-1;t+=1)for(let e=0;e<=this.oL-1;e+=1)if(void 0!==this.EP.find((i=>He(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Wi(new $i((()=>{this.DL(t)}),((e,i,s,r,n)=>{this.TL(r,t,!0),Zt(n)}),(()=>{this.BL(t)}))),s=this.AL.ze(this.pixelScale).Ee(this.dL).setMouseEnterEventHandler((()=>{this.DL(t)})).setMouseLeaveEventHandler((()=>{this.BL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.TL(n,t,!0),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.KB}),this.iL.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.oL-1;t+=1)for(let e=0;e<=this.aL-1;e+=1)if(void 0!==this.EP.find((i=>He(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Wi(new $i((()=>{this.LL(t)}),((e,i,s,r,n)=>{this.TL(r,t,!1),Zt(n)}),(()=>{this.RL(t)}))),s=this.AL.ze(this.pixelScale).Ee(this.dL).setMouseEnterEventHandler((()=>{this.LL(t)})).setMouseLeaveEventHandler((()=>{this.RL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.TL(n,t,!1),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.KB}),this.iL.push({row:t,column:e,line:s,alignment:"horizontal"})}this.hs.gL.As(this.iL.map((t=>t.line)))}EL(){const t=this.pixelScale.ai(),e=this.cL.x._(),i=e.reduce(((t,e)=>t+e)),s=this.cL.y._(),r=s.reduce(((t,e)=>t+e));this.iL.forEach((n=>{if("vertical"===n.alignment){const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(o.x,t.y*s.slice(0,n.row+1).reduce(((t,e)=>t+e),0)/r);n.line.Oe(o).Ve(h)}else{const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(t.x*e.slice(0,n.column+1).reduce(((t,e)=>t+e),0)/i,o.y);n.line.Oe(o).Ve(h)}}))}DL(t){this.iL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.cs.us._s(e.line,1),this.AL.zL(e.line))})),this.ZB=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.cs.vs()}LL(t){this.iL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.cs.us._s(e.line,1),this.AL.zL(e.line))})),this.ZB=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.cs.vs()}BL(t){this.iL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.cs.us._s(e.line,0)})),this.engine.restoreMouseStyle(this.ZB),this.cs.vs()}RL(t){this.iL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.cs.us._s(e.line,0)})),this.engine.restoreMouseStyle(this.ZB),this.cs.vs()}setAnimationsEnabled(t){return this.ih=t,this.getCells().filter((t=>t.panel instanceof Qh)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ih),this}getAnimationsEnabled(){return this.ih}getCells(){return this.EP.slice()}dispose(){return this.Xi||(this.fp&&this.fp(),this.EP.slice().forEach((t=>t.panel.dispose())),this.jB.slice().forEach((t=>t.dispose())),this.Xg.slice().forEach((t=>t.dispose())),this.Xi=!0,this.uL(),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}getIsInView(){return this.Jg}saveToFile(t,e,i){return Xh(this.engine,t,e,i),this}VL(t){if(this.qB){const t=this.cs.ft.ai(),e=t.x,i=t.y;this.uiScale.tt(e,i),this.pixelScale.tt(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.Oi(0,s.x).Ni(0,s.y),this.L.emit("resize",this,s.x,s.y,e,i),this.JB=!0}this.QB&&(this.PL(),this.QB=!1,this.JB=!0),this.JB&&(this.EL(),this.JB=!1);for(const e of this.EP)e.panel.Fe(t);return this.jB.forEach((t=>t.Ds())),this.jB.forEach((t=>t.Fe())),this.Xg.forEach((t=>t.Ds())),this.Xg.forEach((t=>t.Fe())),this.qB=!1,this}Z(){for(const t of this.EP)t.panel.Z();return this.pixelScale.x.Z(),this.pixelScale.y.Z(),this.uiScale.x.Z(),this.uiScale.y.Z(),this}J(){for(const t of this.EP)t.panel.J();return this.pixelScale.x.J(),this.pixelScale.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}translateCoordinate(t,e,i){return $h(t,e,i,this.pixelScale,this.cs)}addUIElement(t=Vo,e=this.uiScale){e=jh(e,this.pixelScale);const i=Wh(t,this.NM(),this.uiScale,e,this.eL,this.ts);return this.jB.push(i),i}addLegendBox(t=$o,i=this.uiScale){i=jh(i,this.pixelScale);const s=Wh(t,this.ap,this.uiScale,i,this.sp,this.ts);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Xg.push(s),s}getLegendBoxes(){return this.Xg}rL(t,e,i,s){return e>=0&&t>=0&&e+s<=this.oL&&t+i<=this.aL}nL(t){const e=this.dL,i=e===ot?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Ir(s)}_L(){this.uiScale.x.ei([0,0]),this.uiScale.y.ei([0,0]),this.pixelScale.x.ei([0,0]),this.pixelScale.y.ei([0,0]);for(const t of this.EP)this.nL(t);this.cs.vs()}}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 r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Lf={None:In,Rectangle:mo,Circle:yo,Diamond:po,Pointer:xo},Pf={ChartMarkerXY:au,SeriesMarkerXY:lu},_f={XY:hu,Spider:Aa,BarChart:va,Map:Ea,Polar:Aa},Vf={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"}},Bf={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"}},zf={"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"}},Nf={"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"}},Of={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"}},Uf={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"}},Gf={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"}},Yf={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"}},Hf={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"}},Xf={World:Uf,USA:Gf,NorthAmerica:Yf,SouthAmerica:Hf,Canada:Nf,Europe:Of,Asia:Bf,Africa:Vf,Australia:zf},Wf={Solid:yd},jf=(t,e)=>Math.abs(t)+Math.abs(e);function $f(t,e){const i=t.reduce(jf,0),s=(r=t,Math.max(...r.map((t=>t))));var r;const n=(t=>Math.min(...t.map((t=>t))))(t);return Math.max(e**2*s/i**2,i**2/(e**2*n))}const Zf=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},Kf=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(jf,0),h=t.map((t=>t.animatedValue)).reduce(jf,0),a=t.map((t=>t.animatedValue*n*r/h)),l=a.reduce(((t,e)=>t+e),0),u=a.map((t=>t/l*100)),c=a.filter(((t,e)=>u[e])),d={children:[],id:0,parentID:-1,name:"Main Rectangle",value:o,animatedValue:h,x:i,y:s,width:r,height:n,nodeIndex:-1,userNode:{name:"Main Rectangle"}};if(1===t.length){const i={...t[0],x:e.x,y:e.y,width:e.width,height:e.height};d.children.push(i)}else qf(c,Zf(d).value,t,d);return d.children},Jf=(t,e,i,s,r)=>{const n=t.reduce(jf,0)/e;t.forEach(((t,e)=>{const o=Math.abs(t)/n,{x:h,y:a,children:l}=r,u={...s[l.length],x:h,y:a,width:i?n:o,height:i?o:n};i?r.y+=o:r.x+=o,l.push(u)})),i?(r.x+=n,r.y-=e,r.width-=n):(r.x-=e,r.y+=n,r.height-=n)},qf=(t,e,i,s)=>{const r=[{children:t,width:e,row:[]}];for(;r.length>0;){const t=r.pop();if(!t)continue;const{children:e,width:n,row:o}=t;let h=0;const a=[...o];for(;hl)){Jf(a,n,Zf(s).vertical,i,s),r.push({children:e.slice(h),width:Zf(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&Jf(a,n,Zf(s).vertical,i,s)}};class Qf extends Qh{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.yp("treeMapChart bg",0),r,i.cs.ts.treeMapChartBackgroundFillStyle||i.cs.ts.chartXYSeriesBackgroundFillStyle,i.cs.ts.treeMapChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.treeMapChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.treeMapChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,h),this.OL=new Map,this.NL=[],this.GL={},this.WL=p([]),this.xm={speed:1},this.UL=Le,this.YL=!0,this.HL="Go Back",this.$L=[],this.XL=this.ts.treeMapChartPathLabelFillStyle||this.ts.uiTextFillStyle,this.jL=this.ts.treeMapChartPathLabelFont||this.ts.uiTextFont,this.ZL=this.ts.treeMapChartLabelHeaderFillStyle||this.ts.uiTextFillStyle,this.QL=this.ts.treeMapChartLabelHeaderFont||this.ts.uiTextFont,this.JL=this.ts.treeMapChartLabelFillStyle||this.ts.uiTextFillStyle,this.KL=this.ts.treeMapChartLabelFont||this.ts.uiTextFont,this.Hi=!0,this.Tx=e.AutoCursorModes.onHover,this.Om=tg,this.Ix=!0,this.qL=!1,this.tR=this.ts.treeMapChartParentColor||I,this.iR=this.ts.treeMapChartNodeStrokeStyle||this.ts.uiBackgroundStrokeStyle,this.onNodeMouseEnter=t=>this.L.on("mouseEnter",t),this.onNodeMouseLeave=t=>this.L.on("mouseLeave",t),this.onNodeMouseClick=t=>this.L.on("mouseClick",t),this.onNodeMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onNodeMouseDown=t=>this.L.on("mouseDown",t),this.onNodeMouseUp=t=>this.L.on("mouseUp",t),this.onNodeMouseMove=t=>this.L.on("mouseMove",t),this.offNodeMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offNodeMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offNodeMouseClick=t=>this.L.off(t,"mouseClick"),this.offNodeMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offNodeMouseDown=t=>this.L.off(t,"mouseDown"),this.offNodeMouseUp=t=>this.L.off(t,"mouseUp"),this.offNodeMouseMove=t=>this.L.off(t,"mouseMove"),this.offNodeMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offNodeMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offNodeMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offNodeMouseWheel=t=>this.L.off(t,"mouseWheel"),this.Bx=(t,e,i,s,r)=>{this.cs.vs(),this.qL=!0},this.Ct=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s,Zt(t)),this.Ix&&this.cs.us._s(i,!0),this.YL&&this.engine.setMouseStyle(e.MouseStyles.Point),this.L.emit("mouseEnter",this,t,s.userNode),this.cs.vs())},this.kt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=void 0,t&&Zt(t)),this.Ix&&this.cs.us._s(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.L.emit("mouseLeave",this,t,s.userNode),this.cs.vs())},this.Dt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s,Zt(t)),this.Ix&&this.cs.us._s(i,!0),this.YL&&this.engine.setMouseStyle(e.MouseStyles.Point),this.L.emit("mouseEnter",this,t,s.userNode),this.cs.vs())},this.Tt=(t,e)=>{const i=this.sR(e);if(i){if(this.YL){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.GL[i.parentID]:void 0;e&&(this.WL.M([e]),this.Kx=void 0,this.L.emit("viewChange",this.WL._()),this.qL=!0),t&&Zt(t)}this.L.emit("mouseClick",this,t,i.userNode),this.cs.vs()}},this.Ft=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseDoubleClick",this,t,s)},this.It=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseDown",this,t,s)},this.Pt=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseUp",this,t,s)},this.Lt=(t,e,i)=>{var s;const r=null===(s=this.OL.get(i))||void 0===s?void 0:s.userNode;this.L.emit("mouseDragStart",this,t,e,r)},this.Bt=(t,e,i,s,r)=>{var n;const o=null===(n=this.OL.get(r))||void 0===n?void 0:n.userNode;this.L.emit("mouseDrag",this,t,e,i,s,o)},this.Rt=(t,e,i,s)=>{var r;const n=null===(r=this.OL.get(s))||void 0===r?void 0:r.userNode;this.L.emit("mouseDragStop",this,t,e,i,n)},this.Et=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseWheel",this,t,s)},this.zt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s),this.Ix&&this.cs.us._s(i,!0),this.L.emit("touchStart",this,t,s.userNode),this.cs.vs(),Zt(t))},this.Vt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s),this.Ix&&this.cs.us._s(i,!0),this.L.emit("touchMove",this,t,s.userNode),this.cs.vs(),Zt(t))},this.Ot=(t,i)=>{const s=this.sR(i);if(s){if(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=void 0),this.YL){const e=(null==s?void 0:s.children.length)?s:s.parentID?this.GL[s.parentID]:void 0;e&&(this.WL.M([e]),this.L.emit("viewChange",this.WL._()),this.qL=!0),t&&Zt(t)}this.Ix&&this.cs.us._s(i,!1),this.L.emit("touchEnd",this,t,s.userNode),this.cs.vs(),Zt(t)}},this.eR=t=>{const e=this.GL[this.$L[t].id]?[this.GL[this.$L[t].id]]:this.NL;this.WL.M(e),this.L.emit("viewChange",e),this.qL=!0,this.cs.vs()},this.ts.treeMapChartNodeColors)this.hR=this.ts.treeMapChartNodeColors;else{const t=this.ts.pointSeriesFillStyle,e=t=>Y(t)?t.getColor():I;this.hR="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.cs.Gn(ah._f),this.Wm=i.Ax("TreeMapChart plotting",0),this.Ym=i.Ax("TreeMap UI plotting",1),this.onResize(this.Bx),this.bp.Eh("TreeMap Chart");const a=Ft(void 0,Ea);this.Ux=a.lm(i.$m(),this.pixelScale,this.pixelScale,this.ts).setVisible(!1),this.rR=this.hs.yg(),this.mp(n,this.uiScale),this.Hx=this.Wm.$x(this.pixelScale).ke(new H).Ce(this.iR),this.nR=this.cs.us.zr(this,{animationEnabled:!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)}),this.oR=new Xa((()=>this.Ym.Dr(this.pixelScale).setMouseInteractions(!1))),this.aR=new Xa((()=>this.Ym.Dr(this.uiScale))),this.Hx.setMouseInteractions(this.Hi).setMouseEnterEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.kt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseDownEventHandler(((t,e,i)=>this.It(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Dt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Lt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Bt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Rt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Et(e,i))).setTouchStartEventHandler(((t,e,i)=>this.zt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Ot(e,i))),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}setData(t){t=Array.isArray(t)?t.slice():[t];const{lR:e}=(()=>{let t=0;return{lR:e=>{var i;const s=e.map(((t,e)=>({node:t,parent:null}))),r=[];for(;s.length>0;){const e=s.pop();if(!e)continue;const{node:n,parent:o}=e;t+=1;const h={id:t,parentID:null==o?void 0:o.id,name:n.name,value:n.value||0,animatedValue:n.value||0,children:[],nodeIndex:o?o.nodeIndex:-1,userNode:n};o?o.children.push(h):r.push(h),null===(i=n.children)||void 0===i||i.forEach((t=>{s.push({node:t,parent:h})}))}const n=t=>{t.children.forEach(n),t.children.length>0&&(t.value+=t.children.reduce(((t,e)=>t+e.value),0),t.animatedValue+=t.children.reduce(((t,e)=>t+e.animatedValue),0),t.children.sort(((t,e)=>e.animatedValue-t.animatedValue)))};r.forEach(n);const o=1===e.length?r[0].children:r;return o.sort(((t,e)=>e.animatedValue-t.animatedValue)),o.forEach(((t,e)=>{t.nodeIndex=e;const i=e=>{e.children.forEach((e=>{e.nodeIndex=t.nodeIndex,i(e)}))};i(t)})),r}}})(),i=e(t);return i.forEach((t=>{const e=this.GL[t.id];e&&this.uR(t,e)})),this.Kx=void 0,this.WL.M(i),this.NL=i,this.GL=this.cR(i),this.qL=!0,this.cs.vs(),this}setAnimationValues(t,e=1){return this.xm=t?{speed:e}:void 0,this.cs.vs(),this}setInitPathButtonText(t){return this.HL=t,this.qL=!0,this.cs.vs(),this}setDisplayedLevelsCount(t){return this.UL=t,this.qL=!0,this.cs.vs(),this}setDrillDownEnabled(t){return this.YL=t,this.qL=!0,this.cs.vs(),this}setDrillDownNode(t){var e,i;if(this.Kx=void 0,void 0===t)this.WL.M(this.NL);else{const s=[...this.NL];for(;s.length>0;){const r=s.pop();if(r){if(void 0!==r.value&&r.userNode===t||r.parentID&&Array.isArray(t)&&(null===(i=null===(e=this.GL[r.parentID])||void 0===e?void 0:e.userNode)||void 0===i?void 0:i.children)===t){const t=r.children.length?r:r.parentID?this.GL[r.parentID]:this.NL[0];this.WL.M([t]);break}if(r.children)for(let t=r.children.length-1;t>=0;t-=1)s.push(r.children[t])}}}return this.L.emit("viewChange",this.WL._()),this.qL=!0,this.cs.vs(),this}setNodeColoring(t){return t instanceof Array?(this.Hx.ke(new H),this.hR=t):this.Hx.ke(t),this.qL=!0,this.cs.vs(),this}setParentNodeColor(t){return this.tR=t,this.qL=!0,this.cs.vs(),this}setPathLabelFillStyle(t){return this.XL="function"==typeof t?t(this.XL):t,this.qL=!0,this.cs.vs(),this}getPathLabelFillStyle(){return this.XL}setPathLabelFont(t){return nr(t)?this.jL=t:this.jL=t(this.jL),this.qL=!0,this.cs.vs(),this}getPathLabelFont(){return this.jL}setHeaderFont(t){return nr(t)?this.QL=t:this.QL=t(this.QL),this.qL=!0,this.cs.vs(),this}getHeaderFont(){return this.QL}setHeaderFillStyle(t){return this.ZL="function"==typeof t?t(this.ZL):t,this.qL=!0,this.cs.vs(),this}getHeaderFillStyle(){return this.ZL}setLabelFont(t){return nr(t)?this.KL=t:this.KL=t(this.KL),this.qL=!0,this.cs.vs(),this}getLabelFont(){return this.KL}setLabelFillStyle(t){return this.JL="function"==typeof t?t(this.JL):t,this.qL=!0,this.cs.vs(),this}getLabelFillStyle(){return this.JL}setNodeBorderStyle(t){return this.Hx.Ce(t),this.qL=!0,this.cs.vs(),this}getNodeBorderStyle(){return this.Hx.lo()}setNodeEffect(t){return this.rR.Ss(t),this.cs.vs(),this}getNodeEffect(){return this.rR.xs()}setAutoCursor(t){return this.Ux&&t(this.Ux),this.cs.vs(),this}getAutoCursor(){return this.Ux}setAutoCursorMode(t){return this.Tx=t,this.cs.vs(),this}getAutoCursorMode(){return this.Tx}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}onNodeMouseDragStart(t){return this.L.on("mouseDragStart",t)}onNodeMouseDrag(t){return this.L.on("mouseDrag",t)}onNodeMouseDragStop(t){return this.L.on("mouseDragStop",t)}onNodeMouseWheel(t){return this.L.on("mouseWheel",t)}onNodeTouchStart(t){return this.L.on("touchStart",t)}onNodeTouchMove(t){return this.L.on("touchMove",t)}onNodeTouchEnd(t){return this.L.on("touchEnd",t)}onViewChange(t){return this.L.on("viewChange",t)}offNodeTouchStart(t){return this.L.off(t,"touchStart")}offNodeTouchMove(t){return this.L.off(t,"touchMove")}offNodeTouchEnd(t){return this.L.off(t,"touchEnd")}offViewChange(t){return this.L.off(t,"viewChange")}setMouseInteractions(t){return this.Hi=t,this.Hx.setMouseInteractions(t),this}getMouseInteractions(){return this.Hi}setAnimationHighlight(t){return this.nR.Nr(t),this}getAnimationHighlight(){return this.nR.Gr()}setHighlightOnHover(t){return this.Ix=t,this}getHighlightOnHover(){return this.Ix}getMinimumSize(){}Qd(){return[this]}Fe(t){super.Fe(t),super.pp(),ta.kp(this.bp,this.Sp);const i=ta.Cp(this.bp,this.Sp);if(this.qL&&this.WL._().length){this.Hx.Gt(),this.OL.clear(),this.nR.Or(),this.ih&&this.dR(t);const s=Kf({data:this.WL._(),dimensions:{x:0+this.ya.left,y:0+this.ya.bottom,width:this.pixelScale.x.getInnerEnd()-this.ya.right-this.ya.left,height:this.pixelScale.y.getInnerEnd()-i-this.ya.top-this.ya.bottom}}),r=this.oR.gy();this.fR(s,r),r.finishPlot(),this.AR(),this.NL!==this.WL._()&&this.NL.length>1&&this.$L.unshift({name:this.HL,id:0});let n=0;const o=this.aR.gy(),h=this.jL;this.$L.forEach(((t,i)=>{const s=o.add(),r=this.cs.Pg.Ig(t.name,h,0);s.Eh(`← ${t.name}`).Nh(h).Ie({x:0,y:100}).za({x:-1,y:1}).Ir({left:this.ya.left+n,top:this.ya.top,right:0,bottom:0}).ke(this.XL).setMouseClickEventHandler((t=>this.eR(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.WL._().every((t=>t.value===t.animatedValue))?this.qL=!1:this.cs.vs(!0)}const s=this.cs.Nn();if(this.Kx&&s){const t=s;this.Ux.setPosition(t).setVisible(!0).getResultTable().setContent(this.Om(new la,this.Kx).Qu())}else this.Ux.setVisible(!1);return this.Ux.Ds().Fe(),this}dispose(){return this.Ym.U(),this.Wm.U(),this.Ux.dispose(),this.Hx.dispose(),this.OL.clear(),this.oR.my(),this.aR.my(),super.dispose()}Z(){return super.Z(),this}J(){return super.J(),this}Wd(){return ue(this.Hx.zh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),le(t,this.ts,i,{}),this}fR(t,e,i=!1,s=0){const r=t.map(((t,e)=>({node:t,isChild:i,depth:s})));for(;r.length>0;){const t=r.pop();if(!t)continue;const{node:i,depth:s,opacity:n}=t,{x:o,y:h,height:a,width:l,children:u,animatedValue:c,name:d,nodeIndex:f}=i,g=this.hR,m=0===s&&1===this.WL._().length?this.tR:g[f%g.length],y=[{x:o,y:h},{x:o,y:a+h},{x:l+o,y:a+h},{x:l+o,y:h}],p=this.Hx.Vr().Sl(y).gR(m.setA(n||250)).Jx(c);this.OL.set(p,i),this.nR.Vr(p,(t=>p.ds(t)));const x=o+5,S=h+5,A=Math.max(a-25-5,0),v=Math.max(l-5-5,0);if(u&&u.length&&s15&&A>15){const t=Kf({data:u,dimensions:{x:v>0?x:o,y:A>0?S:h,width:v,height:A}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.NL.length||this.NL===this.WL._()?250:n?n/(s+1):250-e*o;r.push({node:t[e],isChild:!0,depth:s+1,opacity:h})}}const b=0===s&&1===this.WL._().length?this.ZL:this.JL,M=0===s?this.QL:this.KL,E=this.pR(d,l-25,M),w=this.cs.Pg.Ig(E,M,0),T=e.add();l-25>w.x&&a>25?T.Eh(E).Ie({x:o+5,y:a+h-2.5}).za({x:-1,y:1}).ke(b).Nh(M):T.Eh("")}}cR(t){const e={},i=[...t];for(;i.length>0;){const t=i.pop();t&&(e[t.id]=t,t.children&&i.push(...t.children))}return e}sR(t){if(!this.qL&&t)return this.OL.get(t)}AR(){this.$L=[];const t=this.WL._()[0].id;let e=this.GL[t].parentID;for(;e;)this.$L.push({name:this.GL[e].name,id:e}),e=this.GL[e].parentID;return this.$L.reverse()}pR(t,e,i){let s=this.cs.Pg.Ig(t,i,0).x;if(s<=e)return t;const r=t.split(" ");let n=t;for(;r.length>1&&s>e;)r.pop(),n=`${r.join(" ")}...`,s=this.cs.Pg.Ig(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.cs.Pg.Ig(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.cs.Pg.Ig(n,i,0).x;return n.length<=3&&s>e?"":n}dR(t){var e;const i=[...this.NL];for(;i.length>0;){const s=i.pop();if(!s)continue;const r=s.value-s.animatedValue;if(Math.abs(r)<.0015*s.value||void 0===this.xm)s.animatedValue=s.value;else{const i=r/250*((null===(e=this.xm)||void 0===e?void 0:e.speed)||1)*t;s.animatedValue+=i,(r>0&&s.animatedValue>s.value||r<0&&s.animatedValue0&&i.push(...s.children)}}uR(t,e){const i=[{current:t,previous:e}];for(;i.length>0;){const t=i.pop();if(!t)continue;const{current:e,previous:s}=t;e.animatedValue=this.ih?s.animatedValue:e.value,s.nodeIndex<0?e.nodeIndex=0:e.nodeIndex=s.nodeIndex;const r=new Map(s.children.map((t=>[t.id,t])));e.children.forEach(((t,e)=>{const n=r.get(t.id);i.push({current:t,previous:n||s})}))}}}const tg=(t,e)=>{const{name:i,value:s}=e;return t.addRow(`${i}`).addRow(`${s}`),t},eg=(t,i)=>{const s=(t=>{const i=new G({color:t.uiStrokeColorContrastHigh}),s=new G({color:t.uiStrokeColorContrastMedium}),r=new G({color:t.uiStrokeColorContrastLow}),n=new rr({family:t.fontFamily,weight:"normal",style:"normal"}),o=n.setSize(18*t.fontScaler),h=n.setSize(16*t.fontScaler),a=n.setSize(14*t.fontScaler),l=n.setSize(10*t.fontScaler),u=n.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=n.setSize(13*t.fontScaler),d=new Ji({thickness:2,fillStyle:r}),f=new G({color:t.dataHighlightOverlayColor}),g=new Ji({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new G({color:t.stroke}))),y=t=>m[t%m.length],p=m.map((t=>new Ji({thickness:2,fillStyle:t}))),x=t=>p[t%p.length],S=t.dataColorPalette.map((t=>new G({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),A=t=>S[t%S.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new st({angle:180,stops:[{color:oe(e,E(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:oe(e,E(0,0,0,e.getA()),.3),offset:1}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new st({angle:180,stops:[{color:oe(e,E(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:oe(e,E(0,0,0,e.getA()),.3),offset:1}]})})),T=t=>M[t%M.length],k=t.dataColorPaletteInverted.map((t=>new G({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),C=t=>k[t%k.length],R=new G({color:t.dataColorPositive}),I=new G({color:t.dataColorNegative}),F=new Ji({thickness:1,fillStyle:new G({color:t.dataStrokeColorContrastHigh.setA(50)})}),D=new Ji({thickness:2,fillStyle:t.axisLineFillStyle}),L=ot,P=new G({color:E(0,0,0,1)}),_=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),V=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),B=a,N=t.axisLabelMajorFillStyle,O=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),U=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),Y=a,H=t.axisLabelMajorFillStyle,X=new Ji({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new Ji({thickness:1,fillStyle:t.axisTickMinorFillStyle}),j=l,$=t.axisLabelMinorFillStyle,Z=ph,K=new mh({gridStrokeStyle:_,tickStyle:V,tickLength:50,tickPadding:-14,labelFont:B,labelPadding:0,labelFillStyle:N}),J=new mh({gridStrokeStyle:O,tickStyle:U,tickLength:7,tickPadding:5,labelFont:Y,labelPadding:0,labelFillStyle:H}),q=new mh({gridStrokeStyle:X,tickStyle:W,tickLength:4,tickPadding:10,labelFont:j,labelPadding:0,labelFillStyle:$}),Q=new Nh({extremeTickStyle:Z,majorTickStyle:J,minorTickStyle:q}),tt=new Fh({greatTickStyle:K,majorTickStyle:J,minorTickStyle:q}),et=new Hh({majorTickStyle:J,minorTickStyle:q}),it=new G({color:t.dataHighlightOverlayColor}),rt=new Ji({thickness:1,fillStyle:s}),nt=new Ji({thickness:2,fillStyle:s}),ht=t=>new gr.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),at=m[0],lt=t.uiTextFillStyle,ut=t.legendBackgroundFillStyle,ct=new Ji({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),dt=ae(t.legendButtonDefaultColor),ft=ae(t.isDark?E(70,70,70,255):E(170,170,170,255)),gt=new G({color:t.isDark?E(70,70,70,255):E(170,170,170,255)}),mt=new Ji({thickness:1,fillStyle:i}),yt=new qn({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:Kn.DashedEqual,patternScale:3}),pt=t.zoomBandChartDefocusOverlayFillStyle,xt=new Ji({thickness:2,fillStyle:new G({color:t.zoomBandChartSplitterColor})});let St={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:ot,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new Ji({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:ot,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:x,pointLineSeriesStrokeStyle:x,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:x,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:x,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:ot,segmentSeriesStrokeStyle:x,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:ot,boxSeriesStrokeStyle:new Ji({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:E(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:R,ohlcCandleBodyFillStyleNegative:I,ohlcCandleTailStrokeStylePositive:new Ji({thickness:1,fillStyle:new G({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new Ji({thickness:1,fillStyle:new G({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new Ji({thickness:2,fillStyle:R}),ohlcBarStrokeStyleNegative:new Ji({thickness:2,fillStyle:I}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:F,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:F,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:A,areaRangeSeriesFillStyleInverted:T,areaRangeSeriesStrokeStyleInverted:C,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:A,areaSeriesBipolarLowFillStyle:T,areaSeriesBipolarLowStrokeStyle:C,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:A,areaSeriesNegativeFillStyle:T,areaSeriesNegativeStrokeStyle:C,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:D,xAxisNibStyle:L,xAxisOverlayStyle:P,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:ot,xAxisNumericTicks:Q,xAxisDateTimeTicks:tt,xAxisTimeTicks:et,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:D,yAxisNibStyle:L,yAxisOverlayStyle:P,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:ot,yAxisNumericTicks:Q,yAxisDateTimeTicks:tt,yAxisTimeTicks:et,bandFillStyle:it,bandStrokeStyle:rt,constantLineStrokeStyle:nt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:ot,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:z,barChartSeriesBackgroundStrokeStyle:ot,barChartBarFillStyle:y,barChartBarStrokeStyle:new Ji({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:D,barChartValueAxisTicks:Q.setMajorTickStyle((t=>t.setGridStrokeStyle(ot))).setMinorTickStyle((t=>t.setGridStrokeStyle(ot))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:D,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:Q.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:ot,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:ot,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:D,xAxis3DNumericTicks:Q,xAxis3DDateTimeTicks:tt,xAxis3DTimeTicks:et,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:D,yAxis3DNumericTicks:Q,yAxis3DDateTimeTicks:tt,yAxis3DTimeTicks:et,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:D,zAxis3DNumericTicks:Q,zAxis3DDateTimeTicks:tt,zAxis3DTimeTicks:et,lineSeries3DStrokeStyle:x,pointLineSeries3DStrokeStyle:x,pointLineSeries3DPointStyle:ht,pointSeries3DPointStyle:ht,pointCloudSeries3DPointStyle:t=>new gr.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:F,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:F,boxSeries3DFillStyle:y,meshModel3DFillStyle:y(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:ot,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:it,polarSectorStrokeStyle:rt,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:D,polarAmplitudeAxisNumericTicks:Q,polarAmplitudeAxisDateTimeTicks:tt,polarAmplitudeAxisTimeTicks:et,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:D,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:x,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:x,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:b,polarPolygonSeriesStrokeStyle:A,polarAreaSeriesFillStyle:b,polarAreaSeriesStrokeStyle:A,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:ot,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:at,mapChartStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:z,mapChartOutlierRegionStrokeStyle:new Ji({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:ut,mapChartSeparateRegionStrokeStyle:ct,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:ot,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:at,dataGridCellBackgroundFillStyle:new G({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new Ji({thickness:.4,fillStyle:new G({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:ot,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ct,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ct,dataGridScrollBarButtonArrowFillStyle:dt,dataGridScrollBarButtonArrowStrokeStyle:ct,sparkLineChartStrokeStyle:x(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:A(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:A(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:ct,sparkChartBandFillStyle:it,sparkChartBandStrokeStyle:rt,sparkChartConstantLineStrokeStyle:nt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:ot,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new Ji({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new Ji({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new Ji({thickness:2,fillStyle:i}),spiderSeriesFillStyle:b,spiderSeriesStrokeStyle:A,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:ot,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:ct,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:mt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:ot,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:ct,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:mt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:ot,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:ct,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:mt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:ot,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new G({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ct,gaugeChartGaugeFillStyle:at,gaugeChartIntervalLabelsFillStyle:lt,gaugeChartIntervalLabelsFont:c,gaugeChartValueLabelFillStyle:lt,gaugeChartValueLabelFont:c,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:ot,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:w("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:lt,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:ot,zoomBandChartDefocusOverlayFillStyle:pt,zoomBandChartSplitterStrokeStyle:xt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:E(254,204,0,.7),uiButtonFillStyle:dt,uiButtonFillStyleHidden:ft,uiButtonStrokeStyle:ct,uiButtonSize:10,uiBackgroundFillStyle:ut,uiBackgroundStrokeStyle:ct,uiTextFillStyle:lt,uiTextFillStyleHidden:gt,uiTextFont:c,legendTitleFillStyle:lt,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:ut,cursorTickMarkerXBackgroundStrokeStyle:ct,cursorTickMarkerXTextFillStyle:lt,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:ut,cursorTickMarkerYBackgroundStrokeStyle:ct,cursorTickMarkerYTextFillStyle:lt,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:yt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:ut,cursorResultTableStrokeStyle:ct,cursorResultTableTextFillStyle:lt,cursorResultTableTextFont:c,cursorGridStrokeStyleX:yt,cursorGridStrokeStyleY:yt,chartMarkerPointMarkerFillStyle:yt.getFillStyle(),chartMarkerPointMarkerSize:{x:20,y:20},chartMarkerPointMarkerShape:e.PointShape.Star,seriesMarkerPointMarkerFillStyle:yt.getFillStyle(),seriesMarkerPointMarkerSize:{x:9,y:9},seriesMarkerPointMarkerShape:e.PointShape.Cross};return t.overrideThemeProperties&&(St={...St,...t.overrideThemeProperties}),St})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},ig=(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},sg=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.5);return new tt({stops:[{color:oe(r,E(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:oe(r,E(30,30,30),.5*i).setA(100),offset:1}]})},rg=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.2);return new tt({stops:[{color:oe(r,E(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:oe(r,E(0,0,0),.2*i),offset:1}]})},ng=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.2);return new st({angle:90,stops:[{color:oe(r,E(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:oe(r,E(30,30,30),.5*i),offset:1}]})},og=(t,e,i)=>(()=>{const i=new Map;return s=>{const r=i.get(s);if(r)return r;const n=(i=>{const s=!0===t?e[i%e.length].stroke:oe(e[i%e.length].stroke,E(255,255,255),.3);return new st({angle:90,stops:[{color:oe(s,E(255,255,255),.5),offset:0},{color:s,offset:.35},{color:oe(s,E(30,30,30),.5),offset:1}]})})(s);return i.set(s,n),n}})(),hg=(t,i,s)=>{const r=i[0].stroke;return new tt({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:oe(r,E(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:oe(r,E(0,0,0),.5*s),offset:1}]})},ag=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:1,blur:9,offset:{x:0,y:0},color:E(0,0,0,150)}),n=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(50,51,52)},{offset:.5,color:E(14,15,16)},{offset:1,color:E(0,0,0)}]}),o=new G({color:E(45,45,45)}),h=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(120,120,120,100)},{offset:1,color:E(0,0,0,50)}]}),a=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(30,30,30,200)},{offset:1,color:E(0,0,0,255)}]}),l=new G({color:E(255,255,220)}),u=new G({color:E(255,255,166)}),c=new G({color:E(255,255,220)}),d=new G({color:E(255,255,220,130)}),f=new G({color:E(255,255,200)}),g=f,m=g,y=new st({angle:45,stops:[{offset:0,color:E(230,230,230)},{offset:1,color:E(150,150,150)}]}),p=new G({color:E(220,220,220)}),x=new G({color:E(200,200,200,50)}),S=new G({color:E(200,200,200,150)}),A=new G({color:E(200,200,200,20)}),v=new G({color:E(150,150,150)}),b=new st({angle:0,stops:[{offset:0,color:E(10,10,10,220)},{offset:1,color:E(30,30,30,220)}]}),M=i,T=E(255,255,200),k=b,C=M,R=E(20,20,20),I=E(0,0,0),F=t,D=E(150,150,150),L=E(50,50,50),P=E(50,50,50),_=E(100,100,100),V=E(200,200,200),B=[E(255,255,91,255),E(255,205,91,255),E(255,155,91,255),E(255,196,188,255),E(255,148,184,255),E(219,148,198,255),E(235,196,224,255),E(169,148,198,255),E(148,226,198,255),E(148,255,176,255),E(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(20),N=E(176,255,157,255),O=E(255,112,76,255),U={mapChartFillStyle:new st({angle:135,stops:[{color:E(255,255,91,255),offset:0},{color:E(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:sg(s,B,.5),pieChartSliceFillStylePalette:rg(s,B,1),funnelChartSliceFillStylePalette:ng(s,B,1),pyramidChartSliceFillStylePalette:ng(s,B,1),rectangleSeriesFillStyle:og(s,B),gaugeChartGaugeFillStyle:hg(s,B,1)},Y=new G({color:E(176,255,157,255)}),H=new G({color:E(255,146,146,255)}),X=new G({color:E(176,255,157,255)}),W=new G({color:E(230,63,63,255)}),j=new G({color:E(176,255,157,120)}),$=new G({color:E(229,63,63,180)}),Z=new G({color:E(27,37,36,255)}),K=new G({color:E(62,27,27,255)}),J=[E(255,0,0),E(255,255,0),E(0,255,0)],q=[E(10,10,255),E(10,190,255),E(251,255,0),E(255,38,0)],Q=[E(255,255,0),E(255,204,0),E(255,128,0),E(255,0,0)],et=[E(0,0,0),E(167,4,69,255),E(255,0,0),E(252,252,168,255)],it=new tt({stops:[{color:E(61,61,80,100),offset:0},{color:E(44,44,55,30),offset:1}]}),rt=new G({color:E(148,148,198,255)}),nt=j.getColor().setA(255),ot=E(100,100,100),ht=[E(255,241,149,200),E(255,230,65,200),E(238,211,32,200),E(238,176,32,200),E(255,159,13,200),E(254,120,37,200),E(253,91,56,200),E(253,75,84,200),E(254,95,124,200),E(227,56,160,200),E(226,53,134,200),E(216,90,166,200),E(254,151,206,200),E(237,151,254,200),E(243,177,255,200),E(233,133,252,200),E(210,101,230,200),E(178,61,200,200),E(193,81,156,200),E(217,95,145,200)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:x,axisTickMinorFillStyle:S,axisGridMinorFillStyle:A,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:T,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:C,uiBackgroundColor:R,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:V,dataColorPalette:B,dataColorPaletteInverted:[{area:E(190,50,50,100),border:E(210,80,80)}],dataHighlightOverlayColor:z,dataColorPositive:N,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:w("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:U,treeMapChartParentColor:w("#181E21"),treeMapChartNodeColors:ht,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:H,positiveFillStyle:X,negativeFillStyle:W,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:Z,negativeBackgroundFillStyle:K,badGoodColorPalette:J,coldHotColorPalette:q,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),lg=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:0,blur:9,offset:{x:0,y:0},color:E(105,255,236,40)}),n=new G({color:E(2,21,30)}),o=new tt({stops:[{color:E(19,40,66,150),offset:0},{color:E(0,0,0,150),offset:1}]}),h=new G({color:E(0,5,8,150)}),a=i,l=i,u=i,c=new G({color:E(255,255,220,130)}),d=i,f=i,g=f,m=new G({color:E(20,224,250,255)}),y=i,p=new G({color:E(61,94,110,100)}),x=new G({color:E(61,94,110,255)}),S=new G({color:E(61,94,110,40)}),A=i,v=new G({color:E(0,18,23,255)}),b=i,M=t,T=new G({color:E(0,17,22,240)}),k=i,C=E(0,38,48,220),R=E(0,0,0),I=t,F=E(150,150,150),D=E(19,78,93),L=E(50,50,50),P=E(0,36,48),_=E(200,200,200),V=[E(45,253,253,255),E(44,172,247,255),E(46,100,248,255),E(96,84,199,255),E(184,104,245,255),E(98,160,218,255),E(43,238,245,255),E(38,140,206,255),E(112,96,224,255),E(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),z=E(3,217,194,255),N=E(230,63,63,255),O={mapChartFillStyle:new st({angle:135,stops:[{color:E(118,248,231,255),offset:0},{color:E(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:sg(s,V,1),pieChartSliceFillStylePalette:rg(s,V,1),funnelChartSliceFillStylePalette:ng(s,V,1),pyramidChartSliceFillStylePalette:ng(s,V,1),rectangleSeriesFillStyle:og(s,V),gaugeChartGaugeFillStyle:hg(s,V,1)},U=new G({color:E(45,253,253,255)}),Y=new G({color:E(255,146,146,255)}),H=new G({color:E(45,253,253,255)}),X=new G({color:E(230,63,63,255)}),W=new G({color:E(1,190,164,120)}),j=new G({color:E(229,63,63,180)}),$=new G({color:E(1,53,57,255)}),Z=new G({color:E(62,27,27,255)}),K=[E(1,104,119,255),E(0,165,144,255),E(0,246,214,255)],J=[E(0,87,95,255),E(0,125,124,255),E(1,209,182,255),E(0,255,221,255),E(218,112,112,255),E(172,47,47,255)],q=[E(126,255,253,255),E(50,233,230,255),E(0,196,193,255),E(62,138,178,255),E(139,88,191,255),E(162,55,143,255)],Q=[E(13,31,52,255),E(101,50,118,255),E(1,142,172,255),E(2,196,170,255),E(0,255,221,255)],et=new tt({stops:[{color:E(122,103,254,70),offset:0},{color:E(178,168,255,10),offset:1}]}),it=new G({color:E(122,103,254,255)}),rt=W.getColor().setA(255),nt=E(15,83,83),ot=[E(139,252,252,150),E(60,239,239,150),E(2,201,201,150),E(26,159,159,150),E(15,146,187,150),E(65,168,200,150),E(67,146,207,150),E(64,108,209,150),E(189,64,233,150),E(219,84,238,150),E(192,55,212,150),E(212,98,229,150),E(248,110,211,150),E(251,154,225,150),E(251,154,184,150),E(233,105,144,150),E(255,133,170,150),E(249,110,135,150),E(245,72,101,150),E(210,57,84,150)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new $n({source:ig(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:A,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:_,dataColorPalette:V,dataColorPaletteInverted:[{area:E(170,60,210,100),border:E(210,100,250)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:w("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:w("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),ug=Ee((()=>{const t=!1,i=new ro({spread:0,blur:6,offset:{x:2,y:-2},color:E(0,0,0,30)}),s=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(255,255,255)},{offset:1,color:E(255,255,255)}]}),r=new G({color:E(219,227,233,255)}),n=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,200)},{offset:1,color:E(240,244,246,200)}]}),o=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,255)},{offset:1,color:E(255,255,255,255)}]}),h=new G({color:E(33,43,49)}),a=new G({color:E(33,43,49)}),l=new G({color:E(33,43,49)}),u=new G({color:E(33,43,49,150)}),c=new G({color:E(33,43,49)}),d=c,f=d,g=new st({angle:45,stops:[{offset:0,color:E(225,225,225)},{offset:1,color:E(225,225,225)}]}),m=new G({color:E(150,150,150,255)}),y=new G({color:E(150,150,150,170)}),p=new G({color:E(150,150,150,150)}),x=new G({color:E(150,150,150,100)}),S=new G({color:E(128,146,159)}),A=new st({angle:0,stops:[{offset:0,color:E(255,255,255,240)},{offset:1,color:E(255,255,255,240)}]}),v=new G({color:E(168,186,199)}),b=E(255,255,200),M=new G({color:E(255,255,255,240)}),T=new G({color:E(128,146,159,255)}),k=E(255,255,255,255),C=E(168,168,199,255),R=E(168,186,199,255),I=E(168,186,199,255),F=E(168,186,199,255),D=E(168,186,199,255),L=E(100,100,100),P=E(200,200,200),_=[E(28,181,140,255),E(255,132,0,255),E(240,39,39,255),E(86,121,251,255),E(2,181,213,255),E(13,212,158,255),E(22,167,3,255),E(234,103,232,255),E(62,183,179,255),E(140,93,3,255),E(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),V=E(150,150,150,80),B=E(46,182,120,255),z=E(255,66,66,255),N=new Ji({thickness:2,fillStyle:new G({color:E(168,186,199,255)})}),O={mapChartFillStyle:new st({angle:-45,stops:[{color:E(2,181,213,255),offset:0},{color:E(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:sg(t,_,.8),pieChartSliceFillStylePalette:rg(t,_,.8),funnelChartSliceFillStylePalette:ng(t,_,.5),pyramidChartSliceFillStylePalette:ng(t,_,.5),rectangleSeriesFillStyle:og(t,_),gaugeChartGaugeFillStyle:hg(t,_,.8),chartXYSeriesBackgroundStrokeStyle:N,chart3DSeriesBackgroundStrokeStyle:N,polarChartSeriesBackgroundStrokeStyle:N,spiderChartSeriesBackgroundStrokeStyle:N,dataGridTextFillStyle:new G({color:E(0,88,64,255)})},U=new G({color:E(4,146,108,255)}),Y=new G({color:E(240,39,39,255)}),H=new G({color:E(28,181,140,255)}),X=new G({color:E(230,88,88,255)}),W=new G({color:E(28,181,140,180)}),j=new G({color:E(230,88,88,180)}),$=new G({color:E(229,243,228)}),Z=new G({color:E(232,225,216)}),K=[E(193,48,48,255),E(240,234,60,255),E(45,191,55,255)],J=[E(10,19,255,255),E(15,191,250,255),E(249,255,2,255),E(253,133,0,255),E(255,24,0,255)],q=[E(50,99,213),E(8,179,77),E(255,246,0),E(255,126,0),E(189,36,30)],Q=[E(16,64,176),E(8,179,77),E(255,246,0),E(255,126,0),E(168,6,0)],et=new G({color:E(185,198,207,255)}),it=new tt({stops:[{color:E(151,190,220,10),offset:0},{color:E(151,190,220,50),offset:1}]}),rt=W.getColor().setA(255),nt=E(150,150,150),ot=[E(255,243,136,125),E(254,237,99,125),E(255,216,109,125),E(255,172,100,125),E(255,133,101,125),E(255,113,142,125),E(230,103,129,125),E(242,126,219,125),E(255,155,235,125),E(255,181,240,125),E(203,143,255,125),E(208,154,255,125),E(171,188,255,125),E(197,209,255,125),E(171,187,255,125),E(84,167,239,125),E(38,196,214,125),E(38,214,196,125),E(69,225,141,125),E(36,191,88,125)];return eg({isDark:t,highlightColorOffset:E(-60,-60,-60,60),highlightColorOffsetAxisOverlay:E(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:p,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:A,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:k,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:R,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:P,dataColorPalette:_,dataColorPaletteInverted:[{area:E(190,50,50,100),border:E(210,80,80)}],dataHighlightOverlayColor:V,dataColorPositive:B,dataColorNegative:z,zoomBandChartDefocusOverlayFillStyle:new G({color:E(255,255,255,180)}),zoomBandChartSplitterColor:w("#505D65"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:w("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(0,0,0)}),treeMapChartLabelHeaderFillStyle:new G({color:E(33,33,33)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:E(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),cg=Ee((()=>{const t=!1,i=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(255,255,255)},{offset:1,color:E(255,255,255)}]}),s=new G({color:E(214,236,216,255)}),r=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(233,244,231,70)},{offset:1,color:E(233,244,231,200)}]}),n=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,255)},{offset:1,color:E(255,255,255,255)}]}),o=new G({color:E(1,61,53)}),h=new G({color:E(1,61,53)}),a=new G({color:E(1,61,53)}),l=new G({color:E(1,61,53,150)}),u=new G({color:E(1,61,53)}),c=u,d=c,f=new st({angle:45,stops:[{offset:0,color:E(225,225,225)},{offset:1,color:E(225,225,225)}]}),g=new G({color:E(188,211,186,255)}),m=new G({color:E(188,211,186,150)}),y=new G({color:E(188,211,186,50)}),p=new G({color:E(188,211,186,50)}),x=new G({color:E(104,148,111,255)}),S=new st({angle:0,stops:[{offset:0,color:E(255,255,255,240)},{offset:1,color:E(255,255,255,240)}]}),A=new G({color:E(104,148,111)}),v=E(255,255,200),b=new G({color:E(255,255,255,240)}),M=new G({color:E(104,148,111,255)}),T=E(255,255,255,255),k=E(179,201,183,255),C=E(188,211,186,255),R=E(188,211,186,255),I=E(188,211,186,255),F=E(188,211,186,255),D=E(100,100,100),L=E(200,200,200),P=[E(138,195,142,255),E(193,161,114,255),E(178,99,99,255),E(142,156,210,255),E(154,209,219,255),E(164,212,199,255),E(104,156,97,255),E(196,147,195,255),E(92,190,187,255),E(126,100,51,255),E(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=E(150,150,150,80),V=E(46,182,84,255),B=E(232,96,96,255),z=new Ji({thickness:2,fillStyle:new G({color:E(188,211,186,255)})}),N={mapChartFillStyle:new st({angle:-45,stops:[{color:E(118,160,121,255),offset:0},{color:E(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:sg(t,P,.8),pieChartSliceFillStylePalette:rg(t,P,.8),pyramidChartSliceFillStylePalette:ng(t,P,.5),funnelChartSliceFillStylePalette:ng(t,P,.5),rectangleSeriesFillStyle:og(t,P),gaugeChartGaugeFillStyle:hg(t,P,.8),chartXYSeriesBackgroundStrokeStyle:z,chart3DSeriesBackgroundStrokeStyle:z,polarChartSeriesBackgroundStrokeStyle:z,spiderChartSeriesBackgroundStrokeStyle:z,dataGridTextFillStyle:new G({color:E(77,66,21,255)})},O=new G({color:E(93,151,97,255)}),U=new G({color:E(178,99,99,255)}),Y=new G({color:E(138,195,142,255)}),H=new G({color:E(178,99,99,255)}),X=new G({color:E(138,195,142,180)}),W=new G({color:E(178,99,99,180)}),j=new G({color:E(224,240,237)}),$=new G({color:E(251,227,227)}),Z=[E(178,99,99,255),E(215,224,111,255),E(80,186,88,255)],K=[E(62,64,142,255),E(66,131,77,255),E(250,250,135,255),E(202,161,78,255),E(179,53,53,255)],J=[E(64,86,138),E(123,192,205),E(255,252,149),E(220,155,92),E(184,78,74)],q=[E(64,86,138),E(123,192,205),E(255,252,149),E(220,155,92),E(132,60,57)],Q=new G({color:E(185,198,207,255)}),et=new tt({stops:[{color:E(151,190,220,10),offset:0},{color:E(151,190,220,50),offset:1}]}),it=X.getColor().setA(255),rt=E(150,150,150),nt=[E(242,239,210,150),E(243,238,183,150),E(210,222,136,150),E(204,217,148,150),E(157,190,124,150),E(143,178,72,150),E(198,147,88,150),E(216,148,71,150),E(229,142,103,150),E(225,174,152,150),E(219,149,203,150),E(216,188,209,150),E(109,198,189,150),E(172,206,202,150),E(164,223,217,150),E(174,215,233,150),E(203,225,235,150),E(220,227,243,150),E(207,213,227,150),E(171,182,209,150)];return eg({isDark:t,highlightColorOffset:E(-60,-60,-60,60),highlightColorOffsetAxisOverlay:E(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:y,axisGridMinorFillStyle:p,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:A,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:T,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:R,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:L,dataColorPalette:P,dataColorPaletteInverted:[{area:E(210,70,70,100),border:E(200,110,110)}],dataHighlightOverlayColor:_,dataColorPositive:V,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new G({color:E(255,255,255,180)}),zoomBandChartSplitterColor:w("#446A40"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N,treeMapChartParentColor:w("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new G({color:E(0,0,0)}),treeMapChartLabelHeaderFillStyle:new G({color:E(33,33,33)})},{positiveTextFillStyle:O,negativeTextFillStyle:U,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:q,bollingerFillStyle:et,bollingerBorderFillStyle:Q,highlightPointColor:E(0,0,0),highlightDataGridColor:it,unfocusedDataColor:rt})})),dg=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:1,blur:9,offset:{x:0,y:0},color:E(255,255,255,30)}),n=new G({color:E(6,15,36)}),o=new tt({stops:[{color:E(46,13,87,50),offset:0},{color:E(0,0,0,150),offset:1}]}),h=new G({color:E(0,5,8,150)}),a=i,l=i,u=i,c=new G({color:E(255,255,220,130)}),d=i,f=i,g=f,m=new st({angle:45,stops:[{offset:0,color:E(241,133,255,255)},{offset:1,color:E(115,207,238,255)}]}),y=i,p=new G({color:E(61,94,110,100)}),x=new G({color:E(61,94,110,255)}),S=new G({color:E(61,94,110,40)}),A=i,v=new G({color:E(0,18,23,255)}),b=i,M=E(115,207,238,255),T=new G({color:E(0,17,22,240)}),k=i,C=E(0,38,48,255),R=E(0,0,0),I=t,F=E(150,150,150),D=E(19,57,93),L=E(50,50,50),P=E(0,17,48),_=E(200,200,200),V=[E(20,211,237,255),E(98,147,252,255),E(164,73,250,255),E(129,117,253,255),E(95,134,252,255),E(22,133,212,255),E(35,200,242,255),E(104,121,233,255),E(137,69,232,255),E(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),z=E(3,217,194,255),N=E(243,21,110,255),O={mapChartFillStyle:new st({angle:135,stops:[{color:E(118,248,231,255),offset:0},{color:E(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:sg(s,V,.5),pieChartSliceFillStylePalette:rg(s,V,2),funnelChartSliceFillStylePalette:ng(s,V,1),pyramidChartSliceFillStylePalette:ng(s,V,1),rectangleSeriesFillStyle:og(s,V),gaugeChartGaugeFillStyle:hg(s,V,1)},U=new G({color:E(20,211,237,255)}),Y=new G({color:E(253,145,178,255)}),H=new G({color:E(20,211,237,255)}),X=new G({color:E(239,68,121,255)}),W=new G({color:E(20,211,237,120)}),j=new G({color:E(239,68,121,180)}),$=new G({color:E(1,53,57,255)}),Z=new G({color:E(94,19,42,255)}),K=[E(174,51,132,255),E(204,107,218,255),E(189,215,253,255)],J=[E(0,63,95,255),E(0,149,255,255),E(0,225,255,255),E(255,154,254,255),E(204,98,170,255),E(139,39,84,255)],q=[E(197,241,255,255),E(70,210,255,255),E(0,164,217,255),E(90,99,222,255),E(138,75,192,255),E(151,27,162,255)],Q=[E(13,31,52,255),E(129,54,130,255),E(131,108,176,255),E(7,162,213,255),E(26,247,255,255)],et=new tt({stops:[{color:E(219,42,235,60),offset:0},{color:E(237,73,252,10),offset:1}]}),it=new G({color:E(237,73,252,255)}),rt=W.getColor().setA(255),nt=E(8,70,100),ot=[E(149,230,255,150),E(93,213,243,150),E(20,189,223,150),E(5,151,181,150),E(2,138,198,150),E(2,113,198,150),E(97,148,236,150),E(93,111,230,150),E(151,120,223,150),E(128,87,227,150),E(153,52,230,150),E(179,92,245,150),E(248,110,211,150),E(255,155,228,150),E(251,88,207,150),E(255,0,162,150),E(214,73,177,150),E(209,71,159,150),E(238,101,169,150),E(210,57,134,150)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new $n({source:ig(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:A,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:_,dataColorPalette:V,dataColorPaletteInverted:[{area:E(41,130,255,100),border:E(45,110,240)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:w("#DB77FF"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:w("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),fg={};Object.defineProperty(fg,"darkGold",{get:ag,enumerable:!0}),Object.defineProperty(fg,"turquoiseHexagon",{get:lg,enumerable:!0}),Object.defineProperty(fg,"light",{get:ug,enumerable:!0}),Object.defineProperty(fg,"lightNature",{get:cg,enumerable:!0}),Object.defineProperty(fg,"cyberSpace",{get:dg,enumerable:!0});const gg=fg,mg=gg.darkGold,yg=(t,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,r=0,n=0;const o=[],h=t=>{const i=new bt.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new $n({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Ed)||void 0===s||s.ke(o),r=i.width,n=i.height,u(t)}))}};h(i);const a=t.Wn((t=>h(t)));let l;if(new bt.Image instanceof bt.HTMLImageElement){const t=new bt.Image;t.src=i,l=new $n({source:t,fitMode:e.ImageFitMode.Stretch})}else if(bt.lcjs_setup){const t=new bt.Image;t.src=i;const s=bt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),l=new $n({source:s,fitMode:e.ImageFitMode.Stretch})}else l=new G({color:w("#f00")});const u=t=>{if(t.Ed){const e=t.ft.mi({x:t.ft.x.getInnerEnd(),y:t.ft.y.getInnerStart()},{x:-(3+r),y:3}),i=t.ft.mi({x:t.ft.x.getInnerEnd(),y:t.ft.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.Ed.Ie(e).tt(s)}s&&s.vs()};return s=t.II("logo",Number.MAX_SAFE_INTEGER),i=>{const r={ft:i};return(i=>{i.Ed&&i.Ed.dispose(),s&&(i.Ed=s.Te(i.ft).ke(l).setMouseInteractions(!0).Ce(ot).setMouseEnterEventHandler((()=>{t.Ur(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Ur(e.MouseStyles.None)})).setMouseClickEventHandler(pg).setTouchEndEventHandler(pg),u(i))})(r),o.push(r),{Ds:()=>u(r),U:()=>(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.Un(a)})(r)}}},pg=()=>bt.open("https://lightningchart.com/lightningchart-js/");class xg{constructor(){this.mR=this.fP.bind(this),bt.addEventListener("scroll",this.mR,{passive:!0})}U(){this.mR&&bt.removeEventListener("scroll",this.mR),this.mR=void 0}}class Sg{constructor(t,e){this.ma=t,this.j=e,this.yR=!0,this.SR=null,this.vR=null}}class Ag{constructor(t){this.xR=!1,this.bR=1,this.MR=t,this._R={ma:u(0,0),j:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),yR:!0,SR:null,vR:null},this.wR=u(64,64),this.CR=new Uint8ClampedArray(this.wR.x*this.wR.y*this.bR)}kR(t,e){if(!t.yR)return null;if(t.SR&&t.vR){const i=this.kR(t.SR,e);return null!==i?i:this.kR(t.vR,e)}const i=c(t.j.x,t.j.y);if(t.ma.x+t.j.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.wR.x-t.ma.x-1),t.ma.y+t.j.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.wR.y-t.ma.y-1),t.j.x===e.x&&t.j.y===e.y)return t.yR=!1,t;if(i.xt.j.y)),h?(s=new Sg(oi(t.ma,{x:0,y:1}),u(t.j.x,e.y)),r=new Sg(oi(t.ma,{x:0,y:e.y+1}),u(t.j.x,t.j.y-1-e.y))):(s=new Sg(oi(t.ma,{x:1,y:0}),u(e.x,t.j.y)),r=new Sg(oi(t.ma,{x:e.x+1,y:0}),u(t.j.x-1-e.x,t.j.y))),t.SR=s,t.vR=r,this.kR(t.SR,e)}TR(t,e){const i={FR:!1,ma:null};let s=this.kR(this._R,e);if(null===s)for(;null===s&&this.wR.xthis.MR||t.y>this.MR)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.bR);for(let i=0;i{this.ER.NR(t)})),this.RR.clear(),this}GR(t,e){const i=this.LR.get(e);if(i)return i.get(t)}WR(t,e,i){let s=this.LR.get(e);if(s||(s=new Map,this.LR.set(e,s)),s.has(t.glyph))return bg.Success;const r=this.zR.TR(i,t.size);if(!r||!r.ma)return bg.Fail;r.FR&&this.UR();const n=this.zR.DR(r.BR);if(!n)return bg.Fail;let o=this.RR.get(r.BR);if(!o){const t=this.ER.gl.createTexture();if(!t)throw new yt("Failed to create texture for font!");o=t,this.RR.set(r.BR,t)}const h=r.ma,a=n.wR.x,l=n.wR.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,y=(h.x+t.size.x)/a,p=h.y/l,x=[g,m,y,m,g,p,g,p,y,m,y,p],S=[u,c,d,c,u,f,u,f,d,c,d,f],A={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:S,texCoords:x,packerId:r.BR,texture:o};s.set(t.glyph,A);const v=this.ER.gl;return v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.bindTexture(v.TEXTURE_2D,o),v.texImage2D(v.TEXTURE_2D,0,v.LUMINANCE,n.wR.x,n.wR.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.ER.YR?n.CR:new Uint8Array(n.CR)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.bindTexture(v.TEXTURE_2D,null),r.FR?bg.Resize:bg.Success}UR(){this.LR.forEach((t=>{t.forEach(((e,i)=>{const s=this.zR.DR(e.packerId);if(!s)return;const r=e.origin,n=s.wR.x,o=s.wR.y,h=r.x/n,a=(r.y+e.size.y)/o,l=(r.x+e.size.x)/n,u=r.y/o,c=[h,a,l,a,h,u,h,u,l,a,l,u];e.texCoords=c,t.set(i,e)}))}))}}const wg=t=>{if(t instanceof _i||t instanceof $c)return t.wi()?"linear-highPrecision":"linear";if(t instanceof Vi){const e={};return t.x instanceof Mi&&(e.x={base:t.x.pi()}),t.y instanceof Mi&&(e.y={base:t.y.pi()}),["logarithmic",e]}return"linear"},Tg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let r=!1;i[e]=t=>{if(!t)return r;const e=s();return r=e,e}})),i},kg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.xt(),max:e.bt()}:"y"===t.getLookUpProperty()?{min:e.Mt(),max:e._t()}:"z"===t.getLookUpProperty()?{min:e.uS(),max:e.lS()}:void 0,Cg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),Rg=t=>(e,i)=>i%2?e:e+t;class Ig{constructor(t){this.HR=new Map,this.$R=ce("font"),this.XR=new Map,this.jR=new Set,this.ER=t}OR(t=!1){return(t||0===this.jR.size)&&(this.HR.forEach(((t,e)=>{t.OR(),this.HR.delete(e)})),this.jR.clear()),this}ZR(t){this.jR.add(t)}QR(t){this.jR.delete(t)}JR(t,e,i,s){const r=bt.devicePixelRatio,n=`${s?"dark":"light"} - ${pr(e,r).id}`,o=this.XR.get(n),h=this.HR.get(o);let a=0,l=0,u=0;const c=t.split(""),d=e.size,f=.45*e.size*r,g=Math.round(1*e.size);let m=!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,r=Math.cos(s),n=Math.sin(s);return{x:Math.abs(t*r)+Math.abs(e*n),y:Math.abs(t*n)+Math.abs(e*r)}})(u/r,(l-a+1)/r,i);return{x:y.x,y:y.y,isEstimate:m}}KR(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.XR.get(s);r||(r=this.$R(),this.HR.set(r,new Eg(this.ER)),this.XR.set(s,r));const n=this.HR.get(r);if(!n)throw new yt("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),c=new Map;let d=0;const f=e.properties.size;for(let t=0;t{t.ua.o=!0})),t=-1,d=0,h=0,o=0,c.clear();continue}if(l===bg.Fail)throw new yt("Failed to create glyph");if(a=n.GR(s,f),!a)throw new yt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(a.texture);t||(t={vertices:[],texCoords:[]},c.set(a.texture,t)),t.vertices.push(...a.vertices.map(Rg(r))),t.texCoords.push(...a.texCoords),h=Math.max(h,a.baseline),o=Math.min(o,a.baseline-(a.size.y-1))}d+=a.advanceX}a=d;const g=m(u(0,o),u(a,h)),y=[];return c.forEach(((t,e)=>{y.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[y,g]}}class Fg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>Dg(t)));for(const i of e)t=i(t);return`${xe(this.modifiers.filter((t=>Lg(t)))).map((t=>t.tE)).join("\n")}\n${t}`}}const Dg=t=>"function"==typeof t,Lg=t=>t&&"object"==typeof t&&"iE"in t,Pg=(...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},_g=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Vg=(...t)=>e=>{const i=t.filter((t=>!1!==t));for(let t=0;ti=>{for(let t=0;t{if(!n.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${n}\n)`)})),n},zg=(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},Ng=(...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},Og=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Pg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Pg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Ng(`\t${r} = ${s};`)(i)},Ug=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Gg={roundUnsigned:{iE:"roundUnsigned",tE:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{iE:"linearStep",tE:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{iE:"decodeUbyteRGBAEncodedFloat",tE:"\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:{iE:"texelFetchWithFallback",tE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{iE:"texelFetchWithFallback",tE:"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:{iE:"texelFetchUnsignedWithFallback",tE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{iE:"texelFetchUnsignedWithFallback",tE:"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:{iE:"modulus",tE:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{iE:"computeScreenSpaceWireframe",tE:"#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}"}},Yg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Pg("uniform vec4 uFallbackColor")],n=[],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")):r.push(Bg("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")),r},Hg=[Pg("uniform sampler2D uMaskTexture"),Pg("varying vec2 vMaskTextureCoord"),zg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Xg=[Pg("uniform sampler2D uMaskTexture"),Pg("varying vec2 vMaskTextureCoord"),zg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],Wg=[Pg("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;"),zg("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 jg 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 $g=(...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 r=Object.keys(s).sort();for(const i of r){const r=s[i];"object"==typeof r&&r.__proto__===Object.prototype||Array.isArray(r)?t.push({prefix:i,obj:r}):e+=`${i}=${String(r)},`}}}return e},Zg=t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.eE})),Kg=t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.hE})),Jg=(t,e,...i)=>{const s=[],r=e?"vec3":"vec2",{axisWorldTranslation:n,scaling:o,translation:h,offset:a,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Pg("attribute vec3 aNormal"),Vg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(Vg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(Vg(`${r} ${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(Vg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),Vg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(Vg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),Vg(`${r} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),a&&a.rotation){const t=a.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Pg("attribute float aRotDeg"),Pg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(Vg(`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(Pg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(Vg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Pg(`attribute ${r} aInstanceGeo`)),!0===l){if("linear-highPrecision"===n)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"===n)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"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",r=e?"vec3":"vec2";s.push(Pg(`${o.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===h.dataType?"a":"u")+"TranslationAxis",r=e?"vec3":"vec2";s.push(Pg(`${h.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===a.dataType?"a":"u")+"OffsetAxis",o=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${o} ${t}`));const h=a.halved?" * 0.5":"",l=a.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${r} ${u} = ${t} * ${l}${h} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${r} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===n||"linear"===n)s.push(Pg(`uniform ${r} uDisp`,`uniform ${r} uScale`)),i.forEach((t=>{f.push(`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===n)s.push(Pg(`uniform ${r} uDisp`,`uniform ${r} uScale`,`uniform ${r} uScaleStart_highpart`,`uniform ${r} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${r} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${r} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===n)s.push(Pg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Pg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Pg(`uniform ${r} uScaleStart`,`uniform ${r} uScaleStartLog`,`uniform ${r} uScaleInterval`,`uniform ${r} uScaleIntervalLog`,`uniform ${r} uViewportStart`,`uniform ${r} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=n[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${wi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Pg(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),r=n[1][t];if(void 0===r)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const n=r.base,o="e"===n;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${n}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${r} ${e.variableNameWorldCoord} = uViewportStart + ${r}(${o.join(", ")}) * uViewportSize`)}))}if(a&&"px"===a.sizeUnit){s.push(Pg("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Pg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${n} ${e}`));const o=a.halved?" * 0.5":"",h=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e}${o} * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${h}`)}))}if(a&&"scale"===a.sizeUnit){s.push(Pg("uniform vec2 uRatioPxClip")),s.push(Pg("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Pg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Pg(`${a.dataType} float ${e}`));const r=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e} * uSizePixels * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${r}`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(a&&"nwu"===a.sizeUnit){s.push(Pg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Pg("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(Bg("gl_Position =",...f)),s},qg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(zg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(zg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==n[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(),r=n[1][e];if(void 0===r)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const n=r.base,o="e"===n?"1.0":`cLog${n}`;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":""})`),r.push(zg(i,...t))}}return r},Qg=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.rE})))(t)?[_g("attribute vec4 aColor"),_g("vColor = aColor"),Pg("attribute vec4 aColorA"),Pg("attribute vec4 aColorB"),Ng("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],tm=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.nE})))(t)?[_g("attribute float aLookupValue"),_g("vLookupValue = aLookupValue"),Pg("attribute float aLookupValueA"),Pg("attribute float aLookupValueB"),Ng("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],em={"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",sE:{eE:!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:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[Pg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Ng(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTextureText,r=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",sE:{hE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,nE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,rE:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${$g(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Pg("uniform vec4 uColor"),Vg("vec4 colorFragment = uColor"),...s?Hg:[],...r?Xg:[]);else if("attribute"===i)a="colorAttribute",u.push(Og("attribute vec4 aColor","varying vec4 vColor")),d.push(Pg("varying vec4 vColor"),Vg("vec4 colorFragment = vColor"),...s?Hg:[],...r?Xg:[]);else if("texture"===i)a="colorTexCoord",u.push(Og("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Pg("varying vec2 vTextureCoord"),Pg("uniform sampler2D uColorTexture"),Pg("uniform vec4 uColor"),Vg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Hg:[],...r?Xg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Pg("attribute vec2 aTextureCoord"),Pg("varying vec2 vTextureCoord"),Ng("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Pg("varying vec2 vTextureCoord"),Pg("uniform sampler2D uColorTexture"),Vg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Og("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Pg("uniform sampler2D uColorTexture"),Pg("varying vec2 vTextureCoord"),Vg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Pg("uniform sampler2D uColorTexture"),Pg("varying vec2 vTextureCoord"),Pg("uniform vec4 uColor"),Vg("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",u.push(Og("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Og(e,"varying float vLookupValue"))}d.push(Pg("varying float vLookupValue"),...Yg("vLookupValue",i[2]),...s?Hg:[],...r?Xg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();et(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Pg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Pg(...It(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Gg.linearStep,Vg("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))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?Hg:[],...r?Xg:[])):rt(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Pg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Pg(...It(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Gg.linearStep,Vg("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))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?Hg:[],...r?Xg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Og("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Pg("uniform float uOpacity"),zg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:u,fragmentShader:c,fragmentShaderModifiers:d,idVertex:a,idFragment:l}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${$g(t)}`;return{idFeature:"ColorShaded3D",sE:{hE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,nE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Og("normal","varying vec3 vNormal"),Og("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Pg("uniform vec4 uColorDiffuse"),Vg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Og("attribute vec4 aColor","varying vec4 vColor")),a.push(Pg("varying vec4 vColor"),Vg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Og("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Og(e,"varying float vLookupValue"))}a.push(Pg("varying float vLookupValue"),...Yg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Og("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Pg("varying vec3 vTriangleBary"),Pg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Gg.computeScreenSpaceWireframe,zg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Wg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Zg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Pg(`attribute ${r} aPos`)):i.push(Pg("attribute float aPosX"),Pg("attribute float aPosY"),s&&Pg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Pg("attribute float aPos_highpartX"),Pg("attribute float aPos_lowpartX"),Pg("attribute float aPos_highpartY"),Pg("attribute float aPos_lowpartY")):i.push(Pg(`attribute ${r} aPos_highpart`),Pg(`attribute ${r} aPos_lowpart`)),i.push(...Jg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Pg("attribute vec3 aGeoPos"),Pg("uniform mat4 uModelRotation"),Pg("uniform mat4 uModelRotationNormals"),Pg("uniform vec3 uLocationAxis"),Pg("uniform vec3 uModelAlignment"),Pg("uniform vec3 uModelScale"),Pg("uniform vec3 uModelSize"),...Jg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Bg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&zg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Kg(e)?qg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${$g(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[Pg("uniform float uThicknessPixels"),Pg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA"),Pg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA_highpart"),Pg("attribute vec2 aLocationB_highpart"),Pg("attribute vec2 aLocationA_lowpart"),Pg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationAX"),Pg("attribute float aLocationAY"),Pg("attribute float aLocationBX"),Pg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationA_highpartX"),Pg("attribute float aLocationA_highpartY"),Pg("attribute float aLocationB_highpartX"),Pg("attribute float aLocationB_highpartY"),Pg("attribute float aLocationA_lowpartX"),Pg("attribute float aLocationA_lowpartY"),Pg("attribute float aLocationB_lowpartX"),Pg("attribute float aLocationB_lowpartY")]:[],Pg("attribute vec2 aSegmentPosition"),Pg("attribute float aSegmentSide"),...Jg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Pg("uniform vec2 uMinSegmentPixelVector"),zg("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"),...tm(e),...Qg(e),...Kg(e)?qg(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA"),Pg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA_highpart"),Pg("attribute vec2 aLocationB_highpart"),Pg("attribute vec2 aLocationA_lowpart"),Pg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationAX"),Pg("attribute float aLocationAY"),Pg("attribute float aLocationBX"),Pg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationA_highpartX"),Pg("attribute float aLocationA_highpartY"),Pg("attribute float aLocationB_highpartX"),Pg("attribute float aLocationB_highpartY"),Pg("attribute float aLocationA_lowpartX"),Pg("attribute float aLocationA_lowpartY"),Pg("attribute float aLocationB_lowpartX"),Pg("attribute float aLocationB_lowpartY")]:[],Pg("attribute float aCurveOrBaseline"),Pg("attribute float aSegmentSide"),...Jg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),zg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...tm(e),...Qg(e),...Kg(e)?qg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${$g(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Pg("uniform float uOffsetWU"),Pg("attribute vec3 aLocationA"),Pg("attribute vec3 aLocationB"),Pg("attribute float aSegmentPosition"),Pg("attribute float aPerpendHorizontal"),Pg("attribute float aPerpendVertical"),...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Zg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),zg("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"),...Kg(e)?qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Pg("attribute vec3 aEdge"),Pg("uniform float uEdgeRoundness"),zg("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:(r,n)=>({idVertex:void 0,idFragment:`ColorGrid2D:${$g(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Pg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Gg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?Vg("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"})`):Vg("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})`)),...Yg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,h)=>{const a=[],l=[];return a.push(Pg("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&&Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[h],"ubyte"===r&&Gg.decodeUbyteRGBAEncodedFloat,Vg(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"===r?"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)), ${n})`} ,\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"===r?"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)), ${n})`},\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"===r?"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)), ${n})`},\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"===r?"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)), ${n})`},\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(Pg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),Vg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${$g(t)}`,idFragment:`DrawToNormalTexture:${$g(t)}`,vertexShaderModifiers:a,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,r=t.shadingStyle,n=t.wireframe,o=t.instanceIdSource,h=t.normalTextureType,a=t.heightmapTextureType,l=t.intensityTextureType,u=t.littleEndian;return{idFeature:"SurfaceGrid",apply:(c,d)=>{const f=[],g=[];return f.push(Pg("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&&Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[d],"ubyte"===a&&Gg.decodeUbyteRGBAEncodedFloat,Vg(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"===a?"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(...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&f.push(Og("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Gg.texelFetchUnsignedWithFallback[d],Ng("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Ng("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Ng("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Pg("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(Pg("varying vec3 vTriangleBary")),"uniform"===e?g.push(Pg("uniform vec4 uColorDiffuse"),Vg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(Og("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(Pg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&Gg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?Vg("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"})`):Vg("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"),...Yg("intensityP",e[2]))):(f.push(Og(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(Pg("varying float vLookupValue"),...Yg("vLookupValue",e[2]))):void 0===e&&g.push(Vg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&g.push(...Wg),n&&(f.push(Pg("attribute vec3 aTriangleBary"),Og("aTriangleBary","varying vec3 vTriangleBary")),g.push(Pg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Gg.computeScreenSpaceWireframe,zg("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:${$g(t)}`,idFragment:`SurfaceGrid:${$g(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${$g(t)}`,idFragment:`DebugSurfaceGridNormals:${$g(t)}`,vertexShaderModifiers:[Pg("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"]),Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Gg.decodeUbyteRGBAEncodedFloat,Vg(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?[Gg.texelFetchUnsignedWithFallback[i]]:[],...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),zg("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:[Ng("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Pg("uniform vec3 uCameraLoc"),zg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Pg("attribute float aSegmentInside"),Pg("varying float vSegmentInside"),Pg("varying float vSegmentSide"),zg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Ug("#extension GL_OES_standard_derivatives : enable"),Pg("uniform float uAALimit"),Pg("varying float vSegmentInside"),Pg("varying float vSegmentSide"),zg("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,r=t.firstPass,n=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);n.push(r?{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:${$g(t)}`,idFragment:`Glow1D:${$g(t)}`,vertexShaderModifiers:[Og("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Pg("uniform sampler2D uTexture"),Pg("varying vec2 vTextureCoord"),Pg("uniform vec2 uTextureSize"),r&&Pg("uniform vec2 uOffsetPx"),!r&&Pg("uniform sampler2D uTextureFirstGlowPass"),!r&&Pg("uniform vec4 uGlowColor"),zg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...r?[]:["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)",...r?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...n.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",...n.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:[Pg("uniform vec4 uColor"),Vg("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:[Og("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Pg("varying vec4 vColor"),Vg("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:[Og("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:[Pg("attribute vec2 aLengthSoFar"),Pg("varying float vLengthSoFar"),Pg("uniform vec2 uStippleCount"),Ng("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Pg("uniform sampler2D uStippleTexture"),Pg("uniform float uStippleScale"),Pg("varying float vLengthSoFar"),"webgl1"===e&&Pg("uniform float uStippleTextureWidthLimiter"),zg("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:[Pg("attribute vec2 aLengthSoFarA"),Pg("attribute vec2 aLengthSoFarB"),Pg("varying float vLengthSoFar"),Pg("uniform vec2 uStippleCount"),Ng("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Pg("uniform sampler2D uStippleTexture"),Pg("uniform float uStippleScale"),Pg("varying float vLengthSoFar"),"webgl1"===e&&Pg("uniform float uStippleTextureWidthLimiter"),zg("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,r="interpolation"in t?t:void 0,n="bilinear"===(null==r?void 0:r.interpolation),o=null==r?void 0:r.intensityTextureType,h=null==r?void 0:r.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${$g(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Pg("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",r&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),Gg.texelFetchWithFallback[i],"ubyte"===o&&Gg.decodeUbyteRGBAEncodedFloat,Vg("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&&Vg("vec4 colorFragment = uColor"),r&&zg("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); }",r.flipXY&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",r.flipXY&&"cellStart = ivec2(cellStart.y, cellStart.x)",r.flipXY&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)","vec2 tileDimensions = "+(r.flipXY?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),n&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",n&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",n&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",n&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",n&&"float intensity00 = "+("float"===o?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${h})`),n&&"float intensity01 = "+("float"===o?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${h})`),n&&"float intensity10 = "+("float"===o?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${h})`),n&&"float intensity11 = "+("float"===o?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${h})`),n&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",n&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",n&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",n&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!n&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!n&&"float intensityP = "+("float"===o?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${h})`)),...r?Yg("intensityP",r.lut):[]]}}})},im={"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"},sm={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 rm{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new pt(`Could not find ${this.oE()} ${this.aE()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}oE(){return this.id.toString()}aE(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class nm extends rm{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class om extends rm{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class hm{constructor(t,e,i,s){this.lE=new Map,this.uE=new Map,this.cE=i,this.dE=i.createProgram(),this.fE=`${t.oE()} vertex`,this.AE=`${e.oE()} fragment`,i.attachShader(this.dE,t.shader),i.attachShader(this.dE,e.shader),i.bindAttribLocation(this.dE,0,"aPos"),i.linkProgram(this.dE),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""}gE(t){return me(0,(()=>ye()))}pE(t){const e=this.mE(t);if(void 0===e)throw this.gE(`Could not get ${t} uniform from ${this.fE} and ${this.AE} shaders.`);return e}mE(t){const e=this.lE.get(t);if(e)return e;const i=this.cE.getUniformLocation(this.dE,t);return i?(this.lE.set(t,i),i):void 0}yE(t){const e=this.SE(t);if(void 0===e)throw this.gE(`Could not get ${t} attribute from ${this.fE} and ${this.AE} shaders.`);return e}SE(t){const e=this.uE.get(t);if(e||0===e)return e;const i=this.cE.getAttribLocation(this.dE,t);return i>=0?(this.uE.set(t,i),i):void 0}U(){this.cE.deleteProgram(this.dE)}}const am=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,lm=t=>{let e;try{e=bt.getComputedStyle(t)}catch(t){return null}return e};function um(t){const e=lm(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=lm(gm(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||!!am.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function cm(t){let e=t.length;for(;e--;)if(um(t[e]))return t[e];return null}function dm(t){var e;return t&&Number((null===(e=lm(t))||void 0===e?void 0:e.zIndex)||0)||0}function fm(t){const e=[];for(;t;)e.push(t),t=gm(t);return e}function gm(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}class mm extends xg{constructor(t){if(super(),this.vE=new Map,this.xE=new Map,this.bE=new Map,this.ME=!0,this._E=null,this.wE=null,this.CE=null,this.kE=null,this.TE=0,this.FE=0,this.IE=0,this.PE=!1,this.DE=!0,this.Xi=!1,this.BE=ce(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.j={x:100,y:100},this.LE=()=>{this.RE&&clearTimeout(this.RE),this.RE=setTimeout((()=>this.Qr()),12)},this.EE=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.vE.get(i);if(t){const s=t.zE();t.VE(e),e?this.xE.set(i,t):this.xE.delete(i),s!==e&&t.vs()}}},this.OE=(t,e,i,s,r)=>{const n=r[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.wE.dE),o.clear(o.COLOR_BUFFER_BIT),n.Wr.getBoundingClientRect()){const t=n.NE();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.GE),o.uniform1i(this.TE,0),o.uniformMatrix4fv(this.FE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.CE),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.IE,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.WE&&(n.WE.clearRect(0,0,n.WE.canvas.width,n.WE.canvas.height),n.WE.drawImage(this.UE,0,this.UE.height-t.y,t.x,t.y,0,0,n.WE.canvas.width,n.WE.canvas.height))}},this.YE=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.wE.dE),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Wr.getBoundingClientRect();if(r){const i=r.right-r.left,o=r.bottom-r.top,h=r.left,a=s-r.bottom;n.viewport(h*this.HE-t*this.HE,a*this.HE+e*this.HE,i*this.HE,o*this.HE)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.GE),n.uniform1i(this.TE,0),n.uniformMatrix4fv(this.FE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.CE),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.IE,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.$E=(t,e,i,s,r)=>{const n=r[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const h=n.NE();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.XE[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.UE.height-h.y,h.x,this.UE.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.WE&&(n.WE.clearRect(0,0,n.WE.canvas.width,n.WE.canvas.height),n.WE.drawImage(this.UE,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.jE=(t,e,i,s,r)=>{const n=this.gl2.ctx;n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Wr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.NE();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.XE[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.HE-t*this.HE,l*this.HE+e*this.HE,(a-t+o)*this.HE,(l+e+h)*this.HE,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.RE=void 0,this.Yn=t,!bt.requestAnimationFrame||!bt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.ZE)e=!0===t.ZE?bt.devicePixelRatio||1:t.ZE||1;else{const t=bt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=bt.devicePixelRatio||1)}this.HE=e,t.$n=!0===t.$n,this.DE=!1!==t.QE,this.JE=!1!==t.KE,this.qE=t.qE||!1;let i=!1;if(t.UE)if("string"==typeof t.UE){const e=bt.document.getElementById(t.UE);if(!e)throw new Error(`Canvas "${t.UE}" doesn't exist.`);this.UE=e,i=!0}else this.UE=t.UE,i=!0;else this.UE=bt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.tz&&t.tz){const e=this.UE.getContext("webgl",{...s,antialias:!!t.QE})||this.UE.getContext("experimental-webgl",{...s,antialias:!!t.QE});this.gl=e,this.iz=!1}else{const t=this.UE.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.iz=!0}if(!this.gl)throw new yt("No WebGL context available."+((null==t?void 0:t.tz)?`\nSelected explicit target: WebGL ${t.tz}`:""));const r=[];if(this.sz={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.sz).forEach((t=>{null===this.sz[t]&&r.push(t)})),this.iz)this.ez=!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.ME=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.ez=!!e.OES_texture_float,this.gl1={ctx:this.gl,sz:t,optional:e}}const n=r;if(n.length>0&&!1!==t.$n){const t=bt.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=bt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),bt.document.body.appendChild(t),t.appendChild(e),bt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.hz=this.qE?this.rz(this.iz?this.$E.bind(this):this.OE.bind(this)).bind(this):this.nz(this.iz?this.jE.bind(this):this.YE.bind(this)).bind(this),bt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.UE&&this.oz()};this.Qn=new bt.ResizeObserver(t.bind(this)),this.Qn.observe(this.UE)}if(this.az=((t,e)=>{const i=t,s=new Map,r=new Map,n=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},h=(t,i,s=[])=>{const r=[],n=[],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&&n.push(...e),t=t.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.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 n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:t=`${r.join("\n")}\n${t}`,info:o}};return(...t)=>{const a=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,y,p;try{const e=bt.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(" "),r=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),n=`vert: ${s} frag: ${r}`;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(h||(o=t.defaultVertexShader)),t.vertexShader){if(o&&h&&o!==t.vertexShader)throw new jg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,n,t);o=t.vertexShader,h=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(a||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&a&&u!==t.fragmentShader)throw new jg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,n,t);u=t.fragmentShader,a=!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 jg("No vertex shader template defined",n);if(!u)throw new jg("Fragment shader not defined",n);return{id:n,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:r,template:u,modifiers:c},hints:d}})(l,a);const x=n.get(u.id);if(c="new",x)return c="existing",g=x.vertexShaderSrc,m=x.fragmentShaderSrc,x;const S=u.vertexShader.id;let A=s.get(S);if(A)g=A.src,d="existing";else{d="new";const t=new Fg(u.vertexShader.modifiers).build(im[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,y=r,A=new nm(S,e,i,r),s.set(S,A),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)m=b.src,f="existing";else{f="new";const t=sm[v.template],e=new Fg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);m=s,p=n,b=new om(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const E=new hm(A,b,i,u);return n.set(u.id,E),o.programs+=1,o.totalMs+=bt.performance.now()-e,E}catch(t){throw me(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 bt.alert(t),new Error(t)}))}}})(this.gl,!this.iz),this.qR=(()=>{const t=bt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new yt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,r,n)=>{const o=`${s.style} ${s.weight} ${s.size*r}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const h=e.measureText(i);if(0===h.width)return;const a=void 0!==h.actualBoundingBoxLeft&&void 0!==h.actualBoundingBoxRight?Math.ceil(h.actualBoundingBoxLeft+h.actualBoundingBoxRight):Math.ceil(h.width),l=h.width,c=Math.round(s.size*r),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",n?(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 y=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),bt.addEventListener("resize",this.LE,{passive:!0}),!this.iz){if(this.wE=this.az(em["2DCompose"],em.Color({dataType:"texture-coord-calc-gpu"}),em.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.wE.dE)throw new yt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.wE.dE,"uColorTexture");if(!e)throw new yt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.wE.dE,"uMatrix");if(!i)throw new yt("Unable to setup composition shader! Failed to find uMatrix");this.TE=e,this.FE=i,this.IE=t.getAttribLocation(this.wE.dE,"aPos"),this.CE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.CE),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.kE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.kE),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)}}rz(t){return e=>{this._E=null;const i=this.gl.canvas,s=Array.from(this.xE.values());this.PE=!1,s.forEach((s=>{const r=s.NE();(this.j.x{this._E=null,"style"in this.gl.canvas&&!this.Yn.fz&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.UE.clientHeight,r=this.UE.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.HE&&i.height===s*this.HE||(i.width=r*this.HE,i.height=s*this.HE);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.xE.values());this.PE=!1,h.sort(((t,e)=>t.Az()-e.Az())).forEach((t=>{t.rn&&t.dz(e)})),t(n,o,r,s,h),this.PE&&this.oz()}}oz(t){return!this.PE&&t&&(this.PE=!0),this._E||this.Xi||(this._E=bt.requestAnimationFrame(this.hz)),this}gz(t){const e=this.BE();return t.Wr.setAttribute("data-lcjs-engine-id",e),this.vE.set(e,t),t.pz(this.vE.size-1),t.VE(!0),this.xE.set(e,t),this.cz&&this.cz.observe(t.Wr),this.RE&&clearTimeout(this.RE),this.RE=setTimeout((()=>this.Qr()),0),this}mz(t){const e=t.Wr.getAttribute("data-lcjs-engine-id");return e?(this.vE.delete(e),this.xE.delete(e),this.cz&&this.cz.unobserve(t.Wr),t.Wr.removeAttribute("data-lcjs-engine-id"),this):this}Qr(){if(this.cz){const t=this.cz.takeRecords();for(let e=0;efunction(t,e){if(t===e)throw new Error("Cannot compare node with itself");const i={a:fm(t),b:fm(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 r=dm(cm(i.a)),n=dm(cm(i.b));if(r===n&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let r=t.length;for(;r--;){const i=t[r];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(r-n)}(t.Wr,e.Wr))).forEach(((t,e)=>t.pz(e))),this.oz(!0),this}fP(){return this.oz(),this}yz(){this.Xi||this.vE.forEach((t=>t.hp.layout()))}U(){var t;if(this.Xi)return;this.Xi=!0,super.U(),this._E&&(bt.cancelAnimationFrame(this._E),this._E=null),this.PE=!1,this.Qn&&(this.Qn.disconnect(),this.Qn=void 0),this.cz&&(this.cz.disconnect(),this.cz=void 0),bt.removeEventListener("resize",this.LE),this.LE=void 0,this.vE.forEach((t=>{t.U()})),this.vE.clear(),Array.from(this.bE.values()).forEach((t=>{t.OR(!0)})),this.bE.clear();const e=this.gl;e.deleteBuffer(this.CE),e.deleteBuffer(this.kE),this.UE&&!this.Yn.UE?(this.UE.width=1,this.UE.height=1,null===(t=this.UE.parentElement)||void 0===t||t.removeChild(this.UE),this.UE=void 0):this.UE=void 0,this.az=void 0,this.qR=void 0,this.hz=()=>{},this.sz.WEBGL_lose_context&&this.sz.WEBGL_lose_context.loseContext()}}const ym=(t,e,i,s)=>r=>{const n={theme:mg,...i,...r},o=t(n),h=e||s?yg(o,s):void 0,a=new Ff(o.Yn,r,o,o.U.bind(o),h);return o.co((t=>a.VL(t))).uo((()=>a.Z())).vs(),a},pm=(t,e)=>{t.co((t=>{e.Fe(t)})).uo((()=>e.Z())).vs()},xm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Jh(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h);return pm(o,a),a},Sm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Vc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},Am=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Ud(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},vm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Zc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},bm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:Oa)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Mm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:yd)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,!0!==(null==r?void 0:r.disableAnimations)&&!1!==(null==r?void 0:r.animationsEnabled));return pm(o,a),a},Em=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:nd)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},wm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:Ed)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Tm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Rl(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r,void 0);return pm(o,a),a},km=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Sl(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Cm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new ff(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0);return pm(o,a),a},Rm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Ef(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Im=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Uc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},Fm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Qf(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a};function Dm(t,i,s,r,n,o){let h=i.x.dt(t.max.x),a=i.x.dt(t.min.x),l=i.y.dt(t.max.y),u=i.y.dt(t.min.y),c=h-a,d=l-u;if(c<1){const t=(a+h)/2;a=t-.5,h=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,y=c-g,p=d-m,x=g>y?[y,g]:[g,y],S=m>p?[p,m]:[m,p];let A,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(A=x[0]/c,v=S[0]/d,n===e.GradientShape.circle){const t=Math.min(A*f,v);b=t,M=t}else b=A*f,M=v;break;case e.GradientExtent.farthestSide:if(A=x[1]/c,v=S[1]/d,n===e.GradientShape.circle){const t=Math.max(A*f,v);b=t,M=t}else b=A*f,M=v;break;case e.GradientExtent.closestCorner:if(v=S[0]/d,n===e.GradientShape.circle){A=x[0]/c*f;const t=Math.sqrt(A*A+v*v);b=t,M=t}else{A=x[0]/c;const t=Math.sqrt(A*A+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=S[1]/d,n===e.GradientShape.circle){A=x[1]/c*f;const t=Math.sqrt(A*A+v*v);b=t,M=t}else{A=x[1]/c;const t=Math.sqrt(A*A+v*v);b=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(b,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Lm(t,e,i,s){const r=e.x.dt(t.max.x),n=e.x.dt(t.min.x),o=e.y.dt(t.max.y),h=e.y.dt(t.min.y),a=r-n,l=o-h,c=Math.abs(a*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(a/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(a/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[n*s,h*s,a*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class Pm{constructor(t){this.ER=t}}class _m{constructor(){this.Sz=new Array,this.vz=t=>(this.Sz.push(t),t),this.xz=this.vz(new Map),this.bz=this.vz(new Map),this.Mz=this.vz(new Map),this._z=this.vz(new Map),this.wz=this.vz(new Map),this.Cz=this.vz(new Map),this.kz=this.vz(new Map)}Tz(){this.Sz.forEach((t=>{t.forEach((t=>t.Tz())),t.clear()}))}}const Vm=(t,e,i)=>()=>{t.Fz=e,i&&i()},Bm=(t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,y=1;switch(n){case e.ImageFitMode.Fill:u{this.Lz=!0,this.Oz()})),this.nc.addEventListener("error",(()=>{this.Rz=!0})),this.nc.complete&&(this.Lz=!0,this.Oz());else if(this.nc instanceof bt.HTMLVideoElement){const t=this;this.nc.addEventListener("canplay",(function(){t.Pz=this.videoHeight,t.Iz=this.videoWidth,t.Lz=!0,t.Oz()}),!0),this.nc.addEventListener("play",Vm(this,!0,(()=>this.Oz()))),this.nc.addEventListener("playing",Vm(this,!0,(()=>this.Oz()))),this.nc.addEventListener("pause",Vm(this,!1)),this.nc.addEventListener("ended",Vm(this,!1)),this.nc.readyState>=1&&(this.Iz=this.nc.videoWidth,this.Pz=this.nc.videoHeight,this.Fz=!this.nc.paused,this.Lz=!0,this.Oz())}else this.Lz=!0,this.Oz()}ZR(t){0===this.zz.size&&this.Lz&&this.Oz(),this.zz.add(t)}QR(t){this.zz.delete(t),0===this.zz.size&&this.unbindResources()}Nz(t){this.Ez.add(t),this.Bz&&(t(),this.Gz(t))}Gz(t){this.Ez.delete(t)}Oz(){if(this.Rz||this.Bz||!this.Lz)return;const t=this.cE.gl;if(!this.Vz&&this.nc&&t){this.Vz=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.Vz),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.nc,o=this.Iz>0?this.Iz:n.width,h=this.Pz>0?this.Pz:n.height;t.texImage2D(t.TEXTURE_2D,e,i,s,r,n),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.Iz=o,this.Pz=h,t.bindTexture(t.TEXTURE_2D,null)}this.Bz=!0,this.Ez&&this.Ez.forEach((t=>{t(),this.Gz(t)}))}Ds(){const t=this.cE.gl;if(!this.Rz&&this.Bz&&this.Vz){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.nc;n&&(t.bindTexture(t.TEXTURE_2D,this.Vz),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}Wz(){return this.Vz}unbindResources(){return this.Bz&&(this.Vz&&(this.cE.NR(this.Vz),this.Vz=null),this.Bz=!1),this}}class Nm extends Gr{constructor(t,e,i){super(t.cs,e,i),this.sS=!0,this.Zy={},this.tS=p(Gn),this.Ts=t,this.ft=t.ft}Uz(){var t;return this.tS.o&&this.tS._().type!==(null===(t=this.Yz)||void 0===t?void 0:t.type)}oS(t){return this.sS=t,this}$z(t){return this.Zy=t,this}}class Om{constructor(t){this.SV=[],this.ER=t}vV(t,e){((t,e,i,s)=>{const r=t.Xz(),n=Math.round(Math.min(i.spread,10)*r),o=Math.round(Math.min(i.blur,10)*r),h={x:Math.round(i.offset.x*r),y:Math.round(i.offset.y*r)},a=t.jz(),l=t.Zz(),u=t.Qz(),c=t.Jz(),d=t.Kz();t.qz("disabled"),t.oS(!1),t.tV(!1);const f=e.iV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.Xz(),o=t.sV();t.eV(r.FRAMEBUFFER,s.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,s.depthBuffer),r.bindTexture(r.TEXTURE_2D,s.texture),r.clearDepth(1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);const h=s.sizeDpr;t.hV(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof Hr?s=e.Ts.wp():e instanceof Nm&&(s=e.Ts.qv()),s){const e=s.x+i.left,r=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),h=Math.max(s.height-(i.bottom+i.top),0);t.rV(e*n,r*n,o*n,h*n)}else t.tV(!1);e.VL(2)})),t.eV(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.tV(!1)})(t,s,{left:g+(h.x<0?-h.x:0),top:g+(h.y>0?h.y:0),right:g+(h.x>0?h.x:0),bottom:g+(h.y<0?-h.y:0)},f);let m=f;const y=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;ize(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=Je(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Hr||t instanceof Nm?t.Ts.nV(t):_e;if(pe(e))return _e;const r={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 r.max.x<=r.min.x||r.max.y<=r.min.y?_e:r})).filter((t=>!pe(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=li(t.min,s),i=li(t.max,s),r=e,n=i;o[h+0]=e.x,o[h+1]=e.y,o[h+2]=r.x,o[h+3]=r.y,o[h+4]=i.x,o[h+5]=e.y,o[h+6]=n.x,o[h+7]=r.y,o[h+8]=i.x,o[h+9]=i.y,o[h+10]=n.x,o[h+11]=n.y,o[h+12]=i.x,o[h+13]=i.y,o[h+14]=n.x,o[h+15]=n.y,o[h+16]=e.x,o[h+17]=i.y,o[h+18]=r.x,o[h+19]=n.y,o[h+20]=e.x,o[h+21]=e.y,o[h+22]=r.x,o[h+23]=r.y,h+=24})),{vertexBuffer:t.oV(o),vertexCount:n}})(t,s,{left:y+(h.x<0?-h.x:0),top:y+(h.y>0?h.y:0),right:y+(h.x>0?h.x:0),bottom:y+(h.y<0?-h.y:0)},e.aV()),x=e.iV(f,m),S=t.az(em["2D"],em.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl,h=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,((h,a,l,u)=>(t.ZR(s),n&&n(h),t.fV(h("uIsHighlighted"),0).gR(h("uHighlightColorOffset"),R).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),i.uniforms.AV()).cV(h("uDisp"),i.uniforms.gV()).cV(h("uScaling"),[i.size.x,i.size.y]).cV(h("uTranslationAxis"),[0,0]).uV(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Zm(o.TRIANGLES,r.vertexCount,0),!0))),t.eV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,x,S,p,((e,i,s,r)=>(t.cV(e("uOffsetPx"),[h.x,h.y]),!0))),m=x,t.tV(l),t.pV(d);const A=t.az(em["2D"],em.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r)=>{const n=t.gl,o={x:t.cs.ai().x,y:t.cs.ai().y};t.hV(0,0,o.x*t.Xz(),o.y*t.Xz());const h=ut.d2({scaleXYConstructor:_i}).tt(o).Oi(0,o.x).Ni(0,o.y),a=new Ym;a.mV(h),t.lV(i,((h,l,u,c)=>(t.ZR(i),r&&r(h),t.fV(h("uIsHighlighted"),0).gR(h("uHighlightColorOffset"),R).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),a.AV()).cV(h("uDisp"),a.gV()).cV(h("uScaling"),[o.x,o.y]).cV(h("uTranslationAxis"),[0,0]).uV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Zm(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,A,p,((e,s,r,n)=>(t.dV(e("uTextureFirstGlowPass"),x.texture,1).gR(e("uGlowColor"),i.color),!0))),t.hV(a.x,a.y,a.width,a.height),t.qz(u),t.oS(c),t.yV(p.vertexBuffer)})(this.ER,this,e,t)}aV(){const t=this.ER.cs.ai();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}iV(...t){const e=this.SV,i=this.aV(),s={x:Math.ceil(i.x*this.ER.Xz()),y:Math.ceil(i.y*this.ER.Xz())},r=this.ER.gl,n=e.find((e=>!t.includes(e)));if(n)return n.sizeDpr.x===s.x&&n.sizeDpr.y===s.y||(n.size=i,n.sizeDpr=s,r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindRenderbuffer(r.RENDERBUFFER,n.depthBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),n.scale.tt(i).Oi(0,i.x).Ni(0,i.y),n.uniforms.mV(n.scale)),n;const o=r.createTexture(),h=this.ER.xV(),a=this.ER.bV();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.ER.sV();this.ER.eV(r.FRAMEBUFFER,h),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0),r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a),r.bindTexture(r.TEXTURE_2D,null),this.ER.eV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=ut.d2({scaleXYConstructor:_i}).tt(i).Oi(0,i.x).Ni(0,i.y),c=new Ym;c.mV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}U(){[this.SV].forEach((t=>{t.forEach((t=>{this.ER.MV(t.depthBuffer),this.ER._V(t.frameBuffer),this.ER.NR(t.texture)})),t.length=0}))}}class Um{constructor(t,i,s,r,n=!0){this.wV=new _m,this.CV=new Map,this.kV=new Map,this.TV=[],this.ZE=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(bt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.sS=!1,this.cV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.FV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.IV=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.PV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.DV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.BV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.gR=(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.LV=(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 yt("Could not bind a texture.")},this.RV=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,s=Float32Array)=>{const r=t.length,n=this.EV(r,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof s?t:new s(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new yt("Could not create vertex buffer")},this.zV=(t,e,i,s=Float32Array)=>{const r=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),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),r)return r;throw new yt("Could not create vertex buffer")},this.VV=(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.OV=(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.NV=(t,e)=>{const i=t.length,s=this.EV(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 yt("Could not create index buffer")},this.GV=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 yt("Could not create float buffer")},this.WV=(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.UV=(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 r=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let n=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),n+=e.size}if(void 0!==e)for(let t=0;t-1&&this.YV(s,e)}return this},this.HV=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.$V=(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.XV=(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.YV(t,i)),this),this.jV=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.ZV=null,this.Zm=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.QV=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.JV=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.KV=(t,e,i,s,r=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,r,i,s),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.YV=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.qV=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=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.Zz();o&&this.tV(!1),t(),o&&this.tV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.eV(this.gl.FRAMEBUFFER,n)},this.Gt=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.tO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.ZR=t=>(this.gl.useProgram(t.dE),this),this.iO=!1,this.sO=[],this.cs=t,this.dA=i,this.cs=t,this.gl=s.ctx,this.eO=s.antialias,this.hO=!!this.cs.Jr.ME&&s.lineAntialias,this.ez=this.cs.Jr.ez,this.rO=new Map,this.gl1=this.cs.Jr.gl1,this.gl2=this.cs.Jr.gl2,n&&(this.pV(!0),this.nO()),this.sz=this.cs.Jr.sz,this.VR=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.YR=this.oO(),this.az=this.cs.Jr.az,this.aO=new Xm(this),this.qR=this.cs.Jr.qR,this.lO=new Om(this),this.bE=this.cs.Jr.bE,this.uO=this.oV([0,0,1,0,1,1,0,1]),this.cO=this.oV([0,0,1,0,0,1,0,1,1,0,1,1])}qz(t){return t!==this.dO&&(this.dO=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}Qz(){return this.dO||"disabled"}oS(t){return t!==this.sS&&(this.sS=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}Jz(){return this.sS}fO(t){return this.ZE=t,this}Xz(){return this.ZE}EV(t,e){let i;if(e){const s=this.rO.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.yV(e)}return i||(i=this.gl.createBuffer(),this.rO.set(i,{size:t})),i}AO(t,e=this.gl.RGBA,i=!1,s,r,n=!1,o=this.gl.UNSIGNED_BYTE,h=e){const a=this.gl.createTexture();if(!a)throw new yt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),t&&null===r?this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,e,o,t):r&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,r.x,r.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),a}NR(t){this.gl.deleteTexture(t)}xV(){const t=this.gl.createFramebuffer();if(!t)throw new yt("Couldn't reserve Framebuffer.");return t}eV(t,e){this.ZV=e,this.gl.bindFramebuffer(t,e)}sV(){return this.ZV}_V(t){this.gl.deleteFramebuffer(t)}bV(){const t=this.gl.createRenderbuffer();if(!t)throw new yt("Couldn't reserve Render buffer.");return t}MV(t){this.gl.deleteRenderbuffer(t)}hV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.gO&&t===this.gO.x&&e===this.gO.y&&i===this.gO.width&&s===this.gO.height||(this.gO={x:t,y:e,width:i,height:s}),this}jz(){return this.gO||{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.pO||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.pO=t),this}pV(t){return t!==this.iO&&(this.iO=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}Kz(){return this.iO}nO(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)}Zz(){return void 0!==this.pO&&this.pO}lV(t,e){const i=new Wm(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}yV(t){t&&(this.gl.deleteBuffer(t),this.rO.delete(t))}mO(t,e,i){this.cV(t.uniform("uCenter"),e.center).cV(t.uniform("uDistance"),e.distance).IV(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._O.buffer;this._O&&(this.yV(this._O.buffer),this._O=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.sO.splice(this.sO.indexOf(l),1)}))}IO(t,e,i,s,r,n,o,h){const a=this.gl,l=this.sV();this.eV(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.eV(this.gl.FRAMEBUFFER,l)}PO(t){const e=this.kV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new yt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let r=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}EO(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.nc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.oV(o(t.texture.Iz,t.texture.Pz,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.QR(t),this.yV(i.texCoordsBuffer));const r=this.SO(h);r.ZR(t);const n=s?s.getSourceMissingColor():ks.color;e={texture:r,source:h,texCoordsBuffer:this.oV([]),sourceMissingTexture:this.AO(new Uint8Array([n.getR(),n.getG(),n.getB(),n.getA()]),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{e&&h&&(l(e),this.cs.vs())}},r.Nz(e.textureReadyCallback),l(e)}return e&&e.texture.Bz&&e.texture.Dz&&e.texture.Fz&&(e.texture.Ds(),this.cs.vs()),n&&e&&e.texture.Bz&&l(e),e}i&&this.zO(t,i)}zO(t,e){e&&(e.texture.QR(t),e.texture.Gz(e.textureReadyCallback),this.NR(e.sourceMissingTexture),this.yV(e.texCoordsBuffer))}VO(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.ft,a=this.Xz();this.fV(r("uIsHighlighted"),1===e||2===e?0:i.Vo).gR(r("uHighlightColorOffset"),1===e||2===e?I:i.Wo).fV(r("uRenderEffectMask"),2===e?1:0).cV(n("uRatioPxClip"),[2/this.cs.ai().x,2/this.cs.ai().y]).fV(n("uDevicePixelRatio"),a),h instanceof _i||h instanceof $c?this.cV(r("uScale"),s.uniforms.AV()).cV(r("uDisp"),s.uniforms.gV()).cV(n("uScaleStart_highpart"),s.uniforms.OO()).cV(n("uScaleStart_lowpart"),s.uniforms.NO()):h instanceof Vi&&this.cV(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).cV(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).cV(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).cV(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const l=!0===s.coordsHighPrecision;if(s.coordsX)if(l){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.XV(o("aPosX"),s.coordsX);if(s.coordsY)if(l){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.XV(o("aPosY"),s.coordsY);if(1===e)this.gR(r("uColor"),s.mousePickingColor);else{if(s.fillStyleSolid&&this.gR(r("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this.XV(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.YV(t,s.lookupValueAttribDivisor)}this.RO(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.yO(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.mO(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.YV(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.Wz();this.gR(n("uColor"),s.fillStyleImage.getSurroundingColor()).dV(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).uV(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).RV(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.Wz();this.dV(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).uV(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return!0}GO(t,e,i){if(t)return Lm(i||e.$o(),e.ft,t.getAngle(!0),this.Xz())}WO(t,e,i){if(t)return Dm(i||e.$o(),e.ft,t.getPosition(),t.getExtent(),t.getShape(),this.Xz())}}const Gm=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void bt.setTimeout(o,r)};bt.setTimeout(o,0)}))})(t,h,{retryTimeout:10}).then((()=>(t.deleteSync(h),t.bindBuffer(e,i),t.getBufferSubData(e,s,r,n,o),t.bindBuffer(e,null),r))).catch((t=>{throw t}))};class Ym{mV(t){if(t instanceof _i||t instanceof $c){const e=t.Si();this.UO=e.x.scaling,this.YO=-e.x.displacement,this.HO=e.y.scaling,this.$O=-e.y.displacement,this.XO=e.x.highPrecisionOffset,this.jO=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.ZO=e.y.highPrecisionOffset,this.QO=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Vi&&(this.MixedScaleXY=t.Si());return this}gV(){return[this.YO,this.$O]}AV(){return[this.UO,this.HO]}OO(){return[this.XO,this.ZO]}NO(){return[this.jO,this.QO]}}class Hm{constructor(){this.UO=0,this.HO=0,this.JO=0,this.YO=0,this.$O=0,this.KO=0}qO(t){return this.UO=t.ht(),this.YO=t.getInnerStart()+.5*this.UO*t.rt(),this}tN(t){return this.HO=t.ht(),this.$O=t.getInnerStart()+.5*this.HO*t.rt(),this}iN(t){return this.JO=t.ht(),this.KO=t.getInnerStart()+.5*this.JO*t.rt(),this}AV(){return[this.UO,this.HO,this.JO]}gV(){return[this.YO,this.$O,this.KO]}sN(t,e,i,s,r){const n=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=pl.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Xm{constructor(t){this.ER=t}VL(t,e,i,s,r,n=0){const o=this.ER,h=void 0===s;if(!(s=s||o.xV()))throw new yt("Could not bind a framebuffer.");const a=o.jz(),l=o.Kz();o.pV(!1),o.qV((()=>{o.hV(0,0,i.x,i.y),t()}),s,e,n),h&&o._V(s),this.ER.tO(r),this.ER.hV(a.x,a.y,a.width,a.height),o.pV(l)}}class Wm{constructor(t,e){this.eN=[],this.hN=[],this.uniform=t=>{const e=this.shader.pE(t);return this.hN.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.mE(t);return this.hN.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.yE(t);return this.eN.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.eN)this.glUtils.HV(t.location),this.glUtils.YV(t.location,0)}}class jm extends Hr{constructor(t,e,i,s,r){super(t,e,i,s),this.rN=new Map,this.nN=t,this.oN=e,this.ER=t.aN(),this.lN=r,this.oN=e}uN(t){return!1}OR(){return this}VL(t){if(!this.lN||0!==t||0===this.rN.size)return this;const e=Array.from(this.rN.values()).map((t=>t.cN.filter((t=>t.dN)).map((t=>t.ss)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.lN;return this.ER.lO.vV(e,i),this}Ds(){return this}bt(){return 0}xt(){return 0}_t(){return 0}Mt(){return 0}xl(){return 0}bl(){return 0}rs(t,e){const i={cN:[]},s=(t,e)=>{const s={ss:t||[],dN:void 0===e||e};i.cN.push(s);const r={As:t=>(s.ss=t,r),Ss:t=>(s.dN=t,r),xs:()=>s.dN};return r},r={};Object.keys(e).forEach((t=>{const i=e[t],n=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,h=s(n,o);r[t]=h}));const n={yg:s,...r};this.rN.set(t,i);const o=t.onDispose((()=>{this.rN.delete(t),t.offDispose(o)}));return n}}const $m=(t,e,i)=>((t,e,i)=>{const s=[];let r=0;const n=ni(e,i/2);let o,h,a,l,c=t[t.length-1],d=0;for(let i=0;i0&&(c=t[i-1]),Mt(o,c)&&(c=oi(o,ii(ni(hi(h,o),-1)))),Mt(o,h)&&(h=oi(o,ii(ni(hi(c,o),-1))));const f=li(c,e),g=li(o,e),m=li(h,e),y=ii(hi(g,f)),p=ii(hi(m,g)),x=oi(y,p),S=u(-x.y,x.x),A=u(-y.y,y.x),v=1/ci(S,A),b=ri(S),M=ii(hi(y,p)),E=Math.sign(ci(S,M))||1,w=ai(S,ni(n,v)),T=ai(S,ni(n,-v));if(b<1||v===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},a={x:0,y:0};const l=u(-p.y,p.x),f=Math.sign(ci(y,S))||E,g=ai(A,ni(n,f)),m=ai(l,ni(n,f));1===E?(t=g,e=T,i=m,a=T):(t=w,e=g,i=w,a=m);const x=4*Xe(c,o),b=4*Xe(o,h);(v>x||v>b)&&(1===E?(t=g,e=m,i=m,a=g):(t=m,e=g,i=g,a=m));const M=oi(o,t),k=oi(o,e),C=oi(o,i),R=oi(o,a);s[r]=M,r+=1,s[r]=k,r+=1,s[r]=C,r+=1,s[r]=R,r+=1,d=4}else{const t=oi(o,w),e=oi(o,T);s[r]=t,r+=1,s[r]=e,r+=1,d=2}l=a,a=t[i]}return s[r]=s[0],r+=1,s[r]=s[1],r+=1,[s,d,[l,a]]})(t,e,i)[0];class Zm extends on{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.fN=_e,this.AN=_e,this.gN=Tg({arcStyleSolid:()=>Y(this.be)&&this.be,arcStyleRadialGradient:()=>et(this.be)&&this.be,arcStyleLinearGradient:()=>rt(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}yN(t,e){let i=0,s=Array(0),r=0;if(void 0!==e){const r=t.length,n=Array(r+e.length);let o=0,h=0;for(;o0?md(this.ca._(),this.Wl._(),this.Ii._(),this.Ul._()*l/100,this.Yl._()*l/100,a)[0]:[this.ca._()],d=h.length-1;if(2===d){const t=(h[d-1].x+h[1].x)/2,e=(h[d-1].y+h[1].y)/2;this.Xl=u(t,e)}else{const t=Math.floor(d/2);this.Xl=u(h[t].x,h[t].y)}this.jl=h[1];const f=h.length-1;this.Zl=h[f],this.Hl._()&&(h.shift(),c.shift());let g=!1;(this.ca.o||this.Wl.o||this.Ii.o||this.Ul.o||this.Yl.o||this.Hl.o||this.$l.o||s)&&(this.AN=m(u(this.Ia().x-n,this.Ia().y-o),u(this.Ia().x+n,this.Ia().y+o)),g=!0,this.ca.o=!1,this.Wl.o=!1,this.Ii.o=!1,this.Ul.o=!1,this.Yl.o=!1,this.Hl.o=!1,this.$l.o=!1);const y=this.ia();(g||y)&&this.be!==z&&(this.Hl._()?(this.vN&&this.ER.yV(this.vN),[this.xN,this.vN,this.bN,this.MN]=this.yN(h,c)):(this.vN&&this.ER.yV(this.vN),[this.xN,this.vN,this.bN,this.MN]=this.yN(h,void 0)),et(this.be)?this._N=Dm(this.AN,this.ft,this.be.getPosition(),this.be.getExtent(),this.be.getShape(),this.ER.Xz()):rt(this.be)?this.wN=Lm(this.AN,this.ft,this.be.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0));const p=this.gN.arcStyleSolid(y),x=this.gN.arcStyleLinearGradient(y),S=this.gN.arcStyleRadialGradient(y),A=p||x||S;y&&(this.CN=A?this.ER.az(em["2D"],em.Color({dataType:et(this.be)||rt(this.be)?["gradient",this.be]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.ra(this.be));const v=this.Me;if(qi(v)&&(g||this.aa(v.getThickness())||s)){this.Hl._()?360===i?(h.pop(),c.pop(),[this.kN,this.TN]=this.SN(h,void 0,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0),[this.IN,this.PN]=this.SN(c,void 0,v.getThickness(),r),this.DN&&this.IN?this.ER.OV(this.DN,this.IN,!0):!this.DN&&this.IN?this.DN=this.ER.oV(this.IN,!0):this.DN&&!this.IN&&(this.ER.yV(this.DN),this.DN=void 0)):([this.kN,this.TN]=this.SN(h,c,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0),this.IN&&(this.DN&&this.ER.yV(this.DN),this.DN=void 0,this.PN=0)):(360===i&&(h.shift(),h.pop()),[this.kN,this.TN]=this.SN(h,void 0,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0));const t=v.getFillStyle();et(t)?this.LN=Dm(this.AN,this.ft,t.getPosition(),t.getExtent(),t.getShape(),this.ER.Xz()):rt(t)?this.RN=Lm(this.AN,this.ft,t.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.EN=t===z?void 0:this.ER.az(em["2D"],em.Color({dataType:et(t)||rt(t)?["gradient",t]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})),this.la(v)}if(g){let t=1,e=1;qi(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.fN=m(u(this.AN.min.x-t,this.AN.min.y-e),u(this.AN.max.x+t,this.AN.max.y+e))}this.zN=e&&A?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.VN=e&&this.Me!==ot?this.VN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0}return this}VL(t){if(this.ha()){const e=1===t?this.zN:this.CN,i=this.be,s=this.vN;e&&s&&this.ER.ZR(e).lV(e,((e,r,n,o)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(o("uScaleStart_highpart"),this.lE.OO()).cV(o("uScaleStart_lowpart"),this.lE.NO()).xO(n,s,this.ft.wi(),void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(i))this.ER.gR(e("uColor"),i.getColor());else if(et(i)){if(!this._N)return!1;this.ER.mO(n,this._N,i)}else if(rt(i)){if(!this.wN)return!1;this.ER.yO(n,this.wN,i)}return this.ER.Zm(this.MN,this.bN),!0}));const r=this.Me;qi(r)&&(void 0!==this.FN&&this.ON(t,this.FN,this.TN,r),void 0!==this.DN&&this.ON(t,this.DN,this.PN,r))}return this}ON(t,e,i,s){const r=1===t?this.VN:this.EN,n=s.getFillStyle();r&&this.ER.ZR(r).lV(r,((r,o,h,a)=>{if(this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()).xO(h,e,this.ft.wi(),void 0).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(r("uColor"),this.mN);else if(Y(n))this.ER.gR(r("uColor"),n.getColor());else if(et(n)){if(!this.LN)return!1;this.ER.mO(h,this.LN,n)}else if(rt(n)){if(!this.RN)return!1;this.ER.yO(h,this.RN,n)}const l=s.getThickness(),u=-1===l||1===l;return this.ER.Zm(u?this.ER.gl.LINE_LOOP:this.ER.gl.TRIANGLE_STRIP,i),!0}))}uN(t){return this.pN===t&&{}}OR(){return this.NN&&(this.ER.yV(this.NN),this.NN=void 0),this.GN&&(this.ER.yV(this.GN),this.GN=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.DN&&(this.ER.yV(this.DN),this.DN=void 0),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this}bt(){return this.AN.max.x}xt(){return this.AN.min.x}_t(){return this.AN.max.y}Mt(){return this.AN.min.y}xl(){return we(this.Me)}bl(){return we(this.Me)}}class Km{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}WN(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}UN(){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}YN(){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}HN(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.UN(),this}$N(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.YN(),this}XN(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Km).WN(t))(),qm=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Jm.UN(),n.push(t,e),r.push(Jm.first,Jm.second,Jm.third),h=void 0,o=void 0,r.push(Jm.third,Jm.fourth,Jm.second),a=Jm.third,Jm.YN(),l&&n.push(i,s),[o,h,a]),Qm=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Jm.UN(),o.push(t,e),r.push(Jm.first,Jm.second,Jm.third);const c=Si(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Jm.third,Jm.fourth,Jm.fifth),l=Jm.fourth),Jm.YN(),u&&o.push(i,s),[h,a,l]},ty=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Jm.UN(),r.push(t,e),s.push(Jm.first,Jm.second,Jm.third),n=i,o=void 0,h=Jm.third,l?r.push(i):a=!0,[n,o,h,a]),ey=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Jm.UN(),Jm.UN()):a>0&&(Jm.UN(),u>0&&(u-=1)),n.push(t),r.push(Jm.first,Jm.second,Jm.third),a=Jm.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),iy=(t,e=0)=>{Jm.WN(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],y=!1,p=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=qm(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Qm(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,y]=ty(g,m,d,o,h,a,l,u,y,t):d.y===f.y?(a=g,y&&(h.push(g),y=!1,Jm.UN()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=ey(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=ey(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class sy extends nn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.ZN=0,this.Na=Array(),this.QN=0,this.JN=new Uint16Array(0),this.KN=new Uint16Array(0),this.gN=Tg({hightFillSolid:()=>Y(this.be)&&this.be,hightFillRadialGradient:()=>et(this.be)&&this.be,hightFillLinearGradient:()=>rt(this.be)&&this.be,hightFillPaletted:()=>j(this.be)&&this.be,lowFillSolid:()=>Y(this.Fl)&&this.Fl,lowFillRadialGradient:()=>et(this.Fl)&&this.Fl,lowFillLinearGradient:()=>rt(this.Fl)&&this.Fl,lowFillPaletted:()=>j(this.Fl)&&this.Fl}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}Ds(){const t=this.ea(),e=this.Lo._(),i=this.Ja;if(this.ha()){this.lE.mV(this.ft);const s=this.ft instanceof Vi==0,r=s?this.ft.Ui():void 0,n=this.Bl(),o=this.ft.Gi()||t,h=i||this.wl.o||o&&"disabled"!==n.type;if(h){if(this.ZN=0,this.JN=new Uint16Array(0),this.KN=new Uint16Array(0),this.Na.length=0,this.QN=0,this.Cl>1){const[t,e,i,o]=iy([s?n.packager(this.Ml,r,.5):this.Ml,s?n.packager(this._l,r,.5):this._l]);this.ZN=o,this.JN=e,this.KN=i,this.Na=t,this.QN=t.length}this.wl.o=!1}if(this.Tl&&this.Xa[0].length>1){const[t,e]=this.Xa,i=t.length,[o,h,a,l,u]=iy([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.ZN);this.ZN=l;const c=o.length;for(let t=u;t0||this.Cl>0?1:u;s{if(this.ER.xO(o,e,this.ft.wi(),void 0).jV(r).fV(s("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(s("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(s("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(s("uScale"),this.lE.AV()).cV(s("uDisp"),this.lE.gV()).cV(h("uScaleStart_highpart"),this.lE.OO()).cV(h("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(h("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(s("uColor"),this.mN);else if(Y(i))this.ER.gR(s("uColor"),i.getColor());else if(et(i)){if(!this.iG)return!1;this.ER.mO(o,this.iG,i)}else if(rt(i)){if(!this.sG)return!1;this.ER.yO(o,this.sG,i)}else if(j(i)){const t=kg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.ER.RO(o,i.lut,t)}return this.ER.QV(this.oG),!0}))}const r=1===t?this.zN:this.qN;if(r&&this.eG&&this.hG){const i=this.eG,s=this.hG;this.ER.ZR(r).lV(r,((r,n,o,h)=>{if(this.ER.xO(o,i,this.ft.wi(),void 0).jV(s).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()).cV(h("uScaleStart_highpart"),this.lE.OO()).cV(h("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(h("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(r("uColor"),this.mN);else if(Y(e))this.ER.gR(r("uColor"),e.getColor());else if(et(e)){if(!this._N)return!1;this.ER.mO(o,this._N,e)}else if(rt(e)){if(!this.wN)return!1;this.ER.yO(o,this.wN,e)}else if(j(e)){const t=kg(e,this,void 0);if(!t&&e.lut.percentageValues)return!1;this.ER.RO(o,e.lut,t)}return this.ER.QV(this.rG),!0}))}return this}uN(t){return this.pN===t&&{}}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}Yb(t){this.ll()>0&&this.Ds();const[e,i]=this.il(),s=e.length>2&&e[1].x0&&this.Ds();const[e,i]=this.il(),s=e.length;if(0===s)return;const r=this.Il?1:0,n=s-(this.Pl?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.aG;s+=1){const r=i-s*Math.PI/this.aG;t.push(.5*Math.cos(r),.5*Math.sin(r),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.wV.Mz.get(e);return i||(i=new ry(t,e),t.wV.Mz.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),oy={AG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i)}},gG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.YV(r,1),h.enableVertexAttribArray(r)},pG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i)}},mG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.YV(r,1),h.enableVertexAttribArray(r)},VL:(t,e,i,s,r,n,o)=>{const h=t.aN(),{uniform:a,uniformOptional:l}=i,u=1/t.Yn.Xn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.fV(a("uThicknessPixels"),c).fV(l("uAALimit"),1-(c-1)/c).cV(a("uRatioPxClip"),[2/t.ai().x,2/t.ai().y]),e.ZR(i,s).Zm(o)}},hy={AG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t);const e=o("aPos_lowpart");h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},gG:(t,e,i,s,r,n)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,r,o.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},pG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),!t){const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},yG:(t,e)=>{const i=t.aN();i.Zm(i.gl.LINE_STRIP,e,0)},SG:(t,e)=>{const i=t.aN();i.Zm(i.gl.LINES,2*e,0)}};class ay extends ln{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.Ha=_e,this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t}}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.vG=this.ER.hO}Ds(){const t=this.na(),e=this.uu,i=this.gN.lineStyleSolid(t),s=this.gN.lineStyleDashed(t),r=i||s,n=this.gN.strokeFillSolid(t),o=this.gN.strokeFillLinearGradient(t),h=this.gN.strokeFillRadialGradient(t),a=this.gN.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Pi(),d=this.Fi(),f=this.Lo._(),g=this.Lo.o,y=e.O();if(s&&this.ft instanceof Vi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.lE.mV(this.ft),this.gu&&(this.xG=this.ER.oV(Jt([c,d],this.ft.wi()),!1,this.xG),this.Ha=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ha()&&r&&l&&y>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.bG=t?{type:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),this.vG?em.AliasedEdge:void 0,s&&em.StippleTextureInstanced),mousePickingShader:f?this.ER.az(em["2D"],em.MousePicking,em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),s&&em.StippleTextureInstanced):void 0,geometry:ny(this.ER,y),thickness:y,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.LN=Dm(Wr(this.Ha,{x:this.xl(),y:this.bl()},this.ft),this.ft,h.getPosition(),h.getExtent(),h.getShape(),this.ER.Xz()):o?this.RN=Lm(Wr(this.Ha,{x:this.xl(),y:this.bl()},this.ft),this.ft,o.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),s){if(t||this.gu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.MG=this.ER.oV(t,!1,this.MG)}this._G=this.ER.PO(s.getPattern())}else this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this._G=void 0;return this.Au(e),this.gu=!1,this.Lo.o=!1,this}VL(t){var e,i;const s=this.xG;if(!s)return this;const r=this.bG;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.bG)||void 0===e?void 0:e.mousePickingShader:null===(i=this.bG)||void 0===i?void 0:i.shader;return c?(this.ER.ZR(c).lV(c,((e,i,c,d)=>{if(this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(d("uScaleStart_highpart"),this.lE.OO()).cV(d("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(d("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(d("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(d("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(d("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(n)this.ER.gR(e("uColor"),n.getColor());else if(h){if(!this.LN)return!1;this.ER.mO(c,this.LN,h)}else if(o){if(!this.RN)return!1;this.ER.yO(c,this.RN,o)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ER.RO(c,a.lut,t)}if(l){if(!this.MG||!this._G)return!1;oy.gG(this.ER,c,this.MG,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.ER.cV(e("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(d("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(e("uStippleScale"),l.getPatternScale()).dV(e("uStippleTexture"),this._G.DO,1)}return oy.AG(this.ft.wi(),this.ER,s,c,this.ft.wi()?4:2,0),oy.VL(this.nN,r.geometry,c,this.vG&&1!==t,1===t,u,1),!0})),this):this}uN(t){return this.pN===t&&{}}dispose(){return super.dispose(),this.bG=void 0,this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this._G=void 0,this}OR(){return this}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return we(this.uu)}bl(){return we(this.uu)}}class ly extends un{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.wG=[],this.CG=!1,this.kG=!1,this.TG=!1,this.FG=!1,this.lE=new Ym,this.Ha=_e,this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,lineFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},lineFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},lineFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},lineIndividualPointFill:()=>{const t=this.uu.getFillStyle();return X(t)&&t}}),this.nN=t,this.oN=e,this.IG=n,this.ER=t.aN(),this.vG=this.ER.hO,this.PG=t.Yn.Zn;const{color:o,id:h}=this.IG();this.mN=o,this.pN=h}Vr(){const t=this.mu?void 0:this.IG(),e={ys:t=>this.DG(e,t),ds:t=>this.BG(e,t),zg:(t,i)=>this.LG(e,t,i),gR:t=>this.EG(e,t),Di:{x:0,y:0},Ii:{x:0,y:0},Vo:0,zG:void 0,pN:null==t?void 0:t.id,mN:null==t?void 0:t.color};return this.wG.push(e),e}Gt(){var t;return this.wG.length=0,this.CG=!0,this.Zi&&this.Fn&&(null===(t=this.cs.kn)||void 0===t?void 0:t.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember),this}VG(){return this.wG.length}_(t){const e=this.wG[t];return[e.Di,e.Ii]}py(){return this.wG}bd(t){var e;const i=this.wG.indexOf(t);i>=0&&(this.wG.splice(i,1),this.CG=!0,this.Zi&&this.Fn&&(null===(e=this.cs.kn)||void 0===e?void 0:e.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember))}DG(t,e){if(e&&!this.wG.includes(t))this.wG.push(t);else if(!e){const e=this.wG.indexOf(t);this.wG.splice(e,1)}return this.TG=!0,t}BG(t,e){return t.Vo=e,this.kG=!0,t}LG(t,e,i){return t.Di=e,t.Ii=i,this.CG=!0,t}EG(t,e){return t.zG=e,this.FG=!0,t}Ds(){const t=this.Lo._(),e=this.Lo.o,i=this.na(),s=this.uu,r=this.wG,n=this.kG,o=this.CG,h=this.TG,a=this.FG,l=this.gN.lineStyleSolid(i),u=this.gN.lineStyleDashed(i),c=l||u,d=this.gN.lineFillSolid(i),f=this.gN.lineIndividualPointFill(i),g=this.gN.lineFillRadialGradient(i),m=this.gN.lineFillLinearGradient(i),y=d||f||m||g,p=s.O(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.ft instanceof Vi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.lE.mV(this.ft);const S=o||h;if(S){const t=[];for(let e=0;e0&&e;this.bG=i?"triangulated"===x?{type:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG,ensureMinimumSegmentLength:void 0!==this.pu}),this.vG?em.AliasedEdge:void 0,u&&em.StippleTextureInstanced,em.AttributeHighlight),mousePicking:t?{shader:this.ER.az(em["2D"],this.mu?em.MousePicking:em.MousePickingAttribute,em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG,ensureMinimumSegmentLength:void 0!==this.pu}),u&&em.StippleTextureInstanced,em.AttributeHighlight)}:void 0,geometry:ny(this.ER,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:{type:"primitive",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG}),em.AttributeHighlight),mousePicking:t?{shader:this.ER.az(em["2D"],this.mu?em.MousePicking:em.MousePickingAttribute,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG}),em.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:void 0}if(u){if(i||S){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.Vo,e+=1})),this.OG=this.ER.oV(t,!0,this.OG)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.zG||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.NG=this.ER.oV(t,!1,this.NG)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.zG||f.color;for(let i=e;i{var s,r,n,o;t[e+0]=(null===(s=i.mN)||void 0===s?void 0:s.r)||0,t[e+1]=(null===(r=i.mN)||void 0===r?void 0:r.g)||0,t[e+2]=(null===(n=i.mN)||void 0===n?void 0:n.b)||0,t[e+3]=(null===(o=i.mN)||void 0===o?void 0:o.a)||0,e+=4})),this.GG=this.ER.oV(t,!0,this.GG)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{var s,r,n,o;for(let h=e;h{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(g("uScaleStart_highpart"),this.lE.OO()).cV(g("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(g("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.PG&&this.ER.cV(g("uViewportSizePx"),[this.cs.ai().x*this.ER.Xz(),this.cs.ai().y*this.ER.Xz()]),void 0!==this.pu&&this.ER.cV(e("uMinSegmentPixelVector"),[this.pu.x,this.pu.y]),this.ER.gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)if(this.mu)this.ER.gR(e("uColor"),this.mN);else{if(!r)return!1;"triangulated"===o?this.ER.uV(r,1,{location:d("aColor"),size:4}):this.ER.$V(d("aColor"),r)}else if(h)this.ER.gR(e("uColor"),h.getColor());else if(a){if(!this.NG)return!1;this.ER.uV(this.NG,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this._N)return!1;this.ER.mO(f,this._N,u)}else if(l){if(!this.wN)return!1;this.ER.yO(f,this.wN,l)}if(c){if(!this.MG||!this._G)return!1;oy.mG(this.ER,f,this.MG,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.ER.cV(e("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(g("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(e("uStippleScale"),c.getPatternScale()).dV(e("uStippleTexture"),this._G.DO,0)}if("triangulated"===o){const{geometry:e,thickness:r}=n;oy.pG(this.ft.wi(),this.ER,i,f,this.ft.wi()?4:2,0),this.ER.uV(s,1,{location:d("aIsHighlighted"),size:1}),oy.VL(this.nN,e,f,this.vG&&1!==t,1===t,r,this.wG.length)}else hy.pG(this.ft.wi(),this.ER,i,f,this.ft.wi()?4:2,0),this.ER.XV(d("aIsHighlighted"),s),hy.SG(this.nN,this.wG.length);return!0})),this):this}uN(t){if(t===this.pN)return{};const e=this.wG.find((e=>e.pN===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.bG=void 0,this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this.OG&&(this.ER.yV(this.OG),this.OG=void 0),this.GG&&(this.ER.yV(this.GG),this.GG=void 0),this.NG&&(this.ER.yV(this.NG),this.NG=void 0),this._G=void 0,this}OR(){return this}ds(t){super.ds(t);for(const e of this.wG)e.ds(t);return this}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return we(this.uu)}bl(){return we(this.uu)}}class uy{constructor(t,e){this.WG=!1,this.UG=!1,this.YG=!1,this.ft=t,this.HG=e,this.HG.Yo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.WG="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.WG="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.UG=!0),!0===t.regularProgressiveStep&&(this.YG=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.WG?t[0].x:t[0].y,end:"x"===this.WG?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.WG?"x"===this.WG?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 r=t[0].y,n=t[0].y;for(let i=0;ir&&(r=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 r=t[0].x,n=t[0].x;for(let i=0;ir&&(r=e.x),e.x{!1===t.allowDataGrouping&&(this.$G=!0)}))}QG(t,e=!1){if(this.$G||!this.WG||"linear"!==this.ZG.type)return!1;!1===e&&this.JG&&(clearTimeout(this.JG),this.JG=void 0);const i="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const r=t[0],n=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.WG?r.x:r.y,"x"===this.WG?n.x:n.y,s),h=this.ZG.scale,a=Math.abs("x"===this.WG?h.Ui().x:h.Ui().y),l=a/o,u=Math.floor(l*cy),c=u*o,d=bt.performance.now(),f=!(d-i.lh<500)&&(i.sh?d-i.ah<1e3:d-i.eh<2e3||i.rh),g=s>2*this.XG.totalDataPointsAtTime;if(f&&!g)return this.JG=setTimeout((()=>this.KG(t)),1e3),!1;const m=u>=10,y=this.XG.enabled?this.XG.columnWidthAxis/a<1.5:void 0,p=this.XG.enabled&&u>this.XG.dataPointsPerColumn?u/this.XG.dataPointsPerColumn>=2:void 0;let x;!0===this.XG.enabled?y?p&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const S=!1===e;return x?(S&&(this.XG=x),!0):(S&&(this.XG={...this.XG,totalDataPointsAtTime:s}),!1)}Zp(){this.qG=void 0,this.jG.length=0,this.JG&&(clearTimeout(this.JG),this.JG=void 0)}tW(t){if(0===t.length)return t;if(this.$G||!this.WG||"linear"!==this.ZG.type||!this.XG.enabled)return t;let e;e=this.jG.length>0?ne(this.jG,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.qG,h=-1,a=-1,l=0,u=0;if("x"!==this.WG||this.UG)if("x"===this.WG&&this.UG){const t=this.XG.columnWidthAxis;let c=this.qG?this.qG.x:e[0].x,d=c-t;for(let f=0;f=d?((!r||i.y>r.y)&&(r=i,h=f),(!n||i.y=d?((!r||i.x>r.x)&&(r=i,h=f),(!n||i.xr.x)&&(r=i,h=f),(!n||i.xr.y)&&(r=i,h=f),(!n||i.y0&&(this.qG=s[c-1]),s}iW(t){if(this.WG&&"linear"===this.ZG.type){const e="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Ke===zs.progressive||e.Ke===zs.regressive){const e=Math.abs("x"===this.WG?this.ZG.scale.x.getInnerInterval():this.ZG.scale.y.getInnerInterval());if(this.XG.enabled)return 2*e/this.XG.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.WG?s.x:s.y,"x"===this.WG?r.x:r.y,i)}}}sW(t,e,i){if(!this.WG)return e;const s=i.length;let r=Nr(i,t.min,this.WG,this.UG,0,s-1);void 0===r&&(r=this.UG?s-1:0);let n=Nr(i,t.max,this.WG,this.UG,0,s-1);return void 0===n&&(n=this.UG?0:s-1),1+Math.abs(n-r)}eW(){this.JG&&(clearTimeout(this.JG),this.JG=void 0)}KG(t){this.QG(t,!0)&&this.vs()}}class fy extends uy{renderVisibleOnly(t,e){const i=this.ft.x.getInnerStart(),s=this.ft.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ft.y.getInnerStart(),h=this.ft.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xn||t.boundaries.max.yl||e(t)}))}}class gy{constructor(t,e,i){this.hW=e,this.rW=i,this.nW=t,this.oW=[]}aW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.nW[this.nW.length-1];do{const t=this.nW.length;let r;h||(h=this.lW(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.rW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.nW[t-1].lastDataPoint;e?(n.splice(0,0,e),a=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(h)r=Math.min(o,h.allocatedCoordinatesCount-h.existingCoordinatesCount),s(h,n.slice(0,r),r,a);else{const t=Math.ceil(e)+a;r=Math.min(t,o);const s={...i(t,n.slice(0,r),r,a),isDropped:!1};this.nW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.uW()}cW(t){const e=t,i=this.nW.indexOf(e);i>=0&&this.nW.splice(i,1),e.droppedTimestamp=bt.performance.now(),this.oW.push(e)}dW(){this.nW.slice().forEach((t=>this.cW(t)))}fW(){this.nW.forEach((t=>this.hW(t))),this.oW.forEach((t=>this.hW(t))),this.nW.length=0,this.oW.length=0}lW(t,e){const i=2*t/3,s=4*t/3,r=this.oW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.oW[r];return this.oW.splice(r,1),this.nW.push(t),t}}uW(){if(this.oW.length>5){const t=bt.performance.now();for(let e=0;e=1e4)&&(this.hW(i),this.oW.splice(e,1),e-=1)}}}}class my extends uy{AW(t,e){if(!e||"object"!=typeof e)return 0;const i=this.ft.x.getInnerStart(),s=this.ft.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ft.y.getInnerStart(),h=this.ft.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.gW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.pW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.mW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}gW(t,e,i,s,r,n){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let h=0,a=o;for(let i=0;ie&&(h+=1,a-=s.existingDataPointsCount)}return h}mW(t,e,i,s,r,n){if(void 0===e||!this.WG)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.WG?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.WG?a.boundaries.max.x2))break;o+=1}return o}pW(t,e,i,s,r,n){if(void 0===e||0===e)return 0;let o=0,h=0;for(let a=t.length-1;a>=0;a-=1){const l=t[a];if(h>e)if(this.WG){if(this.UG?"x"===this.WG?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.WG?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}yW(t,e){const i=t.reduce(((t,e)=>Je(t,e.boundaries)),_e);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.WG||this.UG?"x"===this.WG&&this.UG?i.max.x=Math.min(i.max.x,t):"y"!==this.WG||this.UG?"y"===this.WG&&this.UG&&(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 yy extends cn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.lE=new Ym,this.JM=[],this.SW=new fy(this.ft,this),this.vW=new dy(this.ft,this,(()=>this.cs.vs())),this.xW=new gy(this.JM,(t=>{t.coordsBuffer&&this.ER.yV(t.coordsBuffer),t.MG&&this.ER.yV(t.MG)}),!0),this.bW=new my(this.ft,this),this.MW=0,this._W=0,this.wW=!1,this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t}}),this.oN=e,this.pN=n,this.mN=o,this.Yn=h,this.bG={type:"none"},this.ER=t.aN(),this.nN=t,this.vG=this.ER.hO;const a=this.ft.wi(),l=!0===(null==h?void 0:h.individualLookupValuesEnabled);let u,c,d,f=0;a||(u=f,f+=2),a&&(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,r=0;sJt(e,t))(a,l);this.kW={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.uu.getFillStyle())}}TW(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.Lo._(),h=this.Lo.o,a=this.gN.lineStyleSolid(i),l=this.gN.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.gN.strokeFillSolid(i),f=this.gN.strokeFillLinearGradient(i),g=this.gN.strokeFillRadialGradient(i),m=this.gN.strokeFillPaletted(i),y=d||f||g||m,p=this.kW.individualLookupValuesEnabled;if(l&&this.ft instanceof Vi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.yu=ne(this.yu,s,{canReturnB:!0}),this.$a+=r);let x=this.Su.o;const S=this.bW.AW(this.JM,this.Su._());if(S>0){let t=0;for(let e=0;e{t.MG&&(this.ER.yV(t.MG),t.MG=void 0)})),this.wW=!1),v&&(this.vW.Zp(),this.JM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=_e,t.lastDataPoint=void 0})),this.xW.dW(),A=this.yu,this.MW=0,this._W=0);const b=this.vW.tW(A),M=b.length;if(M>0){let t=this.vW.iW(this.yu)||(this.Yo("ApplicationType",(t=>"InternalUI"===t.type))?this.$a:1e5);M/t>10&&(t=M/10),this.xW.aW(b,t,((t,e,i,s)=>{const r=this.SW.calculateUserDataPointsBoundaries(e),n=this.vW.sW(r,i,this.yu)-s;return this.FW=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),lastDataPoint:e[i-1],MG:this.wW?this.ER.zV(2*t,this.TW(e,i,this.FW)):void 0}}),((t,e,i,s)=>{const r=Je(t.boundaries,this.SW.calculateUserDataPointsBoundaries(e)),n=this.vW.sW(r,t.existingCoordinatesCount+i,this.yu)-(t.jointPointsCount+s);this.ER.VV(t.coordsBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),this.wW&&t.MG&&this.ER.VV(t.MG,2*t.existingCoordinatesCount,this.TW(e,i,this.FW)),this.FW=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ha=this.bW.yW(this.JM,this.Su._())),this.lE.mV(this.ft),g?this.LN=Dm(this.zo||this.Ha,this.ft,g.getPosition(),g.getExtent(),g.getShape(),this.ER.Xz()):f?this.RN=Lm(this.zo||this.Ha,this.ft,f.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw bt.alert(t),new Error(t)}if(y&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.bG="primitive"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}),l&&em.StippleTexture),mousePickingShader:o?this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}),l&&em.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),this.vG?em.AliasedEdge:void 0,l&&em.StippleTextureInstanced),mousePickingShader:o?this.ER.az(em["2D"],em.MousePicking,em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),l&&em.StippleTextureInstanced):void 0,geometry:ny(this.ER,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.bG={type:"none"}}return this._G=l?this.ER.PO(l.getPattern()):void 0,this.Au(e),this.Ja=!1,this.Xa=[],this.Lo.o=!1,this.Su.o=!1,this}VL(t){const e=this.ER.gl,i=this.bG;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyleDashed:r,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}=i;return this.ER.ZR(s).lV(s,((s,l,u,c)=>{let d=!1;if(this.ER.fV(s("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(s("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(s("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(s("uScale"),this.lE.AV()).cV(s("uDisp"),this.lE.gV()).cV(c("uScaleStart_highpart"),this.lE.OO()).cV(c("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(c("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(s("uColor"),this.mN);else if(n)this.ER.gR(s("uColor"),n.getColor());else if(h){if(!this.LN)return!1;this.ER.mO(u,this.LN,h)}else if(o){if(!this.RN)return!1;this.ER.yO(u,this.RN,o)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ER.RO(u,a.lut,t)}return this.SW.renderVisibleOnly(this.JM,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?oy.AG:hy.AG;if(this.ft.wi()||void 0===this.kW.attributeOffsetCoordinateLowPrecision?this.ft.wi()&&void 0!==this.kW.attributeOffsetCoordinateHighPrecision&&h(!0,this.ER,o,u,this.kW.attributesPerVertex,this.kW.attributeOffsetCoordinateHighPrecision):h(!1,this.ER,o,u,this.kW.attributesPerVertex,this.kW.attributeOffsetCoordinateLowPrecision),r){if(!n.MG||!this._G)return;"triangulated"===i.type?oy.gG(this.ER,u,n.MG,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):hy.gG(this.ER,u,n.MG,l("aLengthSoFar"),2,0),this.ER.cV(s("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(c("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(s("uStippleScale"),r.getPatternScale()).dV(s("uStippleTexture"),this._G.DO,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this.kW.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kW.attributeOffsetLookUpValue+this.kW.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;oy.VL(this.nN,i.geometry,u,this.vG&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else hy.yG(this.nN,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}uN(t){return this.pN===t&&{}}ol(t,e){return Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.Ha=Je(this.Ha,e||e||this.SW.calculateUserDataPointsBoundaries(t)),this}Gt(){return super.Gt(),this.MW=0,this._W=0,this.FW=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.vW.eW(),this.bG={type:"none"},this._G=void 0,this}OR(){return this}Yb(t){this.ll()>0&&this.Ds();const e=this.il(),i=_r(e,t,this.Qa,this.Il,this.Pl,this.ft,this.engine.ft,this.Ha,this.SW.WG,this.SW.UG);return void 0!==i?e[i]:void 0}ew(t){this.ll()>0&&this.Ds();const e=this.il(),i=e.length;if(0===i)return;const s=this.Il?1:0,r=i-(this.Pl?2:1);if(this.Qa===Lr.Nearest){let s,r,n=Le;for(let o=0;o1}Zm(t,e,i,s,r){return"object"==typeof s?e?this.ER.XV(t.attribute("aOffsetScale"),e,1).cV(t.uniform("uSizePixels"),[s.width,s.height]):this.ER.fV(t.uniform("uOffsetScale"),s.scale).cV(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.ER.XV(t.attribute("aOffsetPixels"),e,1):this.ER.fV(t.uniform("uOffsetPixels"),s):this.ER.fV(t.uniform("uPointSize"),s),r?this.ER.uV(this.CR,0,{location:t.attribute("aInstanceGeo"),size:2}).JV(this.fG,0,this.DW,i):this.ER.Zm(this.ER.gl.POINTS,i),this}Tz(){this.ER.yV(this.CR)}}const xy=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new py(t,i,t.gl.TRIANGLE_FAN,e)},Sy=(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 py(t,s,t.gl.TRIANGLES,e)},Ay=(t,i,s)=>{if(io(t))return Ay(e.PointShape.Square,i,s);let r=i.wV.xz.get(t);if(t===e.PointShape.Circle){const t=s<=3?4:s<=5?8:s<=10?16:24;return r=i.wV.bz.get(t)||((t,e,i=0)=>{const s=function(t=25){return md(u(0,0),0,360,.5,.5,t)[0]}(e);return new py(t,s,t.gl.TRIANGLE_FAN,i)})(i,t),i.wV.bz.set(t,r),r}if(!r){switch(t){case e.PointShape.Triangle:r=((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 py(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=xy(i);break;case e.PointShape.Plus:r=Sy(i);break;case e.PointShape.Cross:r=Sy(i,45);break;case e.PointShape.Diamond:r=xy(i,45);break;case e.PointShape.Arrow:r=((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 py(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new py(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:r=((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 py(t,s,t.gl.TRIANGLES,e)})(i);break;default:return be(0,"LightningChart JS unidentified point shape")}i.wV.xz.set(t,r)}return r};class vy extends tn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.fN=m(c(Pe,Pe),c(Le,Le)),this.gN=Tg({pointStyleSolid:()=>Y(this.be)&&this.be,pointStyleRadialGradient:()=>et(this.be)&&this.be,pointStyleLinearGradient:()=>rt(this.be)&&this.be,pointStylePaletted:()=>j(this.be)&&this.be,pointStyleIndividual:()=>X(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}Ds(){var t;const e=this.Lo._(),i=this.Lo.o,s=this.Xa,r=s.length,n=r>0,o=this.Ga._(),h=this.be,a=this.size._(),l=this.Ga.o||this.ga.o,u=this.ft.Gi(),c=this.size.o||this.Ga.o,d=this.Ja||s&&s.length>0,f=u||c,g=this.ia(),m=this.gN.pointStyleSolid(g),y=this.gN.pointStyleRadialGradient(g),p=this.gN.pointStyleLinearGradient(g),x=this.gN.pointStylePaletted(g),S=this.gN.pointStyleIndividual(g),A=m||y||p||x||S;if(n&&(this.Na=ne(this.Na,s,{canReturnB:!0}),this.$a+=r),n||this.Ja){this.Ha=this.Za?Je(this.Ha,this.Za):Je(this.Ha,Ze(this.Na));const t=Jt(this.Na,this.ft.wi());this.RW=this.$a,this.EW=this.ER.oV(t,!1,this.EW)}this.lE.mV(this.ft),h!==z?f&&(this.zW&&(this.zW=void 0),a>1||this.Wa._()?a<=1&&!this.Wa._()?this.fG=this.ER.gl.POINTS:(this.zW=Ay(o,this.ER,this.Wa._()?25:a),this.fG=this.zW.fG):this.fG=this.ER.gl.POINTS):this.zW&&(this.zW=void 0);const v=(null===(t=this.zW)||void 0===t?void 0:t.BW)||0,b=this.ga._()+v;if(c||g||i||l){const t=this.Wa._()?"attribute":"uniform",i=a<=1&&em.PointSize(t),s=em.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.Ua._()||b%360!=0)&&{dataType:this.Ua._()?"attribute":"uniform"}}:void 0,axisWorldTranslation:wg(this.ft),normalSource:void 0});this.dE=A?this.ER.az(em["2D"],i,s,m?em.Color({dataType:"uniform"}):S?em.Color({dataType:"attribute"}):x?em.Color({dataType:["lookup",x.getLookUpProperty(),x.lut]}):y?em.Color({dataType:["gradient",y]}):p?em.Color({dataType:["gradient",p]}):void 0):void 0,this.zN=e&&A?this.ER.az(em["2D"],i,s,em.MousePicking):void 0}if(d||g){const t=this.Na.length;if(X(h)&&this.RW&&this.RW>0){const e=h.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&a>1){const e=new Float32Array(t);for(let i=0;i0&&a>1){const e=new Float32Array(2*t),i=gi(b),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.Ka={min:e,max:t}}return this.sa=h,this.Ga.o=!1,this.size.o=!1,this.ga.o=!1,this.Lo.o=!1,this.Ja=!1,this}VL(t){const e=1===t?this.zN:this.dE,i=this.EW,s=this.RW;return e&&i&&s&&(this.ER.ZR(e),this.ER.lV(e,((e,r,n,o)=>{var h;if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(o("uScaleStart_highpart"),this.lE.OO()).cV(o("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(o("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(o("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(o("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(o("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.xO(n,i,this.ft.wi(),this.zW?1:void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).fV(o("uDevicePixelRatio"),this.ER.Xz()),this.zW){const t=r("aInstanceGeo");this.ER.WV(t,this.zW.CR).YV(t,0)}if(1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(this.be))this.ER.gR(e("uColor"),this.be.getColor());else if(X(this.be)&&this.VW){const t=r("aColor");this.ER.$V(t,this.VW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(j(this.be)){if("value"===this.be.getLookUpProperty()&&this.GW){const t=r("aLookupValue");this.ER.XV(t,this.GW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}const t=kg(this.be,this,this.Ka);if(!t&&this.be.lut.percentageValues)return!1;this.ER.RO(n,this.be.lut,t)}else if(et(this.be)){if(!this._N)return!1;this.ER.mO(n,this._N,this.be)}else if(rt(this.be)){if(!this.wN)return!1;this.ER.yO(n,this.wN,this.be)}if(this.OW&&this.fG!==this.ER.gl.POINTS){const t=r("aOffsetPixels");this.ER.XV(t,this.OW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(this.fG!==this.ER.gl.POINTS){const t=e("uOffsetPixels");this.ER.fV(t,this.size._())}const a=((null===(h=this.zW)||void 0===h?void 0:h.BW)||0)+this.ga._();if(this.NW&&this.fG!==this.ER.gl.POINTS){const t=r("aRot");this.ER.WV(t,this.NW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(this.fG!==this.ER.gl.POINTS&&a%360!=0){const t=gi(a),i=Math.sin(t),s=Math.cos(t);this.ER.cV(e("uRot"),[i,s])}if(this.fG===this.ER.gl.POINTS)this.ER.fV(e("uPointSize"),this.size._());else{const t={x:2/this.cs.ai().x,y:2/this.cs.ai().y};this.ER.cV(e("uRatioPxClip"),[t.x,t.y])}let l=!1;return this.fG===this.ER.gl.POINTS?(this.ER.Zm(this.fG,s),l=!0):this.zW&&(this.ER.JV(this.fG,0,this.zW.DW,s),l=!0),l}))),this}uN(t){return this.pN===t&&{}}$c(t){this.ll()>0&&this.Ds();const e=this.il(),i=_r(e,t,this.Qa,!1,!1,this.ft,this.cs.ft,this.Ha,void 0,void 0);return void 0!==i?e[i]:void 0}ke(t){return super.ke(t)}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return this.Wa._()?25:this.size._()}bl(){return this.Wa._()?25:this.size._()}OR(){return this.EW&&(this.ER.yV(this.EW),this.EW=void 0),this.zW&&(this.zW=void 0),this.VW&&(this.ER.yV(this.VW),this.VW=void 0),this.NW&&(this.ER.yV(this.NW),this.NW=void 0),this.GW&&(this.ER.yV(this.GW),this.GW=void 0),this}}class by extends Jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.bG={fill:void 0,border:void 0},this.lE=new Ym,this.Ha=_e,this.WW=!1,this.UW=!1,this.YW=!1,this.HW=!1,this.$W=!1,this.vd=[],this.gN=Tg({polygonStyleSolid:()=>Y(this.be)&&this.be,polygonStyleImage:()=>Zn(this.be)&&this.be,polygonStyleRadialGradient:()=>et(this.be)&&this.be,polygonStyleLinearGradient:()=>rt(this.be)&&this.be,polygonStylePaletted:()=>j(this.be)&&this.be,polygonStyleIndividual:()=>X(this.be)&&this.be,lineStyleSolid:()=>qi(this.Me)&&this.Me,lineStyleFilled:()=>{const t=this.Me&&this.Me.getFillStyle();return Y(t)&&t}}),this.nN=t,this.oN=e,this.IG=n,this.ER=t.aN(),this.vG=this.ER.hO}Vr(){const t=this.IG(),e={ys:t=>this.DG(e,t),ds:t=>this.BG(e,t),Sl:t=>this.XW(e,t),Jx:t=>this.jW(e,t),gR:t=>this.EG(e,t),Na:[],S:void 0,ZW:void 0,Vo:0,QW:!0,pN:t.id,mN:t.color};return this.vd.push(e),e}Gt(){var t;return this.vd.length=0,this.WW=!0,this.Zi&&this.Fn&&(null===(t=this.cs.kn)||void 0===t?void 0:t.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember),this}py(){return this.vd}bd(t){var e;const i=this.vd.indexOf(t);i>=0&&(this.vd.splice(i,1),this.$W=!0,this.Zi&&this.Fn&&(null===(e=this.cs.kn)||void 0===e?void 0:e.entity)===this&&this.cs.kn.collectionMember===t&&this.Fn(this,void 0,this.cs.kn.collectionMember))}DG(t,e){var i;return t.QW=e,this.$W=!0,this.Zi&&this.Fn&&(null===(i=this.cs.kn)||void 0===i?void 0:i.entity)===this&&this.cs.kn.collectionMember===t&&this.Fn(this,void 0,this.cs.kn.collectionMember),t}BG(t,e){return t.Vo=e,this.HW=!0,t}XW(t,e){return t.Na=e,this.WW=!0,t}jW(t,e){return t.S=e,this.UW=!0,t}EG(t,e){return t.ZW=null==e?void 0:e.toUint32(),this.YW=!0,t}Ds(){const t=this.Lo._(),e=this.Lo.o,i=this.ia(),s=this.HW,r=this.WW,n=this.UW,o=this.YW,a=this.$W,l=this.Me,u=this.na(),c=this.vd.filter((t=>t.QW&&t.Na.length>0));if(this.lE.mV(this.ft),(r||a)&&(this.Ha=Je(...c.map((t=>Ze(t.Na))))),r||a){const t=Jt(c.map((t=>[...t.Na,t.Na[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.ft.wi()),e=this.ft.wi()?4:2;this.xG=this.ER.oV(t,!1,this.xG);let i=[];c.reduce(((s,r)=>{const n=s,o=(r.Na.length+1)*e,a=new Float32Array(t.buffer,n,o),l=h.default(a,void 0,e),u=s/(Float32Array.BYTES_PER_ELEMENT*e);for(let t=0;tt+e.Na.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Na.length+2;for(let r=i;rt+e.Na.length+2),0),e=new Float32Array(4*t);let i=0;c.forEach((t=>{const s=t.Na.length+2;for(let r=i;rt+e.Na.length+2),0),e=new Float32Array(t);let i=0;const s={min:Le,max:Pe};c.forEach((t=>{const r=void 0!==t.S?t.S:-34028234663852886e22,n=t.Na.length+2;for(let t=i;tt+e.Na.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():R.toUint32();c.forEach((t=>{const r=void 0!==t.ZW?t.ZW:s,n=t.Na.length+2;for(let t=i;tthis.nU(t,e,i,c))),this.HW=!1,this.$W=!1,this.WW=!1,this.UW=!1,this.YW=!1,this.Lo.o=!1,this.ra(this.be),this.la(l),this}VL(t){var e,i;const{fill:s,border:r}=this.bG,n=this.xG,o=this.tU,h=this.iU;if(!n||!o)return this;if(s){const{fillStyleSolid:i,fillStyleLinearGradient:r,fillStyleRadialGradient:a,fillStylePaletted:l,fillStyleImage:u,fillStyleIndividual:c}=s,d=this.JW,f=this.KW,g=1===t?null===(e=s.mousePicking)||void 0===e?void 0:e.shader:s.shader;if(!g||!n||!d||void 0===f)return this;this.ER.ZR(g).lV(g,((e,s,g,m)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(m("uScaleStart_highpart"),this.lE.OO()).cV(m("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(m("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(m("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(m("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(m("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.xO(g,n,this.ft.wi(),void 0).jV(d).XV(s("aIsHighlighted"),o).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.ER.$V(s("aColor"),h)}else if(i)this.ER.gR(e("uColor"),i.getColor());else if(a){if(!this._N)return!1;this.ER.mO(g,this._N,a)}else if(r){if(!this.wN)return!1;this.ER.yO(g,this.wN,r)}else if(l){const t=kg(l,this,this.sU);if(!t&&l.lut.percentageValues)return!1;if(this.ER.RO(g,l.lut,t),"value"===l.getLookUpProperty()){if(!this.eU)return!1;this.ER.XV(s("aLookupValue"),this.eU)}}else if(u){if(!this.rU)return!1;this.ER.gR(m("uColor"),u.getSurroundingColor()).dV(e("uColorTexture"),this.rU.texture.Wz()||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).RV(u.fitMode)}else if(c){if(!this.hU)return!1;const t=s("aColor");this.ER.gl.bindBuffer(this.ER.gl.ARRAY_BUFFER,this.hU),this.ER.gl.vertexAttribPointer(t,4,this.ER.gl.UNSIGNED_BYTE,!0,0,0),this.ER.gl.enableVertexAttribArray(t)}return this.ER.QV(f,void 0,void 0,this.ER.gl.UNSIGNED_INT),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.qW,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.ER.ZR(u).lV(u,((i,r,u,c)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()).cV(c("uScaleStart_highpart"),this.lE.OO()).cV(c("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(c("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(i("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(i("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.uV(o,1,{location:r("aIsHighlighted"),size:1}).gR(i("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.ER.uV(h,1,{location:r("aColor"),size:4})}else s&&this.ER.gR(i("uColor"),s.getColor());return oy.AG(this.ft.wi(),this.ER,n,u,this.ft.wi()?4:2,0),oy.VL(this.nN,e,u,this.vG&&1!==t,1===t,a,l),!0}))}return this}nU(t,e,i,s){const r=dt({x:this.Ha.min.x,y:this.Ha.min.y},this.ft,this.cs.ft),n=dt({x:this.Ha.max.x,y:this.Ha.max.y},this.ft,this.cs.ft),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Bm(t,e,o.x,o.y,i),a=h[1],l=h[4],u=h[6],c=h[7],d=s.reduce(((t,e)=>t+e.Na.length+2),0),f=new Float32Array(2*d),g=this.Ha.max.x-this.Ha.min.x,m=this.Ha.max.y-this.Ha.min.y,y=l-u,p=c-a;let x=0;for(const t of s){for(const e of t.Na){const t=u+y*((e.x-this.Ha.min.x)/g),i=a+p*((e.y-this.Ha.min.y)/m);f[x]=t,f[x+1]=i,x+=2}const e=u+y*((t.Na[0].x-this.Ha.min.x)/g),i=a+p*((t.Na[0].y-this.Ha.min.y)/m);f[x]=e,f[x+1]=i,x+=2,f[x]=Number.NaN,f[x+1]=Number.NaN,x+=2}return f}uN(t){const e=this.vd.find((e=>e.pN===t));return!!e&&{collectionMember:e}}OR(){return this.JW&&(this.ER.yV(this.JW),this.JW=void 0),this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.tU&&(this.ER.yV(this.tU),this.tU=void 0),this.iU&&(this.ER.yV(this.iU),this.iU=void 0),this.eU&&(this.ER.yV(this.eU),this.eU=void 0),this.hU&&(this.ER.yV(this.hU),this.hU=void 0),this.bG={fill:void 0,border:void 0},this.rU=this.ER.zO(this,this.rU),this}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return we(this.Me)}bl(){return we(this.Me)}}class My extends en{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.oU=_e,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be,fillStyleImage:()=>Zn(this.be)&&this.be,strokeStyleSolid:()=>qi(this.Me)&&this.Me,strokeFillSolid:()=>{const t=this.Me.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.Me.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.Me.getFillStyle();return et(t)&&t}}),this.nU=(t,e,i)=>{const s=dt(this.Ia(),this.ft,this.cs.ft),r=hi(dt(oi(this.Ia(),this.ai()),this.ft,this.cs.ft),s);return Bm(t,e,r.x,r.y,i)},this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e}Ds(){super.Ds();const t=this.Lo._(),e=this.ia(),i=this.ca.o||this.j.o||this.ga.o||this.ma.o,s=this.Me,r=this.na(),n=s.getThickness(),o=this.ga._();this.lE.mV(this.ft);const h=this.ft.Gi();if(i){const t=this.j._();this.Na=function(t,e,i,s,r){const n=((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;n[0]=ti(n[0],r,t),n[1]=ti(n[1],r,t),n[2]=ti(n[2],r,t),n[3]=ti(n[3],r,t)}return n}(this.ca._(),t.x,t.y,o,this.ma._());const e=Jt(this.Na,this.ft.wi());this.vN=this.ER.oV(e,!1,this.vN),this.bN=this.Na.length,this.oU=Ze(this.Na)}const a=this.gN.fillStyleSolid(e),l=this.gN.fillStyleRadialGradient(e),c=this.gN.fillStyleLinearGradient(e),d=this.gN.fillStyleImage(e),f=a||l||c||d;e&&(this.CN=f?this.ER.az(em["2D"],a&&em.Color({dataType:"uniform"}),c&&em.Color({dataType:["gradient",c]}),l&&em.Color({dataType:["gradient",l]}),d&&em.Color({dataType:["image",d]}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),l?this._N=Dm(this.zo||this.oU,this.ft,l.getPosition(),l.getExtent(),l.getShape(),this.ER.Xz()):c?this.wN=Lm(this.zo||this.oU,this.ft,c.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0),this.rU=this.ER.EO(this,this.rU,d,void 0,h||i,this.nU);const g=this.gN.strokeStyleSolid(r),m=this.gN.strokeFillSolid(r),y=this.gN.strokeFillLinearGradient(r),p=this.gN.strokeFillRadialGradient(r),x=g,S=m||y||p;if(x&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.kN,this.aU]=[this.Na,void 0];else{const t=this.ft;[this.kN,this.aU]=t instanceof Vi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Yi(s,r,h,-h),i.Yi(r,s,-h,-h),i.Yi(o,n,-h,-h),i.Yi(n,o,h,-h),i.Yi(s,r,-h,h),i.Yi(r,s,h,h),i.Yi(o,n,h,h),i.Yi(n,o,-h,h)],[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.Na,n,t):((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=u(e.x*i*.5,e.y*i*.5),a=ii(ei(r,s)),l=ii(ei(o,s)),c=ui(a),d=ui(l);return[[oi(s,oi(ni(c,h.x),ni(d,h.y))),oi(r,oi(ni(a,h.x),ni(d,h.y))),oi(o,oi(ni(c,h.x),ni(l,h.y))),oi(n,oi(ni(a,h.x),ni(l,h.y))),oi(s,oi(ni(a,h.x),ni(l,h.y))),oi(r,oi(ni(c,h.x),ni(l,h.y))),oi(o,oi(ni(a,h.x),ni(d,h.y))),oi(n,oi(ni(c,h.x),ni(d,h.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.Na,t.Ui(),n)}this.FN=this.ER.oV(Jt(this.kN,this.ft.wi()),!1,this.FN),this.aU?(this.cG=this.ER.NV(new Uint16Array(this.aU),this.cG),this.TN=this.aU.length):(this.cG&&this.ER.yV(this.cG),this.cG=void 0,this.TN=this.kN.length)}return r&&(this.EN=x&&S?this.ER.az(em["2D"],em.Color({dataType:p?["gradient",p]:y?["gradient",y]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),p?this.LN=Dm(this.oU,this.ft,p.getPosition(),p.getExtent(),p.getShape(),this.ER.Xz()):y?this.RN=Lm(this.oU,this.ft,y.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.zN=t&&f?this.zN||this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.VN=t&&this.Me!==ot?this.VN||this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.ra(this.be),this.la(s),this.ca.o=!1,this.ga.o=!1,this.j.o=!1,this.ma.o=!1,this}uN(t){return this.pN===t&&{}}VL(t){const e=1===t?this.zN:this.CN,i=this.vN,s=this.bN,r=this.gN.fillStyleSolid(!1),n=this.gN.fillStyleRadialGradient(!1),o=this.gN.fillStyleLinearGradient(!1),h=this.gN.fillStyleImage(!1);e&&i&&s&&this.be!==z&&(this.ER.ZR(e),this.ER.lV(e,((e,a,l,u)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(u("uScaleStart_highpart"),this.lE.OO()).cV(u("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(u("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(u("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(u("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(u("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(r)this.ER.gR(e("uColor"),r.getColor());else if(n){if(!this._N)return!1;this.ER.mO(l,this._N,n)}else if(o){if(!this.wN)return!1;this.ER.yO(l,this.wN,o)}else if(h){if(!this.rU)return!1;const t=this.rU&&this.rU.texture.Wz();this.ER.gR(u("uColor"),h.getSurroundingColor()).dV(e("uColorTexture"),t||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:a("aTextureCoord"),size:2}).RV(h.fitMode)}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).xO(l,i,this.ft.wi(),void 0).Zm(this.ER.gl.TRIANGLE_FAN,s),!0})));const a=1===t?this.VN:this.EN,l=this.gN.strokeStyleSolid(!1),u=this.gN.strokeFillSolid(!1),c=this.gN.strokeFillLinearGradient(!1),d=this.gN.strokeFillRadialGradient(!1),f=this.FN;return a&&f&&l&&(this.ER.ZR(a),this.ER.lV(a,((e,i,s,r)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(r("uScaleStart_highpart"),this.lE.OO()).cV(r("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(r("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(r("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(r("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(r("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(u)this.ER.gR(e("uColor"),u.getColor());else if(d){if(!this.LN)return!1;this.ER.mO(s,this.LN,d)}else if(c){if(!this.RN)return!1;this.ER.yO(s,this.RN,c)}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).xO(s,f,this.ft.wi(),void 0),this.cG?this.ER.jV(this.cG).QV(this.TN):this.ER.Zm(this.ER.gl.LINE_LOOP,this.TN),!0}))),this}OR(){return this.cG&&(this.ER.yV(this.cG),this.cG=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.rU=this.ER.zO(this,this.rU),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this}bt(){return Math.max(this.ca._().x,this.ca._().x+this.j._().x)}xt(){return Math.min(this.ca._().x,this.ca._().x+this.j._().x)}_t(){return Math.max(this.ca._().y,this.ca._().y+this.j._().y)}Mt(){return Math.min(this.ca._().y,this.ca._().y+this.j._().y)}xl(){return we(this.Me)}bl(){return we(this.Me)}}class Ey extends rn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be,fillStyleImage:()=>Zn(this.be)&&this.be,strokeLineStyleSolid:()=>qi(this.Me)&&this.Me,strokeLineSolidFill:()=>{const t=this.Me.getFillStyle();return Y(t)&&t},strokeLinearGradientFill:()=>{const t=this.Me.getFillStyle();return rt(t)&&t},strokeRadialGradientFill:()=>{const t=this.Me.getFillStyle();return et(t)&&t}}),this.nU=(t,e,i)=>{const s=dt({x:this.Ha.min.x,y:this.Ha.min.y},this.ft,this.cs.ft),r=dt({x:this.Ha.max.x,y:this.Ha.max.y},this.ft,this.cs.ft),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Bm(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Na.length),d=this.Ha.max.x-this.Ha.min.x,f=this.Ha.max.y-this.Ha.min.y,g=a-l,m=u-h;let y=0;for(const t of this.Na){const e=l+g*((t.x-this.Ha.min.x)/d),i=h+m*((t.y-this.Ha.min.y)/f);c[y]=e,c[y+1]=i,y+=2}return c},this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e}$c(t){let e,i=Number.MAX_VALUE;for(const s of this.Na){const r=Xe(dt(s,this.ft,this.cs.ft),t);r=3,r=this.Me,n=this.na(),o=r.getThickness(),a=this.aa(o);this.lE.mV(this.ft),this.IT=this.ft.Ui();const l=this.ft.Gi();if(i&&(this.Ha=Ze(this.Na)),i&&s){const t=Jt(this.Na,this.ft.wi());this.vN=this.ER.oV(t,!1,this.vN),this.lU=new Uint16Array(h.default(t)),this.uU=this.ER.NV(this.lU,this.uU),this.bN=this.lU.length}const u=this.gN.fillStyleSolid(e),c=this.gN.fillStylePaletted(e),d=this.gN.fillStyleRadialGradient(e),f=this.gN.fillStyleLinearGradient(e),g=this.gN.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.CN=m?this.ER.az(em["2D"],u&&em.Color({dataType:"uniform"}),f&&em.Color({dataType:["gradient",f]}),d&&em.Color({dataType:["gradient",d]}),c&&em.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&em.Color({dataType:["image",g]}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),d?this._N=Dm(this.zo||this.Ha,this.ft,d.getPosition(),d.getExtent(),d.getShape(),this.ER.Xz()):f?this.wN=Lm(this.zo||this.Ha,this.ft,f.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0),this.rU=this.ER.EO(this,this.rU,g,void 0,l||i,this.nU),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Na:$m(this.Na,this.IT,o);this.kN=Jt(t,this.ft.wi()),this.FN=this.ER.oV(this.kN,!0,this.FN),this.TN=t.length}const y=this.gN.strokeLineStyleSolid(n),p=this.gN.strokeLineSolidFill(n),x=this.gN.strokeLinearGradientFill(n),S=this.gN.strokeRadialGradientFill(n),A=y,v=p||x||S;return n&&(this.EN=A&&v?this.ER.az(em["2D"],em.Color({dataType:S?["gradient",S]:x?["gradient",x]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),S?this.LN=Dm(this.zo||this.Ha,this.ft,S.getPosition(),S.getExtent(),S.getShape(),this.ER.Xz()):x?this.RN=Lm(this.zo||this.Ha,this.ft,x.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.zN=t&&m?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.VN=t&&this.Me!==ot?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.yl=!1,this.ra(this.be),this.la(r),this}VL(t){const e=1===t?this.zN:this.CN,i=this.vN,s=this.bN,r=this.gN.fillStyleSolid(!1),n=this.gN.fillStyleRadialGradient(!1),o=this.gN.fillStyleLinearGradient(!1),h=this.gN.fillStylePaletted(!1),a=this.gN.fillStyleImage(!1);e&&i&&s&&this.ER.ZR(e).lV(e,((e,s,l,u)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(u("uScaleStart_highpart"),this.lE.OO()).cV(u("uScaleStart_lowpart"),this.lE.NO()).xO(l,i,this.ft.wi(),void 0).jV(this.uU).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(e("uColor"),this.mN);else if(r)this.ER.gR(e("uColor"),r.getColor());else if(n){if(!this._N)return!1;this.ER.mO(l,this._N,n)}else if(o){if(!this.wN)return!1;this.ER.yO(l,this.wN,o)}else if(h){const t=kg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.ER.RO(l,h.lut,t)}else if(a){if(!this.rU)return!1;this.ER.gR(u("uColor"),a.getSurroundingColor()).dV(e("uColorTexture"),this.rU.texture.Wz()||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).RV(a.fitMode)}return this.ER.QV(this.bN),!0}));const l=1===t?this.VN:this.EN,u=this.Me,c=this.FN,d=this.TN;return l&&c&&d&&this.ER.ZR(l).lV(l,((e,i,s,r)=>{this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).xO(s,c,this.ft.wi(),void 0);const n=u.getFillStyle();if(1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(n))this.ER.gR(e("uColor"),n.getColor());else if(et(n)){if(!this.LN)return!1;this.ER.mO(s,this.LN,n)}else if(rt(n)){if(!this.RN)return!1;this.ER.yO(s,this.RN,n)}const o=u.getThickness(),h=-1===o||1===o;return this.ER.Zm(h?this.ER.gl.LINE_LOOP:this.ER.gl.TRIANGLE_STRIP,this.TN),!0})),this}uN(t){return this.pN===t&&{}}OR(){return this.uU&&(this.ER.yV(this.uU),this.uU=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this.rU=this.ER.zO(this,this.rU),this}}const wy=(t,e)=>{let i=0;const s=[];for(;i0;n-=o?1:0,n-=i+n{let i=0;const s=[];for(;i0;n-=o?1:0,n-=0;const h=Math.min(n,t-r),a=i-(o?1:0),l={start:a,startUnique:r,sizeData:Math.min(e,t-a),sizeUniqueData:h};s.push(l),i+=h}return s},ky=(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 r=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},h=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ne(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=Oe(a,h),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),r=Math.max(e.startPrimary,t.iFirstVector.primary),n=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),h=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=r;i<=n;i+=1){const r=i-e.startPrimary,n=e.values[r],a=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=h;i+=1){const r=i-e.startSecondary,o=i-t.iFirstVector.secondary,h=n[r];s[a+o]=h}}}));else{const s=t[0],r=i(s);for(let t=0;t{var s,r;const n=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(n)return t.AO(null,n.RED,!1,!0,{x:e,y:i},!1,n.FLOAT,n.R32F);const o=t.gl;return(null===(r=t.gl1)||void 0===r?void 0:r.optional.OES_texture_float)?t.AO(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.AO(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Iy=(t,e,i,s)=>{e.forEach(((e,r)=>{var n,o;const h=i(r),a=s(r),l=t.gl;l.bindTexture(l.TEXTURE_2D,a),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(n=t.gl2)||void 0===n?void 0:n.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/r.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*r.sizeHeatmapDataVectors.secondary,n=s+e.tileInvalidationLength.primary*r.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,h.subarray(s,n));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,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,h.subarray(s,n));else{const t=new Uint8Array(h.buffer).subarray(4*s,4*n);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,h):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,h):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(h.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class Fy extends Kr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.cU=p("bilinear"),this.Di={x:0,y:0},this.Xw={x:1,y:1},this.pv=wr.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Yn={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}Mv(t){return this.cU.M(t),this}_v(){return this.cU._()}vv(t,e){return this.Di=t,this.Xw=e,this}xv(){return{start:this.Di,step:this.Xw,end:{x:this.Di.x+this.Xw.x*this.Yn.columns,y:this.Di.y+this.Xw.y*this.Yn.rows}}}mv(t){return this.pv="function"==typeof t?t(this.pv):t,this}bv(){return this.pv}}class Dy extends Fy{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.lE=new Ym,this.bG={},this.dU=[],this.fU=!1,this.Ja=!1,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,wireframeStyleLine:()=>qi(this.pv)&&this.pv,wireframeStyleFill:()=>{const t=this.pv&&this.pv.getFillStyle();return Y(t)&&t}}),this.AU=wy,this.nN=t,this.oN=e,this.pN=o,this.mN=h,this.ER=t.aN(),this.oN=e;const a=Math.min(this.ER.VR,void 0!==n.gU?n.gU:2048),l={x:Math.min(a,this.Yn.primaryDimensionVectorsCount),y:Math.min(a,this.Yn.secondaryDimensionVectorsCount)},u=((t,e,i)=>{const s=[],r=i(t.primaryDimensionVectorsCount,e.x),n=i(t.secondaryDimensionVectorsCount,e.y);let o;return r.forEach((t=>n.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}};s.push(i)})))),o=[],s.forEach((t=>{let e=o.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},o.push(e)),e.tiles.push(t)})),{gridTiles:s,gridTileSizes:o}})(this.Yn,l,this.AU),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.pU={gridTiles:c,gridTileSizes:d},this.vv(this.Di,this.Xw)}Ds(){const t=this.dU,e=this.be,i=this.ia(),s=this.pv,r=s!==this.mU,n=this.gN.fillStylePaletted(i),o=this.gN.fillStyleSolid(i),h=this.cU.o,a=this.cU._(),l=this.Ja,u=this.Lo._();this.yU=this.yU||this.SU();const c=this.yU,d=ky(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Iy(this.ER,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.fU=!0),this.lE.mV(this.ft);const f=this.bG;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.ER.az(em["2D"],em.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.Yn.dataOrder,intensityTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.gN.wireframeStyleLine(r),e=this.gN.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Yn.dataOrder,axisWorldTranslation:wg(this.ft),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Yn.dataOrder,axisWorldTranslation:wg(this.ft),normalSource:void 0})),geometry:ny(this.ER,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.vU=this.vU||this.xU():this.vU&&(this.ER.yV(this.vU.wireframeCoordinatesBuffer),this.vU=void 0)}if(f.mousePicking=u?this.bG.mousePicking||{shader:this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:void 0,this.bG=f,void 0===this.Ka&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Le,e=Pe;this.yU.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.Ka={min:t,max:e}}return this.Ja=!1,this.dU.length=0,this.ra(e),this.mU=s,this.cU.o=!1,this}SU(){const t=this.pU.gridTiles.map((t=>{const e=Ry(this.ER,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.pU.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.ER.oV([0,0,1,0,0,1,1,1]),s=this.ER.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}xU(){const t=this.Yn.primaryDimensionVectorsCount+1+this.Yn.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstVector.primary,y:this.Di.y+this.Xw.y*t.iFirstVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstVector.secondary,y:this.Di.y+this.Xw.y*t.iFirstVector.primary},i="columns"===this.Yn.dataOrder?{x:this.Xw.x*t.sizeHeatmapDataVectors.primary,y:this.Xw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Xw.x*t.sizeHeatmapDataVectors.secondary,y:this.Xw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstUniqueVector.primary,y:this.Di.y+this.Xw.y*t.iFirstUniqueVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstUniqueVector.secondary,y:this.Di.y+this.Xw.y*t.iFirstUniqueVector.primary},n="columns"===this.Yn.dataOrder?{x:this.Xw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Xw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Xw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Xw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.bU={boundaries:s,tilesInfo:r},this}VL(t){var e,i;const s=this.yU,r=this.bU,n=1===t?null===(e=this.bG.mousePicking)||void 0===e?void 0:e.shader:null===(i=this.bG.tile)||void 0===i?void 0:i.shader;if(this.bG.tile&&n&&s&&r){const e=n,i=this.bG.tile,o={x:(r.boundaries.max.x-r.boundaries.min.x)*Math.sign(this.Xw.x),y:(r.boundaries.max.y-r.boundaries.min.y)*Math.sign(this.Xw.y)},h={x:o.x/this.Yn.columns,y:o.y/this.Yn.rows},a=this.ft.Ui(),l={x:h.x/a.x,y:h.y/a.y};if("solid"===i.renderMode||1===t)this.ER.ZR(e).lV(e,((e,r,n)=>{if(1===t)this.ER.gR(e("uColor"),this.mN);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.ER.gR(e("uColor"),t.getColor())}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).uV(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).cV(e("uScaling"),[this.Xw.x*this.Yn.columns,this.Xw.y*this.Yn.rows]).cV(e("uTranslationAxis"),[this.Di.x,this.Di.y]).Zm(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{fillStylePaletted:n}=i,o=this.Ka;this.ER.lV(e,((i,h,a)=>{let u=!1;var c,d;return this.ER.ZR(e).cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()).RO(a,n.lut,o).uV(s.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),c=t=>{this.ER.cV(i("uTileDimensions"),["columns"===this.Yn.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const n=r.tilesInfo.get(t.tileData);if(!n)return;let o;const h=this.ER.Xz();if("bilinear"===this.cU._()){const t=(this.ft.x.dt(n.startLocationAxis.x)+l.x/2)*h,e=(this.ft.y.dt(n.startLocationAxis.y)+l.y/2)*h;o=[t,e,(this.ft.x.dt(n.startLocationAxis.x+n.sizeAxis.x)-l.x/2)*h-t,(this.ft.y.dt(n.startLocationAxis.y+n.sizeAxis.y)-l.y/2)*h-e]}else{const t=this.ft.x.dt(n.startLocationAxis.x)*h,e=this.ft.y.dt(n.startLocationAxis.y)*h;o=[t,e,this.ft.x.dt(n.startLocationAxis.x+n.sizeAxis.x)*h-t,this.ft.y.dt(n.startLocationAxis.y+n.sizeAxis.y)*h-e]}this.ER.IV(i("uTileBounds"),o).cV(i("uScaling"),[n.renderSizeAxis.x,n.renderSizeAxis.y]).cV(i("uTranslationAxis"),[n.startRenderLocationAxis.x,n.startRenderLocationAxis.y]).dV(i("uTileIntensityValues"),t.intensityDataTexture,1).Zm(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),u=!0},s.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),u}))}}const o=this.vU,h=this.bG.wireframe,a=1===t||null==h?void 0:h.shader;if(o&&h&&a&&"primitive"===h.renderMode){const{fillStyleSolid:e}=h;this.ER.ZR(a).lV(a,((i,s,r)=>((this.ft instanceof _i||this.ft instanceof $c)&&this.ER.cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()),this.ER.fV(i("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(i("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0).gR(i("uColor"),e.getColor()).uV(o.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).cV(i("uScaling"),[this.Xw.x,this.Xw.y]).cV(i("uTranslationAxis"),[this.Di.x,this.Di.y]).Zm(this.ER.gl.LINES,2*o.wireframeSegmentsLength),!0)))}else if(o&&h&&a&&"triangulated"===h.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=h;this.ER.ZR(a).lV(a,((r,n,h)=>((this.ft instanceof _i||this.ft instanceof $c)&&this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()),this.ER.fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0).gR(r("uColor"),s.getColor()).fV(r("uThicknessPixels"),i.getThickness()).cV(r("uRatioPxClip"),[2/this.cs.ai().x,2/this.cs.ai().y]).uV(o.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).cV(r("uScaling"),[this.Xw.x,this.Xw.y]).cV(r("uTranslationAxis"),[this.Di.x,this.Di.y]),e.ZR(h,!1).Zm(o.wireframeSegmentsLength),!0)))}return this}wv(t){return this.dU.push(t),Cy(this.pU.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.Ka=void 0,this}Gt(){return this.fU&&(this.pU.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Ja=!0,this.fU=!1,this.Ka=void 0),this}dispose(){super.dispose();const t=this.yU;t&&(t.gridTiles.forEach((t=>{this.ER.NR(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.ER.yV(t.rectangleLocationsBuffer)),this.yU=void 0;const e=this.vU;return e&&this.ER.yV(e.wireframeCoordinatesBuffer),this.vU=void 0,this.bG={},this}OR(){return this.dispose(),this}uN(t){return this.pN===t&&{}}$c(t){const e=t,i="columns"===this.Yn.dataOrder?e.x:e.y,s="columns"===this.Yn.dataOrder?e.y:e.x,r="columns"===this.Yn.dataOrder?this.Di.x:this.Di.y,n="columns"===this.Yn.dataOrder?this.Di.y:this.Di.x;let o=(i-r)/("columns"===this.Yn.dataOrder?this.Xw.x:this.Xw.y),h=(s-n)/("columns"===this.Yn.dataOrder?this.Xw.y:this.Xw.x);o=Math.floor(Rt(o,0,this.Yn.primaryDimensionVectorsCount-1)),h=Math.floor(Rt(h,0,this.Yn.secondaryDimensionVectorsCount-1));const a=this.MU(o,h),l="columns"===this.Yn.dataOrder?{x:this.Di.x+(o+.5)*this.Xw.x,y:this.Di.y+(h+.5)*this.Xw.y}:{x:this.Di.x+(h+.5)*this.Xw.x,y:this.Di.y+(o+.5)*this.Xw.y},u="columns"===this.Yn.dataOrder?o:h,c="columns"===this.Yn.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}Vb(t){const e=this.bU;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.Yn.dataOrder?i.x:i.y,r="columns"===this.Yn.dataOrder?i.y:i.x,n="columns"===this.Yn.dataOrder?this.Di.x:this.Di.y,o="columns"===this.Yn.dataOrder?this.Di.y:this.Di.x,h="columns"===this.Yn.dataOrder?this.Xw.x:this.Xw.y,a="columns"===this.Yn.dataOrder?this.Xw.y:this.Xw.x,l=Rt((s-n)/h-.5,0,this.Yn.primaryDimensionVectorsCount-1),u=Rt((r-o)/a-.5,0,this.Yn.secondaryDimensionVectorsCount-1),c=Rt(Math.ceil(l)-1,0,this.Yn.primaryDimensionVectorsCount-1),d=Rt(Math.ceil(u)-1,0,this.Yn.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.MU(c,d)},g={point:{x:c,y:d+1},value:this.MU(c,d+1)},m={point:{x:c+1,y:d},value:this.MU(c+1,d)},y={point:{x:c+1,y:d+1},value:this.MU(c+1,d+1)},p=_n({x:l,y:u},f,g,m,y);if(void 0===p)return;const x=Rt(Math.floor(l+.5),0,this.Yn.primaryDimensionVectorsCount-1),S=Rt(Math.floor(u+.5),0,this.Yn.secondaryDimensionVectorsCount-1),A="columns"===this.Yn.dataOrder?x:S,v="columns"===this.Yn.dataOrder?S:x,b=t;return{x:b.x,y:b.y,column:A,row:v,cellValue:p}}MU(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,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}return 0}bt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.max.x)||0}xt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.min.x)||0}_t(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.max.y)||0}Mt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.min.y)||0}xl(){return 0}bl(){return 0}B_(){const t=[];return this.pU.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.Xw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.bW=new my(this.ft,this));const t=this.bW.AW(this.JM,this.Su._());if(t>0){for(let e=0;e0?this.JM[0].boundaries.min.x:Le:this.Ha.min.y=this.JM.length>0?this.JM[0].boundaries.min.y:Le}this.JM.forEach((t=>t.shape.Ds()));const e=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.Ka)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.Ka)||void 0===s?void 0:s.max,Pe)),t}),{min:Le,max:Pe});return this.JM.forEach((t=>{t.shape.Ka=e})),this.Su.o=!1,this}VL(t){return this.JM.forEach((e=>e.shape.VL(t))),this}Iv(t){if(0===t.length)return this;let e=0;const i=this.wU.dataPerSegment,s=t.length;do{let r=this.JM[this.JM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Yn.scrollDimension?i:this.Yn.resolution,rows:"rows"===this.Yn.scrollDimension?i:this.Yn.resolution,heatmapDataType:this.Yn.heatmapDataType,dataOrder:this.Yn.scrollDimension};let e="columns"===this.Yn.scrollDimension?{x:this.Di.x+this.Xw.x*this._U,y:this.Di.y}:{x:this.Di.x,y:this.Di.y+this.Xw.y*this._U};this.JM.length>0&&(e="columns"===this.Yn.scrollDimension?{x:e.x-1*this.Xw.x,y:e.y}:{x:e.x,y:e.y-1*this.Xw.y},o=!0);const s=new Dy(this.nN,this.oN,this.ft,kt,[],t,this.pN,this.mN).Mv(this.cU._()).ke(this.be).mv(this.pv).vv(e,this.Xw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this._U,hasJoint:!1,boundaries:{min:{x:s.xt(),y:s.Mt()},max:{x:s.bt(),y:s._t()}}},this.JM.push(r),n=i-(o?1:0)}const h=s-e,a=Math.min(n,h),l=t.slice(e,e+a),u={type:"intensity",values:l,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:a,lengthSecondary:this.Yn.resolution};o&&(u.values.unshift(this.CU),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.wv(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.CU=l[l.length-1],this._U+=a,e+=a}while(e{const n=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const h=i-n,a=Math.min(s,o),l=a-h+1,u=e.slice(h-i,a-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:r,startPrimary:h,lengthPrimary:l,values:u};t.shape.wv(c)}));const n=this._U-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().OR()})),this.JM.length=0,this.Ha="columns"===this.Yn.scrollDimension?m({x:this.Di.x,y:this.Di.y},{x:this.Di.x,y:this.Di.y+this.Yn.resolution*this.Xw.y}):m({x:this.Di.x,y:this.Di.y},{x:this.Di.x+this.Yn.resolution*this.Xw.x,y:this.Di.y}),this._U=0,this.CU=void 0,this}vv(t,e){return super.vv(t,e),this.JM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.vv(r,e),i.boundaries={min:{x:i.shape.xt(),y:i.shape.Mt()},max:{x:i.shape.bt(),y:i.shape._t()}}})),this.JM.length>0?this.Ha=Je(...this.JM.map((t=>t.boundaries))):this.Ha="columns"===this.Yn.scrollDimension?m({x:this.Di.x,y:this.Di.y},{x:this.Di.x,y:this.Di.y+this.Yn.resolution*this.Xw.y}):m({x:this.Di.x,y:this.Di.y},{x:this.Di.x+this.Yn.resolution*this.Xw.x,y:this.Di.y}),this}ke(t){return super.ke(t),this.JM.forEach((t=>t.shape.ke(this.be))),this}mv(t){return super.mv(t),this.JM.forEach((t=>t.shape.mv(this.pv))),this}Mv(t){return super.Mv(t),this.JM.forEach((e=>e.shape.Mv(t))),this}dispose(){return super.dispose(),this.JM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.JM.forEach((e=>e.shape.setVisible(t))),this}OR(){return this.JM.forEach((t=>t.shape.OR())),this}uN(t){return this.pN===t&&{}}$c(t){const e=dt(t,this.ft,this.engine.ft),i=this.JM.reduce(((i,s)=>{const r=s.shape.$c(t);if(r){const t=We(dt(r,this.ft,this.engine.ft),e);if(void 0===i||t=this._U||"rows"===this.Yn.scrollDimension&&e>=this._U)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}Vb(t){const e=dt(t,this.ft,this.engine.ft),i=this.JM.reduce(((i,s)=>{const r=s.shape.Vb(t);if(r){const t=We(dt(r,this.ft,this.engine.ft),e);if(void 0===i||t=this._U||"rows"===this.Yn.scrollDimension&&e>=this._U)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}ds(t){return super.ds(t),this.JM.forEach((e=>e.shape.ds(t))),this}}class _y extends Kr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.cU=p("bilinear"),this.pv=wr.lineStyle,this.Yn=n}Mv(t){return this.cU.M(t),this}_v(){return this.cU._()}mv(t){return this.pv="function"==typeof t?t(this.pv):t,this}bv(){return this.pv}}class Vy extends _y{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.lE=new Ym,this.bG={},this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=o,this.mN=h,this.ER=t.aN(),this.oN=e,this.P_=new Dy(this.nN,t.kU,t.ft,kt,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",gU:this.ER.VR},-1,R).mv(ot);const a=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*a,i=Math.cos(e),s=Math.sin(e);l[u+0]=i,l[u+1]=s,u+=2}this.TU={vertexBuffer:this.ER.oV(l),drawMode:this.ER.gl.TRIANGLE_FAN,drawLength:362}}Ds(){const t=this.ia(),e=this.be,i=this.gN.fillStyleSolid(t),s=this.gN.fillStylePaletted(t),r=i||s,n=this.cU._(),o=this.cU.o,h=this.Lo._(),a=this.Lo.o;return this.lE.mV(this.ft),this.P_.Ds(),this.P_.yU?((t||o)&&(this.bG.fill=r?{shader:this.ER.az(em["2D"],em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),normalSource:void 0}),s&&em.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.Yn.dataOrder,lut:s.lut}),i&&em.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.bG.mousePicking=h?{shader:this.ER.az(em["2D"],em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),normalSource:void 0}),em.Color({dataType:"uniform"}))}:void 0),this.ra(e),this.cU.o=!1,this.Lo.o=!1,this):this}VL(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:r}=this.TU,n=this.P_.yU;if(!this.bG.fill||!n)return this;const{fillStylePaletted:o,fillStyleSolid:h}=this.bG.fill,a=1===t?null===(e=this.bG.mousePicking)||void 0===e?void 0:e.shader:this.bG.fill.shader;if(!a)return this;const l=this.ft.yb(),u=Math.min(l.start,l.end),c=Math.max(l.start,l.end),d=Math.min(this.Yn.amplitudeStart,this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep),f=Math.max(this.Yn.amplitudeStart,this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep);let g;return g=l.end>l.start?Math.min(f,c)-l.start:Math.max(d,u)-l.start,this.ER.ZR(a).lV(a,((e,a,l,u)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(u("uViewportSize"),[this.nN.ai().x*this.ER.Xz(),this.nN.ai().y*this.ER.Xz()]).cV(e("uScaling"),[g,g]).cV(e("uTranslationAxis"),[0,0]).uV(i,void 0,{location:a("aPos"),size:2}).fV(u("uAngleOffset"),this.ft.Mb()%(2*Math.PI)).fV(u("uAngleDirection"),this.ft.Tb()?1:-1).fV(u("uSectors"),this.Yn.sectors).fV(u("uAnnuli"),this.Yn.annuli),1===t)this.ER.gR(e("uColor"),this.mN);else{if(this.ER.fV(e("uAmplitudeStart"),this.Yn.amplitudeStart).fV(e("uAmplitudeStep"),this.Yn.amplitudeStep).fV(e("uAmplitudeAxisStart"),this.ft.yb().start).fV(e("uAmplitudeAxisEnd"),this.ft.yb().end),o){const t=this.P_.Ka;this.ER.RO(l,o.lut,t).dV(e("uTileIntensityValues"),n.gridTiles[0].intensityDataTexture,0)}h&&this.ER.gR(e("uColor"),h.getColor())}return this.ER.Zm(r,s),!0})),this}wv(t){return this.P_.wv(t),this}Gt(){return this.P_.Gt(),this}dispose(){return super.dispose(),this.P_.dispose(),this.bG={},this.ER.yV(this.TU.vertexBuffer),this}OR(){return this.dispose(),this}ke(t){return super.ke(t),this.P_.ke(this.be),this}uN(t){return this.pN===t&&{}}$c(t){const e=this.Yn.amplitudeStart,i=this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;let n=Math.round((t.angle-0)/360*this.Yn.sectors);n>=this.Yn.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.Yn.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.MU(o,n),angle:n*(360/this.Yn.sectors),amplitude:e+o*(i-e)/(this.Yn.annuli-1)}}Vb(t){const e=this.Yn.amplitudeStart,i=this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;const n=(t.angle-0)/360*this.Yn.sectors,o=(t.amplitude-e)/(i-e)*(this.Yn.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.MU(a,h)},u={point:{x:a,y:h+1},value:this.MU(a,h+1)},c={point:{x:a+1,y:h},value:this.MU(a+1,h)},d={point:{x:a+1,y:h+1},value:this.MU(a+1,h+1)},f=_n({x:o,y:n},l,u,c,d);return void 0!==f?{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}MU(t,e){const i="annuli"===this.Yn.dataOrder?t:e,s="annuli"===this.Yn.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,r=s-e.iFirstVector.secondary,n=t*e.sizeHeatmapDataVectors.secondary+r;return e.intensityData[n]}}return 0}bt(){return 0}xt(){return 0}_t(){return 0}Mt(){return 0}xl(){return 0}bl(){return 0}}class By extends Pm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.lG();this.uG=t.oV(e),this.dG=s,this.fG=i}ZR(t){return this.ER.uV(this.uG,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Zm(t,e,i){return this.ER.JV(void 0!==e?e:this.fG,i||0,this.dG,t),this}lG(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.ER.gl.TRIANGLES,drawSize:6}}Tz(){this.ER.yV(this.uG)}}const zy=t=>{let e=t.wV._z.get(void 0);return e||(e=new By(t),t.wV._z.set(void 0,e),e)};class Ny extends an{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.FU=wr.fillStyle,this.IU=wr.fillStyle,this.PU=p(e.PointShape.Circle),this.DU=p(5),this.BU=p(0),this.LU=p(void 0),this.jC=!0,this.RU={x:0,y:0}}dd(t){return this.FU=jr(this.FU,t),this}QC(){return this.FU}EU(){return $r(this.zU,this.FU)}VU(){return $r(this.OU,this.IU)}ud(t){return this.IU=jr(this.IU,t),Zn(this.IU)&&(this.Ad(e.PointShape.Square),this.Sd(1)),this}yd(){return this.IU}Ad(t){return this.PU.M(t),io(this.PU._())&&this.Sd(1),this}gd(){return this.PU._()}Sd(t){return this.DU.M(t),this}JC(){return this.DU._()}pd(t){return this.BU.M(t),this}md(){return this.BU._()}KC(t){return this.RU=t,this}qC(){return this.RU}XC(t){return this.LU.M(t),this}tk(){return this.LU._()}}class Oy extends uy{constructor(t,e){super(t,e),this.$G=!1,this.XG={enabled:!1,totalDataPointsAtTime:0},this.ZG=t instanceof _i?{type:"linear",scale:t}:{type:"unknown"},this.HG.Yo("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.$G=!0)}))}NU(t,e){var i,s;const r=null==t?void 0:t.kc,n=null==t?void 0:t.Tc,o=null==t?void 0:t.uc,h=null==t?void 0:t.lc;if(!t||this.$G||!this.WG||"linear"!==this.ZG.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.Cc())||void 0===i?void 0:i.x,l=null===(s=t.Hc())||void 0===s?void 0:s.x;if(o<2||void 0===a||void 0===l)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,a,o),c=this.ZG.scale,d=Math.abs("x"===this.WG?c.Ui().x:c.Ui().y),f=d/u,g=Math.floor(.8*f),m=g*u,y=g>=4,p=this.XG.enabled?this.XG.columnWidthAxis/d<1.5:void 0,x=this.XG.enabled&&g>this.XG.dataPointsPerColumn?g/this.XG.dataPointsPerColumn>=2:void 0;let S;return!0===this.XG.enabled?p?x&&(S={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}):S=y?{enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:y&&(S={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.XG=S||{...this.XG,totalDataPointsAtTime:o},!!S&&this.Zp(),{cpStateChanged:!!S,cpActive:this.XG.enabled}}GU(t,e){var i,s,r;const n=t.kc,o=t.Tc,h=t.cc,a=t.uc,l=t.lc;if(this.$G||!this.XG.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.XG.columnWidthAxis,d=this.ft.x.getInnerStart(),f=this.ft.x.getInnerEnd(),g=ho(d,f,n,h,a,l,e,1);if(!g)return;const m=n[g.iFirstSampleDataArray];if(this.WU){if(this.WU.iFirstPackedSample0)if(this.WU.packedColumnsCount-=t,this.WU.packedColumnsCount>0){this.WU.packedDataX.splice(0,2*t),this.WU.packedDataY.splice(0,2*t),this.WU.packedDataColors&&this.WU.packedDataColors.splice(0,2*t),this.WU.packedDataLookupValues&&this.WU.packedDataLookupValues.splice(0,2*t),this.WU.origin+=t*c;const e=ao(this.WU.origin,Math.max(h-1-u+1,0),h-1,(t=>n[oo(t,h,u)])),i=oo(e,h,u);this.WU.iFirstPackedSample=n[i]>=this.WU.origin?e:e+1}else this.WU=void 0}if(void 0!==(null===(i=this.WU)||void 0===i?void 0:i.iLastPackedSample)&&this.WU.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.WU.origin+this.WU.packedColumnsCount*c-t)/c),this.WU.packedColumnsCount);if(e>0)if(this.WU.packedColumnsCount-=e,this.WU.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.WU.packedDataX.pop(),this.WU.packedDataY.pop(),this.WU.packedDataColors&&this.WU.packedDataColors.pop(),this.WU.packedDataLookupValues&&this.WU.packedDataLookupValues.pop();const t=ao(this.WU.origin+this.WU.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[oo(t,h,u)])),i=oo(t,h,u);this.WU.iLastPackedSample=n[i]<=this.WU.origin+this.WU.packedColumnsCount*c?t:t-1}else this.WU=void 0}}const y=this.WU||{origin:m,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.Ec?[]:void 0,packedDataLookupValues:t.Rc?[]:void 0,packedDataSize:t.zc?[]:void 0,packedDataRotation:t.Vc?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},p=(t,e,i)=>{let s=Math.min(t,t+e*c),r=Math.max(t,t+e*c),a=i;const l=[];let m=Pe,p=Pe,x=-1,S=Le,A=Le,v=-1,b=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const i=a%u,g=n[i],M=o[i];if(s<=g&&g<=r)b+=1,Number.isNaN(M)||(M>p&&(m=g,p=M,x=a),M0)m=m===Pe?Number.NaN:m,p=p===Pe?Number.NaN:p,S=S===Le?Number.NaN:S,A=A===Le?Number.NaN:A,x0?(y.packedDataX.push(m),y.packedDataY.push(p),y.packedDataX.push(S),y.packedDataY.push(A)):(y.packedDataX.unshift(S),y.packedDataY.unshift(A),y.packedDataX.unshift(m),y.packedDataY.unshift(p))):(l.push({iFirst:v,iSecond:x}),e>0?(y.packedDataX.push(S),y.packedDataY.push(A),y.packedDataX.push(m),y.packedDataY.push(p)):(y.packedDataX.unshift(m),y.packedDataY.unshift(p),y.packedDataX.unshift(S),y.packedDataY.unshift(A)));else{const t=e>0?y.iLastPackedSample:y.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(y.packedDataX.push(Number.NaN),y.packedDataY.push(Number.NaN),y.packedDataX.push(Number.NaN),y.packedDataY.push(Number.NaN)):(y.packedDataX.unshift(Number.NaN),y.packedDataY.unshift(Number.NaN),y.packedDataX.unshift(Number.NaN),y.packedDataY.unshift(Number.NaN));else{const i=oo(t,h,u),a=n[i],d=o[i],f=(s+r)/2,m=f-e*c/6,p=d+(m-a)/(g-a)*(M-d),x=f+e*c/6,S=d+(x-a)/(g-a)*(M-d);l.push({iFirst:t,iSecond:t}),e>0?(y.packedDataX.push(m),y.packedDataY.push(p),y.packedDataX.push(x),y.packedDataY.push(S)):(y.packedDataX.unshift(m),y.packedDataY.unshift(p),y.packedDataX.unshift(x),y.packedDataY.unshift(S))}}if(y.packedColumnsCount+=1,e>0?y.iLastPackedSample=a-1:(y.iFirstPackedSample=a+1,y.origin=s),s=Math.min(t+l.length*e*c,t+(l.length+1)*e*c),r=Math.max(t+l.length*e*c,t+(l.length+1)*e*c),b=0,m=Pe,p=Pe,x=-1,S=Le,A=Le,v=-1,sf)break}}return l},x=p(y.origin+y.packedColumnsCount*c,1,void 0!==(null===(s=this.WU)||void 0===s?void 0:s.iLastPackedSample)?this.WU.iLastPackedSample+1:g.iFirstSample),S=p(y.origin,-1,void 0!==(null===(r=this.WU)||void 0===r?void 0:r.iFirstPackedSample)?this.WU.iFirstPackedSample-1:g.iFirstSample),A=t.Ec&&y.packedDataColors?[t.Ec,y.packedDataColors]:void 0,v=t.Rc&&y.packedDataLookupValues?[t.Rc,y.packedDataLookupValues]:void 0,b=t.zc&&y.packedDataSize?[t.zc,y.packedDataSize]:void 0,M=t.Vc&&y.packedDataRotation?[t.Vc,y.packedDataRotation]:void 0;if(A||v||b||M){for(const t of x){const e=oo(t.iFirst,h,u),i=oo(t.iSecond,h,u);A&&A[1].push(A[0][e],A[0][i]),v&&v[1].push(v[0][e],v[0][i]),b&&b[1].push(b[0][e],b[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of S){const e=oo(t.iFirst,h,u),i=oo(t.iSecond,h,u);A&&A[1].unshift(A[0][i],A[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.WU=y.packedColumnsCount>0?y:void 0,{x:y.packedDataX,y:y.packedDataY,color:y.packedDataColors,lookup:y.packedDataLookupValues,size:y.packedDataSize,rotation:y.packedDataRotation}}Zp(){this.WU=void 0}iW(t){if(this.WG&&"linear"===this.ZG.type){const e="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Ke===zs.progressive||e.Ke===zs.regressive){const e=Math.abs("x"===this.WG?this.ZG.scale.x.getInnerInterval():this.ZG.scale.y.getInnerInterval());if(this.XG.enabled)return 2*e/this.XG.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.WG?s.x:s.y,"x"===this.WG?r.x:r.y,i)}}}sW(t,e,i){if(!this.WG)return e;const s=i.length;let r=Nr(i,t.min,this.WG,this.UG,0,s-1);void 0===r&&(r=this.UG?s-1:0);let n=Nr(i,t.max,this.WG,this.UG,0,s-1);return void 0===n&&(n=this.UG?0:s-1),1+Math.abs(n-r)}eW(){}}class Uy extends Ny{constructor(t,e,i,s,r,n){super(t,e,i,s),this.lE=new Ym,this.vW=new Oy(this.ft,this),this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillIndividual:()=>{const t=this.uu.getFillStyle();return X(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t},areaFillSolid:()=>Y(this.FU)&&this.FU,areaFillLinearGradient:()=>rt(this.FU)&&this.FU,areaFillRadialGradient:()=>et(this.FU)&&this.FU,areaFillIndividual:()=>X(this.FU)&&this.FU,areaFillPaletted:()=>j(this.FU)&&this.FU,markerFillSolid:()=>Y(this.IU)&&this.IU,markerFillLinearGradient:()=>rt(this.IU)&&this.IU,markerFillRadialGradient:()=>et(this.IU)&&this.IU,markerFillPaletted:()=>j(this.IU)&&this.IU,markerFillIndividual:()=>X(this.IU)&&this.IU,markerFillImage:()=>Zn(this.IU)&&this.IU,markerShapeIcon:()=>{const t=this.PU._();return io(t)&&t}}),this.ad=p(void 0),this.UU=[],this.Ja=!1,this.YU=[],this.HU=void 0,this.nU=(t,e,i)=>{var s;const r=null===(s=this.$U)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.ai().x,o=r.ai().y),Bm(t,e,n*this.DU._(),o*this.DU._(),i)},this.oN=e,this.bG={type:"none"},this.ER=t.aN(),this.nN=t,this.vG=this.ER.hO,this.pN=r,this.mN=n}ld(t){return this.ad.M(Fe(t,this.ad._(),(()=>[t.Xc(((e,i)=>{this.UU.push({min:e,max:i}),void 0===t.Wc()&&this.XU&&this.YU.push({min:e,max:i})})),t.jc((()=>{this.Ja=!0,this.XU=void 0,this.HU=void 0,this.vW.Zp()}))]))),this.HU=void 0,this}Ds(){var t,i,s,r,n,o,h,a,l,c,d,f,g,m,y;const p=null===(t=this.ad._())||void 0===t?void 0:t.Ut,x=this.ad.o,S=null==p?void 0:p.kc,A=null==p?void 0:p.Tc;if(!p||!S||!A)return this;const v=p.Rc,b=p.Ec,M=p.zc,E=p.Vc,w=p.cc,T=p.uc,k=p.lc,C=this.uu,R=this.FU,I=x||this.na()||this.EU()||this.VU(),F=this.gN.lineStyleSolid(I),D=this.gN.lineStyleDashed(I),L=F||D,P=L&&L.getThickness(),_=this.gN.strokeFillSolid(I),V=this.gN.strokeFillLinearGradient(I),B=this.gN.strokeFillRadialGradient(I),z=this.gN.strokeFillIndividual(I),N=this.gN.strokeFillPaletted(I),O=_||V||B||z||N,U=this.gN.areaFillSolid(I),G=this.gN.areaFillLinearGradient(I),Y=this.gN.areaFillRadialGradient(I),H=this.gN.areaFillIndividual(I),X=this.gN.areaFillPaletted(I),W=U||G||Y||H||X,j=this.gN.markerFillSolid(I),$=this.gN.markerFillLinearGradient(I),Z=this.gN.markerFillRadialGradient(I),K=this.gN.markerFillPaletted(I),J=this.gN.markerFillIndividual(I),q=this.gN.markerFillImage(I),Q=j||$||Z||K||J||q,tt=this.PU._(),et=this.PU.o,it=this.gN.markerShapeIcon(et),st=this.DU._(),rt=this.DU.o,nt=this.LU.o,ot=this.UU.length>0||nt,ht=this.Ja,at=ht?[p.Uc()]:(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.UU),lt=this.ft.x.Ht,ut=this.ft.x.getInnerStart(),ct=this.ft.x.getInnerEnd(),dt=p.Wc(),ft=!!D,gt=this.Lo._(),mt=this.Lo.o,{cpStateChanged:yt,cpActive:pt}=this.vW.NU(p,this.jC);if(dt&&pt&&(yt||ht||ot||lt||I)){const t=this.vW.GU(p,dt);if(t){const e=!yt&&!ht&&!I;this.jU=Gy(this.ER,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ft,this.jU,e,dt,1e3,this.ft.wi(),(t=>Kt(t,this.ft.wi()))),this.ZU={min:Le,max:Pe};const s=t.y.length;for(let e=0;ethis.KU.iLastSample||I){let i,s,r,n,o,h;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=S.subarray(e.offset,e.offset+e.count),s=A.subarray(e.offset,e.offset+e.count),r=b?b.subarray(e.offset,e.offset+e.count):void 0,n=v?v.subarray(e.offset,e.offset+e.count):void 0,o=M?M.subarray(e.offset,e.offset+e.count):void 0,h=E?E.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],a=t.dataRanges[1],l=e.count+a.count;i=new Float32Array(l),i.set(S.subarray(e.offset),0),i.set(S.subarray(a.offset,a.offset+a.count),e.count),s=new Float32Array(l),s.set(A.subarray(e.offset),0),s.set(A.subarray(a.offset,a.offset+a.count),e.count),b&&(r=new Uint32Array(l),r.set(b.subarray(e.offset),0),r.set(b.subarray(a.offset,a.offset+a.count),e.count)),v&&(n=new Float32Array(l),n.set(v.subarray(e.offset),0),n.set(v.subarray(a.offset,a.offset+a.count),e.count)),M&&(o=new Float32Array(l),o.set(M.subarray(e.offset),0),o.set(M.subarray(a.offset,a.offset+a.count),e.count)),E&&(h=new Float32Array(l),h.set(E.subarray(e.offset),0),h.set(E.subarray(a.offset,a.offset+a.count),e.count))}const l=!yt&&!ht&&!I;this.JU=Gy(this.ER,[i,s],r,n,o,h,ft,this.JU,l,dt,1e3,this.ft.wi(),(t=>Kt(t,this.ft.wi())));let c=i,d=s,f=r,g=n;const m=this.LU._();if(m){const t="spline"===m.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:r,colors:n}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:r?Array.from(r):void 0,colors:n?Array.from(n):void 0};const o=((t,e)=>{const i=1e-5,s=t.length-1,r=Array(s);if(s>1){let n=u(0,0),o=u(0,0),h=u(0,0),a=ii(hi({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*n.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=oi(ni(n,c),g[1]),g[2]=hi(g[2],ni(o,d)),r[f]=g}}return r.length>0?r:[]})(i,s),h=o.length,a=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:r,lookupValues:n,colors:o}=t,h=[],a=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=r[0];h[t]=e,a[t]=i,t+=1;for(let n=1;nKt(t,this.ft.wi()))),this.KU=t}}if(!dt&&(ht||ot||I)){if(!this.jU||this.jU.bufferSize{var s,r,n,o;const h=S.subarray(i.min,i.max+1),a=A.subarray(i.min,i.max+1);if(this.ER.VV(t,i.min*(this.ft.wi()?2:1),Kt(h,this.ft.wi())),this.ER.VV(e,i.min*(this.ft.wi()?2:1),Kt(a,this.ft.wi())),b&&(null===(s=this.jU)||void 0===s?void 0:s.bufferColors)){const t=b.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferColors,i.min,t,Uint32Array)}if(v&&(null===(r=this.jU)||void 0===r?void 0:r.bufferLookupValues)){const t=v.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferLookupValues,i.min,t,Float32Array)}if(E&&(null===(n=this.jU)||void 0===n?void 0:n.bufferRotations)){const t=E.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferRotations,i.min,t,Float32Array)}if(M&&(null===(o=this.jU)||void 0===o?void 0:o.bufferSizes)){const t=M.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferSizes,i.min,t,Float32Array)}})),this.jU.valueCount=p.uc}this.JU=this.jU}if(this.lE.mV(this.ft),I||rt||et||mt){if(O&&L&&!1!==P){const t=-1===P?"primitive":"triangulated",e=N?["lookup",N.lookUpProperty,N.lut]:z?"attribute":V?["gradient",V]:B?["gradient",B]:"uniform";this.bG="primitive"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTexture),lineStyleSolid:F,lineStyleDashed:D,fillStyleSolid:_,fillStyleLinearGradient:V,fillStyleRadialGradient:B,fillStyleIndividual:z,fillStylePaletted:N,mousePickingShader:gt&&this.ER.az(em["2D"],em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTexture,em.MousePicking)}:"triangulated"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),this.vG?em.AliasedEdge:void 0,D&&em.StippleTextureInstanced),geometry:ny(this.ER,P),thickness:P,lineStyleSolid:F,lineStyleDashed:D,fillStyleSolid:_,fillStyleLinearGradient:V,fillStyleRadialGradient:B,fillStyleIndividual:z,fillStylePaletted:N,mousePickingShader:gt&&this.ER.az(em["2D"],em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTextureInstanced,em.MousePicking)}:{type:"none"}}else this.bG={type:"none"};if(this.qU=W?{shader:this.ER.az(em["2D"],X&&em.Color({dataType:["lookup",X.lookUpProperty,X.lut]}),H&&em.Color({dataType:"attribute"}),U&&em.Color({dataType:"uniform"}),G&&em.Color({dataType:["gradient",G]}),Y&&em.Color({dataType:["gradient",Y]}),em.Area2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0})),geometry:zy(this.ER),fillStyleSolid:U,fillStyleLinearGradient:G,fillStyleRadialGradient:Y,fillStyleIndividual:H,fillStylePaletted:X,mousePickingShader:gt&&this.ER.az(em["2D"],em.Area2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),em.MousePicking)}:void 0,Q){const t=!(!q&&!it),e=st>1||t,i=M?"attribute":"uniform",s=!e&&em.PointSize("uniform"),r=em.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:E?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:E?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0});this.$U={shader:this.ER.az(em["2D"],s,r,j&&em.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!it}),$&&em.Color({dataType:["gradient",$],overrideOpacity:!0,maskTexture:!!it}),Z&&em.Color({dataType:["gradient",Z],overrideOpacity:!0,maskTexture:!!it}),K&&em.Color({dataType:["lookup",K.getLookUpProperty(),K.getPalette()],overrideOpacity:!0,maskTexture:!!it}),J&&em.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!it}),q&&em.Color({dataType:["image",q],overrideOpacity:!0,maskTexture:!!it})),geometry:Ay(tt,this.ER,"uniform"===i?st:25),fillStyleSolid:j,fillStyleLinearGradient:$,fillStyleRadialGradient:Z,fillStylePaletted:K,fillStyleIndividual:J,fillStyleImage:q,mousePickingShader:gt&&this.ER.az(em["2D"],s,r,em.MousePicking),shapeIcon:it,pointSizeAsScale:t,instancedRendering:e}}else this.$U=void 0}const xt=Wr({min:{x:this.xt(),y:this.ft.y.getInnerStart()},max:{x:this.bt(),y:this._t()}},{x:this.xl(),y:this.bl()},this.ft),St=Wr({min:{x:this.xt(),y:this.Mt()},max:{x:this.bt(),y:this._t()}},{x:this.xl(),y:this.bl()},this.ft);if(this.tY=this.ER.GO(V,this,St),this.iY=this.ER.WO(B,this,St),this.sY=this.ER.GO(G,this,xt),this.eY=this.ER.WO(Y,this,xt),this.hY=this.ER.GO($,this,St),this.rY=this.ER.WO(Z,this,St),(void 0===this.HU||ot)&&v&&(Cg(N)||Cg(X)||Cg(K))){const t=this.HU?at:[p.Uc()];let e=this.HU?this.HU.max:Pe,i=this.HU?this.HU.min:Le;const s=v;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.HU={min:i,max:e}}return this._G=D?this.ER.PO(D.getPattern()):void 0,this.rU=this.ER.EO(this,this.rU,q,it,rt,this.nU),this.Au(C),this.zU=R,this.OU=this.IU,this.PU.o=!1,this.DU.o=!1,this.UU.length=0,this.Ja=!1,this.LU.o=!1,this.ad.o=!1,this.Lo.o=!1,this}VL(t){var e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p;const x=this.ER.gl,S=null===(e=this.jU)||void 0===e?void 0:e.bufferX,A=null===(i=this.jU)||void 0===i?void 0:i.bufferY,v=null===(s=this.jU)||void 0===s?void 0:s.bufferColors,b=null===(r=this.jU)||void 0===r?void 0:r.bufferLookupValues,M=null===(n=this.jU)||void 0===n?void 0:n.valueCount,E=null===(o=this.JU)||void 0===o?void 0:o.valueCount,w=null===(h=this.ad._())||void 0===h?void 0:h.Ut,T=null==w?void 0:w.Wc();if(!S||!A||!w)return this;const k=(e,i,s)=>{if(Hy(this.ER,e,this.ft.wi(),S,"aLocation","X",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT),Hy(this.ER,e,this.ft.wi(),A,"aLocation","Y",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!v)return!1;Hy(this.ER,e,!1,v,"aColor","",4,!0,x.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!b)return!1;Hy(this.ER,e,!1,b,"aLookupValue","",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},C=1===t?null===(a=this.qU)||void 0===a?void 0:a.mousePickingShader:null===(l=this.qU)||void 0===l?void 0:l.shader;if(this.qU&&C&&void 0!==M&&M>0&&T){const e=this.qU;this.ER.ZR(C).lV(C,((i,s,r,n)=>!!this.ER.VO(r,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStylePaletted:e.fillStylePaletted,linearGradientInfo:this.sY,radialGradientInfo:this.eY,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:null})&&!!k(r,e.fillStyleIndividual,e.fillStylePaletted)&&(null==e||e.geometry.ZR(r).Zm(M-1),!0)))}const R="none"===this.bG.type?void 0:1===t?this.bG.mousePickingShader:this.bG.shader;if("none"!==this.bG.type&&R&&void 0!==M&&M>0){const e=this.bG;this.ER.ZR(R).lV(R,((i,s,r,n)=>{var o,h;if(!this.ER.VO(r,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStylePaletted:e.fillStylePaletted,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStyleIndividual:e.fillStyleIndividual,linearGradientInfo:this.tY,radialGradientInfo:this.iY,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:"primitive"===e.type?b:null,colorBuffer:"primitive"===e.type?v:null,coordsX:"primitive"===e.type?S:void 0,coordsY:"primitive"===e.type?A:void 0,coordsHighPrecision:this.ft.wi()}))return!1;if(e.lineStyleDashed){if(!this._G)return!1;this.ER.cV(i("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(n("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(i("uStippleScale"),e.lineStyleDashed.getPatternScale()).dV(i("uStippleTexture"),this._G.DO,1)}if("primitive"===e.type){if(e.lineStyleDashed){if(!(null===(o=this.jU)||void 0===o?void 0:o.bufferLengthSoFar))return!1;this.ER.WV(s("aLengthSoFar"),this.jU.bufferLengthSoFar)}hy.yG(this.nN,M)}else{if(!k(r,e.fillStyleIndividual,e.fillStylePaletted))return!1;if(e.lineStyleDashed){if(!(null===(h=this.jU)||void 0===h?void 0:h.bufferLengthSoFar))return!1;Hy(this.ER,r,!1,this.jU.bufferLengthSoFar,"aLengthSoFar","",2,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT)}oy.VL(this.nN,e.geometry,r,this.vG&&1!==t,1===t,e.thickness,M-1)}return!0}))}const I=null===(u=this.JU)||void 0===u?void 0:u.bufferX,F=null===(c=this.JU)||void 0===c?void 0:c.bufferY,D=null===(d=this.JU)||void 0===d?void 0:d.bufferColors,L=null===(f=this.JU)||void 0===f?void 0:f.bufferLookupValues,P=null===(g=this.JU)||void 0===g?void 0:g.bufferSizes,_=null===(m=this.JU)||void 0===m?void 0:m.bufferRotations,V=1===t?null===(y=this.$U)||void 0===y?void 0:y.mousePickingShader:null===(p=this.$U)||void 0===p?void 0:p.shader,B=this.$U;let z=1;if(T){const t=this.ad?Math.abs((this.bt()-this.xt())/w.getSampleCount()):0,e=this.ft.x.getInnerInterval()/t,i=this.DU._(),s=this.ft.x.ni()/i/1,r=2*s;z=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(V&&B&&I&&F&&z>0&&void 0!==E&&E>0){const e=B,i=e.instancedRendering?1:0;this.ER.ZR(V).lV(V,((s,r,n,o)=>{if(!this.ER.VO(n,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,linearGradientInfo:this.hY,radialGradientInfo:this.rY,fillStylePaletted:e.fillStylePaletted,fillStyleIndividual:e.fillStyleIndividual,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:L,lookupValueAttribDivisor:i,colorBuffer:D,colorAttribDivisor:i,fillStyleImage:e.fillStyleImage,texturedFillGLInfo:this.rU,texCoordAttribDivisor:0,maskTexture:e.shapeIcon&&this.rU,maskTextureCoordsAttribDivisor:0}))return!1;if(this.ft.wi()?this.ER.uV(I,i,{location:r("aPos_highpartX"),size:1},{location:r("aPos_lowpartX"),size:1}).uV(F,i,{location:r("aPos_highpartY"),size:1},{location:r("aPos_lowpartY"),size:1}):this.ER.XV(r("aPosX"),I,i).XV(r("aPosY"),F,i),1!==t&&this.ER.fV(s("uOpacity"),z),e.instancedRendering)if(_)this.ER.XV(r("aRotDeg"),_,i).fV(s("uBaseRotDeg"),e.geometry.BW);else{const t=gi(this.BU._()+e.geometry.BW),i=Math.sin(t),r=Math.cos(t);this.ER.cV(s("uRot"),[i,r])}return this.ER.cV(o("uOffsetAlignment"),[-this.RU.x/2,-this.RU.y/2]),e.geometry.Zm(n,P,E,e.pointSizeAsScale&&this.rU?{scale:this.DU._(),width:e.shapeIcon?e.shapeIcon.ai().x:this.rU.texture.Iz,height:e.shapeIcon?e.shapeIcon.ai().y:this.rU.texture.Pz}:this.DU._(),e.instancedRendering),!0}))}return this}uN(t){return this.pN===t&&{}}dispose(){var t,e,i,s,r,n,o,h,a;return super.dispose(),this.ER.yV(null===(t=this.jU)||void 0===t?void 0:t.bufferX),this.ER.yV(null===(e=this.jU)||void 0===e?void 0:e.bufferY),this.ER.yV(null===(i=this.jU)||void 0===i?void 0:i.bufferColors),this.ER.yV(null===(s=this.jU)||void 0===s?void 0:s.bufferLookupValues),this.ER.yV(null===(r=this.JU)||void 0===r?void 0:r.bufferX),this.ER.yV(null===(n=this.JU)||void 0===n?void 0:n.bufferY),this.ER.yV(null===(o=this.JU)||void 0===o?void 0:o.bufferColors),this.ER.yV(null===(h=this.JU)||void 0===h?void 0:h.bufferLookupValues),this.bG={type:"none"},this.qU=void 0,this.$U=void 0,this.vW.Zp(),null===(a=this.ad._())||void 0===a||a.Wt(),this.jU=void 0,this.JU=void 0,this.tY=void 0,this.iY=void 0,this.sY=void 0,this.eY=void 0,this.hY=void 0,this.rY=void 0,this.ER.zO(this,this.rU),this}OR(){return this.dispose(),this}nY(t){if(!this.XU){const{xValues:e,yValues:i}=t.readBack();this.XU={min:{x:Le,y:Le},max:{x:Pe,y:Pe}};const s=e.length;for(let t=0;tthis.XU.max.x?s:this.XU.max.x,this.XU.max.y=r>this.XU.max.y?r:this.XU.max.y}return this.YU.length=0,this.XU}const e=t.kc,i=t.Tc;if(this.YU.length>0&&e&&i){for(const t of this.YU){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.XU.min.x=tthis.XU.max.x?t:this.XU.max.x,this.XU.max.y=r>this.XU.max.y?r:this.XU.max.y}this.YU.length=0}return this.XU}return this.XU}bt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?(null===(e=n.Cc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Hc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.ZU)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.ZU)||void 0===r?void 0:r.max)||0:this.nY(n).max.x}xt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?(null===(e=n.Hc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Cc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.ZU)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.ZU)||void 0===r?void 0:r.min)||0:this.nY(n).min.x}_t(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?Ft(null===(e=this.ZU)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Ft(null===(i=this.ZU)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Ft(null===(s=n.Cc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Ft(null===(r=n.Hc())||void 0===r?void 0:r.y,0):this.nY(n).max.y}Mt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?Ft(null===(e=this.ZU)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Ft(null===(i=this.ZU)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Ft(null===(s=n.Hc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Ft(null===(r=n.Cc())||void 0===r?void 0:r.y,0):this.nY(n).min.y}xl(){var t,e;let i=this.DU._();this.rU&&(i=Math.max(this.rU.texture.Iz,this.rU.texture.Pz)*this.DU._());const s=Math.max(we(this.uu),(null===(t=this.ad._())||void 0===t?void 0:t.Ut.xc)?25:i),r=null===(e=this.ad._())||void 0===e?void 0:e.Ut.Wc();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}bl(){var t,e;let i=this.DU._();this.rU&&(i=Math.max(this.rU.texture.Iz,this.rU.texture.Pz)*this.DU._());const s=Math.max(we(this.uu),(null===(t=this.ad._())||void 0===t?void 0:t.Ut.xc)?25:i),r=null===(e=this.ad._())||void 0===e?void 0:e.Ut.Wc();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const Gy=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],m=f.length,y=f[0],p=f[m-1],x=g[0],S=g[m-1],A=c?2:1;if(h&&a&&h.firstX&&h.lastX&&y>=h.firstX){const e=ao(h.lastX,0,m-1,(t=>f[t]));if(f[e]===h.lastX){const a=h.bufferSize-h.valueCount,l=e+1,u=m-l;if(0===u)return h;if(a>=u){const e=co(f,l,void 0),a=co(g,l,void 0);if(t.VV(h.bufferX,h.valueCount*A,d(e)),t.VV(h.bufferY,h.valueCount*A,d(a)),i&&h.bufferColors){const e=i.slice(l);t.VV(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.VV(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.VV(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.VV(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Yy(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.VV(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=S,h}}}const v=m+u,b=t.zV(v*A,d(f),null==h?void 0:h.bufferX),M=t.zV(v*A,d(g),null==h?void 0:h.bufferY),E=i?t.zV(v,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,w=s?t.zV(v,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,T=r?t.zV(v,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,k=n?t.zV(v,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let C,R=0,I=0;if(o){const e=Yy(f,g,f[0],g[0],0,0);C=t.zV(2*v,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),R=e[1],I=e[2]}return{bufferX:b,bufferY:M,bufferColors:E,bufferLookupValues:w,bufferSizes:T,bufferRotations:k,bufferSize:v,bufferLengthSoFar:C,valueCount:m,firstX:y,lastX:p,firstY:x,lastY:S,lengthSoFarX:R,lengthSoFarY:I}},Yy=(t,e,i,s,r,n)=>{const o=t.length,h=new Float32Array(2*o);if(0===o)return[h,0,0];let a=0,l=i,u=s,c=r,d=n;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${r}A_highpart${n}`),c=e.attribute(`${r}A_lowpart${n}`),d=e.attribute(`${r}B_highpart${n}`),f=e.attribute(`${r}B_lowpart${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,2*o*l,0*l),u.vertexAttribPointer(c,o,a,h,2*o*l,o*l),t.YV(i,1),t.YV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,a,h,2*o*l,2*o*l),u.vertexAttribPointer(f,o,a,h,2*o*l,3*o*l),t.YV(d,1),t.YV(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${r}A${n}`),c=e.attribute(`${r}B${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,o*l,0*l),u.vertexAttribPointer(c,o,a,h,o*l,o*l),t.YV(i,1),t.YV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Xy={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)=>Xy.multiply(t,Xy.translation(e,i)),rotate:(t,e)=>Xy.multiply(t,Xy.rotation(e)),scale:(t,e,i)=>Xy.multiply(t,Xy.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],y=e[5],p=e[6],x=e[7],S=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+m*n+y*a,g*s+m*o+y*l,g*r+m*h+y*u,p*i+x*n+S*a,p*s+x*o+S*l,p*r+x*h+S*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Wy extends Qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.oY=[],this.lE=new Ym,this.aY=[u(0,0),u(0,0),u(0,0),u(0,0)],this.lY=m(u(0,0),u(0,0)),this.uY=m(u(0,0),u(0,0)),this.cY=u(0,0),this.dY=u(0,0),this.IT=u(0,0),this.fY=u(0,0),this.AY=0,this.gY=0,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e,this.PG=t.Yn.Zn}Ds(){const t=this.ha(),e=this.ea(),i=this.Lo._();if(t){const t=this.ia(),s=this.gN.fillStyleSolid(t),r=this.gN.fillStyleRadialGradient(t),n=this.gN.fillStyleLinearGradient(t),o=s||r||n,h=this.ER,a=this.ER.Xz(),l=a!==this.gY;if(this.gY=a,this.lE.mV(this.ft),this.pa.o||l){this.pY&&this.pY.QR(this),this.font.M(pr(this.pa._(),a));const t=this.font._();this.pY=this.ER.Oh(t.properties.family),this.pY.ZR(this)}const c=this.font.o,d=c||this.ua.o;if(d&&this.pY){const t=this.font._();[this.mY,this.uY]=this.pY.KR(this.ua._(),t,this.nN.ts.isDark),this.oY.forEach((t=>{t.texCoordBuff&&h.yV(t.texCoordBuff),t.vertexBuff&&h.yV(t.vertexBuff)})),this.oY=this.mY.map((t=>({texCoordBuff:h.oV(t.texCoords,!1),texture:t.texture,info:t}))),this.pa.o=!1,this.font.o=!1,this.ua.o=!1}const f=this.ft.Gi()||e,g=this.ca.o||this.fa.o||this.da.o||this.Aa.o||this.ya.o||this.jt.o||d||f,m=this.ya._(),y=ni(u(this.fa._()+1,this.da._()+1),.5);if(g&&this.mY&&(this.cY=u(-(m.left*a+this.uY.max.x-this.uY.min.x+m.right*a)*y.x-this.uY.min.x+m.right*a,-(m.bottom*a+this.uY.max.y-this.uY.min.y+m.top*a)*y.y-this.uY.min.y+m.top*a)),(g||f||this.ga.o||this.ia())&&this.be!==z){if(this.mY){const t=oi(this.ca._(),this.Aa._()),e=dt(t,this.ft,this.cs.ft),i=ni(e,a);this.fY=i;const s=gi(this.ga._());this.AY=s,d&&this.oY.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.oV(e.vertices,!0,t.vertexBuff))}));const r=this.jt._(),n=[oi(ti(u((this.uY.min.x+(-r.left-m.left)*a+this.cY.x)/a,(this.uY.max.y+(r.top+m.top)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.max.x+(r.right+m.right)*a+this.cY.x)/a,(this.uY.max.y+(r.top+m.top)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.max.x+(r.right+m.right)*a+this.cY.x)/a,(this.uY.min.y+(-r.bottom-m.bottom)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.min.x+(-r.left-m.left)*a+this.cY.x)/a,(this.uY.min.y+(-r.bottom-m.bottom)*a+this.cY.y)/a),this.ma,s),e)];this.aY=[dt(n[0],this.cs.ft,this.ft),dt(n[1],this.cs.ft,this.ft),dt(n[2],this.cs.ft,this.ft),dt(n[3],this.cs.ft,this.ft)];const o=Ze(n);this.dY=u(-(o.max.x-o.min.x)*a*y.x-o.min.x*a+this.fY.x,-(o.max.y-o.min.y)*a*y.y-o.min.y*a+this.fY.y),this.Ig=hi(o.max,o.min);const l=Ze(this.aY),c=this.ft.mi(l.min,this.dY),f=this.ft.mi(l.max,this.dY);this.lY=Ze([c,f])}r?this._N=Dm(this.lY,this.ft,r.getPosition(),r.getExtent(),r.getShape(),this.ER.Xz()):n?this.wN=Lm(this.lY,this.ft,n.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0)}(this.ia()||c)&&(this.dE=o?this.ER.az(em["2D"],em.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.PG}),em.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.yY=i&&o?this.yY||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.PG})):void 0,this.ca.o=!1,this.fa.o=!1,this.da.o=!1,this.Aa.o=!1,this.ga.o=!1,this.ra(this.be)}return this.Sa=t,this}VL(t){if(this.ha()){const e=1===t?this.yY:this.dE;if(!e||0===this.oY.length)return this;const i=this.gN.fillStyleSolid(!1),s=this.gN.fillStyleRadialGradient(!1),r=this.gN.fillStyleLinearGradient(!1),n=this.cs.NE(),o=n.x,h=n.y;let a=Xy.projection(o,h,-1);const l=Xy.translation(this.cY.x,this.cY.y),u=Xy.translation(this.dY.x,this.dY.y);a=Xy.translate(a,this.fY.x,this.fY.y),a=Xy.multiply(a,u),a=Xy.rotate(a,this.AY),a=Xy.multiply(a,l),1===t&&(a=Xy.scale(a,this.uY.max.x,this.uY.max.y)),this.ER.ZR(e).lV(e,((e,o,h,l)=>{if(this.ER.DV(e("uMatrix"),a).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),this.PG&&this.ER.cV(l("uViewportSizePx"),[n.x*this.ER.Xz(),n.y*this.ER.Xz()]),1===t)this.ER.gR(e("uColor"),this.mN);else if(i)this.ER.gR(e("uColor"),i.getColor());else if(s&&this._N){this.ER.cV(e("uCenter"),this._N.center).cV(e("uDistance"),this._N.distance).IV(e("uBounds"),this._N.bounds).fV(e("uAspect"),this._N.aspectRatio);const t=s.getColorStops();for(let i=0;i{this.ER.WV(o("aPos"),t.vertexBuff).WV(o("aMaskTextureCoord"),t.texCoordBuff).dV(e("uMaskTexture"),t.texture,0).Zm(this.ER.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}uN(t){return this.pN===t&&{}}Ue(){return this.ha()?this.aY:[]}Zc(){return this.ha()&&this.Ig?this.Ig:u(0,0)}ai(){if(this.ha()&&this.lY){const t=this.lY;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}OR(){return this.oY.forEach((t=>{t.texCoordBuff&&this.ER.yV(t.texCoordBuff),t.vertexBuff&&this.ER.yV(t.vertexBuff)})),this.oY=[],this.pY&&this.pY.QR(this),this}bt(){return this.lY.max.x}xt(){return this.lY.min.x}_t(){return this.lY.max.y}Mt(){return this.lY.min.y}xl(){return 0}bl(){return 0}}class jy{constructor(t,e,i){this.SY=new Set,this.vY=t=>(this.SY.add(t),t),this.xY=t=>(this.SY.delete(t),t.OR(),this),this.cs=t,this.Qo=e,this.bY=i}zL(t){this.SY.delete(t)&&this.SY.add(t)}U(){for(const t of this.SY)t.OR().dispose();this.cs.Mn(this.Qo)}vs(){return this.cs.vs(),this}bn(){return this.Qo}}class $y extends jy{constructor(){super(...arguments),this.MY=p(void 0),this.Jo=!1}tx(t){return this.MY.M(t),this}wp(){return this.MY._()}}class Zy extends $y{constructor(t,e,i){super(t,e,i),this.nN=t,this.gl=t.aN(),this._Y=this.SY}nV(t){const e=t instanceof Xr&&t;if(!e)return _e;const i=e.xt(),s=e.bt(),r=e.Mt(),n=e._t();if(i===Le||s===Pe||r===Le||n===Pe)return _e;const o=e.xl(),h=e.bl(),a=Wr({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ft),l={min:dt(a.min,e.ft,t.cs.ft),max:dt(a.max,e.ft,t.cs.ft)},u=this.MY._();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.nN.CY();return{id:t,color:this.nN.kY(t)}})))}sy(t,e,i){const s=this.nN.CY();return this.vY(new yy(this.nN,this,t,this.xY,i,s,this.nN.kY(s),e))}fd(t){const e=this.nN.CY();return this.vY(new Uy(this.nN,this,t,this.xY,e,this.nN.kY(e)))}Dr(t){const e=this.nN.CY();return this.vY(new Wy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}bS(t){const e=this.nN.CY();return this.vY(new vy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}sc(t,e=hn.Simple){const i=this.nN.CY();if(e===hn.Simple)return this.vY(new Ey(this.nN,this,t,this.xY,[],i,this.nN.kY(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}$x(t){return this.vY(new by(this.nN,this,t,this.xY,[],(()=>{const t=this.nN.CY();return{id:t,color:this.nN.kY(t)}})))}Te(t){const e=this.nN.CY();return this.vY(new My(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}uw(t){const e=this.nN.CY();return this.vY(new sy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}Kc(t){const e=this.nN.CY();return this.vY(new Zm(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}O_(t,e,i){if("intensity"===i.heatmapDataType){const s=this.nN.CY();return this.vY(new Py(this.nN,this,t,this.xY,e,s,this.nN.kY(s),i))}throw new yt("Unimplemented Heatmap Grid Static type")}D_(t,e,i){const s=this.nN.CY();return this.vY(new Dy(this.nN,this,t,this.xY,e,i,s,this.nN.kY(s)))}zb(t,e,i){const s=this.nN.CY();return this.vY(new Vy(this.nN,this,t,this.xY,e,i,s,this.nN.kY(s)))}TY(t){return this.vY(new jm(this.nN,this,this.xY,[],t))}Ds(){if(this.Jo){this.Jo=!1;const t=Array.from(this.SY).sort(((t,e)=>t.qo()-e.qo()));this.SY.clear();for(const e of t)this.SY.add(e)}for(const t of this.SY)t.Ds();return this}VL(t,e){const i=this.MY._();if(i&&this.gl.rV(i.x*this.gl.Xz()*e,i.y*this.gl.Xz()*e,i.width*this.gl.Xz()*e,i.height*this.gl.Xz()*e),1!==t)for(const e of this.SY)e.getVisible()&&e.VL(t);else for(const e of this.SY)e.getMouseInteractions()&&e.getVisible()&&e.VL(t);return this.gl.tV(!1),this}}class Ky extends Pm{constructor(t){super(t)}}class Jy extends Ky{constructor(t){super(t),this.FY="attribute";const{vertices:e,drawSize:i,drawMode:s}=qy(t.gl);this.CR=t.oV(e),this.dG=i,this.fG=s}Zm(t,e,i,s){return this.ER.uV(this.CR,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}).JV(this.fG,0,this.dG,e),this}Tz(){this.ER.yV(this.CR)}}const qy=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 Qy extends Ky{constructor(t,e){super(t),this.FY="attribute",this.IY=e;const{vertices:i,indices:s}=tp();this.CR=t.oV(i),this.cG=t.NV(s),this.dG=s.length,this.fG=t.gl.TRIANGLES}Zm(t,e,i,s){return this.ER.uV(this.CR,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).jV(this.cG).fV(t.uniform("uEdgeRoundness"),this.IY/2).KV(this.fG,this.dG,0,e),this}Tz(){this.ER.yV(this.CR),this.ER.yV(this.cG)}PY(t){return this.IY=t,this}DY(){return this.IY}}const tp=()=>{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 r=0;for(const n of t){const{normal:t,perpendA:o,perpendB:h}=n,a=De.multiply(o,-1),l=De.multiply(h,-1),u=i;e[i]={thicknessDirection:De.addVec(t,o,h),edge:De.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:De.addVec(t,a,h),edge:De.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:De.addVec(t,a,l),edge:De.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:De.addVec(t,o,l),edge:De.addVec(a,h),normal:t},i+=1,s[r+0]=d,s[r+1]=u,s[r+2]=f,s[r+3]=d,s[r+4]=c,s[r+5]=u,r+=6;const g=[{A:o,B:h},{A:a,B:h},{A:a,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=De.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const r=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const n of r)for(let r=0;r<8;r+=1){const o=.5*r/7,h=De.normalize(De.lerp(t,n.direction,o)),a=Math.PI/2-De.angle(h,t),l=De.addVec(De.multiply(De.multiply(n.direction,-1),1-Math.cos(a)),De.multiply(De.multiply(t,-1),1-Math.sin(a)),De.multiply(n.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:h,edge:l};const c=e[i];i+=1,n.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.wV.kz.get(e);return i||(i=void 0!==e&&e>0?new Qy(t,Rt(e,0,1)):new Jy(t),t.wV.kz.set(e,i),i)};class ip extends Nm{nS(t){return this.Yz=this.tS._(),this.tS.M(t),this}kv(t){return this.BY=t,this}Tv(){return this.BY}}class sp extends ip{constructor(t,e,i,s,r){super(t,e,i),this.LY=t,this.pN=s,this.mN=r,this.nN=t.nN,this.ER=this.nN.aN()}uN(t){return t===this.pN&&{}}}class rp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.Ha=Ve,this.RY={},this.EY=[],this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleIndividual:()=>X(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be}),this.be=wr.fillStyle,this.tS.M(Hn)}Ds(t){const e=this.EY,i=this.be,s=i!==z,r=this.zY,n=this.ia()||this.VY!==r,o=this.Uz(),h=this.Lo._(),a=this.Lo.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.OY||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.RY[e]||(r+=1)}let l,u=!1,c=!1;if(u=r!==s,c=u,l=!c&&(e.length<100?"chunks":"all"),u){const e=r*t,i=new Float32Array(e);this.PW&&i.set(this.PW),this.PW=i,this.NY=e,this.GY=s*t}const d=X(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.RY[e],r=[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:Le,y:Le,z:Le},{x:Pe,y:Pe,z:Pe});for(let i=0;in?e.max.x:n,e.max.y=e.max.y>l?e.max.y:l,e.max.z=e.max.z>f?e.max.z:f}this.Ha=e}this.OY=r,this.EY.length=0}return this.ra(i),this.VY=r,this.tS.o=!1,this.Lo.o=!1,this}VL(t){const e=1===t?this.yY:this.dE,i=this.WY,s=this.uG,r=this.be,n=this.OY,o=this.tS._();return e&&s&&void 0!==n&&this.ER.lV(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.ER.ZR(e).PV(h("uScale"),this.LY.lE.AV()).PV(h("uDisp"),this.LY.lE.gV()).BV(h("uViewProjectionMatrix"),this.YY).fV(h("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(h("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(h("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.ER.PV(h("uCameraLoc"),this.HY).PV(h("uLightLoc"),this.$Y).fV(h("uAmbientReflection"),o.ambientReflection).fV(h("uSpecularReflection"),o.specularReflection).fV(h("uDiffuseReflection"),o.diffuseReflection).fV(h("uShininess"),o.shininess).gR(h("uLightColor"),o.specularColor).gR(h("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(h("uColor"),this.mN);else if(Y(r))this.ER.gR(h("uColorDiffuse"),r.getColor());else if(X(r)){const t=a("aColor");m.location=t}else if(j(r)){const t=kg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.ER.RO(l,r.lut,t)}return s&&(this.ER.uV(s,1,f,g,m,{location:void 0,size:1}),i.Zm(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.uG&&(this.ER.yV(this.uG),this.uG=void 0),this.dE=void 0,this}OR(){return this.dispose(),this}pS(t){this.EY=ne(this.EY,t,{canReturnB:!0})}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}AS(t){return this.zY=void 0!==t&&t>0?Rt(t,0,1):void 0,this}UY(){return this.zY}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}lS(){return this.Ha.max.z}uS(){return this.Ha.min.z}xl(){return 0}bl(){return 0}cS(){return 0}ia(){return $r(this.sa,this.be)}ra(t){this.sa=t}}class np extends Pm{constructor(t,e){super(t),this.FY="custom",this.aG=e;const{vertices:i,drawSize:s}=this.lG();this.uG=t.oV(i),this.dG=s}ZR(t){return this.ER.uV(this.uG,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Zm(t){return this.ER.JV(this.ER.gl.TRIANGLE_STRIP,0,this.dG,t),this}lG(){const t=this.aG,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const r=2*Math.PI*s/t,n=Math.cos(r),o=Math.sin(r);for(const t of[0,1])e[i+0]=t,e[i+1]=n,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}Tz(){this.ER.yV(this.uG)}}const op=(t,e=16)=>{let i=t.wV.wz.get(e);return i||(i=new np(t,e),t.wV.wz.set(e,i),i)};class hp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.jY=Ve,this.ZY=[],this.QY=!1,this.uu=wr.lineStyle,this.tS.M(Gn)}Ds(t){const e=this.QY,i=this.uu,s=this.du!==i,r=this.Uz(),n=e;if(e){const t=qt(this.ZY);this.JY=this.ER.oV(t,!1,this.JY)}if(n&&(this.jY=Ke(this.ZY)),s||r){const t=8,e=qi(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.bG=void 0,Y(e)&&("primitive"===s?this.bG={type:s,shader:this.ER.az(em["3D"],em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}),em.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.bG={type:s,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:"uniform",shadingStyle:this.tS._().type}),em.LineInstanced3D({axisWorldTranslation:wg(this.ft)})),geometry:op(this.ER,t),fillStyle:e}))}return this.QY=!1,this.du=i,this.tS.o=!1,this}VL(t){if(1===t)return this;const e=this.ER.gl,i=this.bG,s=this.JY,r=this.uu,n=this.tS._();if(i&&s&&qi(r))switch(i.type){case"instanced":{const o=.5*this.Ts.Gy(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.ER.lV(a,((i,r,u)=>{this.ER.ZR(a).PV(i("uScale"),this.LY.lE.AV()).PV(i("uDisp"),this.LY.lE.gV()).BV(i("uViewProjectionMatrix"),this.YY).gR(i("uColorDiffuse"),h).fV(i("uOffsetWU"),o).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.ER.PV(i("uCameraLoc"),this.HY).PV(i("uLightLoc"),this.$Y).fV(i("uAmbientReflection"),n.ambientReflection).fV(i("uSpecularReflection"),n.specularReflection).fV(i("uDiffuseReflection"),n.diffuseReflection).fV(i("uShininess"),n.shininess).gR(i("uLightColor"),n.specularColor).gR(i("uAmbientColor"),n.ambientColor),e.bindBuffer(e.ARRAY_BUFFER,s);const c=r("aLocationA"),d=r("aLocationB");return e.vertexAttribPointer(c,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(d,1),e.enableVertexAttribArray(d),l.ZR(u).Zm(this.ZY.length/2),!0}));break}case"primitive":{const n=qi(r)?r.getFillStyle():void 0,o=n&&Y(n)?n.getColor():void 0;if(o){const r=i.shader;this.ER.lV(r,((i,n)=>(this.ER.ZR(r).PV(i("uScale"),this.LY.lE.AV()).PV(i("uDisp"),this.LY.lE.gV()).BV(i("uViewProjectionMatrix"),this.YY).gR(i("uColor"),o).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0).uV(s,void 0,{location:n("aPos"),size:3}).Zm(e.LINES,this.ZY.length),!0)))}break}}return this}ol(t){for(let e=0;e{const l=e*r,u=Math.PI/2-t*n,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]=h,i[s+5]=a,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.ER.dA.$n&&s>i.length&&bt.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}}Tz(){this.ER.yV(this.uG)}}const lp=(t,e)=>{const i=Math.round(e);i<3&&me(0,kt);const s=i;let r=t.wV.Cz.get(Array.from(t.wV.Cz.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new ap(t,i,s),t.wV.Cz.set({sectors:i,stacks:s},r),r)};class up extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.JM=[],this.bG={},this.xW=new gy(this.JM,(t=>t.vertexBuffer&&this.ER.yV(t.vertexBuffer)),!0),this.yu=[],this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=Ve,this.gN=Tg({lineStyleSolid:()=>{const t=this.uu;return qi(t)&&t},lineFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},lineFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t},jointStyleTriangulatedPoints:()=>ur(this.mS)&&this.mS,jointSizeTriangulated:()=>{const t=this.mS;return ur(t)&&t.getSize()},jointFillSolid:()=>{const t=this.mS.getFillStyle();return Y(t)&&t},jointFillPaletted:()=>{const t=this.mS.getFillStyle();return j(t)&&t},wireframeLineStyleSolid:()=>{const t=ur(this.mS)&&this.mS.getWireframeStyle();return qi(t)&&t},wireframeFillSolid:()=>{const t=ur(this.mS)&&this.mS.getWireframeStyle(),e=t&&t.getFillStyle();return Y(e)&&e}}),this.Ja=!1,this.uu=wr.lineStyle,this.mS=wr.pointStyle3D,this.tS.M(Hn),this.kW={attributesPerVertex:3,prepareRenderData:(t,e)=>qt(t)}}Ds(t){const e=this.Ja,i=this.Xa,s=this.ja,r=s>0,n=this.uu,o=n!==this.du,h=this.mS,a=h!==this.tH,l=this.Uz(),u=this.Lo.o,c=this.Lo._();this.Za&&(this.Ha=qe(this.Ha,this.Za),this.Za=void 0),r&&(this.yu=ne(this.yu,i,{canReturnB:!0}),this.$a+=s);let d=i,f=s;if(e&&(this.JM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Ve})),this.xW.dW(),d=this.yu,f=this.$a),f>0){const t=1e5,e=Math.floor(this.nN.iH/(this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Yo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Rt(i,t,e);this.xW.aW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Ve,vertexBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i))})),((t,e,i,s)=>{this.ER.VV(t.vertexBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||a||l||u){const t={},e=this.gN.lineStyleSolid(o),i=this.gN.lineFillSolid(o),s=this.gN.lineFillPaletted(o),r=i||s,h=this.gN.jointStyleTriangulatedPoints(a),l=this.gN.jointSizeTriangulated(a),u=this.gN.jointFillSolid(a),d=this.gN.jointFillPaletted(a),f=u||d,g=this.gN.wireframeLineStyleSolid(a),m=this.gN.wireframeFillSolid(a),y=n.getThickness()<0||1===n.getThickness()&&this.Yo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===y&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.ER.az(em["3D"],em.Color({dataType:p}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}))}:void 0}:"instanced"===y&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:p,shadingStyle:this.tS._().type}),em.LineInstanced3D({axisWorldTranslation:wg(this.ft)})),geometry:cp(this.ER,e.getThickness()),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.LineInstanced3D({axisWorldTranslation:wg(this.ft)}))}:void 0}),t.markers=void 0,f&&h){const e=se(h.getShape(),{cube:()=>ep(this.ER),sphere:()=>dp(this.ER,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.tS._().type,wireframe:!1!==m}),em.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.ft),normalSource:e.FY})),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.ft),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.bG=t}return this.Ja=!1,this.Xa=[],this.ja=0,this.du=n,this.tH=h,this.tS.o=!1,this.Lo.o=!1,this}VL(t){var e,i;const s=this.ER.gl,{lines:r,markers:n}=this.bG,o=this.tS._(),h=1===t?null===(e=null==r?void 0:r.mousePicking)||void 0===e?void 0:e.shader:null==r?void 0:r.shader;if(r&&h&&"instanced"===r.type){const e=h,{geometry:i,lineStyleSolid:n,fillStyleSolid:a,fillStylePaletted:l}=r;this.ER.lV(e,((r,h,u)=>{let c=!1;if(this.ER.ZR(e).PV(r("uScale"),this.LY.lE.AV()).PV(r("uDisp"),this.LY.lE.gV()).BV(r("uViewProjectionMatrix"),this.YY).fV(r("uOffsetWU"),this.Ts.Gy(n.getThickness())).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.ER.PV(r("uCameraLoc"),this.HY).PV(r("uLightLoc"),this.$Y).fV(r("uAmbientReflection"),o.ambientReflection).fV(r("uSpecularReflection"),o.specularReflection).fV(r("uDiffuseReflection"),o.diffuseReflection).fV(r("uShininess"),o.shininess).gR(r("uLightColor"),o.specularColor).gR(r("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(r("uColor"),this.mN);else if(a)this.ER.gR(r("uColorDiffuse"),a.getColor());else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ER.RO(u,l.lut,t)}return this.JM.forEach((t=>{s.bindBuffer(s.ARRAY_BUFFER,t.vertexBuffer);const e=h("aLocationA"),r=h("aLocationB");s.vertexAttribPointer(e,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(r,1),s.enableVertexAttribArray(r),i.ZR(u).Zm(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.ER.lV(e,((r,o,h)=>{let a=!1;if(this.ER.ZR(e).PV(r("uScale"),this.LY.lE.AV()).PV(r("uDisp"),this.LY.lE.gV()).BV(r("uViewProjectionMatrix"),this.YY).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(r("uColor"),this.mN);else if(i)this.ER.gR(r("uColor"),i.getColor());else if(n){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ER.RO(h,n.lut,t)}return this.JM.forEach((t=>{this.ER.uV(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Zm(s.LINE_STRIP,t.existingCoordinatesCount),a=!0})),a}))}const a=1===t?null===(i=null==n?void 0:n.mousePicking)||void 0===i?void 0:i.shader:null==n?void 0:n.shader;if(n&&a){const e=a,{geometry:i,fillStyleSolid:s,fillStylePaletted:r,pointSizeAxis:h,pointSizeNWU:l,wireframe:u}=n;this.ER.lV(e,((n,a,c,d)=>{let f=!1;if(this.ER.ZR(e).PV(n("uScale"),this.LY.lE.AV()).PV(n("uDisp"),this.LY.lE.gV()).BV(n("uViewProjectionMatrix"),this.YY).fV(d("uRatioNwuWu"),this.LY.sH()).fV(n("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(n("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.ER.PV(n("uCameraLoc"),this.HY).PV(n("uLightLoc"),this.$Y).fV(n("uAmbientReflection"),o.ambientReflection).fV(n("uSpecularReflection"),o.specularReflection).fV(n("uDiffuseReflection"),o.diffuseReflection).fV(n("uShininess"),o.shininess).gR(n("uLightColor"),o.specularColor).gR(n("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(n("uColor"),this.mN);else if(s)this.ER.gR(n("uColorDiffuse"),s.getColor());else if(r){const t=kg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.ER.RO(c,r.lut,t)}return u&&1!==t&&this.ER.fV(n("uWireframeThickness"),u.thickness).gR(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.ER.PV(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.ER.fV(n("uOffsetNWU"),l),this.JM.forEach((e=>{this.ER.uV(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Zm(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}ol(t,e){Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.ja+=t.length;const i=e||Ke(t);return this.Za=this.Za?qe(this.Za,i):i,this}Ee(t){return this.uu="function"==typeof t?t(this.uu):t,this}cu(){return this.uu}zy(t){return this.mS="function"==typeof t?t(this.mS):t,this}eH(){return this.mS}bt(){return this.Za?Math.max(this.Za.max.x,this.Ha.max.x):this.Ha.max.x}xt(){return this.Za?Math.min(this.Za.min.x,this.Ha.min.x):this.Ha.min.x}_t(){return this.Za?Math.max(this.Za.max.y,this.Ha.max.y):this.Ha.max.y}Mt(){return this.Za?Math.min(this.Za.min.y,this.Ha.min.y):this.Ha.min.y}lS(){return this.Za?Math.max(this.Za.max.z,this.Ha.max.z):this.Ha.max.z}uS(){return this.Za?Math.min(this.Za.min.z,this.Ha.min.z):this.Ha.min.z}xl(){return we(this.uu)}bl(){return we(this.uu)}cS(){return we(this.uu)}il(){return this.yu}tl(){return this.Xa}al(){return this.$a}ll(){return this.ja}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.bG={},this}OR(){return this.dispose(),this}}const cp=(t,e)=>op(t,e>50?20:e>20?16:e>10?12:e>5?8:6),dp=(t,e)=>{const i=e.getSize();return lp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class fp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="disabled",this.hH=!1,this.rH=!1,this.nH={x:1,y:1,z:1},this.Bv={x:0,y:0,z:0},this.Dv={x:0,y:0,z:0},this.Lv={x:0,y:0,z:0},this.Rv={x:1,y:1,z:1},this.oH=pl.projectionOrthographic(-1,1,-1,1,1,-1),this.aH=pl.projectionOrthographic(-1,1,-1,1,1,-1),this.lH=!1,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleValuePalette:()=>j(this.be)&&"value"===this.be.lookUpProperty&&this.be}),this.be=wr.fillStyle,this.tS.M(Hn)}Ds(t){var e;const i=this.Uz(),s=this.Lo._(),r=this.Lo.o,n=this.ia();this.gN.fillStyleSolid(n);const o=this.gN.fillStyleValuePalette(n),h=this.Lv,a=this.Rv;if(this.hH&&this.uH&&(this.uG=this.ER.oV(this.uH.vertices,void 0,this.uG),this.cG=this.ER.NV(this.uH.indices,this.cG),this.cH=this.uH.indices.length),"phong"===this.tS._().type&&(i||this.hH)&&(null===(e=this.uH)||void 0===e?void 0:e.normals)&&(this.dH=this.ER.oV(this.uH.normals,void 0,this.dH)),!this.fH&&o&&"value"===o.lookUpProperty&&this.uH&&(this.fH=new Float32Array(this.uH.vertices.length/3),this.rH=!0),this.fH&&this.rH&&(this.AH=this.ER.oV(this.fH,void 0,this.AH)),i||n||r){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.dE=this.ER.az(em["3D"],em.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.tS._().type,wireframe:!1}),em.Model3D({normalSource:"phong"===this.tS._().type?"attribute":void 0})),this.yY=s?this.ER.az(em["3D"],em.MousePicking,em.Model3D({normalSource:void 0})):void 0}if(this.lH){const t=pl.projectionOrthographic(-1,1,-1,1,1,-1);this.aH=pl.rotateXYZ(t,h),this.oH=pl.translate(t,a.x/2,a.y/2,a.z/2),this.oH=pl.rotateXYZ(this.oH,h),this.oH=pl.translate(this.oH,-a.x/2,-a.y/2,-a.z/2),this.lH=!1}return this.tS.o=!1,this.ra(this.be),this.Lo.o=!1,this.hH=!1,this.rH=!1,this}VL(t){const e=1===t?this.yY:this.dE,i=1===t,s=this.cG,r=this.cH,n=this.uG,o=this.dH,h=this.AH,a=this.Bv,l=this.Dv,u=this.nH,c=this.Rv,d=this.oH,f=this.aH,g=this.gN.fillStyleValuePalette(!1),m=this.gN.fillStyleSolid(!1),y=this.tS._(),p={location:void 0,size:1};return e&&n&&s&&r?(this.ER.lV(e,((x,S,A,v)=>{if(this.ER.ZR(e).PV(x("uScale"),this.LY.lE.AV()).PV(x("uDisp"),this.LY.lE.gV()).BV(x("uViewProjectionMatrix"),this.YY).fV(x("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(x("uHighlightColorOffset"),this.Wo).fV(x("uRenderEffectMask"),2===t?1:0),i)this.ER.gR(x("uColor"),this.mN);else{if(this.be===z)return!1;if(m)this.ER.gR(x("uColorDiffuse"),m.getColor());else if(g){if(!h)return!1;const t=g.getPalette();p.location=S("aLookupValue"),this.ER.RO(A,t,void 0).uV(h,void 0,p)}}return"phong"!==y.type||i||(this.ER.PV(x("uCameraLoc"),this.HY).PV(x("uLightLoc"),this.$Y).fV(x("uAmbientReflection"),y.ambientReflection).fV(x("uSpecularReflection"),y.specularReflection).fV(x("uDiffuseReflection"),y.diffuseReflection).fV(x("uShininess"),y.shininess).gR(x("uLightColor"),y.specularColor).gR(x("uAmbientColor"),y.ambientColor).BV(x("uModelRotationNormals"),f),o&&this.ER.uV(o,void 0,{location:A.attribute("aNormal"),size:3})),this.ER.BV(x("uModelRotation"),d).PV(x("uModelScale"),[u.x,u.y,u.z]).PV(x("uLocationAxis"),[a.x,a.y,a.z]).PV(x("uModelAlignment"),[l.x,l.y,l.z]).PV(x("uModelSize"),[c.x,c.y,c.z]),this.ER.uV(n,0,{location:A.attribute("aGeoPos"),size:3}).jV(s).QV(r,this.ER.gl.TRIANGLES),!0})),this):this}dispose(){return super.dispose(),this.uG&&(this.ER.yV(this.uG),this.uG=void 0),this.cG&&(this.ER.yV(this.cG),this.cG=void 0),this.dH&&(this.ER.yV(this.dH),this.dH=void 0),this.AH&&(this.ER.yV(this.AH),this.AH=void 0),this.dE=void 0,this.yY=void 0,this.uH=void 0,this.fH=void 0,this}OR(){return this.dispose(),this}zv(t){return this.uH=t,this.hH=!0,this.Rv=t.modelSize,this}Ov(t){return this.fH=t,this.rH=!0,this}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}Nv(t){return this.nH=t,this}AV(){return this.nH}Gv(t){return this.Bv=t,this}Wv(t){return this.Dv=t,this}Uv(t){return this.Lv=t,this.lH=!0,this}Yv(t){return this.BY=t,this}Hv(){return this.BY}bt(){return Pe}xt(){return Le}_t(){return Pe}Mt(){return Le}lS(){return Pe}uS(){return Le}xl(){return 0}bl(){return 0}cS(){return 0}ia(){return $r(this.sa,this.be)}ra(t){this.sa=t}}class gp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.BY="cull-back",this.JM=[],this.xW=new gy(this.JM,(t=>t.vertexBuffer&&this.ER.yV(t.vertexBuffer)),!1),this.yu=[],this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=Ve,this.Ja=!1,this.gN=Tg({fillStyleSolid:()=>{const t=this.vS.getFillStyle();return Y(t)&&t},fillStyleIndividual:()=>{const t=this.vS.getFillStyle();return X(t)&&t},fillStylePalette:()=>{const t=this.vS.getFillStyle();return j(t)&&t},triangulatedPointStyle:()=>{const t=this.vS;return ur(t)&&t},wireframeLineStyleSolid:()=>{const t=ur(this.vS)&&this.vS,e=t&&t.getWireframeStyle();return qi(e)&&e},wireframeFillStyleSolid:()=>{const t=ur(this.vS)&&this.vS,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return Y(i)&&i}}),this.Ka=void 0,this.Yn=n,this.vS=wr.pointStyle3D,this.tS.M(Hn);const o=!0===(null==n?void 0:n.individualPointColorEnabled),h=!0===(null==n?void 0:n.individualPointSizeEnabled),a=!0===(null==n?void 0:n.individualLookupValuesEnabled),l=!0===(null==n?void 0:n.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),h&&(c=g,g+=1),a&&(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?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);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 r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&X(e)&&e.getFallbackColor()||R,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eqt(t))(o,h,a,l);this.kW={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.vS,this.vS.fillStyle)}}Ds(t){const e=this.Ja,i=this.Xa,s=this.ja,r=s>0,n=this.vS,o=this.vS!==this.gH,h=this.Lo._(),a=this.Lo.o,l=this.Uz();this.Za&&(this.Ha=qe(this.Ha,this.Za),this.Za=void 0),r&&(this.yu=ne(this.yu,i,{canReturnB:!0}),this.$a+=s);let u=i,c=s;if(e&&(this.JM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Ve})),this.xW.dW(),u=this.yu,c=this.$a),c>0){const t=Math.floor(this.nN.iH/(this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Rt(c,1e5,t);this.xW.aW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Ve,vertexBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i))})),((t,e,i)=>{this.ER.VV(t.vertexBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.gN.fillStyleSolid(o),g=this.gN.fillStyleIndividual(o),m=this.gN.fillStylePalette(o),y=d===z&&z;if(o||l||a){let t;const e=n.getSize(),i=this.kW.individualPointColorEnabled,s=this.kW.individualPointSizeEnabled,r=this.kW.individualPointSizeAxisEnabled,a=this.kW.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw bt.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw bt.alert(t),new Error(t)}const l=this.gN.wireframeLineStyleSolid(o),u=this.gN.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(ur(n)){const r=se(n.getShape(),{cube:()=>ep(this.ER),sphere:()=>mp(this.ER,n,s)});t={type:"instanced",shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:i,shadingStyle:this.tS._().type,wireframe:!1!==u}),em.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.ft),normalSource:r.FY})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:y,mousePickingShader:h&&this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.ft),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else fr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.ER.az(em["3D"],em.PointSize(c),em.Color({dataType:i}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:h&&this.ER.az(em["3D"],em.PointSize(c),em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}))})}this.bG=t}if(void 0===this.Ka&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=Pe,e=Le;for(let i=0;it&&(t=s.value)}this.Ka={min:e,max:t}}return this.Ja=!1,this.Xa=[],this.ja=0,this.gH=n,this.tS.o=!1,this}VL(t){const e=this.ER.gl,i=this.bG;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.tS._(),{fillStyleSolid:n,fillStylePaletted:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.ER.lV(s,((u,c,d,f)=>{let g=!1;if(this.ER.ZR(s).PV(u("uScale"),this.LY.lE.AV()).PV(u("uDisp"),this.LY.lE.gV()).BV(u("uViewProjectionMatrix"),this.YY).fV(u("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(u("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.ER.PV(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.ER.fV(u("uOffsetNWU"),e).fV(f("uRatioNwuWu"),this.LY.sH())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.ER.fV(u("uPointSize"),t).fV(u("uDevicePixelRatio"),this.ER.Xz())}if(1===t)this.ER.gR(u("uColor"),this.mN);else if("instanced"===i.type?("phong"===r.type&&this.ER.PV(u("uCameraLoc"),this.HY).PV(u("uLightLoc"),this.$Y).fV(u("uAmbientReflection"),r.ambientReflection).fV(u("uSpecularReflection"),r.specularReflection).fV(u("uDiffuseReflection"),r.diffuseReflection).fV(u("uShininess"),r.shininess).gR(u("uLightColor"),r.specularColor).gR(u("uAmbientColor"),r.ambientColor),l&&this.ER.fV(u("uWireframeThickness"),l.thickness).gR(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.ER.gR(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.ER.gR(u("uColorDiffuse"),I)):"primitive"===i.type&&n&&this.ER.gR(u("uColor"),n.getColor()),o){const t=kg(o,this,this.Ka);if(!t&&o.lut.percentageValues)return!1;this.ER.RO(d,o.lut,t)}return this.JM.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kW.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kW.attributeOffsetSize){"instanced"===i.type?this.ER.fV(f("uRatioNwuWu"),this.LY.sH()):"primitive"===i.type&&this.ER.fV(u("uDevicePixelRatio"),this.ER.Xz());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kW.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePaletted&&"value"===i.fillStylePaletted.getLookUpProperty()&&void 0!==this.kW.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Zm(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.ER.Zm(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}ol(t,e){Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.ja+=t.length;const i=e||Ke(t);return this.Za=this.Za?qe(this.Za,i):i,this.Ka=void 0,this}xS(t){return this.vS="function"==typeof t?t(this.vS):t,this}pH(){return this.vS}bt(){return this.Za?Math.max(this.Za.max.x,this.Ha.max.x):this.Ha.max.x}xt(){return this.Za?Math.min(this.Za.min.x,this.Ha.min.x):this.Ha.min.x}_t(){return this.Za?Math.max(this.Za.max.y,this.Ha.max.y):this.Ha.max.y}Mt(){return this.Za?Math.min(this.Za.min.y,this.Ha.min.y):this.Ha.min.y}lS(){return this.Za?Math.max(this.Za.max.z,this.Ha.max.z):this.Ha.max.z}uS(){return this.Za?Math.min(this.Za.min.z,this.Ha.min.z):this.Ha.min.z}xl(){const t=this.vS,e=t.getSize();return"number"==typeof e?ur(t)?e/2:fr(t)?5:0:0}bl(){return this.xl()}cS(){return this.xl()}il(){return this.yu}tl(){return this.Xa}al(){return this.$a}ll(){return this.ja}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=void 0,this.Ka=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.bG=void 0,this}OR(){return this.dispose(),this}}const mp=(t,e,i)=>{const s=e.getSize();return lp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class yp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.BY="disabled",this.be=wr.fillStyle,this.pv=wr.lineStyle,this.cU=p("bilinear"),this.mH=[],this.yH=void 0,this.bG={},this.SH=!1,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,wireframeStyleLine:()=>qi(this.pv)&&this.pv,wireframeStyleFill:()=>{const t=this.pv&&this.pv.getFillStyle();return Y(t)&&t}}),this.Di={x:0,z:0},this.Xw={x:1,z:1},this.tS.M(Gn);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.Yn={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.vH=new Array(this.Yn.primaryDimensionVectorsCount).fill(void 0),this.P_=new Dy(this.nN,t.nN.kU,t.cs.ft,kt,[],this.Yn,-1,R).mv(ot),this.P_.AU=Ty;const a=this.P_.pU.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n=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:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:n,normalmapSize:o}})),l=this.P_.pU.gridTileSizes.map((t=>{const e=a.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=a.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,r=i*s;return r>t.cells?{primary:i,secondary:s,cells:r}:t}),{primary:0,secondary:0,cells:0});this.xH={gridTiles:a,gridTileSizes:l,largestGridTileSize:u},this.vv(this.Di,this.Xw)}bH(t){this.MH=t,this.yH=void 0}vv(t,e){this.Di=t,this.Xw=e;const i=this.Yn,s={min:{x:Math.min(this.Di.x,this.Di.x+(i.columns-1)*this.Xw.x),z:Math.min(this.Di.z,this.Di.z+(i.rows-1)*this.Xw.z)},max:{x:Math.max(this.Di.x,this.Di.x+(i.columns-1)*this.Xw.x),z:Math.max(this.Di.z,this.Di.z+(i.rows-1)*this.Xw.z)}},r=new Map;return this.xH.gridTiles.forEach((t=>{const e="columns"===this.Yn.dataOrder?{x:this.Xw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Xw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Xw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Xw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstVector.primary,z:this.Di.z+this.Xw.z*t.iFirstVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstVector.secondary,z:this.Di.z+this.Xw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.bU={_H:s,tilesInfo:r},this}xv(){return{start:this.Di,step:this.Xw,end:{x:this.Di.x+this.Xw.x*this.Yn.columns,z:this.Di.z+this.Xw.z*this.Yn.rows}}}Ds(t){const e=this.mH,i=$r(this.sa,this.be),s=this.gN.fillStyleSolid(i),r=this.gN.fillStylePaletted(i),n=this.pv,o=this.pv!==this.mU,h=this.gN.wireframeStyleLine(o),a=this.gN.wireframeStyleFill(o),l=!1!==a,u=this.cU.o,c=this.cU._(),d=this.tS._(),f=this.Uz(),g=this.Lo._();this.P_.Ds();const m=this.P_.yU;if(!m)return this;this.wH=this.wH||this.CH(m);const y=this.wH;this.kH(y);const p=ky(e,y,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Iy(this.ER,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.SH=!0),"phong"===d.type&&(p.size>0||f)){const t=this.ER.gl,e=this.ER.az(em["2D"],em.DrawToNormalTexture({flipXZ:"rows"===this.Yn.dataOrder,vertexIdSource:this.ER.wO(),normalTextureType:this.ER.gl2?"uint":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN}));y.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.bU)||void 0===r?void 0:r.tilesInfo.get(s.tileData);if(!n||!o)return;const h={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},a=h.x*h.y;this.ER.aO.VL((()=>{this.ER.lV(e,((r,n,h,l)=>(this.ER.ZR(e).CO(h,a).cV(r("uTileDimensionsXZ"),["columns"===this.Yn.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).FV(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).cV(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).cV(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).dV(r("uHeightmapTexture"),s.heightmapDataTexture,1).Zm(t.POINTS,a),!0)))}),n,h,void 0,this.cs.mn(),0)}))}))}const x=this.bG;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return x.mousePicking=g?this.bG.mousePicking||{shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.bG=x,this.mH.length=0,this.sa=this.be,this.mU=n,this.tS.o=!1,this}CH(t){const e=this.xH.gridTiles.map((e=>{const i=Ry(this.ER,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.xH.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.ER.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]),r=this.ER.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}kH(t){var e;if("phong"===this.tS._().type)for(let i=0;i{t.normalmapTexture&&(this.ER.NR(t.normalmapTexture),t.normalmapTexture=void 0)}))}VL(t){var e,i,s,r;const n=this.ER.gl,o=this.wH;if(!o)return this;const h=this.tS._(),a=this.bG,l=1===t?null===(e=a.mousePicking)||void 0===e?void 0:e.shader:null===(i=a.surface)||void 0===i?void 0:i.shader;if(!l)return this;const u=1!==t?null===(s=a.surface)||void 0===s?void 0:s.wireframe:void 0,c=1!==t?null===(r=a.surface)||void 0===r?void 0:r.fill:void 0;return this.ER.lV(l,((e,i,s,r)=>{let a=!1;if(this.ER.ZR(l).TO(s,this.xH.largestGridTileSize.cells).PV(e("uScale"),this.LY.lE.AV()).PV(e("uDisp"),this.LY.lE.gV()).BV(e("uViewProjectionMatrix"),this.YY).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.ER.PV(e("uCameraLoc"),this.HY).PV(e("uLightLoc"),this.$Y).fV(e("uAmbientReflection"),h.ambientReflection).fV(e("uSpecularReflection"),h.specularReflection).fV(e("uDiffuseReflection"),h.diffuseReflection).fV(e("uShininess"),h.shininess).gR(e("uLightColor"),h.specularColor).gR(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.ER.gR(e("uWireframeColor"),t.getColor()).fV(e("uWireframeThickness"),s)}return 1===t?this.ER.gR(e("uColorDiffuse"),this.mN):"solid"===(null==c?void 0:c.fillMode)&&this.ER.gR(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.ER.cV(e("uTileDimensionsXZ"),["columns"===this.Yn.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).FV(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{var l;const d=null===(l=this.bU)||void 0===l?void 0:l.tilesInfo.get(h.tileData);if(!d)return;let f=0,g=(h.sizeHeatmapDataVectors.primary-1)*(h.sizeHeatmapDataVectors.secondary-1);if(this.MH){const t=this.MH.fill.iFirstPrimary,e=this.MH.fill.iFirstPrimary+this.MH.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);f=(n.min-h.iFirstVector.primary)*(r.sizeGeometryData.secondary-1),g=(n.max-n.min)*(r.sizeGeometryData.secondary-1)}if(!(f<0||g<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,i=this.P_.Ka;this.ER.RO(s,t.lut,i).dV(e("uTileIntensityValues"),h.intensityDataTexture,2).IV(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.xt(),max:this.bt()}:"y"===t.getLookUpProperty()?{min:this.Mt(),max:this._t()}:"z"===t.getLookUpProperty()?{min:this.uS(),max:this.lS()}:void 0;if(!e&&t.lut.percentageValues)return;this.ER.RO(s,t.lut,e)}1!==t&&"phong"===this.tS._().type&&h.normalmapTexture&&this.ER.dV(e("uNormalmapTexture"),h.normalmapTexture,3),this.ER.uV(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).LV(e("uBaseInstance"),f).cV(e("uTileStartLocationAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z]).cV(e("uTileSizeAxisXZ"),[d.sizeAxis.x,d.sizeAxis.z]).dV(e("uHeightmapTexture"),h.heightmapDataTexture,0).JV(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,g),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.P_.dispose(),this.wH&&(this.wH.gridTileSizes.forEach((t=>{})),this.wH.gridTiles.forEach((t=>{this.ER.NR(t.heightmapDataTexture),t.normalmapTexture&&this.ER.NR(t.normalmapTexture)})),this.ER.yV(this.wH.rectangleLocationsBuffer),this.wH=void 0),this.bG={},this}OR(){return this.dispose(),this.P_.OR(),this}wv(t){return this.P_.wv(t),this}Cv(t){this.mH.push(t),Cy(this.xH.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let n=Math.max(t,r.iFirstUniqueVector.primary);n<=Math.min(e,r.iFirstUniqueVector.primary+r.sizeUniqueHeatmapDataVectors.primary-1);n+=1){const t=(n-r.iFirstUniqueVector.primary)*r.sizeHeatmapDataVectors.secondary;let e=this.vH[n];if(e)i=ie.max?s:e.max;else{e={min:Le,max:Pe},this.vH[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.yH={min:i,max:s},this.yH}}class pp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.BY="disabled",this._U=0,this.CU={},this.Di={x:0,z:0},this.Xw={x:1,z:1},this.Yn={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this._H={min:{x:this.Di.x,z:this.Di.z},max:{x:"rows"===s.scrollDimension?this.Di.x+(s.columns-1)*this.Xw.x:this.Di.x,z:"columns"===s.scrollDimension?this.Di.z+(s.rows-1)*this.Xw.z:this.Di.z}};const o=()=>({shape:new yp(this.LY,kt,this.No,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.pN,this.mN).setVisible(!1),hasData:!1});this.JM=[o(),o()]}Ds(t){this.JM.forEach((e=>{e.shape.Ds(t)}));const e=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.P_.Ka)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.P_.Ka)||void 0===s?void 0:s.max,Pe)),t}),{min:Le,max:Pe}),i=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.yH)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.yH)||void 0===s?void 0:s.max,Pe)),t}),{min:Le,max:Pe});return this.JM.forEach((t=>{t.shape.P_.Ka=e,t.shape.yH=i})),this}VL(t){return this.JM.forEach((e=>{e.hasData&&(e.shape.YY=this.YY,e.shape.HY=this.HY,e.shape.$Y=this.$Y,e.shape.VL(t))})),this}vv(t,e){return this.Di=t,this.Xw=e,this.JM.forEach((t=>{t.shape.vv("columns"===this.Yn.scrollDimension?{x:t.shape.xv().start.x,z:this.Di.z}:{x:this.Di.x,z:t.shape.xv().start.z},this.Xw)})),"columns"===this.Yn.scrollDimension?(this._H.min.z=t.z,this._H.max.z=this.Di.z+(this.Yn.rows-1)*this.Xw.z):(this._H.min.x=t.x,this._H.max.x=this.Di.x+(this.Yn.columns-1)*this.Xw.x),this}xv(){return{start:this.Di,step:this.Xw}}Gt(){return this._U=0,this.CU={},this._H={min:{x:this.Di.x,z:this.Di.z},max:{x:"rows"===this.Yn.scrollDimension?this.Di.x+(this.Yn.columns-1)*this.Xw.x:this.Di.x,z:"columns"===this.Yn.scrollDimension?this.Di.z+(this.Yn.rows-1)*this.Xw.z:this.Di.z}},this.JM.forEach((t=>{t.shape.setVisible(!1),t.shape.SH=!1,t.hasData=!1})),this}Iv(t){var e;const i=this.JM[0],s=this.JM[1],r=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let n=0;if(!r)return this;do{const e=Math.floor(this._U/this.Yn.scrollDimensionSize)%this.JM.length,o=this.JM[e],h=this._U%this.Yn.scrollDimensionSize,a=this.Yn.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,y=this._U>=this.Yn.scrollDimensionSize&&c<=this.Yn.scrollDimensionSize-1,p=l;l&&(o.shape.vv("columns"===this.Yn.scrollDimension?{x:this.Di.x+(this._U-1)*this.Xw.x,z:this.Di.z}:{x:this.Di.x,z:this.Di.z+(this._U-1)*this.Xw.z},this.Xw),o.shape.setVisible(!0));const x=y?0:1,S=c+(y?1:0);o.shape.bH({fill:{iFirstPrimary:x,amountPrimary:S},wireframe:{iFirstPrimary:x,amountPrimary:S,connectNext:!1}});const A=o===i?s:i,v=c+1,b=1+this.Yn.scrollDimensionSize-v;A.shape.bH({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;p&&this.CU.yValues&&(i=!0,e.splice(0,0,this.CU.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Yn.staticDimensionSize,values:e,type:"y"};o.shape.Cv(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;p&&this.CU.intensityValues&&(i=!0,e.splice(0,0,this.CU.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Yn.staticDimensionSize,values:e,type:"intensity"};o.shape.wv(s),o.hasData=!0,M.intensityValues=e[u-1]}this._U+=u,n+=u,this.CU=M}while(ne.shape.Mv(t))),this}_v(){return this.JM[0].shape._v()}ke(t){return this.JM.forEach((e=>e.shape.ke(t))),this}zh(){return this.JM[0].shape.zh()}mv(t){return this.JM.forEach((e=>e.shape.mv(t))),this}bv(){return this.JM[0].shape.bv()}OR(){return this.dispose(),this.JM.forEach((t=>t.shape.OR())),this}dispose(){return super.dispose(),this.JM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.JM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}nS(t){return super.nS(t),this.JM.forEach((e=>e.shape.nS(t))),this}bt(){return this._H.max.x}xt(){return this._H.min.x}_t(){return Math.max(this.JM[0].shape._t(),this.JM[1].shape._t())}Mt(){return Math.min(this.JM[0].shape.Mt(),this.JM[1].shape.Mt())}lS(){return this._H.max.z}uS(){return this._H.min.z}xl(){return 0}bl(){return 0}cS(){return 0}ds(t){return super.ds(t),this.JM.forEach((e=>e.shape.ds(t))),this}}class xp extends jy{constructor(t,e,i,s){super(t,e,i),this.FH=45,this.IH=.1,this.PH=100,this.HY=f(0,0,1),this.DH=f(0,0,-1),this.BH=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.tS=new Un,this.ft=s}qv(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.ft,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.cs.ai();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.HY=t,this}getCameraLocation(){return this.HY}setCameraDirection(t){return this.DH=De.normalize(t),this}getCameraDirection(){return this.DH}setLightLocation(t){return this.$Y=t,this}getLightLocation(){return this.$Y}LH(){return f(this.BH[0],this.BH[1],this.BH[2])}RH(){return f(this.BH[4],this.BH[5],this.BH[6])}}class Sp extends xp{constructor(t,e,i,s){super(t,e,i,s),this.lE=new Hm,this.EH=!0,this.nN=t,this.gl=t.aN(),this._Y=this.SY,this.zH=this.cs.ko((()=>{this.EH=!0})),this.VH=s.Y((()=>{this.EH=!0}))}nV(t){const e=t.xt(),i=t.Mt(),s=t.uS(),r=t.bt(),n=t._t(),o=t.lS();if(e===Le||r===Pe||i===Le||n===Pe||s===Le||o===Pe)return _e;const h=t.xl(),a=t.bl(),l=t.cS(),u=Math.abs(t.Ts.Gy(h)*t.ft.x.ht()),c=Math.abs(t.Ts.Gy(a)*t.ft.y.ht()),d=Math.abs(t.Ts.Gy(l)*t.ft.z.ht()),f=e-u,g=r+u,m=i-c,y=n+c,p=s-d,x=o+d;let S;return[{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:x},{x:g,y:m,z:x},{x:f,y,z:x},{x:g,y,z:x}].map((e=>t.Ts.Uy(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};S=S?Je(S,{min:t,max:t}):e})),S||_e}wY(t){const e=Array.from(this._Y.values());for(let i=0;iye()));const{viewProjectionMatrix:s}=this.OH();this.NH();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.SY.forEach((t=>{t.YY=s,t.HY=r,t.$Y=n,t.Ds(i)})),this}OH(){if(!this.EH&&this.YY)return{viewProjectionMatrix:this.YY};const t=this.qv(),e=t.width/t.height;this.GH=pl.projectionPerspective(this.FH,e,this.IH,this.PH);const i=this.HY;this.BH[12]=i.x,this.BH[13]=i.y,this.BH[14]=i.z;const s=this.DH,r=f(0,1,0),n=De.multiply(s,-1),o=De.normalize(De.cross(r,n)),h=De.normalize(De.cross(n,o));this.BH[0]=o.x,this.BH[1]=o.y,this.BH[2]=o.z,this.BH[4]=h.x,this.BH[5]=h.y,this.BH[6]=h.z,this.BH[8]=n.x,this.BH[9]=n.y,this.BH[10]=n.z,this.WH=pl.inverse(this.BH);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.ft,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,m=(a.y+l.y/2)/u.y,y=pl.multiply(pl.translation(Pn(-1,1,g),Pn(-1,1,m),0),pl.scaling(c,d,1));return this.YY=pl.multiply(y,pl.multiply(this.GH,this.WH)),this.UH=pl.inverse(this.YY),this.EH=!1,{viewProjectionMatrix:this.YY}}NH(){this.lE.qO(this.ft.x),this.lE.tN(this.ft.y),this.lE.iN(this.ft.z)}VL(t,e){const i=this.gl.Xz(),s=this.qv(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.rV(r.x,r.y,r.width,r.height),this.SY.forEach((e=>{e.getVisible()&&(this.gl.qz(e.BY),1!==t&&this.gl.oS(e.sS),(1!==t||e.getMouseInteractions())&&e.VL(t))})),this.gl.qz("disabled"),this.gl.oS(!1),this.gl.tV(!1),this}setCameraLocation(t){return this.HY.x===t.x&&this.HY.y===t.y&&this.HY.z===t.z||(this.EH=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.DH.x===t.x&&this.DH.y===t.y&&this.DH.z===t.z||(this.EH=!0),super.setCameraDirection(t),this}U(){super.U(),this.cs.To(this.zH),this.ft.H(this.VH)}bS(t){const e=this.nN.CY();return this.vY(new gp(this,this.xY,[],e,this.nN.kY(e),t))}sy(t){const e=this.nN.CY();return this.vY(new up(this,this.xY,t,e,this.nN.kY(e)))}gS(){const t=this.nN.CY();return this.vY(new rp(this,this.xY,[],t,this.nN.kY(t)))}Ev(){const t=this.nN.CY();return this.vY(new fp(this,this.xY,[],t,this.nN.kY(t)))}Rg(){const t=this.nN.CY();return this.vY(new hp(this,this.xY,[],t,this.nN.kY(t)))}yv(t){const e=this.nN.CY();return this.vY(new yp(this,this.xY,[],t,e,this.nN.kY(e)))}Fv(t){const e=this.nN.CY();return this.vY(new pp(this,this.xY,[],t,e,this.nN.kY(e)))}}class Ap extends Tr{constructor(t,e,i,s=Um){if(super(t,e,i),this.j=c(1,1),this.YH=!1,this.HH=0,this.$H=!0,this.XH=0,this.iH=8388608,this.XE=[null,null],this.jH=null,this.ZH=null,this.QH=0,this.Jg=!1,this.JH=0,this.vs=(t=!1)=>(this.Xi||this.fn||this.KH()||(t&&(this.YH=!0),this.rn=!0,this.qH||this.Jr.oz(t)),this),this.qH=!1,this.dz=t=>{if(this.Xi||this.fn)return;const e=t-this.HH;if(e>=this.Jn||-1===this.Jn){this.qH=!0,this.HH=t,this.YH=!1;const i=e>50?1e3/60:e;this.nn&&this.nn(i),this.rn=!1,-1!==this.Jn&&this.YH&&(this.Jr.oz(this.YH),this.rn=!0),this.us.Ds(e),this.Sn(),this.vn(),this.an&&this.an(),this.qH=!1,this.L.emit("render"),this.rn&&this.vs(this.YH)}else this.rn=!0,this.Jr.oz()},this.t$=new Map,this.aN=()=>this.ER,this.i$=()=>{var t,e,i;const s=this.Nn(),r=this.$H,n=bt.performance.now(),o=null===(t=this.s$)||void 0===t?void 0:t.e$.reduce(((t,e)=>t?e.h$&&t.h$&&e.h$>t.h$?e:t:e),void 0),h=null==o?void 0:o.h$,a=null===(e=this.Bn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Mo)||void 0===i?void 0:i.timeStamp;return r?(this.vs(!0),!1):void 0===o||(void 0===o||!o.r$)&&(void 0!==l&&void 0!==h&&l>h||(void 0!==h&&void 0===s?n-h>=1e3:!(void 0!==h&&void 0!==a&&n-a>=2e3)||n-h>=1e3))},this.n$=()=>{var t,e;this.o$=void 0;const i=null===(e=null===(t=this.s$)||void 0===t?void 0:t.a$)||void 0===e?void 0:e.l$;void 0===i||i>=this.XH||this.u$()},this.vn=()=>{if(this.Xi||this.fn)return this;const t=this.ER.gl,e=bt.performance.now();this.ER.eV(t.FRAMEBUFFER,this.Jr.iz?this.XE[0]:null);const i=this.j,s=i.x>0&&i.y>0;if(this.pn.o&&this.ER.tO(this.pn._()),t.resize&&s&&t.resize(i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.hV(0,0,i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.rV(0,0,i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.Gt(),s)for(const t of this.sn.values())t.VL(0,1);if(this.Yn.jn&&s&&(this.o$&&(bt.clearTimeout(this.o$),this.o$=void 0),this.i$()?(this.u$(),this.ER.eV(t.FRAMEBUFFER,this.Jr.iz?this.XE[0]:null)):this.o$=bt.setTimeout(this.n$,500)),this.Z(),this.Zr(),this.wn&&this._n(this.wn),this.Jr.iz){const e=this.ER.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.XE[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.XE[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.GE),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),0),t.bindTexture(t.TEXTURE_2D,null);return this.ER.eV(t.FRAMEBUFFER,null),this.Jr.oz(),this.$H=!1,this.XH=e,this},this.Sn=()=>{if("use-window"===this.c$.mode){const t=bt.devicePixelRatio||1;this.ER.fO(t)}const t=this.j;if(0===t.x||0===t.y)return this;this.ao.tt(t);for(const t of this.sn.values())t.Ds();return this.Z(),this},this.d$=1,this.Jr=t,this.Jr.qE){this.f$=bt.document.createElement("canvas"),this.f$.style.width="100%",this.f$.style.height="100%",this.f$.style.display="block",this.f$.style.boxSizing="content-box",this.f$.style.position="absolute";const t=this.f$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new yt("No Canvas context available.");this.WE=t,this.Wr.appendChild(this.f$)}this.Jr.gz(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 n;if(this.Jr.iz&&t.gl2&&(n=new s(this,this.Yn,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),n||this.Jr.iz||(n=new s(this,this.Yn,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),!n)throw new yt("No WebGL context available");if(this.ER=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.c$={mode:"fixed",value:e.devicePixelRatio},this.ER.fO(e.devicePixelRatio);else{const t=bt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=bt.devicePixelRatio||1;this.c$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.ER.fO(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.ro=this.A$(o),this.oo=this.A$(h),this.g$(this.ro,this.oo),this.kU=this.II("engine offscreen",1e6),this.p$=this.II("engine bg",0);const a="function"==typeof this.ts.lcjsBackgroundFillStyle?this.ts.lcjsBackgroundFillStyle(this.Yn.Xs):this.ts.lcjsBackgroundFillStyle;this.ao=this.p$.Te(this.ft).ke(a).Ce(this.ts.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ie({x:0,y:0});const l=this.II("engine effects",200001).TY(this.ts.effect);this.hs=l;const u=this.Jr.iz,d=this.ai();u&&(this.XE=[n.xV(),n.xV()]);const f=this.ER.gl;u&&(this.jH=f.createRenderbuffer(),this.ZH=f.createRenderbuffer()),this.GE=f.createTexture();const g=d.x*this.ER.Xz(),m=d.y*this.ER.Xz();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.jH);const t=this.ER.gl2.ctx;this.QH=this.Jr.DE&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.QH,t.RGBA8,g,m),f.bindRenderbuffer(f.RENDERBUFFER,this.ZH),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,m),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.QH,t.DEPTH_COMPONENT16,g,m)}u&&(this.ER.eV(f.FRAMEBUFFER,this.XE[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.jH),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.ZH)),f.bindTexture(f.TEXTURE_2D,this.GE),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,m,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),u&&(this.ER.eV(f.FRAMEBUFFER,this.XE[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.GE,0)),this.ER.eV(f.FRAMEBUFFER,null),this.An(),this.Zr(),this.hp=Ar(this),this.rp={ts:this.ts,us:this.us,ft:this.ft,vs:t=>this.vs(t),Nn:()=>this.Nn(),dB:t=>this.dB(t),Yn:this.Yn,Gn:t=>this.Gn(t),hs:this.hs,Do:t=>this.Do(t),Bo:t=>this.Bo(t),Pg:{Ig:(t,e,i)=>this.ER.Oh(e.family).JR(t,e,i,this.ts.isDark)}};const y=()=>{this.U()};bt.addEventListener("unload",y),this.ln.push((()=>{bt.removeEventListener("unload",y)}))}get m$(){return this.sn}Kr(t,e){let i=this.t$.get(t);if(!i){const e=this.ER.SO(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.t$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{fB:()=>e.Bz,AB:t=>{e.Bz?t():o.push(t)}}},this.t$.set(t,i),e.ZR(this),e.Nz((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new eo(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}dB(t){const e=Array.from(this.t$.values()).find((e=>e.instances.has(t)));if(!e)throw me(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}Cn(t,e){var i;const s=null===(i=this.s$)||void 0===i?void 0:i.a$;if(!s)return;const r=this.De(e.x,e.y),n=Math.round(r.x*this.ER.Xz()),o=Math.round(r.y*this.ER.Xz());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.y$(s,n+t[0]/s.S$,o+t[1]/s.S$))).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)}y$(t,e,i){const s=Math.round(e*t.S$),r=Math.round(i*t.S$);if(s<0||s>=t.j.x||r<0||r>=t.j.y)return;const n=4*(s+r*t.j.x),o=t.v$[n+0],h=t.v$[n+1],a=t.v$[n+2],l=t.v$[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.x$(o,h,a,l):void 0}$r(t,e,i){const s=this.ER.gl;this.Jr.iz?(this.ER.eV(s.FRAMEBUFFER,this.XE[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.GE,0)):this.ER.eV(s.FRAMEBUFFER,null);const r=this.NE(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.Jr.iz||this.vn(),s.readPixels(0,0,n,o,s.RGBA,s.UNSIGNED_BYTE,h);const a=new ImageData(new Uint8ClampedArray(h),n,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=n,l.height=o,u.putImageData(a,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.Jr.iz&&(this.ER.eV(s.FRAMEBUFFER,this.XE[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.jH),this.ER.eV(s.FRAMEBUFFER,this.XE[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.GE,0)),this.ER.eV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=bt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Zy))throw new Error("Unexpected Engine Layer error");return i}return this.xn(new Zy(this,e,t))}LI(t,e,i){const s=this.do(e);if(s){if(me(0,(()=>{})),!(s instanceof Sp))throw new Error("Unexpected Engine Layer error");return s}return this.xn(new Sp(this,e,t,i))}ai(){return this.j}NE(){const t=this.ER.Xz();return{x:Math.round(this.j.x*t),y:Math.round(this.j.y*t)}}A$(t){return t instanceof Array||(t=[t,t]),t}b$(){return this.Jr.UE}KH(){const t=this.ER.gl;return t&&"resize"in t}u$(){var t;const e=this.ER.gl,i=bt.performance.now(),s=this.Nn(),r=this.Yn.Xn,n={x:Math.ceil(this.j.x*this.ER.Xz()*r),y:Math.ceil(this.j.y*this.ER.Xz()*r)};this.s$||(this.s$={S$:r,M$:n,e$:[],a$:void 0});let o=this.s$.e$.find((t=>!t.r$)),h=!1;o||(h=!0,o={r$:!1,j:n,DO:e.createTexture(),_$:this.ER.xV(),ZH:this.ER.bV(),w$:new Uint8Array,h$:void 0},this.s$.e$.push(o));const a=o;(h||a.j.x!==n.x||a.j.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.DO),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.x,n.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.ER.eV(e.FRAMEBUFFER,a._$),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.DO,0),e.bindRenderbuffer(e.RENDERBUFFER,a.ZH),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.ZH),a.w$=new Uint8Array(n.x*n.y*4),a.j=n),a.r$=!0,a.h$=i,this.ER.eV(e.FRAMEBUFFER,a._$),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(n.x,n.y),this.ER.hV(0,0,n.x,n.y);for(const t of this.sn.values())t.VL(1,r);this.ER.eV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.ER.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.s$){const t=this.s$.a$;if(t&&t.l$>i)return;this.s$.a$={l$:i,S$:r,j:n,v$:a.w$,C$:s}}};l?this.ER.FO(l,a._$,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.w$).then((()=>{this.Xi||(a.r$=!1,u())})).catch((t=>{this.Xi||(a.r$=!1,bt.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.ER.IO(a._$,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.w$),a.r$=!1,u())}An(t){if("use-window"===this.c$.mode){const t=bt.devicePixelRatio||1;this.ER.fO(t)}const e=this.j.x,i=this.j.y,s=t||{x:this.Wr.offsetWidth,y:this.Wr.offsetHeight};if(0!==s.x&&0!==s.y&&(s.x!==e||s.y!==i)){this.j=s,this.ft.x.K(0,s.x).tt(s.x),this.ft.y.K(0,s.y).tt(s.y);const t=s.x*this.ER.Xz(),e=s.y*this.ER.Xz(),i=this.ER.gl;this.Jr.qE&&this.WE&&(this.WE.canvas.width=t,this.WE.canvas.height=e);const r=this.Jr.iz;if(this.GE&&(i.bindTexture(i.TEXTURE_2D,this.GE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),r){const s=this.ER.gl2.ctx;this.jH&&(i.bindRenderbuffer(i.RENDERBUFFER,this.jH),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.QH,s.RGBA8,t,e)),this.ZH&&(i.bindRenderbuffer(i.RENDERBUFFER,this.ZH),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.QH,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.L.emit("resize",[this.j.x,this.j.y])}}U(){var t;this.Xi||(super.U(),this.o$&&(bt.clearTimeout(this.o$),this.o$=void 0),Array.from(this.ER.bE.entries()).forEach((([t,e])=>{e.OR(!1),this.ER.bE.delete(t)})),Array.from(this.ER.CV.values()).forEach((t=>{t.unbindResources()})),this.ER.CV.clear(),this.ER.wV.Tz(),this.ER.lO.U(),this.ER.yV(this.ER.uO),this.ER.yV(this.ER.cO),this.ER.rO.forEach(((t,e)=>{this.ER.gl.deleteBuffer(e)})),this.ER.rO.clear(),this.ER._O&&(this.ER.yV(this.ER._O.buffer),this.ER._O=void 0),this.ER._V(this.XE[0]),this.ER._V(this.XE[1]),this.ER.MV(this.jH),this.ER.NR(this.GE),this.ER.MV(this.ZH),this.s$&&(this.s$.e$.forEach((t=>{this.ER.MV(t.ZH),this.ER._V(t._$),this.ER.NR(t.DO)})),this.s$=void 0),this.ER.sO.forEach((t=>this.ER.yV(t))),this.t$.clear(),this.Jr.mz(this),this.f$&&(null===(t=this.f$.parentElement)||void 0===t||t.removeChild(this.f$),this.f$=void 0),this.WE&&(this.WE=void 0),this.ER.gl=void 0)}CY(){const t=this.d$;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.d$=1),this.d$+=1,t}kY(t){let e=t;const i=Math.floor(e/16777216);e-=16777216*i;const s=Math.floor(e/65536);e-=65536*s;const r=Math.floor(e/256);return e-=256*r,E(i,s,r,e)}x$(t,e,i,s){if(0===t&&0===e&&0===i&&0===s)return;const r=16777216*t+65536*e+256*i+s;for(const t of this.m$.values()){const e=t.wY(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.bn()}}}}var vp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},bp={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 r(t,e,i){if(r.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.Oz(t||0,e||10,i||"be"))}var n;"object"==typeof bp?bp.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=(void 0).Buffer}catch(t){}function o(t,e,s){for(var r=0,n=Math.min(t.length,s),o=0,h=e;h=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=a}return i(!(240&o),"Invalid character in "+t),r}function h(t,e,s,r){for(var n=0,o=0,h=Math.min(t.length,s),a=e;a=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.Oz=function(t,e,s){if("number"==typeof t)return this.k$(t,e,s);if("object"==typeof t)return this.T$(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this.F$(t,r):this.I$(t,e,r),"-"===t[0]&&(this.negative=1),this.P$(),"le"===s&&this.T$(this.toArray(),e,s)},r.prototype.k$=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.T$(this.toArray(),e,s)},r.prototype.T$=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 r=0;r=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);else if("le"===s)for(r=0,n=0;r>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);return this.P$()},r.prototype.F$=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)r=o(t,i,i+6),this.words[s]|=r<>>26-n&4194303,(n+=24)>=26&&(n-=26,s++);i+6!==e&&(r=o(t,e,i+6),this.words[s]|=r<>>26-n&4194303),this.P$()},r.prototype.I$=function(t,e,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=e)s++;s--,r=r/e|0;for(var n=t.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.R$()},r.prototype.R$=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.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 r=0|t.words[0],n=0|e.words[0],o=r*n,h=67108863&o,a=o/67108864|0;i.words[0]=h;for(var l=1;l>>26,c=67108863&a,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=(r=0|t.words[g])*(n=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,a=0|u}return 0!==a?i.words[l]=0|a:i.length--,i.P$()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.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")},r.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},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.P$();var r=this.byteLength(),n=s||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},r.prototype.E$=function(t,e){for(var i=0,s=0,r=0,n=0;r>8&255),i>16&255),6===n?(i>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===n?(i>=0&&(t[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?r.prototype.V$=function(t){return 32-Math.clz32(t)}:r.prototype.V$=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},r.prototype.O$=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},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.V$(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.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)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.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)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.L$(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.P$()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,r=t%26;return this.L$(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.R$()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.R$();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,y=0|o[2],p=8191&y,x=y>>>13,S=0|o[3],A=8191&S,v=S>>>13,b=0|o[4],M=8191&b,E=b>>>13,w=0|o[5],T=8191&w,k=w>>>13,C=0|o[6],R=8191&C,I=C>>>13,F=0|o[7],D=8191&F,L=F>>>13,P=0|o[8],_=8191&P,V=P>>>13,B=0|o[9],z=8191&B,N=B>>>13,O=0|h[0],U=8191&O,G=O>>>13,Y=0|h[1],H=8191&Y,X=Y>>>13,W=0|h[2],j=8191&W,$=W>>>13,Z=0|h[3],K=8191&Z,J=Z>>>13,q=0|h[4],Q=8191&q,tt=q>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(l+(s=Math.imul(c,U))|0)+((8191&(r=(r=Math.imul(c,G))+Math.imul(d,U)|0))<<13)|0;l=((n=Math.imul(d,G))+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(g,U),r=(r=Math.imul(g,G))+Math.imul(m,U)|0,n=Math.imul(m,G);var pt=(l+(s=s+Math.imul(c,H)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,H)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,U),r=(r=Math.imul(p,G))+Math.imul(x,U)|0,n=Math.imul(x,G),s=s+Math.imul(g,H)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(m,H)|0,n=n+Math.imul(m,X)|0;var xt=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(A,U),r=(r=Math.imul(A,G))+Math.imul(v,U)|0,n=Math.imul(v,G),s=s+Math.imul(p,H)|0,r=(r=r+Math.imul(p,X)|0)+Math.imul(x,H)|0,n=n+Math.imul(x,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,j)|0,n=n+Math.imul(m,$)|0;var St=(l+(s=s+Math.imul(c,K)|0)|0)+((8191&(r=(r=r+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;l=((n=n+Math.imul(d,J)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(M,U),r=(r=Math.imul(M,G))+Math.imul(E,U)|0,n=Math.imul(E,G),s=s+Math.imul(A,H)|0,r=(r=r+Math.imul(A,X)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(p,j)|0,r=(r=r+Math.imul(p,$)|0)+Math.imul(x,j)|0,n=n+Math.imul(x,$)|0,s=s+Math.imul(g,K)|0,r=(r=r+Math.imul(g,J)|0)+Math.imul(m,K)|0,n=n+Math.imul(m,J)|0;var At=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(T,U),r=(r=Math.imul(T,G))+Math.imul(k,U)|0,n=Math.imul(k,G),s=s+Math.imul(M,H)|0,r=(r=r+Math.imul(M,X)|0)+Math.imul(E,H)|0,n=n+Math.imul(E,X)|0,s=s+Math.imul(A,j)|0,r=(r=r+Math.imul(A,$)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,$)|0,s=s+Math.imul(p,K)|0,r=(r=r+Math.imul(p,J)|0)+Math.imul(x,K)|0,n=n+Math.imul(x,J)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,tt)|0;var vt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((n=n+Math.imul(d,st)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(R,U),r=(r=Math.imul(R,G))+Math.imul(I,U)|0,n=Math.imul(I,G),s=s+Math.imul(T,H)|0,r=(r=r+Math.imul(T,X)|0)+Math.imul(k,H)|0,n=n+Math.imul(k,X)|0,s=s+Math.imul(M,j)|0,r=(r=r+Math.imul(M,$)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(A,K)|0,r=(r=r+Math.imul(A,J)|0)+Math.imul(v,K)|0,n=n+Math.imul(v,J)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(x,Q)|0,n=n+Math.imul(x,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(m,it)|0,n=n+Math.imul(m,st)|0;var bt=(l+(s=s+Math.imul(c,nt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ot)|0)+Math.imul(d,nt)|0))<<13)|0;l=((n=n+Math.imul(d,ot)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,U),r=(r=Math.imul(D,G))+Math.imul(L,U)|0,n=Math.imul(L,G),s=s+Math.imul(R,H)|0,r=(r=r+Math.imul(R,X)|0)+Math.imul(I,H)|0,n=n+Math.imul(I,X)|0,s=s+Math.imul(T,j)|0,r=(r=r+Math.imul(T,$)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,$)|0,s=s+Math.imul(M,K)|0,r=(r=r+Math.imul(M,J)|0)+Math.imul(E,K)|0,n=n+Math.imul(E,J)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(x,it)|0,n=n+Math.imul(x,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(m,nt)|0,n=n+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,at)|0)|0)+((8191&(r=(r=r+Math.imul(c,lt)|0)+Math.imul(d,at)|0))<<13)|0;l=((n=n+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(_,U),r=(r=Math.imul(_,G))+Math.imul(V,U)|0,n=Math.imul(V,G),s=s+Math.imul(D,H)|0,r=(r=r+Math.imul(D,X)|0)+Math.imul(L,H)|0,n=n+Math.imul(L,X)|0,s=s+Math.imul(R,j)|0,r=(r=r+Math.imul(R,$)|0)+Math.imul(I,j)|0,n=n+Math.imul(I,$)|0,s=s+Math.imul(T,K)|0,r=(r=r+Math.imul(T,J)|0)+Math.imul(k,K)|0,n=n+Math.imul(k,J)|0,s=s+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,s=s+Math.imul(A,it)|0,r=(r=r+Math.imul(A,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(x,nt)|0,n=n+Math.imul(x,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(m,at)|0,n=n+Math.imul(m,lt)|0;var Et=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,U),r=(r=Math.imul(z,G))+Math.imul(N,U)|0,n=Math.imul(N,G),s=s+Math.imul(_,H)|0,r=(r=r+Math.imul(_,X)|0)+Math.imul(V,H)|0,n=n+Math.imul(V,X)|0,s=s+Math.imul(D,j)|0,r=(r=r+Math.imul(D,$)|0)+Math.imul(L,j)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(R,K)|0,r=(r=r+Math.imul(R,J)|0)+Math.imul(I,K)|0,n=n+Math.imul(I,J)|0,s=s+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(E,it)|0,n=n+Math.imul(E,st)|0,s=s+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(x,at)|0,n=n+Math.imul(x,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,n=n+Math.imul(m,dt)|0;var wt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,H),r=(r=Math.imul(z,X))+Math.imul(N,H)|0,n=Math.imul(N,X),s=s+Math.imul(_,j)|0,r=(r=r+Math.imul(_,$)|0)+Math.imul(V,j)|0,n=n+Math.imul(V,$)|0,s=s+Math.imul(D,K)|0,r=(r=r+Math.imul(D,J)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,J)|0,s=s+Math.imul(R,Q)|0,r=(r=r+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(T,it)|0,r=(r=r+Math.imul(T,st)|0)+Math.imul(k,it)|0,n=n+Math.imul(k,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(E,nt)|0,n=n+Math.imul(E,ot)|0,s=s+Math.imul(A,at)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(x,ct)|0,n=n+Math.imul(x,dt)|0;var Tt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,j),r=(r=Math.imul(z,$))+Math.imul(N,j)|0,n=Math.imul(N,$),s=s+Math.imul(_,K)|0,r=(r=r+Math.imul(_,J)|0)+Math.imul(V,K)|0,n=n+Math.imul(V,J)|0,s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(R,it)|0,r=(r=r+Math.imul(R,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(T,nt)|0,r=(r=r+Math.imul(T,ot)|0)+Math.imul(k,nt)|0,n=n+Math.imul(k,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(E,at)|0,n=n+Math.imul(E,lt)|0,s=s+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var kt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,mt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,K),r=(r=Math.imul(z,J))+Math.imul(N,K)|0,n=Math.imul(N,J),s=s+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,tt)|0)+Math.imul(V,Q)|0,n=n+Math.imul(V,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(R,nt)|0,r=(r=r+Math.imul(R,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(T,at)|0,r=(r=r+Math.imul(T,lt)|0)+Math.imul(k,at)|0,n=n+Math.imul(k,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var Ct=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,mt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,mt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,Q),r=(r=Math.imul(z,tt))+Math.imul(N,Q)|0,n=Math.imul(N,tt),s=s+Math.imul(_,it)|0,r=(r=r+Math.imul(_,st)|0)+Math.imul(V,it)|0,n=n+Math.imul(V,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(R,at)|0,r=(r=r+Math.imul(R,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(T,ct)|0,r=(r=r+Math.imul(T,dt)|0)+Math.imul(k,ct)|0,n=n+Math.imul(k,dt)|0;var Rt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(N,it)|0,n=Math.imul(N,st),s=s+Math.imul(_,nt)|0,r=(r=r+Math.imul(_,ot)|0)+Math.imul(V,nt)|0,n=n+Math.imul(V,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(R,ct)|0,r=(r=r+Math.imul(R,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(T,gt)|0)|0)+((8191&(r=(r=r+Math.imul(T,mt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((n=n+Math.imul(k,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(N,nt)|0,n=Math.imul(N,ot),s=s+Math.imul(_,at)|0,r=(r=r+Math.imul(_,lt)|0)+Math.imul(V,at)|0,n=n+Math.imul(V,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(L,ct)|0,n=n+Math.imul(L,dt)|0;var Ft=(l+(s=s+Math.imul(R,gt)|0)|0)+((8191&(r=(r=r+Math.imul(R,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,mt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(N,at)|0,n=Math.imul(N,lt),s=s+Math.imul(_,ct)|0,r=(r=r+Math.imul(_,dt)|0)+Math.imul(V,ct)|0,n=n+Math.imul(V,dt)|0;var Dt=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(N,ct)|0,n=Math.imul(N,dt);var Lt=(l+(s=s+Math.imul(_,gt)|0)|0)+((8191&(r=(r=r+Math.imul(_,mt)|0)+Math.imul(V,gt)|0))<<13)|0;l=((n=n+Math.imul(V,mt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,mt))+Math.imul(N,gt)|0))<<13)|0;return l=((n=Math.imul(N,mt))+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=yt,a[1]=pt,a[2]=xt,a[3]=St,a[4]=At,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=Et,a[9]=wt,a[10]=Tt,a[11]=kt,a[12]=Ct,a[13]=Rt,a[14]=It,a[15]=Ft,a[16]=Dt,a[17]=Lt,a[18]=Pt,0!==l&&(a[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,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.P$()}function y(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.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):y(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),y(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,r=0;r>=26,s+=n/67108864|0,s+=o>>>26,this.words[r]=67108863&o}return 0!==s&&(this.words[r]=s,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>r&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,s=0;s=0);var e,s=t%26,r=(t-s)/26,n=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!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),h=67108863^67108863>>>n<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=r);l--){var c=0|this.words[l];this.words[l]=u<<26-n|c>>>n,u=c&h}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.P$()},r.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,r=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 r=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},r.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)-(a/67108864|0),this.words[r+s]=67108863&n}for(;r>26,this.words[r+s]=67108863&n;if(0===h)return this.P$();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.P$()},r.prototype.G$=function(t,e){var i=(this.length,t.length),s=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this.V$(o))&&(n=n.ushln(i),s.iushln(i),o=0|n.words[n.length-1]);var h,a=s.length-n.length;if("mod"!==e){(h=new r(null)).length=a+1,h.words=new Array(h.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[n.length+c])+(0|s.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),s.N$(n,d,c);0!==s.negative;)d--,s.negative=0,s.N$(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.P$(),s.P$(),"div"!==e&&0!==i&&s.iushrn(i),{div:h||null,mod:s}},r.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):this.negative&t.negative?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this.G$(t,e);var n,o,h},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.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),r=t.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(s*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*s;this.words[r]=n/t|0,s=n%t}return this.P$(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.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 n=new r(1),o=new r(0),h=new r(0),a=new r(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;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(c)),n.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;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.W$=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 n,o=new r(1),h=new r(0),a=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(a),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;)h.isOdd()&&h.iadd(a),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(h)):(s.isub(e),h.isub(o))}return(n=0===e.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},r.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 r=e.cmp(i);if(r<0){var n=e;e=i,i=n}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,r=1<>>26,h&=67108863,this.words[o]=h}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.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.P$(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:rt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],r=0|t.words[i];if(s!==r){sr&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.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).U$(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.U$=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.U$(t)},r.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},r.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},r.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},r.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},r.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},r.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.Y$(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.Y$(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.H$(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.H$(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.H$(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.H$(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.H$(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.H$(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function x(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.$$()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.X$(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 E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.W$(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)}x.prototype.$$=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},x.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.P$(),i},x.prototype.split=function(t,e){t.iushrn(this.n,0,e)},x.prototype.imulK=function(t){return t.imul(this.k)},s(S,x),S.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},S.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]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.X$=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new A;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return p[t]=e,e},M.prototype.H$=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.Y$=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).U$(this):(a(t,t.umod(this.m).U$(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).U$(this)},M.prototype.add=function(t,e){this.Y$(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.U$(this)},M.prototype.iadd=function(t,e){this.Y$(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.Y$(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.U$(this)},M.prototype.isub=function(t,e){this.Y$(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.H$(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.Y$(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.Y$(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 r(1)).iushrn(2);return this.pow(t,s)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var h=new r(1).toRed(this),a=h.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,l).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),g=o;0!==f.cmp(h);){for(var m=f,y=0;0!==m.cmp(h);y++)m=m.redSqr();i(y=0;s--){for(var l=e.words[s],u=a-1;u>=0;u--){var c=l>>u&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++h||0===s&&0===u)&&(n=this.mul(n,i[o]),h=0,o=0)):h=0}a=26}return n},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},r.mont=function(t){return new E(t)},s(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.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),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.U$(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).U$(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o.U$(this)},E.prototype.invm=function(t){return this.imod(t.W$(this.m).mul(this.r2)).U$(this)}}(0,vp);var Mp=bp.exports;function Ep(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,n=255&s;r?i.push(r,n):i.push(n)}return i}const wp=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const r=1<(r>>1)-1?(r>>1)-i:i,n.isubn(e)):e=0,s[t]=e,n.iushrn(1)}return s},Tp=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,r=0;for(;t.cmpn(-s)>0||e.cmpn(-r)>0;){let n,o,h=t.andln(3)+s&3,a=e.andln(3)+r&3;if(3===h&&(h=-1),3===a&&(a=-1),1&h){const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}else n=0;if(i[0].push(n),1&a){const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}else o=0;i[1].push(o),2*s===n+1&&(s=1-s),2*r===o+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i};class kp{constructor(t,e){this.type=t,this.p=new Mp(e.p,16),this.red=e.prime?Mp.red(e.prime):Mp.mont(this.p),this.zero=new Mp(0).toRed(this.red),this.one=new Mp(1).toRed(this.red),this.two=new Mp(2).toRed(this.red),this.n=e.n&&new Mp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.j$=new Array(4),this.Z$=new Array(4),this.Q$=new Array(4),this.J$=new Array(4),this.K$=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.q$=!0,this.redN=this.n.toRed(this.red))}tX(t,e){const i=t.iX(),s=wp(e,1,this.K$);let r=(1<=t;r--)e=(e<<1)+s[r];n.push(e)}let o=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(let t=r;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===n[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=n[i];o="affine"===t.type?s>0?o.mixedAdd(r[s-1>>1]):o.mixedAdd(r[-s-1>>1].neg()):s>0?o.add(r[s-1>>1]):o.add(r[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}hX(t,e,i,s,r){const n=this.j$,o=this.Z$,h=this.Q$;let a=0;for(let i=0;i=1;t-=2){const s=t-1,r=t;if(1!==n[s]||1!==n[r]){h[s]=wp(i[s],n[s],this.K$),h[r]=wp(i[r],n[r],this.K$),a=Math.max(h[s].length,a),a=Math.max(h[r].length,a);continue}const l=[e[s],null,null,e[r]];0===e[s].y.cmp(e[r].y)?(l[1]=e[s].add(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg())):0===e[s].y.cmp(e[r].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].add(e[r].neg())):(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=Tp(i[s],i[r]);a=Math.max(c[0].length,a),h[s]=new Array(a),h[r]=new Array(a);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)}iX(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let r=0;r({a:new Mp(t.a,16),b:new Mp(t.b,16)}))):this.dX(i),{beta:e,lambda:i,basis:s}}cX(t){const e=t===this.p?this.red:Mp.mont(t),i=new Mp(2).toRed(e).redInvm(),s=i.redNeg(),r=new Mp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}dX(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,r,n,o,h,a,l,u,c=t,d=this.n.clone(),f=new Mp(1),g=new Mp(0),m=new Mp(0),y=new Mp(1),p=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=y.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++p)break;a=l,d=c,c=l,m=f,f=u,y=g,g=o}o=l.neg(),h=u;const x=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(x)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}fX(t){const e=this.endo.basis,i=e[0],s=e[1],r=s.b.mul(t).divRound(this.n),n=i.b.neg().mul(t).divRound(this.n),o=r.mul(i.a),h=n.mul(s.a),a=r.mul(i.b),l=n.mul(s.b);return{k1:t.sub(o).sub(h),k2:a.add(l).neg()}}point(t,e,i){return new Ip(this,t,e,i)}pointFromX(t,e){(t=new Mp(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 r=s.fromRed().isOdd();return(e&&!r||!e&&r)&&(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),r=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)}AX(t,e,i){const s=this.lX,r=this.uX;let n=0;for(n=0;n":``}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(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new Mp(t,16),this.isInfinity()?this:this.oX(t)?this.curve.tX(this,t):this.curve.endo?this.curve.AX([this],[t]):this.curve.sX(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AX(s,r):this.curve.hX(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AX(s,r,!0):this.curve.hX(1,s,r,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 Fp extends Cp{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 Mp(0)):(this.x=new Mp(e,16),this.y=new Mp(i,16),this.z=new Mp(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 Fp(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),r=t.x.redMul(i),n=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),h=s.redSub(r),a=n.redSub(o);if(0===h.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=h.redSqr(),u=l.redMul(h),c=s.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(d)).redISub(n.redMul(u)),g=this.z.redMul(t.z).redMul(h);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),r=this.y,n=t.y.redMul(e).redMul(this.z),o=i.redSub(s),h=r.redSub(n);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const a=o.redSqr(),l=a.redMul(o),u=i.redMul(a),c=h.redSqr().redIAdd(l).redISub(u).redISub(u),d=h.redMul(u.redISub(c)).redISub(r.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(r),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class Dp{constructor(t){this.curve=new Rp(t),this.g=this.curve.g,this.n=this.curve.n}}const Lp={};var Pp;Lp.PresetCurve=Dp,Pp={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(Lp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Dp(Pp);return Object.defineProperty(Lp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class _p{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.yX(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof _p?e:new _p(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}yX(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 Vp(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let r=0,n=e.place;for(let e=0;e>>=0;return!(r<=127)&&(e.place=n,r)}class Bp{constructor(){this.place=0}}class zp{constructor(t,e){if(t instanceof zp)return t;this.SX(t,e)||(this.r=new Mp(t.r,16),this.s=new Mp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}SX(t,e){t=Ep(t,e);const i=new Bp;if(48!==t[i.place++])return!1;const s=Vp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Vp(t,i);if(!1===r)return!1;let n=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;const o=Vp(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let h=t.slice(i.place,o+i.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new Mp(n),this.s=new Mp(h),this.recoveryParam=null,!0}}class Np{constructor(t){if(!(this instanceof Np))return new Np(t);"string"==typeof t&&(t=Lp[t]),t instanceof Lp.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 _p.fromPublic(this,t,e)}vX(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.vX(new Mp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new zp(e,"hex")).r,n=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;const o=n.invm(this.n),h=o.mul(t).umod(this.n),a=o.mul(r).umod(this.n);if(!this.curve.q$){const t=this.g.mulAdd(h,i.getPublic(),a);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(r)}const l=this.g.jmulAdd(h,i.getPublic(),a);return!l.isInfinity()&&l.eqXToP(r)}}var Op,Up={exports:{}};Up.exports=(Op=Op||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!==vp&&vp.crypto&&(i=vp.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.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),n={},o=n.lib={},h=o.Base={extend:function(t){var e=r(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)}},a=o.WordArray=h.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,r=t.sigBytes;if(this.clamp(),s%4)for(var n=0;n>>2]>>>24-n%4*8&255;e[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var h=0;h>>2]=i[h>>>2];return this.sigBytes+=r,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=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).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 a.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],r=0;r>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}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 a.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=h.extend({reset:function(){this.Kw=new a.init,this.xX=0},bX:function(t){"string"==typeof t&&(t=d.parse(t)),this.Kw.concat(t),this.xX+=t.sigBytes},MX:function(e){var i,s=this.Kw,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this._X,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,y=l[f-2],p=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[f]=m+l[f-7]+p+l[f-16]}var x=s&r^s&n^r&n,S=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),A=d+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[f]+l[f];d=c,c=u,u=h,h=o+A|0,o=n,n=r,r=s,s=A+(S+x)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},kX:function(){var t=this.Kw,i=t.words,s=8*this.xX,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.MX(),this.IX},clone:function(){var t=n.clone.call(this);return t.IX=this.IX.clone(),t}});i.SHA256=n.TX(u),i.HmacSHA256=n.FX(u)}(Math),t.SHA256}(Up.exports),Wp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({CX:function(){this.IX=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},kX:function(){var t=r.kX.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.TX(n),e.HmacSHA224=r.FX(n),t.SHA224;var e,i,s,r,n}(Up.exports),jp={exports:{}}.exports=Up.exports.enc.Hex,$p={exports:{}}.exports=Up.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.PX;t.clamp();for(var r=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,h=0;h<4&&n+.75*h>>6*(3-h)&63));var a=s.charAt(64);if(a)for(;r.length%4;)r.push(a);return r.join("")},parse:function(t){var e=t.length,s=this.PX,r=this.DX;if(!r){r=this.DX=[];for(var n=0;n>>6-o%4*2;r[n>>>2]|=h<<24-n%4*8,n++}return i.create(r,n)}(t,e,r)},PX:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Up.exports),function(t){(function(e){var i=t,s=i.lib,r=s.WordArray,n=s.Hasher,o=i.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=o.MD5=n.extend({CX:function(){this.IX=new r.init([1732584193,4023233417,2562383102,271733878])},wX:function(t,e){for(var i=0;i<16;i++){var s=e+i,r=t[s];t[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var n=this.IX.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],y=t[e+5],p=t[e+6],x=t[e+7],S=t[e+8],A=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],E=t[e+13],w=t[e+14],T=t[e+15],k=n[0],C=n[1],R=n[2],I=n[3];k=l(k,C,R,I,o,7,h[0]),I=l(I,k,C,R,a,12,h[1]),R=l(R,I,k,C,f,17,h[2]),C=l(C,R,I,k,g,22,h[3]),k=l(k,C,R,I,m,7,h[4]),I=l(I,k,C,R,y,12,h[5]),R=l(R,I,k,C,p,17,h[6]),C=l(C,R,I,k,x,22,h[7]),k=l(k,C,R,I,S,7,h[8]),I=l(I,k,C,R,A,12,h[9]),R=l(R,I,k,C,v,17,h[10]),C=l(C,R,I,k,b,22,h[11]),k=l(k,C,R,I,M,7,h[12]),I=l(I,k,C,R,E,12,h[13]),R=l(R,I,k,C,w,17,h[14]),k=u(k,C=l(C,R,I,k,T,22,h[15]),R,I,a,5,h[16]),I=u(I,k,C,R,p,9,h[17]),R=u(R,I,k,C,b,14,h[18]),C=u(C,R,I,k,o,20,h[19]),k=u(k,C,R,I,y,5,h[20]),I=u(I,k,C,R,v,9,h[21]),R=u(R,I,k,C,T,14,h[22]),C=u(C,R,I,k,m,20,h[23]),k=u(k,C,R,I,A,5,h[24]),I=u(I,k,C,R,w,9,h[25]),R=u(R,I,k,C,g,14,h[26]),C=u(C,R,I,k,S,20,h[27]),k=u(k,C,R,I,E,5,h[28]),I=u(I,k,C,R,f,9,h[29]),R=u(R,I,k,C,x,14,h[30]),k=c(k,C=u(C,R,I,k,M,20,h[31]),R,I,y,4,h[32]),I=c(I,k,C,R,S,11,h[33]),R=c(R,I,k,C,b,16,h[34]),C=c(C,R,I,k,w,23,h[35]),k=c(k,C,R,I,a,4,h[36]),I=c(I,k,C,R,m,11,h[37]),R=c(R,I,k,C,x,16,h[38]),C=c(C,R,I,k,v,23,h[39]),k=c(k,C,R,I,E,4,h[40]),I=c(I,k,C,R,o,11,h[41]),R=c(R,I,k,C,g,16,h[42]),C=c(C,R,I,k,p,23,h[43]),k=c(k,C,R,I,A,4,h[44]),I=c(I,k,C,R,M,11,h[45]),R=c(R,I,k,C,T,16,h[46]),k=d(k,C=c(C,R,I,k,f,23,h[47]),R,I,o,6,h[48]),I=d(I,k,C,R,x,10,h[49]),R=d(R,I,k,C,w,15,h[50]),C=d(C,R,I,k,y,21,h[51]),k=d(k,C,R,I,M,6,h[52]),I=d(I,k,C,R,g,10,h[53]),R=d(R,I,k,C,v,15,h[54]),C=d(C,R,I,k,a,21,h[55]),k=d(k,C,R,I,S,6,h[56]),I=d(I,k,C,R,T,10,h[57]),R=d(R,I,k,C,p,15,h[58]),C=d(C,R,I,k,E,21,h[59]),k=d(k,C,R,I,m,6,h[60]),I=d(I,k,C,R,b,10,h[61]),R=d(R,I,k,C,f,15,h[62]),C=d(C,R,I,k,A,21,h[63]),n[0]=n[0]+k|0,n[1]=n[1]+C|0,n[2]=n[2]+R|0,n[3]=n[3]+I|0},kX:function(){var t=this.Kw,i=t.words,s=8*this.xX,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var n=e.floor(s/4294967296),o=s;i[15+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.MX();for(var h=this.IX,a=h.words,l=0;l<4;l++){var u=a[l];a[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=n.clone.call(this);return t.IX=this.IX.clone(),t}});function l(t,e,i,s,r,n,o){var h=t+(e&i|~e&s)+r+o;return(h<>>32-n)+e}function u(t,e,i,s,r,n,o){var h=t+(e&s|i&~s)+r+o;return(h<>>32-n)+e}function c(t,e,i,s,r,n,o){var h=t+(e^i^s)+r+o;return(h<>>32-n)+e}function d(t,e,i,s,r,n,o){var h=t+(i^(e|~s))+r+o;return(h<>>32-n)+e}i.MD5=n.TX(a),i.HmacMD5=n.FX(a)})(Math),t.MD5}(Up.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({CX:function(){this.IX=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},wX:function(t,e){for(var i=this.IX.words,s=i[0],r=i[1],n=i[2],h=i[3],a=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)+a+o[l];c+=l<20?1518500249+(r&n|~r&h):l<40?1859775393+(r^n^h):l<60?(r&n|r&h|n&h)-1894007588:(r^n^h)-899497514,a=h,h=n,n=r<<30|r>>>2,r=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+h|0,i[4]=i[4]+a|0},kX:function(){var t=this.Kw,e=t.words,i=8*this.xX,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.MX(),this.IX},clone:function(){var t=r.clone.call(this);return t.IX=this.IX.clone(),t}}),e.SHA1=r.TX(h),e.HmacSHA1=r.FX(h),t.SHA1;var e,i,s,r,n,o,h}(Up.exports),Yp=(Gp=Up.exports).lib.Base,Hp=Gp.enc.Utf8,Gp.algo.HMAC=Yp.extend({init:function(t,e){t=this.BX=new t.init,"string"==typeof e&&(e=Hp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.LX=e.clone(),n=this.RX=e.clone(),o=r.words,h=n.words,a=0;a>>2];t.sigBytes-=e}};i.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:f}),reset:function(){var t;l.reset.call(this);var e=this.cfg,i=e.iv,s=e.mode;this.VX==this.EX?t=s.createEncryptor:(t=s.createDecryptor,this._X=1),this.UX&&this.UX.YX==t?this.UX.init(this,i&&i.words):(this.UX=t.call(s,this,i&&i.words),this.UX.YX=t)},wX:function(t,e){this.UX.processBlock(t,e)},kX:function(){var t,e=this.cfg.padding;return this.VX==this.EX?(e.pad(this.Kw,this.blockSize),t=this.MX(!0)):(t=this.MX(!0),e.unpad(t)),t},blockSize:4});var g=i.CipherParams=s.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=(e.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),g.create({ciphertext:i,salt:e})}},y=i.SerializableCipher=s.extend({cfg:s.extend({format:m}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return g.create({ciphertext:n,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.HX(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},HX:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),p=(e.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=r.random(8));var n=a.create({keySize:e+i}).compute(t,s),o=r.create(n.words.slice(e),4*i);return n.sigBytes=4*e,g.create({key:n,iv:o,salt:s})}},x=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:p}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=y.encrypt.call(this,t,e,r.key,s);return n.mixIn(r),n},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.HX(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,y.decrypt.call(this,t,e,r.key,s)}})}()}(Up.exports);var Zp={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],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,r[i]=g,n[g]=i;var m=t[i],y=t[m],p=t[y],x=257*t[g]^16843008*g;o[i]=x<<24|x>>>8,h[i]=x<<16|x>>>16,a[i]=x<<8|x>>>24,l[i]=x,x=16843009*p^65537*y^257*m^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=m^t[t[t[p^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({CX:function(){if(!this.$X||this.XX!==this.OX){for(var t=this.XX=this.OX,e=t.words,i=t.sigBytes/4,s=4*((this.$X=i+6)+1),n=this.jX=[],o=0;o6&&o%i==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=g[o/i|0]<<24),n[o]=n[o-i]^l);for(var h=this.ZX=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.QX(t,e,this.jX,o,h,a,l,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.QX(t,e,this.ZX,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},QX:function(t,e,i,s,r,n,o,h){for(var a=this.$X,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]^r[u>>>16&255]^n[c>>>8&255]^o[255&d]^i[f++],y=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],p=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],x=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=m,u=y,c=p,d=x}m=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],y=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],p=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],x=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=m,t[e+1]=y,t[e+2]=p,t[e+3]=x},keySize:8});e.AES=i.TX(m)}(),t.AES}(Up.exports),Kp={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.NX,s=i.blockSize,r=this.GX,n=this.JX;r&&(n=this.JX=r.slice(0),this.GX=void 0);var o=n.slice(0);i.encryptBlock(o,0),n[s-1]=n[s-1]+1|0;for(var h=0;h>>2]|=t[r]<<24-r%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(Up.exports),qp={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Up.exports);const Qp={"-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==","VHJlZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},tx=bt,ex=(...t)=>t.slice(1).reduce(((e,i)=>e+tx.atob(Qp[t[0]][i].toString())),"");let ix,sx,rx,nx=new Uint8Array([]);class ox{set e(t){ix=t}get e(){sx={tf:!1,if:!1,sf:!1,ef:!1,hf:!1,rf:!1,nf:!1,af:!1,lf:!1,uf:!1,cf:!1,df:!1,ff:!1,Af:!1,gf:!1,pf:!1,mf:!1,yf:!1,Sf:!1,vf:!1,xf:!1,bf:!1,Mf:!1,_f:!1};const t=nx.length,e=t>=1?nx[0]:void 0,i=t>=2?nx[1]:void 0,s=t>=3?nx[2]:void 0;return void 0!==e&&(sx.tf=!!(1&e),sx.if=!!(2&e),sx.sf=!!(4&e),sx.ef=!!(8&e),sx.hf=!!(16&e),sx.rf=!!(32&e),sx.nf=!!(64&e),sx.af=!!(128&e)),void 0!==i&&(sx.lf=!!(1&i),sx.uf=!!(2&i),sx.cf=!!(4&i),sx.df=!!(8&i),sx.ff=!!(16&i),sx.Af=!!(32&i),sx.gf=!!(64&i),sx.pf=!!(128&i)),void 0!==s&&(sx.mf=!!(1&s),sx.yf=!!(2&s),sx.Sf=!!(4&s),sx.vf=!!(8&s),sx.xf=!!(16&s),sx.bf=!!(32&s),sx.Mf=!!(64&s),sx._f=!!(128&s)),sx.rf}set l(t){rx=t}get l(){return rx}}let hx=!1;const ax=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},lx=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")}`},ux=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),cx=t=>{const e={},i=t.split("-");if(3!==i.length)return{KX:ex(0,0,1,7,1,12,5)};let s=0;const r=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const n=r.subarray(s,s+=20),o=new DataView(r.buffer).getUint16(s,!0);s+=2;const h=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return gx(d,f)?e:{KX:ex(0,0,1,7,1,12,5)}},dx=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(ax(i,2)),e=t.slice(36,40),s=new Uint8Array(4),r=(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,r,!0);const n=t.slice(28,34);let o=0;for(let t=n.length-1;t>0;t-=1)o+=n[t]*2**(8*t);const h=new Date(o);if(ux(h)s[e]===t)))return{};break}case"0002":return cx(t);default:return{KX:ex(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{KX:ex(0,0,1,2,1,7,1,12,5)}},fx=t=>{if(!t)return{KX:ex(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[ex(-1,9)]||t[ex(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(tx[ex(-1,6)][ex(-1,7)])>-1)return{sj:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(Sx(tx[ex(-1,6)][ex(-1,7)],i))return{sj:!0};const s=t[ex(-1,8)]||t[ex(-1,38)];if(""!==s&&null!=s){if(Sx(tx[ex(-1,6)][ex(-1,7)],[s]))return{sj:!1};if(s===tx[ex(-1,6)][ex(-1,7)])return{sj:!1}}return{KX:ex(0,14,1,20,5)}},gx=(t,e)=>{const i=new Np("secp256k1").keyFromPublic(ex(-4,0),"hex"),s=Wp(t).toString();return i.verify(s,e)},mx=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],r=e[2],n=e[3];if(!gx(r,n))return{KX:ex(0,21,1,2,1,7,1,12,5)};const o=jp.parse(r);i=Zp.decrypt({ciphertext:jp.parse(s)},o,{mode:Kp,padding:qp,iv:jp.parse("00000000000000000000000000000001")}).toString($p)}catch(t){return{KX:ex(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{KX:ex(0,21,1,2,1,7,1,12,5)}}if(void 0===e[ex(-1,5)]||null===e[ex(-1,4)]||!e[ex(-1,9)])return{KX:ex(0,21,1,2,1,7,1,12,5)};const s=parseInt(ex(-3,0),10)||Number(parseInt(ex(-3,0),10));return e[ex(-1,5)]{const e=cx(t),i=e.qX,s=e.ij;if(e.KX||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.ij,s+16),r=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{KX:ex(0,39,1,40,1,41,5)};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!gx(`${s}-${r}`,n))return{KX:ex(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(ax(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(ex(-3,0),10)||Number(parseInt(ex(-3,0),10))))return{KX:ex(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(ax(s,8)),l=Xp(e[ex(-1,31)]).toString(jp),u=Int32Array.from(ax(l,8)),c=Xp(e[ex(-1,32)]).toString(jp),d=Int32Array.from(ax(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{KX:ex(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{KX:ex(0,39,1,40,1,41,5)};const i=cx(t),s=i.qX,r=i.ij;if(i.KX||void 0===s||void 0===r)return i;const n=s.slice(r,s.length),o=new DataView(n.buffer),h=new Int32Array(8);for(let t=0;td[e]===t))?{}:{KX:ex(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{KX:ex(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},px=(t,e,i=!0,s)=>{hx=!1,e.eo();const r=e.Wr,n=!!r&&(r===bt.document.body||bt.document.body.contains(r)),o=r&&n?r:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const e=bt.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 r,n=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(n=(i?ex(0,0,1,2,1,23,1,24,25,1):"")+n.charAt(0).toUpperCase()+n.substr(1),s){const t=bt.document.createElement("a");t.href=s,r=t}else r=bt.document.createElement("p1");e.append(r),r.innerHTML=n,r.style.color="red"}},xx=(t,e,i)=>{e?(t[ex(-1,17)](ex(-1,19),i),t[ex(-1,17)](ex(-1,20),i),t[ex(-1,17)](ex(-1,21),i),t[ex(-1,17)](ex(-1,22),i)):(t[ex(-1,18)](ex(-1,19),i),t[ex(-1,18)](ex(-1,20),i),t[ex(-1,18)](ex(-1,21),i),t[ex(-1,18)](ex(-1,22),i))},Sx=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const r=e.findIndex((t=>"*"===t)),n=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(r>i.length-1||!n)}))},Ax=new Map;e.Animation=Z,e.AnimationEasings=$,e.Animator=K,e.AreaRangeSeries=$u,e.AreaSeries=Uu,e.AreaSeriesBipolar=Gu,e.AreaSeriesMonopolar=Yu,e.AreaSeriesNegative=Hu,e.AreaSeriesPositive=Xu,e.AreaSeriesTypes=Wu,e.AutoCursor2DBuilder=ma,e.AutoCursorBuilders=_f,e.AutoCursorXYBuilder=nu,e.AutoFitStrategies=ha,e.AutoFitStrategy=ra,e.Axis=uh,e.Axis3D=ja,e.AxisScrollStrategies=zs,e.AxisTickStrategies=Ns,e.Band=Vs,e.BarChart=Ef,e.BarChartBar=vf,e.BarChartCategoryAxis=Sf,e.BarChartSorting=wf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=Af,e.BasicSeries=vu,e.BorderedPicture=Dn,e.BoxFigure=tu,e.BoxSeries=wu,e.BoxSeries3D=tl,e.Button=zo,e.Chart=Qh,e.Chart3D=Sl,e.ChartComponent=Yi,e.ChartMarker=du,e.ChartMarker2D=class extends du{constructor(t,e,i,s,r,n){super(t,e,i,s.lm(t,e,i,n),r,n)}},e.ChartMarkerXY=gu,e.ChartWithSeries=al,e.ChartXY=Vc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return E(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 E(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,r=t/60,n=s*(1-Math.abs(r%2-1));let o=[];isNaN(t)?o=[0,0,0]:r<=1?o=[s,n,0]:r<=2?o=[n,s,0]:r<=3?o=[0,s,n]:r<=4?o=[0,n,s]:r<=5?o=[n,0,s]:r<=6&&(o=[s,0,n]);const h=i-.5*s;return[Math.round(255*(o[0]+h)),Math.round(255*(o[1]+h)),Math.round(255*(o[2]+h))]})(e[0],e[1],e[2]);return E(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=C[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=T,e.ColorPalettes=Vn,e.ColorRGBA=E,e.ColorShadingStyles=Xn,e.ColorUint32=k,e.ConstantLine=Bs,e.CursorBuilder=ga,e.CursorBuilderXY=ru,e.CustomTick=An,e.Dashboard=Ff,e.DashedLine=qn,e.DataGrid=ff,e.DataPatternsNew=Dr,e.DataSetXY=no,e.DateTimeTickStrategy=Fh,e.EllipseFigure=Tu,e.EllipseSeries=ku,e.EmptyFill=B,e.EmptyUIElement=Rn,e.Figure=Ql,e.FigureSeries=Mu,e.FontSettings=rr,e.FormattingFunctions=Ii,e.FunnelChart=id,e.FunnelChartTypes=hd,e.FunnelChartWithLabelsInsideSlices=od,e.FunnelChartWithLabelsOnSides=nd,e.FunnelSlice=Jc,e.GaugeChart=ud,e.GaugeChartTypes=Wf,e.GaugeSlice=dd,e.GenericAxis=Js,e.GlowEffect=ro,e.HeatmapGridSeries=_u,e.HeatmapGridSeriesIntensityValues=Vu,e.HeatmapScrollingGridSeries=Bu,e.HeatmapScrollingGridSeriesIntensityValues=zu,e.Highlighter=Hi,e.Icon=eo,e.ImageFill=$n,e.IndividualPointFill=H,e.LUT=_,e.LegendBoxBuilders=sh,e.LineAndPointSeries3D=el,e.LineSeries=vc,e.LineSeries3D=il,e.LinearGradientFill=st,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new st({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Rl,e.MapRegions=Xf,e.MapRegionsAfrica=Vf,e.MapRegionsAsia=Bf,e.MapRegionsAustralia=zf,e.MapRegionsCanada=Nf,e.MapRegionsEurope=Of,e.MapRegionsNorthAmerica=Yf,e.MapRegionsSouthAmerica=Hf,e.MapRegionsUSA=Gf,e.MapRegionsWorld=Uf,e.MapTypes=bl,e.MarkerBuilders=Pf,e.MeshModel3D=xl,e.NumericTickStrategy=Nh,e.OHLCSeries=mc,e.OHLCSeriesBars=pc,e.OHLCSeriesCandlesticks=yc,e.OHLCSeriesTypes=xc,e.OnScreenMenu=Mc,e.OnScreenMenuAnimationsButton=vs,e.OnScreenMenuButton=fs,e.OnScreenMenuControlBase=Qi,e.OnScreenMenuCustomButton=Ms,e.OnScreenMenuOsmToggleButton=Es,e.OnScreenMenuToggleButton=gs,e.OnScreenMenuZoomInButton=ms,e.OnScreenMenuZoomInXButton=ys,e.OnScreenMenuZoomInYButton=ps,e.OnScreenMenuZoomOutButton=xs,e.OnScreenMenuZoomOutXButton=Ss,e.OnScreenMenuZoomOutYButton=As,e.OnScreenMenuZoomToFitButton=bs,e.PalettedFill=class extends W{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=Zh,e.PhongShadingStyle=Yn,e.Picture=Fn,e.PieChart=Ba,e.PieChartTypes=Ga,e.PieChartWithLabelsInsideSlices=Ua,e.PieChartWithLabelsOnSides=Oa,e.PieSlice=Da,e.PixelatedPoints3D=dr,e.PointCloudSeries3D=ol,e.PointLineAreaSeries=Ec,e.PointLineSeries=Qu,e.PointLineSeries3D=sl,e.PointSeries=bc,e.PointSeries3D=nl,e.PointSeriesTypes3D=hl,e.PointStyle3D=gr,e.PolarAreaSeries=Wc,e.PolarAreaSeriesInterior=jc,e.PolarAxis=Dl,e.PolarAxisAmplitude=Pl,e.PolarAxisTick=Ll,e.PolarChart=Zc,e.PolarHeatmapSeries=Zl,e.PolarLineSeries=Jl,e.PolarPointLineSeries=ql,e.PolarPointSeries=Yc,e.PolarPolygon=Hc,e.PolarPolygonSeries=Xc,e.PolarSector=Ul,e.PolarSeries=Yl,e.PolygonFigure=Cu,e.PolygonSeries=Ru,e.PyramidChart=vd,e.PyramidChartTypes=Td,e.PyramidChartWithLabelsInsideSlices=wd,e.PyramidChartWithLabelsOnSides=Ed,e.PyramidSlice=pd,e.RadialGauge=cd,e.RadialGradientFill=tt,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new tt({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Nu,e.RectangleFigure=Iu,e.RectangleSeries=Fu,e.SegmentFigure=Du,e.SegmentSeries=Lu,e.Series2D=Gl,e.Series3D=Qa,e.SeriesMarkerXY=mu,e.SeriesXY=yu,e.SimpleShadingStyle=Un,e.Slice=Ia,e.SliceLabelFormatters=Ca,e.SliceSorters=ka,e.SolidFill=G,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new G({color:s(t)})},e.SolidGauge=yd,e.SolidGaugeSlice=fd,e.SolidLine=Ji,e.SpiderAxis=Fd,e.SpiderChart=Ud,e.SpiderSeries=Ld,e.SplineSeries=ic,e.StaticCursor2DBuilder=ya,e.StaticCursorXYBuilder=ou,e.StepSeries=gc,e.StipplePatterns=Kn,e.SurfaceGridSeries3D=fl,e.SurfaceScrollingGridSeries3D=gl,e.TableContentBuilder=aa,e.Themes=gg,e.Tick=lh,e.TickStyle=mh,e.TimeFormattingFunctions=Gh,e.TimeTickStrategy=Hh,e.TreeMapChart=Qf,e.TriangulatedPoints3D=lr,e.UIBackgrounds=Lf,e.UICircle=yo,e.UIColumnGrid=class extends Mo{constructor(){super(...arguments),this.vd=[]}addColumn(){return this.addElement(Co,void 0)}getColumn(t,e=!1){return e&&this.vd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.vd[t]}},e.UIDiamond=po,e.UIElementBuilders=ih,e.UIElementColumn=Eo,e.UIElementLine=bo,e.UIElementRow=Mo,e.UIElementWithBackground=xn,e.UIEmptyBackground=In,e.UILabel=fo,e.UILayoutBuilders=Al,e.UILayoutGap=vo,e.UILegendBoxPanel=vl,e.UIObject=fn,e.UIOrigins=Ts,e.UIPanel=Jh,e.UIPoint=So,e.UIPointer=xo,e.UIPolygon=Ln,e.UIRectangle=mo,e.UIRowGrid=To,e.VisibleFill=U,e.ZoomBandChart=Uc,e.defaultOsmBackgroundColor=Ps,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=z,e.emptyLine=ot,e.emptyPoints3D=hr,e.emptyTick=ph,e.formatLongitudeLatitude=Fl,e.formatNumberAsUnicodeSuperscript=Fi,e.isColor=M,e.isCoordinate3D=yl,e.isCoordinateBarChart=bf,e.isCoordinateClient=Ni,e.isCoordinatePolar=Ol,e.isCoordinateXY=Ui,e.isDashedLine=Qn,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=N,e.isEmptyTick=xh,e.isFontSettings=nr,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=io,e.isIndividualPointFill=X,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=rt,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=j,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=fr,e.isRadialGradientFill=et,e.isSeriesSupportedByZoomBandChart=t=>t instanceof vu||t instanceof Uu||t instanceof $u||t instanceof Vu||t instanceof mc||t instanceof gc||t instanceof Ec,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=Y,e.isSolidLine=qi,e.isTickStyle=yh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=ur,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,n="object"==typeof t?t:void 0,o=new ox;o.e=i;let h=Ax.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(ix){const s=(()=>{if(!ix)return;const t=ix.split("-");if(t.length>0)switch(t[0]){case"0001":return"0001";case"0002":return"0002";case"T001":return"T001";default:return}})();if("0001"===s){nx=new Uint8Array([2]);const e=(()=>{if(!ix)return;const t=ix.split("-");return 4===t.length?t[1].startsWith("m")?2:1:0})();if(1===e){const t=mx(ix);h=!t.sj,i=t,n=!0}else 2===e?(i=yx(ix,t),o=!0):(hx=!0,i=dx(ix),a=!0)}else if("0002"===s){const e=(()=>{if(!ix)return;const t=ix.split("-");return t.length>=2?Uint8Array.from(atob(t[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)hx=!0,i=dx(ix),a=!0;else if(189===e){const t=mx(ix);h=!t.sj,i=t,n=!0}else 159===e?(i=yx(ix,t),o=!0):i={KX:ex(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=ix.split("-");if(3!==i.length)return{KX:ex(0,0,1,7,1,12,5)};const s=`${i[1]}`,r=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!gx(s,r))return{KX:ex(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(n))),h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;ty)return{KX:ex(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),x=l.subarray(n+=2,n+p);if(nx=new Uint8Array(x),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{ej:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&gx(t[0],t[2])?{ej:t[0]}:{KX:ex(0,0,1,7,1,12,5)}}return{KX:ex(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.ej;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={KX:ex(0,0,1,7,1,12,5)}}else i={KX:ex(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={KX:ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),tj:ex(-2,2)}:window.location.host===tx.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,nx=new Uint8Array([38]),i={}):(c=!0,u=!0,nx=new Uint8Array([38]),i={})}}catch(t){i={KX:ex(0,0,1,7,1,12,5)}}try{a&&(s=tx[ex(-1,34)][ex(-1,35)](ex(-1,39))||void 0)}catch(t){tx.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&gx(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.KX||n||o||d),g=(()=>{const t=new(tx[ex(-1,0)]);return t.open(ex(0,26),ex(-2,0)),t.setRequestHeader(ex(-1,24),ex(-1,25)),t.withCredentials=!0,t})(),m=new r.Eventer;if(f){let t;try{t=parseInt(ix?ix.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="",r="",n="";ix=ix||"";const o=ex(-4,0);for(let t=0;t{const n=[],o={Gn:t=>{n.indexOf(t)>=0||(n.push(t),a())},Wn:t=>m.on("logoChange",t),Un:t=>m.off(t)},a=()=>{n.forEach((t=>{const e=d(t);if(!e)return;const{hj:i,rj:s}=e,r=s?ex(-2,1):void 0,n=`${ex(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?ex(0,1,63,1,64,1,59,1,65,1,41):""}`;px(n,y,!1,r)}))},c=t=>t.toLowerCase().split("_").join(" "),d=t=>{var e;const i=null===(e=Object.entries(ah).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case ah.sf:return sx.tf||sx.sf?void 0:{hj:c(i),rj:!0};case ah.nf:return sx.tf||sx.nf?void 0:{hj:c(i),rj:!0};case ah.af:return sx.tf||sx.if||sx.af?void 0:{hj:c(i)};case ah.if:return sx.tf||sx.if?void 0:{hj:c(i)};case ah.ff:return sx.tf||sx.if||sx.ff?void 0:{hj:c(i)};case ah.pf:return sx.tf||sx.if||sx.pf?void 0:{hj:c(i)};case ah.vf:return sx.tf||sx.if||sx.vf?void 0:{hj:c(i)};case ah.bf:return sx.tf||sx.if||sx.bf?void 0:{hj:c(i)};case ah.Mf:return sx.tf||sx.if||sx.Mf?void 0:{hj:c(i)};case ah.xf:return sx.tf||sx.if||sx.xf?void 0:{hj:c(i)};case ah.uf:return sx.tf||sx.if||sx.uf?void 0:{hj:c(i)};case ah.gf:return sx.tf||sx.if||sx.gf?void 0:{hj:c(i)};case ah.df:return sx.tf||sx.if||sx.df?void 0:{hj:c(i)};case ah.mf:return sx.tf||sx.if||sx.mf?void 0:{hj:c(i)};case ah.Sf:return sx.tf||sx.if||sx.Sf?void 0:{hj:c(i)};case ah.yf:return sx.tf||sx.if||sx.yf?void 0:{hj:c(i)};case ah.lf:return sx.tf||sx.if||sx.lf?void 0:{hj:c(i)};case ah.cf:return sx.tf||sx.if||sx.cf?void 0:{hj:c(i)};case ah.Af:return sx.tf||sx.if||sx.Af?void 0:{hj:c(i)};case ah._f:return sx.tf||sx.if||sx._f?void 0:{hj:c(i)};case ah.tf:case ah.ef:case ah.rf:case ah.hf:return}return be(0,"")}},y=new Ap(r,t,o);(null==i?void 0:i.KX)&&px(i.KX,y,void 0,i.tj);const p=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&gx(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return hx=!1,void xx(g,!1,x)}}if(g.readyState===tx[ex(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[ex(-1,23)]);if(!gx(l+ex(-3,0),t.h)){const t=ex(0,0,1,27,1,28,1,29,1,30,1,31,5);px(t,y)}tx[ex(-1,34)][ex(-1,36)](ex(-1,39),t.t),tx[ex(-1,34)][ex(-1,36)](ex(-1,33),t.s),hx=!1}else{let e="";try{e=t&&"loadend"!==t.type?ex(0,0,1,23,1,32,1,24,5):JSON.parse(g[ex(-1,23)]).message,xx(g,!1,x)}catch(t){console.error(t)}px(ex(0,0,1,2,1,7,1,12,5)+e,y)}},x=t=>{p(t)};if(xx(g,!0,x),f?setTimeout((()=>{if(hx){let t=!0;if(s){const e=s.split("-");if(2===e.length&&gx(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&px(ex(0,25,1,23,1,32,1,24,5),y)}}),1e4):xx(g,!1,x),u){const t=(()=>{const t=new(tx[ex(-1,0)]);return t.open(ex(0,26),ex(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=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}if(t.readyState===tx.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!gx(i,s.s)){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}void 0!==e&&(e.l=s.l),m.emit("logoChange",s.l)}}else{const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}},r=t=>{s(t)};xx(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}}),1e4)}return h?(t=>{let e;hx=!1;const i=t.ai(),s=()=>{e&&(t.Mn(e.bn()),e=void 0),e=t.II("deployment test"),e.Dr(t.ft).Eh(ex(0,34,1,33)).Ie({x:i.x/2,y:i.y/2}).ba(50).Gh(13).ke(new G({color:E(128,128,128,100)})).va("Arial")._a(500).setMouseInteractions(!1),t.Sn().vn()};t.ko((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.bn(){var r,n,o,h,a,l,u,c,d,f;let g;if(i&&i.license){const t=i.license.split("-");g=t[t.length-1]}const m=(null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version)||(null===(o=null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.webgl)||void 0===o?void 0:o.version),y={UE:null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.canvas,$n:null==i?void 0:i.warnings,tz:"webgl1"===m?1:"webgl2"===m?2:void 0,QE:!1!==(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.antialias),ZE:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.devicePixelRatio)||void 0,lz:(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.noCanvasStyles)||void 0,fz:(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.noCanvasTransform)||void 0,KE:!1!==(null===(d=null==i?void 0:i.sharedContextOptions)||void 0===d?void 0:d.useStackingOrder),qE:!1!==(null===(f=null==i?void 0:i.sharedContextOptions)||void 0===f?void 0:f.useIndividualCanvas),uz:g||void 0},p=new mm(y),x=e=>t(e,p);return{Dashboard:ym(x,e,i,s),ChartXY:Sm(x,e,i,s),Spider:Am(x,e,i,s),Polar:vm(x,e,i,s),Pie:bm(x,e,i,s),UIPanel:xm(x,e,i,s),Gauge:Mm(x,e,i,s),Funnel:Em(x,e,i,s),Pyramid:wm(x,e,i,s),Chart3D:km(x,e,i,s),Map:Tm(x,e,i,s),DataGrid:Cm(x,e,i,s),BarChart:Rm(x,e,i,s),ZoomBandChart:Im(x,e,i,s),TreeMapChart:Fm(x,e,i,s),dispose:p.U.bind(p),layout:p.yz.bind(p)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Rs,e.onScreenMenuControlBaseWidth=Is,e.onScreenMenuControlOpacity=Fs,e.onScreenMenuDefaultButtonShape=Ls,e.onScreenMenuSpriteURL=Ds,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const r=null==s?void 0:s.formatLabels,n=null==s?void 0:s.alpha;return i.map(((s,o)=>{const h=t+o/(i.length-1)*(e-t);return{color:void 0!==n?s.setA(n):s,value:h,label:r?r(h):void 0}}))},e.saveToFile=Xh,e.synchronizeAxisIntervals=gt,e.translatePoint=dt,e.translatePoint3D=ft,e.transparentFill=ks,e.transparentLine=Cs,e.uint32ColorFromObject=t=>F(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=F,e.vec3Utils=De,e.xDimensionStrategy=ch,e.yDimensionStrategy=dh}}]); \ No newline at end of file diff --git a/js/vendor.b144a6f31f113ba3921f.bundle.js.LICENSE.txt b/js/vendor.84333698cb4abf09f0ae.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.b144a6f31f113ba3921f.bundle.js.LICENSE.txt rename to js/vendor.84333698cb4abf09f0ae.bundle.js.LICENSE.txt diff --git a/js/vendor.b144a6f31f113ba3921f.bundle.js b/js/vendor.b144a6f31f113ba3921f.bundle.js deleted file mode 100644 index 358959e..0000000 --- a/js/vendor.b144a6f31f113ba3921f.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.b144a6f31f113ba3921f.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[502],{613:(t,e,i)=>{i.r(e),i.d(e,{EventError:()=>o,Eventer:()=>u,Token:()=>h});var s=function(t,e){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},s(t,e)};function r(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var s,r,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(s=n.next()).done;)o.push(s.value)}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return o}var o=function(t){function e(i){var s,r="EventError: "+i+"}";return s=t.call(this,r)||this,Object.setPrototypeOf(s,e.prototype),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e}(Error),h=function(t,e){return{token:t+"-"+e,ownerIndex:t,id:e}},a=0,l=function(t,e){return new o("Event listener with "+t.token+" id does not exist at Eventer with "+e+" id.")},u=function(){function t(){this.id=++a,this.lastEventIndex=0,this.topics=new Map}return t.prototype.on=function(t,e,i){var s=this.topics.get(t),r=i||h(this.id,++this.lastEventIndex);return s?s.set(r,e):this.topics.set(t,new Map([[r,e]])),r},t.prototype.has=function(t,e){var i,s;if(e)return(u=this.topics.get(e))?(c=u.get(t))||l(t,this.id):new o("Eventer with "+t.ownerIndex+" does not have "+e+".");try{for(var h=r(this.topics),a=h.next();!a.done;a=h.next()){var u,c,d=n(a.value,2);if(d[0],c=(u=d[1]).get(t))return c}}catch(t){i={error:t}}finally{try{a&&!a.done&&(s=h.return)&&s.call(h)}finally{if(i)throw i.error}}return l(t,this.id)},t.prototype.off=function(t,e){var i,s;if(e)return!(!(a=this.topics.get(e))||!a.delete(t));try{for(var o=r(this.topics),h=o.next();!h.done;h=o.next()){var a,l=n(h.value,2);if(l[0],(a=l[1]).delete(t))return!0}}catch(t){i={error:t}}finally{try{h&&!h.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return!1},t.prototype.allOff=function(){return this.topics.clear(),this},t.prototype.topicOff=function(t){return this.topics.delete(t)},t.prototype.emit=function(t){for(var e=[],i=1;i{i.r(e),i.d(e,{DataGenerator:()=>l,DataHost:()=>a,Stream:()=>h,createDeltaFunctionGenerator:()=>A,createOHLCGenerator:()=>x,createParametricFunctionGenerator:()=>T,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>E,createSpectrumDataGenerator:()=>R,createTraceGenerator:()=>y,createWaterDropDataGenerator:()=>D,createWhiteNoiseGenerator:()=>b});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)e.hasOwnProperty(i)&&(t[i]=e[i])},s(t,e)};function r(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n=function(){return n=Object.assign||function(t){for(var e,i=1,s=arguments.length;i0||-1===this.batchesLeft)&&i.length>0&&(this.data=this.data.concat(i.map((function(e){return t.infiniteReset(e)}))),i.length0||-1===this.batchesLeft||-2===this.batchesLeft&&this.data.length>0;return this.continueHandler&&(t=!0===this.continueHandler()),t},t.prototype.runStream=function(){var t=this.checkStreamContinue();if(this.data&&this.data.length>0&&t){if(this.streamHandler){var e=this.consume();this.streamHandler(e)}setTimeout(this.runStream,this.interval)}else this.streamActive=!1;this.batchesLeft>0&&this.batchesLeft--},t.prototype.activateStream=function(){this.streamActive||(this.streamActive=!0,this.runStream())},t.prototype.push=function(t){Array.isArray(t)?this.data=this.data.concat(t):this.data.push(t),this.activateStream()},t.prototype.map=function(e){return this.outputStream=new t(n(n({},this.options),{repeat:!1}),this.infiniteReset),this.mapHandler=e,this.streamHandler=this._map,this.activateStream(),this.outputStream},t.prototype._map=function(t){if(this.mapHandler&&this.outputStream){var e=t.map(this.mapHandler);this.outputStream.push(e)}},t.prototype.forEach=function(t){this.forEachHandler=t,this.streamHandler=this._forEach,this.activateStream()},t.prototype._forEach=function(t){this.forEachHandler&&t.forEach(this.forEachHandler)},t}(),a=function(){function t(t,e){this.data=[],this.derivativeDataHosts=[],this.promisesToResolve=[],this.streamsToPush=[],this.infiniteReset=this.infiniteReset.bind(this),this.infiniteResetHandler=t;var i={interval:e.interval,batchSize:e.batchSize,repeat:void 0!==e.repeat&&e.repeat};this.streamOptions=Object.freeze(i)}return t.prototype.toStream=function(){var t=new h(this.streamOptions,this.infiniteReset);return this.frozenData?t.push(this.frozenData):this.streamsToPush.push(t),t},t.prototype.toPromise=function(){var t=this;return this.frozenData?Promise.resolve(this.frozenData):new Promise((function(e){t.promisesToResolve.push(e)}))},t.prototype.infiniteReset=function(t){return this.infiniteResetHandler(t,this.frozenData?this.frozenData:[])},t.prototype.push=function(t){var e,i;if(!this.frozenData)if(Array.isArray(t))try{for(var s=function(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.")}(t),r=s.next();!r.done;r=s.next()){var n=r.value;this.data.push(n)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}else this.data.push(t)},t.prototype.setData=function(t){this.data=t},t.prototype.freeze=function(){var t=this;this.frozenData||(this.frozenData=this.data,setTimeout((function(){t.promisesToResolve.forEach((function(e){return e(t.frozenData)})),t.promisesToResolve=[]}),0),setTimeout((function(){t.streamsToPush.forEach((function(e){return e.push(t.frozenData||[])})),t.streamsToPush=[]}),0),setTimeout((function(){t.handleDerivativeDataHosts()}),0),this.data=[])},t.prototype.getPointCount=function(){return this.frozenData?this.frozenData.length:0},t.prototype.handleDerivativeDataHosts=function(){var t=this;this.frozenData&&this.derivativeDataHosts.length>0&&(this.derivativeDataHosts.forEach((function(e){t.frozenData&&e.setData(t.frozenData),e.freeze()})),this.derivativeDataHosts=[])},t.prototype.setStreamInterval=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{interval:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamBatchSize=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{batchSize:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t.prototype.setStreamRepeat=function(e){var i=new t(this.infiniteResetHandler,n(n({},this.streamOptions),{repeat:e}));return this.derivativeDataHosts.push(i),this.handleDerivativeDataHosts(),i},t}();if("undefined"!=typeof window&&window.performance&&window.performance.now)o=window.performance.now.bind(window.performance);else try{o=Object(function(){var t=new Error("Cannot find module 'perf_hooks'");throw t.code="MODULE_NOT_FOUND",t}()).now}catch(t){throw new Error('Failed to detect "performance.now" API')}var l=function(){function t(t){this.options=t}return t.prototype.generate=function(){var t=new a(this.infiniteReset,{interval:500,batchSize:10,repeat:!1}),e=this.getPointCount(),i=this.generateChunks.bind(this,0,e,t);return setTimeout(i,0),t},t.prototype.generateChunks=function(t,e,i){for(var s=o(),r=[],n=0;o()-s<15&&t.5?this.offset+e:this.offset-e}return this.offset+this.options.dataMax>1?this.offset=1-this.options.dataMax:this.offset<0&&(this.offset=0),{x:t,y:this.offset+Math.random()*this.options.dataMax}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function d(){return new f({numberOfPoints:1e3})}var f=function(t){function e(e){var i=t.call(this,e)||this;i.previousPoint={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e={x:t,y:this.previousPoint.y+2*(Math.random()-.5)};return this.previousPoint=e,e},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function g(){return new m({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var m=function(t){function e(e){var i=t.call(this,e)||this;i.x=i.options.start;var s={samplingFunction:e.samplingFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setSamplingFunction=function(t){return new e(n(n({},this.options),{samplingFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.x,y:this.options.samplingFunction(this.x)};return this.x=this.x+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length*(e[e.length-1].x-e[e.length-2].x),y:t.y}},e}(l);function y(){return new p({numberOfPoints:1e3})}var p=function(t){function e(e){var i=t.call(this,e)||this;i.previous={x:0,y:0};var s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.previous.x+2*(Math.random()-.5),y:this.previous.y+2*(Math.random()-.5)};return this.previous=t,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function x(){return new S({numberOfPoints:1e3,startTimestamp:0,dataFreq:1,start:100,volatility:.1})}var S=function(t){function e(e){var i=t.call(this,e)||this;return i.prevPoint=[i.options.startTimestamp,i.options.start,i.options.start,i.options.start,i.options.start],i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setStartTimestamp=function(t){return new e(n(n({},this.options),{startTimestamp:t}))},e.prototype.setDataFrequency=function(t){return new e(n(n({},this.options),{dataFreq:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setVolatility=function(t){return new e(n(n({},this.options),{volatility:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e,i=this,s=this.options.startTimestamp+this.options.dataFreq*t,r=Math.random()>.5?1:-1,n=Array.from(Array(4)).map((function(t){var e=Math.random()*i.options.volatility*r;return i.prevPoint[4]+e<0&&(e*=-1),i.prevPoint[4]+e})).sort((function(t,e){return t-e}));return-1===r&&(n=[n[0],n[2],n[1],n[3]]),e=[s,n[1],n[3],n[0],n[2]],this.prevPoint=e,e},e.prototype.infiniteReset=function(t,e){return[t[0]+e.length*(e[e.length-1][0]-e[e.length-2][0]),t[1],t[2],t[3],t[4]]},e}(l);function A(){return new v({numberOfPoints:1e3,minGap:1,maxGap:-1,minAmplitude:.1,maxAmplitude:1,probability:.02})}var v=function(t){function e(e){var i=t.call(this,e)||this;i.lastSpike=0;var s={numberOfPoints:e.numberOfPoints,minGap:e.minGap,maxGap:e.maxGap,minAmplitude:e.minAmplitude,maxAmplitude:e.maxAmplitude,probability:e.probability};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(n(n({},this.options),{numberOfPoints:t}))},e.prototype.setMinGap=function(t){return new e(n(n({},this.options),{minGap:t}))},e.prototype.setMaxGap=function(t){return new e(n(n({},this.options),{maxGap:t}))},e.prototype.setMinAmplitude=function(t){return new e(n(n({},this.options),{minAmplitude:t}))},e.prototype.setMaxAmplitude=function(t){return new e(n(n({},this.options),{maxAmplitude:t}))},e.prototype.setProbability=function(t){return new e(n(n({},this.options),{probability:t}))},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){var e=t-this.lastSpike,i={x:t,y:0};return(e>this.options.minGap||-1===this.options.minGap)&&(e1-this.options.probability&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t):e>=this.options.maxGap&&(i.y=Math.random()*(this.options.maxAmplitude-this.options.minAmplitude)+this.options.minAmplitude,this.lastSpike=t)),i},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length,y:t.y}},e}(l);function b(){return new M({numberOfPoints:1e3})}var M=function(t){function e(e){var i=t.call(this,e)||this,s={numberOfPoints:e.numberOfPoints};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfPoints=function(t){return new e(this.options?n(n({},this.options),{numberOfPoints:t}):{numberOfPoints:t})},e.prototype.getPointCount=function(){return this.options.numberOfPoints},e.prototype.generateDataPoint=function(t){return{x:t,y:2*(Math.random()-.5)}},e.prototype.infiniteReset=function(t,e){return{x:t.x+e[e.length-1].x,y:t.y+e[e.length-1].y}},e}(l);function E(){return new w({inputData:[],samplingFrequency:50,step:0})}var w=function(t){function e(e){var i=t.call(this,e)||this;i.interval=1/(i.options.samplingFrequency||10);var s={inputData:e.inputData,samplingFrequency:e.samplingFrequency,step:e.step};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setInputData=function(t){return new e(n(n({},this.options),{inputData:t}))},e.prototype.setSamplingFrequency=function(t){return new e(n(n({},this.options),{samplingFrequency:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.options.inputData.length},e.prototype.generateDataPoint=function(t){return{timestamp:t*this.interval+t*this.options.step,data:this.options.inputData[t]}},e.prototype.infiniteReset=function(t,e){return{timestamp:t.timestamp+e[e.length-1].timestamp,data:t.data}},e}(l);function T(){return new k({xFunction:function(t){return 3*Math.cos(3*t)},yFunction:function(t){return 3*Math.sin(4*t)},start:0,end:1e3,step:.5})}var k=function(t){function e(e){var i=t.call(this,e)||this;i.t=i.options.start;var s={xFunction:e.xFunction,yFunction:e.yFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setXFunction=function(t){return new e(n(n({},this.options),{xFunction:t}))},e.prototype.setYFunction=function(t){return new e(n(n({},this.options),{yFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.options.xFunction(this.t),y:this.options.yFunction(this.t)};return this.t=this.t+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x,y:t.y}},e}(l),C={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function R(){return new I(C)}var I=function(t){function e(e){var i=t.call(this,e)||this,s={sampleSize:void 0!==e.sampleSize?e.sampleSize:C.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:C.numberOfSamples,variation:void 0!==e.variation?e.variation:C.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:C.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:C.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:C.narrowFactor2};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfSamples=function(t){return new e(n(n({},this.options),{numberOfSamples:t}))},e.prototype.setSampleSize=function(t){return new e(n(n({},this.options),{sampleSize:t}))},e.prototype.setVariation=function(t){return new e(n(n({},this.options),{variation:t}))},e.prototype.setFrequencyStability=function(t){return new e(n(n({},this.options),{frequencyStability:t}))},e.prototype.setNarrowFactor1=function(t){return new e(n(n({},this.options),{narrowFactor1:t}))},e.prototype.setNarrowFactor2=function(t){return new e(n(n({},this.options),{narrowFactor2:t}))},e.prototype.getPointCount=function(){return this.options.numberOfSamples},e.prototype.generateDataPoint=function(t){for(var e=100,i=this.options.variation,s=this.options.sampleSize,r=this.options.frequencyStability,n=s/8,o=s/2,h=new Array(s),a=0;as&&(n=s),(o+=(Math.random()-.5)*i/r/100*s)<0&&(o=0),o>s&&(o=s);var g,m=e/3*2,y=m/(f*f)*this.options.narrowFactor1,p=50/(f*f)*this.options.narrowFactor2;for(a=0;ae&&(l=e),(u=50-(d=.8*a-o)*d*p)<0&&(u=0),u>e&&(u=e),g=l+u,g+=g*(Math.random()-.5)*i/10,h[a]=(h[a]+g)/2,h[a]<0&&(h[a]=0),h[a]>e&&(h[a]=e),h[a]=.02*h[a];return h},e.prototype.infiniteReset=function(t,e){return t.slice()},e}(l),F={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function D(){return new L(F)}var L=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:F.rows,columns:void 0!==t.columns?t.columns:F.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:F.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:F.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:F.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:F.offsetLevel,volatility:void 0!==t.volatility?t.volatility:F.volatility};this.options=Object.freeze(e)}return t.prototype.setRows=function(e){return new t(n(n({},this.options),{rows:e}))},t.prototype.setColumns=function(e){return new t(n(n({},this.options),{columns:e}))},t.prototype.setWaterDrops=function(e){var i=e.map((function(t){return t.rowNormalized})),s=e.map((function(t){return t.columnNormalized})),r=e.map((function(t){return t.amplitude}));return new t(n(n({},this.options),{rowPositionsNormalized:i,columnPositionsNormalized:s,amplitudes:r}))},t.prototype.setOffsetLevel=function(e){return new t(n(n({},this.options),{offsetLevel:e}))},t.prototype.setVolatility=function(e){return new t(n(n({},this.options),{volatility:e}))},t.prototype.generate=function(){var t=this;return new Promise((function(e){return i=t,s=void 0,n=function(){var t,i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p,x,S;return function(t,e){var i,s,r,n,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:h(0),throw:h(1),return:h(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function h(n){return function(h){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,s&&(r=2&n[0]?s.return:n[0]?s.throw||((r=s.return)&&r.call(s),0):s.next)&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return o.label++,{value:n[1],done:!1};case 5:o.label++,s=n[1],n=[0];continue;case 7:n=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){o=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]0&&m%1e3==0&&Date.now()-g>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:A.sent(),g=Date.now(),A.label=4;case 4:return x++,S+=d,[3,2];case 5:return y++,p+=f,[3,1];case 6:return e(c),[2]}}))},new((r=void 0)||(r=Promise))((function(t,e){function o(t){try{a(n.next(t))}catch(t){e(t)}}function h(t){try{a(n.throw(t))}catch(t){e(t)}}function a(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(o,h)}a((n=n.apply(i,s||[])).next())}));var i,s,r,n}))},t}()},570:t=>{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,m=e&&e.length,y=m?e[0]*s:t.length,p=i(t,0,y,s,!0),x=[];if(!p||p.next===p.prev)return x;if(m&&(p=function(t,e,s,r){var n,o,h,a=[];for(n=0,o=e.length;n80*s){n=h=t[0],o=a=t[1];for(var S=s;Sh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(p,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===T(t,e,i,s)>0)for(n=e;n=e;n-=s)o=M(n,t[n],t[n+1],o);return o&&p(o,o.next)&&(E(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!p(s,s.next)&&0!==y(s.prev,s,s.next))s=s.next;else{if(E(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,m,y=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),E(t),t=m.next,y=m.next;else if((t=m)===y){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(y(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(y(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,m=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,A=d(m,p,e,i,s),v=d(x,S,e,i,s),b=t.prevZ,M=t.nextZ;b&&b.z>=A&&M&&M.z<=v;){if(b.x>=m&&b.x<=x&&b.y>=p&&b.y<=S&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,M.x>=m&&M.x<=x&&M.y>=p&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;b&&b.z>=A;){if(b.x>=m&&b.x<=x&&b.y>=p&&b.y<=S&&b!==r&&b!==o&&g(h,u,a,c,l,f,b.x,b.y)&&y(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;M&&M.z<=v;){if(M.x>=m&&M.x<=x&&M.y>=p&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&y(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!p(n,o)&&x(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),E(r),E(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&m(a,l)){var u=b(a,l);return a=s(a,a.next),u=s(u,u.next),r(a,e,i,n,o,h,0),void r(u,e,i,n,o,h,0)}l=l.next}a=a.next}while(a!==t)}function l(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,s=e,r=t.x,n=t.y,o=-1/0;do{if(n<=s.y&&n>=s.next.y&&s.next.y!==s.y){var h=s.x+(n-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(h<=r&&h>o&&(o=h,i=s.x=s.x&&s.x>=u&&r!==s.x&&g(ni.x||s.x===i.x&&c(i,s)))&&(i=s,f=a)),s=s.next}while(s!==l);return i}(t,e);if(!i)return e;var r=b(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function 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&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(v(t,e)&&v(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||p(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function p(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=A(y(t,e,i)),n=A(y(t,e,s)),o=A(y(i,s,t)),h=A(y(i,s,e));return r!==n&&o!==h||!(0!==r||!S(t,i,e))||!(0!==n||!S(t,s,e))||!(0!==o||!S(i,t,s))||!(0!==h||!S(i,e,s))}function S(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 A(t){return t>0?1:t<0?-1:0}function v(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function b(t,e){var i=new w(t.i,t.x,t.y),s=new w(e.i,e.x,e.y),r=t.next,n=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,s.next=i,i.prev=s,n.next=s,s.prev=n,s}function M(t,e,i,s){var r=new w(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function E(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 T(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},568:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>w,Iterable:()=>ks,List:()=>ai,Map:()=>ze,OrderedMap:()=>bi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Wi,Record:()=>ms,Repeat:()=>bs,Seq:()=>J,Set:()=>Ni,Stack:()=>Ci,default:()=>Cs,fromJS:()=>Ms,get:()=>ae,getIn:()=>ji,has:()=>he,hasIn:()=>Zi,hash:()=>pt,is:()=>ft,isAssociative:()=>E,isCollection:()=>S,isImmutable:()=>L,isIndexed:()=>M,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>_,isOrderedMap:()=>ct,isOrderedSet:()=>_i,isPlainObject:()=>re,isRecord:()=>D,isSeq:()=>I,isSet:()=>Pi,isStack:()=>ki,isValueObject:()=>dt,merge:()=>Ee,mergeDeep:()=>Te,mergeDeepWith:()=>ke,mergeWith:()=>we,remove:()=>ue,removeIn:()=>ye,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ts});var s="delete",r=5,n=1<>>0;if(""+i!==e||4294967295===i)return NaN;e=i}return e<0?u(t)+e:e}function d(){return!0}function f(t,e,i){return(0===t&&!p(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return y(t,e,0)}function m(t,e){return y(t,e,e)}function y(t,e,i){return void 0===t?i:p(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function p(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[x])}var A="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[A])}var b="@@__IMMUTABLE_INDEXED__@@";function M(t){return Boolean(t&&t[b])}function E(t){return v(t)||M(t)}var w=function(t){return S(t)?t:J(t)},T=function(t){function e(t){return v(t)?t:q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(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 S(t)&&!E(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=T,w.Indexed=k,w.Set=C;var R="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[R])}var F="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[F])}function L(t){return S(t)||D(t)}var P="@@__IMMUTABLE_ORDERED__@@";function _(t){return Boolean(t&&t[P])}var V=0,B=1,z=2,N="function"==typeof Symbol&&Symbol.iterator,O="@@iterator",U=N||O,G=function(t){this.next=t};function Y(t,e,i,s){var r=0===t?e:1===t?i:[e,i];return s?s.value=r:s={value:r,done:!1},s}function H(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!$(t)}function W(t){return t&&"function"==typeof t.next}function j(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(N&&t[N]||t[O]);if("function"==typeof e)return e}G.prototype.toString=function(){return"[Iterator]"},G.KEYS=V,G.VALUES=B,G.ENTRIES=z,G.prototype.inspect=G.prototype.toSource=function(){return this.toString()},G.prototype[U]=function(){return this};var Z=Object.prototype.hasOwnProperty;function K(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 J=function(t){function e(t){return null==t?nt():L(t)?t.toSeq():function(t){var e,i,s=at(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,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new G((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return Y(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),q=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?v(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(J),Q=function(t){function e(t){return null==t?nt():S(t)?v(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ht(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(J),tt=function(t){function e(t){return(S(t)&&!E(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}(J);J.isSeq=I,J.Keyed=q,J.Set=tt,J.Indexed=Q,J.prototype[R]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new G((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return Y(t,n,i[n])}))},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 Z.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var i=this._object,s=this._keys,r=s.length,n=0;n!==r;){var o=s[e?r-++n:n++];if(!1===t(i[o],o,this))break}return n},e.prototype.__iterator=function(t,e){var i=this._object,s=this._keys,r=s.length,n=0;return new G((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return Y(t,o,i[o])}))},e}(q);it.prototype[P]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=j(this._collection),s=0;if(W(i))for(var r;!(r=i.next()).done&&!1!==t(r.value,s++,this););return s},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var i=j(this._collection);if(!W(i))return new G(H);var s=0;return new G((function(){var e=i.next();return e.done?e:Y(t,s++,e.value)}))},e}(Q);function nt(){return st||(st=new et([]))}function ot(t){var e=at(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ht(t){var e=at(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function at(t){return K(t)?new et(t):X(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&_(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 yt=Object.prototype.valueOf;function pt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==yt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return mt(e)}(r);case"string":return r.length>Ct?(void 0===(s=Ft[i=r])&&(s=St(i),It===Rt&&(It=0,Ft={}),It++,Ft[i]=s),s):St(r);case"object":case"function":return function(t){var e;if(Et&&void 0!==(e=Mt.get(t)))return e;if(void 0!==(e=t[kt]))return e;if(!vt){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=bt(),Et)Mt.set(t,e);else{if(void 0!==At&&!1===At(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)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}(r);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=bt(),wt[t]=e),e}(r);default:if("function"==typeof r.toString)return St(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function xt(t){return null===t?1108378658:1108378659}function St(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&eh)return{value:void 0,done:!0};var t=r.next();return s||e===B||t.done?t:Y(e,a-1,e===V?void 0:t.value[1],t)}))},l}function Ut(t,e,i,s){var r=Kt(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(z,n),a=!0,l=0;return new G((function(){var t,n,u;do{if((t=h.next()).done)return s||r===B?t:Y(r,l++,r===V?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===z?t:Y(r,n,u,t)}))},r}function Gt(t,e,i){var s=Kt(t);return s.__iterateUncached=function(r,n){if(n)return this.cacheResult().__iterate(r,n);var o=0,h=!1;return function t(a,l){a.__iterate((function(n,a){return(!e||l0}function Wt(t,e,i,s){var r=Kt(t),n=new et(i).map((function(t){return t.size}));return r.size=s?n.max():n.min(),r.__iterate=function(t,e){for(var i,s=this.__iterator(B,e),r=0;!(i=s.next()).done&&!1!==t(i.value,r++,this););return r},r.__iteratorUncached=function(t,r){var n=i.map((function(t){return t=w(t),j(r?t.reverse():t)})),o=0,h=!1;return new G((function(){var i;return h||(i=n.map((function(t){return t.next()})),h=s?i.every((function(t){return t.done})):i.some((function(t){return t.done}))),h?{value:void 0,done:!0}:Y(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}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 Zt(t){return v(t)?T:M(t)?k:C}function Kt(t){return Object.create((v(t)?q:M(t)?Q:tt).prototype)}function Jt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):J.prototype.cacheResult.call(this)}function qt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[i]=arguments[i+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Me(this,e,t)}function Me(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Re(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Re(e,i,t)}function Te(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 Re(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=J(i),h=J(n),M(o)===M(h)&&v(o)===v(h))?Re(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Re(t,e,i){if(!ne(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),r=t,n=s?k:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=Z.call(r,s),o=n&&i?i(r[s],e,s):e;n&&o===r[s]||(r===t&&(r=le(r)),r[s]=o)},h=0;h0;)e[i]=arguments[i+1];return Ce(this,e,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ke(),(function(t){return Re(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ke(),(function(t){return Ce(t,e)}))}function Pe(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function _e(){return this.__ownerID?this:this.__ensureOwner(new l)}function Ve(){return this.__ensureOwner()}function Be(){return this.__altered}var ze=function(t){function e(e){return null==e?Ke():ut(e)&&!_(e)?e:Ke().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 Ke().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 Je(this,t,e)},e.prototype.remove=function(t){return Je(this,t,h)},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):Ke()},e.prototype.sort=function(t){return bi(Yt(this,t))},e.prototype.sortBy=function(t,e){return bi(Yt(this,e,t))},e.prototype.map=function(t,e){var i=this;return this.withMutations((function(s){s.forEach((function(r,n){s.set(n,t.call(e,r,n,i))}))}))},e.prototype.__iterator=function(t,e){return new We(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?Ze(this.size,this._root,t,this.__hash):0===this.size?Ke():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ne=ze.prototype;Ne[lt]=!0,Ne[s]=Ne.remove,Ne.removeAll=Ne.deleteAll,Ne.setIn=me,Ne.removeIn=Ne.deleteIn=pe,Ne.update=Se,Ne.updateIn=Ae,Ne.merge=Ne.concat=ve,Ne.mergeWith=be,Ne.mergeDeep=Ie,Ne.mergeDeepWith=Fe,Ne.mergeIn=De,Ne.mergeDeepIn=Le,Ne.withMutations=Pe,Ne.wasAltered=Be,Ne.asImmutable=Ve,Ne["@@transducer/init"]=Ne.asMutable=_e,Ne["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ne["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new He(t,pt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return h&n?this.nodes[ei(h&n-1)].get(t+r,e,i,s):s},Ue.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=pt(s));var c=(0===e?i:i>>>e)&o,d=1<=ri)return function(t,e,i,s,r){for(var o=0,h=new Array(n),a=0;0!==i;a++,i>>>=1)h[a]=1&i?e[o++]:void 0;return h[s]=r,new Ge(t,o+1,h)}(t,y,f,c,x);if(g&&!x&&2===y.length&&Qe(y[1^m]))return y[1^m];if(g&&x&&1===y.length&&Qe(x))return x;var S=t&&t===this.ownerID,A=g?x?f:f^d:f|d,v=g?x?ii(y,m,x,S):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ge.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=pt(s));var u=(0===e?i:i>>>e)&o,c=n===h,d=this.nodes,f=d[u];if(c&&!f)return this;var g=qe(f,t,e+r,i,s,n,a,l);if(g===f)return this;var m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new He(e,s,n),a>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,127&(t+=t>>8)+(t>>16)}function ii(t,e,i,s){var r=s?t:Qt(t);return r[e]=i,r}var si=n/4,ri=n/2,ni=n/4,oi="@@__IMMUTABLE_LIST__@@";function hi(t){return Boolean(t&&t[oi])}var ai=function(t){function e(e){var i=mi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Si(t,e).set(0,i):Si(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=Ai(t._capacity)?s=yi(s,t.__ownerID,0,e,i,n):r=yi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Si(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=pi(this,t);if(!h)for(var u=0;u>>e&o;if(n>=this.array.length)return this;if(e>0){var h=this.array[n];if((s=h&&h.removeAfter(t,e-r,i))===h&&n===this.array.length-1)return this}var a=pi(this,t);return a.array.splice(n+1),s&&(a.array[n]=s),a};var ci,di={};function fi(t,e){var i=t._origin,s=t._capacity,o=Ai(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=yi(d,e,i-r,s,n,h);return f===d?t:((l=pi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=pi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function pi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=Ai(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function Si(t,e,i){void 0!==e&&(e|=0),void 0!==i&&(i|=0);var s=t.__ownerID||new l,n=t._origin,h=t._capacity,a=n+e,u=void 0===i?h:i<0?h+i:n+i;if(a===n&&u===h)return t;if(a>=u)return t.clear();for(var c=t._level,d=t._root,f=0;a+f<0;)d=new ui(d&&d.array.length?[void 0,d]:[],s),f+=1<<(c+=r);f&&(a+=f,n+=f,u+=f,h+=f);for(var g=Ai(h),m=Ai(u);m>=1<g?new ui([],s):y;if(y&&m>g&&ar;S-=r){var A=g>>>S&o;x=x.array[A]=pi(x.array[A],s)}x.array[g>>>r&o]=y}if(u=m)a-=m,u-=m,c=r,d=null,p=p&&p.removeBefore(s,0,a);else if(a>n||m>>c&o;if(v!==m>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&m>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Mi(s,r)}bi.isOrderedMap=ct,bi.prototype[P]=!0,bi.prototype[s]=bi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function ki(t){return Boolean(t&&t[Ti])}var Ci=function(t){function e(t){return null==t?Di():ki(t)?t:Di().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var i=this._head;for(t=c(this,t);i&&t--;)i=i.next;return i?i.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,i=this._head,s=arguments.length-1;s>=0;s--)i={value:t[s],next:i};return this.__ownerID?(this.size=e,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&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):Fi(i,s)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Di()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Fi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fi(this.size,this._head,t,this.__hash):0===this.size?Di():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var i=this;if(e)return new et(this.toArray()).__iterate((function(e,s){return t(e,s,i)}),e);for(var s=0,r=this._head;r&&!1!==t(r.value,s++,this);)r=r.next;return s},e.prototype.__iterator=function(t,e){if(e)return new et(this.toArray()).__iterator(t,e);var i=0,s=this._head;return new G((function(){if(s){var e=s.value;return s=s.next,Y(t,i++,e)}return{value:void 0,done:!0}}))},e}(k);Ci.isStack=ki;var Ri,Ii=Ci.prototype;function Fi(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Di(){return Ri||(Ri=Fi(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Pe,Ii.wasAltered=Be,Ii.asImmutable=Ve,Ii["@@transducer/init"]=Ii.asMutable=_e,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function Pi(t){return Boolean(t&&t[Li])}function _i(t){return Pi(t)&&_(t)}function Vi(t,e){if(t===e)return!0;if(!S(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||v(t)!==v(e)||M(t)!==M(e)||_(t)!==_(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!E(t);if(_(t)){var s=t.entries();return e.every((function(t,e){var r=s.next().value;return r&&ft(r[1],t)&&(i||ft(r[0],e))}))&&s.next().done}var r=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{r=!0;var n=t;t=e,e=n}var o=!0,a=e.__iterate((function(e,s){if(i?!t.has(e):r?!ft(e,t.get(s,h)):!ft(t.get(s,h),e))return o=!1,!1}));return o&&t.size===a}function Bi(t,e){var i=function(i){t.prototype[i]=e[i]};return Object.keys(e).forEach(i),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(i),t}function zi(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!ne(t))return t;t=J(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Ni=function(t){function e(e){return null==e?Hi():Pi(e)&&!_(e)?e:Hi().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ui.intersect.apply(e(t.pop()),t):Hi()},e.union=function(t){return(t=w(t).toArray()).length?Ui.union.apply(e(t.pop()),t):Hi()},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,r=Gi(this,this._map.mapEntries((function(r){var n=r[1],o=t.call(e,n,n,i);return o!==n&&(s=!0),[o,o]}),e));return s?r:this},e.prototype.union=function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(i){for(var s=0;s=0&&e=0&&i>>-15,461845907),e=gt(e<<13|e>>>-13,5),e=gt((e=e+3864292196^t)^e>>>16,2246822507),e=mt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(pt(t),pt(e))|0}:function(t,e){s=s+as(pt(t),pt(e))|0}:e?function(t){s=31*s+pt(t)|0}:function(t){s=s+pt(t)|0}),s)}(this))}});var Ji=w.prototype;Ji[x]=!0,Ji[U]=Ji.values,Ji.toJSON=Ji.toArray,Ji.__toStringMapper=oe,Ji.inspect=Ji.toSource=function(){return this.toString()},Ji.chain=Ji.flatMap,Ji.contains=Ji.includes,Bi(T,{flip:function(){return jt(this,Vt(this))},mapEntries:function(t,e){var i=this,s=0;return jt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return jt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var qi=T.prototype;qi[A]=!0,qi[U]=Ji.entries,qi.toJSON=Ki,qi.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Bi(k,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return jt(this,Nt(this,t,e,!1))},findIndex:function(t,e){var i=this.findEntry(t,e);return i?i[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return jt(this,zt(this,!1))},slice:function(t,e){return jt(this,Ot(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return 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 as(t,e){return t^e+2654435769+(t<<6)+(t>>2)}ts.has=Ji.includes,ts.contains=ts.includes,ts.keys=ts.values,Bi(q,qi),Bi(Q,Qi),Bi(tt,ts);var ls=function(t){function e(t){return null==t?fs():_i(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(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ni);ls.isOrderedSet=_i;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(Ei()))}cs[P]=!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(D(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(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function Es(t,e,i,s,r,n){if("string"!=typeof i&&!L(i)&&(K(i)||X(i)||re(i))){if(~t.indexOf(i))throw new TypeError("Cannot convert circular structure to Immutable");t.push(i),r&&""!==s&&r.push(s);var o=e.call(n,s,J(i).map((function(s,n){return Es(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return M(e)?e.toList():v(e)?e.toMap():e.toSet()}var Ts="4.3.5",ks=w;const Cs={version:Ts,Collection:w,Iterable:w,Seq:J,Map:ze,OrderedMap:bi,List:ai,Stack:Ci,Set:Ni,OrderedSet:ls,PairSorting:gs,Record:ms,Range:Wi,Repeat:bs,is:ft,fromJS:Ms,hash:pt,isImmutable:L,isCollection:S,isKeyed:v,isIndexed:M,isAssociative:E,isOrdered:_,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:ki,isSet:Pi,isOrderedSet:_i,isRecord:D,get:ae,getIn:ji,has:he,hasIn:Zi,merge:Ee,mergeDeep:Te,mergeWith:we,mergeDeepWith:ke,remove:ue,removeIn:ye,set:ce,setIn:ge,update:xe,updateIn:de}},89:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(568),r=i(613),n=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),h=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(n);class a{constructor(){this.o=!0}u(){return this.o}}class l extends a{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}),y=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),p=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),S=x,A=(t,e)=>({left:void 0!==e.left?e.left:t.left,top:void 0!==e.top?e.top:t.top,right:void 0!==e.right?e.right:t.right,bottom:void 0!==e.bottom?e.bottom:t.bottom}),v=s.Record({type:"color",r:1,g:1,b:1,a:1});class b extends v{constructor(t){super(t)}toUint32(){return void 0!==this.C||(this.C=F(this.getR(),this.getG(),this.getB(),this.getA())),this.C}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.T||(this.T=new b({r:this.r+.45*(1-this.r),g:this.g+.45*(1-this.g),b:this.b+.45*(1-this.b),a:this.a<1?this.a+.45*(1-this.a):1})),this.T}getLighter(){return this.F||(this.F=new b({r:this.r+.4*(1-this.r),g:this.g+.4*(1-this.g),b:this.b+.4*(1-this.b),a:this.a})),this.F}getDarker(){return this.I||(this.I=new b({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.I}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),E=(t,e,i,s=255)=>new b({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 b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255,a:Number(`0x${e.substring(6,8)}`)/255});case 6:return new b({r:Number(`0x${e.substring(0,2)}`)/255,g:Number(`0x${e.substring(2,4)}`)/255,b:Number(`0x${e.substring(4,6)}`)/255});case 4:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255,a:Number(`0x${e.charAt(3)}${e.charAt(3)}`)/255});case 3:return new b({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},T=(t,e=1,i=1)=>{let s,r,n;t/=360;const o=Math.floor(6*t),h=6*t-o,a=i*(1-e),l=i*(1-h*e),u=i*(1-(1-h)*e);switch(o%6){case 0:s=i,r=u,n=a;break;case 1:s=l,r=i,n=a;break;case 2:s=a,r=i,n=u;break;case 3:s=a,r=l,n=i;break;case 4:s=u,r=a,n=i;break;default:s=i,r=a,n=l}return new b({r:s,g:r,b:n})},k=t=>E(255&t,255&(t>>=8),255&(t>>=8),255&(t>>=8)),C={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"},R=new b({}),I=E(0,0,0,0),F=(t,e,i,s=255)=>(s<<24|i<<16|e<<8|t)>>>0,D=(t,e)=>t.value-e.value,L=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:E(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1,percentageValues:!1}),P=t=>{const{steps:e}=t,i=e.length;e.sort(D);const[s,r]=i>0?[e[0].value,e[i-1].value]:[0,0],n=i>0?i-1:0,o=Array(n);for(let t=0;t0&&s!==r}};class _ extends L{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,percentageValues:t.percentageValues,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,P(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.length},percentage=${this.percentageValues}`}setSteps(t){return this.merge(P({...this,steps:t}))}getSteps(){return this.get("steps")}setTitle(t){return this.set("title",t)}getTitle(){return this.get("title")}setUnits(t){return this.set("units",t)}getUnits(){return this.get("units")}setInterpolation(t){return this.set("interpolate",t)}getInterpolation(){return this.get("interpolate")}setFallbackColor(t){return this.set("color",t)}getFallbackColor(){return this.get("color")}setPercentageValues(t){return this.set("percentageValues",t)}getPercentageValues(){return this.get("percentageValues")}getColors(t){if(Array.isArray(t)){if(Array.isArray(t[0])){const e=t,i=e.length,s=e[0].length,r=[...Array(i)].map((()=>Array(s)));for(let t=0;t=a&&t<=l){if(a===l)return i.color;const e=(t-i.value)/(h.value-i.value);return s=i.color,r=h.color,n=e,new b({r:s.r+(r.r-s.r)*n,g:s.g+(r.g-s.g)*n,b:s.b+(r.b-s.b)*n,a:s.a+(r.a-s.a)*n})}}return t=0;s-=1)if(t>=e[s].value)return e[s].color;return e[0].color}}const V=s.Record({type:"fillstyle",fillType:"empty"});class B extends V{toString(){return"emptyFill"}}const z=new B,N=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:E(255,255,255)});class U extends O{}class G extends U{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getColor(){return this.get("color")}setA(t){return this.setColor(this.getColor().setA(t))}setR(t){return this.setColor(this.getColor().setR(t))}setG(t){return this.setColor(this.getColor().setG(t))}setB(t){return this.setColor(this.getColor().setB(t))}}const Y=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class H extends U{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return M(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const X=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),W=s.Record({type:"fillstyle",fillType:"palette",lut:new _({steps:[]}),lookUpProperty:"value"}),j=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),$={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=ee(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.D)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.R=n,this.eases=t.map((([t,e])=>s(t,e,i)))}V(){this.L.emit("start")}start(){return this.R.includes(this)||this.R.push(this),this}addNextAnimations(t){return t instanceof Array?t.forEach((t=>this.nextAnimations.push(t))):this.nextAnimations.push(t),this}NextAnimation(t,e,i=this.duration,s=this.easing){const r=new Z(t,e,i,s,this.R);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.L.on("start",t,e)}onAnimationEnd(t,e){return this.L.on("end",t,e)}onEveryAnimationEnd(t,e){return this.L.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.L.on("allEnd",t,e)}allOffAnimationEnd(){return this.L.topicOff("end"),this}allOffEveryAnimationEnd(){return this.L.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.L.topicOff("allEnd"),this}offAnimationEnd(t){return this.L.off(t,"end")}offEveryAnimationEnd(t){return this.L.off(t,"everyEnd")}offAllAnimationEnd(t){return this.L.off(t,"allEnd")}finish(t=!0){if(this.D=!0,this.R.splice(this.R.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.L.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.L.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.L.emit("end",e),this.L.emit("everyEnd",e)),e}t&&(this.L.emit("end",void 0),this.L.emit("everyEnd",void 0),this.L.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(wt):this.values.map(wt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let e=0;e{e>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const i=[];let s,r,n=0;const o=()=>{s=void 0;const h=Date.now();r=r||h,n=h-r,n/1e3>=1/e&&(r=Date.now()-n%(1e3/e),i.forEach((t=>{0===t.delta&&t.V(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=bt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=$.linear)=>(r,n,h=t)=>{const a=new Z(r,n,h,e,i).start();return s||(s=bt.requestAnimationFrame(o)),a}};var J,q;e.GradientShape=void 0,(J=e.GradientShape||(e.GradientShape={})).circle="circle",J.ellipse="ellipse",e.GradientExtent=void 0,(q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",q.closestCorner="closest-corner",q.farthestSide="farthest-side",q.farthestCorner="farthest-corner";const Q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class tt extends Q{constructor(t){if(super(t),null===t||t&&null===t.stops||t&&t.stops&&!Array.isArray(t.stops)||t&&t.stops&&Array.isArray(t.stops)&&t.stops.length<2)throw new Error("RadialGradientFill requires minimum two color stops to be defined.")}toString(){return`radialGradientFill:${this.shape},${this.extent},${this.position.x},${this.position.y},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");return this.set("stops",t)}getColorStops(){return this.get("stops")}setPosition(t){return this.set("position",t)}getPosition(){return this.get("position")}setShape(t){return this.set("shape",t)}getShape(){return this.get("shape")}setExtent(t){return this.set("extent",t)}getExtent(){return this.get("extent")}}const et=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),it=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class st extends it{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?mi(t):t)}getAngle(t){return t?gi(this.get("angle")):this.get("angle")}}const rt=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),nt=s.Record({type:"linestyle",lineType:"empty"}),ot=new class extends nt{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}O(){return 0}setFillStyle(t){return this}getFillStyle(){return z}},ht=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"empty"!==t.lineType);class at{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new lt,this.y=new lt,this.z=new lt,this.L=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Ge,0),this.cellIndex.x=t.reduce(((t,e,i)=>i>=n.x?t:t+e),0),this.cellSpan.x=t.reduce(((t,e,i)=>i>=n.x&&i{this.cellsAmount.y=t.reduce(Ge,0),this.cellIndex.y=t.reduce(((t,e,i)=>i>=n.y?t:t+e),0),this.cellSpan.y=t.reduce(((t,e,i)=>i>=n.y&&i{s.x.W(e),s.y.W(r)}}}U(){return this.G&&(this.G(),this.G=void 0),this}Y(t){return this.L.on("cell-resize",t)}H(t){return this.L.off(t,"cell-resize")}}class lt extends a{constructor(){super(...arguments),this.$=0,this.X=10,this.j=1}Z(){return this.o=!1,this}J(){return this.o=!0,this}getInnerStart(){return this.$}getInnerEnd(){return this.X}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}K(t,e){return this.$=t,this.X=e,this.q(),this}tt(t){return this.j=t,this.q(),this}it(t){return t/this.j}q(){const t=this.it(this.X-this.$),e=this.j;void 0!==this.st&&!1!==Ct(t,this.st)||(this.o=!0,this.et=e,this.st=t)}ht(){return this.st}rt(){return this.et}nt(){return this.Xnew t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).ut({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new at({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ct=(t,e,i)=>e===i?t:i.ct(e.dt(t)),dt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Pi?e.x:e.x instanceof Pi?e.x.x:e.x.ft,r=e instanceof Pi?e.y:e.y instanceof Pi?e.y.y:e.y.ft,n=i instanceof Pi?i.x:i.x instanceof Pi?i.x.x:i.x.ft,o=i instanceof Pi?i.y:i.y instanceof Pi?i.y.y:i.y.ft;return{...t,x:ct(t.x,s,n),y:ct(t.y,r,o)}},ft=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.yt.At(t);if("world"===e.id&&"axes"===i.id)return e.chart.yt.St(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")},gt=(...t)=>{if(0===t.length)return{remove:kt};let e=!1;const i=t.map((i=>i.onIntervalChange(((s,r,n)=>((i,s,r)=>{e||(e=!0,t.filter((t=>t!==i)).forEach((t=>t.vt(s,r,!1,i.getStopped(),"synchronizedAxis"))),e=!1)})(i,r,n)))));let s=!1;const r=t.map((e=>e.onStoppedStateChanged(((i,r)=>((e,i)=>{s||(s=!0,t.filter((t=>t!==e)).forEach((t=>t.setStopped(i))),s=!1)})(e,r)))));return{remove:()=>{t.forEach(((t,e)=>{t.offIntervalChange(i[e]),t.offStoppedStateChanged(r[e])}))}}};class mt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,mt.prototype)}}class yt extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&bt.alert(s),Object.setPrototypeOf(this,yt.prototype)}}class pt extends yt{constructor(t){super(t),Object.setPrototypeOf(this,pt.prototype)}}var xt,St,At,vt;e.UISpace=void 0,(xt=e.UISpace||(e.UISpace={}))[xt.Content=0]="Content",xt[xt.PaddedContent=1]="PaddedContent",xt[xt.PaddedBackground=2]="PaddedBackground",xt[xt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(St=e.UIVisibilityModes||(e.UIVisibilityModes={}))[St.never=0]="never",St[St.always=1]="always",St[St.whenHovered=2]="whenHovered",St[St.whenDragged=3]="whenDragged",St[St.whenNotDragged=4]="whenNotDragged",St[St.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,(vt=e.UIDirections||(e.UIDirections={}))[vt.Up=0]="Up",vt[vt.Right=1]="Right",vt[vt.Down=2]="Down",vt[vt.Left=3]="Left";const bt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},Mt=(t,e)=>t.x===e.x&&t.y===e.y,Et=t=>t!==Le&&t!==Pe&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,wt=t=>t[1],Tt=t=>t.dispose(),kt=()=>{},Ct=(t,e)=>t===e,Rt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),It=t=>Array.prototype.concat.apply([],t),Ft=(t,e)=>void 0!==t?t:e,Dt=t=>t.xt(),Lt=t=>t.bt(),Pt=t=>t.Mt(),_t=t=>t._t(),Vt=t=>t.min.x,Bt=t=>t.max.x,zt=t=>t.min.y,Nt=t=>t.max.y,Ot=(t,e,i,s,r)=>{if(t.length>0){let n=r?s(r):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Gt=u(0,1),Yt=u(1,0),Ht=u(0,-1),Xt=u(-1,0),Wt=u(0,0),jt=t=>{switch(t){case e.UIDirections.Up:return Gt;case e.UIDirections.Right:return Yt;case e.UIDirections.Down:return Ht;case e.UIDirections.Left:return Xt;default:return Wt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Zt=t=>{t.stopPropagation(),t.preventDefault()},Kt=(t,e)=>{if(!e)return t;const i=t.length,s=new Float32Array(2*i);let r=0;for(let e=0;e{if(!e){const e=t.length,i=new Float32Array(2*e);let s=0;for(let r=0;r{const e=t.length,i=new Float32Array(3*e);let s=0;for(let r=0;re=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)},te=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ie=ee(Math.E),se=(t,e)=>{const i=e[t];return i?i():void 0},re=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;iyi(hi(t,i))-yi(hi(e,i))))},ne=(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:E(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())),he=t=>255===t.getA()?t:t.setA(255),ae=(()=>{const t=E(0,0,0);return i=>(i=he(i),new tt({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:oe(i,t,.5)}]}))})(),le=(()=>{const t=t=>{var e;if(t){if(Y(t)){if(0===t.getColor().getA())return;return t.getColor()}if(et(t)||rt(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}j(t)}};return(e,i,s,r)=>{const n=[];if(r.fill&&n.push(r.fill),r.fill2&&n.push(r.fill2),r.stroke){const t=r.stroke.getFillStyle();t!==z&&n.push(t)}if(r.point3D){const t=r.point3D;n.push(t.getFillStyle())}let o;if(r.behavior&&!0===r.behavior.colorStep){const[e,s]=n.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?(h=e)===(a=s)||h.getR()===a.getR()&&h.getG()===a.getG()&&h.getB()===a.getB()?ae(h):(h=he(h),a=he(a),new st({angle:0,stops:[{offset:0,color:a},{offset:.5,color:a},{offset:.5,color:h},{offset:1,color:h}]})):i.uiButtonFillStyle}else{const e=n.reduce(((e,i)=>e||t(i)),void 0);o=e?s?new G({color:e}):ae(e):i.uiButtonFillStyle}var h,a;e.setButtonOnFillStyle(o)}})(),ue=t=>{const e=t;if(j(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ce=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},de=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let r=s>=0?s:i.length;for(;r"function"==typeof t?t(e):t,ge=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),me=(t,e)=>e(),ye=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new G({color:E(255,255,255,1)});const pe=t=>t===_e||t.min.x===_e.min.x&&t.max.x===_e.max.x&&t.min.y===_e.min.y&&t.max.y===_e.max.y,xe=t=>Array.from(new Set(t)),Se=t=>t.filter((t=>void 0!==t)),Ae=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,ve=(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))))))},be=(t,e)=>{throw new Error(e)},Me=()=>{const t=K((()=>{}));let e;return(i,s,r,n)=>{const o=null==n?void 0:n.onStart,h=null==n?void 0:n.onCompleted,a=(null==n?void 0:n.easing)||$.ease,l=(null==n?void 0:n.durationMs)||1e3;let u;if(e)if(0===e.nextAnimations.length){const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else{i=e.nextAnimations.pop().values[0][0];const t=e.NextAnimation([[i,s]],(([i])=>{e=t,r(i)}),l,a);u=t}else u=t(l,a)([[i,s]],(([t])=>{r(t)})),e=u;u.onAnimationEnd((()=>{e=void 0})),o&&u.onAnimationStart(o),h&&u.onAnimationEnd(h)}},Ee=t=>{let e;return()=>e||(e=t(),e)},we=t=>{if(t===ot)return 0;const e=t.getThickness();return e<0?1:1*e},Te=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please see https://lightningchart.com/js-charts/docs/troubleshooting/error-resources-not-found/`;if(s.shouldCrash)throw bt.alert(r),new Error(r);bt.console.warn(r)},ke=(t,e,i,s=0)=>{if(t{const t=new Map;return{wt:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ct(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.kt(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Tt(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ft(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.It(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Pt(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Dt(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Bt(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Lt(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.Rt(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Et(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.zt(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Vt(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ot(e,i,s)})),e),Nt:(e,i)=>{t.set(e,i)},Gt:()=>{t.clear()}}},Re={left:0,right:0,top:0,bottom:0},Ie=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER),Fe=(t,e,i)=>{e&&e.Wt();const s=i();return{Ut:t,Wt:()=>{s.forEach((e=>t.Yt(e)))}}},De={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=>De.divide(t,De.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(De.dot(t,e)/(De.length(t)*De.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=De.dot(e,t),o=De.cross(e,t);return De.addVec(De.multiply(t,s),De.addVec(De.multiply(e,(1-s)*n),De.multiply(o,r)))},lerp:(t,e,i)=>(i=Rt(i,0,1),De.addVec(De.multiply(t,1-i),De.multiply(e,i))),equals:(t,e)=>Ct(t.x,e.x)&&Ct(t.y,e.y)&&Ct(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)})},Le=Number.MAX_SAFE_INTEGER,Pe=-Number.MAX_SAFE_INTEGER,_e=m(u(Le,Le),u(Pe,Pe)),Ve=m(f(Le,Le,Le),f(Pe,Pe,Pe)),Be=(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))},ze=(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),Oe=(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)))),Ue=t=>{const e=t.length;for(let i=0;ie+t,Ye=(t,e,i)=>{const s=hi(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=hi(i,t),o=(n.x*s.x+n.y*s.y)/r;return o<=0?t:o>=1?e:u(t.x+o*s.x,t.y+o*s.y)},He=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Xe=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},We=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},je=(t,e,i)=>oi(t,ni(hi(e,t),i)),$e=(t,e,i)=>De.addVec(t,De.multiply(De.subtractVec(e,t),i));function Ze(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.z{const e={min:{x:Le,y:Le},max:{x:Pe,y:Pe}};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},qe=(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 Qe(t,e,i,s){const r=t.x-s.x,n=t.y-s.y,o=s.x-i.x,h=i.y-s.y,a=h*r+o*n,l=(s.y-e.y)*r+(e.x-s.x)*n,u=h*(e.x-s.x)+o*(e.y-s.y);return u<0?a<=0&&l<=0&&a+l>=u:a>=0&&l>=0&&a+l<=u}function ti(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 ei(t,e){return u(t.x-e.x,t.y-e.y)}function ii(t){const e=ri(t);return 0===e?u(0,0):u(t.x/e,t.y/e)}function si(t,e){let i={x:e.x-t.x,y:e.y-t.y};i=ii(i);const s=Math.PI/2,r=i.x;return i.x=-Math.sin(s)*i.y,i.y=r*Math.sin(s),i}function ri(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function ni(t,e){return u(t.x*e,t.y*e)}function oi(t,e){return u(t.x+e.x,t.y+e.y)}function hi(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 li(t,e){return u(t.x/e.x,t.y/e.y)}function ui(t){return ni(t,-1)}function ci(t,e){return t.x*e.x+t.y*e.y}const di=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},fi=(t,e,i)=>{const s=(i.y-e.y)/(i.x-e.x),r=e.x+(t-e.y)/s;return u(r,t)};function gi(t){return t*Math.PI/180}function mi(t){return 180*t/Math.PI}function yi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function pi(t){return u(Math.cos(t),Math.sin(t))}function xi(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 Si=(t,e,i,s)=>{let r,n,o,h;if(e.x-t.x!=0||s.x-i.x!=0)return e.x-t.x==0?(o=e.x,n=(s.y-i.y)/(s.x-i.x),h=n*(o-i.x)+i.y):s.x-i.x==0?(o=s.x,r=(e.y-t.y)/(e.x-t.x),h=r*(o-t.x)+t.y):(r=(e.y-t.y)/(e.x-t.x),n=(s.y-i.y)/(s.x-i.x),o=(i.y-n*i.x+r*t.x-t.y)/(r-n),h=r*(o-t.x)+t.y),u(o,h)},Ai=(t,e)=>{const i=t.length,s=e.length,r=new Uint16Array(i+s);return r.set(t,0),r.set(e,i),r};class vi{constructor(){this.Ht=!0}getInnerStart(){return this.$}getInnerEnd(){return this.X}getInnerInterval(){return Math.abs(this.X-this.$)}K(t,e){return this.Ht=t!==this.$||e!==this.X,this.$=t,this.X=e,this}Z(){return this.Ht=!1,this}J(){return this.Ht=!0,this}}class bi extends vi{constructor(t,e,i,s){if(super(),this.$t=!0,this.Xt=!0,this.jt=[0,0],this.Zt=!0,this.Qt=t,this.Jt=e,this.Kt=i,this.qt=t,this.ti=e,s){const t=s.N(this.ii.bind(this));this.ii(s._()),this.si=()=>s.W(t)}}tt(t){return this.j=t,this.Xt=!0,this}ei(t){return this.jt=t.map(Math.abs),this.Zt=!0,this}hi(){return this.Qt/this.Kt*this.j+this.jt[0]}ri(){return(this.Qt+this.Jt)/this.Kt*this.j-this.jt[1]}ni(){return this.getCellSize()-this.oi()}ai(){return this.j}getCellSize(){return this.li(this.j)}oi(){return this.jt[0]+this.jt[1]}ui(){return this.jt}ii(t){this.Kt=t.reduce(Ge,0),this.Qt=t.reduce(((t,e,i)=>i>=this.qt?t:t+e),0),this.Jt=t.reduce(((t,e,i)=>i>=this.qt&&iki;return!n&&!o||!!r&&(e>t?{start:n?Ti:t,end:o?ki:e}:{start:o?ki:t,end:n?Ti:e})}dt(t){const e=this.hi(),i=this.ri(),s=Math.max(t,Ti);return e+(this.di.function(s)-this.fi.scaleStartLog)/this.fi.scaleIntervalLog*(i-e)}ct(t){const e=this.hi(),i=(t-e)/(this.ri()-e),s=this.fi.scaleStartLog+i*this.fi.scaleIntervalLog;return this.di.number**s}ci(){this.di&&this.Ai()}K(t,e){return super.K(t,e),this.di&&this.Ai(),this}ei(t){return super.ei(t),this.di&&this.Ai(),this}tt(t){return super.tt(t),this.di&&this.Ai(),this}gi(t){return this.di={internal:t,function:Ei(t),number:wi(t)},this}pi(){return this.di.internal}mi(t,e){const i=this.dt(t)+e;return this.ct(i)}yi(){return this.Xt||this.Ht||this.Zt||this.$t}Ai(){const t=this.di.function(this.$),e=this.di.function(this.X)-t,i=2*this.hi()/this.j-1,s=2*this.ri()/this.j-1-i;return this.fi={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.fi}Si(){return this.fi}}const Ei=t=>"e"===t?ie:ee(t),wi=t=>"e"===t?Math.E:t,Ti=.9*10**-4,ki=1.1*10**25,Ci=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Ri=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Be(s,10),0);return t.toFixed(r)},Ii={Numeric:(t,e)=>Ri(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);let r="",n="";if(i>=1e3&&t>1e3){let e="";for(const i of Ci){const s=Math.round(1e3*t/i.unit)/1e3;if(s>=1){e=s.toString(),n=i.prefix;break}}r=(s?"-":"")+e}else{let e=String(Math.floor(t));const n=Be(t,1e3);for(let t=1;t<=n;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}r=(s?"-":"")+e+(i<=10?((t,e)=>{if(0===e)return"";let i=(Math.abs(t)-Math.abs(Math.floor(t))).toString().substring(1);return i.length>e&&(i=i.substring(0,e+1)),i})(t,2-Be(i,10)):"")}return r+=n,r},LogarithmicExponentsRounded:(t,e,i,s=10)=>{const r=Ei(s)(t);return`${s}${Fi(r)}`},LogarithmicExponents:(t,e,i,s=10)=>{const r=Ei(s),n=Math.floor(r(t)),o=t/wi(s)**n;return`${Math.round(o)}×${s}${Fi(n)}`},LogarithmicExtreme:(t,e,i,s=10)=>{const r=Ei(s),n=Math.floor(r(t));return`${(t/wi(s)**n).toFixed(2)}×${s}${Fi(n)}`},LogarithmicNoExponents:(t,e,i,s=10)=>{const r=Ei(s);if("e"===s)return`${Math.floor(r(t))}e`;const n=t.toString();if(t>1)return n;const o=Math.floor(r(t));return t.toFixed(Math.abs(o))}},Fi=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 Di extends bi{constructor(t,e,i,s){super(t,e,i,s),this.vi=!1,this.xi=!1,this.bi=0,this.j=1e3,this.K(0,10),this.q()}yi(){return this.xi}ot(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.vi){const i=((t,e,i)=>{const s=((t,e)=>{if(ePe&&tPe){const i=Math.abs(t/2**23),s=Math.abs(e/2**23),r=Math.min(i,s);return 10**Math.floor(Math.log10(r))}})(t,e);if(void 0!==s)return s*i})(t,e,this.getCellSize());if(void 0===i)return!1;if(o>i)return!0;const s=(e+t)/2,h=(r?i/2:n/2)*(t>e?-1:1);return{start:s-h,end:s+h}}const h=10**-(12-Math.log10(Math.max(Math.abs(t),1)));if(o>h)return!0;const a=(e+t)/2,l=(r?h/2:n/2)*(t>e?-1:1);return{start:a-l,end:a+l}}ci(){this.q()}dt(t){return this.hi()+(t-this.$)/(this.X-this.$)*(this.ri()-this.hi())}ct(t){return this.$+(t-this.hi())/(this.ri()-this.hi())*(this.X-this.$)}K(t,e){return super.K(t,e),this.q(),this}ei(t){return super.ei(t),this.q(),this}tt(t){return super.tt(t),this.Mi=Li(this.X-this.$,this.jt,this.j,this.Jt,this.Kt),this.q(),this}_i(){return this.vi=!0,this}wi(){return this.vi}Ci(){return Math.abs(this.ki)}Ti(){return this.Ci()/this.Mi}Fi(){return this.Ii}Pi(){return this.Di}getPixelSize(){return this.Mi}Si(){return this.fi}J(){return super.J(),this.xi=!0,this}Z(){return super.Z(),this.xi=!1,this}Bi(t,e=Ii.Numeric){return e(t,this)}Li(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Ri(t){return Li(t,this.jt,this.j,this.Jt,this.Kt)}q(){let t=this.$,e=this.X,i=0;this.vi&&(t=0,e=this.X-this.$,i=this.$);const s=e-t,r=Li(s,this.jt,this.j,this.Jt,this.Kt);this.Di=t-this.jt[0]*r,this.Ii=e+this.jt[1]*r;const n=this.Ii-this.Di,o=n-this.ki,h=Math.abs(o/r),a=s-this.bi,l=Math.abs(a/r);(!this.fi||h>=.4||l>=.4)&&(this.bi=s,this.ki=n,this.Mi=r,this.xi=!0);const u=this.ki*this.Kt/(2*this.Jt),c=-(this.Di-this.ki*this.Qt/this.Jt)-u,d=2*this.hi()/this.j-1,f=2*this.ri()/this.j-1-d;this.fi={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}mi(t,e){return t+this.Mi*e}}const Li=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Pi{Ei(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}Z(){return this.x.Z(),this.y.Z(),this}J(){return this.x.J(),this.y.J(),this}tt(t,e){return"object"==typeof t?(this.x.tt(t.x),this.y.tt(t.y)):(this.x.tt(t),this.y.tt(e)),this}ai(){return u(this.x.ai(),this.y.ai())}zi(t){return this.x.ei(t),this}Vi(t){return this.y.ei(t),this}oi(){return u(this.x.oi(),this.y.oi())}Oi(t,e){return this.x.K(t,e),this}Ni(t,e){return this.y.K(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.oi(),y:e-this.y.oi()}}Gi(){return this.x.yi()||this.y.yi()}}class _i extends Pi{constructor(){super(...arguments),this.Wi="LinearScaleXY"}ut(t,e,i,s){return this.x=new Di(t.x,e.x,i.x,s?s.x:void 0),this.y=new Di(t.y,e.y,i.y,s?s.y:void 0),this}wi(){return this.x.wi()||this.y.wi()}Ui(){return u(this.x.getPixelSize(),this.y.getPixelSize())}Si(){return{x:this.x.Si(),y:this.y.Si()}}mi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Yi(t,e,i,s){const r=this.Ui(),n=si(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Vi extends Pi{constructor(){super(...arguments),this.Wi="MixedScaleXY"}wi(){return!1}mi(t,e){const i=this.x.dt(t.x),s=this.y.dt(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ct(r.x),y:this.y.ct(r.y)}}Yi(t,e,i,s){const r={x:this.x.dt(t.x),y:this.y.dt(t.y)},n={x:this.x.dt(e.x),y:this.y.dt(e.y)},o=ii(hi(n,r)),h=si(n,r),a={x:r.x+o.x*s+h.x*i,y:r.y+o.y*s+h.y*i};return{x:this.x.ct(a.x),y:this.y.ct(a.y)}}Si(){const t=this.x.Si(),e=this.y.Si();return{uScaleStart:[this.x.$,this.y.$],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 Bi=(t,e)=>t instanceof Mi||e instanceof Mi?(new Vi).Ei(t,e):(new _i).Ei(t,e),zi=t=>"client"===t,Ni=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Oi=t=>"relative"===t,Ui=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Gi;e.HighlightModes=void 0,(Gi=e.HighlightModes||(e.HighlightModes={}))[Gi.noHighlighting=0]="noHighlighting",Gi[Gi.onHover=1]="onHover";class Yi{constructor(t,i,s,n){this.Hi=!0,this.$i=e.HighlightModes.onHover,this.Xi=!1,this.ji=!0,this.Zi=!1,this.L=new r.Eventer,this.Qi=[],this.Ji=[],this.onMouseEnter=t=>this.L.on("mouseEnter",t),this.onMouseLeave=t=>this.L.on("mouseLeave",t),this.onMouseClick=t=>this.L.on("mouseClick",t),this.onMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onMouseDown=t=>this.L.on("mouseDown",t),this.onMouseUp=t=>this.L.on("mouseUp",t),this.onMouseMove=t=>this.L.on("mouseMove",t),this.offMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offMouseClick=t=>this.L.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.L.off(t,"mouseDown"),this.offMouseUp=t=>this.L.off(t,"mouseUp"),this.offMouseMove=t=>this.L.off(t,"mouseMove"),this.offMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.L.off(t,"mouseWheel"),this.Ct=(t,i,s)=>{this.L.emit("mouseEnter",this,i),this.Zi=!0,this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.kt=(t,i,s)=>{this.L.emit("mouseLeave",this,i),this.Zi=!1,this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Dt=(t,e,i)=>{this.L.emit("mouseMove",this,e)},this.Tt=(t,e,i)=>this.L.emit("mouseClick",this,e),this.Ft=(t,e,i)=>this.L.emit("mouseDoubleClick",this,e),this.It=(t,e,i)=>this.L.emit("mouseDown",this,e),this.Pt=(t,e,i)=>this.L.emit("mouseUp",this,e),this.Lt=(t,e,i,s)=>{this.L.emit("mouseDragStart",this,e,i)},this.Bt=(t,e,i,s,r,n)=>{this.L.emit("mouseDrag",this,e,i,s,r)},this.Rt=(t,e,i,s,r)=>{this.L.emit("mouseDragStop",this,e,i,s)},this.Et=(t,e,i)=>{this.L.emit("mouseWheel",this,e)},this.zt=(t,i,s)=>{this.L.emit("touchStart",this,i),this.Zi=!0,this.$i===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Vt=(t,e,i)=>{this.L.emit("touchMove",this,e)},this.Ot=(t,i,s)=>{this.L.emit("touchEnd",this,i),this.Zi=!1,this.$i===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ki=t,this.qi=i,this.ts=s,this.ss=new Map,this.es=n,this.hs=this.es.rs(this,{ns:{themeEffectEnabled:this.ts.effectsText},os:{}}),this.Ki.cs.us.ls(this,(t=>{this.ss.forEach(((e,i)=>i.ds(t))),this.Ji.forEach((e=>e.setHighlight(t))),this.Qi.forEach((e=>e.ds(t)))}),{animationEnabled:this.Ki.getAnimationsEnabled()})}fs(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.ss.set(t,{isText:s});const r=Array.from(this.ss);this.hs.ns.As(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.hs.os.As(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Hi).setVisible(this.ji).ds(this.Ki.cs.us.gs(this,!0)),i&&t.setMouseEnterEventHandler(this.Ct).setMouseLeaveEventHandler(this.kt).setMouseClickEventHandler(this.Tt).setMouseDoubleClickEventHandler(this.Ft).setMouseDownEventHandler(this.It).setMouseUpEventHandler(this.Pt).setMouseMoveEventHandler(this.Dt).setMouseDragStartEventHandler(this.Lt).setMouseDragEventHandler(this.Bt).setMouseDragStopEventHandler(this.Rt).setMouseWheelEventHandler(this.Et).setTouchStartEventHandler(this.zt).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.Ot);const n=t.onDispose((()=>{t.offDispose(n),this.ss.delete(t)}))}ps(t){this.Qi=t;const e=this.Ki.cs.us.gs(this,!0);t.forEach((t=>{t.ds(e).ys(this.ji)}))}setEffect(t){return this.hs.ns.Ss(t&&this.ts.effectsText),this.hs.os.Ss(t),this.Ki.cs.vs(),this}getEffect(){return this.hs.ns.xs()||this.hs.os.xs()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setIcon(t){return this.bs=t,this.Ki.cs.vs(),this}getIcon(){return this.bs}setName(t){return this.Ms=t,this.Ji.forEach((t=>t.setText(this.Ms))),this}getName(){return this.Ms}dispose(){return this.Xi||(this.Xi=!0,this.ss.forEach(((t,e)=>e.dispose())),this.qi(this),this.Ji.forEach((t=>{t.dispose()})),this.Ji.length=0,this.L.emit("dispose",this),this.Ki.cs.vs()),this}setVisible(t){return t===this.ji||(this.ji=t,this.ss.forEach(((e,i)=>i.setVisible(t))),this.Qi.forEach((e=>e.ys(t))),this.Ji.forEach((e=>e.setOn(t))),this.L.emit("visibleStateChanged",this,this.ji),this.Ki.cs.vs()),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}setHighlight(t){return this.Ki.cs.us._s(this,t),this.L.emit("highlight",this,t),this}getHighlight(){return this.Ki.cs.us.gs(this)}setAnimationHighlight(t){return this.Ki.cs.us.ws(this,t),this}getAnimationHighlight(){return this.Ki.cs.us.Cs(this)}setMouseInteractions(t){return this.Hi=t,this.ss.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ki.cs.vs(),this}getMouseInteractions(){return this.Hi}getIsUnderMouse(){return this.Zi}setHighlightOnHover(t){return this.$i=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.$i!==e.HighlightModes.noHighlighting}attach(t,e=!0,i=!1){return ve(t,[this],{toggleVisibilityOnClick:e,label:this.Ms,style:void 0}),this.Ji.push(t),t.onDispose((()=>{const e=this.Ji.indexOf(t);e>=0&&this.Ji.splice(e,1)})),this}ks(){return this.bs}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}offDispose(t){return this.L.off(t,"dispose")}}class Hi extends Yi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Ts=t,this.axis=s,this.ft=r,this.Fs=n,this.Is()}}const Xi=t=>{const e=t.length;if(e>0){let i=0,s=0;for(let r=0;r{const e=t.length,i=new Array(e).fill(!1),s=(s,r)=>{for(let n=0;n=this.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)}}},$i=class{constructor(t,e,i,s=1,r=100){this.zs=t,this.Vs=e,this.Os=i,this.Ns=s,this.Gs=r}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=Xi(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Qi{constructor(t,e){this.Xs=t,this.js=e,this.Zs=e.rows*Rs,this.Qs=e.columns*Is}}var ts,es;e.OnScreenMenuButtonType=void 0,(ts=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[ts.ZoomIn=0]="ZoomIn",ts[ts.ZoomInX=1]="ZoomInX",ts[ts.ZoomInY=2]="ZoomInY",ts[ts.ZoomOut=3]="ZoomOut",ts[ts.ZoomOutX=4]="ZoomOutX",ts[ts.ZoomOutY=5]="ZoomOutY",ts[ts.ZoomToFit=6]="ZoomToFit",ts[ts.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(es=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[es.Circle=0]="Circle",es[es.Rectangle=1]="Rectangle",es[es.RoundedRectangle=2]="RoundedRectangle";const is={x:-43,y:0},ss={x:-65,y:0},rs={x:-86,y:0},ns={x:-107,y:-1},os={x:-128,y:-3},hs={x:-150,y:0},as={x:-171,y:0},ls={x:-276,y:0},us={x:-298,y:0},cs={x:0,y:0},ds={x:-21,y:0};class fs extends Qi{constructor(t,e,i,s){super(t,i),this.Js=bt.document.createElement("button"),this.Ks=bt.document.createElement("div"),this.qs=bt.document.createElement("label"),this.js=i,this.te=e,this.Ki=s}ie(t,e,i,s){this.se(t,s),this.ee(),this.he(e),this.re(),this.qs.textContent=i||"";const r=bt.document.createElement("div");this.ne(r),this.Js.onclick=this.onClick.bind(this),r.appendChild(this.Ks),r.appendChild(this.qs),this.Js.appendChild(r)}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||Fs,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}/${Ds})`,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 gs extends fs{constructor(t,e,i,s){super(t,e,i,s),this.le="",this.ue="",this.ce=!1,this.Ki=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}/${Ds})`,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 ms extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:-1,y:-1})}}class ys extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:-1,y:0})}}class ps extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),hs)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:0,y:-1})}}class xs extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:1,y:1})}}class Ss extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:1,y:0})}}class As extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),as)}onClick(){const t=this.Ki.me();t&&this.Ki.zoom(t,{x:0,y:1})}}class vs extends gs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.le=ls,this.ue=us,this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),this.le)}onToggledStateAction(){this.Ki.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ki.setAnimationsEnabled(!0)}}class bs extends fs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.ie(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){this.Ki.forEachAxis((t=>{t.fit(!0)}))}}class Ms extends fs{constructor(t,e,i){super(t,e.shape||Ls,e.dimensions||{rows:1,columns:1},i);const s=i.getTheme(),r=e.color||s.onScreenMenuBackgroundColor.toRGBAString(),n=e.icon||"",o=e.label||"",h=e.opacity||"";this.ie(r,n,o,h),this.ye=e.action}onClick(){this.ye(this.Ki)}}class Es extends gs{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ki=i,this.Se=s,this.le=ds,this.ue=cs,this.ie(Ps,this.le)}ge(){this.pe(this.le),this.Js.style.backgroundColor=Ps,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 ws;e.MouseStyles=void 0,(ws=e.MouseStyles||(e.MouseStyles={})).Move="move",ws.ResizeColumn="col-resize",ws.ResizeRow="row-resize",ws.Horizontal="ew-resize",ws.Vertical="ns-resize",ws.NorthWest="nw-resize",ws.NorthEast="ne-resize",ws.Copy="copy",ws.CrossHair="crosshair",ws.Default="default",ws.Help="help",ws.Restricted="not-allowed",ws.None="none",ws.Point="pointer",ws.Text="text",ws.Wait="wait",ws.ZoomIn="zoom-in",ws.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)},ks=new G({color:E(255,255,255,0)}),Cs=new Ji({thickness:1,fillStyle:ks}),Rs=60,Is=60,Fs="1.0",Ds="osm/osm-sprite-transparent.png",Ls=e.OnScreenMenuButtonShape.Circle,Ps="#363636";var _s;e.OSMPosition=void 0,(_s=e.OSMPosition||(e.OSMPosition={}))[_s.TopRight=0]="TopRight",_s[_s.TopLeft=1]="TopLeft",_s[_s.BottomLeft=2]="BottomLeft",_s[_s.BottomRight=3]="BottomRight";class Vs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Ms="Band",this.ve=0,this.xe=0,this.be=this.ts.bandFillStyle,this.Me=this.ts.bandStrokeStyle,this._e=!0,this.we=this.Ts.Te(this.ft).ke(this.be).Ce(this.Me).ds(this.getHighlight()),this.fs(this.we)}setValueStart(t){return this.ve=t,this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs(),this}getValueStart(){return this.ve}setValueEnd(t){return this.xe=t,this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs(),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.vs(),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.vs(),this}getStrokeStyle(){return this.Me}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}Fe(){return this.we.Ie(this.Fs.toVec2(this.ve,this.Fs.getHeight(this.ft).getInnerStart())).tt(this.Fs.toVec2(this.xe-this.ve,this.Fs.getHeight(this.ft).getInnerInterval())),this}attach(t,e=!0,i=!1){return super.attach(t,e),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}Pe(t,e){t.ds(e),this.Ts.vs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){let t,i;const s=(e,s)=>{if(!this._e)return;const r=dt(this.Ts.cs.De(s.x,s.y),this.Ts.cs.ft,this.ft),n=this.Fs.getWidth(r),o=this.axis.ft.dt(this.ve),h=this.axis.ft.dt(this.xe),a=(this.axis.ft.dt(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{if(!this._e)return;const h=this.Fs.getWidth(n);t?(this.ve=this.axis.ft.mi(this.ve,h),this.xe=this.axis.ft.mi(this.xe,h)):i?this.ve=this.axis.ft.mi(this.ve,h):this.xe=this.axis.ft.mi(this.xe,h),Zt(o),this.L.emit("valueChange",this,this.ve,this.xe),this.Ts.vs()};this.onMouseMove(((i,r)=>{if(!this._e)return;s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ki.engine.setMouseStyle(n,this.Be)})),this.onMouseLeave((()=>{this._e&&(this.Ki.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((t,e,i,s,n)=>{this._e&&0===i&&r(0,0,0,n,e)}));const n=Wi(new $i(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Bs extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Ms="Constant Line",this.S=0,this.Me=this.ts.constantLineStrokeStyle,this.Le=!0,this._e=!0,this.Re=this.Ts.ze(this.ft).Ee(this.Me).ds(this.getHighlight()),this.fs(this.Re)}setValue(t){return this.S=t,this.L.emit("valueChange",this,this.S),this.Ts.vs(),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.vs(),this}getStrokeStyle(){return this.Me}setInteractionMoveByDragging(t){return this.Le=t,this}getInteractionMoveByDragging(){return this.Le}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}Fe(){return this.Re.Oe(this.Fs.toVec2(this.S,this.Fs.getHeight(this.ft).getInnerStart())).Ve(this.Fs.toVec2(this.S,this.Fs.getHeight(this.ft).getInnerEnd())),this}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.Me}),this}Pe(t,e){t.ds(e),this.Ts.vs()}setDefaultMouseInteractions(t){return this._e=t,this}Is(){const t=(t,e)=>{this._e&&this.Le&&(this.S=this.axis.ft.mi(this.S,this.Fs.getWidth(e)),this.L.emit("valueChange",this,this.S),this.Ts.vs(),Zt(t))};this.onMouseMove((()=>{if(this._e&&this.Le){const t=this.Fs.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Be=this.Ki.engine.setMouseStyle(t,this.Be)}})),this.onMouseLeave((()=>{this._e&&this.Le&&(this.Ki.engine.restoreMouseStyle(this.Be),this.Be=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this._e&&this.Le&&0===s&&t(i,n)}));const i=Wi(new $i(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const zs={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?zs.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:zs.progressive.start(t,e,i,s)+(e-t),allowIntervalLengthChange:!1},regressive:{start:(t,e,i,s)=>e>t?ie>t?zs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ne,Us=t=>void 0!==t.Ge,Gs={We:Ii.Numeric},Ys=(t,e)=>[t,e],Hs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Ct(t,0)&&(t=0),Ct(e,0)&&(e=0);const n=[];let o=void 0!==s?((t,e,i)=>t-(t-i)%e)(t,i,s):t;if(i<=0)throw new Error(`_getRegularGreatKeyValues unit less than or equal to 0, unit: ${i}`);for(;o{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r},js=(t,...e)=>{const i=e.length>0?e.length:t?1:0;return(s,r,n,o,h,a)=>{if(r>=i)return;const l=e[r]||1;let u=!1,c=!1,d=1;return t&&(u="ignore"in t?"first"===t.ignore||"both"===t.ignore:u,c="ignore"in t?"last"===t.ignore||"both"===t.ignore:c,d="offset"in t&&void 0!==t.offset?t.offset:d),((t,e,i,s,r)=>(i&&(t=t.filter(((t,e)=>e>0))),s&&(t=t.filter(((e,i)=>i(i+r)%e==0))))(s,l,u,c,d)}},$s=(...t)=>{const e=t.length>0?t.length:0;return(i,s,r,n,o,h)=>{if(s>=e)return;const a=t[s]||1;return i.filter(((t,e)=>e%a==0))}},Zs=(t,e)=>{if(e.has(t))return e.get(t);const i=Ze(t.Ye.Ue());if(pe(i))return i;const s=t.He.mi(i.min,{x:-5,y:-5}),r=t.He.mi(i.min,{x:5,y:5}),n=t.He.mi(i.max,{x:-5,y:-5}),o=t.He.mi(i.max,{x:5,y:5}),h={min:{x:Math.min(s.x,r.x,n.x,o.x),y:Math.min(s.y,r.y,n.y,o.y)},max:{x:Math.max(s.x,r.x,n.x,o.x),y:Math.max(s.y,r.y,n.y,o.y)}};return e.set(t,h),h},Ks=t=>{const e=new Map;if(t!==Gs){for(const i of t.$e)e.set(i,new Map);for(const i of t.Xe)e.set(i,new Map)}return e};class Js{constructor(t,e,i,s,n,o,h){this.L=new r.Eventer,this.je=Gs,this.Ze=Ns.Empty,this.Qe=new Map,this.Je=new Map,this.Ke=zs.fitting,this.qe=!0,this.th=K((()=>this.chart.cs.vs()))(300,$.linear),this.ih=!0,this.ji=!0,this.sh=!1,this.eh=Pe,this.hh=!1,this.rh=!1,this.oh=Pe,this.ah=Pe,this.lh=Pe,this.uh=!1,this.dh=()=>{this.sh||void 0===this.Ke||this.chart.cs.vs(!0)},this.fh={},this.Ah=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Qe.get(e),l=(t?t.get(a):void 0)||this.gh(a,e);l.ph=!1;const u=this.mh(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.yh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.xh!==i||!!t.find((t=>t===e)))).map((t=>ze(e,Zs(t,a))?t:void 0)),m=p.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=p.filter((t=>void 0!==t));if(t&&e.every((t=>Os(t.xh)))&&(t=!1),t&&i.bh&&i.bh.Mh&&!1===i.bh.Mh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.je.We(t,this.ft),this._h=!0,this.wh=!0,this.chart=t,this.Ch=e,this.ts=s,this.kh=o,this.ft=i,this.Th=h,"logarithmic"===h.type&&this.setAnimationZoom($.logarithmic(wi(h.base))),this.Fh=o.numeric,this.Ih("Numeric"),this.Ph=i.getInnerStart(),this.Dh=i.getInnerEnd(),this.setAnimationsEnabled(n)}setDefaultInterval(t,e){return this.Bh=t,!1!==(null==e?void 0:e.applyImmediately)&&(this.uh=!0,this.chart.cs.vs()),this}getDefaultInterval(){return this.Bh}getTitle(){return this.Rh.Lh()}setTitle(t){return this.Rh.Eh(t),this.chart.cs.vs(),this}getTitleFillStyle(){return this.Rh.zh()}setIntervalRestrictions(t){return this.Vh=t,this.chart.cs.vs(),this}getIntervalRestrictions(){return this.Vh}setTitleFillStyle(t){return this.Rh.ke(t),this.chart.cs.vs(),this}getTitleFont(){return this.Rh.Oh()}setTitleFont(t){return this.Rh.Nh(t),this.chart.cs.vs(),this}setTitleRotation(t){return this.Rh.Gh(t),this.chart.cs.vs(),this}getTitleRotation(){return this.Rh.Wh()}setTitleEffect(t){return this.Uh.Ss(t),this.chart.cs.vs(),this}getTitleEffect(){return this.Uh.xs()}Ih(t,e){if(this.Qe.size>0&&this.Yh(),"Empty"===t)this.je=Gs,this.Ze=t;else if("Numeric"===t){"Numeric"!==this.Ze&&(this.Fh=this.kh.numeric);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}else if("DateTime"===t){"DateTime"!==this.Ze&&(this.Fh=this.kh.datetime);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}else if("Time"===t){"Time"!==this.Ze&&(this.Fh=this.kh.time);const i=e||(t=>t);this.Fh=i(this.Fh),this.je=this.Fh.Hh(this.Th),this.Ze=t}return this.Je.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Je=Ks(this.je),this.chart.cs.vs(),this}$h(){return this.je}Xh(t){this.je=t,this.Je.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Je=Ks(this.je),this.chart.cs.vs()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.vt(void 0!==e?e:this.Ph,void 0!==i?i:this.Dh,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}vt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=!0,h=Math.abs(e-t);if(Math.abs(this.Dh-this.Ph),void 0!==this.je.jh&&this.je.jh>h){const i=(e+t)/2,s=this.je.jh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.je.Zh&&this.je.Zhe?-1:1);n={start:i-s,end:i+s}}const a=this.ft.ot(n.start,n.end,this.Ph,this.Dh,o);if(!1===a)return this;if(!0===a);else if(n=a,"zoomBandChart"===r)return this;let l;switch(r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":l=!0;break;case"zoomBandChart":case"synchronizedAxis":l=!1;break;default:return be(0,""),this}if(this.Qh&&this.Qh.finishAll(!1),this.th&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Qh||this.Qh.isOver()?this.th:this.Qh.NextAnimation.bind(this);this.Qh=e([[this.Ph,n.start],[this.Dh,n.end]],(([t,e])=>{this.Jh(t,e,o)}),t),this.Qh.onAnimationEnd((()=>{this.Qh=void 0,l&&(this.lh=bt.performance.now())})),this.Qh.onAnimationEnd((()=>this.setStopped(s)))}else this.Jh(n.start,n.end,o),this.setStopped(s),l&&(this.lh=bt.performance.now());return this}getInterval(){return{start:this.Ph,end:this.Dh}}setStopped(t){return t===this.sh||(t&&(this.Qh&&this.Qh.finishAll(!1),this.Qh=void 0),this.sh=t,this.L.emit("stoppedStateChanged",this,this.sh),this.eh=bt.performance.now(),this.chart.cs.vs()),this}getStopped(){return this.sh}onStoppedStateChanged(t){return this.L.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.L.off(t,"stoppedStateChanged")}fit(t,e){const i=this.Kh(),s=this.Bh||ir,r="function"==typeof s?s({curStart:this.Ph,curEnd:this.Dh,dataMin:null==i?void 0:i.min,dataMax:null==i?void 0:i.max}):s;return this.vt(void 0!==r.start?r.start:this.Ph,void 0!==r.end?r.end:this.Dh,void 0!==r.animate?r.animate:void 0===t||t,void 0!==r.stopAxisAfter?r.stopAxisAfter:void 0===e||e,"userFit"),this}setScrollStrategy(t){return this.Ke=t,this.chart.cs.vs(),this}getScrollStrategy(){return this.Ke}setAnimationScroll(t){return this.qe=Boolean(t),this.chart.cs.vs(),this}setAnimationZoom(t,e=300){return this.Qh&&(this.Qh.finishAll(!1),this.Qh=void 0),this.th=t?K((()=>this.chart.cs.vs()))(e,t):void 0,this}setAnimationsEnabled(t){return this.ih=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom($.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.ih}setVisible(t){const e=this.ji!==t;return this.ji=t,this.Rh.setVisible(t),this.qh((e=>{e.Ye.setVisible(t)})),e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onIntervalChange(t){return this.L.on("scaleChange",t)}offIntervalChange(t){return this.L.off(t,"scaleChange")}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}tr(t,e){const i=new Map;if(this.je===Gs||!this.ji)return this.Yh(),i;e=e||new Map;const s=this.ir(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.fh.physicalAxisSize=h;const a=Qs(this.je,r,n,this.Ph,this.Dh,h),l=[];if(this.sr(),l.push(...this.er(this.je,r,n,a,e,t,i)),this.hr(this.je,r,n,a,e,t,l,i),this.rr(),a)for(const[t,e]of this.Je){const i=a.get(t);if(void 0!==i)for(const[t,s]of e)i.includes(t)||(null==s||s.dispose(),e.delete(t))}return this.fh.min=r,this.fh.max=n,this.fh.scaleInterval=o,this.fh.physicalAxisSize=h,i}nr(t){const e=t.xh.ar;t.Ye.Eh(e(t.S,this.ft)).Ds()}lr(t,e){const i=e.ur;t.Ye.ke(i.getLabelFillStyle()).Nh(i.getLabelFont()).Gh(i.getLabelRotation())}gh(t,e){const i=this.Je.get(e);let s=i.get(t);s?(i.delete(t),s.xh=e,s.ys(!0)):s=this.cr(t,e);const r=this.Qe.get(e)||new Map;return r.set(t,s),this.Qe.set(e,r),this.lr(s,e),s}mh(t,e){const i=this.dr(t,e);return this.nr(t),i}er(t,e,i,s,r,n,o){const h=[];for(const a of t.$e){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Qe.get(a),l=(t?t.get(s):void 0)||this.gh(s,a),u=this.mh(l,n),c=Zs(l,r);h.find((t=>ze(c,Zs(t,r))))&&l.Ye.setVisible(!1),l.ph=!1,o.set(l,u),h.push(l)}}return h}hr(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Xe){const t=s.get(u);if(!t)break;let c;if(void 0===a)c=[{start:e,end:i,keyValues:t}];else{c=[];for(let e=0;e=i&&e0){if(void 0===u.bh){p=!1;break}const t=u.bh.Ar;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const y=this.yh(m.filter((t=>a.some((e=>Ct(t.S,e))))),g,u,d,n,h,e,i,r,o,l);!0!==y?t=t.concat(y):(d+=1,f=-1,t=[])}y=t,m.forEach((e=>{t.find((t=>t===e))||this.gr(e)}))}if(l=y,!p)break}}gr(t){const e=this.Qe.get(t.xh);null==e||e.delete(t.S);const i=this.Je.get(t.xh);i&&i.has(t.S)?t.dispose():i&&(t.ys(!1),i.set(t.S,t))}qh(t){for(const e of this.Qe.values())for(const i of e.values())t(i)}pr(t,e){for(const i of this.Qe.values())for(const s of i.values())e=t(e,s);return e}Yh(){this.Qe.forEach(((t,e)=>{t.forEach((t=>this.gr(t)))})),this.Qe.clear()}sr(){for(const t of this.Qe.values())for(const e of t.values())e.ph=!0}rr(){for(const t of this.Qe.values())for(const[e,i]of t.entries())i.ph&&(i.dispose(),t.delete(e))}ir(){const t=this.ft.getInnerStart()this.ft.getInnerStart()?this.ft.getInnerEnd():this.ft.getInnerStart();return m(t,e)}Sh(t,e){return!(t.ph||0===t.Ye.Lh().length||Os(e)&&!0!==e.mr)}yr(t,e){return this.je===Gs||(this.je.$e.forEach((i=>{e=t(e,i.ur)})),this.je.Xe.forEach((i=>{(t=>void 0!==t.ar)(i)&&(e=t(e,i.ur))}))),e}Kh(){let t=this.Ch.Sr();const e=this.Ch.vr();let i;if(void 0!==t&&Et(t)&&void 0!==e&&Et(e)&&("logarithmic"===this.Th.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&&Et(i.min)&&Et(i.max))return Ct(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}br(){if(!this._h)return 0;let t=0;const e=this.Ch.Mr();return e&&(t=Math.max(t,e)),t}setAutoRegionsEnabled(t){return this._h=t,this.chart.cs.vs(),this}_r(){var t;const e=this.hh;let i=!1;if(this.uh&&this.Bh){const t=this.Kh(),e="function"==typeof this.Bh?this.Bh({curStart:this.Ph,curEnd:this.Dh,dataMin:null==t?void 0:t.min,dataMax:null==t?void 0:t.max}):this.Bh;this.setInterval(e),this.uh=!1}if(this.Ke&&!this.sh){const e=this.Kh();if(e){const s=this.Ph,r=this.Dh;let n=this.Ke.start(s,r,e.min,e.max),o=this.Ke.end(s,r,e.min,e.max);const h=null===(t=this.Ke.allowIntervalLengthChange)||void 0===t||t,a=er(this.Vh,e,{start:n,end:o},{start:s,end:r},h);n=a.start,o=a.end;const l=!1===Ct(s,n),u=!1===Ct(r,o);if(n=l?n:s,o=u?o:r,l||u){let t=!1;if(this.qe&&!this.wh)if(this.qe){t=!0;const e=l?this.wr(s,n):s,a=u?this.wr(r,o):r;if(!0===this.Jh(e,a,h)&&(l&&!1===Ct(e,n)||u&&!1===Ct(a,o))){this.chart.cs.vs(!0),i=!0;let t=Math.abs(o-n)/Math.abs(e-a);t<1&&(t=1/t),this.rh=t>=1.4}}else t=!1;t||this.Jh(n,o,h),this.wh=!1}}}return i?(this.hh!==i&&(this.hh=i,this.oh=bt.performance.now()),this.Cr&&(clearTimeout(this.Cr),this.Cr=void 0)):!0===e&&void 0===this.Cr&&(this.rh=!1,this.Cr=setTimeout((()=>{!1!==this.hh&&(this.hh=!1,this.oh=bt.performance.now()),this.Cr=void 0,this.chart.cs.vs()}),200)),this}Jh(t,e,i){let s={start:t,end:e},r=!0;if(this.Vh){const t=this.Kh();s=er(this.Vh,t,s,{start:this.Ph,end:this.Dh},i)}const n=Math.abs(e-t),o=Math.abs(this.Dh-this.Ph);if(void 0!==this.je.jh&&this.je.jh>n){const n=(e+t)/2,h=(i?this.je.jh/2:o/2)*(t>e?-1:1);s={start:n-h,end:n+h},r=!1}if(void 0!==this.je.Zh&&this.je.Zhe?-1:1);s={start:n-h,end:n+h},r=!1}let h=this.ft.ot(s.start,s.end,this.Ph,this.Dh,i);if(!1===h)return!1;!0!==h&&(s=h);const a=this.br(),l=this.kr(Math.min(s.start,s.end),Math.max(s.start,s.end),a);return h=this.ft.ot(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min,this.Ph,this.Dh,!1),!!h&&(!0===h?this.ft.K(s.end>s.start?l.min:l.max,s.end>s.start?l.max:l.min):this.ft.K(s.start,s.end),this.Ph=s.start,this.Dh=s.end,this.L.emit("scaleChange",this,s.start,s.end),this.ah=bt.performance.now(),this.chart.cs.vs(),r)}Tr(){return this.hh}Fr(){return void 0!==this.Qh}}class qs{constructor(t,e,i,s,r=i.Dr(s).Pr(Re).Ir(Re).setMouseInteractions(!1)){this.ph=!1,this.Xi=!1,this.ss=[],this.xh=t,this.S=e,this.Br=i,this.He=s,this.Ye=r,this.ss.push(r)}ys(t){this.ss.forEach((e=>e.setVisible(t)))}dispose(){return this.Xi||(this.Xi=!0,this.ss.forEach((t=>t.dispose()))),this}}const Qs=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.$e){let t=n.Lr(e,i,s,r);t=tr(t),o.set(n,t)}let h;for(const s of t.Xe){let t;if(void 0===h)t=s.Lr(e,i,e,i);else{let r=[];const o=h.filter((t=>e<=t&&t<=i)).length;if(o>0){const t=n/(o-1);if(void 0!==s.Rr&&s.Rr>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),er=(t,e,i,s,r)=>{const n="function"==typeof t?t({curStart:s.start,curEnd:s.end,dataMin:null==e?void 0:e.min,dataMax:null==e?void 0:e.max}):t;if(!n)return i;const o={start:i.start,end:i.end};let h=Math.abs(i.end-i.start);if(void 0!==n.intervalMin&&hn.intervalMax){const t=(o.start+o.end)/2;o.start=t+.5*Math.sign(i.start-t)*n.intervalMax,o.end=t+.5*Math.sign(i.end-t)*n.intervalMax}return h=Math.abs(i.end-i.start),void 0!==n.startMin&&(o.start=Math.max(o.start,n.startMin),r||Ct(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.startMax&&(o.start=Math.min(o.start,n.startMax),r||Ct(Math.abs(o.start-o.end),h)||(o.end=o.start+Math.sign(i.end-i.start)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMin&&(o.end=Math.max(o.end,n.endMin),r||Ct(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),h=Math.abs(i.end-i.start),void 0!==n.endMax&&(o.end=Math.min(o.end,n.endMax),r||Ct(Math.abs(o.start-o.end),h)||(o.start=o.end+Math.sign(i.start-i.end)*h)),o},ir=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}},sr=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class rr extends sr{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 nr=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),or=new rr,hr=new class{getFillStyle(){return z}},ar=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new G,wireframeStyle:ot});class lr extends ar{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 ur=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),cr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new G});class dr extends cr{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 fr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),gr={Triangulated:lr,Pixelated:dr};class mr{constructor(t){this.Er=new Map,this.cs=t}ls(t,e,i){const s=i.animationEnabled;this.Er.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Er.delete(t),t.offDispose(r)}))}zr(t,e){let i=e.animationEnabled;const s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Er.delete(t)})),t.offDispose(r)}));return{Vr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Er.set(t,r)},Or:()=>{s.forEach((t=>{this.Er.delete(t)})),s.length=0},Nr:t=>{i=t,s.forEach((t=>{this.ws(t,i)}))},Gr:()=>i}}_s(t,e){const i=this.Er.get(t);i&&(i.curUnanimatedHighlightValue=Ae(e),this.cs.vs())}gs(t,e=!1){const i=this.Er.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}ws(t,e){const i=this.Er.get(t);i&&(i.animationEnabled=e)}Cs(t){const e=this.Er.get(t);return!!e&&e.animationEnabled}Ds(t){let e=!1;this.Er.forEach(((i,s)=>{let r;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const n=i.curAnimationPositionMillis/s;r=i.curUnanimatedHighlightValue*Math.abs(Math.sin(n*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(r=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||r>0):r=0,i.curAnimationPositionMillis=0}else r=i.curUnanimatedHighlightValue;r!==i.curAnimatedHighlightValue&&(i.applyHighlight(r),i.curAnimatedHighlightValue=r)})),e&&this.cs.vs(!0)}}const yr=new Map,pr=(t,e)=>{const i=t.getSize(),s=t.getFamily(),r=t.getWeight(),n=t.getStyle(),o=t.getVariant(),h=`${n} ${o?"small-caps":"normal"} ${r} ${i}px ${s}`,a=`${h} ${e.toFixed(2)}`;let l=yr.get(a);return l||(l=((t,e,i,s)=>({font:t,properties:e,dpr:i,id:s}))(h,{type:"font",size:i,family:s,style:n,variant:o,weight:r},e,a),yr.set(a,l)),l};var xr,Sr;!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"}(xr||(xr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(Sr||(Sr={}));const Ar=t=>({container:t.Wr,scale:t.ft,setMouseStyle:(e,i)=>t.Ur(e,i),restoreMouseStyle:e=>t.Yr(e),clientLocation2Engine:(e,i)=>t.De(e,i),engineLocation2Client:(e,i)=>t.Hr(e,i),captureFrame:(e,i,s)=>t.$r(e,i,s),renderFrame:(e,i,s=!1)=>t.Xr(e,i,s),layout:()=>{t.jr(),t.Zr(),t.Jr.Qr(),t.vs()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Kr(e,i),onRenderFrame:e=>t.qr(e),offRenderFrame:e=>t.tn(e)}),vr=[];let br;const Mr=()=>{if(void 0!==br){const t=bt.getComputedStyle(bt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));br.style.height=bt.innerHeight-e+"px",(()=>{for(let t=0;tthis.vs()),60),this.hn=u(0,0),this.rn=!1,this.nn=kt,this.an=()=>{},this.ln=[],this.un=-1,this.cn=[],this.dn=!0,this.Xi=!1,this.fn=!1,this.Zr=()=>{const{bottom:t,left:e}=this.Wr.getBoundingClientRect();return this.hn=u(Math.floor(e),Math.floor(t)),this},this.jr=()=>{this.An&&this.An()},this.Ur=(t,e)=>{if(!e){this.Wr.style.cursor=t;const e=this.un;return this.un+=1,this.cn.push([e,t]),e}return this.Yr(e),this.Ur(t)},this.Yr=t=>{const e=t?this.cn.findIndex((e=>e[0]===t)):-1;e>=0?(this.cn.splice(e,1),this.cn.length>0?this.Wr.style.cursor=this.cn[this.cn.length-1][1]:this.Wr.style.cursor="default"):(this.cn.push([0,"default"]),this.Wr.style.cursor="default")},this.gn=t=>(this.pn.M(t),this),this.mn=()=>this.pn._(),this.yn=()=>{this.nn&&this.nn(1e3/60),this.Sn(),this.vn(),this.an&&this.an()},this.xn=t=>(this.sn.set(t.bn(),t),this.sn=new Map([...this.sn.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Mn=t=>(this.sn.delete(t),this),this.Z=()=>(this.pn.o=!1,this),this.J=()=>(this.pn.o=!0,this),this._n=t=>{if(!this.dn)return;const e=this.wn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.De(t.clientX,t.clientY),r=this.Cn(t,{x:t.clientX,y:t.clientY});if(this.kn&&((null==r?void 0:r.entity)!==this.kn.entity||r.collectionMember!==this.kn.collectionMember)&&!this.Tn){this.kn.entity.Zi=!1;const e=this.kn.entity.Fn;e&&e(this.kn.entity,t,this.kn.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.Tn)if(r.entity.Zi){if(!i){const e=r.entity.In;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Zi=!0;const e=r.entity.Pn;e&&e(r.entity,t,r.collectionMember)}if(this.Tn){const i=this.Tn.entity.Dn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.Tn.entity,t,this.Tn.button,this.Tn.startLocation,s,this.Tn.collectionMember)}this.Bn=t,this.wn=t,this.Ln=s,this.kn=r},this.Rn=t=>{if(this.dn=!1,this.Ln=void 0,this.Bn=t,this.kn&&!this.En&&!this.Tn){this.kn.entity.Zi=!1;const e=this.kn.entity.Fn;e&&e(this.kn.entity,t,this.kn.collectionMember),this.kn=void 0}},this.zn=t=>{if(this.dn=!0,this.Bn=t,this.Tn&&t.buttons<=0){const e=this.Tn.entity.Vn;e&&e(this.Tn.entity,t,this.Tn.button,this.Tn.startLocation,this.Tn.collectionMember),this.Tn=void 0}if(this.En&&t.buttons<=0){const e=this.En.entity.On;e&&e(this.En.entity,t,this.En.collectionMember),this.En=void 0}},this.Nn=()=>this.Ln,this.Jr=t,this.ts=e.theme,this.Gn=i.Gn,this.Wn=i.Wn,this.Un=i.Un,this.Yn={Hn:e&&e.overrideInteractionMouseButtons?e.overrideInteractionMouseButtons:void 0,Xs:e&&void 0!==e.resourcesBaseUrl&&null!==e.resourcesBaseUrl?e.resourcesBaseUrl:`${bt.location.origin}/resources`,$n:!e||!("warnings"in e)||"boolean"!=typeof e.warnings||e.warnings,Xn:(()=>{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})(),jn:void 0===(null==e?void 0:e.interactable)||e.interactable,Zn:void 0===e.textPixelSnappingEnabled||e.textPixelSnappingEnabled};const s=e?e.container:void 0;if(s){if("string"==typeof s){const t=bt.document.getElementById(s);if(!t)throw new Error(`Container "${s}" doesn't exist.`);this.Wr=t}else this.Wr=s;bt.addEventListener("resize",this.jr),this.ln.push((()=>{bt.removeEventListener("resize",this.jr)}))}else{if(void 0===br){const t=bt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",bt.document.body.appendChild(t),br=t,bt.addEventListener("resize",Mr)}let t=1;for(;null!==bt.document.getElementById(`chart-${t}`);)t+=1;this.Wr=bt.document.createElement("div"),this.Wr.id=`chart-${t}`,this.Wr.style.flex="1",this.Wr.style.height="100%",br.appendChild(this.Wr),Mr(),vr.push(this.jr),this.ln.push((()=>{br&&br.removeChild(this.Wr),vr.includes(this.jr)&&vr.splice(vr.indexOf(this.jr),1),0===vr.length&&br&&(bt.document.body.removeChild(br),br=void 0,bt.removeEventListener("resize",Mr))}))}if(bt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Wr&&this.jr()};this.Qn=new bt.ResizeObserver(t.bind(this)),this.Qn.observe(this.Wr)}""===this.Wr.style.position&&(this.Wr.style.position="relative"),this.Wr.style.boxSizing="content-box",this.Wr.addEventListener("fullscreenchange",this.jr),this.Wr.addEventListener("webkitfullscreenchange",this.jr);const n=e?e.maxFps:void 0;this.Jn=n?-1===n?-1:0!==n?1e3/n:0:0;const o=new Map;let h=!1;const a=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":o.set(i.pointerId,s);break;default:o.delete(i.pointerId),h=!1}switch(i.interactions=Array.from(o.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(h=!0)};this.Wr.onwheel=this.Kn(xr.wheel),this.Wr.oncontextmenu=this.Kn(xr.contextmenu),this.Wr.onclick=this.Kn(xr.click),this.Wr.ondblclick=this.Kn(xr.dbclick),this.Wr.onlostpointercapture=()=>{h=!1},this.Wr.ontouchmove=t=>{h&&t.preventDefault()},this.Wr.onpointerover=a(),this.Wr.onpointerenter=a(this.zn),this.Wr.onpointerdown=a(this.Kn(xr.mouseDown),this.qn(Sr.touchStart)),this.Wr.onpointermove=a(this._n,this.qn(Sr.touchMove)),this.Wr.onpointerup=a(this.Kn(xr.mouseUp),this.qn(Sr.touchEnd)),this.Wr.onpointercancel=a(),this.Wr.onpointerout=a(),this.Wr.onpointerleave=a(this.Rn,this.qn(Sr.touchEnd)),bt.addEventListener("scroll",this.Zr,{passive:!0}),this.pn=p(new b({r:0,g:0,b:0,a:0})),this.us=new mr(this)}io(t,e){var i,s,r,n;(null===(i=this.kn)||void 0===i?void 0:i.entity)===t.entity&&this.kn.collectionMember===t.collectionMember&&(this.kn=e),(null===(s=this.so)||void 0===s?void 0:s.entity)===t.entity&&this.so.collectionMember===t.collectionMember&&(this.so=e),(null===(r=this.En)||void 0===r?void 0:r.entity)===t.entity&&this.En.collectionMember===t.collectionMember&&(this.En={...e,event:this.En.event}),(null===(n=this.Tn)||void 0===n?void 0:n.entity)===t.entity&&this.Tn.collectionMember===t.collectionMember&&(this.Tn={...e,button:this.Tn.button,startLocation:this.Tn.startLocation})}eo(){this.fn=!0,this.nn=void 0,this.an=void 0}qr(t){return this.L.on("render",t)}tn(t){return this.L.off(t)}ho(){return this.ro}no(){return this.oo}setBackgroundFillStyle(t){return this.ao.ke(t),this}getBackgroundFillStyle(){return this.ao.zh()}setBackgroundStrokeStyle(t){return this.ao.Ce(t),this}getBackgroundStrokeStyle(){return this.ao.lo()}uo(t){return this.an=t,this}co(t){return this.nn=t,this}do(t){return this.sn.get(t)}fo(){return Array.from(this.sn.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Kn(t){return e=>this.Ao(t,e)}Ao(t,e){if(!this.dn)return;t===xr.contextmenu&&Zt(e);const i=this.De(e.clientX,e.clientY),s=this.Cn(e,{x:e.clientX,y:e.clientY});if(t===xr.mouseUp){if(this.Tn){const t=this.Tn.entity.Vn;if(t&&t(this.Tn.entity,e,this.Tn.button,this.Tn.startLocation,this.Tn.collectionMember),(null==s?void 0:s.entity)!==this.Tn.entity||s.collectionMember!==this.Tn.collectionMember){this.Tn.entity.Zi=!1;const t=this.Tn.entity.Fn;t&&t(this.Tn.entity,e,this.Tn.collectionMember)}this.Tn=void 0}if(this.En){const t=this.En.entity.getMouseInteractions()&&this.En.entity.On;t&&t(this.En.entity,e,this.En.collectionMember),this.En=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===xr.click?s.entity.po:t===xr.dbclick?s.entity.mo:t===xr.mouseDown?s.entity.yo:t===xr.wheel?s.entity.So:t===xr.contextmenu?s.entity.vo:void 0;if(i&&i(s.entity,e,s.collectionMember),t===xr.mouseDown){this.En={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.En.event.button,i=s.entity.xo;i&&i(s.entity,e,t,s.collectionMember),this.Tn={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.Bn=e,this.Ln=i,this.kn=s}qn(t){return e=>this.bo(t,e)}bo(t,e){const i=e.interactions.length;if(this.Mo=e,this.so){const s=t===Sr.touchMove?this.so.entity._o:t===Sr.touchEnd?this.so.entity.wo:t===Sr.touchStart?this.so.entity.Co:void 0;s&&s(this.so.entity,e,this.so.collectionMember),t===Sr.touchEnd&&0===i&&(this.so.entity.Zi=!1,this.so=void 0)}else if(t===Sr.touchStart){for(let t=0;t{t()})),this.ln.length=0}}De(t,e){return u(t-this.hn.x,this.hn.y-e)}Hr(t,e){return u(t+this.hn.x,this.hn.y-e)}Do(t){const e=this.De(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}Bo(t){const e=this.Hr(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const kr=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x+n;for(;ls&&(s=e[l].y),e[l].y({type:"horizontalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.x),o=e.length,h=[];let a=0,l=0,c=e[0].x-n;for(;lc&&l=c;)e[l].y>s&&(s=e[l].y),e[l].y({type:"verticalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y+n;for(;ls&&(s=e[l].x),e[l].x({type:"verticalRegressive",packager:(e,i,s)=>{if(e.length>1){const r=ni(i,s*t),n=Math.abs(r.y),o=e.length,h=[];let a=0,l=0,c=e[0].y-n;for(;lc&&l=c;)e[l].x>s&&(s=e[l].x),e[l].x{const e="nearest"===t?Lr.Nearest:"nearest-x"===t?Lr.NearestX:"nearest-y"===t?Lr.NearestY:void 0;return void 0!==e?e:Lr.NearestX},_r=(t,e,i,s,r,n,o,h,a,l)=>{const u=t.length;if(0===u)return;const c=s?1:0,d=u-(r?2:1);if(i===Lr.Nearest)return Vr(t,e,n,o,c,d);if(i===Lr.NearestX||i===Lr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Lr.NearestX||"y"===a&&i===Lr.NearestY))return Nr(t,dt(e,o,n),a,l,c,d);if(i===Lr.NearestX)return Br(t,dt(e,o,n),h,c,d);if(i===Lr.NearestY)return zr(t,dt(e,o,n),h,c,d)}},Vr=(t,e,i,s,r,n)=>{let o,h=Number.MAX_VALUE;for(let a=r;a<=n;a+=1){const r=t[a];if(!Number.isNaN(r.x)&&!Number.isNaN(r.y)){const t=dt(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(e))return m;y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Le,s=m{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),y=n,p=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,y),p=Math.floor((g+y)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};y=Math.max(m-1,g),p=Math.floor((g+y)/2)}if(p===m){if(i*(s?-1:1)<0&&m>r){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.L.on("dispose",t),this.offDispose=t=>this.L.off(t,"dispose"),this.cs=t,this.Oo=e,this.No=i,this.Go=Ur,Ur+=1,this.Wo=t.ts.highlightColorOffset}Uo(t){return void 0!==this.No.find((e=>e.type===t))}Yo(t,e){var i;return!!this.Uo(t)&&!0===e(null===(i=this.No.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.Xi||(this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Xi=!0,this.Oo(this),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}setVisible(t){const e=this.ji;return this.ji=t,!t&&e&&(this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Zi=!1),this}getVisible(){return this.ji}setMouseInteractions(t){const e=this.Lo._();return this.Lo.M(t),t||(e&&this.Zi&&this.Fn&&this.Fn(this,void 0,void 0),this.Zi=!1),this}getMouseInteractions(){return this.Lo._()}getIsUnderMouse(){return this.Zi}getIsGrabbed(){return this.Eo}setMouseMoveEventHandler(t){return this.In=t,this}setMouseEnterEventHandler(t){return this.Pn=t,this}setMouseLeaveEventHandler(t){return this.Fn=t,this}setMouseClickEventHandler(t){return this.po=t,this}setMouseDoubleClickEventHandler(t){return this.mo=t,this}setMouseDownEventHandler(t){return this.yo=t,this}setMouseUpEventHandler(t){return this.On=t,this}setMouseWheelEventHandler(t){return this.So=t,this}setMouseContextMenuEventHandler(t){return this.vo=t,this}setMouseDragEventHandler(t){return this.Dn=t,this}setMouseDragStartEventHandler(t){return this.xo=t,this}setMouseDragStopEventHandler(t){return this.Vn=t,this}setTouchStartEventHandler(t){return this.Co=t,this}setTouchMoveEventHandler(t){return this._o=t,this}setTouchEndEventHandler(t){return this.wo=t,this}Ho(t){return this.zo=t,this}$o(){return this.zo?this.zo:Yr}ds(t){return this.Vo=t,this}Xo(){return this.Vo}jo(t){return this.Wo=t,this}Zo(){return this.Wo}}const Yr=m(u(0,0),u(0,0));class Hr extends Gr{constructor(t,e,i,s){super(t,i,s),this.Qo=0,this.Ts=e,this.Ts.Jo=!0}Ko(t){return this.Qo===t||(this.Qo=t,this.Ts.Jo=!0),this}qo(){return this.Qo}}class Xr extends Hr{constructor(t,e,i,s,r){super(t,e,s,r),this.ta=!0,this.ft=i}}const Wr=(t,e,i)=>{if(i instanceof _i){const s=i.Ui(),r=ai(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.mi(u(t.min.x,t.min.y),ni(e,-1)),i.mi(u(t.max.x,t.max.y),e))},jr=(t,e)=>"function"==typeof e?e(t):e,$r=(t,e)=>!t||t!==e,Zr=t=>t!==z;class Kr extends Xr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.be=wr.fillStyle,this.cs=t}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}ia(){return $r(this.sa,this.be)}ea(){return((t,e)=>t===z&&e!==z)(this.sa,this.be)}ha(){return Zr(this.be)}ra(t){this.sa=t}}class Jr extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Me=wr.lineStyle,this.cs=t}Ce(t){return this.Me="function"==typeof t?t(this.Me):t,this}lo(){return this.Me}na(){return!this.oa||this.oa!==this.Me}aa(t){return!this.oa||this.oa.getThickness()!==t}ha(){return this.Me!==ot||super.ha()}ea(){return(this.Me!==ot||this.be!==z)&&this.oa===ot&&this.sa===z}la(t){this.oa=t}}class qr extends Kr{constructor(t,e,i,s,r,n=p(5)){super(t,e,i,s,r),this.size=p(5),this.size=n}tt(t){return this.size.M(t),this}}class Qr extends Kr{constructor(t,e,i,s,r,n=p(wr.font)){super(t,e,i,s,r),this.ua=p(""),this.ca=p(u(0,0)),this.da=p(0),this.fa=p(0),this.Aa=p(u(0,0)),this.ga=p(0),this.pa=p(or),this.ma=u(0,0),this.jt=p(x(1,1,1,1)),this.ya=p(S(4,4,4,4)),this.font=p(wr.font),this.Sa=!1,this.font=n}ha(){return Zr(this.be)&&this.ua._().length>0}ea(){return!1===this.Sa&&this.ha()}Eh(t){return this.ua.M(t),this}Lh(){return this.ua._()}Nh(t){return nr(t)?this.pa.M(t):this.pa.M(t(this.pa._())),this}Oh(){return this.pa._()}va(t){return this.pa.M(this.pa._().setFamily(t)),this}xa(){return this.pa._().getFamily()}ba(t){return this.pa.M(this.pa._().setSize(t)),this}Ma(){return this.pa._().getSize()}_a(t){return this.pa.M(this.pa._().setWeight(t)),this}wa(){return this.pa._().getWeight()}Ca(t){return this.pa.M(this.pa._().setStyle(t)),this}ka(){return this.pa._().getStyle()}Ta(t){return this.pa.M(this.pa._().setVariant(t)),this}Fa(){return this.pa._().getVariant()}Ie(t){return this.ca.M(t),this}Ia(){return this.ca._()}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}Pa(t,e){return this.Aa.M(u(t,e)),this}Da(){return this.Aa._()}Ba(t){return this.fa.M(t),this}La(){return this.fa._()}Ra(t){return this.da.M(t),this}Ea(){return this.da._()}za(t){return this.fa.M(t.x),this.da.M(t.y),this}Ir(t){return this.jt.M(t),this}Va(){return this.jt._()}Pr(t){return this.ya.M(t),this}Oa(){return this.ya._()}}class tn extends qr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,p(o)),this.Na=[],this.Ga=p(e.PointShape.Square),this.ga=p(0),this.Wa=p(!1),this.Ua=p(!1),this.Ya=p(!1),this.Ha=_e,this.$a=0,this.Xa=[],this.ja=0,this.Za=_e,this.Qa=Lr.Nearest,this.Ja=!1,this.Ka=void 0}qa(t){return this.Qa=t,this}tl(){return this.Xa}il(){return this.Na}sl(t){return this.Ga.M(t),this}el(){return this.Ga._()}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}hl(t){return this.Wa.M(t),this}rl(t){return this.Ua.M(t),this}nl(t){return this.Ya.M(t),this}ol(t,e){return Array.isArray(t)||(t=[t]),this.ja+=t.length,this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.Za&&(this.Za=e?Je(this.Za,e):void 0),this.Ka=void 0,this}Gt(){return this.Ja=!0,this.Na.length=0,this.$a=0,this.Ha=_e,this.Xa=[],this.ja=0,this.Ka=void 0,this}al(){return this.$a}ll(){return this.ja}}class en extends Jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=p(u(0,0)),this.j=p(u(100,100)),this.ga=p(0),this.ma=p(u(0,0)),this.ul=!1}Ds(){return this.cl(),this}Ie(t){const e=this.ca._();return t.x===e.x&&t.y===e.y||(this.ca.M(t),this.cl()),this}Ia(){return this.ca._()}dl(t){const e=this.ca._();return t!==e.x&&(this.ca.M(u(t,e.y)),this.cl()),this}fl(t){const e=this.ca._();return t!==e.y&&(this.ca.M(u(e.x,t)),this.cl()),this}tt(t){const e=this.j._();return t.x===e.x&&t.y===e.y||(this.j.M(u(t.x,t.y)),this.cl()),this}ai(){return this.j._()}Al(t){const e=this.j._();return t!==e.x&&(this.j.M(u(t,e.y)),this.cl()),this}pl(t){const e=this.j._();return t!==e.x&&(this.j.M(u(e.x,t)),this.cl()),this}Gh(t){return this.ga.M(t),this}Wh(){return this.ga._()}ml(t){const e=this.ma._();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.ul=!1,this.cl()):(this.ul=!0,this.ma.M(t))),this}cl(){if(!this.ul){const t=this.ca._(),e=this.j._(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.ma._();i.x===s.x&&i.y===s.y||this.ma.M(i)}}}class sn extends Jr{constructor(){super(...arguments),this.Na=[],this.ca=p(u(0,0)),this.Ha=_e,this.yl=!1}Sl(t){return t=te(t),this.Na=t,this.yl=!0,this}vl(){return this.Na}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}}class rn extends sn{}class nn extends Kr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Ml=new Array,this._l=new Array,this.wl=p({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ha=_e,this.Cl=0,this.kl=!1,this.Xa=[Array(),Array()],this.Tl=!1,this.Fl=(new G).setColor(E(42,171,240)),this.Ja=!1,this.Il=!1,this.Pl=!1}ol(t,e){const i=this.Cl-1,s=i>0&&!this.Tl;let[r,n]=s?[[this.Ml[i]],[this._l[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=ne(r,e,{canReturnB:!0}),n=ne(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Tl?(this.Xa[0]=ne(this.Xa[0],r,{canReturnB:!0}),this.Xa[1]=ne(this.Xa[1],n,{canReturnB:!0})):(this.Xa=[r,n],this.Tl=!0),this.Ha=Je(this.Ha,e||Je(Ze(r),Ze(n))),this}Gt(){return this.Ja=!0,this.Ml.length=0,this._l.length=0,this.Cl=0,this.Ha=_e,this}il(){return[this.Ml,this._l]}tl(){return[this.Xa[0],this.Xa[1]]}Dl(t){return this.wl.M(t),this}Bl(){return this.wl._()}Ll(t){return this.Fl="function"==typeof t?t(this.Fl):t,this}Rl(){return this.Fl}al(){return this.Cl-(Number(this.Il)+Number(this.Pl))}ll(){return this.Xa.length}El(t){return this.Il=t,this}zl(){return this.Il}Vl(t){return this.Pl=t,this}Ol(){return this.Pl}ea(){return this.sa===z&&this.Nl===z&&(this.be!==z||this.Fl!==z)}Gl(t){this.Nl=t}ha(){return this.Fl!==z||super.ha()}ia(){return super.ia()||!this.Nl||this.Nl!==this.Fl}}class on extends Jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=p(u(0,0)),this.Wl=p(0),this.Ii=p(360),this.Ul=p(100),this.Yl=p(100),this.Hl=p(0),this.$l=p(void 0),this.Xl=u(0,0),this.jl=u(0,0),this.Zl=u(0,0)}Ql(){return this.Ul._()}Jl(){return this.Yl._()}Ia(){return this.ca._()}Kl(){return this.Wl._()}Fi(){return this.Ii._()}ql(){return this.Hl._()}tu(){return this.$l._()}iu(){return this.Xl}su(){return this.jl}eu(){return this.Zl}Ie(t){return this.ca.M(t),this}hu(t){return this.Wl.M(t),this}Ve(t){return this.Ii.M(t),this}ru(t){return this.Yl.M(t),this.Ul.M(t),this}nu(t){return this.Ul.M(t),this}ou(t){return this.Yl.M(t),this}au(t){return this.Hl.M(t<0?0:t),this}lu(t){return this.$l.M(void 0!==t&&t<=0?void 0:t),this}}var hn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(hn||(hn={}));class an extends Xr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.uu=wr.lineStyle,this.engine=t}Ee(t){return this.uu=((t,e)=>"function"==typeof e?e(t):e)(this.uu,t),this}cu(){return this.uu}na(){return((t,e)=>!t||t!==e)(this.du,this.uu)}fu(t){return((t,e)=>!t||t.getThickness()!==e)(this.du,t)}ea(){return((t,e)=>t===ot&&e!==ot)(this.du,this.uu)}ha(){return(t=>t!==ot&&t.getFillStyle()!==z)(this.uu)}Au(t){this.du=t}}class ln extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Di=u(0,0),this.Ii=u(0,0),this.gu=!1}M({min:t,max:e}){return t.x===this.Di.x&&t.y===this.Di.y&&e.x===this.Ii.x&&e.y===this.Ii.y||(this.gu=!0,this.Di=t,this.Ii=e),this}Pi(){return this.Di}Fi(){return this.Ii}Oe(t){return t.x===this.Di.x&&t.y===this.Di.y||(this.gu=!0,this.Di=t),this}Ve(t){return t.x===this.Ii.x&&t.y===this.Ii.y||(this.gu=!0,this.Ii=t),this}}class un extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.pu=void 0,this.mu=!1}}class cn extends an{constructor(t,e,i,s,r){super(t,e,i,s,r),this.yu=[],this.Ha=_e,this.Xa=new Array,this.$a=0,this.Qa=Lr.NearestX,this.Ja=!1,this.Su=p(void 0),this.Il=!1,this.Pl=!1}vu(t){return this.Su.M(t),this}xu(){return this.Su._()}tl(){return this.Xa}il(){return this.yu}qa(t){return this.Qa=t,this}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.Ha=_e,this}al(){return this.$a-(Number(this.Il)+Number(this.Pl))}ll(){return this.Xa.length}El(t){return this.Il=t,this}zl(){return this.Il}Vl(t){return this.Pl=t,this}Ol(){return this.Pl}}const dn=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 fn{constructor(){this.ji=!0,this.L=new r.Eventer,this.bu=0,this.Ct=(t,e,i)=>{0===this.bu&&this.L.emit("mouseEnter",this,e),this.bu+=1},this.kt=(t,e,i)=>{this.bu-=1,this.bu<1&&(this.L.emit("mouseLeave",this,e),this.bu=0)},this.Tt=(t,e,i)=>{this.L.emit("mouseClick",this,e)},this.Ft=(t,e,i)=>{this.L.emit("mouseDoubleClick",this,e)},this.It=(t,e,i)=>{this.L.emit("mouseDown",this,e)},this.Pt=(t,e,i)=>{this.L.emit("mouseUp",this,e)},this.Dt=(t,e,i)=>{this.L.emit("mouseMove",this,e)},this.Lt=(t,e,i,s)=>{this.L.emit("mouseDragStart",this,e,i)},this.Bt=(t,e,i,s,r,n)=>{this.L.emit("mouseDrag",this,e,i,s,r)},this.Rt=(t,e,i,s,r)=>{this.L.emit("mouseDragStop",this,e,i,s)},this.Et=(t,e,i)=>{this.L.emit("mouseWheel",this,e)},this.zt=(t,e)=>{this.bu+=1,this.L.emit("touchStart",this,e)},this.Vt=(t,e)=>{this.L.emit("touchMove",this,e)},this.Ot=(t,e)=>{this.bu-=1,this.L.emit("touchEnd",this,e)},this.Mu=t=>(t instanceof Xr?t.setMouseEnterEventHandler(this.Ct).setMouseLeaveEventHandler(this.kt).setMouseClickEventHandler(this.Tt).setMouseDoubleClickEventHandler(this.Ft).setMouseDownEventHandler(this.It).setMouseUpEventHandler(this.Pt).setMouseMoveEventHandler(this.Dt).setMouseDragEventHandler(this.Bt).setMouseDragStartEventHandler(this.Lt).setMouseDragStopEventHandler(this.Rt).setMouseWheelEventHandler(this.Et).setTouchStartEventHandler(this.zt).setTouchMoveEventHandler(this.Vt).setTouchEndEventHandler(this.Ot):(t.onMouseEnter(this.Ct),t.onMouseLeave(this.kt),t.onMouseClick(this.Tt),t.onMouseDoubleClick(this.Ft),t.onMouseDown(this.It),t.onMouseUp(this.Pt),t.onMouseMove(this.Dt),t.onMouseDrag(this.Bt),t.onMouseDragStart(this.Lt),t.onMouseDragStop(this.Rt),t.onMouseWheel(this.Et),t.onTouchStart(this.zt),t.onTouchMove(this.Vt),t.onTouchEnd(this.Ot)),t)}onMouseEnter(t){return this.L.on("mouseEnter",t)}onMouseLeave(t){return this.L.on("mouseLeave",t)}onMouseClick(t){return this.L.on("mouseClick",t)}onMouseDoubleClick(t){return this.L.on("mouseDoubleClick",t)}onMouseDown(t){return this.L.on("mouseDown",t)}onMouseUp(t){return this.L.on("mouseUp",t)}onMouseMove(t){return this.L.on("mouseMove",t)}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}offMouseEnter(t){return this.L.off(t,"mouseEnter")}offMouseLeave(t){return this.L.off(t,"mouseLeave")}offMouseClick(t){return this.L.off(t,"mouseClick")}offMouseDoubleClick(t){return this.L.off(t,"mouseDoubleClick")}offMouseDown(t){return this.L.off(t,"mouseDown")}offMouseUp(t){return this.L.off(t,"mouseUp")}offMouseMove(t){return this.L.off(t,"mouseMove")}offMouseDragStart(t){return this.L.off(t,"mouseDragStart")}offMouseDrag(t){return this.L.off(t,"mouseDrag")}offMouseDragStop(t){return this.L.off(t,"mouseDragStop")}offMouseWheel(t){return this.L.off(t,"mouseWheel")}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}getIsUnderMouse(){return this.bu>0}setVisible(t){const e=this.ji!==t;return this.ji=t,e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}const gn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.mi(t.getPosition(),{x:r!==e.UIDraggingModes.onlyVertical?i.x:0,y:r!==e.UIDraggingModes.onlyHorizontal?i.y:0}),o=t.scale,h=t.getSize(),a=t.getOrigin(),l=o.mi({x:o.x.getInnerStart(),y:o.y.getInnerStart()},ai({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.mi({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},ai({x:(a.x-1)/2,y:(a.y-1)/2},h)),c={x:Math.min(Math.max(n.x,l.x),u.x),y:Math.min(Math.max(n.y,l.y),u.y)};t.setPosition(c),Zt(s)}},mn=(t,e,i,s,r)=>{gn(t,r,e)},yn=(t,e,i,s,r)=>{gn(t,s,r)};class pn extends fn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.Xi=!1,this._u=void 0,this.wu=void 0,this.Cu=dn,this.ku=void 0,this.Lo=!0,this.Tu=()=>{const t="function"==typeof this.Cu?this.Cu(this):this.Cu;t&&(this.wu=this.Ts.cs.Ur(t))},this.Fu=()=>{this.Ts.cs.Yr(this.wu)},this.jt=x(0,0,0,0),this.Ts=t,this.renderingScale=e,this.scale=i,this.Oo=s,this.ts=r,this.Ts.vs(),this.onMouseEnter(this.Tu),this.onMouseLeave(this.Fu),this.onMouseDrag(mn);const n=Wi(new $i(kt,yn,kt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.ts=r}setMouseInteractions(t){return this.Iu().forEach((e=>e.setMouseInteractions(t))),this.Lo=t,this}getMouseInteractions(){return this.Lo}setEffect(t){return this.hs=this.hs||this.Ts.cs.hs.rs(this,{Pu:{shapes:this.Iu()}}),this.hs.Pu.Ss(t),this}getEffect(){return!!this.hs&&this.hs.Pu.xs()}setAutoDispose(t){return this.ku=t,this.Ts.vs(),this}getAutoDispose(){return this.ku}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.jt.left+this.jt.right),this.size.y+(this.jt.bottom+this.jt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.jt="object"==typeof t?A(this.jt,t):{left:t,top:t,right:t,bottom:t},this.Ts.vs(),this}getMargin(){return this.jt}Fe(){if(this.ku){const t=this.size,e=this.renderingScale.ai(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.ku.type&&i.x>=this.ku.maxWidth||"max-height"===this.ku.type&&i.y>=this.ku.maxHeight)&&this.dispose()}return this}Ds(){return this}dispose(){return this.Xi||(this.Ts.vs(),this.Xi=!0,this.Oo(this),this.L.emit("dispose",this),this.Iu().forEach((t=>t.dispose()))),this}setVisible(t){return super.setVisible(t),this.Iu().forEach((e=>e.setVisible(t))),this.Ts.vs(),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setPosition(t){return this.position=t,this.Ts.vs(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.mi(this.position,ai({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.mi(r,ai({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.mi(r,{x:this.jt.left,y:this.jt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.mi(n,ai({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Ts.vs(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this._u=t,this.Ts.vs(),this}getDraggingMode(){return void 0!==this._u?this._u:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Cu=t,this}getMouseStyle(){return this.Cu}}class xn extends pn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.ya=x(),this.Du=0,this.Ts=t,this.Bu=s,this.backgroundElement=new this.Bu(this.Ts,this.renderingScale,this.scale,kt,n),this.Mu(this.backgroundElement)}Iu(){return this.backgroundElement.Iu()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Fe(){return super.Fe(),this.Xi||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.Lu(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.ya="object"==typeof t?A(this.ya,t):{left:t,top:t,right:t,bottom:t},this.Ts.vs(),this}getPadding(){return this.ya}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.ya.left+this.ya.right,i.y+this.ya.bottom+this.ya.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.Ru()+this.backgroundElement.Eu(),i.y+this.backgroundElement.zu()+this.backgroundElement.Vu())),i}getPosition(t=this.origin,i=e.UISpace.Everything){if(i===e.UISpace.Everything)return super.getPosition(t,i);const s=super.getPosition(u(-1,-1),e.UISpace.Everything),r=this.getMargin(),n=this.scale.mi(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.mi(n,ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.mi(n,{x:this.backgroundElement.Ru(),y:this.backgroundElement.zu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.mi(o,ai({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.mi(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.mi(a,ai({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.Du}setHighlight(t){return this.Du=Ae(t),this.backgroundElement.setHighlight(t),this.L.emit("highlight",this,t),this}}const Sn=t=>"setBackground"in t;class An extends fn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.S=0,this.Ou=1,this.Nu=!0,this.Gu=new rr,this.Wu=!0,this.Xi=!1,this.axisScale=s,this.renderingScale=r,this.Uu=o,this.Yu=h,this.Hu=a,this.Oo=l,this.$u=e,this.Xu=i,this.ju=this.Mu(this.$u.ze(this.renderingScale)),this.ts=u,this.Zu=this.Mu(this.Hu.Qu(this.Xu,this.renderingScale,n,kt,this.ts,!1).setOrigin(jt(this.Yu)).setDirection(this.Yu)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Zu.Ju?this.ju.Ee(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Zu.Ju?this.ju.Ee(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Zu.Ju&&this.ju.Ee(u.cursorGridStrokeStyleX)}setValue(t){return this.S=t,this.Xu.vs(),this.L.emit("valueChange",this,this.S),this}getValue(){return this.S}setTextFormatter(t){return this.Ku=t,this.Xu.vs(),this}setTickLength(t){return this.Zu.setPointerLength(t),this.$u.vs(),this}getTickLength(){return this.Zu.getPointerLength()}setTickLabelPadding(t){return this.Zu.setTickLabelPadding(t),this.$u.vs(),this}setTickLabelRotation(t){return this.Zu.setTextRotation(t),this.$u.vs(),this}getTickLabelRotation(){return this.Zu.getTextRotation()}getTickLabelPadding(){return this.Zu.getTickLabelPadding()}setGridStrokeLength(t){return this.Ou=t,this.$u.vs(),this}getGridStrokeLength(){return this.Ou}setGridStrokeStyle(t){return this.ju.Ee(t),this.$u.vs(),this}getGridStrokeStyle(){return this.ju.cu()}dispose(){return this.Xi||(this.Xi=!0,this.ju.dispose(),this.Zu.dispose(),this.Oo(this),this.$u.cs.vs(),this.L.emit("dispose",this)),this}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setMarkerVisible(t){return this.Nu=t,this.Xu.vs(),this}getMarkerVisible(){return this.Nu}setMarker(t){return t(this.Zu),this.Xu.vs(),this}getMarker(){return this.Zu}setMouseInteractions(t){return this.Zu.setMouseInteractions(t),this.ju.setMouseInteractions(t),this}getMouseInteractions(){return this.ju.getMouseInteractions()}setAllocatesAxisSpace(t){return this.Wu=t,this.Xu.vs(),this}getAllocatesAxisSpace(){return this.Wu}isInScale(){return He(this.S,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}}class vn extends An{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,u,a,l),this.qu=!1,this.Oo=a,this.$u=e,this.Xu=i}dispose(){return this.qu=!1,super.dispose()}update(){return this}plot(t,e,i,s,r){if(this.isInScale()&&this.getVisible()&&t){this.qu=!1;const t=ct(this.S,this.axisScale,this.Uu.getWidth(this.renderingScale));this.ju.setVisible(!0).Oe(this.Uu.toPoint(t,e)).Ve(this.Uu.toPoint(t,e-(s+i*this.Ou))),this.Nu?(this.Ku&&this.Zu.setText(this.Ku(this.S,this)),this.Zu.setVisible(!0).setPosition(this.Uu.toPoint(t,r))):this.Zu.setVisible(!1)}else this.ju.setVisible(!1),this.Zu.setVisible(!1);return this.Zu.Ds().Fe(),this}tc(){const t=this.Zu.Ds().getSize();return this.Uu.getHeight(t)}}const bn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),Mn=(t,e)=>(le(t.setButtonSize(e.uiButtonSize),e,!1,{fill:e.uiButtonFillStyle}),t),En=(t,e,i)=>{i&&Sn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},wn={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}},Tn={background:void 0,setBackground(t){return{...this,background:t}}},kn={Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return En(o,r,n),o}},Cn={Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return En(o,r,n),o}};class Rn extends pn{constructor(){super(...arguments),this.ic=!0}Fe(){return super.Fe(),this}setMouseInteractions(t){return this.ic=t,this}getMouseInteractions(){return this.ic}Iu(){return[]}}class In extends Rn{onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}Lu(t){return this.size=t,this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return z}setStrokeStyle(){return this}getStrokeStyle(){return ot}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Fn extends pn{constructor(){super(...arguments),this.L=new r.Eventer,this.Du=0}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}getHighlight(){return this.Du}setHighlight(t){return this.Du=t,this.Iu().forEach((e=>e.ds(t))),this.L.emit("highlight",this,t),this.Ts.vs(),this}}class Dn extends Fn{}class Ln extends Dn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Ts=t,this.Ga=this.Ts.sc(this.renderingScale,hn.Simple).setVisible(!1).ke(z).Ce(ot),this.Mu(this.Ga)}hc(){const t=this.rc();if(t.length>2){const e=Ze(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=oi(t,ni(e.min,-1));return this.scale.mi(this.position,oi(s,ai(ni(oi(this.origin,u(1,1)),-.5),i)))})).map((t=>dt(t,this.scale,this.renderingScale)));this.Ga.Sl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Ga&&this.Ga.setVisible(!1),this.setContentSize(u(0,0))}Fe(){return super.Fe(),this.Xi||this.hc(),this}Ds(){return this.hc(),super.Ds()}setVisible(t){return super.setVisible(t),this.Ga.setVisible(t),this}}const Pn=(t,e,i)=>t*(1-i)+e*i,_n=(t,e,i,s,r)=>{if(void 0===e.value||void 0===i.value||void 0===s.value||void 0===r.value)return;const n=(t.x-i.point.x)/(r.point.x-i.point.x),o=(r.point.y-i.point.y)*n+i.point.y,h=(t.x-e.point.x)/(s.point.x-e.point.x),a=(s.point.y-e.point.y)*h+e.point.y,l=(t.y-a)/(o-a),u=Pn(i.value,r.value,n),c=Pn(e.value,s.value,h);return Pn(c,u,l)},Vn={warm:t=>e=>T(60/(t-1)*e,.8,.8),cold:t=>e=>T(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>T(360/t*e,.8,.8),reverseSpectrum:t=>e=>T(360/t*(t-e),.8,.8),flatUI:t=>e=>T(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return T(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return T(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return T(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return T(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return T(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>T(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return T(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return T(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),T(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return T(0,0,s);const r=e.getR()/255,n=e.getG()/255,o=e.getB()/255,h=Math.max(r,n,o),a=Math.min(r,n,o);let l=0;if(h!==a){const t=h-a;switch(h){case r:l=(n-o)/t+(nr=>n=>T(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Bn([{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=>Bn([{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=>Bn([{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=>Bn([{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=>Bn([{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=>Bn([{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)},Bn=(t,e,i)=>{const s=Nn(e,i),[r,n]=On(s,t),o=zn(t[r]),h=zn(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Pn(o.h,h.h,a),s:Pn(o.s,h.s,a),v:Pn(o.v,h.v,a)};return T(l.h,l.s,l.v)},zn=t=>{const e=(t=>{const e=t.r,i=t.g,s=t.b,r=Math.max(e,i,s),n=Math.min(e,i,s);let o=0;const h=r,a=r-n,l=0===r?0:a/r;if(r===n)o=0;else{switch(r){case e:o=(i-s)/a+(i{const i=e/t;return i<0?0:i>1?1:i},On=(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),Kn={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},Jn=s.Record({type:"linestyle",lineType:"dashed",pattern:Kn.DashedEqual,fillStyle:new G({color:E(255,255,255)}),thickness:1,patternScale:3});class qn extends Jn{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")}O(){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 Qn=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),to=s.Record({type:"icon",width:void 0,height:void 0,nc:void 0,oc:kt,ac:kt});class eo extends to{constructor(t,e,i,s){super({...s,nc:t,oc:e,ac:i})}dispose(){return this.ac(this),this}setWidth(t){const e=this.set("width",t);return this.oc(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.oc(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.oc(i),i}ai(){if(!this.nc)return{x:0,y:0};const t=this.nc.width,e=this.nc.height;if(0===t||0===e)return{x:0,y:0};const i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const io=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),so=s.Record({type:"glow",color:E(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class ro extends so{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 no{constructor(t){this.lc=0,this.uc=0,this.cc=0,this.dc=!1,this.fc=!0,this.Ac=!1,this.gc={warningDisplayed:!1,expandEvents:[]},this.L=new r.Eventer,this.fc=!t||void 0===t.autoSortingEnabled||t.autoSortingEnabled,void 0!==(null==t?void 0:t.dataPattern)&&(this.mc={userSpecified:null===t.dataPattern?void 0:t.dataPattern}),this.yc=void 0!==(null==t?void 0:t.lookupValues)&&t.lookupValues,this.Sc=void 0!==(null==t?void 0:t.colors)&&t.colors,this.vc=void 0!==(null==t?void 0:t.ids)&&t.ids,this.xc=void 0!==(null==t?void 0:t.sizes)&&t.sizes,this.bc=void 0!==(null==t?void 0:t.rotations)&&t.rotations,this.Mc=(null==t?void 0:t.dataStorage)?t.dataStorage:Float64Array,this._c=!1!==(null==t?void 0:t.allowInputModification)}add(t){return Array.isArray(t)?this.appendJSON(t,{x:"x",y:"y"}):this.appendSample(t),this}addArraysXY(t,e){return this.appendSamples({xValues:t,yValues:e}),this}appendJSON(t,e={x:"x",y:"y"}){const i=t.length,s=e.x,r=e.y,n=e.lookupValue,o=e.size,h=e.rotation,a=e.color,l=e.id;let u,c,d,f,g,m,y;if(s){u=new this.Mc(i);for(let e=0;ea-1&&(this.lc=0,this.dc=!0),this.uc=Math.min(this.uc+1,a),this.cc+=1,this}appendSamples(t){const{lookupValues:e,colors:i,ids:s,sizes:r,rotations:n,start:o,step:h}=t;let a=t.offset,l=t.count;const u=t.xValues||t.yValues;if(!u)return this;const c=u.length;if(a=void 0!==a?a:0,l=void 0!==l?l:c-a,l<=0)return this;const d=void 0!==t.offsetLookupValues?t.offsetLookupValues:a,f=void 0!==t.offsetColors?t.offsetColors:a,g=void 0!==t.offsetIds?t.offsetIds:a,m=void 0!==t.offsetSizes?t.offsetSizes:a,y=void 0!==t.offsetRotations?t.offsetRotations:a,[p,x]=this.Bc(l,t.xValues,"x",o,h,a),[S,A]=this.Bc(l,t.yValues,"y",o,h,a),v=this.Pc(i),{samplesCacheX:b,samplesCacheY:M,samplesCacheLookup:E,samplesCacheColors:w,samplesCacheIDs:T,samplesCacheSize:k,samplesCacheRotation:C,maxSampleCount:R,dataPattern:I,incomingDataReplacedCache:F}=this.wc({appendCount:l,...0===x&&0===A&&0===a&&0===d&&0===f&&0===g&&0===m&&0===y?{incomingDataX:p,incomingDataY:S,incomingDataLookup:e,incomingDataIDs:s,incomingDataColors:v,incomingDataSize:r,incomingDataRotation:n}:{}});if(!F&&I&&this.fc&&this.kc&&this.Tc){const t=p[x],i=S[A];if(!this.Fc(I,t,i)&&!this.Ac)return this.Ic(this.kc,this.Tc,co(p,x,x+l),co(S,A,A+l),co(e,d,d+l),co(v,f,f+l),co(s,g,g+l),co(r,m,m+l),co(n,y,y+l),I),this}const D=R-this.lc,L=Math.min(l,D);if(L>0&&(F||(lo(b,p,x,L,this.lc),lo(M,S,A,L,this.lc),e&&E&&lo(E,e,d,L,this.lc),s&&T&&lo(T,s,g,L,this.lc),v&&w&&lo(w,v,f,L,this.lc),r&&k&&lo(k,r,m,L,this.lc),n&&C&&lo(C,n,y,L,this.lc)),this.Dc(this.lc,this.lc+L-1),this.lc+=L,this.lc>R-1&&(this.lc=0,this.dc=!0)),this.uc=Math.min(this.uc+L,R),this.cc+=L,this.Lc(),l-L>0){const t={xValues:p?co(p,x+L,void 0):void 0,yValues:S?co(S,A+L,void 0):void 0,lookupValues:e?co(e,d+L,void 0):void 0,ids:s?co(s,g+L,void 0):void 0,colors:v?co(v,f+L,void 0):void 0,sizes:r?co(r,m+L,void 0):void 0,rotations:n?co(n,y+L,void 0):void 0};this.appendSamples(t)}return this}setSamples(t){return this.clear().appendSamples(t)}fill(t){const e=this.kc||this.Tc;if(!e)return this;const i=e.length;if(void 0!==t.x&&(this.kc=this.kc||new this.Mc(i),this.kc.fill(t.x)),void 0!==t.y&&(this.Tc=this.Tc||new this.Mc(i),this.Tc.fill(t.y)),void 0!==t.lookupValue&&(this.Rc=this.Rc||new Float32Array(i),this.Rc.fill(t.lookupValue)),void 0!==t.color){const e=this.Pc([t.color]);e&&(this.Ec=this.Ec||new Uint32Array(i),this.Ec.fill(e[0]))}return void 0!==t.size&&(this.zc=this.zc||new Float32Array(i),this.zc.fill(t.size)),void 0!==t.rotation&&(this.Vc=this.Vc||new Float32Array(i),this.Vc.fill(t.rotation)),this.L.emit("cleared"),this}alterSamples(t,e){const{xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a}=e;let l=e.offset,u=e.count;const c=i||s||r||n||o||h||a;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,y=void 0!==e.offsetSizes?e.offsetSizes:l,p=void 0!==e.offsetRotations?e.offsetRotations:l,x=this.Pc(n),S=this.cc-1,A=void 0!==this.Oc?Math.max(this.cc-this.Oc,0):0,v=t+u-1,b=Math.max(t,A),M=Math.min(v,S),E=M-b+1;if(this.cc>0&&E>0){const{samplesCacheX:e,samplesCacheY:n,samplesCacheColors:u,samplesCacheIDs:c,samplesCacheLookup:d,samplesCacheSize:S,samplesCacheRotation:v}=this.wc({appendCount:0}),w=e.length;if(void 0!==this.Oc&&this.dc&&this.cc%this.Oc!=0){const A=this.cc-this.cc%this.Oc,E=this.cc-1,T=this.cc-this.uc,k=A-1,C=Math.max(b,T),R=Math.min(M,k)-C+1;if(R>0){const A=C-t,b=oo(C,this.cc,w,this.lc);i&&lo(e,i,l+A,R,b),s&&lo(n,s,l+A,R,b),r&&d&&lo(d,r,f+A,R,b),o&&c&&lo(c,o,m+A,R,b),x&&u&&lo(u,x,g+A,R,b),h&&S&&lo(S,h,y+A,R,b),a&&v&&lo(v,a,p+A,R,b)}const I=Math.max(b,A),F=Math.min(M,E)-I+1;if(F>0){const A=I-t,b=oo(I,this.cc,w,this.lc);i&&lo(e,i,l+A,F,b),s&&lo(n,s,l+A,F,b),r&&d&&lo(d,r,f+A,F,b),o&&c&&lo(c,o,m+A,F,b),x&&u&&lo(u,x,g+A,F,b),h&&S&&lo(S,h,y+A,F,b),a&&v&&lo(v,a,p+A,F,b)}}else{const t=b-A;i&&lo(e,i,l,E,t),s&&lo(n,s,l,E,t),r&&d&&lo(d,r,f,E,t),o&&c&&lo(c,o,m,E,t),x&&u&&lo(u,x,g,E,t),h&&S&&lo(S,h,y,E,t),a&&v&&lo(v,a,p,E,t)}this.L.emit("cleared")}const w=t+u-1-S;if(w>0){const e=M+1-t;this.appendSamples({xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:l+e,offsetLookupValues:f+e,offsetColors:g+e,offsetIds:m+e,offsetSizes:y+e,offsetRotations:p+e,count:w})}return this}alterSamplesByID(t,e){if(!this.vc)throw new Error("LightningChart JS attempted to use alterSamplesByID on DataSetXY that doesn't have IDs enabled.");const i=t.length,s=this.Nc;if(i<=0||!s)return this;const r=(("object"==typeof e.color?this.Pc([e.color]):"number"==typeof e.color?[e.color]:[])||[])[0],n=Array.isArray(e.xValues)?new this.Mc(e.xValues):e.xValues,o=Array.isArray(e.yValues)?new this.Mc(e.yValues):e.yValues,h=Array.isArray(e.yValues)?new Float32Array(e.yValues):e.yValues,a=this.Pc(e.colors),l=Array.isArray(e.sizes)?new Float32Array(e.sizes):e.sizes,u=Array.isArray(e.rotations)?new Float32Array(e.rotations):e.rotations,c=s.length,d=this.uc,f=this.cc-1,g=Math.max(f-d+1,0);for(let d=0;ds[oo(t,this.cc,c,this.lc)])),y=oo(m,this.cc,c,this.lc);s[y]===i&&(void 0!==e.x&&this.kc&&(this.kc[y]=e.x),void 0!==e.y&&this.Tc&&(this.Tc[y]=e.y),void 0!==e.lookupValue&&this.Rc&&(this.Rc[y]=e.lookupValue),void 0!==e.size&&this.zc&&(this.zc[y]=e.size),void 0!==e.rotation&&this.Vc&&(this.Vc[y]=e.rotation),void 0!==r&&this.Ec&&(this.Ec[y]=r),n&&this.kc&&(this.kc[y]=n[d]),o&&this.Tc&&(this.Tc[y]=o[d]),h&&this.Rc&&(this.Rc[y]=h[d]),a&&this.Ec&&(this.Ec[y]=a[d]),l&&this.zc&&(this.zc[y]=l[d]),u&&this.Vc&&(this.Vc[y]=u[d]))}return this.L.emit("cleared"),this}clear(){return this.lc=0,this.uc=0,this.cc=0,this.dc=!1,this.L.emit("cleared"),this}getSampleCount(){return this.uc}getNextSampleIndex(){return this.cc}setMaxSampleCount(t){if("object"==typeof t){this.Gc&&this.offMaxSampleCountExceeded(this.Gc);const e=t.max;this.Gc=this.onMaxSampleCountExceeded(((t,i,s,r)=>{if(void 0!==e&&s>=e)return;let n=2*s;void 0!==e&&(n=Math.min(n,e)),this.setMaxSampleCount(n)})),void 0===this.Oc&&this.setMaxSampleCount(1e5)}else if("number"==typeof t){const e=t;if(void 0!==this.Oc&&this.Oc>e)throw new Error("LightningChart JS | DataSetXY.setMaxSampleCount attempted to shrink data set. This is currently not supported.");if(!this.kc||!this.Tc)return this.Oc=e,this;if(e===this.Oc)return this;if(this.dc&&0!==this.lc)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.Oc=e,this.uct+e.count),0),r=new this.Mc(s),n=new this.Mc(s),o=this.Sc?new Uint32Array(s):void 0,h=this.yc?new Float32Array(s):void 0,a=this.vc?new Uint32Array(s):void 0,l=this.xc?new Float32Array(s):void 0,u=this.bc?new Float32Array(s):void 0;let c=0;for(const t of i)r.set(this.kc.subarray(t.offset,t.offset+t.count),c),n.set(this.Tc.subarray(t.offset,t.offset+t.count),c),this.Sc&&o&&this.Ec&&o.set(this.Ec.subarray(t.offset,t.offset+t.count),c),this.yc&&h&&this.Rc&&h.set(this.Rc.subarray(t.offset,t.offset+t.count),c),this.vc&&a&&this.Nc&&a.set(this.Nc.subarray(t.offset,t.offset+t.count),c),this.xc&&l&&this.zc&&l.set(this.zc.subarray(t.offset,t.offset+t.count),c),this.bc&&u&&this.Vc&&u.set(this.Vc.subarray(t.offset,t.offset+t.count),c),c+=t.count;return{xValues:r,yValues:n,lookupValues:h,colors:o,ids:a,sizes:l,rotations:u}}onMaxSampleCountExceeded(t){return this.L.on("maxSampleCountExceeded",t)}offMaxSampleCountExceeded(t){return this.L.off(t)}Bc(t,e,i,s,r,n){if(void 0===e){const e=this.Cc();r=void 0!==r?r:1,s=void 0!==s?s:e?e[i]+r:0;const n=new this.Mc(t);for(let e=0;et){e=s;break}const l={xValues:i,yValues:s,lookupValues:r,colors:n,ids:o,sizes:h,rotations:a,offset:e};this.Ac=!0,this.appendSamples(l),this.Ac=!1}else{const l=t.length,u=this.uc,f=this.cc-1,g=Math.max(f-u+1,0),m=ao(d,g,f,(e=>t[oo(e,this.cc,l,this.lc)])),y=m-1,p=m+1,x=t[oo(m,this.cc,l,this.lc)],S=p<=this.cc-1?t[oo(p,this.cc,l,this.lc)]:void 0,A=void 0!==S&&S0){const e=void 0!==this.Oc&&this.dc?this.lc:0,i=this.uc-1,s=void 0!==this.Oc&&this.dc?0:void 0,r=void 0!==this.Oc&&this.dc?this.lc-1:void 0,[n,o]=void 0!==s&&void 0!==r&&Math.abs(r-s)>Math.abs(i-e)?[s,r]:[e,i];if(1+o-n>=2){let e,i,s=this.kc[n],r=this.Tc[n];for(let t=n+1;t<=o;t+=1){if(!1!==e){const i=this.kc[t],r=Math.sign(i-s);0!==r&&e&&e.direction!==r?e=!1:0===r||e||(e={direction:r}),s=i}if(!1!==i){const e=this.Tc[t],s=Math.sign(e-r);0!==s&&i&&i.direction!==s?i=!1:0===s||i||(i={direction:s}),r=e}}t=e&&e.direction>0?Dr.ProgressiveX:e&&e.direction<0?Dr.RegressiveX:i&&i.direction>0?Dr.ProgressiveY:i&&i.direction<0?Dr.RegressiveY:void 0,this.mc={autoDetectResult:t},t&&bt.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}Fc(t,e,i){const s=this.Cc();return!s||("ProgressiveX"===t?e>s.x:"RegressiveX"===t?es.y:"RegressiveY"!==t||ii-t.timestamp<5e3)),e>1e3&&this.gc.expandEvents.push({timestamp:i}),this.gc.expandEvents.length>5)return bt.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.gc.warningDisplayed=!0,this.setMaxSampleCount({mode:"auto"}),this.wc(t)}const i=new this.Mc(e);i.set(this.kc),this.kc=i;const s=new this.Mc(e);if(s.set(this.Tc),this.Tc=s,this.yc){const t=new Float32Array(e);this.Rc&&t.set(this.Rc),this.Rc=t}if(this.vc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc),this.Nc=t}if(this.Sc){const t=new Uint32Array(e);this.Ec&&t.set(this.Ec),this.Ec=t}if(this.xc){const t=new Float32Array(e);this.zc&&t.set(this.zc),this.zc=t}if(this.bc){const t=new Float32Array(e);this.Vc&&t.set(this.Vc),this.Vc=t}return this.lc=this.uc,{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:e}}if(i>4*e){const t=new this.Mc(e);t.set(this.kc.subarray(0,this.uc)),this.kc=t;const i=new this.Mc(e);if(i.set(this.Tc.subarray(0,this.uc)),this.Tc=i,this.yc){const t=new Float32Array(e);this.Rc&&t.set(this.Rc.subarray(0,this.uc)),this.Rc=t}if(this.vc){const t=new Uint32Array(e);this.Nc&&t.set(this.Nc.subarray(0,this.uc)),this.Nc=t}if(this.Sc){const t=new Uint32Array(e);this.Ec&&t.set(this.Ec.subarray(0,this.uc)),this.Ec=t}if(this.xc){const t=new Float32Array(e);this.zc&&t.set(this.zc.subarray(0,this.uc)),this.zc=t}if(this.bc){const t=new Float32Array(e);this.Vc&&t.set(this.Vc.subarray(0,this.uc)),this.Vc=t}return{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:e}}return{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:i}}return t.appendCount+this.uc>this.Oc&&this.L.emit("maxSampleCountExceeded",this,this.uc,this.Oc,this.uc+t.appendCount),this.kc=this.kc||new this.Mc(this.Oc),this.Tc=this.Tc||new this.Mc(this.Oc),this.Rc=this.Rc||(this.yc?new Float32Array(this.Oc):void 0),this.Nc=this.Nc||(this.vc?new Uint32Array(this.Oc):void 0),this.Ec=this.Ec||(this.Sc?new Uint32Array(this.Oc):void 0),this.zc=this.zc||(this.xc?new Float32Array(this.Oc):void 0),this.Vc=this.Vc||(this.bc?new Float32Array(this.Oc):void 0),{dataPattern:this.Lc(),samplesCacheX:this.kc,samplesCacheY:this.Tc,samplesCacheLookup:this.Rc,samplesCacheIDs:this.Nc,samplesCacheColors:this.Ec,samplesCacheSize:this.zc,samplesCacheRotation:this.Vc,maxSampleCount:this.Oc}}Hc(){if(!this.kc||!this.Tc||0===this.uc)return;if(void 0===this.Oc)return this.cc>0?{x:this.kc[0],y:this.Tc[0]}:void 0;if(!this.dc)return{x:this.kc[0],y:this.Tc[0]};let t=this.lc-this.uc;return t<0&&(t+=this.Oc),{x:this.kc[t],y:this.Tc[t]}}Cc(){if(!this.kc||!this.Tc||0===this.uc)return;if(void 0===this.Oc){const t=this.uc-1;return t>=0?{x:this.kc[t],y:this.Tc[t]}:void 0}let t=this.lc-1;return t<0&&(t+=this.Oc),{x:this.kc[t],y:this.Tc[t]}}$c(t,e,i,s){const r=this.Lc(),n=this.kc,o=this.Tc;if(!n||!o)return;const h=t=>({x:n[t],y:o[t],lookupValue:this.yc&&this.Rc?this.Rc[t]:void 0,id:this.vc&&this.Nc?this.Nc[t]:void 0,color:this.Sc&&this.Ec?this.Ec[t]:void 0,size:this.xc&&this.zc?this.zc[t]:void 0,rotation:this.bc&&this.Vc?this.Vc[t]:void 0}),a=n.length,l=this.uc,u=this.cc-1,c=Math.max(u-l+1,0);if(r){const i=this.Hc(),s=this.Cc();if(!(i&&s&&this.kc&&this.Tc))return;const n="ProgressiveX"===r||"RegressiveX"===r?"x":"y",o="x"===n?"y":"x",l="x"===n?this.kc:this.Tc,d="x"===o?this.kc:this.Tc,f=t[n],g=Math.min(i[n],s[n]),m=Math.max(i[n],s[n]);if(fm)return;const y=ao(f,c,u,(t=>l[oo(t,this.cc,a,this.lc)])),p=oo(y,this.cc,a,this.lc);if(!e)return h(p);const x=y-1,S=y+1,A=f>=l[p]&&("ProgressiveX"===r||"ProgressiveY"===r)?S<=u?oo(S,this.cc,a,this.lc):void 0:x>=c?oo(x,this.cc,a,this.lc):void 0;if(void 0===A)return;const v=l[p],b=d[p],M=l[A],E=d[A],w=Math.min(v,M),T=w===v?b:E,k=Math.max(v,M),C=Pn(T,k===v?b:E,(f-w)/(k-w));return"ProgressiveX"===r||"RegressiveX"===r?{x:f,y:C}:{x:C,y:f}}let d,f=Number.MAX_VALUE;const g=dt(t,i,s),m=this.uc-1;for(let t=0;t<=m;t+=1){const e=n[t],r=o[t];if(!Number.isNaN(e)&&!Number.isNaN(r)){const n=ct(e,i.x,s.x),o=ct(r,i.y,s.y),h=(n-g.x)**2+(o-g.y)**2;ht%i,ho=(t,e,i,s,r,n,o,h)=>{if(0===s||0===r)return;const a=i.length,l=s-1,u=Math.max(l-r+1,0),c=ao(t,u,l,(t=>i[oo(t,s,a)])),d=ao(e,u,l,(t=>i[oo(t,s,a)])),f=Math.max(c-h,u),g=Math.min(d+h,l),m=oo(f,s,a),y=oo(g,s,a);return m>y?{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:y,dataRanges:[{offset:m,count:a-m},{offset:0,count:y+1}]}:{iFirstSample:f,iLastSample:g,iFirstSampleDataArray:m,iLastSampleDataArray:y,dataRanges:[{offset:m,count:y-m+1}]}},ao=(t,e,i,s)=>{const r=i;for(;e!==i;){const r=Math.ceil((e+i)/2);t{const n=e.length;if(Array.isArray(e))for(let n=0;nvoid 0===t?void 0:Array.isArray(t)?new e(t):t instanceof e?t:new e(t),co=(t,e,i)=>{if(void 0!==t)return Array.isArray(t)?t.slice(e,i):t.subarray(e,i)};class fo extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ua="label",this.Ga=this.Ts.Dr(this.renderingScale).Eh(this.ua).ke(z).Ir(Re).Pr(Re),this.setMargin(5),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}Fe(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=dt(t,this.scale,this.renderingScale);return this.Ga.Ie(i),this}Ds(){this.Ga.Ds();const t=0===this.ua.length?u(0,0):this.Ga.Zc();return this.setContentSize(t),super.Ds()}setText(t){return this.ua=t,this.Ga.Eh(this.ua),this.Ts.vs(),this}getText(){return this.ua}setFont(t){return this.Ga.Nh(t),this.Ts.vs(),this}getFont(){return this.Ga.Oh()}setTextRotation(t){return this.Ga.Gh(t),this.Ts.vs(),this}getTextRotation(){return this.Ga.Wh()}}const go={...wn,...kn,uiElement:fo};class mo extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Qc=!1,this.fitTo=this.Lu.bind(this),this.setSize=this.fitTo,this.Ga=this.Ts.sc(e).ke(z).Ce(ot),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Fe(){const t=Ze([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>dt(t,this.scale,this.renderingScale))));return this.Qc?this.Ga.Sl([{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.Ga.Sl([t.min,{x:t.min.x,y:t.max.y},t.max,{x:t.max.x,y:t.min.y}]),this}Lu(t){return this.setContentSize(t),this.Ts.vs(),this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}}class yo extends Dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Jc=u(0,0),this.Ga=t.Kc(e).hu(0).Ve(360).ke(z).Ce(ot),this.Mu(this.Ga)}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Fe(){const t=this.getSize(e.UISpace.Content).x/2;return this.Ga.nu(t*this.renderingScale.Ui().x).ou(t*this.renderingScale.Ui().y).Ie(dt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).lu(255).Ds(),this}Lu(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Jc=t,this.Ts.vs(),this}Ru(){return(this.getSize(e.UISpace.Content).x-this.Jc.x)/2}Eu(){return(this.getSize(e.UISpace.Content).x-this.Jc.x)/2}Vu(){return(this.getSize(e.UISpace.Content).y-this.Jc.y)/2}zu(){return(this.getSize(e.UISpace.Content).y-this.Jc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Jc=t,this}}class po extends Ln{constructor(t,e,i,s,r){super(t,e,i,hn.Simple,s,r),this.qc=p(u(0,0)),this.td=!1,this.Ts=t,this.hc()}rc(){const t=this.qc._();if(this.td){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.qc._().x*this.qc._().x/4+this.qc._().y*this.qc._().y/4),i=u(Math.cos(Math.PI/4)*e,0),s=u(0,Math.sin(Math.PI/4)*e),r=u(0,0),n=oi(r,oi(i,s)),o=oi(n,oi(s,ni(i,-1)));return[r,n,o,hi(o,oi(i,s))]}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}Lu(t){return this.qc.M(t),this.td=!1,this.Ts.vs(),this}Ru(){return this.td?0:(this.getSize(e.UISpace.Content).x-this.qc._().x)/2}Eu(){return this.td?0:(this.getSize(e.UISpace.Content).x-this.qc._().x)/2}Vu(){return this.td?0:(this.getSize(e.UISpace.Content).y-this.qc._().y)/2}zu(){return this.td?0:(this.getSize(e.UISpace.Content).y-this.qc._().y)/2}fitTo(t){return this.qc.M(t),this.td=!0,this.Ts.vs(),this}}class xo extends Ln{constructor(t,i,s,r,n){super(t,i,s,hn.Simple,r,n),this.sd=p(u(0,0)),this.ed=p(10),this.hd=p(void 0),this.Yu=p(e.UIDirections.Right),this.hc()}Iu(){return[this.Ga]}setFillStyle(t){return this.Ga.ke(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.zh()}setStrokeStyle(t){return this.Ga.Ce(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.lo()}setDirection(t){return this.Yu.M(t),this.Ts.vs(),this}getDirection(){return this.Yu._()}setPointerLength(t){return this.ed.M(t),this.Ts.vs(),this}getPointerLength(){return this.ed._()}setPointerAngle(t){return this.hd.M(t),this.Ts.vs(),this}getPointerAngle(){let t=this.hd._();if(void 0===t){const e=this.rd();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)}Lu(t){return this.sd.M(t),this.Ts.vs(),this}nd(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}od(){return $t(this.Yu._())?this.sd._().x:this.sd._().y}rd(){return $t(this.Yu._())?this.sd._().y:this.sd._().x}Ru(){switch(this.Yu._()){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.nd()-this.rd());default:return 0}}Eu(){switch(this.Yu._()){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.nd()-this.rd());default:return 0}}Vu(){switch(this.Yu._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.nd()-this.rd());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}zu(){switch(this.Yu._()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.nd()-this.rd());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}rc(){const t=jt(this.Yu._()),e=si(u(0,0),t),i=this.getPointerLength(),s=this.nd(),r=this.od(),n=this.rd();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=oi(oi(o,ni(t,-i)),ni(e,s/2)),a=oi(h,ni(e,(n-s)/2)),l=oi(a,ni(t,-r)),c=oi(oi(o,ni(t,-i)),ni(e,-s/2)),d=oi(c,ni(e,-(n-s)/2)),f=oi(d,ni(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Ct(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class So extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.Lu.bind(this),this.setSize=this.fitTo,this.ad=new no,this.Ga=this.Ts.fd(e).Ee(ot).dd(z).ud(z).ld(this.ad),this.Mu(this.Ga)}Iu(){return[this.Ga]}setShape(t){return this.Ga.Ad(t),this}getShape(){return this.Ga.gd()}setRotation(t){return this.Ga.pd(t),this}getRotation(){return this.Ga.md()}setFillStyle(t){return this.Ga.ud(t),this.Ts.vs(),this}getFillStyle(){return this.Ga.yd()}Fe(){const t=dt(this.getPosition({x:0,y:0},e.UISpace.Content),this.scale,this.renderingScale),i=Math.max(this.size.x,this.size.y);if(this.ad.clear(),i>0){const e=this.Ga.gd(),s=this.Ga.yd(),r=io(e)&&e,n=Zn(s)&&s;if(r){const t=i/r.ai().y;this.Ga.Sd(t)}else if(n){const t=n.source;if(t instanceof Image){const e=i/t.height;this.Ga.Sd(e)}}else this.Ga.Sd(i);this.ad.appendSample(t)}return this}Lu(t){return this.setContentSize(t),this.Ts.vs(),this}Ru(){return 0}Eu(){return 0}Vu(){return 0}zu(){return 0}}const Ao={...wn,...kn,uiElement:So};class vo extends Rn{setSize(t){return this.setContentSize(t),this.Ts.vs(),this}}class bo extends xn{constructor(){super(...arguments),this.vd=[],this.xd=0,this.bd=t=>{const e=this.vd.indexOf(t);e>=0&&this.vd.splice(e,1)}}getMembers(){return this.vd}getMemberCount(){return this.vd.length}setMinimumSize(t){return this.Md=t,this.Ts.vs(),this}getMinimumSize(){return this.Md}addElement(t,e=-1){const i=t.Qu(this.Ts,this.renderingScale,this.scale,this.bd,this.ts,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.vd.splice(e,0,i):this.vd.push(i),i.setVisible(this.getVisible()),this.Mu(i),this.Xi&&(me(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.vd.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.vd.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof vo)),0),s=i>0?(this.size.x-this.xd)/i:0;return this.vd.reduce(((e,i)=>i instanceof vo?this.scale.mi({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 vo)),0),s=i>0?(this.size.y-this.xd)/i:0;return this.vd.reduce(((e,i)=>i instanceof vo?this.scale.mi({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},Do=Fo("Text",[]),Lo={button:void 0,isLocked:!1,setOn(t){const e=this.button.getOn()!==t;return this.button.setOn(t),e&&this.L.emit("switch",t),this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.L.on("switch",(e=>t(this,e)))},offSwitch(t){return this.L.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()}},Po={textFillStyleHidden:void 0,setTextFillStyleHidden(t){return this.textFillStyleHidden="function"==typeof t?t(this.textFillStyleHidden):t,this},getTextFillStyleHidden(){return this.textFillStyleHidden}},_o={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()}},Vo={...wn,...Tn,background:mo,Qu(t,e,i,s,r,n){const o=new Mo(t,e,i,this.background,s,r),h=o.addElement(go,void 0),a=Object.assign(o,Io,{setTextLabel:h},Do,{stylableTexts:[h]});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),Bo={...wn,...Tn,background:xo,Qu(t,i,s,r,n,o){const h=new Mo(t,i,s,this.background,r,n),a=h.addElement(go,void 0),l=h.getBackground(),u=Object.assign(h,Io,{setTextLabel:a},Do,{stylableTexts:[a]},_o,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?(this.setPadding({top:t}),a.setMargin({top:0})):this.getDirection()===e.UIDirections.Down?(this.setPadding({bottom:t}),a.setMargin({bottom:0})):this.getDirection()===e.UIDirections.Right?(this.setPadding({right:t}),a.setMargin({right:0})):this.getDirection()===e.UIDirections.Left&&(this.setPadding({left:t}),a.setMargin({left:0})),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Ju="other",u.setPointerLength(n.xAxisNumericTicks.majorTickStyle.getTickLength()).setTickLabelPadding(n.xAxisNumericTicks.majorTickStyle.getTickPadding()).setTextFont(n.uiTextFont).setTextFillStyle(n.uiTextFillStyle).setBackground((t=>t.setFillStyle(n.uiBackgroundFillStyle).setStrokeStyle(n.uiBackgroundStrokeStyle))),En(u,n,o),this.applyStylers(u,n)}};class zo extends pn{constructor(t,e,i,s,n,o){super(t,e,i,n,o),this.Bs=!1,this.L=new r.Eventer,this.wd=z,this.Cd=z,this.getOn=()=>this.Bs,this.kd=this.Mu(new So(this.Ts,this.renderingScale,this.scale,kt,o).setShape(s)),this.Cd=o.uiButtonFillStyleHidden||o.uiButtonFillStyle}Iu(){return[...this.kd.Iu()]}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}setOn(t){return this.Bs=t,this.kd.setFillStyle(t?this.wd:this.Cd),this.Ts.vs(),this}setOffFillStyle(t){return this.Cd="function"==typeof t?t(this.Cd):t,this.Bs||this.kd.setFillStyle(this.Cd),this}getOffFillStyle(){return this.Cd}setSize(t){return this.kd.fitTo("number"==typeof t?u(t,t):t),this}getSize(){return this.kd.getSize()}setOnFillStyle(t){return this.wd="function"==typeof t?t(this.wd):t,this.Bs&&this.kd.setFillStyle(this.wd),this}getOnFillStyle(){return this.wd}setButtonShape(t){return this.kd.setShape(t),this.Ts.vs(),this}getButtonShape(){return this.kd.getShape()}Fe(){return super.Fe(),this.kd.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Fe(),this}Ds(){const t=this.kd.Ds().getSize();return this.setContentSize(t),super.Ds()}dispose(){return super.dispose(),this.kd.dispose(),this}setMouseInteractions(t){return this.kd.setMouseInteractions(t),this}getMouseInteractions(){return this.kd.getMouseInteractions()}setHighlight(t){const e=Ae(t);return this.kd.setHighlight(e),this.L.emit("highlight",this,t),this.Ts.vs(),this}getHighlight(){return this.kd.getHighlight()}}const No={...wn,uiElement:zo,buttonShape:e.PointShape.Circle,setButtonShape(t){return{...this,buttonShape:t}},Qu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.buttonShape,s,r),r);return En(o,r,n),o}},Oo={...wn,...Tn,background:mo,buttonBuilder:No,setButtonShape(t){return{...this,buttonBuilder:this.buttonBuilder.setButtonShape(t)}},Qu(t,i,s,r,n,o){const h=new Mo(t,i,s,this.background,r,n),a=h.addElement(Co);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Co);u.addGap();const c=u.addElement(go);u.addGap(),h.addGap();const d=Object.assign(h,Io,{setTextLabel:c},Do,{stylableTexts:[c]},Lo,{button:l},Po);let f;return d.onMouseClick(((t,e)=>{d.getLocked()||d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),d.onSwitch(((t,e)=>{e?f&&d.setTextFillStyle(f):(f=d.getTextFillStyle(),d.setTextFillStyle(d.getTextFillStyleHidden()))})),d.setPadding({left:5}),En(d,n,o),this.applyStylers(d,n)}}.addStyler(bn).addStyler(Mn);class Uo extends pn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Td=[],this.Fd=2,this.Id="",this.Pd=(t,e)=>void 0!==t.label?t.label:e.percentageValues?`${(100*t.value).toFixed(0)}%`:Ri(t.value,e.min,e.max),this.Dd=0,this.Bd=0,this.Ld=!1,this.Ts=t,this.Rd=n,this.Ed=this.Mu(t.Te(e).Ce(ot)),this.zd=this.Mu(t.Dr(e).ke(r.uiTextFillStyle).Nh(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Vd=140,this.Od=25):(this.Vd=160,this.Od=15)}Iu(){return[this.Ed,this.zd]}Nd(t){this.Gd=t;const e=Ho(t,"vertical"===this.Rd?0:90,this.Ld);return this.Ed.ke(e),this.Ts.vs(),this}Wd(){return this.Gd}Ud(t){return this.Vd=t,this.Ts.vs(),this}Yd(){return this.Vd}Hd(t){return this.Od=t,this.Ts.vs(),this}$d(){return this.Od}Xd(t){return this.Id=t,this.Ts.vs(),this}jd(){return this.Id}Zd(t){return this.Pd=t,this.Ts.vs(),this}setLUTDisplayProportionalSteps(t){if(this.Ld=t,this.Gd){const t=Ho(this.Gd,"vertical"===this.Rd?0:90,this.Ld);this.Ed.ke(t)}return this.Ts.vs(),this}getLUTDisplayProportionalSteps(){return this.Ld}setFillStyle(t){return this.zd.ke(t),this.Ts.vs(),this}getFillStyle(){return this.zd.zh()}setFont(t){return this.zd.Nh(t),this.Ts.vs(),this}getFont(){return this.zd.Oh()}setTextRotation(t){return this.Bd=t,this.zd.Gh(t),this.Ts.vs(),this}getTextRotation(){return this.zd.Wh()}Fe(){var t,i,s,r;if(super.Fe(),this.Xi||!this.getVisible())return this;const n=this.Gd;if(n){const o=this.renderingScale.Ui(),h=n.min,a=n.max;if("vertical"===this.Rd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=oi(s,{x:this.Ed.ai().x+this.Fd*o.x,y:0}),l={x:r.x,y:r.y+(this.Id.length>0?this.Dd*o.y+this.zd.ai().y:0)+.5*((null===(t=this.Td[0])||void 0===t?void 0:t.ai().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Td[this.Td.length-1])||void 0===i?void 0:i.ai().y)||0)};this.Ed.Ie({x:s.x,y:l.y}),this.zd.za({x:-1,y:-1}).Ie(r),n.getSteps().forEach(((t,e)=>{const i=je(l,u,this.Ld?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Td[e].za({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.Td.reduce(((t,e)=>Math.max(t,e.ai().y)),0),u=oi(t,{x:.5*((null===(s=this.Td[0])||void 0===s?void 0:s.ai().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Td[this.Td.length-1])||void 0===r?void 0:r.ai().x)||0)+(this.Id.length>0?this.Dd*o.x+this.zd.ai().x:0)),y:u.y},f={x:u.x,y:u.y+this.Fd*o.y};this.Ed.Ie(f),this.zd.za({x:1,y:1}).Ie(c),n.getSteps().forEach(((t,e)=>{const i=je(u,d,this.Ld?!0===n.getInterpolation()?(t.value-h)/(a-h):.9*(t.value-h)/(a-h):!0===n.getInterpolation()?e/(n.getSteps().length-1):e/n.getSteps().length);this.Td[e].za({x:0,y:1}).Ie(i)}))}}return this}Ds(){if(this.Gd&&this.getVisible()){const t=this.Gd.getSteps();for(let e=this.Td.length;eMath.max(t,e.Ds().Zc().x)),0),this.zd.Ds().Zc().x),s=(this.Id.length>0?this.Dd+this.zd.Ds().Zc().y:0)+e+.5*this.Td[0].Ds().Zc().y+.5*this.Td[this.Td.length-1].Ds().Zc().y;this.setContentSize({x:i,y:s})}else{const t=this.Vd,e=this.Od;this.Ed.tt({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Id.length>0?this.Dd+this.zd.Ds().Zc().x:0,.5*this.Td[this.Td.length-1].Ds().Zc().x),s=t+.5*this.Td[0].Ds().Zc().x+i,r=e+this.Fd+this.Td.reduce(((t,e)=>Math.max(t,e.Ds().Zc().y)),0);this.setContentSize({x:s,y:r})}}else this.Td.forEach((t=>t.dispose())),this.Td.length=0,this.zd.setVisible(!1),this.Ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ds()}dispose(){return super.dispose(),this.Ed.dispose(),this.Td.forEach(Tt),this.zd.dispose(),this}setMouseInteractions(t){return this.Ed.setMouseInteractions(t),this}getMouseInteractions(){return this.Ed.getMouseInteractions()}}const Go={lutElement:{},setLUT(t){return this.lutElement.Nd(t),this},getLUT(){return this.lutElement.Wd()},setLUTLength(t){return this.lutElement.Ud(t),this},getLUTLength(){return this.lutElement.Yd()},setLUTThickness(t){return this.lutElement.Hd(t),this},getLUTThickness(){return this.lutElement.$d()},setLookUpUnit(t){return this.lutElement.Xd(t),this},getLookUpUnit(){return this.lutElement.jd()},setLUTStepValueFormatter(t){return this.lutElement.Zd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Yo={...wn,...Tn,background:mo,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},Qu(t,e,i,s,r,n){const o=new Eo(t,e,i,this.background,s,r),h=o.addElement({Qu:()=>new Uo(t,e,i,kt,r,this.alignment)}),a=Object.assign(o,Do,{stylableTexts:[h]},Go,{lutElement:h});return En(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),Ho=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new st({angle:e,stops:s.map(((e,o)=>({offset:i?(e.value-r)/n:o/(s.length-1),color:e.color||t.color})))});const o=[];for(let e=0;enew Uo(t,i,s,kt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Io,{setTextLabel:c},Do,{stylableTexts:[c,d]},Fo("LUTText",[d]),Lo,{button:l},Go,{lutElement:d},Po);let g;return f.onMouseClick((()=>{f.getLocked()||f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setTextFillStyleHidden(n.uiTextFillStyleHidden||n.uiTextFillStyle),f.onSwitch(((t,e)=>{e?g&&f.setTextFillStyle(g):(g=f.getTextFillStyle(),f.setTextFillStyle(f.getTextFillStyleHidden()))})),f.setPadding({left:5}),this.applyStylers(f,n)}}.addStyler(bn).addStyler(Mn),Wo={alignment:null,title:null,entryStylers:null,legendBoxDisposed:null,entries:[],add(t,e){const i=!e||"object"!=typeof e||void 0===e.toggleVisibilityOnClick||e.toggleVisibilityOnClick,s=null==e?void 0:e.matchStyleExactly,r=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Qh?this.addChart(t,i,r,s):"attach"in t?this.addAttachable(t,i,r,s):t&&this.addDashboard(t,i,r,s)),this},addAttachable(t,e,i,s){const r=t.Wd&&t.Wd(),n=t.ks&&t.ks(),o=void 0!==s&&s;let h=i;if(!h){let t=r?Xo.setAlignment(this.alignment):Oo;void 0!==n&&(t=t.setButtonShape(n)),h=t}const a=this.addElement(h);if(r&&"setLUT"in a){a.setLUT(r.lut);const t=r.lut.getUnits(),e=r.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";a.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(a))),this.entries.push({entry:a,component:t}),t.attach(a,e,o),e||a.setLocked(!0),this},addChart(t,e,i,s){return t.Qd().forEach((t=>this.addAttachable(t,e,i,s))),this},addDashboard(t,e,i,s){return t.getCells().filter((t=>t.panel instanceof Qh)).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}},jo={alignment:"vertical",layoutBuilder:Co,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Ro:Co}},getAlignment(){return this.alignment},titleBuilder:Vo,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},$o={...wn,...Tn,...jo,background:mo,Qu(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).Qu(t,e,i,s,r,!1);let h=Object.assign(o,Wo,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.Xi});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Co:Ro),l=a.addElement(this.titleBuilder).setText("Legend").setTextFillStyle(r.legendTitleFillStyle).setTextFont(r.legendTitleFont);return a.addGap(),h=Object.assign(h,{title:l}),"horizontal"===this.alignment&&l.setMargin({right:6}),En(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Zo extends pn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.Jd=10,this.Kd=e.UIDirections.Up,this.qd=0,this.Ju="major",this.ua=this.Mu(t.Dr(this.renderingScale).Ir(Re).Pr(Re)),this.Re=this.Mu(t.ze(this.renderingScale))}Iu(){return[this.ua]}Fe(){if(super.Fe(),this.Xi)return this;const t=dt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.mi(t,{x:this.Kd===e.UIDirections.Right?-this.Jd:this.Kd===e.UIDirections.Left?this.Jd:0,y:this.Kd===e.UIDirections.Up?-this.Jd:this.Kd===e.UIDirections.Down?this.Jd:0}),s=this.renderingScale.mi(i,{x:this.Kd===e.UIDirections.Right?-this.qd:this.Kd===e.UIDirections.Left?this.qd:0,y:this.Kd===e.UIDirections.Up?-this.qd:this.Kd===e.UIDirections.Down?this.qd:0});return this.Re.Oe(t).Ve(i),this.ua.Ie(s).za(this.Kd===e.UIDirections.Up?{x:0,y:1}:this.Kd===e.UIDirections.Down?{x:0,y:-1}:this.Kd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ds(){const t=this.Re.cu().getThickness();return this.size=this.Kd===e.UIDirections.Left||this.Kd===e.UIDirections.Right?{x:this.Jd+this.qd+this.ua.Ds().Zc().x,y:t}:{y:this.Jd+this.qd+this.ua.Ds().Zc().y,x:t},super.Ds()}dispose(){return super.dispose(),this.ua.dispose(),this.Re.dispose(),this}setVisible(t){return super.setVisible(t),this.ua.setVisible(t),this.Re.setVisible(t),this}setMouseInteractions(t){return this.ua.setMouseInteractions(t),this.Re.setMouseInteractions(t),this}getMouseInteractions(){return this.ua.getMouseInteractions()}getText(){return this.ua.Lh()}setTextFillStyle(t){return this.ua.ke(t),this.Ts.vs(),this}getTextFillStyle(){return this.ua.zh()}setTextFont(t){return this.ua.Nh(t),this}setTextRotation(t){return this.ua.Gh(t),this}getTextRotation(){return this.ua.Wh()}getTextFont(){return this.ua.Oh()}setText(t){return this.ua.Eh(t),this.Ts.vs(),this}setDirection(t){return this.Kd=t,this.Ts.vs(),this}getDirection(){return this.Kd}setPointerLength(t){return this.Jd=t,this.Ts.vs(),this}getPointerLength(){return this.Jd}setTickLabelPadding(t){return this.qd=t,this.Ts.vs(),this}getTickLabelPadding(){return this.qd}setTickStyle(t){return this.Re.Ee(t),this.Ts.vs(),this}getTickStyle(){return this.Re.cu()}}const Ko={...wn,Qu(t,e,i,s,r,n){const o=new Zo(t,e,i,s,r);return En(o,r,n),this.applyStylers(o,r)}}.addStyler(bn),Jo=Ko.addStyler(((t,e)=>(t.Ju="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)))),qo=Ko.addStyler(((t,e)=>(t.Ju="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)))),Qo=Oo.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),th=$o.setAlignment("horizontal"),eh=$o.setAlignment("vertical"),ih={TextBox:Vo,CheckBox:Oo,ButtonBox:Qo,PointableTextBox:Bo,AxisTickMajor:Jo,AxisTickMinor:qo,LUTRange:Yo},sh={HorizontalLegendBox:th,VerticalLegendBox:eh},rh=(t,e)=>{if(Ni(t)){const i=e.Do(t);return{x:i.engineX,y:i.engineY}}return t},nh=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}},oh=(t,e,i,s=1)=>Rt(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),hh=(t,e,i,s=1)=>{const r=i.dt(t),n=i.dt(e);return Rt(i.ct(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)},ah={tf:0,if:1,sf:2,ef:3,hf:4,rf:5,nf:6,af:7,lf:8,uf:9,cf:10,df:11,ff:12,Af:13,gf:14,pf:15,mf:16,yf:17,Sf:18,vf:19,xf:20,bf:21,Mf:22,_f:23};class lh extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.wf=r}}class uh extends Js{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,y,p,x){var S,A,v;super(d,c,a,y,p,{numeric:c.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:c.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:c.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},x),this.Cf=new Map,this.kf=void 0,this.Tf=0,this.Ff=[],this.If=[],this.Ke=zs.fitting,this.Pf=!0,this.Df=8,this.Bf=void 0,this.Lf=void 0,this.Rf=20,this.Ef=1,this.zf=!0,this.Vf=!0,this.Of=!0,this.Nf=!0,this.Gf=!0,this.Wf=!0,this.Uf=!0,this.Yf=!0,this.Hf=!0,this.$f=!0,this.Xf=this.Ch.defaultDragMouseStyle,this.jf=this.Ch.defaultDragMouseStyle,this.Zf=this.Ch.defaultDragMouseStyle,this.Qf=this.Ch.defaultDragMouseStyle,this.Jf=this.Ch.defaultDragMouseStyle,this.L=new r.Eventer,this.Kf=[],this.qf=t=>{const e=this.If.indexOf(t);e>=0&&this.If.splice(e,1)},this.tA=t=>(this.If.indexOf(t)<0&&this.If.push(t),this.qf),this.zt=(t,e)=>this.L.emit("axisAreaTouch",this,e),this.iA=Qt(this.Kf),this.onAxisInteractionAreaMouseClick=t=>this.L.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.L.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.L.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.L.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.L.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.L.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.L.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.L.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.L.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.L.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.L.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.L.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.L.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.L.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.L.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.L.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.L.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.L.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.L.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.L.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.L.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.L.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.L.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.L.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.L.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.L.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.L.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.L.off(t,"axisAreaTouchEnd"),this.Vd={relative:1},this.sA=0,this.eA=0,this.hA=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().tc()):t,this.rA=t=>{const e=this.Ff.indexOf(t);-1!==e&&this.Ff.splice(e,1)},this.nA=(t,e)=>{this.L.emit("axisAreaDoubleClick",this,e),this.Nf&&(this.setStopped(!1),Zt(e))},this.oA=t=>{this.L.emit("axisAreaMouseEnter",this),(this.Vf||this.zf||this.Of||this.Nf)&&this.aA(t)},this.lA=t=>{this.uA(t),this.L.emit("axisAreaMouseLeave",this)},this.cA=(t,e,i)=>{var s,r;this.L.emit("axisAreaMouseDragStart",this,e,i);const n=Ft(null===(s=this.chart.dA.Hn)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Ft(null===(r=this.chart.dA.Hn)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Vf?(this.fA(t),Zt(e)):i===n&&this.zf&&(this.AA(t,h),Zt(e))},this.gA=(t,e,i,s,r)=>{var n,o;this.L.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Ft(null===(n=this.chart.dA.Hn)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Ft(null===(o=this.chart.dA.Hn)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Vf?(this.pA(t,r),Zt(e)):i===h&&this.zf&&(this.mA(t,s,l,r),Zt(e))},this.yA=(t,e,i,s)=>{var r,n;this.L.emit("axisAreaMouseDragStop",this,e,i,s);const o=Ft(null===(r=this.chart.dA.Hn)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Ft(null===(n=this.chart.dA.Hn)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Vf?(this.SA(t),Zt(e)):i===o&&this.zf&&(this.vA(t,s,a),Zt(e)),t.getIsUnderMouse()&&(this.Vf||this.zf||this.Of||this.Nf)&&this.aA(t)},this.xA=(t,e)=>{if(this.L.emit("axisAreaMouseWheel",this,e),this.Of){this.setStopped(!0);const t=this.Ch.getWidth(this.bA.cs.De(e.clientX,e.clientY)),i=this.ft.ct(t);this.zoom(i,ge(e)),Zt(e)}},this.MA=(t,e)=>this.L.emit("axisAreaMouseClick",this,e),this._A=(t,e)=>this.L.emit("axisAreaMouseDown",this,e),this.wA=(t,e)=>this.L.emit("axisAreaMouseUp",this,e),this.CA=(t,e)=>this.L.emit("axisAreaMouseMove",this,e),this.kA=(t,e,i)=>{this.L.emit("axisAreaTouchStart",this,i),this.zf&&(this.aA(t),this.AA(t,e),Zt(i))},this.TA=(t,e,i,s,r)=>{this.L.emit("axisAreaTouch",this,r),this.zf&&(this.mA(t,e,i,s),Zt(r))},this.FA=(t,e,i,s)=>{this.L.emit("axisAreaTouchEnd",this,s),this.zf&&(this.vA(t,e,i),this.uA(t),Zt(s))},this.IA=(t,e,i,s)=>{(this.Vf||this.Of)&&(this.aA(t),this.fA(t),Zt(s))},this.PA=(t,e,i,s,r,n)=>{if(this.Vf){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.pA(t,e),Zt(n)}if(this.Of){const t=this.bA.cs.De(e.x,e.y),o=this.bA.cs.De(i.x,i.y),h=Math.abs(this.Ch.getWidth(hi(t,s))-this.Ch.getWidth(hi(o,r)))-Math.abs(this.Ch.getWidth(t)-this.Ch.getWidth(o)),a=this.ft.mi(this.Ph,-h),l=this.ft.mi(this.Dh,h);this.Jh(a,l,!0),Zt(n)}},this.DA=(t,e,i,s)=>{(this.Vf||this.Of)&&(this.SA(t),this.uA(t),Zt(s))},this.BA=(t,e)=>{(this.Gf||this.Wf)&&this.LA(t)},this.RA=(t,e)=>{this.EA(t)},this.zA=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gf&&this.VA(t,s)},this.OA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gf&&this.NA(t,n,s,r)},this.GA=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gf&&this.WA(t,n,s,r)},this.UA=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gf||this.Wf)&&this.YA(t,r,s),(this.Gf||this.Wf)&&this.LA(t)},this.HA=(t,e)=>{this.Wf&&(this.setStopped(!0),this.zoom(this.Ph,ge(e)),Zt(e))},this.$A=(t,e)=>{this.Wf&&(this.setStopped(!0),this.zoom(this.Dh,ge(e)),Zt(e))},this.XA=(t,e,i)=>{this.Gf&&(this.LA(t),this.VA(t,e),Zt(i))},this.jA=(t,e,i,s,r)=>{this.Gf&&(this.NA(t,e,i,s),Zt(r))},this.ZA=(t,e,i,s,r)=>{this.Gf&&(this.WA(t,e,i,s),Zt(r))},this.QA=(t,e,i,s)=>{this.Gf&&(this.YA(t,e,i),this.EA(t),Zt(s))},this.JA=t,this.bA=i,this.KA=n,this.qA=o,this.chart=d,this.tg=g,this.ig=s,this.es=h,"logarithmic"===x.type&&this.chart.cs.Gn(ah.vf),m(this,this.tA),a.sg=this,this.eg=f,this.hg=this.eg>50?1:-1,this.rg=(v=this.Ch.toPoint(0,-this.hg),Math.abs(v.x)>=Math.abs(v.y)?v.x>=0?e.UIDirections.Right:e.UIDirections.Left:v.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.ng=l,this.og=this.ft instanceof Di?(new _i).Ei(this.Ch.toVec2(this.ft,this.ng)):(new Vi).Ei(this.Ch.toVec2(this.ft,this.ng)),this.ag=this.chart.pixelScale,this.lg=(new _i).Ei(this.Ch.toVec2(this.Ch.getWidth(this.ag),this.ng)),this.ug=this.bA.ze(this.og).setMouseInteractions(!1),this.cg=this.bA.ze(this.og).setMouseInteractions(!1),this.dg=this.bA.ze(this.og).setMouseInteractions(!1),this.Ag=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.gg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).Ce(c.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.pg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.mg=this.ig.Te(this.ag).ke(c.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).Ce(ot).jo(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.Rh=this.ig.Dr(this.og).setMouseInteractions(!1).Gh(this.Ch.getTitleTextRotation(this.hg)).Pr(Re).Ir(Re),this.chart.cs.us.ls(this.Ag,(t=>this.Ag.ds(t)),{animationEnabled:this.ih}),this.chart.cs.us.ls(this.pg,(t=>this.pg.ds(t)),{animationEnabled:this.ih}),this.chart.cs.us.ls(this.mg,(t=>this.mg.ds(t)),{animationEnabled:this.ih});const b=Wi(new $i(this.kA,this.TA,this.FA,1),new Zi(this.IA,this.PA,this.DA),new ji(this.nA)),M=Wi(new $i(this.XA,this.jA,this.QA)),E=Wi(new $i(this.XA,this.ZA,this.QA));this.Ag.setMouseEnterEventHandler(this.oA).setMouseLeaveEventHandler(this.lA).setMouseDragStartEventHandler(this.cA).setMouseDragEventHandler(this.gA).setMouseDragStopEventHandler(this.yA).setMouseWheelEventHandler(this.xA).setMouseDoubleClickEventHandler(this.nA).setMouseClickEventHandler(this.MA).setMouseDownEventHandler(this._A).setMouseUpEventHandler(this.wA).setMouseMoveEventHandler(this.CA).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.pg.setMouseEnterEventHandler(this.BA).setMouseLeaveEventHandler(this.RA).setMouseDragStartEventHandler(this.zA).setMouseDragEventHandler(this.OA).setMouseDragStopEventHandler(this.UA).setMouseWheelEventHandler(this.HA).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.mg.setMouseEnterEventHandler(this.BA).setMouseLeaveEventHandler(this.RA).setMouseDragStartEventHandler(this.zA).setMouseDragEventHandler(this.GA).setMouseDragStopEventHandler(this.UA).setMouseWheelEventHandler(this.$A).setTouchStartEventHandler(E.onTouchStart).setTouchMoveEventHandler(E.onTouchMove).setTouchEndEventHandler(E.onTouchEnd),this.ug.Ee(c.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.cg.Ee(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.dg.Ee(c.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.Rh.ke(c.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Nh(c.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.hs=h.rs(this,{}),this.Uh=this.hs.yg([this.Rh]).Ss(y.effectsText),this.Sg=null!==(S=c.getWidth({x:y.xAxisMarginAfterTicks,y:y.yAxisMarginAfterTicks}))&&void 0!==S?S:7,this.vg=null!==(A=c.getWidth({x:y.xAxisMarginAfterTitle,y:y.yAxisMarginAfterTitle}))&&void 0!==A?A:7}Tr(){return this.hh}Fr(){return void 0!==this.Qh}setTickStrategy(t,e){return super.Ih(t,e)}getTickStrategy(){return this.Ze}addBand(t=!0){const e=t?this.qA:this.KA,i=new Vs(e,this.chart,this.iA,this,this.og,this.Ch,this.ts,this.es);return this.Kf.push(i),i}addConstantLine(t=!0){const e=t?this.qA:this.KA,i=new Bs(e,this.chart,this.iA,this,this.og,this.Ch,this.ts,this.es);return this.Kf.push(i),i}xg(t){this.Kf.forEach(t)}bg(t){return this.Kf.map(t)}getHighlighters(){return this.Kf}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}wg(){return this.If}cr(t,e){return new lh(e,t,this.bA,this.og,this.og)}Yh(){if(this.Cf){for(const t of this.Cf)t[1].grid.dispose(),t[1].tick.dispose();this.Cf.clear()}super.Yh()}dr(t,e){const{tickStart:i}=e,s=t.xh.ur,r=i+s.getTickLength()*this.hg+s.getTickPadding()*this.hg;t.Ye.Ie(this.Ch.toPoint(t.S,r)).za(this.Ch.toPoint(s.getLabelAlignment(),-this.hg)).Gh(s.labelRotation).setVisible(this.getVisible())}Cg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.xh.ur,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.hg;return{gridStroke:{start:this.Ch.toPoint(t.S,r),end:this.Ch.toPoint(t.S,h)},tickStroke:{start:this.Ch.toPoint(t.S,n),end:this.Ch.toPoint(t.S,a)}}}wr(t,e){return"linear"===this.Th.type?oh(t,e,this.ft):hh(t,e,this.ft)}kg(t,e){return e instanceof Di?oh:hh}kr(t,e,i){if("logarithmic"!==this.Th.type){const s=this.ft.Ri(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ft;return{min:s.mi(t,-i),max:s.mi(e,i)}}Ds(){if(!this.ji)return{Tg:0,Fg:0,Od:0};const t=!(this.Qe.size>0),e=this.Rh&&this.Rh.Lh().length>0&&this.getTitleFillStyle()!==z,i=this.Ch.getHeight(e?this.chart.cs.Pg.Ig(this.getTitle(),this.getTitleFont(),this.getTitleRotation()):{x:0,y:0})+(e?this.vg:0),s=this.je===Gs?new Map:Qs(this.je,Math.min(this.Ph,this.Dh),Math.max(this.Ph,this.Dh),this.Ph,this.Dh,0),r=this.ft;let n=0;s.forEach(((e,i)=>{if((t=>void 0!==t.ur&&void 0!==t.ar)(i)){const s=Math.max(...e.map((e=>{if(!He(e,this.Ph,this.Dh))return 0;const s=this.chart.cs.Pg.Ig(i.ar(e,r),i.ur.labelFont,i.ur.labelRotation);return t||!s.isEstimate?this.Ch.getHeight(s):0})))+i.ur.tickLength+i.ur.tickPadding+i.ur.labelPadding;n=Math.max(n,s)}}));const o=this.Ff.reduce(this.hA,0);n=Math.max(n,o),n+=this.Sg;const h=Rt(i+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le);return this.Tf=h,{Tg:n,Fg:i,Od:h}}Fe(t){const e=this.getVisible()&&t.Dg>0;this.Bg=t;const i=this.ug.cu(),s=this.ft.getInnerStart()this.ft.getInnerStart()?this.ft.getInnerEnd():this.ft.getInnerStart(),n=i.getThickness()*this.hg/2,o=this.ng.getInnerInterval(),h=this.eg/100*o,a=h+t.Lg,l=o*this.hg,u=a+n;if(e||this.Yh(),this.je!==Gs&&e){const t=this.ft.ni();this.tr({physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});for(const[e,i]of this.Qe){let s=this.Cf.get(e);if(!s)if(e.Ne)s={grid:this.JA[0].Rg(this.og).setMouseInteractions(!1),tick:this.JA[0].Rg(this.og).setMouseInteractions(!1)};else if("Eg"in e){const t=Array.from(this.Qe.keys()).filter((t=>"Eg"in t)).reverse().indexOf(e),i=this.JA[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.Rg(this.og).setMouseInteractions(!1),tick:i.Rg(this.og).setMouseInteractions(!1)}}if(s){s.grid.Gt(),s.tick.Gt();for(const[e,r]of i){const e=this.Cg(r,{physicalAxisSize:t,startPosition:h,gridStrokeLen:l,gridStrokeStart:a,tickStart:u});s.grid.Vr().zg(e.gridStroke.start,e.gridStroke.end),s.tick.Vr().zg(e.tickStroke.start,e.tickStroke.end)}s.grid.Ee(e.ur.getGridStrokeStyle()),s.tick.Ee(e.ur.getTickStyle()),this.Cf.set(e,s)}}}const c=u,d=c+this.hg*t.Vg,f=this.Gf||this.Wf?Math.min(this.Rf,.25*t.Dg):0,g={start:this.Ch.toVec2(this.ft.mi(this.ft.getInnerStart(),f),c),end:this.Ch.toVec2(this.ft.mi(this.ft.getInnerEnd(),-f),d)},m=dt(this.Ch.toVec2(this.ft.getInnerStart(),d),this.og,this.ag),y=dt(g.start,this.og,this.ag),p=dt(g.end,this.og,this.ag),x=dt(this.Ch.toVec2(this.ft.getInnerEnd(),c),this.og,this.ag);this.ug.Oe(this.Ch.toPoint(s,a)).Ve(this.Ch.toPoint(r,a)).setVisible(e),this.cg.Oe(this.Ch.toPoint(this.ft.mi(this.ft.getInnerStart(),this.Df),a)).Ve(this.Ch.toPoint(this.ft.getInnerStart(),a)).setVisible(e),this.dg.Oe(this.Ch.toPoint(this.ft.mi(this.ft.getInnerEnd(),-this.Df),a)).Ve(this.Ch.toPoint(this.ft.getInnerEnd(),a)).setVisible(e);const S=a+t.Tg*this.hg;if(this.Rh.Ie(this.Ch.toPoint(this.Ch.getWidth(dt(ni(oi(m,x),.5),this.ag,this.og)),S)).za(this.Ch.toPoint(0,-1*this.hg)).setVisible(e),this.kf){const e=this.eg/100*o+t.Lg,i=-this.hg*o-t.Lg,s={start:this.Ch.toVec2(this.kf.min,u+this.hg*this.Tf),end:this.Ch.toVec2(this.kf.max,e+i)},r=dt(s.start,this.og,this.ag),n=dt(s.end,this.og,this.ag);this.gg.Ie(r).tt(hi(n,r)).setVisible(!0)}else this.gg.setVisible(!1);this.Ag.Ie(y).tt(hi(p,y)).setVisible(e),this.pg.Ie(m).tt(hi(y,m)).setVisible(e),this.mg.Ie(p).tt(hi(x,p)).setVisible(e);for(const i of this.Ff)i.update().plot(e,a,l,t.Lg,u);for(const t of this.Kf)t.Fe()}setLength(t){return this.Vd=t,this.chart.cs.vs(),this}getLength(){return this.Vd}setMargins(t,e){return this.sA=t,this.eA=e,this.chart.cs.vs(),this}getMargins(){return{start:this.sA,end:this.eA}}getStackIndex(){var t,e;return null!==(e=null===(t=[...this.chart.Og,...this.chart.Ng,...this.chart.Gg,...this.chart.Wg].find((t=>t.axis===this)))||void 0===t?void 0:t.iStack)&&void 0!==e?e:0}getParallelIndex(){var t,e;return null!==(e=null===(t=[...this.chart.Og,...this.chart.Ng,...this.chart.Gg,...this.chart.Wg].find((t=>t.axis===this)))||void 0===t?void 0:t.iParallel)&&void 0!==e?e:0}Ug(){const t=this.Bg;if(!t)return;const e=this.getVisible()&&t.Dg>0,i=this.ug.cu().getThickness()*this.hg/2,s=this.ng.getInnerInterval(),r=this.eg/100*s+t.Lg,n=s*this.hg,o=r+i;for(const i of this.Ff)i.update().plot(e,r,n,t.Lg,o);for(const t of this.Kf)t.Fe()}Yg(){return this.Tf}Hg(t,e){e=e||ih.AxisTickMajor;const i=new vn(this,t?this.JA[0]:this.ig,this.ig,this.ft,this.lg,this.lg,this.Ch,this.rg,this.rA,this.ts,e).setTextFormatter(this.formatValue);return this.Ff.push(i),i}aA(t){this.chart.cs.us._s(t,1),this.Bf=t.cs.Ur(this.Xf,this.Bf)}uA(t){this.chart.cs.us._s(t,0),t.cs.Yr(this.Bf)}fA(t){this.setStopped(!0),t.cs.Yr(this.Bf)}pA(t,e){const i=-this.Ch.getWidth(e);this.pan(i),this.Bf=t.cs.Ur(this.jf,this.Bf)}pan(t){const e=this.Ph,i=this.Dh,s=this.ft.mi(e,t),r=this.ft.mi(i,t);this.Jh(s,r,!1)}zoom(t,e){const i=this.ft.dt(this.Ph),s=this.ft.dt(this.Dh),r=this.ft.dt(t),n=Rt((r-i)/(s-i),0,1),o=.2*this.ft.ni(),h=n*this.Ef*o*-e,a=(1-n)*this.Ef*o*e,l=this.ft.mi(this.Ph,h),u=this.ft.mi(this.Dh,a);this.Jh(l,u,!0)}SA(t){this.kf=void 0,t.cs.Yr(this.Bf)}AA(t,e){this.setStopped(!0),t.cs.Yr(this.Bf),this.chart.cs.us._s(this.Ag,0)}mA(t,e,i,s){const r=dt(this.bA.cs.De(i.x,i.y),this.bA.cs.ft,this.og),n=Rt(this.Ch.getWidth(r),this.Ph,this.Dh),o=this.Ch.getWidth(dt(this.bA.cs.De(e.x,e.y),this.bA.cs.ft,this.og));Math.abs(this.ft.dt(n)-this.ft.dt(o))>10?(this.kf=m(Math.min(n,o),Math.max(n,o)),this.Bf=t.cs.Ur(this.Zf,this.Bf)):(this.kf=void 0,this.Bf=t.cs.Ur(this.Xf,this.Bf)),this.bA.vs()}vA(t,e,i){if(this.kf){const t=this.kf.min,e=this.kf.max,i=this.Dh{e.ys(t)}));for(const e of this.Cf.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.chart.cs.vs(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.ih),this}}const ch={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},dh={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},fh=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof uh&&"y"in t&&t.y instanceof uh),gh=s.Record({type:"tick-style",gridStrokeLength:1,gridStrokeStyle:new Ji,tickLength:7,tickStyle:new Ji,tickPadding:0,labelFont:new rr,labelFillStyle:new G,labelPadding:0,labelAlignment:0,labelRotation:0});class mh extends gh{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 yh=t=>!(!t||"object"!=typeof t||!("type"in t)||"tick-style"!==t.type),ph=new mh({labelFillStyle:z,gridStrokeStyle:ot,tickStyle:ot}),xh=t=>yh(t)&&N(t.labelFillStyle)&&ht(t.gridStrokeStyle)&&ht(t.tickStyle),Sh=(t,e,i,s,r)=>(n,o)=>h=>{const a=new Date(h+n),l={year:o?a.getUTCFullYear():a.getFullYear(),monthIndex:o?a.getUTCMonth():a.getMonth(),day:o?a.getUTCDate():a.getDate(),hours:o?a.getUTCHours():a.getHours(),minutes:o?a.getUTCMinutes():a.getMinutes(),seconds:o?a.getUTCSeconds():a.getSeconds(),millis:o?a.getUTCMilliseconds():a.getMilliseconds()},u=s?s(l):void 0;if(0===t&&!0===u)return h;const c=l[e];r.includes("year")&&(l.year=Math.floor(l.year/i)*i),r.includes("monthIndex")&&(l.monthIndex=0),r.includes("day")&&(l.day=1),r.includes("hours")&&(l.hours=0),r.includes("minutes")&&(l.minutes=0),r.includes("seconds")&&(l.seconds=0),r.includes("millis")&&(l.millis=0);let d=(0===t?1:t)*i;return-1===t&&!1===u&&(d=0),0!==d&&(l[e]=i*(d>0?Math.floor((c+d)/i):Math.ceil((c+d)/i))),o?Date.UTC(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis)-n:new Date(l.year,l.monthIndex,l.day,l.hours,l.minutes,l.seconds,l.millis).getTime()-n},Ah=(t,e,i,...s)=>Sh(-1,t,e,i,s),vh=(t,e,i,...s)=>Sh(-1,t,e,i,s),bh=(t,e,i,...s)=>Sh(0,t,e,i,s),Mh=(t,e,...i)=>Sh(1,t,e,void 0,i),Eh=t=>(e,i)=>s=>{const r=new Date(s+e),n=i?r.getUTCDay():r.getDay(),o=1===n&&0===(i?r.getUTCHours():r.getHours())&&0===(i?r.getUTCMinutes():r.getMinutes())&&0===r.getSeconds()&&0===r.getMilliseconds();if(0===t&&!0===o)return s;let h=i?r.getUTCDate():r.getDate();return-1===t&&1===n&&!1===o||(-1===t?h-=n>=2?n-1:n+6:h+=n>0?8-n:1),i?Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),h,0,0,0,0)-e:new Date(r.getFullYear(),r.getMonth(),h,0,0,0,0).getTime()-e},wh=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:$s(5,10,15,30)},minorTicks:{amount:4,fitFunction:js(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:$s(5,10,15,30)},minorTicks:{amount:12,fitFunction:js(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:$s(3,6,12)},minorTicks:{amount:8,fitFunction:js(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Ah("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:js({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:js({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:Eh(-1),getNextKeyValueIncludingRef:Eh(0),getNextKeyValue:Eh(1),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:vh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:bh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:Mh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,3)},minorTicks:{fitFunction:js(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:vh("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:bh("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:Mh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js({ignore:"first"},2,5)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:vh("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:bh("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:Mh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:js(void 0,2,4)},minorTicks:{fitFunction:js(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:vh("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:bh("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:Mh("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:vh("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:bh("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:Mh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],Th=(t,e,i)=>{let s=((t,e,i,s,r)=>{const n=e-t;let o;for(let t=0;t(s,r,n,o)=>{const h=Th("great",s,r);if(void 0===h)return[];if("Decade"===h.label||"Century"===h.label||"Millennium"===h.label)return[];const a=o>n?s:r,l=(s+r)/2,u=o>n?r:s;if(wh.indexOf(h)<=wh.findIndex((t=>"Hour"===t.label)))return"left"===i?[a]:[];let c;if(!0===h.irregular)c=Ws(s,r,h.getPrevKeyValue(t,e),h.getNextKeyValue(t,e));else{const i=h.greatTicks.getReferenceKeyValue(t,e)(s);c=Xs(s,r,h.unit,i,1)}const d=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(s,r,c);return"left"===i?void 0===d||He(d,l,u)?[a]:[d]:void 0!==d&&He(d,l,u)?[d]:[u]},Ch=(t,e,i)=>(s,r,n,o)=>{const h=Th(t,n,o);let a;if(void 0===h)return[];if("great"===t&&void 0!==h.greatTicks)if(!0===h.irregular)a=Ws(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i));else{const t=h.greatTicks.getReferenceKeyValue(e,i)(s);a=Xs(s,r,h.unit,t,1)}else if("major"===t&&void 0!==h.majorTicks)a=!0===h.irregular?((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r})(s,r,h.getPrevKeyValue(e,i),h.getNextKeyValue(e,i)):((t,e,i)=>{const s=[];let r=t,n=0;for(;r1e3)throw new Error("Infinite loop in Axis tick key values logic.");return s.push(r),s})(s,r,h.unit);else{if("minor"!==t||void 0===h.minorTicks)return[];if(!0===h.irregular)a=((t,e,i,s)=>{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r})(s,r,h.getNextKeyValueIncludingRef(e,i),h.getNextKeyValue(e,i));else{const t=(t=>{if(void 0!==t)return wh[wh.indexOf(t)+1]})(h);if(void 0===t)return[];a=Hs(s,r,t.unit/h.minorTicks.amount,1)}}return a},Rh=t=>(e,i,s,r,n,o)=>{const h=Th(t,n,o);if(void 0===h)return;let a;return"major"===t?a=h.majorTicks.fitFunction:h.minorTicks&&(a=h.minorTicks.fitFunction),a?a(e,i,s,r,n,o):void 0},Ih=s.Record({type:"date-time-ticks",utc:!1,locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new mh,majorTickStyle:new mh,minorTickStyle:new mh,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),r=(t=>{const e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()));e.setUTCDate(e.getUTCDate()+4-(e.getUTCDay()||7));const i=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-i.getTime())/864e5+1)/7)})(s);return`${new Intl.DateTimeFormat(i,{year:"numeric",month:"long"}).format(s)} Week ${r}`},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 Fh extends Ih{Hh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>wh.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]},`;bt.console.error(`Invalid Intl.DateTimeFormat ( locale: ${this.locale}, formatOptions {${e}} )`)}})),s=new Map;s.set("great",i("Great")),s.set("major",i("Major")),s.set("minor",i("Minor"));const r=t=>String(t),n=(t,i)=>(n,o)=>{let h=n+e;const a=o.getInnerStart(),l=o.getInnerEnd(),u=a>l,c=Th(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=Ct(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e,this.utc)(n):c.greatTicks.getReferenceKeyValue(e,this.utc)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e,this.utc)(n):c.getNextKeyValue(e,this.utc)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[wh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ye:"Great ticks (directive)",Eg:0,Ge:!0,Lr:Ch("great",e,this.utc),Rr:void 0},{Ye:"Major ticks",Eg:1,ur:this.majorTickStyle,ar:n("major"),Lr:Ch("major",e,this.utc),bh:{Ar:Rh("major")},Rr:void 0}];xh(this.greatTickStyle)||(o.push({Ye:"Great ticks (left)",ur:this.greatTickStyle.setLabelAlignment(-1),ar:n("great","left"),Lr:kh(e,this.utc,"left"),Ne:!0,mr:!1}),o.push({Ye:"Great ticks (right)",ur:this.greatTickStyle.setLabelAlignment(1),ar:n("great","right"),Lr:kh(e,this.utc,"right"),Ne:!0,mr:!1})),xh(this.minorTickStyle)||h.push({Ye:"Minor ticks",Eg:2,ur:this.minorTickStyle,ar:n("minor"),Lr:Ch("minor",e,this.utc),bh:{Ar:Rh("minor"),Mh:(t,e,i,s,r,n)=>{const o=Th("minor",r,n);return!o||"Week"!==o.label}},Rr:void 0});const a=this.cursorFormatter;return{$e:o,Xe:h,We:a?(t,i,s)=>a(e+t,i,s):(t,i,s)=>{const r=new Date(e+t);return`${new Intl.DateTimeFormat(s,{year:"numeric",month:"numeric",day:"numeric",minute:"2-digit",hour:"2-digit"}).format(r)} `},jh:1e3,Zh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTickStyle(t){return this.setGreatTickStyle(t).setMajorTickStyle(t).setMinorTickStyle(t)}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return this.set("greatTickStyle",t(e))}return this.set("greatTickStyle",t)}getGreatTickStyle(){return this.get("greatTickStyle")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setUTC(t){return this.set("utc",t)}getUTC(){return this.get("utc")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}setFormatting(t,e,i){return this.withMutations((s=>s.set("formatOptionsGreatYear",t||this.formatOptionsGreatYear).set("formatOptionsGreatMonth",t||this.formatOptionsGreatMonth).set("formatOptionsGreatWeek",t||this.formatOptionsGreatWeek).set("formatOptionsGreatDay",t||this.formatOptionsGreatDay).set("formatOptionsGreatHour",t||this.formatOptionsGreatHour).set("formatOptionsGreatMinute",t||this.formatOptionsGreatMinute).set("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 Dh=(t,e)=>(i,s)=>{const r=s-i;if(e){const e=Math.log10(r/2);let n=10**Math.floor(e-t);const o=1/n;n=Math.round(n*o)/o;const h=Math.round(Math.floor(i/(10*n))*n*10*o)/o;return Xs(h,s,n,void 0,o)}const n=Math.log10(r);let o=10**Math.round(n-t);const h=1/o;return o=Math.round(o*h)/h,Hs(i,s,o,h)},Lh=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%5==0)):void 0,Ph=(t,e,i,s,r,n)=>0===e?t.filter(((t,e)=>e%2==0)):1===e?t.filter(((t,e)=>e%3==0)):2===e?t.filter(((t,e)=>e%4==0)):3===e?t.filter(((t,e)=>e%5==0)):void 0,_h=js(void 0,2,5),Vh=(t,e,i,s,r,n)=>0===e?[t[1],t[3],t[5]]:1===e?[t[0],t[3]]:2===e?[t[1]]:void 0,Bh=(t,e)=>{const i=Ei(t),s=wi(t);if(e)return(t,e)=>{const r=[],n=Math.floor(i(t)),o=Math.ceil(i(e));for(let t=n-1;t<=o+1;t+=1){const e=s**t;r.push(e)}return r};const r=10===t?9:4;return(t,e)=>{const n=Math.round(i(t)),o=Math.round(i(e)),h=[],a=s**n,l=(s**o-a)/r;for(let i=1;i<=r;i+=1){const s=a+l*i;s>t&&sIi.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),s=this.get("majorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ii.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),r=this.get("minorFormattingFunction")||("logarithmic"===t.type?(e,i)=>Ii.LogarithmicNoExponents(e,i,void 0,t.base):Ii.Numeric),n=[],o=[];xh(this.extremeTickStyle)||n.push({Ye:"Extreme ticks",ur:this.extremeTickStyle,ar:void 0===e?i:(t,s,r)=>i(e+t,s,r),Lr:Ys,Ne:!0,mr:!0}),o.push({Ye:"Major ticks",Eg:0,ur:this.majorTickStyle,ar:void 0===e?s:(t,i,r)=>s(e+t,i,r),Lr:"logarithmic"===t.type?Bh(t.base,!0):Dh(0,!0),bh:"logarithmic"===t.type?{Ar:Ph}:{Ar:Lh},Rr:void 0}),xh(this.minorTickStyle)||o.push({Ye:"Minor ticks",Eg:1,ur:this.minorTickStyle,ar:void 0===e?r:(t,i,s)=>r(e+t,i,s),Lr:"logarithmic"===t.type?Bh(t.base,!1):Dh(1,!1),bh:"logarithmic"===t.type?{Ar:Vh}:{Ar:_h},Rr:50});const h=this.cursorFormatter?this.cursorFormatter:Ii.Numeric;return{$e:n,Xe:o,We:void 0===e?h:(t,i,s)=>h(e+t,i,s),jh:1e-9,Zh:void 0}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setExtremeTickStyle(t){if("function"==typeof t){const e=this.get("extremeTickStyle");return this.set("extremeTickStyle",t(e))}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setTickStyle(t){const e=this.setMajorTickStyle(t).setMinorTickStyle(t);return e.extremeTickStyle!==ph?e.setExtremeTickStyle(t):e}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setFormattingFunction(t){return this.withMutations((e=>e.set("extremeFormattingFunction",t).set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getExtremeFormattingFunction(){return this.get("extremeFormattingFunction")}setExtremeFormattingFunction(t){return this.set("extremeFormattingFunction",t)}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Oh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new mh,minorTickStyle:new mh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Uh=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=9e4?"MajorMinutes":i>=10500?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Gh={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${de(s,2)}:${de(r,2)}:${de(n,2)}.${de(o,3)}${h}`}},Yh={MajorHours12:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,36e5,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Gh.hhmmss},MajorHours:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,6,12)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,3e5,1e6),fitKeyValues:js({},2,4,6)},defaultValueFormatter:Gh.hhmmss},MajorMinutes15:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Xs(t,e,9e5,void 0,1e6)),fitKeyValues:js({ignore:"first"},2)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,6e4,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Gh.hhmmss},MajorMinutes:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Xs(t,e,6e4,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,5e3,1e6),fitKeyValues:js({},2,3,4,6)},defaultValueFormatter:Gh.hhmmss},MajorSeconds15:{major:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Xs(t,e,15e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,4)},minor:{format:Gh.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,1e3,1e6),fitKeyValues:js({},3,5)},defaultValueFormatter:Gh.hhmmss},MajorSeconds:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Xs(t,e,1e3,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,100,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds100:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Xs(t,e,100,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,10,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds10:{major:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Xs(t,e,10,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,1,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmm},MajorMilliseconds:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Xs(t,e,1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.1,1e6),fitKeyValues:js({},2)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Xs(t,e,.1,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.01,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Xs(t,e,.01,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.001,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Xs(t,e,.001,void 0,1e6)),fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,100*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Xs(t,e,r,void 0,1e6)},fitKeyValues:js({ignore:"first"},2,5)},minor:{format:Gh.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,10*1e-6,1e6),fitKeyValues:js({},2,3,5)},defaultValueFormatter:Gh.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 Hh extends Oh{Hh(t){const e=this.timeOrigin||0,i=[{Ye:"Major ticks",Eg:0,ur:this.majorTickStyle,ar:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Uh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Yh[r].major.format)(t+e,i,s)},Lr:(t,e,i,s)=>{const r=Uh(i,s);return(0,Yh[r].major.getKeyValues)(t,e,i,s)},bh:{Ar:(t,e,i,s,r,n)=>{const o=Uh(r,n),h=Yh[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Rr:void 0}];return yh(this.minorTickStyle)&&i.push({Ye:"Minor ticks",Eg:1,ur:this.minorTickStyle,ar:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Uh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Yh[r].minor.format)(t+e,i,s)},Lr:(t,e,i,s)=>{const r=Uh(i,s);return(0,Yh[r].minor.getKeyValues)(t,e,i,s)},bh:{Ar:(t,e,i,s,r,n)=>{const o=Uh(r,n),h=Yh[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Rr:void 0}),{$e:[],Xe:i,We:this.cursorFormatter||((t,i,s)=>{const r=Uh(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Yh[r].defaultValueFormatter(t+e,i,s)}),jh:1e-4,Zh:864e6}}setTickStyle(t){return this.setMajorTickStyle(t).setMinorTickStyle(t)}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return this.set("minorTickStyle",t(e))}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setTimeOrigin(t){return this.set("timeOrigin",t)}getTimeOrigin(){return this.get("timeOrigin")}setFormattingFunction(t){return this.withMutations((e=>e.set("majorFormattingFunction",t).set("minorFormattingFunction",t).set("cursorFormatter",t)))}getMajorFormattingFunction(){return this.get("majorFormattingFunction")}setMajorFormattingFunction(t){return this.set("majorFormattingFunction",t)}getMinorFormattingFunction(){return this.get("minorFormattingFunction")}setMinorFormattingFunction(t){return this.set("minorFormattingFunction",t)}}const Xh=(t,e,i="image/png",s)=>{e+=`.${i.slice(i.indexOf("image/")+6)}`;const r=t.captureFrame(i,s);if("image/png"!==i&&r.type.includes("image/png"))throw new Error(`saveToFile | type not supported by browser: ${i}\nCheck support table for HTMLCanvasElement.toDataURL`);if(bt.navigator.msSaveBlob)bt.navigator.msSaveBlob(r,e);else{const t=bt.document.createElement("a");bt.document.body.appendChild(t);const i=bt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{bt.URL.revokeObjectURL(i),bt.document.body.removeChild(t)}),0)}},Wh=(t,i,s,r,n,o)=>{const h=t.Qu(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},jh=(t,e)=>{if("relative"===t)return e;if(t instanceof Pi)return t;const i=t.x instanceof Js?t.x.ft:t.x.x,s=t.y instanceof Js?t.y.ft:t.y.y;return Bi(i,s)},$h=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=fh(o)?o:Oi(o)?s:void 0;if(h&&zi(i)){const t=dt(n,h,r.ft);return r.Bo({engineX:t.x,engineY:t.y})}if(h&&Oi(i))return dt(n,h,s);if(h&&fh(i))return dt(n,h,i)}else{const i=t;if(Oi(e)){const t=r.Do(i);return dt({x:t.engineX,y:t.engineY},r.ft,s)}if(fh(e)){const t=e,s=r.Do(i);return dt({x:s.engineX,y:s.engineY},r.ft,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Zh{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.$g=[],this.Xg=[],this.L=new r.Eventer,this.jg=void 0,this.Zg=void 0,this.Qg=void 0,this.jt=x(0,0,0,0),this.Jg=!1,this.Xi=!1,this.Kg=()=>{this.qg=!0,this.tp.vs()},this.ip=t=>e=>{const i=this.$g.indexOf(e);-1!==i&&this.$g.splice(i,1),this.cs.vs(),t.U()},this.sp=t=>{const e=this.Xg.indexOf(t);-1!==e&&this.Xg.splice(e,1),this.cs.vs()},this.qg=!0,this.onInViewChange=t=>this.L.on("inViewChange",t),this.offInViewChange=t=>this.L.off(t,"inViewChange"),this.dA=t,this.ep=i,this.tp=s,this.removePanel=n,this.ts=e.cs.ts;const l=e.cs.ai();if(this.uiScale=i.d2({scaleXYConstructor:_i}).Oi(0,100).Ni(0,100).tt(l),this.pixelScale=i.d2({scaleXYConstructor:_i}).Oi(0,this.uiScale.x.getCellSize()).Ni(0,this.uiScale.y.getCellSize()).tt(l),this.engine=e.cs.hp,this.cs=e.cs.rp,this.hs=this.cs.hs.rs(this,{}),this.np=()=>e.op("unidentified ui"),this.ap=e.lp(),this.up=this.tp.Te(this.uiScale).Ie(u(0,0)).tt(u(100,100)).ke(o).Ce(h).setMouseMoveEventHandler(((t,e)=>this.L.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.L.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.L.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.L.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.L.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.L.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.L.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.L.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.L.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.L.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.L.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.L.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.L.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.L.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.Kg);this.cp=()=>a.off(t)}else{const t=e.cs.ko(this.Kg);this.dp=e.cs.To.bind(e.cs,t)}const c=e.cs.Io((t=>{this.Jg=t,this.L.emit("inViewChange",this,t)}));this.fp=e.cs.Po.bind(e.cs,c),this.jg=n}getTheme(){return this.ts}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.up.ke(t),this.tp.vs(),this}getBackgroundFillStyle(){return this.up.zh()}setBackgroundStrokeStyle(t){return this.up.Ce(t),this.tp.vs(),this}getBackgroundStrokeStyle(){return this.up.lo()}translateCoordinate(t,e,i){return $h(t,e,i,this.pixelScale,this.cs)}Ap(t){return this.$g.push(t),this.cs.vs(),t}gp(t){return this.Xg.push(t),this.cs.vs(),t}addUIElement(t=Vo,e=this.uiScale){e=jh(e,this.pixelScale);const i=this.np();return this.Ap(Wh(t,i,this.uiScale,e,this.ip(i),this.ts))}addLegendBox(t=$o,i=this.uiScale){i=jh(i,this.pixelScale);const s=this.gp(Wh(t,this.ap,this.uiScale,i,this.sp,this.ts));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.mi({x:50,y:0},{x:0,y:3}))),s}getLegendBoxes(){return this.Xg}dispose(){return this.Xi||(this.Xi=!0,this.dp&&this.dp(),this.cp&&this.cp(),Kh(this.uiScale),Kh(this.pixelScale),this.fp&&this.fp(),this.Zg&&this.Zg(),this.tp.U(),this.ap.U(),this.$g.slice().forEach((t=>{t.dispose()})),this.Xg.slice().forEach((t=>{t.dispose()})),this.cs.vs(),this.jg&&this.jg(this),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}saveToFile(t,e,i){return Xh(this.engine,t,e,i),this}Ir(t){this.jt=t,this.Kg()}Z(){return this.pixelScale.Z(),this.uiScale.Z(),this}J(){return this.pixelScale.J(),this.uiScale.J(),this}Fe(t){if(this.qg){const t=this.tp.cs.ai(),e=t.x,i=t.y;this.uiScale.tt(e,i),this.pixelScale.tt(e,i);const s=[this.jt.left,this.jt.right],r=[this.jt.bottom,this.jt.top];this.uiScale.zi(s),this.uiScale.Vi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.Oi(0,n.x).zi(s).Ni(0,n.y).Vi(r),this.L.emit("resize",this,n.x,n.y,e,i)}this.qg=!1}pp(){for(let t=0;t{t.si&&t.si()};class Jh extends Zh{constructor(t,e,i,s,r,n){super(t,e,i,e.yp("uipanel bg",0),s,e.cs.ts.uiPanelBackgroundFillStyle,e.cs.ts.uiPanelBackgroundStrokeStyle,n),this.mp(r,this.pixelScale)}setMinimumSize(t){return this.Md=t,this.cs.vs(),this}getMinimumSize(){return this.Md}Fe(t){super.Fe(t),super.pp()}}const qh=x(10,10,10,10);class Qh extends Zh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.Sp={},this.ya=qh,this.ih=!0,this.vp=e.xp("chart internal ui",0),this.bp=this.vp.Dr(this.uiScale).Eh("Chart").Ie(u(50,100)).za(u(0,1)).Nh(h).ke(a).setMouseInteractions(!1),this.Mp=this.hs.yg([this.bp]).Ss(this.ts.effectsText)}setAnimationsEnabled(t){return this.ih=t,this}getAnimationsEnabled(){return this.ih}setTitle(t){return this.bp.Eh(t),this.cs.vs(),this}getTitle(){return this.bp.Lh()}getTitleSize(){return this.bp.Ds().Zc()}setTitleFillStyle(t){return this.bp.ke(t),this.Kg(),this}getTitleFillStyle(){return this.bp.zh()}setTitleFont(t){return this.bp.Nh(t),this.Kg(),this}getTitleFont(){return this.bp.Oh()}setTitleRotation(t){return this.bp.Gh(t),this.cs.vs(),this}getTitleRotation(){return this.bp.Wh()}setTitleEffect(t){return this.Mp.Ss(t),this.cs.vs(),this}getTitleEffect(){return this.Mp.xs()}setTitleMargin(t){var e,i;return this.Sp="object"==typeof t?this.Sp?(e=this.Sp,{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.Kg(),this}getTitleMargin(){return this.Sp}setPadding(t){return this.ya="object"==typeof t?A(this.ya,t):{left:t,top:t,right:t,bottom:t},this.Kg(),this}getPadding(){return this.ya}_p(t){const e=t.wp(),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.vp.U(),this}}const ta={Cp:(t,e)=>t.zh()!==z&&0!==t.Lh().length&&t.getVisible()?t.Ds().Zc().y:0,kp(t,e){t.Ie(u(50,100)).Ir({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var ea;e.AutoCursorModes=void 0,(ea=e.AutoCursorModes||(e.AutoCursorModes={}))[ea.disabled=0]="disabled",ea[ea.snapToClosest=1]="snapToClosest",ea[ea.onHover=2]="onHover";const ia={Tp(t,i,s,r,n,o){let h;const a=t.getAutoCursorMode();if(!s&&a!==e.AutoCursorModes.disabled){const s=t.cs.Nn(),l=r.find((t=>t.getIsUnderMouse()));a===e.AutoCursorModes.snapToClosest&&n?(i||void 0!==l)&&(h=s&&n(s)):void 0===l||l.getCursorEnabled&&!l.getCursorEnabled()||(h=s&&o(l,s))}h?t.Fp.pointAt(h).setVisible(!0):t.Fp.setVisible(!1),t.Fp.Ds().Fe()},$c(t,e,i){if(e.xt.uiScale.x.ri()||e.yt.uiScale.y.ri())return;let s,r=Number.MAX_VALUE;for(const n of i)if(n.getCursorEnabled()&&n.getVisible()){const i=n.$c(e);if(i){const n=dt(i.location,i.scale,t.engine.scale),o=Xe(e,n);Number.isNaN(o)||s&&!(o{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundMouseMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchStart((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchMove((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),t.onSeriesBackgroundTouchEnd((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()}))},Pp(t,i){i.onMouseEnter(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),i.onMouseMove(((i,s)=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()})),i.onMouseLeave((()=>{t.getAutoCursorMode()!==e.AutoCursorModes.disabled&&t.cs.vs()}))}};class sa{constructor(t,e){this.Dp=t,this.Bp=e}alter(t){this.Lp=void 0!==this.Lp?this.Lp:this.Bp(),this.Rp=t,this.Dp(t)}resetValue(){void 0!==this.Rp&&(void 0!==this.Lp&&this.isAltered()&&this.Dp(this.Lp),this.Lp=void 0,this.Rp=void 0)}getNormalValue(){return void 0!==this.Lp?this.Lp:this.Bp()}isAltered(){return void 0!==this.Rp&&this.Bp()===this.Rp}}class ra{constructor(t,e){this.Ep=[],this.zp=t,this.ft=e}update(){return this.zp.getVisible()?!(this.Vp()&&(!this.Op()||(this.resetTable(),this.zp.Ds(),this.Vp()))&&(this.Np(),this.zp.Ds(),this.Vp()&&(this.resetTable(),this.zp.Ds(),1))):(this.Op()&&this.resetTable(),!0)}Op(){for(let t=0;t{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.zp,this.ft)}Gp(){return((t,i)=>{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.zp,this.ft)}Wp(){return((t,i)=>{const s=dt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=dt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.zp,this.ft)}Yp(t){return this.Ep.push(t),t}}class na extends ra{constructor(){super(...arguments),this.ma=this.Yp(new sa((t=>this.zp.setOrigin(t)),(()=>this.zp.getOrigin())))}Np(){const t=this.ma.getNormalValue(),e=u(this.Gp()?-t.x:t.x,this.Wp()?-t.y:t.y);this.ma.alter(e)}}class oa extends ra{constructor(t,e,i,s){super(t,e),this.Hp=this.Yp(new sa((t=>this.zp.setTextFont((e=>e.setSize(t)))),(()=>this.zp.getTextFont().getSize()))),this.$p=i,this.Xp=s}Np(){const t=this.Hp.getNormalValue(),e=this.$p;if(enew na(t,e),FontSize:(t=5,e=5)=>(i,s)=>new oa(i,s,t,e)};class aa{constructor(){this.jp=[]}addRow(...t){return this.jp.push(t),this}}class la extends aa{Qu(){const t=this.jp;return this.jp=[],t}Zp(){return this.jp.length=0,this}}class ua extends To{constructor(){super(...arguments),this.Gu=this.ts.cursorResultTableTextFont,this.Bd=0,this.Qp=this.ts.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=r.getMembers().length;for(let n=0;n=e)r.getMembers()[n].dispose(),n-=1,i-=1;else if(void 0!==l&&l.length>0||u){for(let t=c.length;t{for(const e of Object.keys(h)){const i=h[e];t.set(e,i)}return t})):this.Gu,e=a||this.Qp,i=c[n];if(l){let s;i&&i instanceof fo?s=i:(i&&i.dispose(),s=r.addElement(go,n)),s.setFont(t).setFillStyle(e).setText(l).setTextRotation(this.Bd)}else if(u){let s;i&&i instanceof So?s=i:(i&&i.dispose(),s=r.addElement(Ao,n)),s.setFillStyle(e).setShape(u).setSize({y:t.size,x:t.size}),s.setMargin(5)}}else{for(let t=c.length;tt.setFillStyle(r.cursorResultTableFillStyle).setStrokeStyle(r.cursorResultTableStrokeStyle))).setTextFillStyle(r.cursorResultTableTextFillStyle).setTextFont(r.cursorResultTableTextFont),this.sm=ha.Flip(this.zp,this.scale)}dispose(){return this.im.dispose(),this.zp.dispose(),this}pointAt(t){return this.ca=t.scale===this.scale?t.location:dt(t.location,t.scale,this.scale),this.im.setPosition(this.ca),this.zp.setPosition(this.ca).setContent(t.resultTableContent),this.Ts.vs(),this}getPosition(){return this.ca}setVisible(t){return this.ji=t,this.Ts.vs(),this}getVisible(){return this.ji}setPointMarkerVisible(t){return this.Kp=t,this.Ts.vs(),this}getPointMarkerVisible(){return this.Kp}setPointMarker(t){return t(this.im),this.Ts.vs(),this}getPointMarker(){return this.im}setResultTableVisible(t){return this.qp=t,this.Ts.vs(),this}getResultTableVisible(){return this.qp}setResultTable(t){return t(this.zp),this.Ts.vs(),this}getResultTable(){return this.zp}setAutoFitStrategy(t){return this.sm&&this.sm.resetTable(),this.sm=t?t(this.zp,this.Ts.cs.ft):void 0,this.Ts.vs(),this}getAutoFitStrategy(){return void 0!==this.sm}Fe(){return this.sm&&this.sm.update(),this.zp.setVisible(this.Jg&&this.ji&&this.qp),this.im.setVisible(this.Jg&&this.ji&&this.Kp),this.im.Fe(),this.zp.Fe(),this}Ds(){return this.im.Ds(),this.zp.Ds(),this.Jg=((t,e,i=e)=>{const s=e!==i?dt(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.ca,this.scale),this}}class da extends ca{constructor(){super(...arguments),this.hm=!1}pointAt(t){return this.rm(t.fillStyle),super.pointAt(t)}rm(t){t&&this.hm&&this.zp.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.hm=t,this.Ts.vs(),this}getResultTableAutoTextStyle(){return this.hm}}class fa extends ca{setPosition(t){return this.ca=t,this.im.setPosition(t),this.zp.setPosition(t),this.Ts.vs(),this}}class ga{constructor(t,e=[]){this.nm=[],this.om=(t,e)=>(this.nm.forEach((i=>i(t,e))),t),this.tm=t,this.nm=e}}class ma extends ga{constructor(){super(...arguments),this.am=(t,e,i,s)=>this.om(new da(t,e,i,this.tm,s),s),this.addStyler=t=>new ma(this.tm,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ma(t,this.nm.map((t=>t)))}}class ya extends ga{constructor(){super(...arguments),this.lm=(t,e,i,s)=>this.om(new fa(t,e,i,this.tm,s),s),this.addStyler=t=>new ya(this.tm,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ya(t,this.nm.map((t=>t)))}}const pa=t=>t.setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),xa=(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))),Sa=new ma(mo,[pa]),Aa=new ma(xo,[pa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof xo&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),va=Sa,ba=Sa,Ma=Aa,Ea=new ya(mo,[xa,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(Ts.LeftBottom)))]),wa=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,owner:s,fillStyle:r});var Ta;e.SliceLabelIndices=void 0,(Ta=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Ta.LabelsInsideSlices=0]="LabelsInsideSlices",Ta[Ta.LabelsOnSides=1]="LabelsOnSides";const ka={SortByName:(t,e)=>t.getName().localeCompare(e.getName(),void 0,{numeric:!0}),SortByValueAscending:(t,e)=>t.getAnimatedValue()-e.getAnimatedValue(),SortByValueDescending:(t,e)=>e.getAnimatedValue()-t.getAnimatedValue(),None:()=>0},Ca={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`},Ra=(t,e,i,s)=>t.addRow(i.getName()).addRow(i.getAnimatedValue().toString());class Ia extends Yi{constructor(){super(...arguments),this.Ms="Slice",this.S=0}}const Fa=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class Da extends Ia{}class La extends Da{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.um=!1,this.dm=z,this.fm=z,this.Am=this.S,this.gm=this.um?1:0,this.pm=this.getVisible(),this.ym=K((()=>this.Ki.cs.vs())),this.Sm=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.bm=()=>{this.Mm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this._m=e.Kc(r).ds(this.getHighlight()),this.fs(this._m),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0}),this.onMouseClick(Fa),this.onTouchEnd(Fa)}setValue(t){return this.Ki.getAnimationsEnabled()?this.pm&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setExploded(t){if(t&&!1===this.Ki.getMultipleSliceExplosion()){const t=this.Ki.getSlices();for(let e=0;e{this.gm=t,this.Ki.cs.vs()})),this.Mm.onEveryAnimationEnd(this.bm),this.um=!this.um):!1!==this.Ki.getMultipleSliceExplosion()||t?(this.gm=this.um?0:1,this.um=!this.um):(this.gm=0,this.um=!this.um),this.Ki.cs.vs(),this}getExploded(){return this.um}setVisible(t){return this.pm=t,!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.dm=t,this.fm=i,this._m.ke(this.dm).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;toi(e,ni(pi(.5*(t.Kl()+t.Fi())*Math.PI/180),i)),_a=(t,e,i,s,r,n)=>{const o=t.length;let h=90;for(let a=0;a{const e=t.getSlices();for(let t=0;t{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.Wm=i.Um("pieChart bottom",0),this.Ym=i.Um("pieChart top",1),this.bp.Eh("Pie Chart"),this.mp(n,this.pixelScale),this.onBackgroundMouseDoubleClick(Va);const a=Wi(new ji(Va));this.onBackgroundTouchStart(a.onTouchStart),this.onBackgroundTouchMove(a.onTouchMove),this.onBackgroundTouchEnd(a.onTouchEnd),this.Hm=i.$m();const l=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=l.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new La(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);this.Bm+=1,i.setName(t);const s=this.ih;return this.ih=!1,i.setValue(e),this.ih=s,i.setEffect(this.Em),this.Xm(i),this.Cm.push(i),this.Gm(),i.setHighlightOnHover(this.Im),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){this.Dm="function"==typeof t?t(this.Dm):t;for(let t=0;te.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);if(this.Gd){const t=this.Gd;this.Cm.forEach((e=>{this.Xm(e,new G({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Cm[t]._m.setVisible(e),this.Cm[t].Ye.setVisible(e)}this.Cm=this.Cm.sort(this.km);const r=this.Cm.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;twa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e=this.Tm(t.index,t)){t.setStyle(e,this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return super.dispose(),this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Ym.U(),this.Wm.U(),this.Hm.U(),this}}const za={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Na=(...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 Oa extends Ba{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.jm=Ca.NamePlusValue,this.Qm=[],this.Jm=40,this.Km=5,this.qm=10,this.ty=this.ts.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t{const r=360*e[s],h=c-r,a=pi(gi(.5*(c+h))),l=a.x>=0?-1:1,d=oi(oi(i,ni(a,u+n)),{x:l*-o,y:0});c=h;const f={x:l,y:0};t.Ye.Ie(d).za(f),t.Ye.Ds();const g=Ze(t.Ye.Ue());return{position:d,alignment:f,shape:t.Ye,boundaries:g,sliceAngleVec:a,slice:t}})),f=[];for(let t=0;t{const s=t.slice._m,r=Pa(s,i,u+h+a*t.slice.getAnimatedExplosion()),n=fi(t.position.y,r,i),o=t.position;this.iy([r,n,o])}))}getMinimumSize(){return u(500,300)}iy(t){let e;for(let t=0;t{if(qi(t)){const e=t.getThickness(),i=t.getFillStyle();if(Y(i))return 1===e?hr:new lr({size:e,fillStyle:i,shape:"sphere"})}return hr};class Ha{constructor(t,e,i,s){this.hy=[],this.ny=new Map,this.oy=t,this.ly=e,this.uy=i,this.Ay=s}gy(){this.uy&&this.uy();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.hy.slice(),r=[];e.forEach((t=>{let e=s.pop();e||(e=this.oy(),this.hy.push(e));const n=[],o=e.py().slice();t.instances.forEach(((t,e)=>{const i=o.shift();n.push({...t,existingMember:i})}));const h=this.ly(e,n,t.sharedProperties);i=ne(i,h,{canReturnB:!0});for(let i=0;i{null==e||e.bd(t)}))})),s.forEach((t=>{t.dispose();const e=this.hy.indexOf(t);e<0?me(0,(()=>{})):this.hy.splice(e,1)})),r.forEach((t=>{const e=this.ny.get(t.Go);e&&t.collection.cs.io({entity:e.collection,collectionMember:e.member},{entity:t.collection,collectionMember:t.member})})),this.ny.clear(),r.forEach((t=>{this.ny.set(t.Go,t)})),this.Ay&&this.Ay(this.hy,i)}}}my(){this.hy.forEach((t=>{t.dispose()})),this.hy.length=0}}class Xa{constructor(t){this.yy=[],this.Sy=t}gy(){return this.vy(),{add:()=>this.el(),finishPlot:()=>{this.xy()}}}el(){let t=this.yy.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.Sy()},this.yy.push(t)),t.isFree=!1,t.shape}vy(){this.yy.forEach((t=>{t.isFree=!0}))}xy(){this.yy.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.yy.splice(this.yy.indexOf(t),1)}))}my(){this.yy.forEach((t=>t.shape.dispose())),this.yy.length=0}}class Wa{constructor(t,e,i,s,n,o,h,a,l,u){this.L=new r.Eventer,this.S=0,this.ji=!0,this.Xi=!1,this.vs=t,this.by=e,this.My=i,this._y=s,this.wy=n,this.Cy=o,this.Bd=h,this.Qp=a,this.ky=l,this.Ku=u}setValue(t){return t===this.S||(this.S=t,this.vs(),this.L.emit("valueChange",this,this.S)),this}getValue(){return this.S}setTickStyle(t){return this.My="function"==typeof t?t(this.My):t,this.vs(),this}getTickStyle(){return this.My}setTickLength(t){return this._y=t,this.vs(),this}getTickLength(){return this._y}setGridStrokeStyle(t){return this.wy="function"==typeof t?t(this.wy):t,this.vs(),this}getGridStrokeStyle(){return this.wy}setTextPadding(t){return this.Cy=t,this.vs(),this}getTextPadding(){return this.Cy}setTextRotation(t){return this.Bd=t,this.vs(),this}getTextRotation(){return this.Bd}setTextFillStyle(t){return this.Qp="function"==typeof t?t(this.Qp):t,this.vs(),this}getTextFillStyle(){return this.Qp}setTextFont(t){return this.ky="function"==typeof t?t(this.ky):t,this.vs(),this}getTextFont(){return this.ky}setTextFormatter(t){return this.Ku=t,this.vs(),this}onValueChange(t){return this.L.on("valueChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}dispose(){return this.Xi||(this.Xi=!0,this.by(),this.vs(),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setVisible(t){const e=this.ji!==t;return this.ji=t,e&&(this.L.emit("visibleStateChanged",this,this.ji),this.vs()),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}class ja extends Js{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Ty({x:t.cs.ts.xAxis3DNumericTicks,y:t.cs.ts.yAxis3DNumericTicks,z:t.cs.ts.zAxis3DNumericTicks}),datetime:e.Ty({x:t.cs.ts.xAxis3DDateTimeTicks,y:t.cs.ts.yAxis3DDateTimeTicks,z:t.cs.ts.zAxis3DDateTimeTicks}),time:e.Ty({x:t.cs.ts.xAxis3DTimeTicks,y:t.cs.ts.yAxis3DTimeTicks,z:t.cs.ts.zAxis3DTimeTicks})},{type:"linear"}),this.Ff=[],this.Fy=()=>{},this.Iy=()=>{},this.Py=()=>{},this.Dy=()=>{},this.chart=t,this.yt=r,this.By=n,this.Ly=o,this.Ry=this.yt.ft;const l=this.Ch.Ty({x:this.ts.xAxis3DStrokeStyle,y:this.ts.yAxis3DStrokeStyle,z:this.ts.zAxis3DStrokeStyle});this.Ey=this.yt.sy([za.InternalUI]).Ee(l).zy(Ya(l)).setMouseInteractions(!1),this.Rh=this.By.Dr(this.Ly).setMouseInteractions(!1).ke(e.Ty({x:t.cs.ts.xAxis3DTitleFillStyle,y:t.cs.ts.yAxis3DTitleFillStyle,z:t.cs.ts.zAxis3DTitleFillStyle})).Nh(e.Ty({x:t.cs.ts.xAxis3DTitleFont,y:t.cs.ts.yAxis3DTitleFont,z:t.cs.ts.zAxis3DTitleFont})),this.Vy=new Xa((()=>this.By.Dr(this.Ly))),this.Oy=new Ha((()=>this.yt.Rg().setMouseInteractions(!1)),((t,e,i)=>(t.Gt().Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>i||t.ol(e)))))),this.hs=a,this.Uh=this.hs.yg([this.Rh]).Ss(s.effectsText),this.Ey.setMouseEnterEventHandler(this.Fy).setMouseLeaveEventHandler(this.Iy).setMouseDragEventHandler(this.Py).setMouseDragStopEventHandler(this.Dy),i.sg=this}setTickStrategy(t,e){return super.Ih(t,e)}getTickStrategy(){return this.Ze}addCustomTick(){const t=new Wa((()=>this.chart.cs.vs()),(()=>{const e=this.Ff.indexOf(t);e>=0&&this.Ff.splice(e,1)}),this.ts.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickLength,this.ts.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.ts.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.ts.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Ff.push(t),this.chart.cs.vs(),t}setStrokeStyle(t){return this.Ey.Ee(t).zy(Ya(this.Ey.cu())),this.chart.cs.vs(),this}getStrokeStyle(){return this.Ey.cu()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Ey.setVisible(t),!1===t&&(this.Oy.my(),this.Vy.my()),this.By.vs(),this}wg(){return this.chart.getSeries()}Ny(t){return Math.abs(this.ft.it(t)*this.yt.Gy(1))}kr(t,e,i){const s=Math.abs(this.ft.it(e-t)*this.yt.Gy(1));return{min:t-i*s,max:e+i*s}}cr(t,e){return new $a(e,t,this.By,this.Ly,this.yt)}dr(t,e){const i=this.Wy(e,t.S,t.xh.ur.tickLength,t.xh.ur.tickPadding);return t.Ye.Ie(i.labelPosition).za(i.labelAlignment),i}Wy(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ft.getInnerStart())/(this.ft.getInnerEnd()-this.ft.getInnerStart()),c=De.addVec($e(n,o,l),De.multiplyVec(De.multiply(h,this.yt.Gy(.5*this.Ey.cu().getThickness())),r)),d=De.addVec(c,De.multiplyVec(De.multiply(h,this.yt.Gy(i)),r)),f=this.yt.Uy(d)||u(0,0);return{labelPosition:oi(dt(f,this.chart.engine.scale,this.Ly),ni(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}Yy(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ft.getInnerStart())/(this.ft.getInnerEnd()-this.ft.getInnerStart()),a=De.addVec($e(r,n,h),De.multiplyVec(De.multiply(o,this.yt.Gy(.5*this.Ey.cu().getThickness())),s)),l=De.addVec(a,De.multiplyVec(De.multiply(o,this.yt.Gy(10)),s)),c=this.yt.Uy(a)||u(0,0),d=this.yt.Uy(l)||u(0,0);return this.By.ze(this.Ly).Oe(c).Ve(d).Ee(new Ji({fillStyle:new G({color:T(120*i)}),thickness:1}))}wr(t,e){return Za(t,e,this.ft)}Fe(t){if(!this.ji)return;const e=Math.min(this.Ph,this.Dh),i=Math.max(this.Ph,this.Dh),s=this.Ry,r=f(s.x.ht(),s.y.ht(),s.z.ht());let n,o;this.Hy()?(n=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerStart()),o=f(s.x.getInnerEnd(),s.y.getInnerStart(),s.z.getInnerEnd())):(n=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),o=this.Ch.$y(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.Ch.Kd,a=this.yt.Uy(n)||u(0,0),l=this.yt.Uy(o)||u(0,0),c=$e(n,o,.5),d=De.addVec(c,De.multiplyVec(De.multiply(h,-1),r)),g=this.yt.Uy(c)||u(0,0),m=this.yt.Uy(d)||u(0,0),y=ii(hi(dt(g,this.chart.engine.scale,this.Ly),dt(m,this.chart.engine.scale,this.Ly)));this.Ey.Gt().ol([n,o]);const{gridlinePositionA:p,gridlinePositionB:x,gridlinePositionC:S}=this.Ch.Xy(t),A=t=>({x:-1===t.x?this.Ry.x.getInnerStart():1===t.x?this.Ry.x.getInnerEnd():0,y:-1===t.y?this.Ry.y.getInnerStart():1===t.y?this.Ry.y.getInnerEnd():0,z:-1===t.z?this.Ry.z.getInnerStart():1===t.z?this.Ry.z.getInnerEnd():0}),v=A(p),b=A(x),M=A(S),E={physicalAxisSize:ri(hi(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:y,gridlinePositionA:v,gridlinePositionB:b,gridlinePositionC:M},w=this.tr(E),T=this.Oy.gy();for(const[t,e]of this.Qe)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.jy(E,e);T.add({Go:0,positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.ur.tickStyle}),s.gridStroke&&T.add({Go:0,positions:s.gridStroke},{lineStyle:t.ur.gridStrokeStyle})}const k=this.Vy.gy(),C={x:0,y:0};this.Ff.forEach((t=>{if(!t.ji||t.Si)return;const s=this.Wy(E,t.S,t._y,t.Cy),r=this.jy(E,s),n=k.add().Ie(s.labelPosition).za(s.labelAlignment).ke(t.Qp).Nh(t.ky).Eh(t.Ku(t.S)).Gh(t.Bd).Ds().ai();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),T.add({Go:0,positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.My}),r.gridStroke&&T.add({Go:0,positions:r.gridStroke},{lineStyle:t.wy})})),k.finishPlot(),T.finishPlot();const R=this.pr(((t,e)=>{const i=e.Ye.ai();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-a.y)/(l.x-a.x));this.Rh.za({x:0,y:0}).Gh(180*-I/Math.PI);const F=De.addVec(c,De.multiplyVec(De.multiply(h,this.yt.Gy(.5*this.Ey.cu().getThickness()+this.yr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),D=this.yt.Uy(F)||u(0,0),L=oi(dt(D,this.chart.engine.scale,this.Ly),oi(oi(ai(R,y),ni(y,this.yr(((t,e)=>Math.max(t,e.labelPadding)),0))),ai(ni(this.Rh.Ds().ai(),.5),y)));this.Rh.Ie(L),this.Ey.Zy={overrideFollowing:!1,skipMousePicking:!1}}jy(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return Ct(h,0)||Ct(h,1)||(a=[this.Qy()?{...i,x:n.x}:this.Jy()?{...i,y:n.y}:this.Hy()?{...i,z:n.z}:{x:0,y:0,z:0},this.Qy()?{...s,x:n.x}:this.Jy()?{...s,y:n.y}:this.Hy()?{...s,z:n.z}:{x:0,y:0,z:0},this.Qy()?{...r,x:n.x}:this.Jy()?{...r,y:n.y}:this.Hy()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Yh(){super.Yh(),this.Oy.my(),this.Vy.my()}Qy(){return this.Ch.Qy()}Jy(){return this.Ch.Jy()}Hy(){return this.Ch.Hy()}}class $a extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ky=r}}const Za=(t,e,i)=>Rt(t+.1*(e-t)+Math.abs(i.ht())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Ka=(t,e,i,s)=>({Sr:()=>{const i=t();let s;for(const t of i){if(!t.qy())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},vr:()=>{const e=t();let s;for(const t of e){if(!t.qy())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},Mr:()=>{const e=t();let i;for(const t of e){if(!t.qy())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),Ja=t=>({...Ka(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Mr().y)),Ty:t=>t.y,$y:(t,e)=>({x:e.x,y:t.y,z:e.z}),Kd:f(-1,0,0),Xy: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)}},Qy:()=>!1,Jy:()=>!0,Hy:()=>!1}),qa=t=>({...Ka(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.Mr().z)),Ty:t=>t.z,$y:(t,e)=>({x:e.x,y:e.y,z:t.z}),Kd:f(1,0,0),Xy: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)}},Qy:()=>!1,Jy:()=>!1,Hy:()=>!0});class Qa extends Yi{constructor(t,e,i,s,r){super(t,e,s,r),this.tS=Hn,this.iS=!0,this.sS=!0,this.Ki=t,this.yt=i,this.ss=new Map,this.onMouseWheel(this.Ki.eS),this.onMouseDrag(this.Ki.hS),this.onTouchStart(this.Ki.rS.onTouchStart),this.onTouchMove(this.Ki.rS.onTouchMove),this.onTouchEnd(this.Ki.rS.onTouchEnd)}setAutoScrollingEnabled(t){return this.iS=t,this.Ki.cs.vs(),this}getAutoScrollingEnabled(){return this.iS}setColorShadingStyle(t){return this.tS=t,this.ss.forEach(((e,i)=>i.nS(t))),this.yt.vs(),this}getColorShadingStyle(){return this.tS}setDepthTestEnabled(t){return this.sS=t,this.ss.forEach(((e,i)=>i.oS(t))),this.yt.vs(),this}getDepthTestEnabled(){return this.sS}aS(){}Fe(){}Ay(){}getXMax(){const t=this.Ga;return t?t.bt():void 0}getXMin(){const t=this.Ga;return t?t.xt():void 0}getYMax(){const t=this.Ga;return t?t._t():void 0}getYMin(){const t=this.Ga;return t?t.Mt():void 0}getZMax(){const t=this.Ga;return t?t.lS():void 0}getZMin(){const t=this.Ga;return t?t.uS():void 0}Mr(){const t=this.Ga;return t?f(t.xl(),t.bl(),t.cS()):f(0,0,0)}}class tl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Box Series 3D",this.dS=.25,this.fS=!1,this.Wd=()=>ue(this.be),this.be=fe(this.ts.boxSeries3DFillStyle,r),this.Ga=this.yt.gS().oS(this.sS).ke(this.be).AS(this.dS).ds(this.getHighlight()),this.fs(this.Ga)}invalidateData(t){const e=t.length;if(0===e)return this;this.fS&&this.Ki.cs.Gn(ah.xf);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;iue(this.uu.getFillStyle())}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Ga.Ee(e),this.yt.vs(),this}getStrokeStyle(){return this.uu}add(t){return this.fS&&this.Ki.cs.Gn(ah.xf),this.fS=!0,(t=Array.isArray(t)?t:[t])?(this.Ga.ol(t.slice()),this.yt.vs(),this):this}clear(){return this.Ga.Gt(),this}getPointAmount(){const t=this.Ga;return t.al()+t.ll()}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.uu}),this}}class il extends el{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Line Series 3D",this.uu=fe(s.lineSeries3DStrokeStyle,r),this.mS=wr.pointStyle3D,this.yS(this.uu),this.Ga=this.yt.sy([za.UserSeries]).oS(this.sS).Ee(this.uu).zy(this.mS).ds(this.getHighlight()),this.fs(this.Ga)}setStrokeStyle(t){super.setStrokeStyle(t),this.yS(this.uu);const e=this.mS;return this.Ga.zy(e),this}yS(t){const e=new gr.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.mS=e}}class sl extends el{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Point Line Series 3D",this.Wd=()=>ue(this.uu.getFillStyle())||ue(this.mS.getFillStyle()),this.mS=fe(s.pointLineSeries3DPointStyle,r),this.uu=fe(s.lineSeries3DStrokeStyle,r),this.SS(),this.Ga=this.yt.sy([za.UserSeries]).oS(this.sS).Ee(this.uu).zy(this.mS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){return this.mS="function"==typeof t?t(this.mS):t,this.SS(),this.Ga.zy(this.mS),this.yt.vs(),this}getPointStyle(){return this.mS}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.uu,i=Math.abs(e.getThickness()),s=this.mS,r=s.getSize();i>("object"==typeof r?Math.max(r.x,r.y,r.z):r)&&(this.mS=s.setSize(i)),this.SS();const n=this.mS;return this.Ga.zy(n),this.yt.vs(),this}SS(){const t=this.mS,e=t.getSize();this.mS=t.setSize(e)}Pe(t,e){t.ds(e),this.yt.vs()}}class rl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.fS=!1,((null==n?void 0:n.individualPointSizeAxisEnabled)||(null==n?void 0:n.individualPointSizeEnabled))&&this.Ki.cs.Gn(ah.bf)}add(t){return this.fS&&this.Ki.cs.Gn(ah.xf),this.fS=!0,(t=Array.isArray(t)?t:[t])?(this.Ga.ol(t.slice()),this.yt.vs(),this):this}clear(){return this.Ga.Gt(),this}getPointAmount(){const t=this.Ga;return t.al()+t.ll()}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{point3D:this.vS}),this}}class nl extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ms="Point Series 3D",this.Wd=()=>ue(this.vS.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ki.getSeries().length;this.vS=fe(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Ga=this.yt.bS(h).oS(this.sS).xS(this.vS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){this.vS="function"==typeof t?t(this.vS):t;const e=this.vS;return this.Ga.xS(e),this.yt.vs(),this}getPointStyle(){return this.vS}}class ol extends rl{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ms="Point Cloud Series 3D",this.Wd=()=>ue(this.vS.getFillStyle());const o=this.Ki.getSeries().length;this.vS=fe(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Ga=this.yt.bS(h).xS(this.vS).ds(this.getHighlight()),this.fs(this.Ga)}setPointStyle(t){this.vS="function"==typeof t?t(this.vS):t;const e=this.vS;return this.Ga.xS(e),this.yt.vs(),this}getPointStyle(){return this.vS}}const hl={Triangulated:nl,Pixelated:ol};class al extends Qh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.MS=[],this._S=0,this.wS=t=>{const e=this.MS.indexOf(t);e>=0&&(this.MS.splice(e,1),this.L.emit("seriesDispose",this,t))},this.CS=()=>{this._S+=1},this.kS=()=>{this._S-=1},this.onSeriesBackgroundMouseEnter=t=>this.L.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.L.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.L.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.L.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.L.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.L.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.L.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.L.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.L.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.L.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.L.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.L.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.L.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.L.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.L.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.L.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.L.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.L.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.L.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.L.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.L.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.L.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.L.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.L.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.L.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.L.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.L.off(t,"touchEndSeriesBackground"),this.TS=this.hs.yg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.MS.forEach((e=>e.setAnimationHighlight(t))),this}FS(t,e){this.TS.As([e]),t.setMouseMoveEventHandler(((t,e)=>{this.L.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.L.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.L.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.L.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.L.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.L.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.L.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.L.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.L.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.L.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.L.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.L.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.L.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.L.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.IS.ke(t),this.cs.vs(),this}getSeriesBackgroundFillStyle(){return this.IS.zh()}setSeriesBackgroundStrokeStyle(t){return this.PS.Ce(t),this.cs.vs(),this}getSeriesBackgroundStrokeStyle(){return this.PS.lo()}setSeriesBackgroundEffect(t){return this.TS.Ss(t),this.cs.vs(),this}getSeriesBackgroundEffect(){return this.TS.xs()}DS(t){this.MS.push(t),t.onMouseEnter(this.CS),t.onMouseLeave(this.kS),void 0!==this.BS&&t.setHighlightOnHover(this.BS),this.L.emit("seriesAdded",this,t)}Qd(){return this.MS}LS(){return this._S}setSeriesHighlightOnHover(t){return this.BS=t,this.MS.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.MS.slice().forEach(Tt),super.dispose()}RS(t){return this.L.on("seriesAdded",t)}ES(t){return this.L.off(t)}zS(t){return this.L.on("seriesDispose",t)}VS(t){return this.L.off(t)}}const ll=De.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class ul{constructor(t,e,i,s){this.OS=!0,this.NS=!0,this.GS=2*-Math.PI/2160,this.WS=2*Math.PI/2160,this.US=.1,this.YS=1*Math.PI/180,this.HS=t,this.$S=e,this.XS=i,this.Uy=s}getDefaultCameraConfiguration(t){const e={direction:ll,location:De.multiply(ll,-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.jS(i,t):"wheel-zoom"===t.type?i=this.ZS(i,t):"rotate+zoom"===t.type?i=this.QS(i,t):"fixed-rotate"===t.type?i=this.JS(i,t):"move"===t.type&&(i=this.KS(i,t))})),this.OS?i=this.qS(t.boundingBox,i):this.NS&&(i=this.tv(t.boundingBox,i)),i}jS(t,e){const{rotation:i}=e,s=t.location,r=De.multiply(De.normalize(t.location),-1),{Right:n,Up:o}=this.sv(r);let h=s;const a=this.ev(r),l=i.x*this.GS*a;h=De.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.WS,a-this.YS);return 0!==u&&(h=De.rotateAroundAxis(h,n,u)),{location:h,direction:De.multiply(De.normalize(h),-1)}}ZS(t,e){const{deltaY:i}=e;this.OS&&this.hv(!1);const s=t.location,r=De.multiply(De.normalize(s),-1),n=i*this.US,o=De.length(s)*-n;return{direction:r,location:De.addVec(s,De.multiply(r,o))}}QS(t,e){const{rotation:i,cameraDistance:s}=e;this.OS&&this.hv(!1);let r=this.jS(t,{type:"rotate",rotation:i});const n=r.location,o=De.multiply(De.normalize(n),-1),h=De.multiply(o,-s);return r={direction:De.multiply(De.normalize(h),-1),location:h},r}JS(t,e){this.OS&&this.hv(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.sv(r),h=i.x*this.GS;let a=De.normalize(De.rotateAroundAxis(r,o,h));const l=i.y*this.WS;return a=De.normalize(De.rotateAroundAxis(a,n,l)),{location:s,direction:a}}KS(t,e){this.OS&&this.hv(!1),this.NS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.sv(n);return{location:De.addVec(r,De.multiply(n,.01*s),De.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};return this.OS?this.qS(t.boundingBox,e):this.tv(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};return this.OS?this.qS(t.boundingBox,e):this.tv(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:De.multiply(De.normalize(t.cameraLocation),-1)};if(this.OS)return this.qS(t.boundingBox,e)}qS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.rv(t,s,100,20,1,i,5);const r=this.ev(s.direction);return s=this.nv(s,this.ov(t,s,100,1),r),s}rv(t,e,i,s,r,n,o){return cl(n,o,(t=>({direction:e.direction,location:De.multiply(e.direction,-t)})),(e=>this.av(t,e)),i,r,"linear",s)}ov(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.sv(e.direction),a=this.lv(t,!1,e);let l=e;const u=s,c=.1;return Math.abs(a.bottom-a.top)>u&&(l=a.bottom({location:l.location,direction:De.normalize(De.lerp(l.direction,h,t))})),(e=>this.uv(t,e)),0,u,!0,i):dl(0,c,(t=>({location:l.location,direction:De.normalize(De.lerp(l.direction,o,t))})),(e=>this.uv(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:De.normalize(De.lerp(l.direction,n,t))})),(e=>this.cv(t,e)),0,u,!0,i):dl(0,c,(t=>({location:l.location,direction:De.normalize(De.lerp(l.direction,r,t))})),(e=>this.cv(t,e)),0,u,!0,i)),l}av(t,e){const i=this.lv(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}cv(t,e){const i=this.lv(t,!1,e);return Math.abs(i.left-i.right)}uv(t,e){const i=this.lv(t,!1,e);return Math.abs(i.top-i.bottom)}lv(t,e,i){const s=Ze(this.dv(t,e,i).map((t=>dt(t,this.HS,this.$S))));return{left:s.min.x,right:this.$S.x.getInnerEnd()-s.max.x,top:this.$S.y.getInnerEnd()-s.max.y,bottom:s.min.y}}dv(t,e,i){const s=this.XS,r=f(s.x.getInnerStart(),s.y.getInnerStart(),s.z.getInnerStart()),n=f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),o=[],h=e?16:4,a=(r.x+n.x)/2,l=(r.z+n.z)/2,u=Math.sqrt(2)*(n.x-a),c=Math.sqrt(2)*(n.z-l);return[r.y,n.y].forEach((t=>{for(let e=0;ethis.Uy(t,i))).filter((t=>void 0!==t))}tv(t,e){const i=De.length(e.location),s=this.fv(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)ue(this.be),this.tS=Gn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.be=fe(this.ts.surfaceGridSeries3DFillStyle,o),this.pv=fe(this.ts.surfaceGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows};this.Yn=h,this.Ga=this.yt.yv(h).ke(this.be).mv(this.pv).nS(this.tS).ds(this.getHighlight()),this.fs(this.Ga),s.start&&this.setStart(s.start),s.end&&this.setEnd(s.end),s.step&&this.setStep(s.step)}Sv(){const t=this.gv.start||{x:0,z:0};let e;e=this.gv.end?{x:(this.gv.end.x-t.x)/this.Yn.columns,z:(this.gv.end.z-t.z)/this.Yn.rows}:this.gv.step?this.gv.step:{x:1,z:1},this.Ga.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.Ga.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.Ga.xv().step}setEnd(t){return this.gv.end=t,this.Sv(),this}getEnd(){return this.Ga.xv().end}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ga.ke(this.be),this.yt.vs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.Ga.mv(this.pv),this.yt.vs(),this}getWireframeStyle(){return this.Ga.bv()}setIntensityInterpolation(t){return t=t||"disabled",this.Ga.Mv(t),this.yt.vs(),this}getIntensityInterpolation(){return this.Ga._v()}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),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.Yn.dataOrder?t.length:t[0].length,rows:"rows"===this.Yn.dataOrder?t.length:t[0].length},i="columns"===this.Yn.dataOrder?this.Yn.columns:this.Yn.rows,s="columns"===this.Yn.dataOrder?this.Yn.rows:this.Yn.columns;if(e.x>i||e.y>s){if(!0===this.Ki.dA.$n){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.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.`;bt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ei||e.y>s){if(!0===this.Ki.dA.$n){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Yn.columns}x${this.Yn.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.`;bt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;eue(this.be),this.Ki.cs.Gn(ah.xf),this.tS=Gn;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.be=fe(this.ts.surfaceScrollingGridSeries3DFillStyle,o),this.pv=fe(this.ts.surfaceScrollingGridSeries3DWireframeStyle,o);const h={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows};this.Yn=h,this.Ga=this.yt.Fv(h).ke(this.be).mv(this.pv).nS(this.tS).ds(this.getHighlight()),this.fs(this.Ga),s.start&&this.setStart(s.start),s.step&&this.setStep(s.step)}Sv(){const t=this.gv.start||{x:0,z:0};let e;e=this.gv.step?this.gv.step:{x:1,z:1},this.Ga.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.Ga.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.Ga.xv().step}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ga.ke(this.be),this.yt.vs(),this}getFillStyle(){return this.be}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.Ga.mv(this.pv),this.yt.vs(),this}getWireframeStyle(){return this.Ga.bv()}setIntensityInterpolation(t){return t=t||"disabled",this.Ga.Mv(t),this.yt.vs(),this}getIntensityInterpolation(){return this.Ga._v()}clear(){return this.Ga.Gt(),this.yt.vs(),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.Yn.scrollDimension?this.Yn.rows:this.Yn.columns;if(i>s-1){if(!0===this.Ki.dA.$n){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Yn.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ki.dA.$n){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Yn.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(e)}const e=[];for(let t=0;ts?e=e.slice(0,s):i=i.slice(0,t)}}const s=e?e.length:null==i?void 0:i.length,r=e?e[0].length:null==i?void 0:i[0].length;return this.Ga.Iv({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.yt.vs(),this}setCullMode(t){return this.Ga.kv("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Ga.Tv()}aS(){}Fe(){}Ay(){}qy(){return this.iS&&this.getVisible()}Pe(t,e){t.ds(e),this.yt.vs()}}const ml=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Sl),yl=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),pl={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)=>pl.multiply(t,pl.translation(e,i,s)),xRotate:(t,e)=>pl.multiply(t,pl.xRotation(e)),yRotate:(t,e)=>pl.multiply(t,pl.yRotation(e)),zRotate:(t,e)=>pl.multiply(t,pl.zRotation(e)),rotateXYZ(t,e){let i=pl.xRotate(t,e.x);return i=pl.yRotate(i,e.y),i=pl.zRotate(i,e.z),i},scale:(t,e,i,s)=>pl.multiply(t,pl.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],y=e[14],p=e[15],x=t[0],S=t[1],A=t[2],v=t[3],b=t[4],M=t[5],E=t[6],w=t[7],T=t[8],k=t[9],C=t[10],R=t[11],I=t[12],F=t[13],D=t[14],L=t[15],P=[];return P[0]=i*x+s*b+r*T+n*I,P[1]=i*S+s*M+r*k+n*F,P[2]=i*A+s*E+r*C+n*D,P[3]=i*v+s*w+r*R+n*L,P[4]=o*x+h*b+a*T+l*I,P[5]=o*S+h*M+a*k+l*F,P[6]=o*A+h*E+a*C+l*D,P[7]=o*v+h*w+a*R+l*L,P[8]=u*x+c*b+d*T+f*I,P[9]=u*S+c*M+d*k+f*F,P[10]=u*A+c*E+d*C+f*D,P[11]=u*v+c*w+d*R+f*L,P[12]=g*x+m*b+y*T+p*I,P[13]=g*S+m*M+y*k+p*F,P[14]=g*A+m*E+y*C+p*D,P[15]=g*v+m*w+y*R+p*L,P},inverse(t){const e=[],i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11],g=t[12],m=t[13],y=t[14],p=t[15],x=d*p,S=y*f,A=a*p,v=y*l,b=a*f,M=d*l,E=r*p,w=y*n,T=r*f,k=d*n,C=r*l,R=a*n,I=u*m,F=g*c,D=o*m,L=g*h,P=o*c,_=u*h,V=i*m,B=g*s,z=i*c,N=u*s,O=i*h,U=o*s,G=x*h+v*c+b*m-(S*h+A*c+M*m),Y=S*s+E*c+k*m-(x*s+w*c+T*m),H=A*s+w*h+C*m-(v*s+E*h+R*m),X=M*s+T*h+R*c-(b*s+k*h+C*c),W=1/(i*G+o*Y+u*H+g*X);return e[0]=W*G,e[1]=W*Y,e[2]=W*H,e[3]=W*X,e[4]=W*(S*o+A*u+M*g-(x*o+v*u+b*g)),e[5]=W*(x*i+w*u+T*g-(S*i+E*u+k*g)),e[6]=W*(v*i+E*o+R*g-(A*i+w*o+C*g)),e[7]=W*(b*i+k*o+C*u-(M*i+T*o+R*u)),e[8]=W*(I*l+L*f+P*p-(F*l+D*f+_*p)),e[9]=W*(F*n+V*f+N*p-(I*n+B*f+z*p)),e[10]=W*(D*n+B*l+O*p-(L*n+V*l+U*p)),e[11]=W*(_*n+z*l+U*f-(P*n+N*l+O*f)),e[12]=W*(D*d+_*y+F*a-(P*y+I*a+L*d)),e[13]=W*(z*y+I*r+B*d-(V*d+N*y+F*r)),e[14]=W*(V*a+U*y+L*r-(O*y+D*r+B*a)),e[15]=W*(O*d+P*r+N*a-(z*a+U*d+_*r)),e},projectionPerspective(t,e,i,s){const r=1/Math.tan(t*Math.PI/180/2),n=1/(i-s);return[r/e,0,0,0,0,r,0,0,0,0,(i+s)*n,-1,0,0,i*s*n*2,0]},projectionOrthographic:(t,e,i,s,r,n)=>[2/(e-t),0,0,-(e+t)/(e-t),0,2/(s-i),0,-(s+i)/(s-i),0,0,-2/(n-r),-(n+r)/(n-r),0,0,0,1]};class xl extends Qa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Ms="Mesh Model 3D",this.Pv=new Float32Array,this.ft={x:1,y:1,z:1},this.Dv={x:0,y:0,z:0},this.Bv={x:0,y:0,z:0},this.Lv={x:0,y:0,z:0},this.Rv={x:0,y:0,z:0},this.Ha=Ve,this.Wd=()=>ue(this.getFillStyle());const o=void 0!==(null==r?void 0:r.automaticColorIndex)?r.automaticColorIndex:this.Ki.getSeries().length;this.Ga=this.yt.Ev().oS(this.sS).ke(fe(this.ts.meshModel3DFillStyle||this.ts.pointSeriesFillStyle,o)).ds(this.getHighlight()),this.fs(this.Ga)}setModelGeometry(t){const{indices:e,vertices:i,normals:s}=t;let r=Pe,n=Le,o=Pe,h=Le,a=Pe,l=Le;for(let t=0;t{const t=this.yt.qv();this.ix.tx(t),this.sx.tx(t);const e=this.hx.viewportChanged(this.nx());e&&this.ox(e),this.cs.vs()},this.hS=(t,e,i,s,r)=>{if(this.Jv){const t=r;this.Xv.push({type:"rotate",rotation:t}),this.cs.vs(),Zt(e)}},this.eS=(t,e)=>{if(this.Qv){if(this.Zv)Math.sign(this.Kv)!==Math.sign(e.deltaY)?this.Kv=ge(e):this.Kv+=ge(e);else{const t=ge(e);this.Xv.push({type:"wheel-zoom",deltaY:t})}this.cs.vs(),Zt(e)}},this.cs.Gn(ah.ff),this.bp.Eh("Chart3D"),this.lx=i.d3(),this.lx.x.K(-1,1),this.lx.y.K(-1,1),this.lx.z.K(-1,1),this.yt=e.ux("chart3D layer3D",0,this.lx),this.ix=e.Ax("chart3D series bg",0),this.sx=e.Um("chart3D axis ui",1),this.gx={x:new ja(this,(h=()=>this.MS,{...Ka(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Mr().x)),Ty:t=>t.x,$y:(t,e)=>({x:t.x,y:e.y,z:e.z}),Kd:f(0,-1,0),Xy: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)}},Qy:()=>!0,Jy:()=>!1,Hy:()=>!1}),this.lx.x,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs),y:new ja(this,Ja((()=>this.MS)),this.lx.y,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs),z:new ja(this,qa((()=>this.MS)),this.lx.z,this.ts,this.yt,this.sx,this.pixelScale,!1,this.hs)},this.mx=this.yt.sy([za.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.ts.chart3DBoundingBoxStrokeStyle),this.IS=this.ix.sc(this.engine.scale,hn.Simple).ke(this.ts.chart3DSeriesBackgroundFillStyle).Ce(ot).setMouseInteractions(!0),this.PS=this.ix.sc(this.engine.scale,hn.Simple).ke(z).Ce(this.ts.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.yx({x:1,y:1,z:1},!0),this.hx=new ul(this.engine.scale,this.pixelScale,this.lx,((t,e)=>(e&&this.ox(e),this.yt.Uy(t)))),this.Sx=this.hx.getDefaultCameraConfiguration(this.vx(this.xx)),this.ox(this.Sx),this.rS=Wi(new Zi(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.yt.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.Jv&&!this.Qv)return;const o=(a.locationOne.x-a.locationTwo.x)**2+(a.locationOne.y-a.locationTwo.y)**2,h=(e.x-i.x)**2+(e.y-i.y)**2,l=De.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.Xv.push({type:"rotate+zoom",rotation:this.Jv?d:{x:0,y:0},cameraDistance:this.Qv?c:l}),this.cs.vs(),Zt(n)}),(t=>{})),new $i((t=>{}),((t,e,i,s,r)=>{if(this.Jv){const t=s;this.Xv.push({type:"rotate",rotation:t}),this.cs.vs(),Zt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.rS.onTouchStart),this.onBackgroundTouchMove(this.rS.onTouchMove),this.onBackgroundTouchEnd(this.rS.onTouchEnd),this.onSeriesBackgroundTouchStart(this.rS.onTouchStart),this.onSeriesBackgroundTouchMove(this.rS.onTouchMove),this.onSeriesBackgroundTouchEnd(this.rS.onTouchEnd),this.onBackgroundMouseDrag(this.hS),this.onBackgroundMouseWheel(this.eS),this.onBackgroundMouseDown(((t,e)=>{Zt(e)})),this.onSeriesBackgroundMouseDrag(this.hS),this.onSeriesBackgroundMouseWheel(this.eS),this.onSeriesBackgroundMouseDown(((t,e)=>{Zt(e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.onResize(this.An),this.An(),this.mp(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||nl)(this,this.wS,this.yt,this.ts,this.cs.hs,t);return this.DS(e),e}addLineSeries(t){const e=new il(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointLineSeries(t){const e=new sl(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addSurfaceGridSeries(t){const e=new fl(this,this.wS,this.yt,t,this.ts,this.cs.hs);return this.DS(e),e}addSurfaceScrollingGridSeries(t){const e=new gl(this,this.wS,this.yt,t,this.ts,this.cs.hs);return this.DS(e),e}addBoxSeries(t){const e=new tl(this,this.wS,this.yt,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addMeshModel(t){const e=new xl(this,this.wS,this.yt,this.ts,t,this.cs.hs);return this.DS(e),e}translateCoordinate(t,e,i){if(ml(e)||ml(i)||yl(t)){if(ml(e)&&ml(i)&&yl(t)){if("axes"===e.id&&"world"===i.id)return this.yt.At(t);if("world"===e.id&&"axes"===i.id)return this.yt.St(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return $h(t,e,i,this.pixelScale,this.cs)}getDefaultAxisX(){return this.gx.x}getDefaultAxisY(){return this.gx.y}getDefaultAxisZ(){return this.gx.z}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}get axisZ(){return this.getDefaultAxisZ()}get zAxis(){return this.getDefaultAxisZ()}getDefaultAxes(){return[this.gx.x,this.gx.y,this.gx.z]}setCameraLocation(t){let e={location:t,direction:De.normalize(De.multiply(t,-1))};const i=this.hx.cameraLocationChanged(this.nx(e));return i&&(e=i),this.ox(e),this.cs.vs(),this}getCameraLocation(){return this.yt.getCameraLocation()}getCameraDirection(){return this.yt.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.hx.hv(t);const e=this.hx.cameraLocationChanged(this.nx());return e&&this.ox(e),this}getCameraAutomaticFittingEnabled(){return this.hx.Av()}onCameraChange(t){return this.L.on("cameraChange",t)}offCameraChange(t){return this.L.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.mx.Ee(t).zy(Ya(this.mx.cu())),this.yt.vs(),this}getBoundingBoxStrokeStyle(){return this.mx.cu()}setBoundingBox(t){return this.yx(t,!1),this}yx(t,e){this.xx=t;const i=this.vx(t);if(this.lx.x.tt(i.x),this.lx.y.tt(i.y),this.lx.z.tt(-i.z),!e){const t=this.hx.boundingBoxChanged(this.nx());t&&this.ox(t)}this.cs.vs()}getBoundingBox(){return this.xx}Fe(t){if(ta.kp(this.bp,this.Sp),0!==this.Kv){const e=this.Kv*t*.006;this.Xv.push({type:"wheel-zoom",deltaY:e}),this.Kv=Math.sign(this.Kv)*Math.max(Math.abs(this.Kv)-.01*t,0),0!==this.Kv&&this.cs.vs(!0)}const e=this.getCameraDirection();if(this.Xv.length>0){const t=this.hx.applyCameraInteractions(this.nx(),this.Xv);t&&this.ox(t),this.Xv.length=0}this.bx&&De.equals(this.bx.location,this.Sx.location)&&De.equals(this.bx.direction,this.Sx.direction)||this.L.emit("cameraChange",this,this.getCameraLocation()),this.bx=this.Sx,super.Fe(t);for(let t=0;tthis.yt.Uy(t))),o=this.yt.Uy(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=re(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.ln.length=0,this.lx.U(),this.yt.U(),this.sx.U(),this.ix.U(),super.dispose()}Z(){return this.lx.x.Z(),this.lx.y.Z(),this.lx.z.Z(),super.Z()}J(){return super.J()}ox(t){this.yt.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(De.addVec(t.location,De.multiply(t.direction,-this.jv))),this.Sx=t,this.cs.vs()}vx(t){return De.divide(t,De.length(t)/this.$v)}nx(t=this.Sx){return{boundingBox:this.vx(this.xx),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.Qv=t,this}getMouseInteractionZoom(){return this.Qv}setMouseInteractionRotate(t){return this.Jv=t,this}getMouseInteractionRotate(){return this.Jv}forEachAxis(t){return t(this.gx.x),t(this.gx.y),t(this.gx.z),this}getSeries(){return this.MS}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.Zv=!!t,this}getAnimationZoom(){return this.Zv}}const Al={Column:Co,Row:Ro};class vl extends Jh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Mx=new Map,this._x=this.addUIElement(Al.Row).setPosition({x:0,y:100}).setOrigin(Ts.LeftTop).setBackground((t=>t.setFillStyle(z).setStrokeStyle(ot)))}add(t,e){return(t instanceof Qh?[t]:t instanceof Ff?t.getCells().filter((t=>t.panel instanceof Qh)).map((t=>t.panel)):[]).forEach((t=>{const i=this._x.addElement(sh.VerticalLegendBox).setBackground((t=>t.setFillStyle(z).setStrokeStyle(ot))).add(t,e).setTitle(t.getTitle());this.Mx.set(t,i)})),this.cs.vs(),this}setLegendBoxes(t){return this.Mx.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this._x.getSize()}}const bl={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Ml=(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(),El=(t,e)=>{let i=e.geometry;return i=wl(t,e,i),i=Tl(t,e,i),i},wl=(t,e,i)=>{if(t===bl.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===bl.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=Ze(It(i)),h=[];for(let e=0;ethis.L.on("mouseEnter",t),this.onMouseLeave=t=>this.L.on("mouseLeave",t),this.onMouseClick=t=>this.L.on("mouseClick",t),this.onMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onMouseDown=t=>this.L.on("mouseDown",t),this.onMouseUp=t=>this.L.on("mouseUp",t),this.onMouseMove=t=>this.L.on("mouseMove",t),this.offMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offMouseClick=t=>this.L.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.L.off(t,"mouseDown"),this.offMouseUp=t=>this.L.off(t,"mouseUp"),this.offMouseMove=t=>this.L.off(t,"mouseMove"),this.offMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.L.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.L.on("mapDataReady",t);return this.Dx&&bt.setTimeout((()=>t())),e},this.onViewChange=t=>this.L.on("viewChange",t),this.Bx=(t,e,i,s,r)=>{this.ft.x.tt(s).ei([this.jt.left+this.ya.left,this.jt.right+this.ya.right]),this.ft.y.tt(r).ei([this.jt.bottom+this.ya.bottom,this.jt.top+this.ya.top+ta.Cp(this.bp,this.Sp)]),this.Lx&&this.Rx(this.Ex,this.ft,this.Lx)},this.Ct=(t,i)=>{const s=i;if(!s||!this.Dx)return;const{iRegion:r,region:n}=this.zx(this.Dx,s);this.Tx!==e.AutoCursorModes.disabled&&(this.Vx(n,r),Zt(t)),this.Ix&&this.cs.us._s(n,!0),this.Ox=n,this.L.emit("mouseEnter",this,t)},this.kt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Nx(r,s),this.Ix&&this.cs.us._s(r,!1),this.Ox=void 0,this.L.emit("mouseLeave",this,t),t&&Zt(t)},this.Dt=(t,i)=>{const s=i;if(!s||!this.Dx)return;const{iRegion:r,region:n}=this.zx(this.Dx,s);this.Tx!==e.AutoCursorModes.disabled&&(this.Vx(n,r),Zt(t)),this.Ox=n,this.L.emit("mouseMove",this,t)},this.Tt=(t,e)=>this.L.emit("mouseClick",this,t),this.Ft=(t,e)=>this.L.emit("mouseDoubleClick",this,t),this.It=(t,e)=>this.L.emit("mouseDown",this,t),this.Pt=(t,e)=>this.L.emit("mouseUp",this,t),this.Lt=(t,e,i)=>{this.L.emit("mouseDragStart",this,t,e)},this.Bt=(t,e,i,s,r)=>{this.L.emit("mouseDrag",this,t,e,i,s)},this.Rt=(t,e,i,s)=>{this.L.emit("mouseDragStop",this,t,e,i)},this.Et=(t,e)=>{this.L.emit("mouseWheel",this,t)},this.zt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Vx(r,s),this.Ix&&this.cs.us._s(r,!0),this.Ox=r,this.L.emit("touchStart",this,t),Zt(t)},this.Vt=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Vx(r,s),this.Ox=r,this.L.emit("touchMove",this,t),Zt(t)},this.Ot=(t,e)=>{const i=e;if(!i||!this.Dx)return;const{iRegion:s,region:r}=this.zx(this.Dx,i);this.Gx=void 0,this.Nx(r,s),this.Ix&&this.cs.us._s(r,!1),this.Ox=void 0,this.L.emit("touchEnd",this,t),Zt(t)},this.cs.Gn(ah.gf),this.ih=!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.Wx=i.Um("mapChart plotting",0),this.onResize(this.Bx),this.bp.Eh("Map Chart");const a=Ft(o?o.autoCursorBuilder:void 0,Ea);this.Ux=a.lm(i.$m(),this.ft,this.ft,this.ts).setVisible(!1),this.Yx=this.hs.yg(),this.mp(n,this.uiScale),this.Hx=this.Wx.$x(this.ft).setMouseInteractions(this.Hi).setMouseEnterEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.kt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseDownEventHandler(((t,e,i)=>this.It(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Dt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Lt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Bt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Rt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Et(e,i))).setTouchStartEventHandler(((t,e,i)=>this.zt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Ot(e,i))).ke(this.ts.mapChartFillStyle).Ce(this.ts.mapChartStrokeStyle),this.Xx=this.Wx.$x(this.ft).setMouseInteractions(this.Hi).ke(this.ts.mapChartOutlierRegionFillStyle).Ce(this.ts.mapChartOutlierRegionStrokeStyle);const l=Ft(o&&o.type,bl.World);this.Ex=l,this.jx(l).then((()=>{this.L.emit("mapDataReady")}))}getRegionUnderMouse(){return this.Ox}setFillStyle(t){return this.Hx.ke(t),this.cs.vs(),this}getFillStyle(){return this.Hx.zh()}setStrokeStyle(t){return this.Hx.Ce(t),this.cs.vs(),this}getStrokeStyle(){return this.Hx.lo()}setEffect(t){return this.Yx.Ss(t),this.cs.vs(),this}getEffect(){return this.Yx.xs()}setOutlierRegionFillStyle(t){return this.Xx.ke(t),this.cs.vs(),this}getOutlierRegionFillStyle(){return this.Xx.zh()}setOutlierRegionStrokeStyle(t){return this.Xx.Ce(t),this.cs.vs(),this}getOutlierRegionStrokeStyle(){return this.Xx.lo()}setSeparateRegionFillStyle(t){return this.Cx="function"==typeof t?t(this.Cx):t,this.wx.forEach((t=>t.ke(this.Cx))),this.cs.vs(),this}getSeparateRegionFillStyle(){return this.Cx}setSeparateRegionStrokeStyle(t){return this.kx="function"==typeof t?t(this.kx):t,this.wx.forEach((t=>t.Ce(this.kx))),this.cs.vs(),this}getSeparateRegionStrokeStyle(){return this.kx}invalidateRegionValues(t){if(!this.Dx||!this.Zx)return this.Qx=this.Qx||[],this.Qx.push(t),this;if("function"==typeof t)for(let e=0;e{t.Jx(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.Jx(e.value)}))}}return this.cs.vs(),this}setAutoCursor(t){return this.Ux&&t(this.Ux),this.cs.vs(),this}getAutoCursor(){return this.Ux}setAutoCursorMode(t){return this.Tx=t,this.cs.vs(),this}getAutoCursorMode(){return this.Tx}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}onMouseDragStart(t){return this.L.on("mouseDragStart",t)}onMouseDrag(t){return this.L.on("mouseDrag",t)}onMouseDragStop(t){return this.L.on("mouseDragStop",t)}onMouseWheel(t){return this.L.on("mouseWheel",t)}onTouchStart(t){return this.L.on("touchStart",t)}onTouchMove(t){return this.L.on("touchMove",t)}onTouchEnd(t){return this.L.on("touchEnd",t)}offTouchStart(t){return this.L.off(t,"touchStart")}offTouchMove(t){return this.L.off(t,"touchMove")}offTouchEnd(t){return this.L.off(t,"touchEnd")}setMouseInteractions(t){return this.Hi=t,this.Hx.setMouseInteractions(t),this}getMouseInteractions(){return this.Hi}setHighlight(t){var e;return t=Ae(t),this.Fx=t,null===(e=this.Dx)||void 0===e||e.regions.forEach((e=>{this.cs.us._s(e,t)})),this.L.emit("highlight",this,t),this}getHighlight(){return this.Fx}setAnimationHighlight(t){var e;return null===(e=this.Dx)||void 0===e||e.regions.forEach((e=>{this.cs.us.ws(e,t)})),this}getAnimationHighlight(){var t;return this.cs.us.Cs(null===(t=this.Dx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Ix=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Ix}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}offMapDataReady(t){return this.L.off(t,"mapDataReady")}offViewChange(t){return this.L.off(t,"viewChange")}async jx(t){const e=await((t,e)=>{let i;if(t===bl.World)i="countries_world.json";else if(t===bl.NorthAmerica)i="countries_northAmerica.json";else if(t===bl.SouthAmerica)i="countries_southAmerica.json";else if(t===bl.Africa)i="countries_africa.json";else if(t===bl.Europe)i="countries_europe.json";else if(t===bl.Asia)i="countries_asia.json";else if(t===bl.USA)i="states_usa.json";else if(t===bl.Canada)i="territoriesProvinces_canada.json";else{if(t!==bl.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw bt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return bt.fetch(s).then((t=>t.json())).catch((t=>{Te(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.dA.Xs);this.Zx=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=kl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.Xx.Vr().Sl(e);if(t===bl.USA){const t=25.8,e=29.7;this.wx.push(this.Wx.Te(this.ft).setMouseInteractions(!1).ke(this.Cx).Ce(this.kx).Ie({x:-126,y:t}).tt({x:10,y:e-t}),this.Wx.Te(this.ft).setMouseInteractions(!1).ke(this.Cx).Ce(this.kx).Ie({x:-113,y:t}).tt({x:7,y:e-t}))}const s=this.cs.us.zr(this.Hx,{animationEnabled:this.ih});for(let i=0;i{o.forEach((e=>e.ds(t)))}))}if(this.Yx.As([this.Hx]),this.Lx=i,this.Rx(t,this.ft,i),this.Dx=e,this.Qx){for(const t of this.Qx)this.invalidateRegionValues(t);this.Qx=void 0}this.cs.vs()}Rx(t,e,i){const s=Cl[t],r=e.x.getCellSize(),n=e.y.getCellSize()/r,o={min:{x:i.min.x,y:i.min.y},max:{x:i.max.x,y:i.max.y}};if(ns){const t=(o.max.y-o.min.y)*(n/s-1);o.min.y-=t/2,o.max.y+=t/2}e.x.K(o.min.x,o.max.x),e.y.K(o.min.y,o.max.y);const h=this.ft.x.ui(),a=this.ft.y.ui();this.L.emit("viewChange",{latitudeRange:{start:o.min.y,end:o.max.y},longitudeRange:{start:o.min.x,end:o.max.x},margin:{top:a[1],bottom:a[0],left:h[0],right:h[1]}})}Vx(t,e){this.Kx={region:t,iRegion:e},this.cs.vs()}Nx(t,e){this.Kx&&t===this.Kx.region&&(this.Kx=void 0,this.cs.vs())}zx(t,e){const i=Array.from(this.Px.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.ih=!t,this}getAnimationsEnabled(){return this.ih}getMinimumSize(){}Qd(){return[this]}Fe(t){super.Fe(t),super.pp(),ta.kp(this.bp,this.Sp);const e=y(this.ft.x.hi(),this.ft.y.hi(),this.ft.x.ni(),this.ft.y.ni());this.Wx.tx(e);const i=this.cs.Nn()||this.Gx;if(this.Kx&&i){const t=this.Zx&&this.Zx[this.Kx.iRegion];let e=dt(i,this.engine.scale,this.ft);e={x:Rt(e.x,this.ft.x.getInnerStart(),this.ft.x.getInnerEnd()),y:Rt(e.y,this.ft.y.getInnerStart(),this.ft.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.Kx.region.transform;this.Kx.region.outlier&&n&&(s=(s-n.translate.x-n.vertexBoundaries.min.x)/n.scale.x+n.vertexBoundaries.min.x,r=(r-n.translate.y-n.vertexBoundaries.min.y)/n.scale.y+n.vertexBoundaries.min.y),this.Ux.setPosition(e).setVisible(!0).getResultTable().setContent(this.Om(new la,this.Kx.region,t,s,r,this).Qu())}else this.Ux.setVisible(!1);return this.Ux.Ds().Fe(),this}dispose(){return this.Wx.U(),this.Ux.dispose(),Kh(this.ft),super.dispose()}Z(){return super.Z(),this.ft.Z(),this}J(){return super.J(),this.ft.J(),this}Wd(){return ue(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))),le(t,this.ts,i,{fill:this.getFillStyle()}),this}}const Il=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(Fl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),Fl=(t,e)=>{const i=t>0,s=e>0;return`${[de(Math.abs(0|t),2),"° ",de(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[de(Math.abs(0|e),2),"° ",de(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class Dl extends Js{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.qx(i),s,r,{numeric:e.tb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.tb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.tb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.ib=n,this.sb=o,this.eb=h,this.hs=a,this.hb=i,this.rb=e.tb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.Rh=h.Dr(i).setMouseInteractions(!1).Nh(e.tb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ke(e.tb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Uh=this.hs.yg([this.Rh]).Ss(s.effectsText)}setTickStrategy(t,e){return super.Ih(t,e)}setStrokeStyle(t){return this.rb="function"==typeof t?t(this.rb):t,this.sb.vs(),this}getStrokeStyle(){return this.rb}cr(t,e){return new Ll(e,t,this.hb,this.eb,this.nb(this.ib,this.hb),this.eb.ze(this.hb).setMouseInteractions(!1))}dr(t,e){const i=this.ob(this.hb,t);this.ab&&!1===this.ab(t)?t.Ye.setVisible(!1):t.Ye.setVisible(!0).Ie(oi(this.lb(this.hb,t.S),i.padding)).za(i.alignment).Gh(i.rotation).Pa(i.offset.x,i.offset.y),this.ub(this.hb,t.cb,t.fb,t)}setMouseInteractions(t){return this}Fe(){this.tr({physicalAxisSize:0});const t=this.pr(((t,e)=>{const i=e.xh.ur,s=.5*this.rb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ye.Ds().Zc().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Ab(this.hb,this.rb,t),this.gb(this.hb,this.Rh,t),t}}class Ll extends qs{constructor(t,e,i,s,r,n,o){super(t,e,s,i,o),this.cb=r,this.fb=n,r.setMouseInteractions(!1),this.ss.push(r,n)}}class Pl extends Dl{constructor(t,e,i,s,r,n,o,h,a){super(t,_l((()=>this.wg())),e,i,s,r,n,o,h),this.Ey=this.sb.ze(this.hb).setMouseInteractions(!1),this.pb=a,this.setScrollStrategy(zs.expansion),this.setTickStrategy(Ns.Numeric),this.setTitle("Amplitude")}wg(){return this.pb()}wr(t,e){return oh(t,e,this.hb.y)}kr(t,e,i){const s=2*(e-t),r=this.hb.x.Ri(s);return{min:t-i*r,max:e+i*r}}lb(t,e){return{x:t.mb()?e-t.yb().start:t.yb().start-e,y:0}}nb(t,e){return t.Kc(e)}ub(t,e,i,s){const r=s.xh.ur,n=t.mb()?s.S-t.yb().start:t.yb().start-s.S;Ct(s.S,t.yb().start)||Ct(s.S,t.yb().end)?e.setVisible(!1):e.setVisible(!0).hu(0).Ve(360).lu(void 0).au(0).ru(n).lu(60).ke(z).Ce(r.gridStrokeStyle);const o=.5*this.rb.getThickness();i.Oe({x:n,y:-o*t.Ui().y}).Ve({x:n,y:-(o+r.tickLength)*t.Ui().y}).Ee(r.tickStyle)}ob(t,e){const i=e.xh.ur;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ui().y*-(.5*this.rb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Ab(t,e,i){const s=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;this.Ey.Oe({x:0,y:0}).Ve({x:s,y:0}).Ee(e)}gb(t,e,i){const s=t.mb()?(t.yb().start+t.yb().end)/2-t.yb().start:t.yb().start-(t.yb().start+t.yb().end)/2;e.za({x:0,y:1}).Ie({x:s,y:-i*t.Ui().y})}}const _l=t=>({...Ka(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),qx:t=>({getInnerStart:()=>t.yb().start,getInnerEnd:()=>t.yb().end,K:(e,i)=>t.Sb(e,i),ot:(e,i,s,r,n)=>t.y.ot(e,i,s,r,n)}),tb:t=>t.amplitude});class Vl extends Dl{constructor(t,e,i,s,r,n,o,h){super(t,zl,e,i,s,r,n,o,h),this.vb=90,this.xb=12,this.bb=Bl,this.Ey=this.sb.Kc(this.hb).setMouseInteractions(!1),this.ab=t=>{let e=180*(t.S-this.hb.Mb())/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.Ke=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.vb)}setTickStyle(t){return this._b="function"==typeof t?t(this._b):t,this.wb(),this.sb.vs(),this}getTickStyle(){return this._b}setTickFormattingFunction(t){return this.bb=t,this.wb(),this.sb.vs(),this}getTickFormattingFunction(){return this.bb}setClockwise(t){this.hb.Cb(t);const e=this.vb*Math.PI/180;return t?this.hb.kb(e+Math.PI/2):this.hb.kb(e-Math.PI/2),this.sb.vs(),this}getClockwise(){return!this.hb.Tb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.vb=t;const e=t*Math.PI/180;return this.getClockwise()?this.hb.kb(e+Math.PI/2):this.hb.kb(e-Math.PI/2),this.sb.vs(),this}getNorth(){return 180*this.hb.Mb()/Math.PI}setDivision(t){return this.xb=t,this.wb(),this.sb.vs(),this}getDivision(){return this.xb}wg(){return[]}wr(t,e){return e}kr(t,e,i){return{min:t,max:e}}lb(t,e){const i=t.Tb()?1:-1,s=t.Mb(),r=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}nb(t,e){return t.ze(e)}ub(t,e,i,s){const r=this._b,n=t.Tb()?1:-1,o=t.Mb(),h=(s.S-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).Ve(c);const d={x:c.x+a*r.tickLength*t.Ui().x,y:c.y+l*r.tickLength*t.Ui().y};i.Oe(c).Ve(d),e.Ee(r.gridStrokeStyle),i.Ee(r.tickStyle)}ob(t,e){const i=this._b,s=t.Tb()?1:-1,r=t.Mb();let n,o=(e.S-r)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;n=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const h=i.tickLength+i.tickPadding,a=Math.cos(o)*h*t.Ui().x,l=Math.sin(o)*h*t.Ui().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Ab(t,e,i){const s=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;this.Ey.hu(0).Ve(360).au(0).ru(s+.5*e.getThickness()*t.Ui().x).lu(360).ke(z).Ce(e)}gb(t,e,i){const s=t.Mb(),r=this.ob(t,{S:0+s}),n=t.mb()?t.yb().end-t.yb().start:t.yb().start-t.yb().end;e.za(r.alignment).Gh(r.rotation).Pa(r.offset.x,r.offset.y).Ie(oi({x:n,y:0},r.padding))}wb(){this.Xh({$e:[],Xe:[{Ye:"Radial ticks",Eg:0,ur:this._b,ar:this.bb,Lr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.xb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},bh:{Ar:()=>{},Mh:()=>!1},Rr:void 0}],We:Bl,jh:void 0,Zh:void 0})}}const Bl=(t,e,i)=>(180*t/Math.PI).toFixed(0),zl={Sr:()=>{},vr:()=>{},Mr:()=>{},qx:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,K:(t,e)=>{},ot:(e,i,s,r,n)=>t.x.ot(e,i,s,r,n)}),tb:t=>t.radial},Nl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),Ol=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Ul extends Yi{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ms="Sector",this.Fb=0,this.Ib=1*Math.PI/2,this.Pb=void 0,this.Db=void 0,this.Ts=t,this.hb=s,this._m=this.Ts.Kc(this.hb).ds(this.getHighlight()),this.fs(this._m),this.be=r.polarSectorFillStyle,this.Me=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.Fb=Rt(t,0,360),this.Ts.vs(),this}getAngleStart(){return this.Fb}setAngleEnd(t){return this.Ib=Rt(t,0,360),this.Ts.vs(),this}getAngleEnd(){return this.Ib}setAmplitudeStart(t){return this.Pb=t,this.Ts.vs(),this}getAmplitudeStart(){return this.Pb}setAmplitudeEnd(t){return this.Db=t,this.Ts.vs(),this}getAmplitudeEnd(){return this.Db}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Ts.vs(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ts.vs(),this}getStrokeStyle(){return this.Me}Fe(){const t=this.hb.yb(),e=180*this.hb.Mb()/Math.PI,i=void 0!==this.Pb?Rt(this.Pb,t.start,t.end):t.start,s=void 0!==this.Db?Rt(this.Db,t.start,t.end):t.end,r=this.hb.mb()?i-t.start:t.start-i,n=this.hb.mb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.hb.Tb()?1:-1,l=Math.abs(this.Ib-this.Fb);this._m.hu((this.Fb-e)*a).Ve((this.Ib-e)*a).au(100*o/h).ru(h).ke(this.be).Ce(this.Me).lu(Math.ceil(l/2))}Pe(t,e){t.ds(e),this.Ts.vs()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}}class Gl extends Yi{constructor(){super(...arguments),this.iS=!0,this.Bb=!0}setAutoScrollingEnabled(t){return this.iS=t,this.Ki.cs.vs(),this}getAutoScrollingEnabled(){return this.iS}aS(){}Fe(){}Ay(){}setCursorEnabled(t){return this.Bb=t,this}getCursorEnabled(){return this.Bb}}class Yl extends Gl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Ts=t,this.Ki=e,this.scale=s}getAmplitudeMin(){return this.Lb?this.Lb.min:void 0}getAmplitudeMax(){return this.Lb?this.Lb.max:void 0}}const Hl=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s))},Xl=(t,e)=>{const i=[],s=e.yb().start,r=e.yb().end,n=e.mb(),o=e.Tb()?1:-1,h=e.Mb(),a=Math.abs(r-s),l=Math.min(s,r)+.001*a,u=Math.max(s,r)-.001*a;for(const e of t){const t=Rt(e.amplitude,l,u),r=e.angle*Math.PI/180-h,a=Math.cos(r*o)*(n?t-s:s-t),c=Math.sin(r*o)*(n?t-s:s-t),d=e.color;i.push({x:a,y:c,color:d})}return i},Wl=t=>{const e={min:Le,max:Pe};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},jl=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),$l=(t,e)=>{let i=yi(t);for(e.Tb()||(i*=-1),i+=180*e.Mb()/Math.PI;i<0;)i+=360;i%=360;const s=ri(t),r=e.yb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Pn(r.start,r.end,s/n)}};class Zl extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.Ms="Heatmap Series",this.Rb=!0,this.fS=!1,this.Om=Kl,this.Wd=()=>ue(this.be);const h=this.Ki.getSeries().length;this.be=fe(this.ts.polarHeatmapSeriesFillStyle||this.ts.heatmapGridSeriesFillStyle,h);const a=o.amplitudeStart||0,l=o.amplitudeEnd?(o.amplitudeEnd-a)/(o.annuli-1):o.amplitudeStep||1,u={sectors:o.sectors,annuli:o.annuli,amplitudeStart:a,amplitudeStep:l,heatmapDataType:"intensity",dataOrder:o.dataOrder||"annuli"};this.Yn=u,this.Eb=t.zb(s,[],u).ke(this.be).ds(this.getHighlight()),this.fs(this.Eb);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.Lb={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),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.Yn.dataOrder?t[0].length:t.length,annuli:"annuli"===this.Yn.dataOrder?t.length:t[0].length},i="annuli"===this.Yn.dataOrder?this.Yn.annuli:this.Yn.sectors,s="annuli"===this.Yn.dataOrder?this.Yn.sectors:this.Yn.annuli;if(e.x>i||e.y>s){if(!0===this.Ki.dA.$n){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.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.dA.$n){const t=`PolarHeatmapSeries.invalidateIntensityValues intensity matrix overflow.\nMax indexes ${o}x${h}, input ${e.primary}x${e.secondary} starting at [${i},${r}].\nOut of bounds data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const a=Math.max(s-o,0),l=e.primary-a,u=Math.max(n-h,0),c=[];for(let e=0;e0?-u:void 0);if(0===(t={iSector:t.iSector,iAnnulus:t.iAnnulus,values:c}).values.length||0===t.values[0].length)return this}this.Eb.wv({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.Ts.vs(),this.fS=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Eb.ke(this.be),this.Ts.vs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}clear(){return this.Eb.Gt(),this.Ts.vs(),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.Eb.Mv(t),this.Ts.vs(),this}getIntensityInterpolation(){return this.Eb._v()}qy(){return this.iS&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=dt(t,this.Ki.engine.scale,this.scale),s=$l(i,this.scale),r=this.Rb?this.Eb.Vb(s):this.Eb.$c(s);if(r)return wa(Xl([r],this.scale)[0],this.scale,this.Om(new la,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ki.getAmplitudeAxis().formatValue).Qu(),this,this.be)}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}Fe(){}attach(t,e=!0,i=!1){return super.attach(t,e),le(t,this.ts,i,{fill:this.be}),this}}const Kl=(t,e,i,s)=>{const r=e.getIcon();return r?t.addRow(r,e.getName()):t.addRow(e.getName()),t.addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1))};class Jl extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Line Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.Om=Hl,this.uu=fe(this.ts.polarLineSeriesStrokeStyle,n),this.Wb=t.sy(s,void 0,[za.UserSeries]).Ee(this.uu).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.Wb)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Wb.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.uu}setConnectDataAutomaticallyEnabled(t){return this.Gb=t,this.Ts.vs(),this}getConnectDataAutomaticallyEnabled(){return this.Gb}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){return this.Ub(t,this.Wb)}solveNearestFromScreen(t){return this.Ub(rh(t,this.Ki.cs),this.Wb)}Ub(t,e){const i=e.Yb(t);if(!i)return;const{angle:s,amplitude:r}=$l(i,this.scale);return wa(i,this.scale,this.Om(new la,this,s,r,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,this.uu.getFillStyle())}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.Gb?(t.push({...t[0]}),this.Wb.Vl(!0)):this.Wb.Vl(!1),this.Wb.Gt().ol(t).Ho(e),this.Nb=!1,this.Wb.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{stroke:this.uu}),this}}class ql extends Yl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Ms="Point Line Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.$b=3,this.ga=0,this.Xb=e.PointShape.Circle,this.Om=Hl,this.be=fe(this.ts.polarPointLineSeriesFillStyle,o),this.uu=fe(this.ts.polarPointLineSeriesStrokeStyle,o),this.Wb=t.sy(r,void 0,[za.UserSeries]).Ee(this.uu).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.Wb),this.jb=t.bS(r).ke(this.be).sl(this.Xb).tt(this.$b).ds(this.getHighlight()).qa(Lr.Nearest),this.fs(this.jb)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;return this.Wb.Ee(e),this.Ts.vs(),this}getStrokeStyle(){return this.uu}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.jb.ke(e),this.Ts.vs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.$b=t,this.jb.tt(t),this.Ts.vs(),this}getPointSize(){return this.$b}setPointShape(t){return this.Xb=t,this.jb.sl(this.Xb),this}getPointShape(){return this.Xb}setPointRotation(t){return this.ga=t,this.jb.Gh(t),this.Ts.vs(),this}getPointRotation(){return this.ga}setConnectDataAutomaticallyEnabled(t){return this.Gb=t,this.Ts.vs(),this}getConnectDataAutomaticallyEnabled(){return this.Gb}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){return this.Ub(t,this.Wb)}solveNearestFromScreen(t){return this.Ub(rh(t,this.Ki.cs),this.Wb)}Ub(t,e){const i=e instanceof tn?e.$c(t):e.Yb(t);if(!i)return;const{angle:s,amplitude:r}=$l(i,this.scale);return wa(i,this.scale,this.Om(new la,this,s,r,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,"color"in i&&X(this.be)?new G({color:i.color}):this.be)}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.Gb?(t.push({...t[0]}),this.Wb.Vl(!0)):this.Wb.Vl(!1),this.Wb.Gt().ol(t).Ho(e),this.jb.Gt().ol(t).Ho(e),this.Nb=!1,this.Wb.Ds(),this.jb.Ds()}}ks(){return this.bs||this.Xb}}class Ql extends fn{constructor(t,e,i,s,n,o,h,a,l){super(),this.Go=Ie(),this.L=new r.Eventer,this.Xi=!1,this.Zb=s,this.Qb=n,this.Jb=o,this.Kb=h,this.qb=a,this.Ts=t,this.scale=e,this.tM=i,this.ts=l}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}dispose(){return this.tM&&this.tM(this),this.Ts.cs.vs(),this.L.emit("dispose",this),this.Xi=!0,this}setVisible(t){return super.setVisible(t),this.Jb(),this.Ts.cs.vs(),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setMouseInteractions(t){return this.Kb(this,t),this}getMouseInteractions(){return this.qb(this)}}class tu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g,y,p){super(t,e,i,s,r,n,o,h,p),this.iM=1,this.sM=1,this.Ts=t,this.scale=e,this.dimensionStrategy=a,this.start=l,this.end=u,this.lowerExtreme=c,this.lowerQuartile=d,this.median=f,this.upperQuartile=g,this.upperExtreme=y,this.boundaries=m(this.dimensionStrategy.toPoint(l,c),this.dimensionStrategy.toPoint(u,y)),this.eM=this.ts.boxSeriesBodyFillStyle,this.hM=this.ts.boxSeriesBodyStrokeStyle,this.uu=this.ts.boxSeriesStrokeStyle,this.rM=this.ts.boxSeriesMedianStrokeStyle,this.Ds()}getBoundaries(){return this.boundaries}setBodyWidth(t){return this.iM=t,this.Ds(),this}getBodyWidth(){return this.iM}setBodyFillStyle(t){return this.eM="function"==typeof t?t(this.eM):t,this.Qb(),this}getBodyFillStyle(){return this.eM}setBodyStrokeStyle(t){return this.hM="function"==typeof t?t(this.hM):t,this.Qb(),this}getBodyStrokeStyle(){return this.hM}setTailWidth(t){return this.sM=t,this.Ds(),this}getTailWidth(){return this.sM}setStrokeStyle(t){return this.uu="function"==typeof t?t(this.uu):t,this.Qb(),this}getStrokeStyle(){return this.uu}setMedianStrokeStyle(t){return this.rM="function"==typeof t?t(this.rM):t,this.Qb(),this}getMedianStrokeStyle(){return this.rM}Ds(){this.Zb()}getDominantStyle(){return this.getBodyFillStyle()}}const eu=(t,e,i)=>{const s=e.ft,r=i.ft;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.hg&&(n=1-n),1===e.hg&&(o=1-o),u(o,n)};class iu extends fa{constructor(t,e,i,s,r,n,o,h){super(t,e,Bi(i.ft,s.ft),r,h),this.nM=!1,this.oM=!1,this.aM=!0,this.lM=!0,this.uM=!1,this.cM=!1,this.setGridStrokeYStyle=t=>(this.dM.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.dM.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.fM=n,this.AM=o,this.gM=this.axisX.Hg(!1,this.fM).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.dM=this.axisY.Hg(!1,this.AM).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.gM.dispose(),this.dM.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(dt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.gM.setValue(t.x),this.dM.setValue(t.y);const e=eu(u(this.gM.getValue(),this.dM.getValue()),this.axisX,this.axisY);return this.gM.setGridStrokeLength(this.uM?e.x:1),this.dM.setGridStrokeLength(this.cM?e.y:1),this}Fe(){this.gM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.nM),this.dM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.oM);const t=eu(u(this.gM.getValue(),this.dM.getValue()),this.axisX,this.axisY);return this.gM.setGridStrokeLength(this.uM?t.x:1),this.dM.setGridStrokeLength(this.cM?t.y:1),super.Fe()}setGridStrokeXCut(t){return this.uM=t,this.Ts.vs(),this}getGridStrokeXCut(){return this.uM}setGridStrokeYCut(t){return this.cM=t,this.Ts.vs(),this}getGridStrokeYCut(){return this.cM}setGridStrokeXStyle(t){return this.gM.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.gM.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.nM=t,this.Ts.vs(),this}getTickMarkerXVisible(){return this.nM}setTickMarkerYVisible(t){return this.oM=t,this.Ts.vs(),this}getTickMarkerYVisible(){return this.oM}setTickMarkerX(t){return this.gM.setMarker(t),this}setTickMarkerY(t){return this.dM.setMarker(t),this}getTickMarkerX(){return this.gM.getMarker()}getTickMarkerY(){return this.dM.getMarker()}}class su extends da{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.uM=!1,this.cM=!1,this.pM=!1,this.mM=!1,this.yM=new Map,this.SM=new Map,this.nM=!0,this.oM=!0,this.tm=s,this.fM=r,this.AM=n,this.vM=o.cursorGridStrokeStyleX,this.xM=o.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.yM.forEach((t=>t.dispose())),this.SM.forEach((t=>t.dispose())),this.bM=void 0,this.MM=void 0,this}Fe(){return this.bM&&this.bM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.nM),this.MM&&this.MM.setVisible(this.ji&&this.Jg).setMarkerVisible(this.ji&&this.Jg&&this.oM),super.Fe()}pointAt(t){const{location:e}=t,i=t.owner instanceof yu&&t.owner;if(!i)return this;const{axisX:s}=i,{axisY:r}=i,n=this.gh(s,!0),o=this.gh(r,!1);n!==this.bM&&this.bM&&this.bM.setVisible(!1),o!==this.MM&&this.MM&&this.MM.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=eu(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.uM?h.x:1),o.setGridStrokeLength(this.cM?h.y:1),this.bM=n,this.MM=o,super.pointAt(t)}rm(t){if(super.rm(t),t){const e=e=>e.setTextFillStyle(t);this.bM&&this.pM&&this.bM.setMarker(e),this.MM&&this.mM&&this.MM.setMarker(e)}}gh(t,e){let i=(e?this.yM:this.SM).get(t);return i||(e?(i=t.Hg(!1,this.fM),this.yM.set(t,i)):(i=t.Hg(!1,this.AM),this.SM.set(t,i)),this.lr(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}lr(t,e){const i=e?this.vM:this.xM;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.nM:this.oM)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.uM=t,this.Ts.vs(),this}getGridStrokeXCut(){return this.uM}setGridStrokeYCut(t){return this.cM=t,this.Ts.vs(),this}getGridStrokeYCut(){return this.cM}setGridStrokeXStyle(t){return this.vM=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.yM.forEach((t=>t.setGridStrokeStyle(this.vM))),this}getGridStrokeXStyle(){return this.vM}setGridStrokeYStyle(t){return this.xM=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.SM.forEach((t=>t.setGridStrokeStyle(this.xM))),this}getGridStrokeYStyle(){return this.xM}setTickMarkerXVisible(t){return this.nM=t,this.Ts.vs(),this}getTickMarkerXVisible(){return this.nM}setTickMarkerYVisible(t){return this.oM=t,this.Ts.vs(),this}getTickMarkerYVisible(){return this.oM}setTickMarkerX(t){return this.yM.forEach((e=>e.setMarker(t))),this.fM=this.fM.addStyler(t),this.Ts.vs(),this}setTickMarkerY(t){return this.SM.forEach((e=>e.setMarker(t))),this.AM=this.AM.addStyler(t),this.Ts.vs(),this}setTickMarkerXAutoTextStyle(t){return this.pM=t,this.Ts.vs(),this}getTickMarkerXAutoTextStyle(){return this.pM}setTickMarkerYAutoTextStyle(t){return this.mM=t,this.Ts.vs(),this}getTickMarkerYAutoTextStyle(){return this.mM}}class ru extends ga{constructor(t,e,i,s){super(t,s),this.tm=t,this.fM=e,this.AM=i,this.nm=s}}class nu extends ru{constructor(){super(...arguments),this.am=(t,e,i,s)=>this.om(new su(t,e,i,this.tm,this.fM,this.AM,s),s),this.addStyler=t=>new nu(this.tm,this.fM,this.AM,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new nu(t,this.fM,this.AM,this.nm.map((t=>t)))}}class ou extends ru{constructor(){super(...arguments),this.lm=(t,e,i,s,r)=>this.om(new iu(t,e,i,s,this.tm,this.fM,this.AM,r),r),this.addStyler=t=>new ou(this.tm,this.fM,this.AM,this.nm.map((t=>t)).concat(t)),this.setResultTableBackground=t=>new ou(t,this.fM,this.AM,this.nm.map((t=>t)))}}const hu=new nu(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{pa(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),au=new ou(mo,ih.PointableTextBox,ih.PointableTextBox,[(t,e)=>{xa(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),lu=new ou(mo,ih.PointableTextBox,ih.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),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Sn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),uu=(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}},cu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class du{constructor(t,i,s,n,o,h){this._M=e.UIVisibilityModes.always,this.wM=e.UIVisibilityModes.always,this.Lo=!0,this.Xi=!1,this.CM=!1,this.kM=!1,this.ca=u(0,0),this._u=e.UIDraggingModes.draggable,this.wu=void 0,this.L=new r.Eventer,this.ji=!0,this.TM=(t,i,s)=>{this.CM=!0,this.Ts.vs();const r=this._u===e.UIDraggingModes.notDraggable?this._u:s||this._u;this.wu=this.Ts.cs.Ur(r===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:r===e.UIDraggingModes.draggable?e.MouseStyles.Move:r===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical)},this.FM=()=>{this.CM=!1,this.Ts.vs(),this.Ts.cs.Yr(this.wu)},this.IM=(t,e)=>{this.kM=!0,Zt(e),this.Ts.vs()},this.PM=(t,i)=>{if(this._u!==e.UIDraggingModes.notDraggable){const s=i||this._u,r=dt(this.Ts.cs.De(t.x,t.y),this.Ts.cs.ft,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?cu(r.x,this.scale.x):this.ca.x,s!==e.UIDraggingModes.onlyHorizontal?cu(r.y,this.scale.y):this.ca.y);return this.setPosition(n),!0}return!1},this.DM=(t,e)=>{this.kM=!1,Zt(e),this.Ts.vs()},this.onDispose=t=>this.L.on("dispose",t),this.offDispose=t=>this.L.off(t,"dispose"),this.Ts=t,this.renderingScale=i,this.scale=s,this.Ux=n,this.BM=o,this.ts=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.TM(t,e))),a.onMouseLeave(this.FM),a.onMouseDragStart(this.IM),a.onMouseDrag(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),a.onMouseDragStop(this.DM),a.onTouchStart(this.IM),a.onTouchMove(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),a.onTouchEnd(this.DM),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.ca)}setPosition(t){return this.ca=t,this.Ux.setPosition(t),this.L.emit("positionChange",this,this.ca),this}getPosition(){return this.ca}onPositionChange(t){return this.L.on("positionChange",t)}offPositionChange(t){return this.L.off(t,"positionChange")}setPointMarkerVisibility(t){return this._M=t,this.Ts.vs(),this}getPointMarkerVisibility(){return this._M}setResultTableVisibility(t){return this.wM=t,this.Ts.vs(),this}getResultTableVisibility(){return this.wM}setMouseInteractions(t){return this.Lo=t,this.Ux.getPointMarker().setMouseInteractions(t),this.Ux.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.Lo}setAutoFitStrategy(t){return this.Ux.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Ux.getAutoFitStrategy()}isAttached(){return!0}Fe(){const t=this.isAttached();return uu(this._M,this.CM,this.kM)?this.Ux.setPointMarkerVisible(!0):this.Ux.setPointMarkerVisible(!1),t&&uu(this.wM,this.CM,this.kM)?this.Ux.setResultTableVisible(!0):this.Ux.setResultTableVisible(!1),this.Ux.Fe(),this}Ds(){return this.Ux.Ds(),this}pointAt(t){return this.Ux.pointAt(t),this}dispose(){return this.Xi||(this.Xi=!0,this.BM(this),this.Ux.dispose(),this.L.emit("dispose")),this}isDisposed(){return this.Xi}setVisible(t){const e=this.ji!==t;return this.ji=t,this.Ux.setVisible(t),e&&this.L.emit("visibleStateChanged",this,this.ji),this}getVisible(){return this.ji}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}setPointMarker(t){return this.Ux.setPointMarker(t),this}getPointMarker(){return this.Ux.getPointMarker()}setResultTable(t){return this.Ux.setResultTable(t),this}getResultTable(){return this.Ux.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this._u=t,this.Ts.vs(),this}getDraggingMode(){return this._u}}class fu extends du{constructor(t,i,s,r,n,o,h){super(t,i,Bi(s.ft,r.ft),n.lm(t,i,s,r,h),o,h),this.LM=e.UIVisibilityModes.always,this.RM=e.UIVisibilityModes.always,this.EM=e.UIVisibilityModes.always,this.zM=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Ux.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Ux.getGridStrokeYStyle(),this.Ts=t,this.axisX=s,this.axisY=r,this.BM=o;const a=this.Ux.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.TM(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.FM),a.onMouseDragStart(this.IM),a.onMouseDrag(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i))),a.onMouseDragStop(this.DM),a.onTouchStart(this.IM),a.onTouchMove(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i)));const l=this.Ux.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.TM(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.FM),l.onMouseDragStart(this.IM),l.onMouseDrag(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i))),l.onMouseDragStop(this.DM),l.onTouchStart(this.IM),l.onTouchMove(((t,i)=>this.PM(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i)))}Fe(){const t=this.isAttached();return this.ji&&t&&uu(this.EM,this.CM,this.kM)?this.Ux.setTickMarkerXVisible(!0):this.Ux.setTickMarkerXVisible(!1),this.ji&&t&&uu(this.zM,this.CM,this.kM)?this.Ux.setTickMarkerYVisible(!0):this.Ux.setTickMarkerYVisible(!1),this.Ux.setGridStrokeXStyle(this.ji&&t&&uu(this.LM,this.CM,this.kM)?this.gridStrokeStyleX:ot),this.Ux.setGridStrokeYStyle(this.ji&&t&&uu(this.RM,this.CM,this.kM)?this.gridStrokeStyleY:ot),super.Fe()}setGridStrokeXVisibility(t){return this.LM=t,this.Ts.vs(),this}getGridStrokeXVisibility(){return this.LM}setGridStrokeYVisibility(t){return this.RM=t,this.Ts.vs(),this}getGridStrokeYVisibility(){return this.RM}setTickMarkerXVisibility(t){return this.EM=t,this.Ts.vs(),this}getTickMarkerXVisibility(){return this.EM}setTickMarkerYVisibility(t){return this.zM=t,this.Ts.vs(),this}getTickMarkerYVisibility(){return this.zM}setGridStrokeXCut(t){return this.Ux.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Ux.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Ux.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Ux.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Ux.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Ux.getGridStrokeYStyle()}setTickMarkerX(t){return this.Ux.setTickMarkerX(t),this}getTickMarkerX(){return this.Ux.getTickMarkerX()}setTickMarkerY(t){return this.Ux.setTickMarkerY(t),this}getTickMarkerY(){return this.Ux.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Ux.getTickMarkerX().setMouseInteractions(t),this.Ux.getTickMarkerY().setMouseInteractions(t),this}}class gu extends fu{}class mu extends gu{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.VM=!1,this.Ts=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.VM=!1,this.Ts.vs(),this}Ds(){if(!this.VM){const t=this.owningSeries.solveNearestFromScreen(dt(this.ca,this.scale,this.Ts.cs.ft));t?(this.ca=dt(t.location,this.owningSeries.scale,this.scale),this.Ux.pointAt(t),this.VM=!0):this.Ux.setPosition(this.ca)}return super.Ds()}isAttached(){return this.VM}}class yu extends Gl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.OM=[],this.addMarker=(t=lu)=>{const e=new mu(this.NM(),this.Ki.uiScale,this,t,this.removeMarker,this.ts);return this.OM.push(e),e},this.removeMarker=t=>{const e=this.OM.indexOf(t);-1!==e&&this.OM.splice(e,1)},this.ss=new Map,this.chart=t,this.Ts=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.NM=h,this.scale=Bi(s.ft,r.ft),this.GM=t.WM,t.WM+=1,this.UM(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.YM),this.onMouseLeave(this.chart.HM),this.onMouseWheel(this.chart.eS),this.onMouseDragStart(this.chart.$M),this.onMouseDrag(this.chart.hS),this.onMouseDragStop(this.chart.XM),this.onTouchStart(this.chart.rS.onTouchStart),this.onTouchMove(this.chart.rS.onTouchMove),this.onTouchEnd(this.chart.rS.onTouchEnd)}get xAxis(){return this.axisX}get yAxis(){return this.axisY}attacheAxis(){this.jM=this.axisXAttachHandler(this),this.ZM=this.axisYAttachHandler(this)}Fe(){super.Fe();for(let t=0;t{e.Ko(this.GM)})),this.Ki.cs.vs(),this}dispose(){return super.dispose(),this.OM.slice().forEach((t=>t.dispose())),this.jM(this),this.ZM(this),this}QM(){for(let t=0;t{const r=t.length;let n=0;if(void 0!==e){const r=i-e;if(r>0){const e=t.slice(n,r);n+=r,s(e,!0)}}for(;nt))=>{const i=[];let s;for(let r=0;r{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const r=e.getIcon();return r?t.addRow(r,e.getName()):t.addRow(e.getName()),t.addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s))};class vu extends yu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.JM=[],this.yu=[],this.KM=0,this.Zi=!1,this.$i=e.HighlightModes.onHover,this.Om=Au,this.Ki.cs.Gn(ah.mf),this.qM=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.KM=void 0!==e&&e>0?e:0,this.Ts.vs(),this}add(t){if(0!==this.JM.length&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)?this.t_(t):this.t_([t]),this.yu.length>0){const t=this.yu[this.yu.length-1];this.i_={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.i_?this.i_.y+e:0),this.add(((t,e=1,i)=>{const s=void 0!==i?i:0,r=new Array(t.length);for(let i=0;i{const i=new Array(t.length);for(let s=0;st+e.al()+e.ll()),this.yu.length)}clear(){this.s_=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.qM.getXMax(this.JM,this.s_)||0}getXMin(){return this.qM.getXMin(this.JM,this.s_)||0}getYMax(){return this.qM.getYMax(this.JM,this.s_)||0}getYMin(){return this.qM.getYMin(this.JM,this.s_)||0}Mr(){const t=u(0,0);for(const e of this.JM)t.x=Math.max(t.x,e.xl()),t.y=Math.max(t.y,e.bl());return t}e_(t,e,i,s){this.qM.e_(t,e,i,s,this.scale,(t=>{}))}aS(){super.aS();const t=this.JM.length;this.h_&&this.e_(this.JM,this.getPointAmount(),this.h_,this.KM),t!==this.JM.length&&this.QM()}Fe(){super.Fe();const t=this.getBoundaries();this.yu.length>0&&(this.r_(this.yu),this.yu=[]);for(const e of this.JM)e.Ho(t);return super.Fe()}Ay(){super.Ay(),this.s_=void 0,this.yu.length=0}t_(t){0!==t.length&&(this.s_?this.s_=Je(this.s_,Ze(t)):this.s_=Ze(t),this.L.emit("dataAdd",this,t,this.s_),this.yu=ne(this.yu,t,{canReturnB:!1}),this.Ts.vs())}n_(){return xu(this.JM)}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}}const bu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.c_.findIndex((e=>e===t));e>=0&&this.c_.splice(e,1),this.f_=!0,this.d_=void 0,this.Ts.vs()},this.Zb=()=>{this.d_=void 0,this.f_=!0,this.Ki.cs.vs()},this.Qb=()=>{this.f_=!0,this.Ki.cs.vs()},this.Jb=()=>{this.d_=void 0,this.f_=!0,this.chart.cs.vs()},this.Kb=(t,e)=>{this.setMouseInteractions(e)},this.A_=t=>this.getMouseInteractions()}Fe(){super.Fe(),this.f_&&(this.g_(this.c_),this.f_=!1)}clear(){return this.c_.slice().forEach(Tt),this.c_.length=0,this.f_=!0,this.d_=void 0,this.Ts.vs(),this}p_(t,e){void 0!==e?this.c_.splice(e,0,t):this.c_.push(t),this.f_=!0,this.m_&&this.m_(t),t.onMouseEnter(((t,e)=>this.Ct(t,e))),t.onMouseLeave(((t,e)=>this.kt(t,e))),t.onMouseClick(((t,e)=>this.Tt(t,e))),t.onMouseDoubleClick(((t,e)=>this.Ft(t,e))),t.onMouseDown(((t,e)=>this.It(t,e))),t.onMouseUp(((t,e)=>this.Pt(t,e))),t.onMouseMove(((t,e)=>this.Dt(t,e))),t.onMouseDragStart(((t,e,i)=>this.Lt(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.Bt(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.Rt(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Et(t,e))),t.onTouchStart(((t,e)=>this.zt(t,e))),t.onTouchMove(((t,e)=>this.Vt(t,e))),t.onTouchEnd(((t,e)=>this.Ot(t,e))),this.Ts.vs()}qy(){return this.iS&&this.c_.length>0&&this.getVisible()}setDefaultStyle(t){this.m_=t,this.c_.forEach(t),t(this.y_);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.c_.filter((t=>t.getVisible())),this.v_,Xe);if(void 0!==i)return{location:dt(i[0],this.Ts.cs.ft,this.scale),scale:this.scale,resultTableContent:this.Om(new la,this,i[1]).Qu(),owner:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}getXMax(){return this.d_||(this.d_=this.x_()),this.d_.max.x}getXMin(){return this.d_||(this.d_=this.x_()),this.d_.min.x}getYMax(){return this.d_||(this.d_=this.x_()),this.d_.max.y}getYMin(){return this.d_||(this.d_=this.x_()),this.d_.min.y}Mr(){return u(0,0)}x_(){const t=m(c(Le,Le),c(Pe,Pe));for(let e=0;e0?this.c_[0].getDominantStyle():this.y_.getDominantStyle()})}}const Eu=(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 wu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Box Series",this.Om=Eu,this.b_=Ce(),this.v_=t=>dt(this.Fs.toPoint((t.start+t.end)/2,t.median),this.scale,this.Ts.cs.ft),this.Ki.cs.Gn(ah.Sf),this.Fs=a,this.y_=new tu(this.Ts,this.scale,this.tM,kt,kt,kt,kt,(t=>!1),this.Fs,0,0,0,0,0,0,0,this.ts).dispose(),this.M_=new Ha((()=>{const t=this.Ts.Rg(this.scale);return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.zg(e.start,e.end),i}))))),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){if(!(t instanceof _i||t instanceof Vi))throw new Error("BoxSeries only supports Linear Axes")}g_(t){const e=this.__.gy(),i=this.M_.gy();t.forEach((t=>{if(!t.getVisible())return;const s=this.Fs.toPoint((t.start+t.end-t.iM*(t.end-t.start))/2,t.lowerQuartile),r=this.Fs.toPoint((t.end-t.start)*t.iM,t.upperQuartile-t.lowerQuartile),n=this.Fs.toPoint((t.start+t.end)/2,t.lowerQuartile),o=this.Fs.toPoint((t.start+t.end)/2,t.lowerExtreme),h=this.Fs.toPoint((t.start+t.end)/2,t.upperQuartile),a=this.Fs.toPoint((t.start+t.end)/2,t.upperExtreme),l=this.Fs.toPoint((t.start+t.end-t.sM*(t.end-t.start))/2,t.lowerExtreme),u=this.Fs.toPoint((t.start+t.end+t.sM*(t.end-t.start))/2,t.lowerExtreme),c=this.Fs.toPoint((t.start+t.end-t.sM*(t.end-t.start))/2,t.upperExtreme),d=this.Fs.toPoint((t.start+t.end+t.sM*(t.end-t.start))/2,t.upperExtreme),f=this.Fs.toPoint((t.start+t.end-t.iM*(t.end-t.start))/2,t.median),g=this.Fs.toPoint((t.start+t.end+t.iM*(t.end-t.start))/2,t.median);e.add({Go:t.Go,vertices:[{x:s.x,y:s.y},{x:s.x,y:s.y+r.y},{x:s.x+r.x,y:s.y+r.y},{x:s.x+r.x,y:s.y}],figure:t},{fillStyle:t.eM,strokeStyle:t.hM}),i.add({Go:0,start:n,end:o,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:h,end:a,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:l,end:u,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:c,end:d,figure:t},{strokeStyle:t.uu}),i.add({Go:0,start:f,end:g,figure:t},{strokeStyle:t.rM})})),e.finishPlot(),i.finishPlot()}add(t){const e=new tu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.Fs,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.ts);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Tu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Ha=m(u(0,0),u(0,0)),this.Ts=t,this.scale=e,this.be=fe(a.ellipseSeriesFillStyle,l),this.Me=fe(a.ellipseSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.dimensions=t,this.Ha=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class ku extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Ellipse Series",this.Om=(t,e,i)=>t.addRow(e.Ms).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.b_=Ce(),this.v_=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Tu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){if(!(t instanceof _i||t instanceof Vi))throw new Error("EllipseSeries only supports Linear Axes")}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=[],r=void 0!==i.drawSteps?i.drawSteps:72;for(let t=0;t<=r;t+=1){const e=t/r*2*Math.PI,n=i.x+i.radiusX*Math.cos(e),o=i.y+i.radiusY*Math.sin(e);s.push({x:n,y:o})}const n=t.getFillStyle(),o=t.getStrokeStyle();e.add({Go:t.Go,vertices:s,figure:t},{fillStyle:n,strokeStyle:o})})),e.finishPlot()}add(t){const e=new Tu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Cu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.C_=[],this.Ha=_e,this.Ts=t,this.scale=e,this.be=fe(a.polygonSeriesFillStyle,l),this.Me=fe(a.polygonSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.C_=t,this.Ha=Ze(this.C_),this.Zb(),this.Ts.vs(),this}getDimensions(){return this.C_}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Ru extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Polygon Series",this.Om=(t,e,i)=>t.addRow(e.getName()),this.b_=Ce(),this.v_=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Cu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s=t.getFillStyle(),r=t.getStrokeStyle();e.add({Go:t.Go,vertices:i,figure:t},{fillStyle:s,strokeStyle:r})})),e.finishPlot()}add(t){const e=new Cu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Iu extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.k_={x:0,y:0,width:0,height:0},this.T_={x1:0,y1:0,x2:0,y2:0},this.Ha=m(u(0,0),u(0,0)),this.be=fe(a.rectangleSeriesFillStyle,l),this.Ts=t,this.scale=e,this.Me=fe(a.rectangleSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return"x"in t?(this.k_=t,this.T_={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.T_=t,this.k_={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Ha=Ze([this.k_,u(this.k_.x+this.k_.width,this.k_.y+this.k_.height)]),this.Zb(),this.Ts.vs(),this}getDimensionsPositionAndSize(){return this.k_}getDimensionsTwoPoints(){return this.T_}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.Qb(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){return this.be}}class Fu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Rectangle Series",this.Om=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.Ms).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.b_=Ce(),this.v_=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Iu(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.__=new Ha((()=>{const t=this.b_.wt(this.Ts.$x(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.figure),i})))),(()=>{this.b_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.__.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensionsTwoPoints(),s=[{x:i.x1,y:i.y1},{x:i.x1,y:i.y2},{x:i.x2,y:i.y2},{x:i.x2,y:i.y1}],r=t.getFillStyle(),n=t.getStrokeStyle();e.add({Go:t.Go,vertices:s,figure:t},{fillStyle:r,strokeStyle:n})})),e.finishPlot()}add(t){const e=new Iu(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}class Du extends Ql{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Ha=m(u(0,0),u(0,0)),this.ts=a,this.Ts=t,this.scale=e,this.Me=fe(a.segmentSeriesStrokeStyle,l)}getBoundaries(){return this.Ha}setDimensions(t){return this.dimensions=t,this.Ha=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.Zb(),this.Ts.vs(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Qb(),this}getStrokeStyle(){return this.Me}getDominantStyle(){const t=this.Me;return t!==ot?t.getFillStyle():z}}class Lu extends Mu{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Segment Series",this.Om=(t,e,i)=>t.addRow(e.Ms).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.F_=Ce(),this.v_=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return dt(i,this.scale,this.Ts.cs.ft)},this.Ki.cs.Gn(ah.Sf),this.w_=c,this.y_=new Du(this.Ts,this.scale,kt,kt,kt,kt,kt,(t=>!1),this.ts,this.w_).dispose(),this.M_=new Ha((()=>{const t=this.F_.wt(this.Ts.Rg(this.scale));return this.fs(t,{setEventHandlers:!1}),t}),((t,e,i)=>(t.Ee(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.zg(e.start,e.end),this.F_.Nt(i,e.figure),i})))),(()=>{this.F_.Gt()}),((t,e)=>{this.ps(e)}))}UM(t){}g_(t){const e=this.M_.gy();t.forEach((t=>{if(!t.getVisible())return;const i=t.getDimensions(),s={x:i.startX,y:i.startY},r={x:i.endX,y:i.endY},n=t.getStrokeStyle();e.add({Go:t.Go,start:s,end:r,figure:t},{strokeStyle:n})})),e.finishPlot()}add(t){const e=new Du(this.Ts,this.scale,this.tM,this.Zb,this.Qb,this.Jb,this.Kb,this.A_,this.ts,this.w_).setDimensions(t);return this.p_(e),this.f_=!0,this.Ki.cs.vs(),e}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}}const Pu=(t,e,i)=>{const s=e.getIcon();return s?t.addRow(s,e.getName()):t.addRow(e.getName()),t.addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1))};class _u extends yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Heatmap Grid Series",this.Om=Pu,this.Rb=!1,this.gv={},this.Ki.cs.Gn(ah.yf),this.I_=a,this.ts=l;const d=c;this.be=fe(l.heatmapGridSeriesFillStyle,d),this.pv=fe(this.ts.heatmapGridSeriesWireframeStyle,d);const f={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows};this.Yn=f,this.P_=this.Ts.D_(this.scale,[],f).ke(this.be).mv(this.pv).ds(this.getHighlight()),this.fs(this.P_),a.start&&this.setStart(a.start),a.end&&this.setEnd(a.end),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}Sv(){const t=this.gv.start||{x:0,y:0};let e;e=this.gv.end?{x:(this.gv.end.x-t.x)/this.Yn.columns,y:(this.gv.end.y-t.y)/this.Yn.rows}:this.gv.step?this.gv.step:{x:1,y:1},this.P_.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.P_.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.P_.xv().step}setEnd(t){return this.gv.end=t,this.Sv(),this}getEnd(){return this.P_.xv().end}clear(){return this.P_.Gt(),this.Ts.vs(),this.L.emit("dataClear",this),this}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.P_.mv(this.pv),this.Ts.vs(),this.L.emit("styleChange",this),this}getWireframeStyle(){return this.pv}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.P_.Mv(t),this.Ts.vs(),this.L.emit("styleChange",this),this}getIntensityInterpolation(){return this.P_._v()}qy(){return this.iS&&this.getVisible()}Wd(){return ue(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}B_(t){this.P_.B_().forEach((e=>{t.P_.wv(e)}))}u_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}L_(t){return this.L.on("styleChange",t)}R_(t){return this.L.off(t)}$c(t,e,i=this.Rb){const s=dt(t,this.Ts.cs.ft,this.scale),r=e?this.P_.getIsUnderMouse()?this.P_:void 0:this.P_;if(!r)return;const n=i?r.Vb(s):r.$c(s);if(n){const t={x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue};return{location:t,scale:this.scale,resultTableContent:this.Om(new la,this,t).Qu(),owner:this}}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}getXMax(){const t=this.P_;return t?t.bt():void 0}getXMin(){const t=this.P_;return t?t.xt():void 0}getYMax(){const t=this.P_;return t?t._t():void 0}getYMin(){const t=this.P_;return t?t.Mt():void 0}Mr(){const t=u(0,0);return t.x=Math.max(t.x,this.P_.xl()),t.y=Math.max(t.y,this.P_.bl()),t}UM(t){if(!(t instanceof _i))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.wi())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Pe(t,e){t.ds(e),this.Ts.vs()}Fe(){return super.Fe(),this.P_.Ho(this.getBoundaries()),this}}class Vu extends _u{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.fS=!1,this.Om=Pu}invalidateIntensityValues(t){if(this.fS&&this.Ki.cs.Gn(ah.xf),Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Yn.dataOrder?t.length:t[0].length,rows:"rows"===this.Yn.dataOrder?t.length:t[0].length},i="columns"===this.Yn.dataOrder?this.Yn.columns:this.Yn.rows,s="columns"===this.Yn.dataOrder?this.Yn.rows:this.Yn.columns;if(e.x>i||e.y>s){if(!0===this.chart.dA.$n){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Yn.columns}x${this.Yn.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.dA.$n){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Yn.columns}x${this.Yn.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.`;bt.console.warn(i)}const i=Math.max(s-o,0),r=e.primary-i,a=Math.max(n-h,0),l=[];for(let e=0;e0?-a:void 0);t={iColumn:t.iColumn,iRow:t.iRow,values:l}}this.P_.wv({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.L.emit("invalidateIntensity",this,t),this.Ts.vs(),this.fS=!0,this}setFillStyle(t){return this.be="function"==typeof t?t(this.be):t,this.P_.ke(this.be),this.L.emit("styleChange",this),this.Ts.vs(),this}getFillStyle(){return this.be}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}E_(t){return this.L.on("invalidateIntensity",t)}z_(t){return this.L.off(t)}}class Bu extends yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Scrolling Heatmap Grid Series",this.Om=Pu,this.Rb=!1,this.gv={},this.Ki.cs.Gn(ah.yf),this.Ki.cs.Gn(ah.xf);const d=c;this.be=fe(l.heatmapScrollingGridSeriesFillStyle,d),this.pv=fe(this.ts.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",...a};this.Yn=f,this.V_=this.Ts.O_(this.scale,[],f).ke(this.be).mv(this.pv).ds(this.getHighlight()),this.fs(this.V_),a.start&&this.setStart(a.start),a.step&&this.setStep(a.step),this.setHighlightOnHover(!1)}Sv(){const t=this.gv.start||{x:0,y:0};let e;e=this.gv.step?this.gv.step:{x:1,y:1},this.V_.vv(t,e),this.Ki.cs.vs()}setStart(t){return this.gv.start=t,this.Sv(),this}getStart(){return this.V_.xv().start}setStep(t){return this.gv.step=t,this.Sv(),this}getStep(){return this.V_.xv().step}clear(){return this.V_.Gt(),this.Ts.vs(),this}setWireframeStyle(t){return this.pv="function"==typeof t?t(this.pv):t,this.V_.mv(this.pv),this.Ts.vs(),this}getWireframeStyle(){return this.pv}setPixelInterpolationMode(t){return t=t||"disabled",this.V_.Mv(t),this.Ts.vs(),this}getPixelInterpolationMode(){return this.V_._v()}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.V_.vu(t),this.Ts.vs(),this}qy(){return this.iS&&this.getVisible()}Wd(){return ue(this.be)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}ke(t){return this.be="function"==typeof t?t(this.be):t,this.V_.ke(this.be),this.Ts.vs(),this}$c(t,e,i=this.Rb){const s=dt(t,this.Ts.cs.ft,this.scale),r=e?this.V_.getIsUnderMouse()?this.V_:void 0:this.V_;if(!r)return;const n=i?r.Vb(s):r.$c(s);return n?wa(n,this.scale,this.Om(new la,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).Qu(),this):void 0}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}UM(t){if(!(t instanceof _i))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.wi())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.V_.bt()||0}getXMin(){return this.V_.xt()||0}getYMax(){return this.V_._t()||0}getYMin(){return this.V_.Mt()||0}Mr(){const t=u(0,0);return t.x=Math.max(t.x,this.V_.xl()),t.y=Math.max(t.y,this.V_.bl()),t}Pe(t,e){t.ds(e),this.Ts.vs()}}class zu extends Bu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u,c),this.Om=Pu}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Yn.scrollDimension?t.length:t[0].length,"rows"===this.Yn.scrollDimension?t.length:t[0].length,0+i-1),r=this.Yn.resolution-1;if(s>r){if(!0===this.chart.dA.$n){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Yn.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;bt.console.warn(t)}const s=[];for(let i=0;it.slice()},this.Rb=!0,this.U_=[],this.Y_=[],this.H_=!1,this.Wd=()=>ue(this.X_)||ue(this.j_),this.Z_=t=>{const e=t.length;if(this.JM.length>0){const i=this.JM.length-1,s=this.JM[i];if(e>0){const[e,i]=s.il(),[r,n]=s.tl();if((r?e.length+r.length:e.length)>=this.h_){const o=r&&r.length>0?r[r.length-1]:e[e.length-1],h=n&&n.length>0?n[n.length-1]:i[e.length-1],a=(o.x+t[0].position)/2,l=di(a,o,u(t[0].position,t[0].high)).y,c=di(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.ol(f,m(u(a,c),u(a,l))).Vl(!0),this.Q_([f].concat(t)).El(!0)}else s.ol(t)}}else e>0&&this.Q_(t)},this.J_=t=>{const e=this.U_,i=t.length;if(this.U_.length>0){if(i>0){const i=e[e.length-1],s=i.il(),r=i.tl();if(s.length+r.length>=this.h_){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=di(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ol(a,m(u(o,h),u(o,h))).Vl(!0),e.push(this.K_([a].concat(t),this.s_).El(!0))}else i.ol(t)}}else i>0&&e.push(this.K_(t))},this.q_=t=>{const e=this.Y_,i=t.length;if(this.Y_.length>0){if(i>0){const i=e[e.length-1],s=i.il(),r=i.tl();if(s.length+r.length>=this.h_){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=di(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.ol(a,m(u(o,h),u(o,h))).Vl(!0),e.push(this.tw([a].concat(t)).El(!0))}else i.ol(t)}}else i>0&&e.push(this.tw(t))},this.iw=(t,e)=>{const i=t.Yb(e);if(i)return[dt(i[0],this.scale,this.Ts.cs.ft),dt(i[1],this.scale,this.Ts.cs.ft)]},this.sw=(t,e)=>{const i=t.ew(e);if(i)return[dt(i[0],this.scale,this.Ts.cs.ft),dt(i[1],this.scale,this.Ts.cs.ft)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.KM=void 0!==e&&e>0?e:0,this.Ts.vs(),this}clear(){for(let t=0;tt+e.al()+e.ll()),this.yu.length)}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.Om}getXMax(){return Ot(this.JM,Lt,Math.max,Bt,this.s_)||0}getXMin(){return Ot(this.JM,Dt,Math.min,Vt,this.s_)||0}getYMax(){return Ot(this.JM,_t,Math.max,Nt,this.s_)||0}getYMin(){return Ot(this.JM,Pt,Math.min,zt,this.s_)||0}Mr(){const t=u(0,0);for(const e of this.JM)t.x=Math.max(t.x,e.xl()),t.y=Math.max(t.y,e.bl());return t}qy(){return this.iS&&this.getPointAmount()>0&&this.getVisible()}UM(t){}t_(t,e,i){this.yu=ne(this.yu,t,{canReturnB:!1}),this.G_=ne(this.G_,e,{canReturnB:!1}),this.W_=ne(this.W_,i,{canReturnB:!1}),this.Ts.vs()}hw(t,e,i,s){this.rw(e,i,s),this.t_(Array.isArray(t)?t:[t],e,i)}rw(t,e,i){const s=Je(Ze(t),Ze(e));this.s_?this.s_=Je(this.s_,s):this.s_=s,i&&(this.s_=Je(this.s_,i))}nw(){const t=this.JM.length,e=Math.min(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd());let i=0;if(t>1)for(let s=0;s0){const r=Math.ceil(i/e),n=t.length-r;if(n>0&&s>0){const e=n-s>0?s:n;if(e>0){for(let i=0;i0?this.JM[this.JM.length-1]:void 0,i=e?e.il()[0].length+(e.tl()[0]?e.tl()[0].length:0):void 0;pu(t,i,this.h_,this.Z_)}aw(t){const e=this.U_.length>0?this.U_[this.U_.length-1].il().length+this.U_[this.U_.length-1].tl().length:void 0;pu(t,e,this.h_,this.J_)}lw(t,e){const i=this.U_.length>0?this.U_[this.U_.length-1].il().length+this.U_[this.U_.length-1].tl().length:void 0;pu(t,i,this.h_,this.J_),pu(e,i,this.h_,this.q_)}Q_(t,e){const i=this.Ts.uw(this.scale).ol(t,e).ke(this.X_).Ll(this.j_).Dl(this.wl).ds(this.getHighlight());return this.JM.push(i),this.fs(i),i}cw(t,e,i){const s=this.Ts.sy(this.scale,void 0,[za.UserSeries]).ol(t,i).setMouseInteractions(!1).Ee(e).ds(this.getHighlight());return this.fs(s),s}K_(t,e){return this.cw(t,this.dw,e)}tw(t,e){return this.cw(t,this.fw,e)}Aw(t){this.X_="function"==typeof t?t(this.X_):t;const e=this.X_;for(let t=0;t0){const t=this.JM.length,e=this.nw();this.e_(this.JM,this.h_,this.KM,e);const i=this.JM.length;this.U_.length>0&&this.e_(this.U_,this.h_,this.KM,e),this.Y_.length>0&&this.e_(this.Y_,this.h_,this.KM,e),t!==i&&this.QM(),this.H_=!0}}Fe(){if(super.Fe(),this.yu.length>0&&(this.ow(this.yu),this.Mw(this.G_,this.W_),this.H_=!0),this.H_){const t=this.getBoundaries();for(const e of this.JM)e.Ho(t);for(const e of this.U_)e.Ho(t);for(const e of this.Y_)e.Ho(t)}}Ay(){this.s_=void 0,this.yu.length=0,this.G_.length=0,this.W_.length=0}$c(t,e,i=this.Rb){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.JM,i?this.sw:this.iw);if(void 0!==s&&void 0!==s[0]){const t=dt(s[0][0],this.Ts.cs.ft,this.scale),e=dt(s[0][1],this.Ts.cs.ft,this.scale);return wa(t,this.scale,this.Om(new la,this,t.x,t.y,e.y).Qu(),this,s[1].zh())}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}const Ou=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r))};class Uu extends Nu{constructor(t,e,i,s,r,n,o,h,a=0,l,u){super(t,e,i,s,r,n,o,h,l,u),this.Ms="Area Series",this.Om=Ou,this.Ki.cs.Gn(ah.mf),this._w=a}add(t){0!==this.JM.length&&this.Ki.cs.Gn(ah.xf);const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.ww(e),[i,s]=this.Cw(t);this.hw(t,i,s,m(u(Le,this._w),u(Pe,this._w)));const r=this.yu[this.yu.length-1];this.i_=r?{position:r.position,high:r.high,low:r.low}:void 0,this.L.emit("dataAdd",this,e,this.s_)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.i_?this.i_.position+e:0),this.add(Su(t,e,s)),this}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}}class Gu extends Uu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u);const c=t.getSeries().length;this.X_=fe(this.ts.areaSeriesBipolarHighFillStyle,c),this.dw=fe(this.ts.areaSeriesBipolarHighStrokeStyle,c),this.j_=fe(this.ts.areaSeriesBipolarLowFillStyle,c),this.fw=fe(this.ts.areaSeriesBipolarLowStrokeStyle,c)}ww(t){return this.kw(t)}Mw(t,e){return this.lw(t,e)}kw(t){let e=0;const i=[],s=t.length,r=this._w;return s>0&&(this.Tw&&(this.Tw.y<=r&&r<=t[0].y||this.Tw.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.Tw.x+t[0].x),r,r),e+=1),this.Tw=t[s-1],1===s?this.Fw(t[0],i,e):this.Iw(t,i)),i}Fw(t,e,i=0){return e[i]=d(t.x,t.y,this._w),i+1}Iw(t,e){let i=0,s=0;const r=t.length-1,n=this._w;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Pn(r.x,o.x,(h-t)/(s-t));e[i]=d(a,n,n),i+=1}e[i]=d(o.x,o.y,n),i+=1}return i}Cw(t){const e=t.length,i=Array(e),s=Array(e),r=this._w;for(let n=0;nr?(i[n]=u(e.position,e.high),s[n]=u(e.position,r)):e.hight[0]))}setPositiveFillStyle(t){return this.Aw(t),this}setNegativeFillStyle(t){return this.gw(t),this}setPositiveStrokeStyle(t){return this.mw(t),this}setNegativeStrokeStyle(t){return this.yw(t),this}getPositiveFillStyle(){return this.pw()}getNegativeFillStyle(){return this.Rl()}getPositiveStrokeStyle(){return this.Sw()}getNegativeStrokeStyle(){return this.xw()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.X_,fill2:this.j_,behavior:{colorStep:!0}}),super.attach(t,e,i)}}class Yu extends Uu{constructor(){super(...arguments),this.fw=ot}Mw(t){return this.aw(t)}Cw(t){const e=t.length,i=Array(e);for(let s=0;ss?d(t.x,s,s):d(t.x,t.y,s),i+1}Iw(t,e,i=0){let s=0;const r=t.length-1,n=this._w;for(;sn){const t=Si(u(Pe,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,n,n),i+=1}else e[i]=d(o.x,o.y,n),i+=1}else{const t=d(r.x,n,n);if(0!==i&&Ut(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=Si(u(Pe,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}n_(){return xu(this.JM,(t=>t[1]))}setFillStyle(t){return this.gw(t),this}getFillStyle(){return this.Rl()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.j_,stroke:this.dw}),super.attach(t,e,i)}}class Xu extends Yu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,a,l,u);const d=c;this.X_=fe(this.ts.areaSeriesPositiveFillStyle,d),this.j_=z,this.dw=fe(this.ts.areaSeriesPositiveStrokeStyle,d)}ww(t){return this.Dw(t)}Dw(t){const e=[];return 1===t.length?this.Fw(t[0],e):this.Iw(t,e),e}Fw(t,e,i=0){const s=this._w;return e[i]=t.y=n){const t=d(r.x,r.y,n);if(0!==i&&Ut(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=Si(u(Pe,n),u(Le,n),r,o);t&&(e[i]=d(t.x,t.y,n),i+=1),e[i]=d(o.x,o.y,n),i+=1}else e[i]=d(o.x,n,n),i+=1}}return i}n_(){return xu(this.JM,(t=>t[0]||[]))}setFillStyle(t){return this.Aw(t),this}getFillStyle(){return this.pw()}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.X_,stroke:this.dw}),super.attach(t,e,i)}}const Wu={Positive:Xu,Negative:Hu,Bipolar:Gu},ju=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("High","",e.axisY.formatValue(s)).addRow("Low","",e.axisY.formatValue(r));class $u extends Nu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.Ms="Area Range Series",this.Om=ju,this.Ki.cs.Gn(ah.mf);const c=u;this.X_=fe(this.ts.areaRangeSeriesFillStyle,c),this.dw=fe(this.ts.areaRangeSeriesStrokeStyle,c),this.j_=fe(this.ts.areaRangeSeriesFillStyleInverted,c),this.fw=fe(this.ts.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.hw(t,i,s);const r=this.yu[this.yu.length-1];return this.i_=r?{position:r.position,high:r.high,low:r.low}:void 0,this.L.emit("dataAdd",this,e,this.s_),this}addArraysHighLow(t,e,i=1,s=0){if(t.length!==e.length)throw new Error("arrayHigh and arrayLow lengths are not equal");{let r=s;r||(r=this.i_?this.i_.position+i:0),this.add(((t,e,i=1,s)=>{const r=void 0!==s?s:0,n=new Array(t.length);for(let s=0;s{const e=t[0],i=t[1];if(!e||!i)return[];const s=[],r=e.length;for(let t=0;t{const i=[],s=t.length,r=e;if(s>0){let e=0,n=t[0];i[e]=n,e+=1;for(let o=1;o{const i=t*t,s=i*t,r=1-t,n=r*r,o=n*r;return u(o*e[0].x+3*t*n*e[1].x+3*i*r*e[2].x+s*e[3].x,o*e[0].y+3*t*n*e[1].y+3*i*r*e[2].y+s*e[3].y)},qu=(t,e=32)=>{if(2===t.length)return[t[0],t[1]];const i=(t=>{const e=1e-5,i=t.length-1,s=Array(i);if(i>1){let r=u(0,0),n=u(0,0),o=u(0,0),h=ii(hi(t[1],t[0]));const a=3;let l=0,c=0;for(let d=0;de?Math.abs(i/(a*r.x)):1,c=Math.abs(n.x)>e?Math.abs(i/(a*n.x)):1}f[1]=oi(ni(r,l),f[1]),f[2]=hi(f[2],ni(n,c)),s[d]=f}}return s.length>0?s:[]})(t),s=i.length,r=Array(s*e);let n=0;for(let t=0;t{if(this.JM.length>0){const e=this.JM[this.JM.length-1];if(t.length>0){const i=e.il(),s=e.tl(),r=i.length+s.length-+e.zl();if(r>=this.h_){const n=s.length>0?s[s.length-1]:i[e.zl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.ol(o,m(u(o.x,o.y),u(o.x,o.y))).Vl(!0),this.zw([o].concat(t)).El(!0)}else e.ol(t,this.s_)}}else t.length>0&&this.zw(t)},this.Vw=t=>{if(this.Rw.length>0){const e=this.Rw[this.Rw.length-1];t.length>0&&((e.il().length+e.tl().length)*this.Lw>=this.h_?this.Ow(t):e.ol(t))}else t.length>0&&this.Ow(t)},this.Nw=(t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Gw=(t,e)=>{const i=t.ew(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Yn=y,this.Xb=l,this.Ww=f,this.Uw=fe(c.pointLineSeriesFillStyle,g),this.uu=fe(this.ts.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}n_(){return xu(this.Rw)}setStrokeStyle(t){this.uu="function"==typeof t?t(this.uu):t;const e=this.uu;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorSolveBasis(t){return this.Bw=t,this.JM.forEach((e=>e.qa(Pr(t)))),this.Rw.forEach((e=>e.qa(Pr(t)))),this.Ts.vs(),this}getCursorSolveBasis(){return this.Bw}Wd(){return ue(this.Uw)||ue(this.uu.getFillStyle())}ks(){return this.bs||this.Xb}UM(t){}Pe(t,e){t.ds(e),this.Ts.vs()}r_(t){const e=this.JM.length>0?this.JM[this.JM.length-1].il().length+this.JM[this.JM.length-1].tl().length-+this.JM[this.JM.length-1].zl():void 0;pu(t,e,this.h_,this.Ew),pu(t,e,this.h_,this.Vw)}Ow(t,e){const i=this.Ts.bS(this.scale).ol(t,e).setMouseInteractions(this.Hi).ke(this.Uw).sl(this.Xb).tt(this.$b).Gh(this.ga).hl(this.Wa).rl(this.Ua).nl(this.Ya).qa(Pr(this.Bw)).ds(this.getHighlight());return this.fs(i),this.Rw.push(i),i}zw(t,e){const i=this.Ts.sy(this.scale,void 0,[za.UserSeries,...this.Ww]).ol(t,e).setMouseInteractions(this.Hi).Ee(this.uu).qa(Pr(this.Bw)).ds(this.getHighlight());return this.fs(i),this.JM.push(i),i}attach(t,e=!0,i=!1){return le(t,this.ts,i,{stroke:this.uu,fill:this.Uw}),super.attach(t,e,i)}getPointAmount(){return this.Rw.reduce(((t,e)=>t+e.al()+e.ll()),this.yu.length)}clear(){super.clear();for(let t=0;t{}))}$c(t,e,i=this.Rb){const s=i?bu(t,e?this.JM.filter((t=>t.getIsUnderMouse())):this.JM,this.Gw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):bu(t,e?this.Rw.filter((t=>t.getIsUnderMouse())):this.Rw,this.Nw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(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=dt(s[0],this.Ts.cs.ft,this.scale),e=s[1]instanceof cn?s[1].cu():s[1].zh(),i=s[1]instanceof tn?s[1].zh():void 0,r=s[1]instanceof cn?s[1].cu().getFillStyle():void 0,n=X(e)?s[0].color?new G({color:s[0].color}):new G({color:e.getFallbackColor()}):void 0;return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,r||n||i)}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}const tc=(t,e)=>t.tl().length>=e?t.tl().slice(-e):Array.prototype.concat(t.il(),t.tl()).slice(-e),ec=(t,e,i)=>{const s=Array.prototype.concat(t.il(),t.tl()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Gt().ol(s).Ds()};class ic extends Qu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g){super(t,e,i,s,r,n,o,h,a,l,u,c,d,f,g),this.Ms="Spline Series",this.Lw=32,this.h_=8e3,this.Yw=t=>{if(0===t.length)return;const e=this.Rw.length;if(e>0){const i=e>1,s=this.Rw[e-1];if(i){const i=Array.prototype.concat(s.il(),s.tl()),r=i.length;if(32*r>=this.h_){const i=tc(s,3),r=Array.prototype.concat(i,t),n=qu(r,32);ec(this.JM[e-1],n,32),this.zw(n.slice(66))}else if(r<5){const s=this.Rw[e-2],r=tc(s,3),n=Array.prototype.concat(r,i,t),o=qu(n,32),h=this.JM[e-1],a=o.slice(66);h.Gt().ol(a).Ds()}else{const i=this.JM[e-1],r=Array.prototype.concat(i.il(),i.tl()),n=tc(s,4),o=Array.prototype.concat(n,t),h=qu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Gt().ol(a).Ds()}}else{const i=Array.prototype.concat(s.il(),s.tl()),r=i.length,n=this.JM[e-1];if(32*r>=this.h_){const e=tc(s,3),i=Array.prototype.concat(e,t),r=qu(i,32);ec(this.JM[0],r,32),this.zw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=qu(e,32);n.Gt().ol(s).Ds()}else n.ol(t)}}else{const e=t.length>0?qu(t,32):t,i=Ze(e);this.zw(e,i)}this.Vw(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}r_(t){const e=this.Rw.length,i=this.Rw.length>0?this.Rw[e-1].il().length+this.Rw[e-1].tl().length:void 0;pu(t,i,Math.ceil(this.h_/this.Lw),this.Yw)}solveNearestFromScreen(t,e=this.Rb){if(e)return super.solveNearestFromScreen(rh(t,this.Ki.cs),e);const i=bu(rh(t,this.Ki.cs),this.Rw,this.Nw,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(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=dt(i[0],this.Ts.cs.ft,this.scale);return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,i[1].zh())}}}class sc{constructor(){this.Wi="FreeformPattern",this.wl={type:"disabled",packager:(t,e,i)=>t.slice()}}e_(t,e,i,s,r,n){if(s>0){const r=Math.trunc((e-s)/i);if(r>0&&t.length>1){const e=t.splice(0,r);for(let t=0;t{switch(t){case"normal":default:return 1;case"high":return.25}},nc=s.Record({wl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class oc extends nc{e_(t,e,i,s,r,n){if(s>0){const e=Math.ceil(s/i),o=t.length-e;if(o>0){const e=this.nw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.Mt();return t?Math.min(i,t):i},ac=(t,e)=>{const i=e._t();return t?Math.max(i,t):i};class lc extends oc{Hw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(ac,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(hc,e?e.min.y:void 0)}}const uc=(t,e)=>{const i=e.xt();return t?Math.min(i,t):i},cc=(t,e)=>{const i=e.bt();return t?Math.max(i,t):i};class dc extends oc{Hw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(cc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(uc,e?e.min.x:void 0)}}const fc={horizontalProgressive:new class extends lc{constructor(){super({wl:kr()}),this.Wi="HorizontalProgressivePattern"}nw(t,e){const i=t.length,s=Math.min(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1].bt():void 0}getXMin(t=[],e){return t.length>0&&t[0].al()>0?t[0].xt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",kr(rc(t)))}},horizontalRegressive:new class extends lc{constructor(){super({wl:Cr()}),this.Wi="HorizontalRegressivePattern"}nw(t,e){const i=t.length,s=Math.max(e.x.getInnerStart(),e.x.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].al()>0?t[0].bt():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].xt():void 0}setPrecision(t){return this.set("_columnPackaging",Cr(rc(t)))}},verticalProgressive:new class extends dc{constructor(){super({wl:Rr()}),this.Wi="VerticalProgressivePattern"}nw(t,e){const i=t.length,s=Math.min(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0?t[t.length-1]._t():void 0}getYMin(t=[],e){return t.length>0&&t[0].al()>0?t[0].Mt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Rr(rc(t)))}},verticalRegressive:new class extends dc{constructor(){super({wl:Ir()}),this.Wi="VerticalRegressivePattern"}nw(t,e){const i=t.length,s=Math.max(e.y.getInnerStart(),e.y.getInnerEnd());let r=0;if(i>1)for(let n=0;n0&&t[0].al()>0?t[0]._t():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].Mt():void 0}setPrecision(t){return this.set("_columnPackaging",Ir(rc(t)))}},freeform:new sc};class gc extends Qu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g,y){super(t,e,i,s,r,n,o,h,fc.horizontalProgressive,a,c,d,f,g,y),this.Ms="Step Series",this.Ew=t=>{const e=this.JM.length>0?this.JM[this.JM.length-1].il().length+this.JM[this.JM.length-1].tl().length:void 0;pu(t,e,this.h_,this.$w)},this.$w=t=>{const e=t.length;if(this.JM.length>0){const i=this.JM[this.JM.length-1];if(e>0){const e=i.il(),s=i.tl(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Ku([r].concat(t),this.Xw);n.shift();const o=u((r.x+n[0].x)/2,(r.y+n[0].y)/2),h=Array.prototype.concat(o,n);(s.length>0?e.length+s.length:e.length)>=this.h_?(i.ol(o,m(u(o.x,o.y),u(o.x,o.y))).Vl(!0),this.zw(h).El(!0),this.Ow(t)):i.ol(h)}}else e>0&&this.zw(Ku(t,this.Xw));this.Vw(t)},this.Xw=l,void 0===this.Ww.find((t=>"DataPattern"===t.type))&&this.Ww.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class mc extends yu{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.Ms="OHLC Series",this.jw=t=>t[4]>=t[1],this.d_=m(c(Le,Le),c(Pe,Pe)),this.Zw=[],this.Qw=!1,this.Jw=-1,this.Kw=[],this.qw=!0,this.tC=!1,this.iC=4,this.Om=(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.sC=[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.Ki.cs.Gn(ah.nf)}n_(){return this.Kw}o_(t){return this.L.on("dataAdd",t)}a_(t){return this.L.off(t)}l_(t){return this.L.on("dataClear",t)}u_(t){return this.L.off(t)}qy(){return this.iS&&this.Kw.length>0&&this.getVisible()}eC(t){if(!(this.Kw.length<1))return[this.Kw[t][0],this.Kw[t][1],this.Kw[t][2],this.Kw[t][3],this.Kw[t][4]]}$c(t){if(0===this.Kw.length)return;const e=dt(t,this.Ts.cs.ft,this.scale).x,i=void 0!==this.getPackDataState();let s,r,n,o,h;if(i){const t=this.hC;if(!t)return;const i=ke(e,t.length-1,(e=>t[e][0])),a=void 0!==i&&t[i];if(!a)return;o=a[3],n=a[2],r=a[1],h=a[4],s=a[0]}else{const t=ke(e,this.Kw.length-1,(t=>this.Kw[t][0])),i=void 0!==t&&this.Kw[t];if(!i)return;s=i[0],r=i[1],n=i[2],o=i[3],h=i[4]}const a={position:s,open:r,high:n,low:o,close:h,isPacked:i};return{location:u(a.position,a.close),scale:this.scale,resultTableContent:this.Om(new la,this,a).Qu(),owner:this,isPacked:i,position:s,open:r,high:n,low:o,close:h}}UM(t){if(!(t.x instanceof Di))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.rC=t.x}Mr(){return u(5,5)}H_(t){const e=t.length-1;if(e<0)return this;for(let i=0;i<=e;i+=1)t[i][3]0&&this.Ki.cs.Gn(ah.xf);const e=Array.isArray(t[0])?t:[t[0]];if(e.length>0){this.Qw=!0;const t=this.Kw.length,i=this.Zw.length,s=e.length;this.Kw.length=t+s,this.Zw.length=i+s;for(let r=0;rthis.sC[t]));return void 0===i?i=e=1){for(let e=0;e=1&&(t!==this.Jw||this.Qw||this.tC)){this.tC=!1,this.Jw=t,this.Qw=!1,this.oC(),this.hC=[];const e=this.Kw.length;let i=this.Kw[0][0]-this.Kw[0][0]%(t/2)+t,s=0;for(;s({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Ka(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.Mr().x))}),Ac=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Ka(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.Mr().y))});class vc extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.JM=[],this.Ms="Line Series",this.Rb=!0,this.h_=void 0,this.Bw="nearest-x",this.Su=void 0,this.Wd=()=>ue(this.uu.getFillStyle()),this.FC=(t,e)=>{const i=t.Yb(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Gw=(t,e)=>{const i=t.ew(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Ww=c,this.Yn=f,this.uu=fe(this.ts.lineSeriesStrokeStyle,d),this.IC={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.uu="function"==typeof t?t(this.uu):t;const e=this.uu;for(let t=0;tt.vu(this.Su))),this.Ts.vs(),this}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}setCursorSolveBasis(t){return this.Bw=t,this.JM.forEach((e=>e.qa(Pr(t)))),this.Ts.vs(),this}getCursorSolveBasis(){return this.Bw}UM(t){}r_(t){let e=this.JM[0];e||(e=this.zw(),this.JM.push(e),this.fs(e)),e.ol(t,this.s_)}zw(){return this.Ts.sy(this.scale,this.IC,[za.UserSeries,...this.Ww]).Ee(this.uu).vu(this.Su).qa(Pr(this.Bw)).ds(this.getHighlight())}attach(t,e=!0,i=!1){return le(t,this.ts,i,{stroke:this.uu}),super.attach(t,e,i)}Pe(t,e){t.ds(e),this.Ts.vs()}e_(t,e,i,s){}$c(t,e,i=this.Rb){const s=bu(t,e?this.JM.filter((t=>t.getIsUnderMouse())):this.JM,i?this.Gw:this.FC,"nearest-x"===this.Bw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Bw?(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=dt(s[0],this.Ts.cs.ft,this.scale),e=s[1].cu();return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.Rb){return this.$c(rh(t,this.Ki.cs),!1,e)}}class bc extends vu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,new sc,l,u),this.JM=[],this.Ms="Point series",this.$b=5,this.ga=0,this.Wa=!1,this.Ua=!1,this.Ya=!1,this.h_=void 0,this.Nw=(t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,this.Ts.cs.ft)},this.Yn=d,this.Xb=a,this.be=fe(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}Wd(){return ue(this.be)}ks(){return this.bs||this.Xb}UM(t){}attach(t,e=!0,i=!1){return le(t,this.ts,i,{fill:this.be}),super.attach(t,e)}Pe(t,e){t.ds(e),this.Ts.vs()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(let t=0;tt.getIsUnderMouse())):this.JM,this.Nw,Xe);if(void 0!==i){const t=dt(i[0],this.Ts.cs.ft,this.scale),e=i[1].zh(),s=X(e)?i[0].color?new G({color:i[0].color}):new G({color:e.getFallbackColor()}):e;return wa(t,this.scale,this.Om(new la,this,t.x,t.y,t).Qu(),this,s)}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class Mc{constructor(t,e,i,s){this.PC=!1,this.L=new r.Eventer,this.chart=i,this.DC=s,this.Xs=t.Xs,this.te=s||Ls,this.BC=bt.document.createElement("div"),this.BC.style.position="absolute",this.BC.style.pointerEvents="none",bt.document.body.append(this.BC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.BC.style.left=`${t.left}px`,this.BC.style.top=`${t.top}px`,this.BC.style.width=`${t.width}px`,this.BC.style.height=`${t.height}px`};n(),i.onResize(n),this.LC(this.BC),this.RC(),this.EC(),this.zC(),this.VC(e),this.chart.OC().push(this)}LC(t){this.NC=bt.document.createElement("div"),this.NC.style.pointerEvents="all",t.append(this.NC),this.GC=bt.document.createElement("div"),this.WC=new Es(this.Xs,this.te,this.chart,this.GC),this.UC=bt.document.createElement("table"),this.UC.style.borderSpacing="0",this.NC.appendChild(this.WC.ae()),this.NC.appendChild(this.GC),this.GC.appendChild(this.UC)}EC(){let t=0,e=0,i=0,s=0,r=!1;this.PC=!1,this.NC.onmousedown=n=>{n=n||bt.event,i=n.clientX,s=n.clientY,r=!0,bt.document.onmouseup=t=>{this.PC?this.NC.addEventListener("click",Zt,!0):this.NC.removeEventListener("click",Zt,!0),r=!1,this.PC=!1,bt.document.onmouseup=null,bt.document.onmousemove=null},bt.document.onmousemove=n=>{n=n||bt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.PC=!0,this.NC.style.top=this.NC.offsetTop-e+"px",this.NC.style.left=this.NC.offsetLeft-t+"px",this.NC.style.removeProperty("right"),this.NC.style.removeProperty("bottom"))}}}zC(){let t=0,e=0,i=0,s=0,r=!1;this.NC.ontouchstart=n=>{n=n||bt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.NC.ontouchend=()=>{r=!1,bt.document.ontouchend=null,bt.document.ontouchmove=null},this.NC.ontouchmove=n=>{r&&(Zt(n),n=n||bt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.NC.style.top=this.NC.offsetTop-e+"px",this.NC.style.left=this.NC.offsetLeft-t+"px",this.NC.style.removeProperty("right"),this.NC.style.removeProperty("bottom"))}}}RC(){this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("left","10px"),this.NC.style.position="absolute",this.NC.style.display="flex",this.NC.style.alignItems="flex-start",this.GC.style.setProperty("display","none")}removePositionProperty(){this.NC.style.removeProperty("top"),this.NC.style.removeProperty("left"),this.NC.style.removeProperty("bottom"),this.NC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.NC.style.setProperty("bottom","10px"),this.NC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.NC.style.setProperty("bottom","10px"),this.NC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.NC.style.setProperty("top","10px"),this.NC.style.setProperty("right","10px")}}VC(t){for(let e=0;e[t.Xc((()=>{this.$C+=1,this.$C>1&&this.Ki.cs.Gn(ah.xf),this.Ki.cs.vs()})),t.jc((()=>this.Ki.cs.vs()))])),this.Ga.ld(t),this.chart.cs.vs()),this}getDataSet(){return this.ZC()}setStrokeStyle(t){return this.Ga.Ee(t),this.Ts.vs(),this}getStrokeStyle(){return this.Ga.cu()}setAreaFillStyle(t){return this.Ga.dd(t),this.Ts.vs(),this}getAreaFillStyle(){return this.Ga.QC()}setPointFillStyle(t){return this.Ga.ud(t),this.Ts.vs(),this}getPointFillStyle(){return this.Ga.yd()}setPointSize(t){return this.Ga.Sd(t),this.Ts.vs(),this}getPointSize(){return this.Ga.JC()}setPointShape(t){return this.Ga.Ad(t),this.Ts.vs(),this}getPointShape(){return this.Ga.gd()}setPointRotation(t){return this.Ga.pd(t),this.Ts.vs(),this}getPointRotation(){return this.Ga.md()}setPointAlignment(t){return this.Ga.KC(t),this.Ki.cs.vs(),this}getPointAlignment(){return this.Ga.qC()}setCurvePreprocessing(t){return this.Ga.XC(t),this.Ts.vs(),this}getCurvePreprocessing(){return this.Ga.tk()}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setCursorInterpolationEnabled(t){return this.Rb=t,this.Ts.cs.vs(),this}getCursorInterpolationEnabled(){return this.Rb}add(t){return this.ZC().add(t),this.Ts.vs(),this}addArraysXY(t,e){return this.ZC().addArraysXY(t,e),this.Ts.vs(),this}appendJSON(t,e){return this.ZC().appendJSON(t,e),this.Ts.vs(),this}appendSample(t){return this.ZC().appendSample(t),this.Ts.vs(),this}appendSamples(t){return this.ZC().appendSamples(t),this.Ts.vs(),this}fill(t){return this.ZC().fill(t),this.Ts.vs(),this}setSamples(t){return this.ZC().setSamples(t),this.Ts.vs(),this}alterSamples(t,e){return this.ZC().alterSamples(t,e),this.Ts.vs(),this}alterSamplesByID(t,e){return this.ZC().alterSamplesByID(t,e),this.Ts.vs(),this}getSampleCount(){return this.ZC().getSampleCount()}getNextSampleIndex(){return this.ZC().getNextSampleIndex()}clear(){return this.ZC().clear(),this.Ts.vs(),this}setMaxSampleCount(t){return this.ZC().setMaxSampleCount(t),this.Ts.vs(),this}getMaxSampleCount(){return this.ZC().getMaxSampleCount()}readBack(t){return this.ZC().readBack(t)}onMaxSampleCountExceeded(t){return this.ZC().onMaxSampleCountExceeded(t)}offMaxSampleCountExceeded(t){return this.ZC().offMaxSampleCountExceeded(t)}ik(){return this.ZC()}Wd(){return ue(this.getPointFillStyle())||ue(this.getStrokeStyle().getFillStyle())||ue(this.getAreaFillStyle())}qy(){var t;const e=null===(t=this.ad)||void 0===t?void 0:t.Ut;return this.getAutoScrollingEnabled()&&void 0!==e&&e.cc>0}UM(t){}getXMax(){return this.Ga.bt()}getXMin(){return this.Ga.xt()}getYMax(){return this.Ga._t()}getYMin(){return this.Ga.Mt()}Mr(){return{x:this.Ga.xl(),y:this.Ga.bl()}}ZC(){if(!this.ad){const t=new no(this.Yn);t.Sc&&this.Ki.cs.Gn(ah.Mf),t.xc&&this.Ki.cs.Gn(ah.bf),this.ad=Fe(t,this.ad,(()=>[t.Xc((()=>{this.$C+=1,this.$C>1&&this.Ki.cs.Gn(ah.xf),this.Ki.cs.vs()})),t.jc((()=>{this.Ki.cs.vs()}))])),this.Ga.ld(t)}return this.ad.Ut}attach(t,e=!0,i=!1){super.attach(t,e,i);const s=this.getPointFillStyle(),r=this.getAreaFillStyle();return le(t,this.ts,i,{stroke:this.getStrokeStyle(),fill:s!==z?s:r}),super.attach(t,e)}ks(){return this.bs||this.getPointShape()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e,i=this.Rb){void 0!==this.getCurvePreprocessing()&&(i=!1);const s=this.ik(),r=dt(t,this.Ki.cs.ft,this.scale),n=!e||this.Ga.getIsUnderMouse()?s.$c(r,i,this.scale,this.Ki.pixelScale):void 0;if(void 0!==n){const t=[this.getStrokeStyle().getFillStyle(),this.getPointFillStyle(),this.getAreaFillStyle()];return wa(n,this.scale,this.Om(new la,this,n).Qu(),this,t.filter((t=>!N(t)))[0])}}solveNearestFromScreen(t,e=!1){return this.$c(rh(t,this.Ki.cs),!1,e)}}const wc=(t,e,i)=>{const s=e.getIcon();return s?t.addRow(s,e.getName()):t.addRow(e.getName()),t.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},Tc=(...t)=>(e,i)=>t.forEach((t=>t.forEach((t=>{t.axis.ft.tt(e),t.axis.ng.tt(i)})))),kc=u(10,10);var Cc;e.AxisPosition=void 0,(Cc=e.AxisPosition||(e.AxisPosition={}))[Cc.Top=0]="Top",Cc[Cc.Bottom=1]="Bottom",Cc[Cc.Left=2]="Left",Cc[Cc.Right=3]="Right";const Rc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Ic=t=>t.setStopped(!0),Fc=t=>t.getChartInteractionFitByDrag()?t.fit(!0):void 0,Dc=(t,e)=>{const i="linear-highPrecision"===t.Th.type||"linear-highPrecision"===e.Th.type,s="logarithmic"===t.Th.type||"logarithmic"===e.Th.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.Th.type}, y: ${e.Th.type})`;throw new Error(i)}};var Lc,Pc,_c;!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"}(Lc||(Lc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Pc||(Pc={}));class Vc extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("chartXY bg",0),r,i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.chartXYTitleFont,i.cs.ts.chartXYTitleFillStyle,h),this.sk=this.ep.d2({scaleXYConstructor:_i}),this.Og=[],this.Ng=[],this.Wg=[],this.Gg=[],this.ek=new Map,this.hk=!0,this.rk=!0,this.nk=!0,this.Ef=2,this.ak=!0,this.lk=!0,this.uk=[],this.ck=this.vp.Te(this.sk).ke(z).Ce(ot).setMouseInteractions(!1),this.dk=this.vp.ze(this.sk).Ee(ot).setMouseInteractions(!1),this.fk=this.vp.ze(this.sk).Ee(ot).setMouseInteractions(!1),this.Ak=this.ts.chartXYZoomingRectangleFillStyle,this.gk=this.ts.chartXYZoomingRectangleStrokeStyle,this.pk=this.ts.chartXYFittingRectangleFillStyle,this.mk=this.ts.chartXYFittingRectangleStrokeStyle,this.yk=e.MouseStyles.Default,this.Sk=e.MouseStyles.Move,this.vk=e.MouseStyles.ZoomIn,this.xk=e.MouseStyles.Default,this.bk=void 0,this.Mk=Bc,this.WM=0,this.Vm=e.AutoCursorModes.snapToClosest,this._k=Tc(this.Ng,this.Og),this.wk=Tc(this.Wg,this.Gg),this.Ck=(t,e,i,s,r)=>{this._k(s,r),this.wk(r,s),this.sk.tt(s,r),this.cs.vs()},this.kk=(t,e)=>{this.ek.set(t,e)},this.tg=t=>{const e=this.Ng.findIndex((e=>e.axis===t)),i=this.Og.findIndex((e=>e.axis===t)),s=this.Wg.findIndex((e=>e.axis===t)),r=this.Gg.findIndex((e=>e.axis===t));e>=0&&this.Ng.splice(e,1),i>=0&&this.Og.splice(i,1),s>=0&&this.Wg.splice(s,1),r>=0&&this.Gg.splice(r,1),this.ek.delete(t),this.cs.vs()},this.addAreaSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Dc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Wu.Positive)(this,this.wS,this.Wx,e,i,this.Tk(e),this.Tk(i),this.np,s,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length);return this.DS(r),r},this.addAreaRangeSeries=t=>{const e=(null==t?void 0:t.axisX)||(null==t?void 0:t.xAxis)||this.getDefaultAxisX(),i=(null==t?void 0:t.axisY)||(null==t?void 0:t.yAxis)||this.getDefaultAxisY();Dc(e,i);const s=new $u(this,this.wS,this.Wx,e,i,this.Tk(e),this.Tk(i),this.np,this.ts,this.cs.hs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length);return this.DS(s),s},this.Fk=!1,this.Ik=!1,this.YM=()=>{(this.hk||this.rk)&&(this.bk=this.engine.setMouseStyle(this.yk))},this.HM=()=>{this.Fk=!1,this.engine.restoreMouseStyle(this.bk)},this.$M=(t,e,i)=>{var s,r;const n=Ft(null===(s=this.dA.Hn)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Ft(null===(r=this.dA.Hn)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.bk);const h=this.vp.cs.De(e.clientX,e.clientY);i===n&&(this.hk||this.rk)?(this.Pk(t,h),Zt(e)):i===o&&this.ak&&(this.bk=this.engine.setMouseStyle(this.Sk),this.Ik=!0,Zt(e))},this.hS=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Ft(null===(n=this.dA.Hn)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Ft(null===(o=this.dA.Hn)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.hk||this.rk)?(this.Dk(t,s,h),Zt(e)):i===l&&this.ak&&(this.Bk(ni(r,-1)),Zt(e)),this.cs.vs()},this.XM=(t,e,i,s)=>{var r,n;const o=Ft(null===(r=this.dA.Hn)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Ft(null===(n=this.dA.Hn)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.hk||this.rk)){const i=u(e.clientX,e.clientY);this.Lk(t,s,i),Zt(e)}else i===h&&this.ak&&Zt(e);this.engine.restoreMouseStyle(this.bk),this.IS.getIsUnderMouse()&&(this.bk=this.engine.setMouseStyle(this.yk)),this.Fk=!1,this.Ik=!1},this.eS=(t,e)=>{if(this.nk){const t=this.vp.cs.De(e.clientX,e.clientY);this.Rk(t,u(ge(e),ge(e))),Zt(e)}},this.Ek=(t,e,i,s)=>{},this.zk=(t,e,i,s,r,n)=>{if(this.ak){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.Bk(t),Zt(n),this.Ik=!0}if(this.nk){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=hi(u(Math.abs(t.x-s.x-(o.x-r.x)),Math.abs(t.y-s.y-(o.y-r.y))),u(Math.abs(t.x-o.x),Math.abs(t.y-o.y)));this.forEachAxisX((t=>{t.getChartInteractionZoomByWheel()&&t.vt(t.ft.mi(t.getInterval().start,-h.x),t.ft.mi(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.vt(t.ft.mi(t.getInterval().start,-h.y),t.ft.mi(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Zt(n),this.Fk=!0}},this.Vk=(t,e,i,s)=>{this.Ik=!1,this.Fk=!1},this.Ok=(t,e,i)=>{(this.rk||this.hk)&&(this.Pk(t,e),Zt(i))},this.Nk=(t,e,i,s,r)=>{(this.rk||this.hk)&&(this.Dk(t,e,i),Zt(r))},this.Gk=(t,e,i,s)=>{(this.rk||this.hk)&&(this.Lk(t,e,i),Zt(s))},this.cs.Gn(ah.pf),this.setPadding({right:24}),this.Wk=i.Ax("chartXY series bg",Lc.seriesBackground),this.Uk=[Lc.gridLine0,Lc.gridLine1,Lc.gridLine2].map((t=>i.Yk(`chartXY gridline #${t}`,t))),this.KA=i.Yk("chartXY highlighters below",Lc.highlightersBelow),this.Wx=i.Um("chartXY plotting",Pc.plotting),this.qA=i.Um("chartXY highlighters above",Pc.highlightersAbove),this.bA=i.Um("chartXY fg",Pc.fg),this.sk.x.K(0,this.uiScale.x.getCellSize()-(this.jt.left+this.jt.right+this.ya.left+this.ya.right)),this.sk.y.K(0,this.uiScale.y.getCellSize()-(this.jt.bottom+this.jt.top+this.ya.bottom+this.ya.top)),this.sk.tt(this.uiScale.ai().x,this.uiScale.ai().y),this.IS=this.Wk.Te(this.sk).ke(this.ts.chartXYSeriesBackgroundFillStyle).Ce(ot),this.PS=this.bA.Te(this.sk).ke(z).Ce(this.ts.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.setSeriesBackgroundEffect(!1),this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,hu);this.Fp=a.am(this.Hm,this.sk,this.sk,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.Ck),this.bp.Eh("ChartXY"),this.rS=Wi(new $i(this.Ok,this.Nk,this.Gk,1),new Zi(this.Ek,this.zk,this.Vk)),this.onSeriesBackgroundMouseEnter(this.YM),this.onSeriesBackgroundMouseLeave(this.HM),this.onSeriesBackgroundMouseWheel(this.eS),this.onSeriesBackgroundMouseDragStart(this.$M),this.onSeriesBackgroundMouseDrag(this.hS),this.onSeriesBackgroundMouseDragStop(this.XM),this.onSeriesBackgroundTouchStart(this.rS.onTouchStart),this.onSeriesBackgroundTouchMove(this.rS.onTouchMove),this.onSeriesBackgroundTouchEnd(this.rS.onTouchEnd),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.mp(n,this.sk)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}getMinimumSize(){const t={x:0,y:0};t.x+=this.jt.left+this.jt.right+this.ya.left+this.ya.right,t.y+=this.jt.top+this.jt.bottom+this.ya.top+this.ya.bottom;const e=this.bp.Ds().Zc(),i=A(zc(this.Mk||Bc),this.Sp);return t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom,this.Hk&&(t.x+=this.Hk.left,t.x+=this.Hk.right,t.y+=this.Hk.top,t.y+=this.Hk.bottom),t.x+=kc.x,t.y+=kc.y,t}addChartMarkerXY(t=au,e,i){const s=this.np(),r=new gu(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.ip(s),this.ts);return this.Ap(r),r}addAxisX(t){var e,i;const{opposite:s,type:r}=nh(t);let n;n="linear"===r.type?this.ep.d1({dimension:"x",scale1DConstructor:Di}):"linear-highPrecision"===r.type?this.ep.d1({dimension:"x",scale1DConstructor:Di})._i():this.ep.d1({dimension:"x",scale1DConstructor:Mi}).gi(r.base),n.tt(this.sk.x.ai());const o=s?this.Og:this.Ng,h=new uh(this.Uk,this.bA,this.vp,this.KA,this.qA,this.cs.hs,n,this.sk.y,(a=()=>h.wg(),{...ch,...Sc(a)}),this,s?100:0,this.tg,this.kk,this.ts,this.ih,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iStack:u,iParallel:l}),this.cs.vs(),h}addAxisY(t){var e,i;const{opposite:s,type:r}=nh(t);let n;n="linear"===r.type?this.ep.d1({dimension:"y",scale1DConstructor:Di}):"linear-highPrecision"===r.type?this.ep.d1({dimension:"y",scale1DConstructor:Di})._i():this.ep.d1({dimension:"y",scale1DConstructor:Mi}).gi(r.base),n.tt(this.sk.y.ai());const o=s?this.Gg:this.Wg,h=new uh(this.Uk,this.bA,this.vp,this.KA,this.qA,this.cs.hs,n,this.sk.x,(a=()=>h.wg(),{...dh,...Ac(a)}),this,s?100:0,this.tg,this.kk,this.ts,this.ih,r);var a;let l,u;return void 0===(null==t?void 0:t.iParallel)&&void 0===(null==t?void 0:t.iStack)?(l=o.reduce(((t,e)=>Math.max(t,e.iParallel+1)),0),u=0):(l=null!==(e=t.iParallel)&&void 0!==e?e:0,u=null!==(i=t.iStack)&&void 0!==i?i:0),o.push({axis:h,iParallel:l,iStack:u}),this.cs.vs(),h}swapAxes(t,e){const i=[this.Ng,this.Wg,this.Gg,this.Og],s=i.find((e=>void 0!==e.find((e=>e.axis===t)))),r=i.find((t=>void 0!==t.find((t=>t.axis===e))));if(!s||!r)return this;if(s!==r)throw new Error("LightningChart JS ChartXY.swapAxes does not support swapping Axes that are on different sides.");const n=s.find((e=>e.axis===t)),o=s.find((t=>t.axis===e));if(!n||!o)return this;const h=n.iParallel,a=n.iStack;return n.iParallel=o.iParallel,n.iStack=o.iStack,o.iParallel=h,o.iStack=a,this.cs.vs(),this}dispose(){return this.Fp.dispose(),this.Wk.U(),this.Wx.U(),this.bA.U(),this.Uk.forEach((t=>t.U())),this.qA.U(),this.KA.U(),this.Hm.U(),this.OC().forEach((t=>t.dispose())),Kh(this.sk),this.Ng.slice().forEach((t=>t.axis.dispose())),this.Wg.slice().forEach((t=>t.axis.dispose())),this.Gg.slice().forEach((t=>t.axis.dispose())),this.Og.slice().forEach((t=>t.axis.dispose())),this.MS.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){var t;return null===(t=[...this.Ng,...this.Og].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}getDefaultAxisY(){var t;return null===(t=[...this.Wg,...this.Gg].find((t=>t.axis.getVisible())))||void 0===t?void 0:t.axis}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):Rc;return It(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.Og.map((t=>t.axis));case e.AxisPosition.Bottom:return this.Ng.map((t=>t.axis));case e.AxisPosition.Left:return this.Wg.map((t=>t.axis));case e.AxisPosition.Right:return this.Gg.map((t=>t.axis))}})))}$k(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.Ng.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Og.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}forEachAxisY(t){this.Wg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis))))),this.Gg.forEach(((e,i,s)=>t(e.axis,i,s.map((t=>t.axis)))))}setTitlePosition(t){return this.Mk=t,this.cs.vs(),this}getTitlePosition(){return this.Mk}Xk(t,e,i,s){const r=this.Mk||Bc;let n,o=A(zc(r),this.Sp);this.getTitleFillStyle()===z||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.bp.Ds().Zc();const h=Math.abs(s)+this.ya.bottom+this.jt.bottom,a=Math.abs(i)+this.ya.top+this.jt.top,l={left:Math.abs(t)+this.ya.left+this.jt.left,right:Math.abs(e)+this.ya.right+this.jt.right,top:a,bottom:h},u=this.uiScale.Ui(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Nc(r,u,l,n,o,this.ya);return this.bp.Ie(f).Ba(c).Ra(d),g}Fe(t){super.Fe(t);for(const t of this.MS)t.aS();for(const t of this.MS)t.Fe();const e=this.Wg.map((t=>t.axis._r().Ds())),i=this.Ng.map((t=>t.axis._r().Ds())),s=this.Og.map((t=>t.axis._r().Ds())),r=this.Gg.map((t=>t.axis._r().Ds()));let n=!1;this.forEachAxis((t=>{(t.Tr()||t.Fr())&&(n=!0)}));const o=this.Fk||this.Ik||!this.lk&&n;ia.Tp(this,this.IS.getIsUnderMouse(),o,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));const h=Oc(this.Wg,e),a=Oc(this.Ng,i),l=Oc(this.Og,s),c=Oc(this.Gg,r),d=this.Xk(h.thicknessTotal,c.thicknessTotal,l.thicknessTotal,a.thicknessTotal),f=this.sk.x.getCellSize()-(d.left+d.right),g=this.sk.y.getCellSize()-(d.bottom+d.top),m=[d.left,d.right],p=[d.bottom,d.top];this.sk.x.K(0,f),this.sk.y.K(0,g),this.sk.x.ei(m),this.sk.y.ei(p);const x=(t,e,i,s)=>{let r=0;t.groups.forEach((t=>{let n=0;const o=t.stacks.reduce(((t,e)=>Math.max(t,e.Tg)),0),h=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()?e.axis.sA+e.axis.eA:0)),0),a=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"pixels"in e.axis.Vd?e.axis.Vd.pixels:0)),0),l=e-h-a;t.stacks.forEach((s=>{const h=s.axis,a=h.getVisible(),u=Math.max(e-n,0),c=Math.min(a?"pixels"in h.Vd?h.Vd.pixels:h.Vd.relative/t.sumRelativeSize*l:0,u),d=a?i[0]+n+h.sA:0,f=a?i[1]+(e-n)-c-h.sA:0;h.ft.ei([d,f]),h.Fe({Tg:o,Fg:s.Fg,Dg:c,jk:n,Vg:o+s.Fg,Lg:r}),a&&(n+=c+h.sA+h.eA)})),r+=s*t.thicknessMax}))};x(h,g,p,-1),x(c,g,p,1),x(a,f,m,-1),x(l,f,m,1),this.Hk={left:h.thicknessTotal,top:l.thicknessTotal,right:c.thicknessTotal,bottom:a.thicknessTotal},this.IS.Ie(u(0,0)).tt(u(f,g)),this.PS.Ie(u(0,0)).tt(u(f,g));const S=y(this.sk.x.hi(),this.sk.y.hi(),this.sk.x.ni(),this.sk.y.ni());this.Wx.tx(S),this.KA.tx(S),this.qA.tx(S),this.Qg&&this.Qg(),this.Ng.forEach((t=>t.axis.Ug())),this.Og.forEach((t=>t.axis.Ug())),this.Wg.forEach((t=>t.axis.Ug())),this.Gg.forEach((t=>t.axis.Ug())),super.pp();for(const t of this.MS)t.Ay()}Z(){for(let t=0;t=10;n&&a&&h.x===s.x&&this.rk?(this.Fk=!0,this.ck.ke(this.pk).Ce(this.mk),this.dk.Ee(this.mk).Oe(s).Ve(r),this.fk.Ee(this.mk).Oe(u(s.x,r.y)).Ve(u(r.x,s.y)),this.bk=this.engine.setMouseStyle(this.xk,this.bk)):n&&a&&(this.hk||this.rk)?(this.Fk=!0,this.ck.ke(this.Ak).Ce(this.gk),this.dk.Ee(ot),this.fk.Ee(ot),this.bk=this.engine.setMouseStyle(this.vk,this.bk)):(this.Fk=!1,this.ck.Ce(ot).ke(z),this.dk.Ee(ot),this.fk.Ee(ot),this.engine.restoreMouseStyle(this.bk)),this.cs.vs()}Lk(t,e,i){if(this.Fk){const t=dt(this.engine.clientLocation2Engine(i.x,i.y),this.vp.cs.ft,this.sk),s=He(t.x,this.sk.x.getInnerStart(),this.sk.x.getInnerEnd())&&He(t.y,this.sk.y.getInnerStart(),this.sk.y.getInnerEnd()),r=i.x>=e.x||!this.rk?"zoom":"fit",n=this.ck.Ia(),o=oi(n,this.ck.ai()),h=Math.min(this.ck.ai().x,this.ck.ai().y)>=10;s&&h&&"zoom"===r&&this.hk?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=dt(n,this.sk,t.og).x,i=dt(o,this.sk,t.og).x;t.vt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=dt(n,this.sk,t.og).y,i=dt(o,this.sk,t.og).y;t.vt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.rk&&this.forEachAxis(Fc)}this.ck.Ce(ot).ke(z),this.dk.Ee(ot),this.fk.Ee(ot),this.cs.vs()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}Bk(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(Ic),this.forEachAxisX((i=>{i.zoom(i.ft.ct(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ft.ct(t.y),e.y)}))}Rk(t,e){this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&(Ic(i),i.zoom(i.ft.ct(t.x),e.x))})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&(Ic(i),i.zoom(i.ft.ct(t.y),e.y))}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Qd(){const t=[];return this.forEachAxis((e=>e.xg((e=>t.push(e))))),super.Qd().concat(t)}OC(){return this.uk}me(){return this._p(this.Wx)}setAutoCursorEnabledDuringAxisAnimation(t){return this.lk=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.lk}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=fh(r)?r:Oi(r)?this.pixelScale:void 0;if(n&&zi(i)){const t=dt(s,n,this.engine.scale);return this.cs.Bo({engineX:t.x,engineY:t.y})}if(n&&Oi(i))return dt(s,n,this.pixelScale);if(n&&fh(i))return dt(s,n,i)}else{const i=t;if(Oi(e)){const t=this.cs.Do(i);return dt({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(fh(e)){const t=e,s=this.cs.Do(i);return dt({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,(_c=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",_c.RightTop="right-top",_c.LeftTop="left-top",_c.CenterBottom="center-bottom",_c.RightBottom="right-bottom",_c.LeftBottom="left-bottom",_c.SeriesCenterTop="series-center-top",_c.SeriesRightTop="series-right-top",_c.SeriesLeftTop="series-left-top",_c.SeriesCenterBottom="series-center-bottom",_c.SeriesRightBottom="series-right-bottom",_c.SeriesLeftBottom="series-left-bottom";const Bc=e.ChartXYTitlePositionOptions.CenterTop,zc=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 be(0,`Unexpected ChartXY title position selection ${t}`)},Nc=(t,e,i,s,r,n)=>{s.x,r.left,r.right;const o=s.y+r.bottom+r.top,h=(r.left-r.right)*e.x,a=(r.bottom-r.top)*e.y;switch(t){case"center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-(n.top+r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100+h,y:100-(n.top-r.top)*e.y},marginsWithTitle:{...i,top:i.top+o}};case"center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100+h,y:(n.bottom+r.bottom)*e.y},marginsWithTitle:{...i,bottom:i.bottom+o}};case"series-center-top":return{horizontalAlignment:0,verticalAlignment:1,position:{x:50+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-left-top":return{horizontalAlignment:-1,verticalAlignment:1,position:{x:i.left*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-right-top":return{horizontalAlignment:1,verticalAlignment:1,position:{x:100-i.right*e.x+h,y:100-i.top*e.y+a},marginsWithTitle:i};case"series-center-bottom":return{horizontalAlignment:0,verticalAlignment:-1,position:{x:50,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-left-bottom":return{horizontalAlignment:-1,verticalAlignment:-1,position:{x:i.left*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i};case"series-right-bottom":return{horizontalAlignment:1,verticalAlignment:-1,position:{x:100-i.right*e.x+h,y:i.bottom*e.y+a},marginsWithTitle:i}}return be(0,`Unexpected ChartXY title position selection ${t}`)},Oc=(t,e)=>{const i=[];t.forEach(((t,s)=>{const r=e[s],n=i.find((e=>e.iParallel===t.iParallel));n?(n.stacks.push({...t,...r}),n.stacks.sort(((t,e)=>t.iStack-e.iStack))):i.push({iParallel:t.iParallel,stacks:[{...t,...r}]})}));const s=i.map((t=>{const e=t.stacks.reduce(((t,e)=>Math.max(t,e.Tg)),0),i=t.stacks.reduce(((t,e)=>Math.max(t,e.Fg)),0),s=t.stacks.reduce(((t,e)=>Math.max(t,e.Od)),0),r=t.stacks.reduce(((t,e)=>t+(e.axis.getVisible()&&"relative"in e.axis.Vd?e.axis.Vd.relative:0)),0);return{...t,ticksSizeMax:e,titleSizeMax:i,sumRelativeSize:r,thicknessMax:s}}));return s.sort(((t,e)=>t.iParallel-e.iParallel)),{groups:s,thicknessTotal:s.reduce(((t,e)=>t+e.thicknessMax),0)}};class Uc{constructor(t,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.L=new r.Eventer,this.Zk=[],this.Qk=new Map,this.MS=new Map,this.Jk=(t,e,i)=>{0!==this.MS.size&&void 0!==[...this.MS.values()].find((({series:t})=>!0===t.getVisible()))||this.Kk.vt(e,i,!1,!1,"zoomBandChart"),this.qk.cs.vs()},i.cs.Gn(ah.Af),this.dA=t,this.tT=(null==h?void 0:h.orientation)||"x",this.iT=void 0!==(null==h?void 0:h.useSharedValueAxis)&&h.useSharedValueAxis,this.sT=n,this.Uu="x"===this.tT?ch:dh;const l={...h,defaultAxisX:this.Uu.getWidth({x:null==h?void 0:h.defaultAxis,y:void 0}),defaultAxisY:this.Uu.getHeight({x:null==h?void 0:h.defaultAxis,y:void 0})};this.qk=new Vc(t,i,s,kt,o,l,a).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.qk.engine;const u=this.qk.getDefaultAxisX().setMouseInteractions(!1),c=this.qk.getDefaultAxisY().setMouseInteractions(!1);this.Kk=this.Uu.getWidth({x:u,y:c}).setScrollStrategy(zs.fitting).setAnimationScroll(!1).setStrokeStyle(ot).setTickStrategy(Ns.Empty),(null==h?void 0:h.useSharedValueAxis)?this.eT=this.Uu.getHeight({x:u,y:c}):this.Uu.getHeight({x:u,y:c}).dispose();const d=this.getTheme().zoomBandChartDefocusOverlayFillStyle||new G({color:this.getTheme().isDark?E(0,0,0,180):E(255,255,255,180)});this.hT=[this.qk.bA.Te(this.Kk.og).ke(d).Ce(ot),this.qk.bA.Te(this.Kk.og).ke(d).Ce(ot)];const f=this.qk.bA.Rg(this.Kk.og).Ee(this.getTheme().zoomBandChartSplitterStrokeStyle||this.getTheme().chartXYSeriesBackgroundStrokeStyle);this.rT={collection:f,members:new Array(5).fill(0).map((t=>f.Vr()))};const g=this.getTheme(),m="function"==typeof g.zoomBandChartKnobFillStyle?g.zoomBandChartKnobFillStyle(this.dA.Xs):g.zoomBandChartKnobFillStyle||z;this.nT=[this.qk.bA.Te(this.qk.pixelScale).ke(m).Ce(ot),this.qk.bA.Te(this.qk.pixelScale).ke(m).Ce(ot)],this.oT=this.getTheme().zoomBandChartKnobSize||{x:0,y:0},this.aT()}add(t){var e,i,s,r,n;const o=this.Zk.map((t=>t.axis)),h="x"===this.tT?t.axisX:t.axisY;if(!o.includes(h)){const t=h.onIntervalChange(this.Jk);this.Zk.push({axis:h,deattach:()=>{h.offIntervalChange(t)}}),this.Kk.Xh(h.$h()),this.lT&&this.lT.remove(),this.lT=gt(...this.Zk.map((t=>t.axis)))}const a=this.Uu.getHeight({x:t.axisX,y:t.axisY});let l;if(this.iT)l=this.eT;else{const t=this.Qk.get(a);t?l=t:(l=this.Uu.getHeight({x:this.qk.addAxisX.bind(this.qk),y:this.qk.addAxisY.bind(this.qk)})(),this.uT(l)),this.Qk.set(a,l)}const u=this.Uu.getWidth({x:this.Kk,y:l}),c=this.Uu.getHeight({x:this.Kk,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.a_(r)));const n=t.l_((()=>e.clear()));f.push((()=>{t.u_(n)}))};if(t instanceof Ec)d=this.qk.addPointLineAreaSeries({...t.Yn,xAxis:u,yAxis:c}).setStrokeStyle(t.getStrokeStyle()).setAreaFillStyle(t.getAreaFillStyle()).setPointFillStyle(t.getPointFillStyle()).setCurvePreprocessing(t.getCurvePreprocessing()),d.setDataSet(t.ik());else if(t instanceof vc||t instanceof mc){const i=this.qk.addLineSeries({xAxis:u,yAxis:c,dataPattern:t instanceof vc?null===(e=t.Yn)||void 0===e?void 0:e.dataPattern:void 0});if(t instanceof vc)i.setStrokeStyle(t.getStrokeStyle());else{const e=Gc(t);e&&i.setStrokeStyle(e)}g(t,i),d=i}else if(t instanceof Yu){const e=this.qk.addAreaSeries({xAxis:u,yAxis:c,baseline:t._w}).setFillStyle(t.getFillStyle()).setStrokeStyle(t.getStrokeStyle());g(t,e),d=e}else if(t instanceof bc){const e=this.qk.addPointSeries({xAxis:u,yAxis:c,pointShape:null===(i=t.Yn)||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 gc){const e=this.qk.addStepSeries({xAxis:u,yAxis:c,pointShape:null===(s=t.Yn)||void 0===s?void 0:s.pointShape,mode:t.Xw}).setStrokeStyle(t.getStrokeStyle()).setPointFillStyle(t.getPointFillStyle()).setPointSize(t.getPointSize()).setPointRotation(t.getPointRotation());g(t,e),d=e}else if(t instanceof ic){const e=this.qk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(r=t.Yn)||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 Qu){const e=this.qk.addSplineSeries({xAxis:u,yAxis:c,pointShape:null===(n=t.Yn)||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 $u){const e=this.qk.addAreaRangeSeries({xAxis:u,yAxis:c}).setLowFillStyle(t.getLowFillStyle()).setHighFillStyle(t.getHighFillStyle()).setLowStrokeStyle(t.getLowStrokeStyle()).setHighStrokeStyle(t.getHighStrokeStyle()).add(t.n_()),i=t.o_(((t,i)=>e.add(i)));f.push((()=>t.a_(i))),d=e;const s=t.l_((()=>e.clear()));f.push((()=>{t.u_(s)}))}else{if(!(t instanceof _u))throw new Error("LightningChart JS Zoom Band Chart unsupported series type");{const e=this.qk.addHeatmapGridSeries({xAxis:u,yAxis:c,...t.I_}),i=()=>{e.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};i(),d=e,t.B_(d);const s=t.E_(((t,i)=>e.invalidateIntensityValues(i))),r=t.L_(i);f.push((()=>{t.z_(s),t.R_(r)}));const n=t.l_((()=>e.clear()));f.push((()=>{t.u_(n)}))}}d.setMouseInteractions(!1);const m=t.onVisibleStateChanged(((t,e)=>{d.setVisible(e)}));f.push((()=>{t.offVisibleStateChanged(m)}));const y=t.onHighlight(((t,e)=>d.setHighlight(e)));f.push((()=>{t.offHighlight(y)}));const p=t.onDispose((()=>{this.disposeSeries(t)}));return f.push((()=>{t.offDispose(p)})),this.MS.set(t,{series:d,clearReferences:()=>f.forEach((t=>t()))}),d}disposeSeries(t){const e=this.MS.get(t);if(e){const{clearReferences:i}=e;i(),this.MS.delete(t),e.series.dispose();const s=this.Uu.getHeight({x:t.axisX,y:t.axisY}),r=this.Qk.get(s);r&&0===r.wg().length&&(this.Qk.delete(s),r.dispose())}const i="x"===this.tT?t.axisX:t.axisY;if(!Array.from(this.MS.keys()).find((t=>i===("x"===this.tT?t.axisX:t.axisY)))){const t=this.Zk.findIndex((t=>t.axis===i));this.Zk[t].deattach(),this.Zk.splice(t,1)}return this}setDefocusOverlayFillStyle(t){return this.hT.forEach((e=>e.ke(t))),this.qk.cs.vs(),this}getDefocusOverlayFillStyle(){return this.hT[0].zh()}setSplitterStrokeStyle(t){return this.rT.collection.Ee(t),this.qk.cs.vs(),this}getSplitterStrokeStyle(){return this.rT.collection.cu()}setKnobFillStyle(t){return this.nT.forEach((e=>e.ke(t))),this.qk.cs.vs(),this}getKnobFillStyle(){return this.nT[0].zh()}setKnobStrokeStyle(t){return this.nT.forEach((e=>e.Ce(t))),this.qk.cs.vs(),this}getKnobStrokeStyle(){return this.nT[0].lo()}setKnobSize(t){return this.oT=t,this.qk.cs.vs(),this}getKnobSize(){return this.oT}getDefaultAxisX(){return this.qk.getDefaultAxisX()}getDefaultAxisY(){return this.qk.getDefaultAxisY()}get axisX(){return this.getDefaultAxisX()}get xAxis(){return this.getDefaultAxisX()}get axisY(){return this.getDefaultAxisY()}get yAxis(){return this.getDefaultAxisY()}uT(t){t.setTickStrategy(Ns.Empty).setMouseInteractions(!1).setNibStyle(ot).setStrokeStyle(ot)}aT(){let t;const i=(t,e,i)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.getInterval();Math.abs(this.Kk.ft.dt(t)-this.Kk.ft.dt(e))<10||Math.sign(e-t)!==Math.sign(o.end-o.start)||Math.min(t,e)Math.max(h.start,h.end)&&Math.max(o.start,o.end){s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(this.Uu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical}),t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const n="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisY;if(!n)return;const o=this.Uu.getWidth(this.qk.translateCoordinate(t,this.qk.coordsAxis)),h=n.getInterval(),a=0===r?o:h.start,l=1===r?o:h.end;i(a,l,!1),Zt(t)};s.setMouseDragEventHandler(((t,e,i,s,r)=>n(e)));const o=Wi(new $i(void 0,((t,e,i,s,r)=>n(r))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)})),this.qk.onSeriesBackgroundMouseEnter((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Move,t)})),this.qk.onSeriesBackgroundMouseLeave((()=>{this.engine.restoreMouseStyle(t)}));const s=(t,e)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.ft.mi(o.start,this.Uu.getWidth(t)),a=this.Kk.ft.mi(o.end,this.Uu.getWidth(t));i(h,a,!1),Zt(e)};this.qk.onSeriesBackgroundMouseDrag(((t,e,i,r,n)=>s(n,e)));const r=Wi(new $i(void 0,((t,e,i,r,n)=>s(r,n))));this.qk.onSeriesBackgroundMouseWheel(((t,e)=>{var s,r;const n="x"===this.tT?null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisX:null===(r=Array.from(this.MS.keys())[0])||void 0===r?void 0:r.axisY;if(!n)return;const o=n.getInterval(),h=this.Kk.getInterval(),a=this.Uu.getWidth(this.qk.translateCoordinate(e,this.qk.coordsAxis)),l=this.Kk.ft.dt(o.start),u=this.Kk.ft.dt(o.end),c=this.Kk.ft.dt(a),d=Rt((c-l)/(u-l),0,1),f=.2*Math.abs(u-l)*n.Ef,g=d*f*-Math.sign(e.deltaY),m=(1-d)*f*Math.sign(e.deltaY),y=Rt(this.Kk.ft.mi(o.start,g),h.start,h.end),p=Rt(this.Kk.ft.mi(o.end,m),h.start,h.end);i(y,p,!1),Zt(e)})),this.qk.onSeriesBackgroundTouchStart(r.onTouchStart),this.qk.onSeriesBackgroundTouchMove(r.onTouchMove),this.qk.onSeriesBackgroundTouchEnd(r.onTouchEnd),this.hT.forEach(((s,r)=>{s.setMouseEnterEventHandler((()=>{t=this.engine.setMouseStyle(e.MouseStyles.Point,t)})),s.setMouseLeaveEventHandler((()=>{this.engine.restoreMouseStyle(t)}));const n=t=>{var e,s;const r="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(s=Array.from(this.MS.keys())[0])||void 0===s?void 0:s.axisY;if(!r)return;const n=this.Uu.getWidth(this.qk.translateCoordinate(t,this.qk.coordsAxis)),o=r.getInterval(),h=this.Kk.getInterval(),a=Rt(n-(o.end-o.start)/2,Math.min(h.start,h.end),Math.max(h.start,h.end)-Math.abs(o.end-o.start)),l=a+(o.end-o.start);i(a,l,!0),Zt(t)};s.setMouseClickEventHandler(((t,e)=>n(e)));const o=Wi(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=bt.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)=>n(e))));s.setTouchStartEventHandler(o.onTouchStart),s.setTouchMoveEventHandler(o.onTouchMove),s.setTouchEndEventHandler(o.onTouchEnd)}))}getSizePixels(){return this.qk.getSizePixels()}onResize(t){return this.qk.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.qk.offResize(t)}Ir(t){this.qk.Ir(t)}getMinimumSize(){return this.qk.getMinimumSize()}Z(){return this.qk.Z()}J(){return this.qk.J()}Fe(t){var e,i,s,r;const n=xe(Array.from(this.MS.keys()).map((t=>t.chart))),o="x"===this.tT?null===(e=Array.from(this.MS.keys())[0])||void 0===e?void 0:e.axisX:null===(i=Array.from(this.MS.keys())[0])||void 0===i?void 0:i.axisY;if("x"===this.tT){const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.eg?t.Yg():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.eg?t.Yg():0})),Math.max(t,i)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=n.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);null===(s=this.getDefaultAxisY())||void 0===s||s.setThickness(t),this.qk.setPadding({left:i+(0===n.length?10:0),right:r+e+(0===n.length?10:0)})}else{const t=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.eg?t.Yg():0})),Math.max(t,i)}),0),e=n.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.eg?t.Yg():0})),Math.max(t,i)}),0),i=n.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),s=n.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);null===(r=this.getDefaultAxisX())||void 0===r||r.setThickness(t),this.qk.setPadding({bottom:i+(0===n.length?10:0),top:s+e+(0===n.length?10:0)})}this.qk.Fe(t);const h=this.Kk.getInterval().start,a=this.Kk.getInterval().end,l=Rt(o?o.getInterval().start:h,h,a),u=Rt(o?o.getInterval().end:a,h,a),c=this.Uu.getHeight(this.qk.sk.getInnerIntervalPixels());this.hT[0].Ie(this.Uu.toPoint(h,0)).tt(this.Uu.toPoint(l-h,c)),this.hT[1].Ie(this.Uu.toPoint(u,0)).tt(this.Uu.toPoint(a-u,c)),this.rT.members[0].zg(this.Uu.toPoint(h,c),this.Uu.toPoint(l,c)),this.rT.members[1].zg(this.Uu.toPoint(l,c),this.Uu.toPoint(l,0)),this.rT.members[2].zg(this.Uu.toPoint(l,0),this.Uu.toPoint(u,0)),this.rT.members[3].zg(this.Uu.toPoint(u,0),this.Uu.toPoint(u,c)),this.rT.members[4].zg(this.Uu.toPoint(u,c),this.Uu.toPoint(a,c));const d=dt(this.Uu.toPoint(l,c/2),this.Kk.og,this.qk.pixelScale),f=dt(this.Uu.toPoint(u,c/2),this.Kk.og,this.qk.pixelScale),g=this.oT;this.nT[0].Ie({x:d.x-g.x/2,y:d.y-g.y/2}).tt({x:g.x,y:g.y}).Gh(this.Uu.getWidth({x:0,y:90})),this.nT[1].Ie({x:f.x-g.x/2,y:f.y-g.y/2}).tt({x:g.x,y:g.y}).Gh(this.Uu.getWidth({x:0,y:90}))}setSeriesBackgroundFillStyle(t){return this.qk.setSeriesBackgroundFillStyle(t),this.qk.cs.vs(),this}getSeriesBackgroundFillStyle(){return this.qk.getSeriesBackgroundFillStyle()}setSeriesBackgroundStrokeStyle(t){return this.qk.setSeriesBackgroundStrokeStyle(t),this.qk.cs.vs(),this}getSeriesBackgroundStrokeStyle(){return this.qk.getSeriesBackgroundStrokeStyle()}setSeriesBackgroundEffect(t){return this.qk.setSeriesBackgroundEffect(t),this.qk.cs.vs(),this}getSeriesBackgroundEffect(){return this.qk.getSeriesBackgroundEffect()}getTheme(){return this.qk.getTheme()}setTitle(t){return this.qk.setTitle(t),this}getTitle(){return this.qk.getTitle()}setTitleFillStyle(t){return this.qk.setTitleFillStyle(t),this}getTitleFillStyle(){return this.qk.getTitleFillStyle()}setTitleFont(t){return this.qk.setTitleFont(t),this}getTitleFont(){return this.qk.getTitleFont()}setTitleMargin(t){return this.qk.setTitleMargin(t),this}getTitleMargin(){return this.qk.getTitleMargin()}setPadding(t){return this.qk.setPadding(t),this}getPadding(){return this.qk.getPadding()}setBackgroundFillStyle(t){return this.qk.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.qk.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.qk.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.qk.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return $h(t,e,i,this.qk.pixelScale,this.qk.cs)}addUIElement(t,e){return this.qk.addUIElement(t,e)}addLegendBox(t,e){return this.qk.addLegendBox(t,e)}getLegendBoxes(){return this.qk.getLegendBoxes()}saveToFile(t,e,i){return this.qk.saveToFile(t,e,i),this}dispose(){return this.qk.dispose(),this.Qk.clear(),this.MS.clear(),this.sT(this),this}isDisposed(){return this.qk.isDisposed()}onDispose(t){return this.qk.onDispose((()=>t(this)))}offDispose(t){return this.qk.offDispose(t)}}const Gc=t=>{if("getStrokeStyle"in t)return t.getStrokeStyle();const e=(t=>t instanceof vc||t instanceof Yu?t.getStrokeStyle().getFillStyle():t instanceof bc||t instanceof Qu?t.getPointFillStyle():void 0)(t);return e?new Ji({thickness:2,fillStyle:e}):void 0};class Yc extends Yl{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Ms="Point Series",this.Ob=[],this.Nb=!1,this.$b=3,this.ga=0,this.Om=Hl,this.be=fe(this.ts.polarPointSeriesFillStyle,o),this.ad=new no({dataPattern:null}),this.Ga=t.fd(r).Ee(ot).dd(z).ud(this.be).Ad(e.PointShape.Circle).Sd(this.$b).ds(this.getHighlight()).ld(this.ad),this.fs(this.Ga)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){return 0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf),this.Ob=jl(t),this.Nb=!0,this.Lb=Wl(this.Ob),this.Ts.vs(),this}setPointAlignment(t){return this.Ga.KC(t),this.Ki.cs.vs(),this}getPointAlignment(){return this.Ga.qC()}setPointFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;return this.Ga.ud(e),this.Ts.vs(),this}getPointFillStyle(){return this.be}setPointSize(t){return this.$b=t,this.Ga.Sd(t),this.Ts.vs(),this}getPointSize(){return this.$b}setPointShape(t){return this.Ga.Ad(t),this.Ki.cs.vs(),this}getPointShape(){return this.Ga.gd()}setPointRotation(t){return this.ga=t,this.Ga.pd(t),this.Ts.vs(),this}getPointRotation(){return this.ga}qy(){return this.iS&&this.Ob.length>0&&this.getVisible()}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=dt(t,this.Ki.cs.ft,this.scale),s=this.ad.$c(i,!1,this.scale,this.Ki.pixelScale);if(!s)return;const{angle:r,amplitude:n}=$l(s,this.scale);return wa(s,this.scale,this.Om(new la,this,r,n,this.Ki.getAmplitudeAxis().formatValue).Qu(),this,"color"in s&&void 0!==s.color&&X(this.be)?new G({color:k(s.color)}):this.be)}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}Fe(){if(this.Nb||this.scale.Hb()){const t=Xl(this.Ob,this.scale),e=Ze(t);this.ad.clear().add(t),this.Ga.Ho(e),this.Nb=!1,this.Ga.Ds()}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be}),this}ks(){return this.bs||this.getPointShape()}}class Hc{constructor(t,e,i,s){this.L=new r.Eventer,this.cT=!1,this.Ki=t,this.dT=e,this.MS=i,this.Ga=s}setGeometry(t){return this.fT=t,this.cT=!0,this.Ki.cs.vs(),this}getGeometry(){return this.fT}setMouseInteractions(t){return this.Ga.setMouseInteractions(t),this}dispose(){return this.Ga.dispose(),this.dT(this),this.L.emit("dispose",this),this}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}setVisible(t){const e=this.Ga.getVisible()!==t;return this.Ga.setVisible(t),e&&this.L.emit("visibleStateChanged",this,t),this.Ki.cs.vs(),this}getVisible(){return this.Ga.getVisible()}onVisibleStateChanged(t){return this.L.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.L.off(t,"visibleStateChanged")}}class Xc extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Polygon Series",this.AT=[],this.gT=[],this.Om=Hl,this.pT=t=>{const e=this.gT.indexOf(t);e>=0&&this.gT.splice(e,1);const i=this.AT.findIndex((e=>e===t.Ga));i>=0&&this.AT.splice(i,1),this.Ts.vs()},this.be=fe(this.ts.polarPolygonSeriesFillStyle,n),this.Me=fe(this.ts.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}addPolygon(){const t=new Hc(this.Ki,this.pT,this,this.mT());return this.gT.push(t),t}setFillStyle(t){this.be="function"==typeof t?t(this.be):t;const e=this.be;for(const t of this.AT)t.ke(e);return this.Ts.vs(),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.AT)t.Ce(e);return this.Ts.vs(),this}getStrokeStyle(){return this.Me}qy(){return this.iS&&void 0!==this.gT.find((t=>void 0!==t.yT))&&this.getVisible()}Fe(){this.gT.forEach((t=>{(t.cT||this.scale.Hb())&&t.ST&&(t.Ga.Sl(Xl(t.ST,this.scale)),t.cT=!1,t.Ga.Ds())}))}aS(){super.aS();const t=m(Le,Pe);this.gT.forEach((e=>{if(!e.fT)return;const i=!e.cT&&e.ST?e.ST:jl(e.fT);e.ST=i;const s=!e.cT&&e.yT?e.yT:Wl(i);e.yT=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Lb=t}Pe(t,e){t.ds(e),this.Ts.vs()}$c(t,e){const i=bu(t,this.AT,((t,e)=>{const i=t.$c(e);if(i)return dt(i,this.scale,t.cs.ft)}),Xe);if(!i)return;const s=dt(i[0],i[1].cs.ft,this.scale),r=this.vT(i[1]);if(!r)return;const{angle:n,amplitude:o}=$l(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.Om(new la,this,n,o,this.Ki.getAmplitudeAxis().formatValue).Qu(),owner:this,fillStyle:this.be,polarPolygon:r}}solveNearestFromScreen(t){return this.$c(rh(t,this.Ki.cs),!1)}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}mT(){const t=this.Ts.sc(this.scale,hn.Simple).ke(this.be).Ce(this.Me).ds(this.getHighlight());return this.AT.push(t),this.fs(t),t}vT(t){return this.gT.find((e=>e.Ga===t))}}class Wc extends Yl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Ms="Area Series",this.Ob=[],this.Nb=!1,this.Gb=!1,this.xT=!1,this.Om=Hl,this.be=fe(this.ts.polarAreaSeriesFillStyle,n),this.Me=fe(this.ts.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.Om=t,this.Ki.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}setData(t){0!==this.Ob.length&&this.Ki.cs.Gn(ah.xf);const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.be,stroke:this.Me}),this}}class jc extends Wc{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.bT=this.Ts.sc(this.scale,hn.Simple).ds(this.getHighlight()),this.fs(this.bT)}Fe(){if(this.Nb||this.scale.Hb()){const t=this.Ob,e=!0===this.Gb?Xl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Ct(e.angle,i.angle))return t;const s=1*Math.sign(i.angle-e.angle);let r=0;const n=[];for(let t=i.angle+s;!Ct(t%360,e.angle%360);t+=s)if(n.push({angle:t,amplitude:0}),r+=1,r>360)return[];for(let t=0;t=this.MT.start}Cb(t){this._T=t,this.FT=!0}Tb(){return!1===this._T}kb(t){this.wT=t,this.FT=!0}Mb(){return this.wT}yi(){return this.xi}wi(){return!1}ut(t,e,i,s){return this.x=new Di(t.x,e.x,i.x,s?s.x:void 0),this.y=new Di(t.y,e.y,i.y,s?s.y:void 0),this}Si(){return this.fi}Hb(){return this.TT}DT(){return this.FT}Ui(){return this.IT}Z(){return this.o=!1,this.xi=!1,this.TT=!1,this.FT=!1,this}J(){return this.o=!0,this.xi=!0,this.TT=!0,this.FT=!0,this}tt(t,e){return"object"==typeof t?(this.j.x=t.x,this.j.y=t.y):(this.j.x=t,this.j.y=e),this.PT(),this}zi(t){return this.CT=t,this.PT(),this}Vi(t){return this.kT=t,this.PT(),this}oi(){return u(this.CT[0]+this.CT[1],this.kT[0]+this.kT[1])}ai(){return this.j}PT(){const t=this.MT,e=u(this.x.li(this.j.x),this.y.li(this.j.y)),i=this.CT[0]+this.CT[1],s=this.kT[0]+this.kT[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.CT[0]+Math.max((r-2*o)/2,0),this.CT[1]+Math.max((r-2*o)/2,0)],a=[this.kT[0]+Math.max((n-2*o)/2,0),this.kT[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.tt(this.j.x).ei(h).K(-l,l),this.y.tt(this.j.y).ei(a).K(-l,l),this.IT={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.fi={x:this.x.Si(),y:this.y.Si()},this.J()}mi(t,e){const i=this.Ui();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Yi(t,e,i,s){const r=this.Ui(),n=si(t,e);return n.x*=s,n.y*=s,{x:t.x+i*r.x*n.x,y:t.y+i*r.y*n.y}}}class Zc extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("polarChart bg",0),r,i.cs.ts.polarChartBackgroundFillStyle,i.cs.ts.polarChartBackgroundStrokeStyle,i.cs.ts.polarChartTitleFont,i.cs.ts.polarChartTitleFillStyle,h),this.coordsClient="client",this.Kf=[],this.Lo=!0,this.Vm=e.AutoCursorModes.onHover,this.BT=(t,e,i,s,r)=>{this.hb.tt(s,r)},this.iA=Qt(this.Kf),this.LT=t=>{this.Kf.push(t)},this.RT=()=>this.MS,this.cs.Gn(ah.df),this.Wk=i.Ax("polarChart series bg",0),this.ET=i.Um("polarChart axis gridlines",0),this.zT=i.Um("polarChart series",1),this.VT=i.Um("polarChart axis lines",2),this.OT=i.Um("polarChart axis ticks",3),this.hb=s.d2({scaleXYConstructor:$c}),this.onResize(this.BT),this.bp.Eh("Polar Chart"),this.IS=this.Wk.Kc(this.hb).ke(this.ts.polarChartSeriesBackgroundFillStyle).Ce(ot).hu(0).Ve(360).au(0),this.PS=this.Wk.Kc(this.hb).ke(z).Ce(this.ts.polarChartSeriesBackgroundStrokeStyle).hu(0).Ve(360).au(0),super.FS(this.IS,this.PS),this.mp(n,this.pixelScale),this.NT=new Pl(this,this.hb,this.ts,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.ET,this.VT,this.OT,this.hs,this.RT),this.GT=new Vl(this,this.hb,this.ts,!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled),this.ET,this.VT,this.OT,this.hs),this.coordsAxis={axisAmplitude:this.NT,axisRadial:this.GT},this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,Ma);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(zi(r)){const t=dt(e,s,this.engine.scale);return this.cs.Bo({engineX:t.x,engineY:t.y})}if(Oi(r))return e;if(Nl(r)){const t=dt(e,s,this.hb);return $l(t,this.hb)}}else{const i=t,s=e;if(Ni(i)){if(Nl(s)){const t=this.cs.Do(i),e=dt({x:t.engineX,y:t.engineY},this.engine.scale,this.hb);return $l(e,this.hb)}if(zi(s))return i;if(Oi(s)){const t=this.cs.Do(i);return dt({x:t.engineX,y:t.engineY},this.cs.ft,this.pixelScale)}}else if(Ol(i)){if(Nl(s))return i;const t=Xl([i],this.hb)[0];if(zi(s)){const e=dt(t,this.hb,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.cs.Bo(i)}if(Oi(s))return dt(t,this.hb,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Jl(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointSeries(t){const e=new Yc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPointLineSeries(t){const e=new ql(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addAreaSeries(t){const e=new jc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addPolygonSeries(t){const e=new Xc(this.zT,this,this.wS,this.hb,this.ts,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.MS.length,this.cs.hs);return this.DS(e),e}addHeatmapSeries(t){const e=new Zl(this.zT,this,this.wS,this.hb,this.ts,this.cs.hs,t);return this.DS(e),e}addSector(){const t=new Ul(this.zT,this,this.iA,this.hb,this.ts,this.cs.hs);return this.LT(t),t}getAmplitudeAxis(){return this.NT}get amplitudeAxis(){return this.NT}get axisAmplitude(){return this.NT}getRadialAxis(){return this.GT}get radialAxis(){return this.radialAxis}get axisRadial(){return this.radialAxis}Fe(t){var e,i;super.Fe(t),ta.kp(this.bp,this.Sp);for(const t of this.MS)t.aS();this.NT._r(),this.GT._r();for(const t of this.MS)t.Fe();for(let t=1;t<=2;t+=1){const e=this.NT.Fe(),i=this.GT.Fe(),s=ta.Cp(this.bp,this.Sp),r=[this.ya.left+i,this.ya.right+i],n=[this.ya.bottom+i,this.ya.top+i+s];this.hb.zi(r).Vi(n);const o=4;if(!(!this.WT||Math.abs(this.WT.amplitude-e)>=o||Math.abs(this.WT.radial-i)>=o)||1!==t){this.WT={amplitude:e,radial:i};break}}const s=this.hb.yb().start,r=this.hb.yb().end,n=this.hb.mb()?((null===(e=this.WT)||void 0===e?void 0:e.radial)||0)*this.hb.x.getPixelSize()+r-s:((null===(i=this.WT)||void 0===i?void 0:i.radial)||0)*this.hb.x.getPixelSize()+s-r;this.IS.ru(n).lu(360),this.PS.ru(n).lu(360);for(const t of this.Kf)t.Fe();ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));for(const t of this.MS)t.Ay();return super.pp(),this.UT(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.NT.setAnimationsEnabled(t),this.GT.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.Lo=t,this}getMouseInteractions(){return this.Lo}getMinimumSize(){return u(Kc,Kc)}UT(){}forEachAxis(t){return t(this.NT),t(this.GT),this}dispose(){return this.Kf.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wk.U(),this.ET.U(),this.zT.U(),this.VT.U(),this.OT.U(),this.Hm.U(),super.dispose()}Qd(){return[...this.MS,...this.Kf]}}const Kc=300;class Jc extends Ia{}class qc extends Jc{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Ms="Slice",this.S=0,this.um=!1,this.YT=z,this.fm=z,this.Am=this.S,this.ym=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.bT=e.sc(r,hn.Simple).ds(this.getHighlight()),this.fs(this.bT),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.YT=t,this.fm=i,this.bT.ke(this.YT).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},ed=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=td(i,r.x),s=td(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),A=(i+c/u*(s-i))/2,g={x:a-A,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+A,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>g.x&&p.bT.Sl([g,d,f,m])}};class id extends Qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("funnelChart bg",0),r,i.cs.ts.funnelChartBackgroundFillStyle,i.cs.ts.funnelChartBackgroundStrokeStyle,i.cs.ts.funnelChartTitleFont,i.cs.ts.funnelChartTitleFillStyle,o),this.Cm=[],this.km=ka.None,this.Im=!0,this.Bm=0,this.HT=80,this.$T=20,this.XT=0,this.jT=e.FunnelSliceModes.VariableHeight,this.Em=!0,this.Vm=e.AutoCursorModes.onHover,this.Om=Ra,this.Nm=t=>{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.zm=this.ts.effectsText,this.Wm=i.Um("funnelChart bottom",0),this.Ym=i.Um("funnelChart top",1),this.bp.Eh("Funnel Chart"),this.Tm=this.ts.funnelChartSliceFillStylePalette,this.Fm=this.ts.funnelChartSliceStrokeStyle,this.Pm=this.ts.funnelChartSliceLabelFont,this.Dm=this.ts.funnelChartSliceLabelFillStyle,this.Hm=i.$m();const a=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.mp(n,this.pixelScale)}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new qc(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);return this.Bm+=1,i.setName(t),i.setValue(e),i.hs.ns.Ss(this.zm),i.hs.os.Ss(this.Em),this.Cm.push(i),this.cs.vs(),i.setHighlightOnHover(this.Im),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){return this.Dm="function"==typeof t?t(this.Dm):t,this.cs.vs(),this}getLabelFillStyle(){return this.Dm}setLabelFont(t){return this.Pm="function"==typeof t?t(this.Pm):t,this.cs.vs(),this}getLabelFont(){return this.Pm}setLabelEffect(t){return this.zm=t,this.Cm.forEach((e=>e.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);this.Cm=this.Cm.sort(this.km);for(let t=0,{length:e}=this.Cm;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;twa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e){t.setStyle(this.Gd?new G({color:this.Gd.getColors(t.getAnimatedValue())}):this.Tm(e,t),this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wm.U(),this.Ym.U(),this.Hm.U(),super.dispose()}}const sd=(t,i,s)=>{const r=t.vl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.FunnelLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},rd=t=>{const e=t.vl();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 nd extends id{constructor(){super(...arguments),this.jm=Ca.NamePlusValue,this.ZT=10,this.QT=e.FunnelLabelSide.Left,this.JT=e.SliceLabelIndices.LabelsOnSides,this.Qm=[],this.ty=this.ts.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t{const e=this.Cm.indexOf(t);e>=0&&this.Cm.splice(e,1)},this.cs.Gn(ah.uf),this.Ts=e.Um("gaugeChart layer",0),this.Ym=e.Um("gaugeChart top layer",1),this.bp.Eh("Gauge Chart"),this.mp(r,this.pixelScale);const h=Wi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),this.setAnimationsEnabled(void 0===o||o)}dispose(){return this.Ts.U(),this.Ym.U(),this.Cm.slice().forEach((t=>t.dispose())),super.dispose()}}class cd extends ud{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.jl=90,this.Zl=-270,this.tF={min:this.jl,max:this.Zl},this.iF=K((()=>this.Ts.vs())),this.sF=()=>{this.eF=void 0},this.hF=e.Um("radialGaugeChart bg arc",2),this.rF=this.Ts.Kc(this.pixelScale).ke(this.ts.gaugeChartEmptyGaugeFillStyle).Ce(this.ts.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.jl,s=this.Zl,r=this.tF;return this.getAnimationsEnabled()?this.nF(r,{min:t,max:e}):(r.min=t,r.max=e,this.jl=t,this.Zl=e),this.L.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.cs.vs(),this}getAngleInterval(){return{min:this.jl,max:this.Zl}}setGaugeFillStyle(t){return this.rF.ke(t),this.cs.vs(),this}setGaugeStrokeStyle(t){return this.rF.Ce(t),this.cs.vs(),this}nF(t,e,i){this.eF=this.iF(1e3,$.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.tF={min:t,max:e},this.jl=t,this.Zl=e,this.Ts.vs()})),this.eF.onEveryAnimationEnd(this.sF),i&&this.eF.onAnimationEnd(i)}onAngleIntervalChange(t){return this.L.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.L.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.hF.U(),this}}class dd extends Ia{oF(t){return this.L.on("valueChange",t)}aF(t){return this.L.on("valueIntervalChange",t)}offValueChange(t){return this.L.off(t,"valueChange")}offIntervalChange(t){return this.L.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){le(t,this.ts,i,{fill:this.lF})}}class fd extends dd{onValueChange(t){return this.oF(t)}onIntervalChange(t){return this.aF(t)}}class gd extends fd{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.jl=0,this.Zl=0,this.uF=0,this.cF=0,this.dF=0,this.fF=100,this.AF=!0,this.Am=this.S,this.pm=this.getVisible(),this.ym=Me(),this.gF=t=>{this.Am=t,this.Ki.cs.vs()},this.pF=t,this.Br=e,this.Ki=i,this.scale=s,this.lF=this.ts.gaugeChartGaugeFillStyle,this._m=t.Kc(s).ke(this.lF).Ce(ot).ds(this.getHighlight()),this.fs(this._m),this.mF=e.Dr(s).ds(this.getHighlight()),this.fs(this.mF,{isText:!0}),this.yF=e.Dr(s).ds(this.getHighlight()),this.fs(this.yF,{isText:!0}),this.Ye=e.Dr(s).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0}),this.mF.ke(n.gaugeChartIntervalLabelsFillStyle).Nh(n.gaugeChartIntervalLabelsFont),this.yF.ke(n.gaugeChartIntervalLabelsFillStyle).Nh(n.gaugeChartIntervalLabelsFont),this.Ye.ke(n.gaugeChartValueLabelFillStyle).Nh(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Fe(){const t=this.Ki.getDataLabelFormatter(),e=this.jl/90r&&(i=r);const n=this.Zl-e*this.cF,o=this.jl+e*this.uF,h=this.fF-this.dF,a=(0!==h?(n-o)/h:1/0)*(i-this.dF);this._m.hu(o).Ve(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ye.Eh(l)}SF(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.dF,{getInnerStart:()=>this.dF,getInnerEnd:()=>this.fF}):t.format(this.dF);return this.mF.Eh(e).Ds(),this.mF.ai()}vF(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.fF,{getInnerStart:()=>this.dF,getInnerEnd:()=>this.fF}):t.format(this.fF);return this.yF.Eh(e).Ds(),this.yF.ai()}setName(t){return super.setName(t),this.Ki.cs.vs(),this}setValue(t){const e=this.S;return this.Ki.getAnimationsEnabled()?this.pm&&this.ym(e,t,this.gF):this.Am=t,this.S=t,this.L.emit("valueChange",this,e,t),this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return this.pm=t,!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?this.ym(this.Am,0,this.gF,{onCompleted:()=>super.setVisible(!1)}):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(super.setVisible(!0),this.ym(this.Am,this.S,this.gF)):(this.Am=this.S,super.setVisible(!0)),this}setInterval(t,e){const i=this.dF,s=this.fF;return this.L.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.dF=t,this.fF=e,this.Ki.cs.vs(),this}setIntervalLabelsFont(t){return this.mF.Nh(t),this.yF.Nh(t),this.Ki.cs.vs(),this}getIntervalLabelsFont(){return this.mF.Oh()}setIntervalLabelsFillStyle(t){return this.mF.ke(t),this.yF.ke(t),this.Ki.cs.vs(),this}getIntervalLabelsFillStyle(){return this.mF.zh()}setIntervalLabelsVisible(t){return t?(this.mF.setVisible(!0),this.yF.setVisible(!0)):(this.mF.setVisible(!1),this.yF.setVisible(!1)),this.AF=t,this}getIntervalLabelsVisible(){return this.AF}setAngleInterval(t,e){return this.jl=t,this.Zl=e,this.Ki.cs.vs(),this}setMinAngle(t){return this.jl=t,this.Ki.cs.vs(),this}setMaxAngle(t){return this.Zl=t,this.Ki.cs.vs(),this}setMarginInDegrees(t=this.uF,e=this.cF){return t!==this.uF&&(this.uF=t),e!==this.cF&&(this.cF=e),this.Ki.cs.vs(),this}setFillStyle(t){this.lF="function"==typeof t?t(this.lF):t;const e=this.lF;this._m.ke(e);for(let t=0;tr?25*s:25*r))){const o=Array(n+2),h=Math.PI;let a=0,l=0;const c=e*h/180,d=(i*h/180-c)/n;for(o[a]=u(t.x,t.y),a+=1;a<=n+1;)o[a]=u(t.x+s*Math.cos(c+l*d),t.y+r*Math.sin(c+l*d)),a+=1,l+=1;return[o,n]}class yd extends cd{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Od=20,this.MF=new Intl.NumberFormat,this._F=new Intl.NumberFormat,this.wF=!1,this.CF=5;const h=new gd(this.Ts,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);this.kF=h,this.Cm.push(h),this.setPadding(10)}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=Ze([this.kF.SF(),this.kF.vF()]),s=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.ya.left+i.max.x+.5*s.x,this.ya.bottom+i.max.y+.5*s.y),o=this.wF?this.TF(n,r):n,h=this.rF.Me.getThickness(),a=r-.5*h,l=r-this.Od;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.Od-h)/r);this.FF(o,l)&&(this.rF.ru(r).au(c),this.kF._m.ru(a).au(d));const f=.5*(g=r,(m=this.Zl-this.jl)/(2*Math.PI*g*(m/360))*h);var g,m;this.rF.hu(this.jl).Ve(this.Zl).Ie(o),this.kF._m.Ie(o),this.kF.Ye.Ie(o),this.Gd&&this.kF.setFillStyle(new G({color:this.Gd.getColors(this.kF.getAnimatedValue())})),this.kF.setMinAngle(this.jl).setMaxAngle(this.Zl).setMarginInDegrees(f,f).Fe();const y=this.rF.Ql();if(this.kF.getIntervalLabelsVisible()){this.IF(this.jl,this.Zl,o,y+this.CF);const t=this.kF.mF.Ds().Ue(),e=this.kF.yF.Ds().Ue();Ne(t,e)&&this.PF(t,e,o,y+this.CF)}}FF(t,e){const i=ni(this.kF.Ye.Ds().ai(),.5),s=t.x+e,r=t.x-e,n=t.y+e,o=t.y-e;return!(t.x+i.x>s||t.x-i.xn||t.y-i.y=0?i=-s:s=-i),[i,s]}TF(t,e){const[i]=md(t,this.jl,this.Zl,e,e),s=Ze(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return oi(hi(t,u(s.min.x+r,s.min.y+n)),t)}IF(t,e,i,s){const r=gi(t),n=gi(e);this.kF.mF.Ie(ti(u(i.x+s,i.y),i,-r)),this.kF.yF.Ie(ti(u(i.x+s,i.y),i,-n)),this.kF.mF.za(u(-Math.cos(r),-Math.sin(r))),this.kF.yF.za(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.kF}setAutoScaling(t){return this.wF=t,this.cs.vs(),this}getAutoScaling(){return this.wF}setDataLabelFormatter(t){return this._F=t,this.cs.vs(),this}getDataLabelFormatter(){return this._F}setIntervalLabelFormatter(t){return this.MF=t,this.cs.vs(),this}getIntervalLabelFormatter(){return this.MF}setIntervalLabelPadding(t){return this.CF=t,this.cs.vs(),this}getIntervalLabelPadding(){return this.CF}setThickness(t){return this.Od=t,this}setLUT(t){return this.Gd=t,this.cs.vs(),this}setDataLabelFont(t){return this.kF.Ye.Nh(t),this.cs.vs(),this}getDataLabelFont(){return this.kF.Ye.Oh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.kF.xF(t),this.cs.vs(),this}getDataLabelFillStyle(){return this.kF.bF()}Qd(){return this.Cm}dispose(){return this.kF.dispose(),super.dispose()}}class pd extends Ia{}class xd extends pd{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Ms="Slice",this.S=0,this.um=!1,this.YT=z,this.fm=z,this.Am=this.S,this.ym=K((()=>this.Ki.cs.vs())),this.vm=()=>{this.xm=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.bT=e.sc(r,hn.Simple).ds(this.getHighlight()),this.fs(this.bT),this.Ye=i.Dr(r).ds(this.getHighlight()),this.fs(this.Ye,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.wm(this.Am,t):this.Am=t,this.S=t,this.Ki.cs.vs(),this}getValue(){return this.S}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.Am>0?(this.xm&&(this.xm.finish(!1),this.xm=void 0),this.wm(this.Am,0,(()=>super.setVisible(!1)))):(this.Am=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this.xm&&(this.xm.finish(!1),this.xm=void 0),super.setVisible(!0),this.wm(this.Am,this.S)):(this.Am=this.S,super.setVisible(!0)),this}wm(t,e,i){this.xm=this.ym(300,$.ease)([[t,e]],(([t])=>{this.Am=t,this.Ki.cs.vs()})),this.xm.onEveryAnimationEnd(this.vm),i&&this.xm.onAnimationEnd(i)}setStyle(t,e,i,s){this.YT=t,this.fm=i,this.bT.ke(this.YT).Ce(e),this.Ye.ke(this.fm).Nh(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Ad=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Sd(i,r.x),s=Sd(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},y=0,p=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),A=(i+c/u*(s-i))/2,g={x:a-A,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+A,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>=g.x&&p.bT.Sl([g,d,f,m])}};class vd extends Qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("pyramidChart bg",0),r,i.cs.ts.pyramidChartBackgroundFillStyle,i.cs.ts.pyramidChartBackgroundStrokeStyle,i.cs.ts.pyramidChartTitleFont,i.cs.ts.pyramidChartTitleFillStyle,o),this.Cm=[],this.km=ka.None,this.Tm=this.ts.pyramidChartSliceFillStylePalette,this.Fm=this.ts.pyramidChartSliceStrokeStyle,this.Im=!0,this.Pm=this.ts.pyramidChartSliceLabelFont,this.Dm=this.ts.pyramidChartSliceLabelFillStyle,this.Bm=0,this.HT=0,this.$T=80,this.XT=0,this.jT=e.PyramidSliceModes.VariableHeight,this.Em=!0,this.Vm=e.AutoCursorModes.onHover,this.Om=Ra,this.Nm=t=>{const e=this.Cm.indexOf(t);e>=0&&(this.Cm.splice(e,1),this.Gm())},this.cs.Gn(ah.lf),this.zm=this.ts.effectsText,this.Wm=i.Um("pyramidChart bottom",0),this.Ym=i.Um("pyramidChart top",1),this.bp.Eh("Pyramid Chart"),this.Hm=i.$m();const a=Ft(h?h.autoCursorBuilder:void 0,ba);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.mp(n,this.pixelScale),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled))}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}addSlice(t,e){const i=new xd(this.Bm,this.Wm,this.Ym,this,this.pixelScale,this.Nm,this.ts,this.cs.hs);return this.Bm+=1,i.setName(t),i.setValue(e),i.hs.ns.Ss(this.zm),i.hs.os.Ss(this.Em),this.Cm.push(i),this.cs.vs(),i.onMouseMove((()=>{this.Vm&&this.cs.vs()})),i}addSlices(t){const e=[];for(let i=0;ie.hs.os.Ss(t))),this.cs.vs(),this}getSliceEffect(){return this.Em}setSliceSorter(t){return this.km=t,this.Cm=this.Cm.sort(this.km),this.cs.vs(),this}getSliceSorter(){return this.km}setLabelFillStyle(t){return this.Dm="function"==typeof t?t(this.Dm):t,this.cs.vs(),this}getLabelFillStyle(){return this.Dm}setLabelFont(t){return this.Pm="function"==typeof t?t(this.Pm):t,this.cs.vs(),this}getLabelFont(){return this.Pm}setLabelEffect(t){return this.zm=t,this.Cm.forEach((e=>e.hs.ns.Ss(t))),this.cs.vs(),this}getLabelEffect(){return this.zm}setLabelFormatter(t){return this.jm=t,this.cs.vs(),this}getLabelFormatter(){return this.jm}setSliceHighlightOnHover(t){return this.Im=t,this.Cm.forEach((e=>e.setHighlightOnHover(t))),this}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=ta.Cp(this.bp,this.Sp),i=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+e)),s=u(this.ya.left+i.x/2,this.ya.bottom+i.y/2);this.Cm=this.Cm.sort(this.km);for(let t=0,{length:e}=this.Cm;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;twa(e,this.engine.scale,this.Om(new la,this,t,o[r.indexOf(t)]||0).Qu(),t,void 0))),this.Zm(r,o,s,i)}Xm(t,e){t.setStyle(this.Gd?new G({color:this.Gd.getColors(t.getAnimatedValue())}):this.Tm(e,t),this.Fm,this.Dm,this.Pm)}Gm(){this.Cm=this.Cm.sort(this.km),this.cs.vs()}Qd(){return this.Cm}dispose(){return this.Cm.slice().forEach((t=>t.dispose())),this.Fp.dispose(),this.Wm.U(),this.Ym.U(),this.Hm.U(),super.dispose()}}const bd=(t,i,s)=>{const r=t.vl();if(r.length>0){let t;const n=(r[1].y-r[0].y)/2+r[0].y;return t=i===e.PyramidLabelSide.Left?(r[0].x-r[1].x)/2+r[1].x-s:(r[2].x-(4===r.length?r[3].x:r[1].x))/2+(4===r.length?r[3].x:r[1].x)+s,{x:t,y:n}}},Md=t=>{const e=t.vl();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 Ed extends vd{constructor(){super(...arguments),this.jm=Ca.NamePlusValue,this.ZT=10,this.QT=e.PyramidLabelSide.Left,this.JT=e.SliceLabelIndices.LabelsOnSides,this.Qm=[],this.ty=this.ts.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.ty=t;for(let t=0;t(t.alignmentX=(r+Math.PI/2)%(2*Math.PI)<=Math.PI?-1:1,t.alignmentY=r%(2*Math.PI)<=Math.PI?-1:1,t.paddingX=Math.cos(r)*n,t.paddingY=Math.sin(r)*n,t),Rd=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Id;e.SpiderWebMode=void 0,(Id=e.SpiderWebMode||(e.SpiderWebMode={}))[Id.Normal=0]="Normal",Id[Id.Circle=1]="Circle";class Fd{constructor(t,e,i,s,n,o,h,a){this.L=new r.Eventer,this.BF=t,this.Br=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.LF=h,this.RF=a,this.EF=this.BF.ze(this.scale).setMouseInteractions(!1),this.zF=this.Br.Dr(this.scale).Eh(this.tag).setMouseInteractions(!1),this.VF=this.LF(this,this.BF.sy(this.scale,void 0,[za.InternalUI])).Ee(this.chart.getNibStyle()),this.RF.As([this.zF])}Zm(t,i,s,r,n,o,h){const a=i.length,l=i[s>0?s-1:a-1],c=i[s],d=i[s{const n=s/i,o=[];for(let h=-s/2;h<=s/2;h+=r){const r=n*(h/s)+e,a=u(t.x+Math.cos(r)*i,t.y+Math.sin(r)*i);o.push(a)}return o})(t,r,n,f)),h?this.zF.setVisible(!0).Ie(oi(c,u(h.paddingX,h.paddingY))).Ba(h.alignmentX).Ra(h.alignmentY):this.zF.setVisible(!1)}getLabelSize(){return this.zF.Nh(this.chart.getAxisLabelFont()).ke(this.chart.getAxisLabelStyle()).Ds().ai()}dispose(){this.EF&&this.EF.dispose(),this.zF&&this.zF.dispose(),this.VF&&this.VF.dispose()}}const Dd=(t,e,i,s,r)=>{const n=e.getIcon();return n?t.addRow(n,e.getName()):t.addRow(e.getName()),t.addRow("Axis:","",s).addRow("Value:","",r(i))};class Ld extends Gl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Ms="Spider Series",this.yu=new Map,this.$i=e.HighlightModes.onHover,this.Om=Dd,this.$b=8,this.ga=0,this.OF=Me(),this.NF={},this.GF={},this.pm=this.getVisible(),this.WF=1,this.UF=((t,e)=>{const i=K((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||$.ease,u=(null==a?void 0:a.durationMs)||1e3;s&&(s.finish(!1),s=void 0),!1===o?h&&n?(s=i(u,l)([[n,0]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0,e(!1)}))):(n=0,e(!1)):h?(e(!0),s=i(u,l)([[n,1]],(([e])=>{n=e,t(n)})),s.onAnimationEnd((()=>{s=void 0}))):(n=1,e(!0))}})((t=>{this.WF=t,this.Ts.cs.vs()}),(t=>{super.setVisible(t)})),this.Ki=t,this.Ts=i,this.Xb=r,this.YF=n,this.gx=o,this.HF=h,this.$F=a,this.scale=s,this.XF=fe(u.spiderSeriesFillStyle,c),this.jF=fe(u.spiderSeriesStrokeStyle,c),this.ZF=fe(u.spiderSeriesPointFillStyle,c)}qy(){return this.iS&&this.yu.size>0&&this.getVisible()}addPoints(...t){this.yu.size>0&&this.Ki.cs.Gn(ah.xf),t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.OF(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.yu.set(s,r+t*(e-r)),this.Ts.cs.vs()}))}),{easing:this.NF.easing,durationMs:this.NF.durationMs,onStart:()=>{i=new Map(this.yu)}})}else for(let e=0;e=3&&(this.bT||(this.bT=this.Ts.sc(this.scale,hn.Simple).Ce(this.jF).ke(this.XF).ds(this.getHighlight()),this.fs(this.bT)),this.bT.Sl(t),this.jb||(this.jb=this.Ts.bS(this.scale).tt(this.$b).sl(this.Xb).Gh(this.ga).ke(this.ZF).ds(this.getHighlight()),this.fs(this.jb)),this.jb.Gt().ol(t))}}attach(t,e=!0,i=!1){return super.attach(t,e,i),le(t,this.ts,i,{fill:this.XF,stroke:this.jF}),this}ks(){return this.bs||this.Xb}QF(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},_d=t=>Ze(t.zF.Ue()),Vd=t=>Ze(t.Ue()),Bd=(t,i,s,r)=>t.au(0).Ie(s).hu(90).Ve(-270).lu(i===e.SpiderWebMode.Circle?void 0:r.length),zd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Nd={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Od=()=>{Nd.alignmentX=0,Nd.alignmentY=0,Nd.paddingX=0,Nd.paddingY=0};class Ud extends al{constructor(t,i,s,r,n,o,h){super(t,i,s,i.yp("spiderChart bg",0),r,i.cs.ts.spiderChartBackgroundFillStyle,i.cs.ts.spiderChartBackgroundStrokeStyle,i.cs.ts.spiderChartTitleFont,i.cs.ts.spiderChartTitleFillStyle,h),this.ya=x(20,20,20,20),this.axisScale=ut.d1({scale1DConstructor:Di,dimension:"x"}).K(0,1),this.gx=[],this.JF=[],this.KF=[],this.qF=zs.expansion,this.tI=!0,this.iI=Rd,this.sI=Cd,this.Lo=!0,this.eI=e.SpiderWebMode.Normal,this.hI=4,this.rI=this.ts.spiderChartWebStyle,this.nI=this.ts.spiderChartScaleLabelFillStyle,this.oI=this.ts.spiderChartScaleLabelFont,this.aI=5,this.lI=this.ts.spiderChartAxisLabelFillStyle,this.uI=this.ts.spiderChartAxisLabelFont,this.cI=5,this.dI=this.ts.spiderChartAxisStrokeStyle,this.fI=this.ts.spiderChartAxisNibStrokeStyle,this.Df=10,this.AI=x(),this.Vm=e.AutoCursorModes.onHover,this.hasAxis=t=>this.gx.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.Bi(t,Ii.Numeric),this.gI=()=>{const t=this.gx.map(_d).concat(this.KF.map(Vd));return Ue(t)},this.pI=()=>this.mI.Kc(this.pixelScale).setMouseInteractions(!1),this.yI=t=>t.dispose(),this.SI=()=>this.bA.Dr(this.pixelScale).setMouseInteractions(!1),this.vI=t=>t.dispose(),this.xI=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.bI=(t,e)=>{let i,s;const r=()=>{void 0!==this.MI&&this.MI.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.qF,this.qF=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.gx.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Pd(a,this.gx.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ri(hi(t.EF.Pi(),t.EF.Fi())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.K(i.min,l),Zt(o),this.cs.vs()}},o=()=>{if(i=void 0,void 0!==s)if(this.ih){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this._I(),i=s;if(void 0!==e){const s=i.start(t.min,t.max,e.min,e.max),r=i.end(t.min,t.max,e.min,e.max);this.MI=this.tp.cs.en(300,$.ease)([[0,1]],(([e])=>{this.axisScale.K(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.MI.onAnimationEnd((()=>{this.MI=void 0,this.qF=i}))}else this.qF=s}else this.qF=s;s=void 0};e.setMouseEnterEventHandler(this.wI).setMouseLeaveEventHandler(this.CI).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Wi(new $i(((t,e,i)=>{this.wI(t),r(),Zt(i)}),n,((t,e,i,s)=>{this.CI(t),o(),Zt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.kI=t=>{this.tI&&!this.hasAxis(t)&&this.addAxis(t)},this.HF=(t,e)=>{for(const i of this.gx)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return je(i.EF.Pi(),i.EF.Fi(),t)}},this.$F=t=>{if(0===this.gx.length)return;const e=hi(dt(t,this.engine.scale,this.pixelScale),this.gx[0].EF.Pi()),i=Math.atan2(e.y,e.x);let s,r=Le;for(const t of this.gx){const e=hi(t.EF.Fi(),t.EF.Pi()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.Lo&&(t.Ee(this.fI),this.cs.vs())},this.CI=t=>{t.Ee(this.fI),this.cs.vs()},this.cs.Gn(ah.cf),this.Wk=i.Ax("spiderChart series bg",0),this.mI=i.Um("spiderChart web shapes",0),this.TI=i.Um("spiderChart axis bg",1),this.Wx=i.Um("spiderChart plotting",2),this.bA=i.Um("spiderChart fg",3),this.RF=this.hs.yg().Ss(this.ts.effectsText),this.bp.Eh("Spider Chart"),this.IS=this.Wk.Kc(this.pixelScale).ke(this.ts.spiderChartSeriesBackgroundFillStyle).Ce(ot).hu(90).Ve(-270).au(0),this.PS=this.Wk.Kc(this.pixelScale).ke(z).Ce(this.ts.spiderChartSeriesBackgroundStrokeStyle).hu(90).Ve(-270).au(0),super.FS(this.IS,this.PS),this.Hm=i.$m();const a=Ft(o?o.autoCursorBuilder:void 0,Aa);this.Fp=a.am(this.Hm,this.uiScale,this.uiScale,this.ts),ia.Ip(this),this.RS(((t,e)=>{ia.Pp(this,e)})),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)),this.mp(n,this.pixelScale)}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}solveNearest(t){const e=t||this.cs.Nn();if(e)return ia.$c(this,rh(e,this.cs),this.MS)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Fd(this.TI,this.bA,this.pixelScale,this,t,this.axisScale,this.bI,this.RF);this.gx.push(e)}}else t&&this.gx.push(t);return this.RF.As(this.gx.map((t=>t.zF))),this.cs.vs(),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.MS.length,r=new Ld(this,this.Wx,this.pixelScale,i,this.kI,this.gx,this.HF,this.$F,this.wS,this.ts,s,this.cs.hs);return this.DS(r),r}getSeriesCount(){return this.MS.length}setWebMode(t){return this.eI=t,this.cs.vs(),this}getWebMode(){return this.eI}setWebCount(t){return this.hI=t,this.cs.vs(),this}getWebCount(){return this.hI}setWebStyle(t){return this.rI="function"==typeof t?t(this.rI):t,this.cs.vs(),this}getWebStyle(){return this.rI}setScaleLabelStyle(t){return this.nI="function"==typeof t?t(this.nI):t,this.cs.vs(),this}getScaleLabelStyle(){return this.nI}setScaleLabelFont(t){return this.oI="function"==typeof t?t(this.oI):t,this.cs.vs(),this}getScaleLabelFont(){return this.oI}setScaleLabelPadding(t){return this.aI=t,this.cs.vs(),this}getScaleLabelPadding(){return this.aI}setScaleLabelStrategy(t){return this.iI=t,this.cs.vs(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.cs.vs(),this}setAxisLabelStyle(t){return this.lI="function"==typeof t?t(this.lI):t,this.cs.vs(),this}getAxisLabelStyle(){return this.lI}setAxisLabelFont(t){return this.uI="function"==typeof t?t(this.uI):t,this.cs.vs(),this}getAxisLabelFont(){return this.uI}setAxisLabelEffect(t){return this.RF.Ss(t),this.cs.vs(),this}getAxisLabelEffect(){return this.RF.xs()}setAxisLabelPadding(t){return this.cI=t,this.cs.vs(),this}getAxisLabelPadding(){return this.cI}setAxisLabelStrategy(t){return this.sI=t,this.cs.vs(),this}setAxisStyle(t){return this.dI="function"==typeof t?t(this.dI):t,this.cs.vs(),this}getAxisStyle(){return this.dI}setNibStyle(t){return this.fI="function"==typeof t?t(this.fI):t,this.cs.vs(),this}getNibStyle(){return this.fI}setNibLength(t){return this.Df=t,this.cs.vs(),this}getNibLength(){return this.Df}setAutoAxis(t){return this.tI=t,this}getAutoAxis(){return this.tI}setMouseInteractions(t){return this.Lo=t,this}getMouseInteractions(){return this.Lo}setAxisScrollStrategy(t){return this.qF=t,this.cs.vs(),this}getAxisScrollStrategy(){return this.qF}setAxisInterval(t,e=0){return this.axisScale.K(e,t),this.cs.vs(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp);const e=this.gx.length,i=ta.Cp(this.bp,this.Sp),s=u(this.pixelScale.x.getInnerInterval()-(this.ya.left+this.ya.right),this.pixelScale.y.getInnerInterval()-(this.ya.bottom+this.ya.top+i)),r=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.sI){const t=Math.min(s.x,s.y)/2;for(let i=0;i0?r.right=Math.max(r.right,l.x+.5*(1-a.alignmentX)*h.x-t):r.left=Math.max(r.left,-l.x+.5*(a.alignmentX+1)*h.x-t),o>0?r.top=Math.max(r.top,l.y+.5*(1-a.alignmentY)*h.y-t):r.bottom=Math.max(r.bottom,-l.y+.5*(a.alignmentY+1)*h.y-t)}}if(this.qF){const t=this._I();if(void 0!==t){const e=this.qF.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.qF.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.K(e,i)}}const n=u(this.pixelScale.x.getInnerStart()+(r.left+this.pixelScale.x.getInnerInterval()-r.right)/2,this.pixelScale.y.getInnerStart()+(r.bottom+this.pixelScale.y.getInnerInterval()-r.top)/2),o=Math.min(s.x/2-(r.left+r.right)/2,s.y/2-(r.bottom+r.top)/2);this.AI=x(this.jt.left+this.ya.left+r.left,this.jt.top+this.ya.top+i+r.top,this.jt.right+this.ya.right+r.right,this.jt.bottom+this.ya.bottom+r.bottom),this.Zm(n,o);for(const t of this.MS)t.aS();for(const t of this.MS)t.Fe();super.pp(),ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,(t=>ia.$c(this,t,this.MS)),((t,e)=>t.$c(e,!0)));for(const t of this.MS)t.Ay()}dispose(){return this.Wk.U(),this.mI.U(),this.TI.U(),this.Wx.U(),this.bA.U(),this.Fp.dispose(),this.Hm.U(),super.dispose()}getMinimumSize(){return u(this.AI.left+this.AI.right+100,this.AI.bottom+this.AI.top+100)}Zm(t,e){const i=this.gx.length,s=[];for(let r=0;r{const a=t.length,l=n.length,u=e>0&&l>1;for(let l=0;l=a&&t.push(o());const h=t[l];Bd(h,i,s,n);const u=r*((l+1)/e);h.ru(u)}else l{const c=r.length,d=t.length;let f=0;if(void 0!==e)for(let a=0;a=d&&t.push(h());const e=t[f];f+=1;const s=(i-r)/i,c=je(n,o[a],s);e.Ie(oi(c,u(y.paddingX,y.paddingY))).Ba(y.alignmentX).Ra(y.alignmentY).Eh(l(s))}}}for(let e=f;e1;for(const s of this.gx)for(const r of this.MS){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Gd=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99998/e),o=Math.floor(99999/(e+1)),h=Math.floor(89999/(e+1)),a=510001+e*h;let l=0;return{FI:()=>{const e=t.II("dashboard ui",a+l);return l+=1,e},DI:()=>t.II("dashboard legend",51e4),BI:e=>{const a=1+e*i,l=100001+e*s,u=200002+e*r,c=300002+e*n,d=400001+e*o,f=510001+e*h;let g=0;return{cs:t,yp:(e,i)=>{const s=a+i;return t.II(e,s)},Ax:(e,i)=>{const s=l+i;return t.II(e,s)},Yk:(e,i)=>{const s=u+i;return t.II(e,s)},Um:(e,i)=>{const s=c+i;return t.II(e,s)},ux:(e,i,s)=>{const r=c+i;return t.LI(e,r,s)},xp:(e,i)=>{const s=d+i;return t.II(e,s)},op:e=>{const i=f+g,s=t.II(e,i);return g+=1,s},lp:()=>t.II("panel legend",500002+e),$m:()=>t.II("panel cursor",600001+e)}}}};class Yd{constructor(t){this.L=new r.Eventer,this.S=t}M(t){return this.S=t,this.L.emit("set",t),this}_(){return this.S}N(t){return this.L.on("set",t)}W(t){return this.L.off(t,"set")}}const Hd={dh:()=>{},sh:!1,eh:0,hh:!1,oh:0,rh:!1,ah:0,lh:0,Ke:zs.fitting},Xd=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,r,n,o,h)=>{const{type:a,data:l}=t;if(0===l.length)return;const u=[s,r];"spark-line"===a&&ef(t,e,u,n,o,h),"spark-bar"===a&&sf({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&sf({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&rf(t,e,u,n,o,h),"spark-pie"===a&&nf(t,e,u,n,o,h)},jd=(t,e,i,s)=>({x:Zd(t.x,e.x,i.x,s),y:Kd(t.y,e.y,i.y,s)}),$d=(t,e,i,s)=>({position:Zd(t.position,e.x,i.x,s),high:Kd(t.high,e.y,i.y,s),low:Kd(t.low,e.y,i.y,s)}),Zd=(t,e,i,s)=>{const r=Rt(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Kd=(t,e,i,s)=>{const r=Rt(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Jd=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&qd(a,e,i,r,n,o,h),"axis-band"===a.type&&Qd(a,i,r,n,o,h),"constant-line"===a.type&&tf(a,i,s,r,n,o,h)},qd=(t,i,s,r,n,o,h)=>{const{value:a,fillStyle:l,shape:u,size:c,rotation:d}=t;let f={x:NaN,y:NaN};if("start"===a&&(f=i[0]),"end"===a&&(f=i[i.length-1]),"min"===a){f=i[0];for(const t of i)f=f.yt.y?f:t}("object"!=typeof a||(f=jd(a,s,r,n),((t,e)=>{const i=e[0],s=e[1],r=t.x,n=t.y;return i.x<=r&&r<=i.x+s.x&&i.y<=n&&n<=i.y+s.y})(f,n)))&&o.pointSet.add().Gt().sl(void 0!==u?u:e.PointShape.Circle).Gh(d||0).tt(c||5).ke(l||h.sparkPointChartFillStyle).ol(f)},Qd=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Pe,Le),f=u(Pe,Le);"x"===o&&(d=jd({x:h,y:Pe},e,i,s),f=jd({x:a,y:Le},e,i,s)),"y"===o&&(d=jd({x:Pe,y:h},e,i,s),f=jd({x:Le,y:a},e,i,s));const g=s[0],m=s[1],y=Rt(d.x,g.x,g.x+m.x),p=Rt(d.y,g.y,g.y+m.y),x=Rt(f.x,g.x,g.x+m.x),S=Rt(f.y,g.y,g.y+m.y);r.rect.add().dl(y).fl(p).tt(u(x-y,S-p)).ke(l||n.sparkChartBandFillStyle).Ce(c||n.sparkChartBandStrokeStyle).Ce(ot)},tf=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,y=[];if("y"===h&&d<=c&&c<=f){const t=jd(u(g,c),{x:g,y:d},s,r),e=jd(u(m,c),{x:g,y:d},s,r);y.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=jd(u(c,d),{x:g,y:d},s,r),e=jd(u(c,f),{x:g,y:d},s,r);y.push([t,e])}y.length>0&&n.line.add().Ee(l||o.sparkChartConstantLineStrokeStyle).Oe(y[0][0]).Ve(y[0][1])},ef=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.$n&&bt.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=Le,c=Pe,d=Le,f=Pe;for(let t=0;tjd(t,{x:u,y:d},g,i)));e.lineSet.add().ds(n).Ee(o||s.sparkLineChartStrokeStyle).Gt().ol(m),a&&Jd(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},sf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,y=f/d*1;let p=Le,x=Pe;if(g)p=-1,x=1;else for(const t of o)p=Math.min(p,t),x=Math.max(x,t);const S={x:0,y:g?-1:Math.min(0,p)},A={x:1*o.length+(o.length-1)*y,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*y,y:g?t>=m?1:0:t},r=jd({x:1*e+e*y,y:g?t>=m?0:-1:0},S,A,i),n=jd(s,S,A,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().ds(n).Ie(t.position).pl(t.height).Al(t.width).ke((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).Ce(a||s.sparkBarChartStrokeStyle)}))},rf=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.$n&&bt.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=Le,f=Pe,g=Le,m=Pe;for(let t=0;t{const{data:o,strokeStyle:h}=t,a=o.map((t=>"number"==typeof t?t:t.value)),l=o.map((t=>"object"==typeof t?t.fillStyle:void 0)),c=a.reduce(((t,e)=>t+e),0),d=jd(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;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().ds(n).Ie(d).ru(g).au(0).hu(m).Ve(m+r).ke(l[i]||fe(s.sparkPieChartFillStyle,i)).Ce(h||s.sparkPieChartStrokeStyle),m+=r}))};var of,hf,af;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(of||(of={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(hf||(hf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(af||(af={}));class lf extends fn{constructor(t,e,i,s,r){super(),this.Bs=!1,this.k_={x:0,y:0,height:20,width:20},this.RI={x:10,y:10},this.Ts=t,this.EI=r,this.zI=new mo(t,e,i,kt,s).setMouseInteractions(!0),this.VI=t.sc(e,hn.Simple).ke(s.dataGridScrollBarButtonArrowFillStyle).Ce(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.Mu(this),this.zI.onMouseEnter((t=>t.setHighlight(1))),this.zI.onMouseLeave((t=>t.setHighlight(0)))}OI(){switch(this.EI){case af.Up:this.VI.Sl([{x:this.k_.x,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y-this.RI.y/2},{x:this.k_.x-this.RI.x/2,y:this.k_.y-this.RI.y/2}]);break;case af.Down:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x,y:this.k_.y-this.RI.y/2}]);break;case af.Left:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y},{x:this.k_.x+this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y-this.RI.y/2}]);break;case af.Right:this.VI.Sl([{x:this.k_.x-this.RI.x/2,y:this.k_.y+this.RI.y/2},{x:this.k_.x+this.RI.x/2,y:this.k_.y},{x:this.k_.x-this.RI.x/2,y:this.k_.y-this.RI.y/2}])}}Ie(t){return this.k_.x=t.x,this.k_.y=t.y,this}Ia(){return u(this.k_.x,this.k_.y)}tt(t){return this.k_.height=t.x,this.k_.width=t.y,this}ai(){return{x:this.k_.height,y:this.k_.width}}onMouseDown(t){return this.zI.onMouseDown(t)}onMouseUp(t){return this.zI.onMouseUp(t)}setFillStyle(t){return this.zI.setFillStyle(t),this}getFillStyle(){return this.zI.getFillStyle()}setStrokeStyle(t){return this.zI.setStrokeStyle(t),this}getStrokeStyle(){return this.zI.getStrokeStyle()}Fe(){return this.zI.Fe(),this.OI(),this}Ds(){return this.zI.setSize(u(this.k_.height,this.k_.width)).setPosition(u(this.k_.x,this.k_.y)),this}setVisible(t){return this.zI.setVisible(t),this.VI.setVisible(t),this}dispose(){return this.zI.dispose(),this.VI.dispose(),this}setMouseInteractions(t){return this.zI.setMouseInteractions(t),this}getMouseInteractions(){return this.zI.getMouseInteractions()}onHighlight(t){return this.L.on("highlight",t)}offHighlight(t){return this.L.off(t)}getHighlight(){return this.zI.getHighlight()}setHighlight(t){return this.zI.setHighlight(Ae(t)),this.L.emit("highlight",this,Boolean(t)),this.Ts.vs(),this}}const uf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class cf{constructor(t,i,s,n,o,h,a){this.qc={x:0,y:0},this.k_={x:0,y:0,height:0,width:0},this.L=new r.Eventer,this.NI={min:u(0,0),max:u(0,0)},this.CM=!1,this.kM=!1,this.GI={x:0,y:0},this.wu=void 0,this.WI=u(0,0),this.UI={x:0,y:0},this.YI=0,this.HI=15,this.TM=(t,i)=>{this.CM=!0,this.bA.vs();const s=this.$I.getDraggingMode();this.wu=this.bA.cs.Ur(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.XI&&clearInterval(this.XI)},this.FM=()=>{this.CM=!1,this.bA.vs(),this.bA.cs.Yr(this.wu)},this.IM=t=>(this.kM=!0,this.GI=dt(this.bA.cs.De(t.x,t.y),this.bA.cs.ft,this.scale),!0),this.jI=(t,e)=>(this.ZI(e),this.XI=setInterval((()=>this.ZI(e)),300),!0),this.QI=()=>(clearInterval(this.XI),!0),this.PM=(t,i)=>{const s=this.$I.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=dt(this.bA.cs.De(t.x,t.y),this.bA.cs.ft,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?uf(n.x,this.scale.x):this.k_.x,r!==e.UIDraggingModes.onlyHorizontal?uf(n.y,this.scale.y):this.k_.y),h=u(o.x-this.GI.x,o.y-this.GI.y),a=u(this.$I.getPosition().x+h.x,this.$I.getPosition().y+h.y),l=this.JI(a),c={x:Math.abs(this.WI.x-l.x),y:Math.abs(this.WI.y-l.y)};return this.KI(c),this.UI.y>h.y&&(this.GI=n),this.Fe(),!0}return!1},this.DM=(t,e)=>{this.kM=!1,Zt(e),this.bA.vs()},this.bA=t,this.tp=i,this.scale=n,this.contentScale=o,this.qI=a,this.tP=new lf(t,s,n,h,a===of.UpToDown?af.Up:af.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.iP=new lf(t,s,n,h,a===of.UpToDown?af.Down:af.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.$I=new mo(t,s,n,kt,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===of.UpToDown?e.UIDraggingModes.onlyVertical:a===of.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.sP=new mo(i,s,n,kt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.$I.onMouseEnter(this.TM),this.$I.onMouseLeave(this.FM),this.$I.onMouseDragStart(((t,e)=>this.IM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onMouseDrag(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onMouseDragStop(this.DM),this.$I.onTouchStart(((t,e)=>this.IM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onTouchMove(((t,e)=>this.PM(u(e.clientX,e.clientY))&&Zt(e))),this.$I.onTouchEnd(this.DM),this.tP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.iP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.tP.onMouseUp(((t,e)=>this.QI()&&Zt(e))),this.iP.onMouseUp(((t,e)=>this.QI()&&Zt(e))),this.sP.onMouseWheel(((t,e)=>this.eP(e))),this.$I.onMouseWheel(((t,e)=>this.eP(e))),this.sP.onMouseDown(((t,e)=>this.jI(t,e)&&Zt(e))),this.sP.onMouseUp(((t,e)=>this.QI()&&Zt(e)))}hP(t){return this.k_=t,this}Al(t){return this.k_.width=t,this}rP(){return this.k_.width}nP(t){return this.WI=t,this}oP(t){return this.qc=t,this}aP(){return this.qc}lP(t){return this.HI=t,this}uP(){return this.qI}cP(t){let e;switch(this.qI){case of.UpToDown:return e=t>0?Math.min(this.WI.y-this.NI.max.y,this.UI.y+t):Math.max(0,this.UI.y+t),e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0);case of.LeftToRight:return e=Math.min(this.NI.max.x-this.WI.x,this.UI.x+t),e!==this.UI.x&&(this.KI({y:0,x:e}),this.Fe(),!0);default:return!1}}dP(t){let e;switch(this.qI){case of.UpToDown:return e=Math.max(0,this.UI.y-t),e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0);case of.LeftToRight:return e=t>0?Math.max(0,this.UI.x-t):Math.min(this.NI.max.x-this.WI.x,this.UI.x-t),e!==this.UI.x&&(this.KI({x:e,y:0}),this.Fe(),!0);default:return!0}}fP(t){switch(this.qI){case of.UpToDown:return this.L.on("scrollY",t);case of.LeftToRight:return this.L.on("scrollX",t)}return this.L.on("scrollY",t)}JI(t){switch(this.qI){case of.UpToDown:if(t.y>this.NI.min.y)return u(t.x,this.NI.min.y);if(t.ythis.NI.max.x)return u(this.NI.max.x,t.y)}return t}eP(t){t.deltaY>0&&this.AP()&&Zt(t),t.deltaY<0&&this.gP()&&Zt(t)}ZI(t){const e=dt(this.bA.cs.De(t.clientX,t.clientY),this.bA.cs.ft,this.scale);let i;const s=this.$I.getPosition(),r=this.$I.getSize();this.pP(e,s,r)?clearInterval(this.XI):(i=this.qI===of.UpToDown?u(0,e.y-s.y>0?this.HI:-this.HI):u(s.x-e.x>0?this.HI:-this.HI,0),(i.x>0||i.y>0)&&this.mP(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.yP(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}pP(t,e,i){return this.qI===of.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.k_.height?Math.min(this.WI.y-this.NI.max.y,this.UI.y+t):0,e!==this.UI.y&&(this.KI({x:0,y:e}),this.Fe(),!0)}case of.LeftToRight:{const e=Math.min(this.NI.max.x-this.WI.x,this.UI.x+t);return e!==this.UI.x&&(this.KI({y:0,x:e}),this.Fe(),!0)}default:return!1}}gP(){return this.mP(this.HI)}AP(){return this.yP(this.HI)}KI(t){if(t.x===this.UI.x&&t.y===this.UI.y)return;let e;switch(this.UI=t,this.qI){case of.UpToDown:e=this.UI.y*this.YI*this.contentScale.Ui().y,this.L.emit("scrollY",hf.Vertical,e),this.bA.cs.vs();break;case of.LeftToRight:e=this.UI.x*this.YI*this.contentScale.Ui().x,this.L.emit("scrollX",hf.Horizontal,e)}}setVisible(t){return this.tP.setVisible(t),this.iP.setVisible(t),this.sP.setVisible(t),this.$I.setVisible(t),this}dispose(){return this.tP.dispose(),this.iP.dispose(),this.sP.dispose(),this.$I.dispose(),this.XI&&clearInterval(this.XI),this}Ds(){switch(this.vP(),this.xP(),this.qI){case of.UpToDown:this.tP.Ie({x:this.k_.x,y:this.k_.y+this.k_.height-this.tP.ai().x/2}).tt(u(this.k_.width,this.k_.width)).Ds(),this.iP.Ie({x:this.k_.x,y:this.k_.y+10}).tt(u(this.k_.width,this.k_.width)).Ds(),this.sP.setSize({x:this.k_.width,y:this.k_.height-2*this.tP.ai().x}).setPosition({x:this.k_.x,y:this.k_.y+this.iP.ai().y+this.sP.getSize().y/2}),this.$I.setSize(u(this.k_.width,this.bP())),this.WI={x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2},this.SP({min:{x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2},max:{x:this.k_.x,y:this.iP.Ia().y+this.iP.ai().x/2+this.$I.getSize().y/2}});break;case of.LeftToRight:this.tP.Ie({x:this.k_.x,y:this.k_.y}).tt(u(this.k_.height,this.k_.height)).Ds(),this.iP.Ie({x:this.k_.x+this.k_.width-this.iP.ai().x,y:this.k_.y}).tt(u(this.k_.height,this.k_.height)).Ds(),this.sP.setSize({y:this.k_.height,x:this.k_.width-2*this.tP.ai().y}).setPosition({x:this.k_.x+this.tP.ai().x/2+this.sP.getSize().x/2,y:this.k_.y}),this.$I.setSize(u(this.bP(),this.k_.height)),this.WI={x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2,y:this.k_.y},this.SP({min:{x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2,y:this.k_.y},max:{x:this.iP.Ia().x-this.iP.ai().x/2-this.$I.getSize().x/2,y:this.k_.y}})}return this.MP(),this}vP(){switch(this.qI){case of.UpToDown:this._P()||this.setVisible(!1),this._P()&&this.setVisible(!0);break;case of.LeftToRight:this.wP()||this.setVisible(!1),this.wP()&&this.setVisible(!0)}}xP(){switch(this.qI){case of.UpToDown:this._P()||this.KI({x:0,y:0});break;case of.LeftToRight:this.wP()||this.KI({x:0,y:0})}}_P(){return this.qc.x>this.k_.height}wP(){return this.qc.y>this.k_.width}bP(){switch(this.qI){case of.UpToDown:return this.k_.height*(this.k_.height-2*this.tP.ai().x)/this.qc.x;case of.LeftToRight:return this.k_.width*(this.k_.width-2*this.tP.ai().y)/this.qc.y;default:return 0}}MP(){switch(this.qI){case of.UpToDown:this.YI=(this.qc.x-this.k_.height)/(this.NI.min.y-this.NI.max.y);break;case of.LeftToRight:this.YI=(this.qc.y-this.k_.width)/(this.NI.max.x-this.NI.min.x)}}Fe(){switch(this.tP.Fe(),this.iP.Fe(),this.sP.Fe(),this.qI){case of.UpToDown:this.$I.setPosition({x:this.k_.x,y:this.tP.Ia().y-this.tP.ai().y/2-this.$I.getSize().y/2-this.UI.y}).Fe();break;case of.LeftToRight:this.$I.setPosition({y:this.k_.y,x:this.tP.Ia().x+this.tP.ai().x/2+this.$I.getSize().x/2+this.UI.x}).Fe()}return this}}class df{constructor(t,e,i,s,r,n,o){switch(this.bA=t,this.tp=e,this.scale=s,this.contentScale=r,o){case hf.Vertical:this.CP=this.kP(i,n,of.UpToDown);break;case hf.Horizontal:this.TP=this.kP(i,n,of.LeftToRight);break;case hf.Both:this.CP=this.kP(i,n,of.UpToDown),this.TP=this.kP(i,n,of.LeftToRight)}this.FP=Wi(new $i(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.TP)||void 0===n?void 0:n.dP(s.x))&&Zt(r),0!==s.y&&(null===(o=this.CP)||void 0===o?void 0:o.cP(s.y))&&Zt(r)})))}kP(t,e,i){return new cf(this.bA,this.tp,t,this.scale,this.contentScale,e,i)}rP(){return 20}oP(t){var e,i;return null===(e=this.CP)||void 0===e||e.oP(t),null===(i=this.TP)||void 0===i||i.oP(t),this}IP(t){var e;return null===(e=this.TP)||void 0===e||e.lP(t),this}PP(t){var e;return null===(e=this.CP)||void 0===e||e.lP(t),this}DP(t){const e=this.CP;return e&&e.eP(t),this}BP(t){return this.FP.onTouchStart(this,t),this}LP(t){return this.FP.onTouchMove(this,t),this}RP(t){return this.FP.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.TP)||void 0===e||e.fP(t),null===(i=this.CP)||void 0===i||i.fP(t),this}dispose(){var t,e;return null===(t=this.CP)||void 0===t||t.dispose(),null===(e=this.TP)||void 0===e||e.dispose(),this}Fe(){var t,e;return null===(t=this.CP)||void 0===t||t.Fe(),null===(e=this.TP)||void 0===e||e.Fe(),this}Ds(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.CP)||void 0===t||t.hP({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.TP)||void 0===e||e.hP({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.CP)||void 0===i||i.Ds(),null===(s=this.TP)||void 0===s||s.Ds(),this}}class ff extends Qh{constructor(t,e,i,s,r,n){super(t,e,i,e.yp("dataGrid bg",0),s,e.cs.ts.dataGridBackgroundFillStyle,e.cs.ts.dataGridBackgroundStrokeStyle,e.cs.ts.dataGridTitleFont,e.cs.ts.dataGridTitleFillStyle,n),this.EP=[],this.zP=[],this.VP=[],this.OP=new Map,this.NP=!0,this.GP=!0,this.WP=!0,this.UP=!0,this.YP=!0,this.HP=!0,this.$P=!0,this.XP=!0,this.jP=!0,this.ZP=!0,this.QP=!0,this.JP=!0,this.KP=!0,this.qP=!0,this.tD=!0,this.iD=!0,this.sD=new Set,this.eD=new Set,this.hD=!0,this.rD=!0,this.nD=(t,e)=>{t.borders=void 0===e?xf:{...t.borders,...e},this.oD(t),this.JP=!0,this.cs.vs()},this.oD=t=>{t.borders&&(!1===t.borders.top&&this.aD(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.lD,bottom:!1}})),!1===t.borders.bottom&&this.aD(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.lD,top:!1}})),!1===t.borders.left&&this.aD(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.lD,right:!1}})),!1===t.borders.right&&this.aD(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.lD,left:!1}})),!0===t.borders.top&&this.aD(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.lD,bottom:!0}})),!0===t.borders.bottom&&this.aD(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.lD,top:!0}})),!0===t.borders.left&&this.aD(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.lD,right:!0}})),!0===t.borders.right&&this.aD(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.lD,left:!0}})))},this.uD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseEnter,i,e)},this.cD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseLeave,i,e)},this.dD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseClick,i,e)},this.fD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDoubleClick,i,e)},this.AD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDown,i,e)},this.gD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseUp,i,e)},this.pD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseMove,i,e)},this.mD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDrag,i,e)},this.yD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDragStart,i,e)},this.SD=(t,e)=>{const i=this.OP.get(t);i&&this.L.emit(gf.cellMouseDragStop,i,e)},this.vD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellMouseWheel,i,e),!e.defaultPrevented&&this.hD&&this.xD.DP(e))},this.bD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchStart,i,e),!e.defaultPrevented&&this.rD&&this.xD.BP(e))},this.MD=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchMove,i,e),!e.defaultPrevented&&this.rD&&this.xD.LP(e))},this._D=(t,e)=>{const i=this.OP.get(t);i&&(this.L.emit(gf.cellTouchEnd,i,e),!e.defaultPrevented&&this.rD&&this.xD.RP(e))},this.cs.Gn(ah.sf),this.bp.Eh("Data Grid"),this.wD=i.d2({scaleXYConstructor:_i}),this.wD.x.sg=Hd,this.CD=i.d2({scaleXYConstructor:_i}),this.kD={x:0,y:0},this.TD=this.ts.dataGridTextFont,this.FD=this.ts.dataGridTextFillStyle,this.lD={top:!0,bottom:!0,left:!0,right:!0},this.ID=this.ts.dataGridCellBackgroundFillStyle,this.PD=this.ts.dataGridBorderStrokeStyle,this.DD="left-center",this.BD={left:5,right:5,bottom:5,top:5},this.LD=e.Ax("dataGrid grid bg",0),this.RD=e.Ax("dataGrid cell bg",1),this.ED=e.Um("dataGrid cell content",0),this.zD=e.Um("dataGrid scrollbar bg",1),this.VD=e.Um("dataGrid scrollbar fg",2),this.xD=this.OD(),this.onBackgroundMouseWheel(((t,e)=>{this.hD&&this.xD.DP(e)})),this.onBackgroundTouchStart(((t,e)=>{this.rD&&this.xD.BP(e)})),this.onBackgroundTouchMove(((t,e)=>{this.rD&&this.xD.LP(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.rD&&this.xD.RP(e)})),this.ND=this.LD.Te(this.wD).ke(this.ts.dataGridBackgroundFillStyle).Ce(ot).setMouseInteractions(!1),this.GD=this.ED.Rg(this.wD).setMouseInteractions(!1),this.WD=new Xa((()=>this.RD.Te(this.wD).setMouseInteractions(!0).setMouseEnterEventHandler(this.uD).setMouseLeaveEventHandler(this.cD).setMouseClickEventHandler(this.dD).setMouseDoubleClickEventHandler(this.fD).setMouseDownEventHandler(this.AD).setMouseUpEventHandler(this.gD).setMouseMoveEventHandler(this.pD).setMouseDragEventHandler(this.mD).setMouseDragStartEventHandler(this.yD).setMouseDragStopEventHandler(this.SD).setMouseWheelEventHandler(this.vD).setTouchStartEventHandler(this.bD).setTouchMoveEventHandler(this.MD).setTouchEndEventHandler(this._D))),this.UD=new Xa((()=>this.ED.Te(this.wD).setMouseInteractions(!1))),this.YD=new Xa((()=>this.ED.Dr(this.wD).setMouseInteractions(!1))),this.HD=new Xa((()=>this.ED.sy(this.wD,{},[za.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.$D=new Xa((()=>this.ED.ze(this.wD).setMouseInteractions(!1))),this.XD=new Xa((()=>this.ED.bS(this.wD).setMouseInteractions(!1))),this.jD=new Xa((()=>this.ED.Te(this.wD).setMouseInteractions(!1))),this.ZD=new Xa((()=>this.ED.uw(this.wD).setMouseInteractions(!1))),this.QD=new Xa((()=>this.ED.Kc(this.wD).setMouseInteractions(!1))),this.mp(r,this.uiScale),this.onResize((()=>{this.NP=!0,this.cs.vs(),this.wD.tt(this.pixelScale.ai()),this.CD.tt(this.pixelScale.ai())})),this.JD=this.hs.yg([this.ND])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Qd(){return[]}dispose(){return super.dispose(),this.LD.U(),this.RD.U(),this.ED.U(),this.zD.U(),this.VD.U(),Kh(this.wD),Kh(this.CD),this.xD.dispose(),this.YD.my(),this.WD.my(),this.UD.my(),this.HD.my(),this.$D.my(),this.XD.my(),this.jD.my(),this.ZD.my(),this.QD.my(),this}Z(){return super.Z(),this.wD.Z(),this.CD.Z(),this}J(){return super.J(),this.wD.J(),this.CD.J(),this}setBackgroundEffect(t){return this.JD.Ss(t),this.cs.vs(),this}getBackgroundEffect(){return this.JD.xs()}setInteractionScrollOnWheel(t){return this.hD=t,this}getInteractionScrollOnWheel(){return this.hD}setInteractionPanOnTouch(t){return this.rD=t,this}getInteractionPanOnTouch(){return this.rD}onCellMouseEnter(t){return this.L.on(gf.cellMouseEnter,t)}offCellMouseEnter(t){return this.L.off(t)}onCellMouseLeave(t){return this.L.on(gf.cellMouseLeave,t)}offCellMouseLeave(t){return this.L.off(t)}onCellMouseClick(t){return this.L.on(gf.cellMouseClick,t)}offCellMouseClick(t){return this.L.off(t)}onCellMouseDoubleClick(t){return this.L.on(gf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.L.off(t)}onCellMouseDown(t){return this.L.on(gf.cellMouseDown,t)}offCellMouseDown(t){return this.L.off(t)}onCellMouseUp(t){return this.L.on(gf.cellMouseUp,t)}offCellMouseUp(t){return this.L.off(t)}onCellMouseMove(t){return this.L.on(gf.cellMouseMove,t)}offCellMouseMove(t){return this.L.off(t)}onCellMouseDrag(t){return this.L.on(gf.cellMouseDrag,t)}offCellMouseDrag(t){return this.L.off(t)}onCellMouseDragStart(t){return this.L.on(gf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.L.off(t)}onCellMouseDragStop(t){return this.L.on(gf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.L.off(t)}onCellMouseWheel(t){return this.L.on(gf.cellMouseWheel,t)}offCellMouseWheel(t){return this.L.off(t)}onCellTouchStart(t){return this.L.on(gf.cellTouchStart,t)}offCellTouchStart(t){return this.L.off(t)}onCellTouchMove(t){return this.L.on(gf.cellTouchMove,t)}offCellTouchMove(t){return this.L.off(t)}onCellTouchEnd(t){return this.L.on(gf.cellTouchEnd,t)}offCellTouchEnd(t){return this.L.off(t)}setGridBackgroundFillStyle(t){return this.ND.ke(t),this.cs.vs(),this}getGridBackgroundFillStyle(){return this.ND.zh()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const n=i,o=s,h=r;let a=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.zP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.zP.splice(this.zP.indexOf(i),1):(i.min=e,i.max=e),this.HP=!0,this.cs.vs(),this}setRowHeight(t,e){let i=this.VP.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.VP.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.VP.splice(this.VP.indexOf(i),1):(i.min=e,i.max=e),this.HP=!0,this.cs.vs(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.qD(t,(t=>this.tB(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.iB(t,(t=>this.tB(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=S(i,i,i,i)),this.aD(t,e,(t=>this.tB(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=S(t,t,t,t)),this.BD={...this.BD,...t},this.sB((t=>this.tB(t,this.BD))),this}setCellBorders(t,e,i){return this.aD(t,e,(t=>this.nD(t,i))),this}setRowBorders(t,e){return this.iB(t,(t=>this.nD(t,e))),this}setColumnBorders(t,e){return this.qD(t,(t=>this.nD(t,e))),this}setCellsBorders(t){return this.lD=void 0===t?xf:t,this.sB((t=>this.nD(t,this.lD))),this}setCellsBorderStrokeStyle(t){return this.PD="function"==typeof t?t(this.PD):t,this.qP=!0,this.cs.vs(),this}setColumnTextFillStyle(t,e){return this.qD(t,(t=>this.eB(t,e))),this}setRowTextFillStyle(t,e){return this.iB(t,(t=>this.eB(t,e))),this}setCellTextFillStyle(t,e,i){return this.aD(t,e,(t=>this.eB(t,i))),this}setCellsTextFillStyle(t){return this.FD="function"==typeof t?t(this.FD):t,this.sB((t=>this.eB(t,this.FD))),this}setColumnTextFont(t,e){return this.qD(t,(t=>this.hB(t,e))),this}setRowTextFont(t,e){return this.iB(t,(t=>this.hB(t,e))),this}setCellTextFont(t,e,i){return this.aD(t,e,(t=>this.hB(t,i))),this}setCellsTextFont(t){return this.TD="function"==typeof t?t(this.TD):t,this.sB((t=>this.hB(t,this.TD))),this}setColumnContentAlignment(t,e){return this.qD(t,(t=>this.rB(t,e))),this}setRowContentAlignment(t,e){return this.iB(t,(t=>this.rB(t,e))),this}setCellContentAlignment(t,e,i){return this.aD(t,e,(t=>this.rB(t,i))),this}setCellsContentAlignment(t){return this.DD=t,this.sB((t=>this.rB(t,this.DD))),this}setCellBackgroundFillStyle(t,e,i){return this.aD(t,e,(t=>this.nB(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.qD(t,(t=>this.nB(t,e))),this}setRowBackgroundFillStyle(t,e){return this.iB(t,(t=>this.nB(t,e))),this}setCellsBackgroundFillStyle(t){return this.ID="function"==typeof t?t(this.ID):t,this.sB((t=>this.nB(t,this.ID))),this}setCellHighlight(t,e,i){return this.aD(t,e,(t=>{t.highlight=Ae(i)})),this.KP=!0,this.cs.vs(),this}setColumnHighlight(t,e){const i=Ae(e);return this.qD(t,(t=>{t.highlight=i})),this.KP=!0,this.cs.vs(),this}setRowHighlight(t,e){const i=Ae(e);return this.iB(t,(t=>{t.highlight=i})),this.KP=!0,this.cs.vs(),this}removeCell(t,e){return this.aD(t,e,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.YP=!0,this.cs.vs(),this}removeRow(t){return this.iB(t,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.EP.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.YP=!0,this.cs.vs(),this}removeColumn(t){return this.qD(t,(t=>this.EP.splice(this.EP.indexOf(t),1))),this.EP.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.YP=!0,this.cs.vs(),this}removeCells(){return this.EP.splice(0),this.YP=!0,this.cs.vs(),this}getColumnMax(){return 0===this.EP.length?0:this.EP.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.EP.length?0:this.EP.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Fe(t){super.Fe(t),ta.kp(this.bp,this.Sp),super.pp();const e=Math.round(this.PD.O()),i=e/2;let s=this.GP||this.WP||this.UP||this.YP||this.HP||this.$P||this.QP||this.JP||this.qP||this.iD;if(s){this.EP.forEach((t=>{this.eD.add(t.column)})),this.EP.forEach((t=>{this.sD.add(t.row)}));const t=this.YD.gy(),r=this.oB(i,t);t.finishPlot();const n=this.aB(this.eD.size,r),o=this.lB(this.sD.size,r),h=n.reduce(Ge,0)+e,a=o.reduce(Ge,0)+e,l=new Array(n.length+1).fill(0).map(((t,e)=>n.reduce(((t,i,s)=>t+(so.reduce(((t,i,s)=>t+(st===n[e])),e=this.uB.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.uB={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.WP||this.UP||this.YP||this.XP||this.jP||this.ZP||this.JP||this.KP||this.qP||this.NP||this.iD;if((r||this.tD)&&this.uB){const t=this.pixelScale.getInnerIntervalPixels(),s=ta.Cp(this.bp,this.Sp),n=[this.ya.left+i,this.ya.right+i],o=[this.ya.bottom+i,this.ya.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.ya.left,this.ya.right],l=[this.ya.bottom,this.ya.top+s],u={x:Math.round(t.x-a[0]-a[1]),y:Math.round(t.y-l[0]-l[1])},c={x:Math.ceil(i),y:Math.floor(u.y-i)};this.CD.zi(n).Vi(o).Oi(0,h.x).Ni(0,h.y),this.xD.oP({x:this.uB.dataGridHeight,y:this.uB.dataGridWidth}).Ds().Fe();const d={x:Math.round(this.kD.x),y:Math.round(Math.min(0,this.kD.y))};this.wD.zi(a).Vi(l).Oi(d.x,u.x+d.x).Ni(d.y,u.y+d.y),this.ND.Ie({x:c.x,y:c.y});const f={x:this.wD.x.hi(),y:this.wD.y.hi()+this.xD.rP(),width:this.wD.x.ni()+e-this.xD.rP(),height:this.wD.y.ni()+e};this.ED.tx(f),this.RD.tx(f),this.LD.tx(f);const g=this.uB,m=[{x:this.wD.x.getInnerStart(),y:this.wD.y.getInnerStart()},{x:this.wD.x.getInnerEnd(),y:this.wD.y.getInnerStart()},{x:this.wD.x.getInnerEnd(),y:this.wD.y.getInnerEnd()},{x:this.wD.x.getInnerStart(),y:this.wD.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]},r=Ne([i,{x:s.x,y:i.y},s,{x:i.x,y:s.y}],m);null===(e=t.text)||void 0===e||e.setVisible(r)})),r&&this.cB(c,this.uB,e)}this.NP=!1,this.GP=!1,this.WP=!1,this.UP=!1,this.YP=!1,this.HP=!1,this.$P=!1,this.XP=!1,this.jP=!1,this.ZP=!1,this.QP=!1,this.JP=!1,this.KP=!1,this.qP=!1,this.tD=!1,this.iD=!1}oB(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.EP){const{content:r}=t,n={...this.BD,...t.padding};let o,h,a,l={x:0,y:0};if("string"==typeof r||"number"==typeof r){const i=String(r);o=e.add(),l=o.Eh(i).Nh(t.textFont||this.TD).Ds().Zc()}if(Xd(r)&&(h=r,l={x:200,y:50}),io(r)){const t=this.cs.dB(r);t.fB()?(a=r,l=a.ai()):t.AB((()=>{this.iD=!0,this.cs.vs()}))}if(o||h||a){n.top=Math.round(n.top),n.left=Math.round(n.left),n.right=Math.round(n.right),n.bottom=Math.round(n.bottom);const e={x:Math.round(l.x+n.left+n.right+s.left+s.right),y:Math.round(l.y+n.top+n.bottom+s.top+s.bottom)};i.push({cell:t,contentSize:e,text:o,sparkChart:h,icon:a,cellPadding:n,cellMargin:s})}}return i}cB(t,i,s){const{dataGridWidth:r,dataGridHeight:n,cellsContentSizes:o,columnWidths:h,columnWidthsCumulative:a,rowHeights:l,rowHeightsCumulative:u}=i,c={x:r-s,y:-n+s};this.ND.tt(c),this.GD.Ee(this.PD),this.OP.clear();const d={cellBackground:this.WD.gy(),cellIconRect:this.UD.gy(),lineSet:this.HD.gy(),line:this.$D.gy(),pointSet:this.XD.gy(),rect:this.jD.gy(),junction:this.ZD.gy(),arc:this.QD.gy()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:m}=i,y={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},x={x:p.x+m.left,y:p.y+m.bottom},S={x:x.x+g.left,y:x.y+g.bottom},A={x:new Array(r.columnSpan).fill(0).reduce(((t,e,i)=>t+h[r.column+i]),0),y:new Array(r.rowSpan).fill(0).reduce(((t,e,i)=>t+l[r.row+i]),0)},v={x:A.x-m.left-m.right,y:A.y-m.top-m.bottom},b={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=pf(S,b,r.contentAlignment||this.DD);n.Ie(t[0]).za({x:t[1],y:t[2]}).ke(this.gB(r.textFillStyle||this.FD,r.content,this.FD)).ds(r.highlight)}const M=this.gB(r.backgroundFillStyle||this.ID,r.content);if(M!==z){const t=d.cellBackground.add();t.Ie(p).tt(A).ke(M).Ce(ot).ds(r.highlight),this.OP.set(t,y)}const E=r.borders||this.lD;if(E&&yf(p,A,E,s,f),o){const t=S,e=b;Wd(o,d,this.wD,t,e,this.ts,this.dA,r.highlight)}if(c){const t=c.ai(),i=pf(S,b,r.contentAlignment||this.DD);d.cellIconRect.add().Ie({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).tt(t).ke(new $n({source:c.nc,fitMode:e.ImageFitMode.Stretch})).Ce(ot).ds(r.highlight)}}this.GD.Gt();for(const t of f)this.GD.Vr().zg(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()}aB(t,e){const i=new Array(t).fill(0);for(const t of this.eD.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),r=this.zP.find((e=>e.column===t)),n=r?Rt(s,void 0!==r.min?r.min:Pe,void 0!==r.max?r.max:Le):s;i[t]=n}return i}lB(t,e){const i=new Array(t).fill(0);for(const t of this.sD.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),r=this.VP.find((e=>e.row===t)),n=r?Rt(s,void 0!==r.min?r.min:Pe,void 0!==r.max?r.max:Le):s;i[t]=n}return i}gB(t,e,i){if(j(t)){try{const i=Number(e);return new G({color:t.getPalette().getColors(i)})}catch(t){}return i||z}return t}eB(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.FD):e,this.ZP=!0,this.cs.vs()}hB(t,e){t.textFont="function"==typeof e?e(t.textFont||this.TD):e,this.QP=!0,this.cs.vs()}nB(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.ID):e,this.jP=!0,this.cs.vs()}rB(t,e){t.contentAlignment=e,this.XP=!0,this.cs.vs()}tB(t,e){t.padding={...t.padding,...e},this.$P=!0,this.cs.vs()}KD(t,e,i){let s=this.aD(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.EP.push(s),this.UP=!0),"string"==typeof s.content||"number"==typeof s.content?this.GP=!0:this.WP=!0,this.cs.vs()}sB(t){this.EP.forEach((e=>t(e)))}aD(t,e,i){const s=this.EP.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}qD(t,e){const i=this.EP.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}iB(t,e){const i=this.EP.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}OD(){return new df(this.VD,this.zD,this.CD,this.CD,this.wD,this.ts,hf.Both).onScroll(((t,e)=>{this.uB&&(t===hf.Vertical&&(this.kD.y=-e),t===hf.Horizontal&&(this.kD.x=e),this.tD=!0,this.cs.vs())})).IP(50).PP(12)}}const gf={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 mf;e.DataGridCellContentAlignmentOptions=void 0,(mf=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",mf.RightCenter="right-center",mf.LeftCenter="left-center",mf.RightTop="right-top",mf.LeftTop="left-top",mf.RightBottom="right-bottom",mf.LeftBottom="left-bottom",mf.CenterTop="center-top",mf.CenterBottom="center-bottom";const yf=(t,e,i,s,r)=>{const n={x:t.x,y:t.y},o={x:t.x,y:t.y+e.y},h={x:t.x+e.x,y:t.y},a={x:t.x+e.x,y:t.y+e.y};i.top&&r.push([o,a]),i.bottom&&r.push([n,h]),i.left&&r.push([n,o]),i.right&&r.push([h,a])},pf=(t,e,i)=>{const s=t.x,r=t.x+e.x,n=t.x+e.x/2,o=t.y+e.y,h=t.y,a=t.y+e.y/2;switch(i){case"left-center":return[u(s,a),-1,0];case"right-center":return[u(r,a),1,0];case"center":return[u(n,a),0,0];case"left-bottom":return[u(s,h),-1,-1];case"right-bottom":return[u(r,h),1,-1];case"center-bottom":return[u(n,h),0,-1];case"left-top":return[u(s,o),-1,1];case"right-top":return[u(r,o),1,1];case"center-top":return[u(n,o),0,1]}return be(0,`Unidentified DataGrid cell content alignment option: ${i}`)},xf={top:!1,bottom:!1,left:!1,right:!1};class Sf extends Js{constructor(t,e,i,s,r,n){super(t,{vr(){},Sr(){},Mr(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.hs=n,this.Ts=r,this.Rh=r.Dr(t.pB).Nh(this.ts.barChartCategoryAxisTitleFont||this.ts.xAxisTitleFont).ke(this.ts.barChartCategoryAxisTitleFillStyle||this.ts.xAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getWidth({x:0,y:-90})),this.Uh=this.hs.yg([this.Rh]).Ss(e.effectsText),this.mB=r.ze(t.pB).Ee(e.barChartCategoryAxisStrokeStyle||e.xAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.mB.Ee(t),this.chart.cs.vs(),this}getStrokeStyle(){return this.mB.cu()}Ds(){if(!this.ji)return{Tg:0,Fg:0,Od:Rt(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)};const t=this.mB.cu().O()/2,e=this.chart.Fs.getHeight(this.Rh.Ds().Zc());return{Tg:t,Fg:e,Od:t+e}}Fe(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.mB.Oe(this.chart.Fs.toPoint(r.start,n.start)).Ve(this.chart.Fs.toPoint(r.end,n.start)).setVisible(this.ji),this.Rh.Ie(this.chart.Fs.toPoint(.5*(r.start+r.end),this.chart.valueAxis.ft.mi(n.start,-(t.Tg+s.labelMarginBeforeCategoryAxisPixels)))).za(this.chart.Fs.toPoint(0,1)).setVisible(this.ji)}setMouseInteractions(t){return this}cr(t,e){return new qs(e,t,this.Ts,this.chart.pB)}dr(t,e){return{}}wr(t,e){return e}kr(t,e,i){return{min:t,max:e}}}class Af extends Js{constructor(t,e,i,s,r,n,o){super(t,{vr:()=>{var e;if(t.yB){if("positive"===t.SB||"bipolar"===t.SB){if("after-bar"===(null===(e=t.vB)||void 0===e?void 0:e.position)){const e=this.ft.ni();return this.ft.mi(t.yB.max,Math.min(this.chart.Fs.getHeight(this.chart.xB())+t.vB.labelMargin,.3*e))}return t.yB.max}return t.bB?Rt(-1,-1e-6,t.yB.max):0}},Sr:()=>{var e;if(t.yB){if("negative"===t.SB||"bipolar"===t.SB){if("after-bar"===(null===(e=t.vB)||void 0===e?void 0:e.position)){const e=this.ft.ni();return this.ft.mi(t.yB.min,-Math.min(this.chart.Fs.getHeight(this.chart.xB())+t.vB.labelMargin,.3*e))}return t.yB.min}return t.bB?Rt(1,1e-6,t.yB.min):0}},Mr:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.hs=n,this.Ts=r,this.Rh=r.Dr(t.pB).Nh(this.ts.barChartValueAxisTitleFont||this.ts.yAxisTitleFont).ke(this.ts.barChartValueAxisTitleFillStyle||this.ts.yAxisTitleFillStyle),this.setTitleRotation(this.chart.Fs.getHeight({x:0,y:-90})),this.Uh=this.hs.yg([this.Rh]).Ss(e.effectsText),this.mB=r.ze(t.pB).Ee(e.barChartValueAxisStrokeStyle||this.ts.yAxisStrokeStyle)}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.chart.cs.vs(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.mB.Ee(t),this.chart.cs.vs(),this}getStrokeStyle(){return this.mB.cu()}setTickStrategy(t,e){return super.Ih(t,e)}Ds(t){if(!this.ji)return this.Yh(),{Tg:0,Fg:0,Od:Rt(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)};const e=this.chart.Fs.getWidth(this.chart.pB).ni(),i=this.ft.ni();this.tr({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Qe.values())for(const e of t.values()){const t=e.xh.ur,i=this.chart.Fs.getWidth(e.Ye.Zc()),r=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,r)}const r=s+this.mB.cu().O()/2,n=this.chart.Fs.getWidth(this.Rh.Ds().Zc());return{Tg:r,Fg:n,Od:Rt(r+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Le)}}Fe(t){const e=this.getInterval();this.mB.Oe(this.chart.Fs.toPoint(-.5,this.Ph)).Ve(this.chart.Fs.toPoint(-.5,this.Dh)).setVisible(this.ji);const i="logarithmic"===this.Th.type?Math.sqrt(e.start+e.end):.5*(e.start+e.end),s=this.chart.Fs.toPoint(this.chart.categoryAxis.ft.mi(-.5,t.Tg*this.chart.Fs.MB),i),r=this.chart.Fs.toPoint(this.chart.Fs._B,0);this.Rh.Ie(s).za(r).setVisible(this.ji)}setMouseInteractions(t){return this}cr(t,e){return new qs(e,t,this.Ts,this.chart.pB)}dr(t,e){const i=t.xh.ur,s=this.chart.Fs.toPoint(-.5,t.S),r=this.chart.pB.mi(s,this.chart.Fs.toPoint(i.getTickLength()*this.chart.Fs.MB,0)),n=this.chart.pB.mi(s,this.chart.Fs.toPoint(i.gridStrokeLength*e.oppositeAxisSize*-this.chart.Fs.MB,0)),o=this.chart.pB.mi(r,this.chart.Fs.toPoint(i.getTickPadding()*this.chart.Fs.MB,0));t.Ye.Ie(o).za(this.chart.Fs.toPoint(this.chart.Fs._B,i.getLabelAlignment())).Gh(i.getLabelRotation()),i.tickStyle!==ot&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==ot&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}wr(t,e){return"linear"===this.Th.type?oh(t,e,this.ft):hh(t,e,this.ft)}kr(t,e,i){return{min:t,max:e}}}class vf extends Gl{constructor(t,e,i,s,r,n,o){super(t,e,i,s),this.Go=Ie(),this.S=0,this.wB=!1,this.chart=t,this.Ki=t,this.category=r,this.subCategory=n,this.Ms=r,this.be=fe(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,o),this.Me=fe(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,o),this.onVisibleStateChanged((()=>{this.Ki.CB()})),this.onDispose((()=>{this.Ki.CB(),this.Ki.kB.delete(this)}))}setValue(t){return this.wB=!0,this.S=t,this.Ki.CB(),this.Ki.cs.vs(),this.Ki.kB.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.Ki.CB(),this}getFillStyle(){return this.be}setStrokeStyle(t){return this.Me="function"==typeof t?t(this.Me):t,this.Ki.CB(),this}getStrokeStyle(){return this.Me}qy(){return this.iS}$c(t,e){return wa(t,this.Ki.engine.scale,this.Ki.Om(new la,this.category,this.S,this).Qu(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ki.setBarsEffect(t),this}}const bf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Mf=(t,e,i)=>{const s=t.Td.filter((t=>void 0!==t)),r=s.map((t=>i(t.sizePixels))).reduce(((t,e)=>Math.max(t,e)),1),n=Math.ceil(r/(e/s.length));return n<=1?s:s.filter(((t,e)=>e%n==0))};class Ef extends al{constructor(t,i,s,r,n,o,h){var a;let l;super(t,i,s,i.yp("barChart bg",0),r,i.cs.ts.barChartBackgroundFillStyle||i.cs.ts.chartXYBackgroundFillStyle,i.cs.ts.barChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.barChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.barChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.TB=wf.Descending,this.FB=this.ts.barChartCategoryLabels,this.vB=this.ts.barChartValueLabelsAfterBars,this.IB=!1,this.b_=Ce(),this.PB=new Map,this.kB=new Map,this.SB="positive",this.DB="columns",this.BB=!0,this.LB=new Map,this.RB={speed:1},this.xm={speed:1},this.EB=.08,this.Vm=e.AutoCursorModes.snapToClosest,this.Om=(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 r=[];return s.subCategory&&s.subCategory.length>0&&r.push(s.subCategory),r.push(this.valueAxis.formatValue(i)),t.addRow(...r),t},this.An=(t,e,i,s,r)=>{this.pB.tt(s,r)},this.cs.Gn(ah.af),this.Fs="horizontal"===(null==h?void 0:h.type)?kf:Tf,this.bp.Eh("Bar Chart"),this.zB=i.Um("barChart plotting 1",0),this.VB=i.Um("barChart plotting 2",1),this.bB="logarithmic"===(null===(a=null==h?void 0:h.valueAxis)||void 0===a?void 0:a.type),this.bB?"horizontal"===this.Fs.OB?(l=s.d1({scale1DConstructor:Di,dimension:"y"}),this.pB=(new Vi).Ei(s.d1({scale1DConstructor:Mi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:Di,dimension:"x"}),this.pB=(new Vi).Ei(l,s.d1({scale1DConstructor:Mi,dimension:"y"}))):(this.pB=s.d2({scaleXYConstructor:_i}),l=this.Fs.getWidth(this.pB)),this.NB=this.hs.yg(),this.__=new Ha((()=>this.b_.wt(this.zB.$x(this.pB).Ko(0))),((t,e,i)=>(t.ke(i.fillStyle).Ce(i.strokeStyle),e.map((e=>{const i=e.existingMember||t.Vr();return i.Sl(e.vertices),this.b_.Nt(i,e.bar),e.bar.ps([i]),i})))),(()=>{this.b_.Gt()}),(t=>{this.NB.As(t)})),this.IS=this.tp.Te(this.pB).ke(this.ts.barChartSeriesBackgroundFillStyle||z).Ce(ot),this.PS=this.tp.Te(this.pB).ke(z).Ce(this.ts.barChartSeriesBackgroundStrokeStyle||ot).setMouseInteractions(!1),super.FS(this.IS,this.PS),this.categoryAxis=new Sf(this,this.ts,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),l,this.VB,this.hs);const u=nh(null==h?void 0:h.valueAxis);this.valueAxis=new Af(this,this.ts,!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled),this.Fs.getHeight(this.pB),this.VB,this.hs,u.type),this.GB=new Xa((()=>this.VB.Dr(this.pB).Pr(Re).Ir(Re).Ko(1))),this.WB=new Ha((()=>this.tp.Rg(this.pB).setMouseInteractions(!1)),((t,e,i)=>(t.Ee(i.lineStyle),e.map((({positions:e,existingMember:i})=>(i||t.Vr()).zg(e[0],e[1])))))),this.Hm=i.$m();const c=Ft(h?h.autoCursorBuilder:void 0,va);this.Fp=c.am(this.Hm,this.uiScale,this.uiScale,this.ts),this.onResize(this.An),this.mp(n,this.pB),this.setAutoCursorMode(e.AutoCursorModes.onHover),this.setAnimationsEnabled(!0!==(null==h?void 0:h.disableAnimations)&&!1!==(null==h?void 0:h.animationsEnabled)),this.RS(((t,e)=>{ia.Pp(this,e)}))}getSeries(){return this.MS}setAutoCursor(t){return this.Fp&&t(this.Fp),this.cs.vs(),this}getAutoCursor(){return this.Fp}setAutoCursorMode(t){return this.Vm=t,this.cs.vs(),this}getAutoCursorMode(){return this.Vm}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}setBarsMargin(t){return this.EB=Rt(t,0,.49),this.IB=!0,this.cs.vs(),this}getBarsMargin(){return this.EB}setBarsEffect(t){return this.NB.Ss(t),this.cs.vs(),this}getBarsEffect(){return this.NB.xs()}setData(t){let e;if(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.UB("columns",e),this}setDataStacked(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.UB("stacks",i),this}setDataGrouped(t,e){const i=[];return e.forEach((e=>{const{subCategory:s,values:r}=e;r.forEach(((e,r)=>{const n=t[r];i.push({category:n,subCategory:s,value:e})}))})),this.UB("groups",i),this}UB(t,e){this.MS.length>0&&this.cs.Gn(ah.xf),this.DB=t,this.YB(e);const i=xe(e.map((t=>t.category))),s=i.length,r=xe(e.map((t=>t.subCategory))).filter((t=>void 0!==t));if(e.forEach((t=>{let e=this.MS.find((e=>e.category===t.category&&e.subCategory===t.subCategory));if(!e){const s=i.indexOf(t.category),n=r.includes(t.subCategory)?r.indexOf(t.subCategory):void 0;e=new vf(this,this.wS,this.ts,this.cs.hs,t.category,t.subCategory,Ft(n,s)),this.DS(e),this.LB.set(e,{category:s,valueStart:this.bB?1e-6:0,valueEnd:void 0!==t.value?t.value:0})}void 0!==t.value&&e.setValue(t.value)})),this.MS.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category&&e.subCategory===t.subCategory))&&(t.dispose(),this.LB.delete(t))})),this.categoryAxis.setInterval(this.Fs.getWidth({x:{start:-.5,end:s-.5},y:{start:s-.5,end:-.5}})),this.yB=0===this.MS.length?void 0:"stacks"!==t?this.MS.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Le,max:Pe}):{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.yB&&(this.SB=this.yB.min>=0?"positive":this.yB.max<=0?"negative":"bipolar",("bipolar"===this.SB||"negative"===this.SB)&&this.bB))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");this.YB(this.MS),this.PB.clear(),this.kB.clear(),this.IB=!0,this.cs.vs()}setCategoryLabels(t){const e="function"==typeof t?this.FB?t(this.FB):this.FB:t;return this.FB=e?{...this.ts.barChartCategoryLabels,...e}:void 0,this.PB.clear(),this.cs.vs(),this}getCategoryLabels(){return this.FB}setValueLabels(t){var e;const i="function"==typeof t?this.vB?t(this.vB):this.vB:t,s=(null==i?void 0:i.position)||(null===(e=this.vB)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.vB={...this.ts.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.vB={...this.ts.barChartValueLabelsInsideBars,...i}):this.vB=void 0,this.kB.clear(),this.cs.vs(),this}getValueLabels(){return this.vB}setLabelFittingEnabled(t){return this.BB=t,this.cs.vs(),this}getLabelFittingEnabled(){return this.BB}getBar(t,e){if(("groups"===this.DB||"stacks"===this.DB)&&void 0===e)throw new Error("LightningChart JS BarChart.getBar() | `subCategory` parameter is required for grouped and stacked bar charts!");const i=this.MS.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.MS}setSorting(t){return this.TB=t,this.YB(this.MS),this.cs.vs(),this}getSorting(){return this.TB}setAnimationCategoryPosition(t,e=1){return this.RB=t?{speed:e}:void 0,this.cs.vs(),this}setAnimationValues(t,e=1){return this.xm=t?{speed:e}:void 0,this.cs.vs(),this}translateCoordinate(t,e,i){if(i&&Ui(t)&&Oi(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Ni(t))r=this.cs.Do(t);else if(Ui(t)){const e=dt(t,this.pixelScale,this.cs.ft);r={engineX:e.x,engineY:e.y}}else{if(!bf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=dt(this.Fs.toPoint(t.iCategory,t.value),this.pB,this.cs.ft);r={engineX:e.x,engineY:e.y}}}if(zi(s))return this.cs.Bo(r);if("barChart"===s){const t=dt({x:r.engineX,y:r.engineY},this.cs.ft,this.pB);return{iCategory:this.Fs.getWidth(t),value:this.Fs.getHeight(t)}}if(Oi(s))return dt({x:r.engineX,y:r.engineY},this.cs.ft,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Qd(){if("columns"===this.DB)return this.MS;const t=xe(Se(this.MS.map((t=>t.subCategory))));return Se(t.map((t=>{const e=this.MS.filter((e=>e.subCategory===t)),i=e[0];if(i)return(t=>{let e=!1;t.forEach((i=>i.onHighlight(((s,r)=>{e||(e=!0,t.forEach((t=>i!==t?t.setHighlight(r):void 0)),e=!1)})))),t.forEach((e=>e.onDispose((()=>{const i=t.indexOf(e);i>=0&&t.splice(i,1)}))))})(e),{attach(s,r){return ve(s,e,{toggleVisibilityOnClick:!0,label:t,style:i.getFillStyle()}),this}}})))}Fe(t){var e,i;super.Fe(t);const s=this.GB.gy(),r=this.WB.gy(),n=this.MS.filter((t=>t.getVisible()&&t.wB)),o=xe(n.map((t=>t.category))),h=xe(Se(n.map((t=>t.subCategory)))),a=5e-4*t*((null===(e=this.RB)||void 0===e?void 0:e.speed)||0),l=.003*t*((null===(i=this.RB)||void 0===i?void 0:i.speed)||0),u=this.valueAxis.ft,c=u instanceof Di?(t,e)=>{var i;return oh(t,e,u,(null===(i=this.xm)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return hh(t,e,u,(null===(i=this.xm)||void 0===i?void 0:i.speed)||0)};let d;"columns"===this.DB?d=n.map((t=>({bar:t,position:{category:o.indexOf(t.category),valueStart:this.bB?1e-6:0,valueEnd:t.value}}))):"groups"===this.DB?d=n.map((t=>{const e=o.indexOf(t.category),i=h.indexOf(t.subCategory),s=1/(h.length+2*(h.length+1)*this.EB),r=this.EB*s;return{bar:t,position:{category:e+(i-(h.length-1)/2)*(s+r),valueStart:this.bB?1e-6:0,valueEnd:t.value}}})):(d=[],o.forEach(((t,e)=>{const i=n.filter((e=>e.category===t));let s=this.bB?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,r,n=this.LB.get(e);void 0===n&&(n=i);const o=i.valueStart;if(this.RB&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+a*t+l*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this.xm&&n.valueEnd!==i.valueEnd){const t=Math.sign(i.valueEnd-n.valueEnd);r=c(n.valueEnd,i.valueEnd),t!==Math.sign(i.valueEnd-r)&&(r=i.valueEnd)}else r=i.valueEnd;this.LB.set(e,{category:s,valueStart:o,valueEnd:r}),s===i.category&&r===i.valueEnd||this.cs.vs(!0),s===n.category&&r===n.valueEnd||(this.IB=!0)})),ta.kp(this.bp,this.Sp);const f=n.length>0;this.categoryAxis._r(),this.valueAxis._r();const g=this.categoryAxis.setVisible(f).Ds(),m=this.valueAxis.setVisible(f).Ds(r),{labelMarginBeforeCategoryAxisPixels:y}=f?this.HB(o,n,s,r):{labelMarginBeforeCategoryAxisPixels:0};this.categoryAxis.Fe(g,s,r,{labelMarginBeforeCategoryAxisPixels:y}),this.valueAxis.Fe(m);const p=this.categoryAxis.getThickness(),x=Rt(g.Od+y,void 0!==p.min?p.min:0,void 0!==p.max?p.max:Le),S={x:Math.min(this.pB.x.getInnerStart(),this.pB.x.getInnerEnd()),y:Math.min(this.pB.y.getInnerStart(),this.pB.y.getInnerEnd())},A=Math.max(this.pB.x.getInnerStart(),this.pB.x.getInnerEnd()),v=Math.max(this.pB.y.getInnerStart(),this.pB.y.getInnerEnd()),b={x:A-S.x,y:v-S.y};this.IS.Ie(S),this.IS.tt(b),this.PS.Ie(S),this.PS.tt(b),super.pp(),ia.Tp(this,this.IS.getIsUnderMouse(),!1,this.MS,void 0,((t,e)=>t.$c(e,!0)));const M=ta.Cp(this.bp,this.Sp);if(this.pB.Vi([this.jt.bottom+this.ya.bottom+("vertical"===this.Fs.OB?x:0),this.jt.top+this.ya.top+M+("horizontal"===this.Fs.OB?m.Od:0)]),this.pB.zi([this.jt.left+this.ya.left+this.Fs.getHeight({x,y:m.Od}),this.jt.right+this.ya.right]),this.zB.tx({x:this.pB.x.hi(),y:this.pB.y.hi(),width:this.pB.x.ni(),height:this.pB.y.ni()}),this.Qg&&this.Qg(),this.IB){const t=this.__.gy(),e="groups"===this.DB?1/(h.length+2*(h.length+1)*this.EB):1-2*this.EB;n.forEach((i=>{const s=this.LB.get(i);if(void 0===s)return;const r=s.category-.5*e,n=s.category+.5*e,o=[this.Fs.toPoint(r,s.valueStart),this.Fs.toPoint(r,s.valueEnd),this.Fs.toPoint(n,s.valueEnd),this.Fs.toPoint(n,s.valueStart)];t.add({Go:i.Go,vertices:o,bar:i},{fillStyle:i.be,strokeStyle:i.Me})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.IB=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(t),this.setAnimationValues(t),this.valueAxis.setAnimationsEnabled(t),this.categoryAxis.setAnimationsEnabled(t),this}solveNearest(t){}dispose(){return this.VB.U(),this.zB.U(),this.Fp.dispose(),this.Hm.U(),super.dispose()}YB(t){const e=this.TB;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)})))}HB(t,e,i,s){let r=0;const n=this.FB,o=this.vB,h=this.valueAxis.getInterval(),a=this.Fs.getWidth({x:this.pB.x.ni(),y:this.pB.y.ni()});if(n&&n.labelFillStyle!==z){const o=n.tickLength+n.labelMargin,l=this.Fs.toPoint(0,1),u={Td:t.map(((t,i)=>{const s=e.reduce(((e,i)=>i.category!==t?e:e+i.value),0),r=n.formatter(t,s);if(!r)return;const a=i;return void 0!==a?{text:r,position:this.Fs.toPoint(a,this.valueAxis.ft.mi(h.start,-o)),alignment:l,rotation:n.labelRotation,sizePixels:this.$B(t,s)}:void 0})),Gu:n.labelFont,ft:this.pB},c=u?this.BB?Mf(u,a,this.Fs.getWidth):u.Td:[];c.forEach((t=>{t&&i.add().Eh(t.text).Ie(t.position).za(t.alignment).Gh(t.rotation).ke(n.labelFillStyle).Nh(n.labelFont)})),n.tickStyle!==ot&&0!==n.tickLength&&c.forEach((t=>{if(!t)return;const e=this.Fs.getWidth(t.position);s.add({positions:[this.Fs.toPoint(e,this.valueAxis.ft.getInnerStart()),this.Fs.toPoint(e,this.valueAxis.ft.mi(h.start,-n.tickLength))]},{lineStyle:n.tickStyle})})),r=c.reduce(((t,e)=>e?Math.max(t,this.Fs.getHeight(e.sizePixels)):t),0)+n.tickLength+n.labelMargin}if(o&&o.labelFillStyle!==z){let t;"after-bar"===o.position?t={Td:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.LB.get(t);return void 0!==s?{text:i,position:this.Fs.toPoint(s.category,this.valueAxis.ft.mi(s.valueEnd,o.labelMargin*Math.sign(s.valueEnd))),alignment:this.Fs.toPoint(0,-1*Math.sign(s.valueEnd)),rotation:o.labelRotation,sizePixels:this.XB(t)}:void 0})),Gu:o.labelFont,ft:this.pB}:"inside-bar"!==o.position&&"inside-bar-start"!==o.position&&"inside-bar-centered"!==o.position&&"inside-bar-end"!==o.position||(t={Td:e.map(((t,e)=>{const i=o.formatter(t,t.category,t.value);if(!i)return;const s=this.LB.get(t);if(void 0===s)return;const r="bipolar"===this.SB?Math.sign(s.valueEnd):"negative"===this.SB?-1:1,n=this.Fs.toPoint(0,"inside-bar"===o.position||"inside-bar-end"===o.position?1*r:"inside-bar-centered"===o.position?0:-1*r);return{text:i,position:this.Fs.toPoint(s.category,"inside-bar"===o.position||"inside-bar-end"===o.position?this.valueAxis.ft.mi(s.valueEnd,-o.labelMargin*r):"inside-bar-centered"===o.position?(s.valueStart+s.valueEnd)/2:this.valueAxis.ft.mi(s.valueStart,o.labelMargin*r)),alignment:n,rotation:o.labelRotation,sizePixels:this.XB(t)}})),Gu:o.labelFont,ft:this.pB}),t&&(t?this.BB?Mf(t,a,this.Fs.getWidth):t.Td:[]).forEach((t=>{t&&i.add().Eh(t.text).Ie(t.position).za(t.alignment).Gh(t.rotation).ke(o.labelFillStyle).Nh(o.labelFont).setMouseInteractions(!1)}))}return{labelMarginBeforeCategoryAxisPixels:r}}$B(t,e){if(!this.FB||this.FB.labelFillStyle===z)return{x:0,y:0};const i=this.PB.get(t);if(i)return i;const s=this.FB.formatter(t,e),r=this.cs.Pg.Ig(s,this.FB.labelFont,this.FB.labelRotation);return r.isEstimate?this.cs.vs(!0):this.PB.set(t,r),r}XB(t){if(!this.vB||this.vB.labelFillStyle===z)return{x:0,y:0};const e=this.kB.get(t);if(e)return e;const i=this.cs.Pg.Ig(this.vB.formatter(t,t.category,t.value),this.vB.labelFont,this.vB.labelRotation);return i.isEstimate?this.cs.vs(!0):this.kB.set(t,i),i}xB(){return this.MS.reduce(((t,e)=>{const i=this.XB(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}CB(){this.IB=!0,this.cs.vs()}getMinimumSize(){return{x:200,y:200}}}const wf={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)},Tf={...ch,OB:"vertical",MB:-1,_B:1},kf={...dh,OB:"horizontal",MB:1,_B:-1},Cf=(t,e)=>e?t.x:t.y,Rf=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),If=(t,e,i,s,r,n)=>{const o=e.length,h=Math.sign(s),a=[],l=e.reduce(((t,e)=>t+e));for(let t=1;t<=o-1;t+=1)a.push(Cf(r,n)*e.slice(0,t).reduce(((t,e)=>t+e),0)/l);const u=a.map((t=>0));let c=a[i-1]+s;for(let e=i;e>0&&eRf(t,h,n,e))).reduce(((t,e)=>Math.max(t,Cf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>Cf(r,n)-s||-1===h&&c<0+s){u.fill(0);break}if(e!==i&&(1===h?o>c:oa[e]+t)),f=d.map(((t,e)=>(t-(e>0?d[e-1]:0))/Cf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Ff{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.Xi=!1,this.EP=new Array,this.L=new r.Eventer,this.jB=[],this.Xg=[],this.ZB=void 0,this.QB=!0,this.JB=!0,this.KB=!0,this.Jg=!1,this.qB=!0,this.tL=()=>{this.qB=!0,this.cs.vs()},this.iL=[],this.onInViewChange=t=>this.L.on("inViewChange",t),this.offInViewChange=t=>this.L.off(t,"inViewChange"),this.sL=t=>{for(let e=0;e{const e=this.jB.indexOf(t);e>=0&&this.jB.splice(e,1)},this.sp=t=>{const e=this.Xg.indexOf(t);e>=0&&this.Xg.splice(e,1)},this.hL=(t,e,i,s,r)=>{if(this.rL(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.EP.push(n),this.nL(n),this.QB=!0,t}throw new mt("Out of dashboard range.")},this.oL=e.numberOfRows,this.aL=e.numberOfColumns,this.dA=t,this.lL=e,this.uL=s;const o=this.aL*this.oL;this.cL={x:new Yd(new Array(this.aL).fill(1)),y:new Yd(new Array(this.oL).fill(1))},this.ts=i.ts,this.dL=this.ts.dashboardSplitterStyle,this.ih=!0!==(null==e?void 0:e.disableAnimations)&&!1!==(null==e?void 0:e.animationsEnabled),this.fL=Gd(i,o),this.AL=i.II("dashboard splitters",500001),this.NM=()=>this.fL.FI(),this.ap=this.fL.DI(),this.hs=i.hs.rs(this,{gL:{}}),this.hs.gL.Ss(this.ts.effectsDashboardSplitters);const h=i.ai();this.uiScale=ut.d2({scaleXYConstructor:_i}).Oi(0,100).Ni(0,100).tt(h),this.pixelScale=ut.d2({scaleXYConstructor:_i}).Oi(0,this.uiScale.x.getCellSize()).Ni(0,this.uiScale.y.getCellSize()).tt(h),this.pL=i.mL.bind(i),this.yL=i.SL.bind(i),this.vL=i.xL.bind(i),this.bL=i.ML.bind(i),this.ho=i.ho.bind(i),this.no=i.no.bind(i),this.engine=i.hp,this.cs=i.rp,i.ko((()=>this.tL())),i.vs();const a=i.Io((t=>{this.Jg=t,this.L.emit("inViewChange",this,t)}));this.fp=i.Po.bind(i,a),this._L(),this.setAnimationsEnabled(this.ih);const l=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.L);this.createChartXY=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Vc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Ud(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Zc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:Oa;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:yd;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Df(t,this.lL,this.ih),i=e&&e.type?e.type:nd;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Df(t,this.lL,this.ih),i=t&&t.type?t.type:Ed;return this.hL(new i(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Jh(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new vl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Uc(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Df(t,this.lL,this.ih);return this.hL(new Rl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,e,l),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Df(t,this.lL,this.ih),i=new Sl(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Df(t,this.lL,this.ih),i=new ff(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Df(t,this.lL,this.ih),i=new Ef(this.dA,this.fL.BI(this.wL(t.columnIndex,t.rowIndex)),this.CL(e,this.cL),this.sL,n,l,e);return this.hL(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}wL(t,e){return t+e*this.aL}CL(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.aL:this.oL,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).ut({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.aL,y:this.oL},e),d3:()=>new at({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.aL,y:this.oL},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.pL(t[0]),this.yL(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.vL(t[0]),this.bL(t[1]),this}getWidth(){return this.ho()}getHeight(){return this.no()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.AL.vs(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.AL.vs(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.ts}setSplitterStyle(t){const e=this.dL;return this.dL="function"==typeof t?t(this.dL):t,this.kL(e),this}getSplitterStyle(){return this.dL}setSplitterEffect(t){return this.hs.gL.Ss(t),this.cs.vs(),this}getSplitterEffect(){return this.hs.gL.xs()}setAnimationHighlight(t){return this.KB=t,this.iL.forEach((e=>this.cs.us.ws(e.line,t))),this}getAnimationHighlight(){return this.KB}kL(t){for(const t of this.iL)t.line.Ee(this.dL);this._L()}setColumnWidth(t,e){const i=this.cL.x._();return t>=0&&t=e.length)throw new mt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.cL.y._();return t>=0&&t=e.length)throw new mt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.L.on("resize",t)}offResize(t){return this.L.off(t,"resize")}TL(t,e,i){if(i&&Math.abs(t.x)>0)this.FL(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.IL(e,t.y)}for(const t of this.EP)t.panel.J();this.tL()}IL(t,e){const i=If(this.EP,this.cL.y._(),t,e,this.pixelScale.ai(),!1);this.cL.y.M(i),this.tL()}FL(t,e){const i=If(this.EP,this.cL.x._(),t,e,this.pixelScale.ai(),!0);this.cL.x.M(i),this.tL()}PL(){this.iL.forEach((t=>t.line.dispose())),this.iL.length=0;for(let t=1;t<=this.aL-1;t+=1)for(let e=0;e<=this.oL-1;e+=1)if(void 0!==this.EP.find((i=>He(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Wi(new $i((()=>{this.DL(t)}),((e,i,s,r,n)=>{this.TL(r,t,!0),Zt(n)}),(()=>{this.BL(t)}))),s=this.AL.ze(this.pixelScale).Ee(this.dL).setMouseEnterEventHandler((()=>{this.DL(t)})).setMouseLeaveEventHandler((()=>{this.BL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.TL(n,t,!0),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.KB}),this.iL.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.oL-1;t+=1)for(let e=0;e<=this.aL-1;e+=1)if(void 0!==this.EP.find((i=>He(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Wi(new $i((()=>{this.LL(t)}),((e,i,s,r,n)=>{this.TL(r,t,!1),Zt(n)}),(()=>{this.RL(t)}))),s=this.AL.ze(this.pixelScale).Ee(this.dL).setMouseEnterEventHandler((()=>{this.LL(t)})).setMouseLeaveEventHandler((()=>{this.RL(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.TL(n,t,!1),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.cs.us.ls(s,(t=>s.ds(t)),{animationEnabled:this.KB}),this.iL.push({row:t,column:e,line:s,alignment:"horizontal"})}this.hs.gL.As(this.iL.map((t=>t.line)))}EL(){const t=this.pixelScale.ai(),e=this.cL.x._(),i=e.reduce(((t,e)=>t+e)),s=this.cL.y._(),r=s.reduce(((t,e)=>t+e));this.iL.forEach((n=>{if("vertical"===n.alignment){const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(o.x,t.y*s.slice(0,n.row+1).reduce(((t,e)=>t+e),0)/r);n.line.Oe(o).Ve(h)}else{const o=u(t.x*e.slice(0,n.column).reduce(((t,e)=>t+e),0)/i,t.y*s.slice(0,n.row).reduce(((t,e)=>t+e),0)/r),h=u(t.x*e.slice(0,n.column+1).reduce(((t,e)=>t+e),0)/i,o.y);n.line.Oe(o).Ve(h)}}))}DL(t){this.iL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.cs.us._s(e.line,1),this.AL.zL(e.line))})),this.ZB=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.cs.vs()}LL(t){this.iL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.cs.us._s(e.line,1),this.AL.zL(e.line))})),this.ZB=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.cs.vs()}BL(t){this.iL.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.cs.us._s(e.line,0)})),this.engine.restoreMouseStyle(this.ZB),this.cs.vs()}RL(t){this.iL.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.cs.us._s(e.line,0)})),this.engine.restoreMouseStyle(this.ZB),this.cs.vs()}setAnimationsEnabled(t){return this.ih=t,this.getCells().filter((t=>t.panel instanceof Qh)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.ih),this}getAnimationsEnabled(){return this.ih}getCells(){return this.EP.slice()}dispose(){return this.Xi||(this.fp&&this.fp(),this.EP.slice().forEach((t=>t.panel.dispose())),this.jB.slice().forEach((t=>t.dispose())),this.Xg.slice().forEach((t=>t.dispose())),this.Xi=!0,this.uL(),this.L.emit("dispose",this)),this}isDisposed(){return this.Xi}onDispose(t){return this.L.on("dispose",t)}offDispose(t){return this.L.off(t,"dispose")}getIsInView(){return this.Jg}saveToFile(t,e,i){return Xh(this.engine,t,e,i),this}VL(t){if(this.qB){const t=this.cs.ft.ai(),e=t.x,i=t.y;this.uiScale.tt(e,i),this.pixelScale.tt(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.Oi(0,s.x).Ni(0,s.y),this.L.emit("resize",this,s.x,s.y,e,i),this.JB=!0}this.QB&&(this.PL(),this.QB=!1,this.JB=!0),this.JB&&(this.EL(),this.JB=!1);for(const e of this.EP)e.panel.Fe(t);return this.jB.forEach((t=>t.Ds())),this.jB.forEach((t=>t.Fe())),this.Xg.forEach((t=>t.Ds())),this.Xg.forEach((t=>t.Fe())),this.qB=!1,this}Z(){for(const t of this.EP)t.panel.Z();return this.pixelScale.x.Z(),this.pixelScale.y.Z(),this.uiScale.x.Z(),this.uiScale.y.Z(),this}J(){for(const t of this.EP)t.panel.J();return this.pixelScale.x.J(),this.pixelScale.y.J(),this.uiScale.x.J(),this.uiScale.y.J(),this}translateCoordinate(t,e,i){return $h(t,e,i,this.pixelScale,this.cs)}addUIElement(t=Vo,e=this.uiScale){e=jh(e,this.pixelScale);const i=Wh(t,this.NM(),this.uiScale,e,this.eL,this.ts);return this.jB.push(i),i}addLegendBox(t=$o,i=this.uiScale){i=jh(i,this.pixelScale);const s=Wh(t,this.ap,this.uiScale,i,this.sp,this.ts);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Xg.push(s),s}getLegendBoxes(){return this.Xg}rL(t,e,i,s){return e>=0&&t>=0&&e+s<=this.oL&&t+i<=this.aL}nL(t){const e=this.dL,i=e===ot?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Ir(s)}_L(){this.uiScale.x.ei([0,0]),this.uiScale.y.ei([0,0]),this.pixelScale.x.ei([0,0]),this.pixelScale.y.ei([0,0]);for(const t of this.EP)this.nL(t);this.cs.vs()}}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 r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Lf={None:In,Rectangle:mo,Circle:yo,Diamond:po,Pointer:xo},Pf={ChartMarkerXY:au,SeriesMarkerXY:lu},_f={XY:hu,Spider:Aa,BarChart:va,Map:Ea,Polar:Aa},Vf={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"}},Bf={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"}},zf={"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"}},Nf={"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"}},Of={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"}},Uf={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"}},Gf={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"}},Yf={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"}},Hf={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"}},Xf={World:Uf,USA:Gf,NorthAmerica:Yf,SouthAmerica:Hf,Canada:Nf,Europe:Of,Asia:Bf,Africa:Vf,Australia:zf},Wf={Solid:yd},jf=(t,e)=>Math.abs(t)+Math.abs(e);function $f(t,e){const i=t.reduce(jf,0),s=(r=t,Math.max(...r.map((t=>t))));var r;const n=(t=>Math.min(...t.map((t=>t))))(t);return Math.max(e**2*s/i**2,i**2/(e**2*n))}const Zf=({height:t,width:e})=>t>e?{value:e,vertical:!1}:{value:t,vertical:!0},Kf=({data:t,dimensions:e})=>{const{x:i,y:s,width:r,height:n}=e,o=t.map((t=>t.value)).reduce(jf,0),h=t.map((t=>t.animatedValue)).reduce(jf,0),a=t.map((t=>t.animatedValue*n*r/h)),l=a.reduce(((t,e)=>t+e),0),u=a.map((t=>t/l*100)),c=a.filter(((t,e)=>u[e])),d={children:[],id:0,parentID:-1,name:"Main Rectangle",value:o,animatedValue:h,x:i,y:s,width:r,height:n,nodeIndex:-1,userNode:{name:"Main Rectangle"}};if(1===t.length){const i={...t[0],x:e.x,y:e.y,width:e.width,height:e.height};d.children.push(i)}else qf(c,Zf(d).value,t,d);return d.children},Jf=(t,e,i,s,r)=>{const n=t.reduce(jf,0)/e;t.forEach(((t,e)=>{const o=Math.abs(t)/n,{x:h,y:a,children:l}=r,u={...s[l.length],x:h,y:a,width:i?n:o,height:i?o:n};i?r.y+=o:r.x+=o,l.push(u)})),i?(r.x+=n,r.y-=e,r.width-=n):(r.x-=e,r.y+=n,r.height-=n)},qf=(t,e,i,s)=>{const r=[{children:t,width:e,row:[]}];for(;r.length>0;){const t=r.pop();if(!t)continue;const{children:e,width:n,row:o}=t;let h=0;const a=[...o];for(;hl)){Jf(a,n,Zf(s).vertical,i,s),r.push({children:e.slice(h),width:Zf(s).value,row:[]});break}a.push(e[h]),h+=1}h===e.length&&Jf(a,n,Zf(s).vertical,i,s)}};class Qf extends Qh{constructor(t,i,s,r,n,o,h){if(super(t,i,s,i.yp("treeMapChart bg",0),r,i.cs.ts.treeMapChartBackgroundFillStyle||i.cs.ts.chartXYSeriesBackgroundFillStyle,i.cs.ts.treeMapChartBackgroundStrokeStyle||i.cs.ts.chartXYBackgroundStrokeStyle,i.cs.ts.treeMapChartTitleFont||i.cs.ts.chartXYTitleFont,i.cs.ts.treeMapChartTitleFillStyle||i.cs.ts.chartXYTitleFillStyle,h),this.OL=new Map,this.NL=[],this.GL={},this.WL=p([]),this.xm={speed:1},this.UL=Le,this.YL=!0,this.HL="Go Back",this.$L=[],this.XL=this.ts.treeMapChartPathLabelFillStyle||this.ts.uiTextFillStyle,this.jL=this.ts.treeMapChartPathLabelFont||this.ts.uiTextFont,this.ZL=this.ts.treeMapChartLabelHeaderFillStyle||this.ts.uiTextFillStyle,this.QL=this.ts.treeMapChartLabelHeaderFont||this.ts.uiTextFont,this.JL=this.ts.treeMapChartLabelFillStyle||this.ts.uiTextFillStyle,this.KL=this.ts.treeMapChartLabelFont||this.ts.uiTextFont,this.Hi=!0,this.Tx=e.AutoCursorModes.onHover,this.Om=tg,this.Ix=!0,this.qL=!1,this.tR=this.ts.treeMapChartParentColor||I,this.iR=this.ts.treeMapChartNodeStrokeStyle||this.ts.uiBackgroundStrokeStyle,this.onNodeMouseEnter=t=>this.L.on("mouseEnter",t),this.onNodeMouseLeave=t=>this.L.on("mouseLeave",t),this.onNodeMouseClick=t=>this.L.on("mouseClick",t),this.onNodeMouseDoubleClick=t=>this.L.on("mouseDoubleClick",t),this.onNodeMouseDown=t=>this.L.on("mouseDown",t),this.onNodeMouseUp=t=>this.L.on("mouseUp",t),this.onNodeMouseMove=t=>this.L.on("mouseMove",t),this.offNodeMouseEnter=t=>this.L.off(t,"mouseEnter"),this.offNodeMouseLeave=t=>this.L.off(t,"mouseLeave"),this.offNodeMouseClick=t=>this.L.off(t,"mouseClick"),this.offNodeMouseDoubleClick=t=>this.L.off(t,"mouseDoubleClick"),this.offNodeMouseDown=t=>this.L.off(t,"mouseDown"),this.offNodeMouseUp=t=>this.L.off(t,"mouseUp"),this.offNodeMouseMove=t=>this.L.off(t,"mouseMove"),this.offNodeMouseDragStart=t=>this.L.off(t,"mouseDragStart"),this.offNodeMouseDrag=t=>this.L.off(t,"mouseDrag"),this.offNodeMouseDragStop=t=>this.L.off(t,"mouseDragStop"),this.offNodeMouseWheel=t=>this.L.off(t,"mouseWheel"),this.Bx=(t,e,i,s,r)=>{this.cs.vs(),this.qL=!0},this.Ct=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s,Zt(t)),this.Ix&&this.cs.us._s(i,!0),this.YL&&this.engine.setMouseStyle(e.MouseStyles.Point),this.L.emit("mouseEnter",this,t,s.userNode),this.cs.vs())},this.kt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=void 0,t&&Zt(t)),this.Ix&&this.cs.us._s(i,!1),this.engine.setMouseStyle(e.MouseStyles.Default),this.L.emit("mouseLeave",this,t,s.userNode),this.cs.vs())},this.Dt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s,Zt(t)),this.Ix&&this.cs.us._s(i,!0),this.YL&&this.engine.setMouseStyle(e.MouseStyles.Point),this.L.emit("mouseEnter",this,t,s.userNode),this.cs.vs())},this.Tt=(t,e)=>{const i=this.sR(e);if(i){if(this.YL){const e=(null==i?void 0:i.children.length)?i:i.parentID?this.GL[i.parentID]:void 0;e&&(this.WL.M([e]),this.Kx=void 0,this.L.emit("viewChange",this.WL._()),this.qL=!0),t&&Zt(t)}this.L.emit("mouseClick",this,t,i.userNode),this.cs.vs()}},this.Ft=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseDoubleClick",this,t,s)},this.It=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseDown",this,t,s)},this.Pt=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseUp",this,t,s)},this.Lt=(t,e,i)=>{var s;const r=null===(s=this.OL.get(i))||void 0===s?void 0:s.userNode;this.L.emit("mouseDragStart",this,t,e,r)},this.Bt=(t,e,i,s,r)=>{var n;const o=null===(n=this.OL.get(r))||void 0===n?void 0:n.userNode;this.L.emit("mouseDrag",this,t,e,i,s,o)},this.Rt=(t,e,i,s)=>{var r;const n=null===(r=this.OL.get(s))||void 0===r?void 0:r.userNode;this.L.emit("mouseDragStop",this,t,e,i,n)},this.Et=(t,e)=>{var i;const s=null===(i=this.OL.get(e))||void 0===i?void 0:i.userNode;this.L.emit("mouseWheel",this,t,s)},this.zt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s),this.Ix&&this.cs.us._s(i,!0),this.L.emit("touchStart",this,t,s.userNode),this.cs.vs(),Zt(t))},this.Vt=(t,i)=>{const s=this.sR(i);s&&(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=s),this.Ix&&this.cs.us._s(i,!0),this.L.emit("touchMove",this,t,s.userNode),this.cs.vs(),Zt(t))},this.Ot=(t,i)=>{const s=this.sR(i);if(s){if(this.Tx!==e.AutoCursorModes.disabled&&(this.Kx=void 0),this.YL){const e=(null==s?void 0:s.children.length)?s:s.parentID?this.GL[s.parentID]:void 0;e&&(this.WL.M([e]),this.L.emit("viewChange",this.WL._()),this.qL=!0),t&&Zt(t)}this.Ix&&this.cs.us._s(i,!1),this.L.emit("touchEnd",this,t,s.userNode),this.cs.vs(),Zt(t)}},this.eR=t=>{const e=this.GL[this.$L[t].id]?[this.GL[this.$L[t].id]]:this.NL;this.WL.M(e),this.L.emit("viewChange",e),this.qL=!0,this.cs.vs()},this.ts.treeMapChartNodeColors)this.hR=this.ts.treeMapChartNodeColors;else{const t=this.ts.pointSeriesFillStyle,e=t=>Y(t)?t.getColor():I;this.hR="function"==typeof t?new Array(5).fill(0).map(((i,s)=>e(t(s)))):[e(t)]}this.cs.Gn(ah._f),this.Wm=i.Ax("TreeMapChart plotting",0),this.Ym=i.Ax("TreeMap UI plotting",1),this.onResize(this.Bx),this.bp.Eh("TreeMap Chart");const a=Ft(void 0,Ea);this.Ux=a.lm(i.$m(),this.pixelScale,this.pixelScale,this.ts).setVisible(!1),this.rR=this.hs.yg(),this.mp(n,this.uiScale),this.Hx=this.Wm.$x(this.pixelScale).ke(new H).Ce(this.iR),this.nR=this.cs.us.zr(this,{animationEnabled:!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled)}),this.oR=new Xa((()=>this.Ym.Dr(this.pixelScale).setMouseInteractions(!1))),this.aR=new Xa((()=>this.Ym.Dr(this.uiScale))),this.Hx.setMouseInteractions(this.Hi).setMouseEnterEventHandler(((t,e,i)=>this.Ct(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.kt(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Tt(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ft(e,i))).setMouseDownEventHandler(((t,e,i)=>this.It(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Pt(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.Dt(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Lt(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Bt(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.Rt(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.Et(e,i))).setTouchStartEventHandler(((t,e,i)=>this.zt(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Vt(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Ot(e,i))),this.setAnimationsEnabled(!0!==(null==o?void 0:o.disableAnimations)&&!1!==(null==o?void 0:o.animationsEnabled))}setData(t){t=Array.isArray(t)?t.slice():[t];const{lR:e}=(()=>{let t=0;return{lR:e=>{var i;const s=e.map(((t,e)=>({node:t,parent:null}))),r=[];for(;s.length>0;){const e=s.pop();if(!e)continue;const{node:n,parent:o}=e;t+=1;const h={id:t,parentID:null==o?void 0:o.id,name:n.name,value:n.value||0,animatedValue:n.value||0,children:[],nodeIndex:o?o.nodeIndex:-1,userNode:n};o?o.children.push(h):r.push(h),null===(i=n.children)||void 0===i||i.forEach((t=>{s.push({node:t,parent:h})}))}const n=t=>{t.children.forEach(n),t.children.length>0&&(t.value+=t.children.reduce(((t,e)=>t+e.value),0),t.animatedValue+=t.children.reduce(((t,e)=>t+e.animatedValue),0),t.children.sort(((t,e)=>e.animatedValue-t.animatedValue)))};r.forEach(n);const o=1===e.length?r[0].children:r;return o.sort(((t,e)=>e.animatedValue-t.animatedValue)),o.forEach(((t,e)=>{t.nodeIndex=e;const i=e=>{e.children.forEach((e=>{e.nodeIndex=t.nodeIndex,i(e)}))};i(t)})),r}}})(),i=e(t);return i.forEach((t=>{const e=this.GL[t.id];e&&this.uR(t,e)})),this.Kx=void 0,this.WL.M(i),this.NL=i,this.GL=this.cR(i),this.qL=!0,this.cs.vs(),this}setAnimationValues(t,e=1){return this.xm=t?{speed:e}:void 0,this.cs.vs(),this}setInitPathButtonText(t){return this.HL=t,this.qL=!0,this.cs.vs(),this}setDisplayedLevelsCount(t){return this.UL=t,this.qL=!0,this.cs.vs(),this}setDrillDownEnabled(t){return this.YL=t,this.qL=!0,this.cs.vs(),this}setDrillDownNode(t){var e,i;if(this.Kx=void 0,void 0===t)this.WL.M(this.NL);else{const s=[...this.NL];for(;s.length>0;){const r=s.pop();if(r){if(void 0!==r.value&&r.userNode===t||r.parentID&&Array.isArray(t)&&(null===(i=null===(e=this.GL[r.parentID])||void 0===e?void 0:e.userNode)||void 0===i?void 0:i.children)===t){const t=r.children.length?r:r.parentID?this.GL[r.parentID]:this.NL[0];this.WL.M([t]);break}if(r.children)for(let t=r.children.length-1;t>=0;t-=1)s.push(r.children[t])}}}return this.L.emit("viewChange",this.WL._()),this.qL=!0,this.cs.vs(),this}setNodeColoring(t){return t instanceof Array?(this.Hx.ke(new H),this.hR=t):this.Hx.ke(t),this.qL=!0,this.cs.vs(),this}setParentNodeColor(t){return this.tR=t,this.qL=!0,this.cs.vs(),this}setPathLabelFillStyle(t){return this.XL="function"==typeof t?t(this.XL):t,this.qL=!0,this.cs.vs(),this}getPathLabelFillStyle(){return this.XL}setPathLabelFont(t){return nr(t)?this.jL=t:this.jL=t(this.jL),this.qL=!0,this.cs.vs(),this}getPathLabelFont(){return this.jL}setHeaderFont(t){return nr(t)?this.QL=t:this.QL=t(this.QL),this.qL=!0,this.cs.vs(),this}getHeaderFont(){return this.QL}setHeaderFillStyle(t){return this.ZL="function"==typeof t?t(this.ZL):t,this.qL=!0,this.cs.vs(),this}getHeaderFillStyle(){return this.ZL}setLabelFont(t){return nr(t)?this.KL=t:this.KL=t(this.KL),this.qL=!0,this.cs.vs(),this}getLabelFont(){return this.KL}setLabelFillStyle(t){return this.JL="function"==typeof t?t(this.JL):t,this.qL=!0,this.cs.vs(),this}getLabelFillStyle(){return this.JL}setNodeBorderStyle(t){return this.Hx.Ce(t),this.qL=!0,this.cs.vs(),this}getNodeBorderStyle(){return this.Hx.lo()}setNodeEffect(t){return this.rR.Ss(t),this.cs.vs(),this}getNodeEffect(){return this.rR.xs()}setAutoCursor(t){return this.Ux&&t(this.Ux),this.cs.vs(),this}getAutoCursor(){return this.Ux}setAutoCursorMode(t){return this.Tx=t,this.cs.vs(),this}getAutoCursorMode(){return this.Tx}setCursorResultTableFormatter(t){return this.Om=t,this.cs.vs(),this}getCursorResultTableFormatter(){return this.Om}onNodeMouseDragStart(t){return this.L.on("mouseDragStart",t)}onNodeMouseDrag(t){return this.L.on("mouseDrag",t)}onNodeMouseDragStop(t){return this.L.on("mouseDragStop",t)}onNodeMouseWheel(t){return this.L.on("mouseWheel",t)}onNodeTouchStart(t){return this.L.on("touchStart",t)}onNodeTouchMove(t){return this.L.on("touchMove",t)}onNodeTouchEnd(t){return this.L.on("touchEnd",t)}onViewChange(t){return this.L.on("viewChange",t)}offNodeTouchStart(t){return this.L.off(t,"touchStart")}offNodeTouchMove(t){return this.L.off(t,"touchMove")}offNodeTouchEnd(t){return this.L.off(t,"touchEnd")}offViewChange(t){return this.L.off(t,"viewChange")}setMouseInteractions(t){return this.Hi=t,this.Hx.setMouseInteractions(t),this}getMouseInteractions(){return this.Hi}setAnimationHighlight(t){return this.nR.Nr(t),this}getAnimationHighlight(){return this.nR.Gr()}setHighlightOnHover(t){return this.Ix=t,this}getHighlightOnHover(){return this.Ix}getMinimumSize(){}Qd(){return[this]}Fe(t){super.Fe(t),super.pp(),ta.kp(this.bp,this.Sp);const i=ta.Cp(this.bp,this.Sp);if(this.qL&&this.WL._().length){this.Hx.Gt(),this.OL.clear(),this.nR.Or(),this.ih&&this.dR(t);const s=Kf({data:this.WL._(),dimensions:{x:0+this.ya.left,y:0+this.ya.bottom,width:this.pixelScale.x.getInnerEnd()-this.ya.right-this.ya.left,height:this.pixelScale.y.getInnerEnd()-i-this.ya.top-this.ya.bottom}}),r=this.oR.gy();this.fR(s,r),r.finishPlot(),this.AR(),this.NL!==this.WL._()&&this.NL.length>1&&this.$L.unshift({name:this.HL,id:0});let n=0;const o=this.aR.gy(),h=this.jL;this.$L.forEach(((t,i)=>{const s=o.add(),r=this.cs.Pg.Ig(t.name,h,0);s.Eh(`← ${t.name}`).Nh(h).Ie({x:0,y:100}).za({x:-1,y:1}).Ir({left:this.ya.left+n,top:this.ya.top,right:0,bottom:0}).ke(this.XL).setMouseClickEventHandler((t=>this.eR(i))).setMouseEnterEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Point))).setMouseLeaveEventHandler((()=>this.engine.setMouseStyle(e.MouseStyles.Default))),n+=r.x+25})),o.finishPlot(),this.WL._().every((t=>t.value===t.animatedValue))?this.qL=!1:this.cs.vs(!0)}const s=this.cs.Nn();if(this.Kx&&s){const t=s;this.Ux.setPosition(t).setVisible(!0).getResultTable().setContent(this.Om(new la,this.Kx).Qu())}else this.Ux.setVisible(!1);return this.Ux.Ds().Fe(),this}dispose(){return this.Ym.U(),this.Wm.U(),this.Ux.dispose(),this.Hx.dispose(),this.OL.clear(),this.oR.my(),this.aR.my(),super.dispose()}Z(){return super.Z(),this}J(){return super.J(),this}Wd(){return ue(this.Hx.zh())}attach(t,e=!0,i=!1){return t.setText(this.getTitle()),t.setOn(!0).setLocked(!0),le(t,this.ts,i,{}),this}fR(t,e,i=!1,s=0){const r=t.map(((t,e)=>({node:t,isChild:i,depth:s})));for(;r.length>0;){const t=r.pop();if(!t)continue;const{node:i,depth:s,opacity:n}=t,{x:o,y:h,height:a,width:l,children:u,animatedValue:c,name:d,nodeIndex:f}=i,g=this.hR,m=0===s&&1===this.WL._().length?this.tR:g[f%g.length],y=[{x:o,y:h},{x:o,y:a+h},{x:l+o,y:a+h},{x:l+o,y:h}],p=this.Hx.Vr().Sl(y).gR(m.setA(n||250)).Jx(c);this.OL.set(p,i),this.nR.Vr(p,(t=>p.ds(t)));const x=o+5,S=h+5,A=Math.max(a-25-5,0),v=Math.max(l-5-5,0);if(u&&u.length&&s15&&A>15){const t=Kf({data:u,dimensions:{x:v>0?x:o,y:A>0?S:h,width:v,height:A}});for(let e=0;e7?50:150))/(u.length-1),h=1===i.id&&1===this.NL.length||this.NL===this.WL._()?250:n?n/(s+1):250-e*o;r.push({node:t[e],isChild:!0,depth:s+1,opacity:h})}}const b=0===s&&1===this.WL._().length?this.ZL:this.JL,M=0===s?this.QL:this.KL,E=this.pR(d,l-25,M),w=this.cs.Pg.Ig(E,M,0),T=e.add();l-25>w.x&&a>25?T.Eh(E).Ie({x:o+5,y:a+h-2.5}).za({x:-1,y:1}).ke(b).Nh(M):T.Eh("")}}cR(t){const e={},i=[...t];for(;i.length>0;){const t=i.pop();t&&(e[t.id]=t,t.children&&i.push(...t.children))}return e}sR(t){if(!this.qL&&t)return this.OL.get(t)}AR(){this.$L=[];const t=this.WL._()[0].id;let e=this.GL[t].parentID;for(;e;)this.$L.push({name:this.GL[e].name,id:e}),e=this.GL[e].parentID;return this.$L.reverse()}pR(t,e,i){let s=this.cs.Pg.Ig(t,i,0).x;if(s<=e)return t;const r=t.split(" ");let n=t;for(;r.length>1&&s>e;)r.pop(),n=`${r.join(" ")}...`,s=this.cs.Pg.Ig(n,i,0).x;if(s>e)for(n=`${r[0]}...`,s=this.cs.Pg.Ig(n,i,0).x;n.length>3&&s>e;)n=`${n.substring(0,n.length-4)}...`,s=this.cs.Pg.Ig(n,i,0).x;return n.length<=3&&s>e?"":n}dR(t){var e;const i=[...this.NL];for(;i.length>0;){const s=i.pop();if(!s)continue;const r=s.value-s.animatedValue;if(Math.abs(r)<.0015*s.value||void 0===this.xm)s.animatedValue=s.value;else{const i=r/250*((null===(e=this.xm)||void 0===e?void 0:e.speed)||1)*t;s.animatedValue+=i,(r>0&&s.animatedValue>s.value||r<0&&s.animatedValue0&&i.push(...s.children)}}uR(t,e){const i=[{current:t,previous:e}];for(;i.length>0;){const t=i.pop();if(!t)continue;const{current:e,previous:s}=t;e.animatedValue=this.ih?s.animatedValue:e.value,s.nodeIndex<0?e.nodeIndex=0:e.nodeIndex=s.nodeIndex;const r=new Map(s.children.map((t=>[t.id,t])));e.children.forEach(((t,e)=>{const n=r.get(t.id);i.push({current:t,previous:n||s})}))}}}const tg=(t,e)=>{const{name:i,value:s}=e;return t.addRow(`${i}`).addRow(`${s}`),t},eg=(t,i)=>{const s=(t=>{const i=new G({color:t.uiStrokeColorContrastHigh}),s=new G({color:t.uiStrokeColorContrastMedium}),r=new G({color:t.uiStrokeColorContrastLow}),n=new rr({family:t.fontFamily,weight:"normal",style:"normal"}),o=n.setSize(18*t.fontScaler),h=n.setSize(16*t.fontScaler),a=n.setSize(14*t.fontScaler),l=n.setSize(10*t.fontScaler),u=n.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),c=n.setSize(13*t.fontScaler),d=new Ji({thickness:2,fillStyle:r}),f=new G({color:t.dataHighlightOverlayColor}),g=new Ji({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),m=t.dataColorPalette.map((t=>new G({color:t.stroke}))),y=t=>m[t%m.length],p=m.map((t=>new Ji({thickness:2,fillStyle:t}))),x=t=>p[t%p.length],S=t.dataColorPalette.map((t=>new G({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),A=t=>S[t%S.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new st({angle:180,stops:[{color:oe(e,E(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:oe(e,E(0,0,0,e.getA()),.3),offset:1}]})})),b=t=>v[t%v.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new st({angle:180,stops:[{color:oe(e,E(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:oe(e,E(0,0,0,e.getA()),.3),offset:1}]})})),T=t=>M[t%M.length],k=t.dataColorPaletteInverted.map((t=>new G({color:t.border}))).map((t=>new Ji({thickness:2,fillStyle:t}))),C=t=>k[t%k.length],R=new G({color:t.dataColorPositive}),I=new G({color:t.dataColorNegative}),F=new Ji({thickness:1,fillStyle:new G({color:t.dataStrokeColorContrastHigh.setA(50)})}),D=new Ji({thickness:2,fillStyle:t.axisLineFillStyle}),L=ot,P=new G({color:E(0,0,0,1)}),_=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),V=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),B=a,N=t.axisLabelMajorFillStyle,O=new Ji({thickness:1,fillStyle:t.axisGridMajorFillStyle}),U=new Ji({thickness:1,fillStyle:t.axisTickMajorFillStyle}),Y=a,H=t.axisLabelMajorFillStyle,X=new Ji({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new Ji({thickness:1,fillStyle:t.axisTickMinorFillStyle}),j=l,$=t.axisLabelMinorFillStyle,Z=ph,K=new mh({gridStrokeStyle:_,tickStyle:V,tickLength:50,tickPadding:-14,labelFont:B,labelPadding:0,labelFillStyle:N}),J=new mh({gridStrokeStyle:O,tickStyle:U,tickLength:7,tickPadding:5,labelFont:Y,labelPadding:0,labelFillStyle:H}),q=new mh({gridStrokeStyle:X,tickStyle:W,tickLength:4,tickPadding:10,labelFont:j,labelPadding:0,labelFillStyle:$}),Q=new Nh({extremeTickStyle:Z,majorTickStyle:J,minorTickStyle:q}),tt=new Fh({greatTickStyle:K,majorTickStyle:J,minorTickStyle:q}),et=new Hh({majorTickStyle:J,minorTickStyle:q}),it=new G({color:t.dataHighlightOverlayColor}),rt=new Ji({thickness:1,fillStyle:s}),nt=new Ji({thickness:2,fillStyle:s}),ht=t=>new gr.Triangulated({shape:"sphere",size:10,fillStyle:m[t%m.length]}),at=m[0],lt=t.uiTextFillStyle,ut=t.legendBackgroundFillStyle,ct=new Ji({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),dt=ae(t.legendButtonDefaultColor),ft=ae(t.isDark?E(70,70,70,255):E(170,170,170,255)),gt=new G({color:t.isDark?E(70,70,70,255):E(170,170,170,255)}),mt=new Ji({thickness:1,fillStyle:i}),yt=new qn({thickness:1,fillStyle:t.cursorGridFillStyle,pattern:Kn.DashedEqual,patternScale:3}),pt=t.zoomBandChartDefocusOverlayFillStyle,xt=new Ji({thickness:2,fillStyle:new G({color:t.zoomBandChartSplitterColor})});let St={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:ot,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new Ji({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:ot,chartXYTitleFont:o,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:d,chartXYZoomingRectangleFillStyle:f,chartXYZoomingRectangleStrokeStyle:g,chartXYFittingRectangleFillStyle:f,chartXYFittingRectangleStrokeStyle:g,lineSeriesStrokeStyle:x,pointLineSeriesStrokeStyle:x,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:x,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:x,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:ot,segmentSeriesStrokeStyle:x,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:ot,boxSeriesStrokeStyle:new Ji({thickness:1,fillStyle:m[0]}),boxSeriesMedianStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:E(0,0,0)})}),ohlcCandleThicknessPixels:5,ohlcCandleBodyFillStylePositive:R,ohlcCandleBodyFillStyleNegative:I,ohlcCandleTailStrokeStylePositive:new Ji({thickness:1,fillStyle:new G({color:t.uiStrokeColorContrastHigh})}),ohlcCandleTailStrokeStyleNegative:new Ji({thickness:1,fillStyle:new G({color:t.uiStrokeColorContrastHigh})}),ohlcBarThicknessPixels:10,ohlcBarStrokeStylePositive:new Ji({thickness:2,fillStyle:R}),ohlcBarStrokeStyleNegative:new Ji({thickness:2,fillStyle:I}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:F,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:F,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:A,areaRangeSeriesFillStyleInverted:T,areaRangeSeriesStrokeStyleInverted:C,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:A,areaSeriesBipolarLowFillStyle:T,areaSeriesBipolarLowStrokeStyle:C,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:A,areaSeriesNegativeFillStyle:T,areaSeriesNegativeStrokeStyle:C,xAxisTitleFont:h,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:D,xAxisNibStyle:L,xAxisOverlayStyle:P,xAxisZoomingBandFillStyle:f,xAxisZoomingBandStrokeStyle:ot,xAxisNumericTicks:Q,xAxisDateTimeTicks:tt,xAxisTimeTicks:et,yAxisTitleFont:h,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:D,yAxisNibStyle:L,yAxisOverlayStyle:P,yAxisZoomingBandFillStyle:f,yAxisZoomingBandStrokeStyle:ot,yAxisNumericTicks:Q,yAxisDateTimeTicks:tt,yAxisTimeTicks:et,bandFillStyle:it,bandStrokeStyle:rt,constantLineStrokeStyle:nt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:ot,barChartTitleFont:o,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:z,barChartSeriesBackgroundStrokeStyle:ot,barChartBarFillStyle:y,barChartBarStrokeStyle:new Ji({thickness:1,fillStyle:r}),barChartValueAxisTitleFont:h,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:D,barChartValueAxisTicks:Q.setMajorTickStyle((t=>t.setGridStrokeStyle(ot))).setMinorTickStyle((t=>t.setGridStrokeStyle(ot))),barChartCategoryAxisTitleFont:h,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:D,barChartCategoryLabels:{formatter:(t,e)=>t,labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:Q.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Q.majorTickStyle.labelFillStyle,labelFont:Q.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:ot,chart3DTitleFont:o,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:d,chart3DBoundingBoxStrokeStyle:ot,xAxis3DTitleFont:h,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:D,xAxis3DNumericTicks:Q,xAxis3DDateTimeTicks:tt,xAxis3DTimeTicks:et,yAxis3DTitleFont:h,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:D,yAxis3DNumericTicks:Q,yAxis3DDateTimeTicks:tt,yAxis3DTimeTicks:et,zAxis3DTitleFont:h,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:D,zAxis3DNumericTicks:Q,zAxis3DDateTimeTicks:tt,zAxis3DTimeTicks:et,lineSeries3DStrokeStyle:x,pointLineSeries3DStrokeStyle:x,pointLineSeries3DPointStyle:ht,pointSeries3DPointStyle:ht,pointCloudSeries3DPointStyle:t=>new gr.Pixelated({size:5,fillStyle:m[t%m.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:F,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:F,boxSeries3DFillStyle:y,meshModel3DFillStyle:y(0),polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:ot,polarChartTitleFont:o,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:d,polarSectorFillStyle:it,polarSectorStrokeStyle:rt,polarAmplitudeAxisTitleFont:h,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:D,polarAmplitudeAxisNumericTicks:Q,polarAmplitudeAxisDateTimeTicks:tt,polarAmplitudeAxisTimeTicks:et,polarRadialAxisTitleFont:h,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:D,polarRadialAxisTickStyle:J,polarLineSeriesStrokeStyle:x,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:x,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:b,polarPolygonSeriesStrokeStyle:A,polarAreaSeriesFillStyle:b,polarAreaSeriesStrokeStyle:A,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:ot,mapChartTitleFont:o,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:at,mapChartStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:z,mapChartOutlierRegionStrokeStyle:new Ji({thickness:1,fillStyle:r}),mapChartSeparateRegionFillStyle:ut,mapChartSeparateRegionStrokeStyle:ct,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:ot,dataGridTitleFont:o,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:a,dataGridTextFillStyle:at,dataGridCellBackgroundFillStyle:new G({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new Ji({thickness:.4,fillStyle:new G({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:ot,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ct,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ct,dataGridScrollBarButtonArrowFillStyle:dt,dataGridScrollBarButtonArrowStrokeStyle:ct,sparkLineChartStrokeStyle:x(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:A(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:A(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:ct,sparkChartBandFillStyle:it,sparkChartBandStrokeStyle:rt,sparkChartConstantLineStrokeStyle:nt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:ot,spiderChartTitleFont:o,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:d,spiderChartWebStyle:new Ji({thickness:2,fillStyle:r}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:a,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:h,spiderChartAxisStrokeStyle:new Ji({thickness:2,fillStyle:s}),spiderChartAxisNibStrokeStyle:new Ji({thickness:2,fillStyle:i}),spiderSeriesFillStyle:b,spiderSeriesStrokeStyle:A,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:ot,pieChartTitleFont:o,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:ct,pieChartSliceLabelFont:c,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:mt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:ot,funnelChartTitleFont:o,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:ct,funnelChartSliceLabelFont:c,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:mt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:ot,pyramidChartTitleFont:o,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:ct,pyramidChartSliceLabelFont:c,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:mt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:ot,gaugeChartTitleFont:o,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new G({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ct,gaugeChartGaugeFillStyle:at,gaugeChartIntervalLabelsFillStyle:lt,gaugeChartIntervalLabelsFont:c,gaugeChartValueLabelFillStyle:lt,gaugeChartValueLabelFont:c,treeMapChartBackgroundFillStyle:t.panelBackgroundFillStyle,treeMapChartBackgroundStrokeStyle:ot,treeMapChartParentColor:t.treeMapChartParentColor,treeMapChartNodeColors:t.treeMapChartNodeColors,treeMapChartNodeStrokeStyle:new Ji({thickness:1,fillStyle:new G({color:w("000")})}),treeMapChartTitleFillStyle:t.titleFillStyle,treeMapChartTitleFont:o,treeMapChartPathLabelFillStyle:lt,treeMapChartPathLabelFont:c,treeMapChartLabelHeaderFillStyle:t.treeMapChartLabelHeaderFillStyle,treeMapChartLabelHeaderFont:o,treeMapChartLabelFillStyle:t.treeMapChartLabelFillStyle,treeMapChartLabelFont:c,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:ot,zoomBandChartDefocusOverlayFillStyle:pt,zoomBandChartSplitterStrokeStyle:xt,zoomBandChartKnobFillStyle:t.zoomBandChartKnobFillStyle,zoomBandChartKnobSize:t.zoomBandChartKnobSize,onScreenMenuBackgroundColor:E(254,204,0,.7),uiButtonFillStyle:dt,uiButtonFillStyleHidden:ft,uiButtonStrokeStyle:ct,uiButtonSize:10,uiBackgroundFillStyle:ut,uiBackgroundStrokeStyle:ct,uiTextFillStyle:lt,uiTextFillStyleHidden:gt,uiTextFont:c,legendTitleFillStyle:lt,legendTitleFont:u,cursorTickMarkerXBackgroundFillStyle:ut,cursorTickMarkerXBackgroundStrokeStyle:ct,cursorTickMarkerXTextFillStyle:lt,cursorTickMarkerXTextFont:c,cursorTickMarkerYBackgroundFillStyle:ut,cursorTickMarkerYBackgroundStrokeStyle:ct,cursorTickMarkerYTextFillStyle:lt,cursorTickMarkerYTextFont:c,cursorPointMarkerFillStyle:yt.getFillStyle(),cursorPointMarkerSize:{x:9,y:9},cursorPointMarkerShape:e.PointShape.Cross,cursorResultTableFillStyle:ut,cursorResultTableStrokeStyle:ct,cursorResultTableTextFillStyle:lt,cursorResultTableTextFont:c,cursorGridStrokeStyleX:yt,cursorGridStrokeStyleY:yt,chartMarkerPointMarkerFillStyle:yt.getFillStyle(),chartMarkerPointMarkerSize:{x:20,y:20},chartMarkerPointMarkerShape:e.PointShape.Star,seriesMarkerPointMarkerFillStyle:yt.getFillStyle(),seriesMarkerPointMarkerSize:{x:9,y:9},seriesMarkerPointMarkerShape:e.PointShape.Cross};return t.overrideThemeProperties&&(St={...St,...t.overrideThemeProperties}),St})(t),r={...i,header1Font:s.xAxisTitleFont,header2Font:s.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:s.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...s,examples:r}},ig=(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},sg=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.5);return new tt({stops:[{color:oe(r,E(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:oe(r,E(30,30,30),.5*i).setA(100),offset:1}]})},rg=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.2);return new tt({stops:[{color:oe(r,E(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:oe(r,E(0,0,0),.2*i),offset:1}]})},ng=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:oe(e[s%e.length].stroke,E(255,255,255),.2);return new st({angle:90,stops:[{color:oe(r,E(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:oe(r,E(30,30,30),.5*i),offset:1}]})},og=(t,e,i)=>(i=>{const s=new Map;return i=>{const r=s.get(i);if(r)return r;const n=(i=>{const s=!0===t?e[i%e.length].stroke:oe(e[i%e.length].stroke,E(255,255,255),.3);return new st({angle:90,stops:[{color:oe(s,E(255,255,255),.5),offset:0},{color:s,offset:.35},{color:oe(s,E(30,30,30),.5),offset:1}]})})(i);return s.set(i,n),n}})(),hg=(t,i,s)=>{const r=i[0].stroke;return new tt({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:oe(r,E(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:oe(r,E(0,0,0),.5*s),offset:1}]})},ag=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:1,blur:9,offset:{x:0,y:0},color:E(0,0,0,150)}),n=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(50,51,52)},{offset:.5,color:E(14,15,16)},{offset:1,color:E(0,0,0)}]}),o=new G({color:E(45,45,45)}),h=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(120,120,120,100)},{offset:1,color:E(0,0,0,50)}]}),a=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(30,30,30,200)},{offset:1,color:E(0,0,0,255)}]}),l=new G({color:E(255,255,220)}),u=new G({color:E(255,255,166)}),c=new G({color:E(255,255,220)}),d=new G({color:E(255,255,220,130)}),f=new G({color:E(255,255,200)}),g=f,m=g,y=new st({angle:45,stops:[{offset:0,color:E(230,230,230)},{offset:1,color:E(150,150,150)}]}),p=new G({color:E(220,220,220)}),x=new G({color:E(200,200,200,50)}),S=new G({color:E(200,200,200,150)}),A=new G({color:E(200,200,200,20)}),v=new G({color:E(150,150,150)}),b=new st({angle:0,stops:[{offset:0,color:E(10,10,10,220)},{offset:1,color:E(30,30,30,220)}]}),M=i,T=E(255,255,200),k=b,C=M,R=E(20,20,20),I=E(0,0,0),F=t,D=E(150,150,150),L=E(50,50,50),P=E(50,50,50),_=E(100,100,100),V=E(200,200,200),B=[E(255,255,91,255),E(255,205,91,255),E(255,155,91,255),E(255,196,188,255),E(255,148,184,255),E(219,148,198,255),E(235,196,224,255),E(169,148,198,255),E(148,226,198,255),E(148,255,176,255),E(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(20),N=E(176,255,157,255),O=E(255,112,76,255),U={mapChartFillStyle:new st({angle:135,stops:[{color:E(255,255,91,255),offset:0},{color:E(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:sg(s,B,.5),pieChartSliceFillStylePalette:rg(s,B,1),funnelChartSliceFillStylePalette:ng(s,B,1),pyramidChartSliceFillStylePalette:ng(s,B,1),rectangleSeriesFillStyle:og(s,B),gaugeChartGaugeFillStyle:hg(s,B,1)},Y=new G({color:E(176,255,157,255)}),H=new G({color:E(255,146,146,255)}),X=new G({color:E(176,255,157,255)}),W=new G({color:E(230,63,63,255)}),j=new G({color:E(176,255,157,120)}),$=new G({color:E(229,63,63,180)}),Z=new G({color:E(27,37,36,255)}),K=new G({color:E(62,27,27,255)}),J=[E(255,0,0),E(255,255,0),E(0,255,0)],q=[E(10,10,255),E(10,190,255),E(251,255,0),E(255,38,0)],Q=[E(255,255,0),E(255,204,0),E(255,128,0),E(255,0,0)],et=[E(0,0,0),E(167,4,69,255),E(255,0,0),E(252,252,168,255)],it=new tt({stops:[{color:E(61,61,80,100),offset:0},{color:E(44,44,55,30),offset:1}]}),rt=new G({color:E(148,148,198,255)}),nt=j.getColor().setA(255),ot=E(100,100,100),ht=[E(255,241,149,200),E(255,230,65,200),E(238,211,32,200),E(238,176,32,200),E(255,159,13,200),E(254,120,37,200),E(253,91,56,200),E(253,75,84,200),E(254,95,124,200),E(227,56,160,200),E(226,53,134,200),E(216,90,166,200),E(254,151,206,200),E(237,151,254,200),E(243,177,255,200),E(233,133,252,200),E(210,101,230,200),E(178,61,200,200),E(193,81,156,200),E(217,95,145,200)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:n,dashboardSplitterFillStyle:o,panelBackgroundFillStyle:h,seriesBackgroundFillStyle:a,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:l,axisTitleFillStyle:u,axisLabelMajorFillStyle:c,axisLabelMinorFillStyle:d,uiTitleFillStyle:f,uiTextFillStyle:g,cursorTextFillStyle:m,axisLineFillStyle:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:x,axisTickMinorFillStyle:S,axisGridMinorFillStyle:A,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:T,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:C,uiBackgroundColor:R,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:F,uiStrokeColorContrastMedium:D,uiStrokeColorContrastLow:L,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:V,dataColorPalette:B,dataColorPaletteInverted:[{area:E(190,50,50,100),border:E(210,80,80)}],dataHighlightOverlayColor:z,dataColorPositive:N,dataColorNegative:O,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:w("#FBFB5A"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/darkgold-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:U,treeMapChartParentColor:w("#181E21"),treeMapChartNodeColors:ht,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:Y,negativeTextFillStyle:H,positiveFillStyle:X,negativeFillStyle:W,positiveAreaFillStyle:j,negativeAreaFillStyle:$,positiveBackgroundFillStyle:Z,negativeBackgroundFillStyle:K,badGoodColorPalette:J,coldHotColorPalette:q,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:rt,highlightPointColor:t,highlightDataGridColor:nt,unfocusedDataColor:ot})})),lg=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:0,blur:9,offset:{x:0,y:0},color:E(105,255,236,40)}),n=new G({color:E(2,21,30)}),o=new tt({stops:[{color:E(19,40,66,150),offset:0},{color:E(0,0,0,150),offset:1}]}),h=new G({color:E(0,5,8,150)}),a=i,l=i,u=i,c=new G({color:E(255,255,220,130)}),d=i,f=i,g=f,m=new G({color:E(20,224,250,255)}),y=i,p=new G({color:E(61,94,110,100)}),x=new G({color:E(61,94,110,255)}),S=new G({color:E(61,94,110,40)}),A=i,v=new G({color:E(0,18,23,255)}),b=i,M=t,T=new G({color:E(0,17,22,240)}),k=i,C=E(0,38,48,220),R=E(0,0,0),I=t,F=E(150,150,150),D=E(19,78,93),L=E(50,50,50),P=E(0,36,48),_=E(200,200,200),V=[E(45,253,253,255),E(44,172,247,255),E(46,100,248,255),E(96,84,199,255),E(184,104,245,255),E(98,160,218,255),E(43,238,245,255),E(38,140,206,255),E(112,96,224,255),E(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),z=E(3,217,194,255),N=E(230,63,63,255),O={mapChartFillStyle:new st({angle:135,stops:[{color:E(118,248,231,255),offset:0},{color:E(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:sg(s,V,1),pieChartSliceFillStylePalette:rg(s,V,1),funnelChartSliceFillStylePalette:ng(s,V,1),pyramidChartSliceFillStylePalette:ng(s,V,1),rectangleSeriesFillStyle:og(s,V),gaugeChartGaugeFillStyle:hg(s,V,1)},U=new G({color:E(45,253,253,255)}),Y=new G({color:E(255,146,146,255)}),H=new G({color:E(45,253,253,255)}),X=new G({color:E(230,63,63,255)}),W=new G({color:E(1,190,164,120)}),j=new G({color:E(229,63,63,180)}),$=new G({color:E(1,53,57,255)}),Z=new G({color:E(62,27,27,255)}),K=[E(1,104,119,255),E(0,165,144,255),E(0,246,214,255)],J=[E(0,87,95,255),E(0,125,124,255),E(1,209,182,255),E(0,255,221,255),E(218,112,112,255),E(172,47,47,255)],q=[E(126,255,253,255),E(50,233,230,255),E(0,196,193,255),E(62,138,178,255),E(139,88,191,255),E(162,55,143,255)],Q=[E(13,31,52,255),E(101,50,118,255),E(1,142,172,255),E(2,196,170,255),E(0,255,221,255)],et=new tt({stops:[{color:E(122,103,254,70),offset:0},{color:E(178,168,255,10),offset:1}]}),it=new G({color:E(122,103,254,255)}),rt=W.getColor().setA(255),nt=E(15,83,83),ot=[E(139,252,252,150),E(60,239,239,150),E(2,201,201,150),E(26,159,159,150),E(15,146,187,150),E(65,168,200,150),E(67,146,207,150),E(64,108,209,150),E(189,64,233,150),E(219,84,238,150),E(192,55,212,150),E(212,98,229,150),E(248,110,211,150),E(251,154,225,150),E(251,154,184,150),E(233,105,144,150),E(255,133,170,150),E(249,110,135,150),E(245,72,101,150),E(210,57,84,150)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new $n({source:ig(t,"themes/turquoiseHexagon.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:A,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:_,dataColorPalette:V,dataColorPaletteInverted:[{area:E(170,60,210,100),border:E(210,100,250)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:w("#2BF4F4"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/turquoise-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:w("#002329"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),ug=Ee((()=>{const t=!1,i=new ro({spread:0,blur:6,offset:{x:2,y:-2},color:E(0,0,0,30)}),s=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(255,255,255)},{offset:1,color:E(255,255,255)}]}),r=new G({color:E(219,227,233,255)}),n=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,200)},{offset:1,color:E(240,244,246,200)}]}),o=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,255)},{offset:1,color:E(255,255,255,255)}]}),h=new G({color:E(33,43,49)}),a=new G({color:E(33,43,49)}),l=new G({color:E(33,43,49)}),u=new G({color:E(33,43,49,150)}),c=new G({color:E(33,43,49)}),d=c,f=d,g=new st({angle:45,stops:[{offset:0,color:E(225,225,225)},{offset:1,color:E(225,225,225)}]}),m=new G({color:E(150,150,150,255)}),y=new G({color:E(150,150,150,170)}),p=new G({color:E(150,150,150,150)}),x=new G({color:E(150,150,150,100)}),S=new G({color:E(128,146,159)}),A=new st({angle:0,stops:[{offset:0,color:E(255,255,255,240)},{offset:1,color:E(255,255,255,240)}]}),v=new G({color:E(168,186,199)}),b=E(255,255,200),M=new G({color:E(255,255,255,240)}),T=new G({color:E(128,146,159,255)}),k=E(255,255,255,255),C=E(168,168,199,255),R=E(168,186,199,255),I=E(168,186,199,255),F=E(168,186,199,255),D=E(168,186,199,255),L=E(100,100,100),P=E(200,200,200),_=[E(28,181,140,255),E(255,132,0,255),E(240,39,39,255),E(86,121,251,255),E(2,181,213,255),E(13,212,158,255),E(22,167,3,255),E(234,103,232,255),E(62,183,179,255),E(140,93,3,255),E(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),V=E(150,150,150,80),B=E(46,182,120,255),z=E(255,66,66,255),N=new Ji({thickness:2,fillStyle:new G({color:E(168,186,199,255)})}),O={mapChartFillStyle:new st({angle:-45,stops:[{color:E(2,181,213,255),offset:0},{color:E(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:sg(t,_,.8),pieChartSliceFillStylePalette:rg(t,_,.8),funnelChartSliceFillStylePalette:ng(t,_,.5),pyramidChartSliceFillStylePalette:ng(t,_,.5),rectangleSeriesFillStyle:og(t,_),gaugeChartGaugeFillStyle:hg(t,_,.8),chartXYSeriesBackgroundStrokeStyle:N,chart3DSeriesBackgroundStrokeStyle:N,polarChartSeriesBackgroundStrokeStyle:N,spiderChartSeriesBackgroundStrokeStyle:N,dataGridTextFillStyle:new G({color:E(0,88,64,255)})},U=new G({color:E(4,146,108,255)}),Y=new G({color:E(240,39,39,255)}),H=new G({color:E(28,181,140,255)}),X=new G({color:E(230,88,88,255)}),W=new G({color:E(28,181,140,180)}),j=new G({color:E(230,88,88,180)}),$=new G({color:E(229,243,228)}),Z=new G({color:E(232,225,216)}),K=[E(193,48,48,255),E(240,234,60,255),E(45,191,55,255)],J=[E(10,19,255,255),E(15,191,250,255),E(249,255,2,255),E(253,133,0,255),E(255,24,0,255)],q=[E(50,99,213),E(8,179,77),E(255,246,0),E(255,126,0),E(189,36,30)],Q=[E(16,64,176),E(8,179,77),E(255,246,0),E(255,126,0),E(168,6,0)],et=new G({color:E(185,198,207,255)}),it=new tt({stops:[{color:E(151,190,220,10),offset:0},{color:E(151,190,220,50),offset:1}]}),rt=W.getColor().setA(255),nt=E(150,150,150),ot=[E(255,243,136,125),E(254,237,99,125),E(255,216,109,125),E(255,172,100,125),E(255,133,101,125),E(255,113,142,125),E(230,103,129,125),E(242,126,219,125),E(255,155,235,125),E(255,181,240,125),E(203,143,255,125),E(208,154,255,125),E(171,188,255,125),E(197,209,255,125),E(171,187,255,125),E(84,167,239,125),E(38,196,214,125),E(38,214,196,125),E(69,225,141,125),E(36,191,88,125)];return eg({isDark:t,highlightColorOffset:E(-60,-60,-60,60),highlightColorOffsetAxisOverlay:E(0,0,0,40),effect:i,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:s,dashboardSplitterFillStyle:r,panelBackgroundFillStyle:n,seriesBackgroundFillStyle:o,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:h,axisTitleFillStyle:a,axisLabelMajorFillStyle:l,axisLabelMinorFillStyle:u,uiTitleFillStyle:c,uiTextFillStyle:d,cursorTextFillStyle:f,axisLineFillStyle:g,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:p,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:A,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:k,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:R,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:D,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:P,dataColorPalette:_,dataColorPaletteInverted:[{area:E(190,50,50,100),border:E(210,80,80)}],dataHighlightOverlayColor:V,dataColorPositive:B,dataColorNegative:z,zoomBandChartDefocusOverlayFillStyle:new G({color:E(255,255,255,180)}),zoomBandChartSplitterColor:w("#505D65"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/light-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:w("#D9D9D9"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(0,0,0)}),treeMapChartLabelHeaderFillStyle:new G({color:E(33,33,33)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:E(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),cg=Ee((()=>{const t=!1,i=new tt({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:E(255,255,255)},{offset:1,color:E(255,255,255)}]}),s=new G({color:E(214,236,216,255)}),r=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(233,244,231,70)},{offset:1,color:E(233,244,231,200)}]}),n=new tt({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:E(255,255,255,255)},{offset:1,color:E(255,255,255,255)}]}),o=new G({color:E(1,61,53)}),h=new G({color:E(1,61,53)}),a=new G({color:E(1,61,53)}),l=new G({color:E(1,61,53,150)}),u=new G({color:E(1,61,53)}),c=u,d=c,f=new st({angle:45,stops:[{offset:0,color:E(225,225,225)},{offset:1,color:E(225,225,225)}]}),g=new G({color:E(188,211,186,255)}),m=new G({color:E(188,211,186,150)}),y=new G({color:E(188,211,186,50)}),p=new G({color:E(188,211,186,50)}),x=new G({color:E(104,148,111,255)}),S=new st({angle:0,stops:[{offset:0,color:E(255,255,255,240)},{offset:1,color:E(255,255,255,240)}]}),A=new G({color:E(104,148,111)}),v=E(255,255,200),b=new G({color:E(255,255,255,240)}),M=new G({color:E(104,148,111,255)}),T=E(255,255,255,255),k=E(179,201,183,255),C=E(188,211,186,255),R=E(188,211,186,255),I=E(188,211,186,255),F=E(188,211,186,255),D=E(100,100,100),L=E(200,200,200),P=[E(138,195,142,255),E(193,161,114,255),E(178,99,99,255),E(142,156,210,255),E(154,209,219,255),E(164,212,199,255),E(104,156,97,255),E(196,147,195,255),E(92,190,187,255),E(126,100,51,255),E(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=E(150,150,150,80),V=E(46,182,84,255),B=E(232,96,96,255),z=new Ji({thickness:2,fillStyle:new G({color:E(188,211,186,255)})}),N={mapChartFillStyle:new st({angle:-45,stops:[{color:E(118,160,121,255),offset:0},{color:E(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:sg(t,P,.8),pieChartSliceFillStylePalette:rg(t,P,.8),pyramidChartSliceFillStylePalette:ng(t,P,.5),funnelChartSliceFillStylePalette:ng(t,P,.5),rectangleSeriesFillStyle:og(t,P),gaugeChartGaugeFillStyle:hg(t,P,.8),chartXYSeriesBackgroundStrokeStyle:z,chart3DSeriesBackgroundStrokeStyle:z,polarChartSeriesBackgroundStrokeStyle:z,spiderChartSeriesBackgroundStrokeStyle:z,dataGridTextFillStyle:new G({color:E(77,66,21,255)})},O=new G({color:E(93,151,97,255)}),U=new G({color:E(178,99,99,255)}),Y=new G({color:E(138,195,142,255)}),H=new G({color:E(178,99,99,255)}),X=new G({color:E(138,195,142,180)}),W=new G({color:E(178,99,99,180)}),j=new G({color:E(224,240,237)}),$=new G({color:E(251,227,227)}),Z=[E(178,99,99,255),E(215,224,111,255),E(80,186,88,255)],K=[E(62,64,142,255),E(66,131,77,255),E(250,250,135,255),E(202,161,78,255),E(179,53,53,255)],J=[E(64,86,138),E(123,192,205),E(255,252,149),E(220,155,92),E(184,78,74)],q=[E(64,86,138),E(123,192,205),E(255,252,149),E(220,155,92),E(132,60,57)],Q=new G({color:E(185,198,207,255)}),et=new tt({stops:[{color:E(151,190,220,10),offset:0},{color:E(151,190,220,50),offset:1}]}),it=X.getColor().setA(255),rt=E(150,150,150),nt=[E(242,239,210,150),E(243,238,183,150),E(210,222,136,150),E(204,217,148,150),E(157,190,124,150),E(143,178,72,150),E(198,147,88,150),E(216,148,71,150),E(229,142,103,150),E(225,174,152,150),E(219,149,203,150),E(216,188,209,150),E(109,198,189,150),E(172,206,202,150),E(164,223,217,150),E(174,215,233,150),E(203,225,235,150),E(220,227,243,150),E(207,213,227,150),E(171,182,209,150)];return eg({isDark:t,highlightColorOffset:E(-60,-60,-60,60),highlightColorOffsetAxisOverlay:E(0,0,0,40),effect:void 0,effectsText:!1,effectsDashboardSplitters:!1,lcjsBackgroundFillStyle:i,dashboardSplitterFillStyle:s,panelBackgroundFillStyle:r,seriesBackgroundFillStyle:n,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:o,axisTitleFillStyle:h,axisLabelMajorFillStyle:a,axisLabelMinorFillStyle:l,uiTitleFillStyle:u,uiTextFillStyle:c,cursorTextFillStyle:d,axisLineFillStyle:f,axisTickMajorFillStyle:g,axisGridMajorFillStyle:m,axisTickMinorFillStyle:y,axisGridMinorFillStyle:p,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:A,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:b,resultTableBackgroundBorderFillStyle:M,uiBackgroundColor:T,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:R,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:D,dataStrokeColorContrastLow:L,dataColorPalette:P,dataColorPaletteInverted:[{area:E(210,70,70,100),border:E(200,110,110)}],dataHighlightOverlayColor:_,dataColorPositive:V,dataColorNegative:B,zoomBandChartDefocusOverlayFillStyle:new G({color:E(255,255,255,180)}),zoomBandChartSplitterColor:w("#446A40"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/lightnature-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:N,treeMapChartParentColor:w("#EFF7EE"),treeMapChartNodeColors:nt,treeMapChartLabelFillStyle:new G({color:E(0,0,0)}),treeMapChartLabelHeaderFillStyle:new G({color:E(33,33,33)})},{positiveTextFillStyle:O,negativeTextFillStyle:U,positiveFillStyle:Y,negativeFillStyle:H,positiveAreaFillStyle:X,negativeAreaFillStyle:W,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:$,badGoodColorPalette:Z,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:q,bollingerFillStyle:et,bollingerBorderFillStyle:Q,highlightPointColor:E(0,0,0),highlightDataGridColor:it,unfocusedDataColor:rt})})),dg=Ee((()=>{const t=E(255,255,255),i=new G({color:t}),s=!0,r=new ro({spread:1,blur:9,offset:{x:0,y:0},color:E(255,255,255,30)}),n=new G({color:E(6,15,36)}),o=new tt({stops:[{color:E(46,13,87,50),offset:0},{color:E(0,0,0,150),offset:1}]}),h=new G({color:E(0,5,8,150)}),a=i,l=i,u=i,c=new G({color:E(255,255,220,130)}),d=i,f=i,g=f,m=new st({angle:45,stops:[{offset:0,color:E(241,133,255,255)},{offset:1,color:E(115,207,238,255)}]}),y=i,p=new G({color:E(61,94,110,100)}),x=new G({color:E(61,94,110,255)}),S=new G({color:E(61,94,110,40)}),A=i,v=new G({color:E(0,18,23,255)}),b=i,M=E(115,207,238,255),T=new G({color:E(0,17,22,240)}),k=i,C=E(0,38,48,255),R=E(0,0,0),I=t,F=E(150,150,150),D=E(19,57,93),L=E(50,50,50),P=E(0,17,48),_=E(200,200,200),V=[E(20,211,237,255),E(98,147,252,255),E(164,73,250,255),E(129,117,253,255),E(95,134,252,255),E(22,133,212,255),E(35,200,242,255),E(104,121,233,255),E(137,69,232,255),E(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=t.setA(50),z=E(3,217,194,255),N=E(243,21,110,255),O={mapChartFillStyle:new st({angle:135,stops:[{color:E(118,248,231,255),offset:0},{color:E(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:sg(s,V,.5),pieChartSliceFillStylePalette:rg(s,V,2),funnelChartSliceFillStylePalette:ng(s,V,1),pyramidChartSliceFillStylePalette:ng(s,V,1),rectangleSeriesFillStyle:og(s,V),gaugeChartGaugeFillStyle:hg(s,V,1)},U=new G({color:E(20,211,237,255)}),Y=new G({color:E(253,145,178,255)}),H=new G({color:E(20,211,237,255)}),X=new G({color:E(239,68,121,255)}),W=new G({color:E(20,211,237,120)}),j=new G({color:E(239,68,121,180)}),$=new G({color:E(1,53,57,255)}),Z=new G({color:E(94,19,42,255)}),K=[E(174,51,132,255),E(204,107,218,255),E(189,215,253,255)],J=[E(0,63,95,255),E(0,149,255,255),E(0,225,255,255),E(255,154,254,255),E(204,98,170,255),E(139,39,84,255)],q=[E(197,241,255,255),E(70,210,255,255),E(0,164,217,255),E(90,99,222,255),E(138,75,192,255),E(151,27,162,255)],Q=[E(13,31,52,255),E(129,54,130,255),E(131,108,176,255),E(7,162,213,255),E(26,247,255,255)],et=new tt({stops:[{color:E(219,42,235,60),offset:0},{color:E(237,73,252,10),offset:1}]}),it=new G({color:E(237,73,252,255)}),rt=W.getColor().setA(255),nt=E(8,70,100),ot=[E(149,230,255,150),E(93,213,243,150),E(20,189,223,150),E(5,151,181,150),E(2,138,198,150),E(2,113,198,150),E(97,148,236,150),E(93,111,230,150),E(151,120,223,150),E(128,87,227,150),E(153,52,230,150),E(179,92,245,150),E(248,110,211,150),E(255,155,228,150),E(251,88,207,150),E(255,0,162,150),E(214,73,177,150),E(209,71,159,150),E(238,101,169,150),E(210,57,134,150)];return eg({isDark:s,highlightColorOffset:E(60,60,60,60),highlightColorOffsetAxisOverlay:E(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new $n({source:ig(t,"themes/cyberSpace.jpg"),fitMode:e.ImageFitMode.Fill}),dashboardSplitterFillStyle:n,panelBackgroundFillStyle:o,seriesBackgroundFillStyle:h,fontFamily:"Segoe UI, -apple-system, Verdana, Helvetica",fontScaler:1,titleFillStyle:a,axisTitleFillStyle:l,axisLabelMajorFillStyle:u,axisLabelMinorFillStyle:c,uiTitleFillStyle:d,uiTextFillStyle:f,cursorTextFillStyle:g,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:A,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:C,uiBackgroundBorderColor:R,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:D,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:_,dataColorPalette:V,dataColorPaletteInverted:[{area:E(41,130,255,100),border:E(45,110,240)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:N,zoomBandChartDefocusOverlayFillStyle:new G({color:E(0,0,0,180)}),zoomBandChartSplitterColor:w("#DB77FF"),zoomBandChartKnobFillStyle:t=>new $n({source:ig(t,"zoomBandChart/cyberspace-selector.png"),fitMode:e.ImageFitMode.Fill}),zoomBandChartKnobSize:{x:14,y:30},overrideThemeProperties:O,treeMapChartParentColor:w("#1E1E3B"),treeMapChartNodeColors:ot,treeMapChartLabelFillStyle:new G({color:E(33,33,33)}),treeMapChartLabelHeaderFillStyle:new G({color:E(250,250,250)})},{positiveTextFillStyle:U,negativeTextFillStyle:Y,positiveFillStyle:H,negativeFillStyle:X,positiveAreaFillStyle:W,negativeAreaFillStyle:j,positiveBackgroundFillStyle:$,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:q,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),fg={};Object.defineProperty(fg,"darkGold",{get:ag,enumerable:!0}),Object.defineProperty(fg,"turquoiseHexagon",{get:lg,enumerable:!0}),Object.defineProperty(fg,"light",{get:ug,enumerable:!0}),Object.defineProperty(fg,"lightNature",{get:cg,enumerable:!0}),Object.defineProperty(fg,"cyberSpace",{get:dg,enumerable:!0});const gg=fg,mg=gg.darkGold,yg=(t,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,r=0,n=0;const o=[],h=t=>{const i=new bt.Image;i.src=t,i.onload=()=>{o.forEach((t=>{var s;const o=new $n({source:i,fitMode:e.ImageFitMode.Stretch});null===(s=t.Ed)||void 0===s||s.ke(o),r=i.width,n=i.height,u(t)}))}};h(i);const a=t.Wn((t=>h(t)));let l;if(new bt.Image instanceof bt.HTMLImageElement){const t=new bt.Image;t.src=i,l=new $n({source:t,fitMode:e.ImageFitMode.Stretch})}else if(bt.lcjs_setup){const t=new bt.Image;t.src=i;const s=bt.lcjs_setup(t.naturalWidth,t.naturalHeight);s.getContext("2d").drawImage(t,0,0),l=new $n({source:s,fitMode:e.ImageFitMode.Stretch})}else l=new G({color:w("#f00")});const u=t=>{if(t.Ed){const e=t.ft.mi({x:t.ft.x.getInnerEnd(),y:t.ft.y.getInnerStart()},{x:-(3+r),y:3}),i=t.ft.mi({x:t.ft.x.getInnerEnd(),y:t.ft.y.getInnerStart()},{x:-3,y:3+n}),s={x:i.x-e.x,y:i.y-e.y};t.Ed.Ie(e).tt(s)}s&&s.vs()};return s=t.II("logo",Number.MAX_SAFE_INTEGER),i=>{const r={ft:i};return(i=>{i.Ed&&i.Ed.dispose(),s&&(i.Ed=s.Te(i.ft).ke(l).setMouseInteractions(!0).Ce(ot).setMouseEnterEventHandler((()=>{t.Ur(e.MouseStyles.Point)})).setMouseLeaveEventHandler((()=>{t.Ur(e.MouseStyles.None)})).setMouseClickEventHandler(pg).setTouchEndEventHandler(pg),u(i))})(r),o.push(r),{Ds:()=>u(r),U:()=>(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.Un(a)})(r)}}},pg=()=>bt.open("https://lightningchart.com/lightningchart-js/");class xg{constructor(){this.mR=this.fP.bind(this),bt.addEventListener("scroll",this.mR,{passive:!0})}U(){this.mR&&bt.removeEventListener("scroll",this.mR),this.mR=void 0}}class Sg{constructor(t,e){this.ma=t,this.j=e,this.yR=!0,this.SR=null,this.vR=null}}class Ag{constructor(t){this.xR=!1,this.bR=1,this.MR=t,this._R={ma:u(0,0),j:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),yR:!0,SR:null,vR:null},this.wR=u(64,64),this.CR=new Uint8ClampedArray(this.wR.x*this.wR.y*this.bR)}kR(t,e){if(!t.yR)return null;if(t.SR&&t.vR){const i=this.kR(t.SR,e);return null!==i?i:this.kR(t.vR,e)}const i=c(t.j.x,t.j.y);if(t.ma.x+t.j.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.wR.x-t.ma.x-1),t.ma.y+t.j.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.wR.y-t.ma.y-1),t.j.x===e.x&&t.j.y===e.y)return t.yR=!1,t;if(i.xt.j.y)),h?(s=new Sg(oi(t.ma,{x:0,y:1}),u(t.j.x,e.y)),r=new Sg(oi(t.ma,{x:0,y:e.y+1}),u(t.j.x,t.j.y-1-e.y))):(s=new Sg(oi(t.ma,{x:1,y:0}),u(e.x,t.j.y)),r=new Sg(oi(t.ma,{x:e.x+1,y:0}),u(t.j.x-1-e.x,t.j.y))),t.SR=s,t.vR=r,this.kR(t.SR,e)}TR(t,e){const i={FR:!1,ma:null};let s=this.kR(this._R,e);if(null===s)for(;null===s&&this.wR.xthis.MR||t.y>this.MR)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.bR);for(let i=0;i{this.ER.NR(t)})),this.RR.clear(),this}GR(t,e){const i=this.LR.get(e);if(i)return i.get(t)}WR(t,e,i){let s=this.LR.get(e);if(s||(s=new Map,this.LR.set(e,s)),s.has(t.glyph))return bg.Success;const r=this.zR.TR(i,t.size);if(!r||!r.ma)return bg.Fail;r.FR&&this.UR();const n=this.zR.DR(r.BR);if(!n)return bg.Fail;let o=this.RR.get(r.BR);if(!o){const t=this.ER.gl.createTexture();if(!t)throw new yt("Failed to create texture for font!");o=t,this.RR.set(r.BR,t)}const h=r.ma,a=n.wR.x,l=n.wR.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,y=(h.x+t.size.x)/a,p=h.y/l,x=[g,m,y,m,g,p,g,p,y,m,y,p],S=[u,c,d,c,u,f,u,f,d,c,d,f],A={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:S,texCoords:x,packerId:r.BR,texture:o};s.set(t.glyph,A);const v=this.ER.gl;return v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),v.bindTexture(v.TEXTURE_2D,o),v.texImage2D(v.TEXTURE_2D,0,v.LUMINANCE,n.wR.x,n.wR.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.ER.YR?n.CR:new Uint8Array(n.CR)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.bindTexture(v.TEXTURE_2D,null),r.FR?bg.Resize:bg.Success}UR(){this.LR.forEach((t=>{t.forEach(((e,i)=>{const s=this.zR.DR(e.packerId);if(!s)return;const r=e.origin,n=s.wR.x,o=s.wR.y,h=r.x/n,a=(r.y+e.size.y)/o,l=(r.x+e.size.x)/n,u=r.y/o,c=[h,a,l,a,h,u,h,u,l,a,l,u];e.texCoords=c,t.set(i,e)}))}))}}const wg=t=>{if(t instanceof _i||t instanceof $c)return t.wi()?"linear-highPrecision":"linear";if(t instanceof Vi){const e={};return t.x instanceof Mi&&(e.x={base:t.x.pi()}),t.y instanceof Mi&&(e.y={base:t.y.pi()}),["logarithmic",e]}return"linear"},Tg=t=>{const e=Object.keys(t),i={};return e.forEach((e=>{const s=t[e];let r=!1;i[e]=t=>{if(!t)return r;const e=s();return r=e,e}})),i},kg=(t,e,i)=>"value"===t.getLookUpProperty()?i:"x"===t.getLookUpProperty()?{min:e.xt(),max:e.bt()}:"y"===t.getLookUpProperty()?{min:e.Mt(),max:e._t()}:"z"===t.getLookUpProperty()?{min:e.uS(),max:e.lS()}:void 0,Cg=t=>!(!t||"value"!==t.lookUpProperty||!t.lut.percentageValues),Rg=t=>(e,i)=>i%2?e:e+t;class Ig{constructor(t){this.HR=new Map,this.$R=ce("font"),this.XR=new Map,this.jR=new Set,this.ER=t}OR(t=!1){return(t||0===this.jR.size)&&(this.HR.forEach(((t,e)=>{t.OR(),this.HR.delete(e)})),this.jR.clear()),this}ZR(t){this.jR.add(t)}QR(t){this.jR.delete(t)}JR(t,e,i,s){const r=bt.devicePixelRatio,n=`${s?"dark":"light"} - ${pr(e,r).id}`,o=this.XR.get(n),h=this.HR.get(o);let a=0,l=0,u=0;const c=t.split(""),d=e.size,f=.45*e.size*r,g=Math.round(1*e.size);let m=!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,r=Math.cos(s),n=Math.sin(s);return{x:Math.abs(t*r)+Math.abs(e*n),y:Math.abs(t*n)+Math.abs(e*r)}})(u/r,(l-a+1)/r,i);return{x:y.x,y:y.y,isEstimate:m}}KR(t,e,i){const s=`${i?"dark":"light"} - ${e.id}`;let r=this.XR.get(s);r||(r=this.$R(),this.HR.set(r,new Eg(this.ER)),this.XR.set(s,r));const n=this.HR.get(r);if(!n)throw new yt("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),c=new Map;let d=0;const f=e.properties.size;for(let t=0;t{t.ua.o=!0})),t=-1,d=0,h=0,o=0,c.clear();continue}if(l===bg.Fail)throw new yt("Failed to create glyph");if(a=n.GR(s,f),!a)throw new yt("Failed to get glyph after creation")}if(""!==s.trim()){let t=c.get(a.texture);t||(t={vertices:[],texCoords:[]},c.set(a.texture,t)),t.vertices.push(...a.vertices.map(Rg(r))),t.texCoords.push(...a.texCoords),h=Math.max(h,a.baseline),o=Math.min(o,a.baseline-(a.size.y-1))}d+=a.advanceX}a=d;const g=m(u(0,o),u(a,h)),y=[];return c.forEach(((t,e)=>{y.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[y,g]}}class Fg{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>Dg(t)));for(const i of e)t=i(t);return`${xe(this.modifiers.filter((t=>Lg(t)))).map((t=>t.tE)).join("\n")}\n${t}`}}const Dg=t=>"function"==typeof t,Lg=t=>t&&"object"==typeof t&&"iE"in t,Pg=(...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},_g=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Vg=(...t)=>e=>{const i=t.filter((t=>!1!==t));for(let t=0;ti=>{for(let t=0;t{if(!n.includes(e))throw new Error(`ShaderBefore misusage (not found: \n${e}\nmatch: \n${t}\nresult: \n${n}\n)`)})),n},zg=(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},Ng=(...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},Og=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Pg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Pg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Ng(`\t${r} = ${s};`)(i)},Ug=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e},Gg={roundUnsigned:{iE:"roundUnsigned",tE:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{iE:"linearStep",tE:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{iE:"decodeUbyteRGBAEncodedFloat",tE:"\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:{iE:"texelFetchWithFallback",tE:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{iE:"texelFetchWithFallback",tE:"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:{iE:"texelFetchUnsignedWithFallback",tE:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{iE:"texelFetchUnsignedWithFallback",tE:"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:{iE:"modulus",tE:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{iE:"computeScreenSpaceWireframe",tE:"#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}"}},Yg=(t,e)=>{const i=e.steps,s=i.length-1,r=[Pg("uniform vec4 uFallbackColor")],n=[],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")):r.push(Bg("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")),r},Hg=[Pg("uniform sampler2D uMaskTexture"),Pg("varying vec2 vMaskTextureCoord"),zg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Xg=[Pg("uniform sampler2D uMaskTexture"),Pg("varying vec2 vMaskTextureCoord"),zg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.a")],Wg=[Pg("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;"),zg("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 jg 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 $g=(...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 r=Object.keys(s).sort();for(const i of r){const r=s[i];"object"==typeof r&&r.__proto__===Object.prototype||Array.isArray(r)?t.push({prefix:i,obj:r}):e+=`${i}=${String(r)},`}}}return e},Zg=t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.eE})),Kg=t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.hE})),Jg=(t,e,...i)=>{const s=[],r=e?"vec3":"vec2",{axisWorldTranslation:n,scaling:o,translation:h,offset:a,flipXY:l,flipXZ:u,splitPosAttribute:c,normalSource:d}=t,f=[];if("attribute"===d&&s.push(Pg("attribute vec3 aNormal"),Vg("vec3 normal = aNormal")),"linear-highPrecision"!==n?i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&void 0!==t.variableNameAxisCoord&&(!0!==c?s.push(Vg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(Vg(`${r} ${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(Vg(`${r} ${e.variableNameAxisCoord}_highpart = ${e.attributeNameAxisCoord}_highpart`),Vg(`${r} ${e.variableNameAxisCoord}_lowpart = ${e.attributeNameAxisCoord}_lowpart`)):s.push(Vg(`${r} ${e.variableNameAxisCoord}_highpart = vec2(${e.attributeNameAxisCoord}_highpartX, ${e.attributeNameAxisCoord}_highpartY)`),Vg(`${r} ${e.variableNameAxisCoord}_lowpart = vec2(${e.attributeNameAxisCoord}_lowpartX, ${e.attributeNameAxisCoord}_lowpartY)`))})),a&&a.rotation){const t=a.rotation.dataType,e="uniform"===t?"u":"a";if("attribute-deg"===t){s.push(Pg("attribute float aRotDeg"),Pg("uniform float uBaseRotDeg"));const t="cRot",e="aInstanceGeo";s.push(Vg(`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(Pg(`${t} vec2 ${i}`));const r="aInstanceGeo";s.push(Vg(`vec2 rotatedGeo = vec2(${r}.x * ${i}.y + ${r}.y * ${i}.x, ${r}.y * ${i}.y - ${r}.x * ${i}.x)`))}}if(a&&s.push(Pg(`attribute ${r} aInstanceGeo`)),!0===l){if("linear-highPrecision"===n)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"===n)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"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + scaling");const t=("attribute"===o.dataType?"a":"u")+"Scaling",r=e?"vec3":"vec2";s.push(Pg(`${o.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} * ${t}`)}))}if(h&&"axis"===h.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + translation (axis)");const t=("attribute"===h.dataType?"a":"u")+"TranslationAxis",r=e?"vec3":"vec2";s.push(Pg(`${h.dataType} ${r} ${t}`)),i.forEach((e=>{f.push(`${e.variableNameAxisCoord} = ${e.variableNameAxisCoord} + ${t}`)}))}if(a&&"axis"===a.sizeUnit){if("linear-highPrecision"===n)throw new Error("Unimplemented vertex location feature combination: linear-highPrecision + offset (axis)");const t=("attribute"===a.dataType?"a":"u")+"OffsetAxis",o=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${o} ${t}`));const h=a.halved?" * 0.5":"",l=a.rotation?"rotatedGeo":"aInstanceGeo",u="offsetGeometry";f.push(`${r} ${u} = ${t} * ${l}${h} * sign(uScale)`),e&&"gpu-calculate"===d&&f.push(`${r} normal = ${l}`),i.forEach((t=>{f.push(`${t.variableNameAxisCoord} = ${t.variableNameAxisCoord} + ${u}`)}))}if(void 0===n||"linear"===n)s.push(Pg(`uniform ${r} uDisp`,`uniform ${r} uScale`)),i.forEach((t=>{f.push(`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord} - uDisp) / uScale`)}));else if("linear-highPrecision"===n)s.push(Pg(`uniform ${r} uDisp`,`uniform ${r} uScale`,`uniform ${r} uScaleStart_highpart`,`uniform ${r} uScaleStart_lowpart`)),i.forEach((t=>{f.push(`${r} ${t.variableNameAxisCoord}_hprecision = (${t.variableNameAxisCoord}_highpart - uScaleStart_highpart) + (${t.variableNameAxisCoord}_lowpart - uScaleStart_lowpart)`,`${r} ${t.variableNameWorldCoord} = (${t.variableNameAxisCoord}_hprecision - uDisp) / uScale`,`${r} ${t.variableNameAxisCoord} = ${t.variableNameAxisCoord}_highpart + ${t.variableNameAxisCoord}_lowpart`)}));else if("matrix"===n)s.push(Pg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("matrix4"===n)s.push(Pg("uniform mat4 uMatrix")),i.forEach((t=>{f.push(`vec4 ${t.variableNameWorldCoord} = uMatrix * ${t.attributeNameAxisCoord}`)}));else if("logarithmic"===n[0]){s.push(Pg(`uniform ${r} uScaleStart`,`uniform ${r} uScaleStartLog`,`uniform ${r} uScaleInterval`,`uniform ${r} uScaleIntervalLog`,`uniform ${r} uViewportStart`,`uniform ${r} uViewportSize`));const t=e?["x","y","z"]:["x","y"],o=[];t.forEach((t=>{const e=n[1][t];if(void 0!==e){const t=e.base;if("e"===t)return;const i=`float cLog${t} = 1.0 / log(${wi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Pg(...o)),i.forEach(((e,i)=>{const s=`${i}`,o=[];t.forEach((t=>{const i=t.toUpperCase(),r=n[1][t];if(void 0===r)f.push(`float posPercent${i}${s} = (${e.variableNameAxisCoord}.${t} - uScaleStart.${t}) / uScaleInterval.${t}`);else{const n=r.base,o="e"===n;f.push(`float posLog${i}${s} = log(${e.variableNameAxisCoord}.${t})${o?"":` * cLog${n}`}`,`float posPercent${i}${s} = (posLog${i}${s} - uScaleStartLog.${t}) / uScaleIntervalLog.${t}`)}o.push(`posPercent${i}${s}`)})),f.push(`${r} ${e.variableNameWorldCoord} = uViewportStart + ${r}(${o.join(", ")}) * uViewportSize`)}))}if(a&&"px"===a.sizeUnit){s.push(Pg("uniform vec2 uRatioPxClip"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Pg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("attribute"===a.dataType?"a":"u")+"OffsetPixels",n=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${n} ${e}`));const o=a.halved?" * 0.5":"",h=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e}${o} * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${h}`)}))}if(a&&"scale"===a.sizeUnit){s.push(Pg("uniform vec2 uRatioPxClip")),s.push(Pg("uniform vec2 uSizePixels"));let t="vec2(0.0, 0.0)";a.useAlignment&&(s.push(Pg("uniform vec2 uOffsetAlignment")),t="uOffsetAlignment");const e=("uniform"===a.dataType?"u":"a")+"OffsetScale";s.push(Pg(`${a.dataType} float ${e}`));const r=`(${a.rotation?"rotatedGeo":"aInstanceGeo"} + ${t}) * ${e} * uSizePixels * uRatioPxClip`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${r}`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l}`)}))}if(a&&"nwu"===a.sizeUnit){s.push(Pg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Pg(`${a.dataType} ${n} ${t}`));const o=a.halved?" * 0.5":"",h=a.rotation?"rotatedGeo":"aInstanceGeo",l="offsetGeometry";f.push(`${r} ${l} = ${t} * ${h}${o}`),e&&"gpu-calculate"===d&&f.push(`${r} normal = normalize(${l})`),i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${l} * uRatioNwuWu`)}))}return t.snapToNearestPixel&&(s.push(Pg("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(Bg("gl_Position =",...f)),s},qg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(zg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(zg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("matrix4"===n)throw new Error("transformWorldCoordBackToAxis | unimplemented vertex location type");if("logarithmic"!==n[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(),r=n[1][e];if(void 0===r)t.push(`float pos${s}Back = ${i}_percent.${e} * uScaleInterval.${e} + uScaleStart.${e}`);else{const n=r.base,o="e"===n?"1.0":`cLog${n}`;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":""})`),r.push(zg(i,...t))}}return r},Qg=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.rE})))(t)?[_g("attribute vec4 aColor"),_g("vColor = aColor"),Pg("attribute vec4 aColorA"),Pg("attribute vec4 aColorB"),Ng("vColor = mix(aColorA, aColorB, aSegmentSide)")]:[],tm=t=>(t=>void 0!==t.find((t=>{var e;return null===(e=t.sE)||void 0===e?void 0:e.nE})))(t)?[_g("attribute float aLookupValue"),_g("vLookupValue = aLookupValue"),Pg("attribute float aLookupValueA"),Pg("attribute float aLookupValueB"),Ng("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],em={"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",sE:{eE:!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:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[Pg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Ng(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTextureText,r=t&&t.maskTexture,n=t&&t.overrideOpacity;return{idFeature:"Color",sE:{hE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,nE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0,rE:"attribute"===t.dataType||void 0},apply:(o,h)=>{let a,l=`Color:${$g(t)}`;const u=[];let c="FragmentShader";const d=[];if("uniform"===i)d.push(Pg("uniform vec4 uColor"),Vg("vec4 colorFragment = uColor"),...s?Hg:[],...r?Xg:[]);else if("attribute"===i)a="colorAttribute",u.push(Og("attribute vec4 aColor","varying vec4 vColor")),d.push(Pg("varying vec4 vColor"),Vg("vec4 colorFragment = vColor"),...s?Hg:[],...r?Xg:[]);else if("texture"===i)a="colorTexCoord",u.push(Og("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),d.push(Pg("varying vec2 vTextureCoord"),Pg("uniform sampler2D uColorTexture"),Pg("uniform vec4 uColor"),Vg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","if(vTextureCoord.x < 0. || vTextureCoord.x > 1. || vTextureCoord.y < 0. || vTextureCoord.y > 1.) {\n colorFragment = uColor;\n }"),...s?Hg:[],...r?Xg:[]);else if("texture-coord-calc-gpu"===i)a="colorTexCoord",c="Empty",u.push(Pg("attribute vec2 aTextureCoord"),Pg("varying vec2 vTextureCoord"),Ng("vTextureCoord = gl_Position.xy * 0.5 + 0.5")),d.push(Pg("varying vec2 vTextureCoord"),Pg("uniform sampler2D uColorTexture"),Vg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord)","gl_FragColor = colorFragment;"));else if(Array.isArray(i)&&"image"===i[0])a="colorTexCoord",u.push(Og("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1].fitMode===e.ImageFitMode.Tile?d.push(Pg("uniform sampler2D uColorTexture"),Pg("varying vec2 vTextureCoord"),Vg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):d.push(Pg("uniform sampler2D uColorTexture"),Pg("varying vec2 vTextureCoord"),Pg("uniform vec4 uColor"),Vg("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",u.push(Og("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;a=`lookup:${t}`,u.push(Og(e,"varying float vLookupValue"))}d.push(Pg("varying float vLookupValue"),...Yg("vLookupValue",i[2]),...s?Hg:[],...r?Xg:[])}else if(Array.isArray(i)&&"gradient"===i[0]){const t=i[1],e=t.getColorStops();et(t)?(l=`rgradient${e.length},${r},${s}`,d.push(Pg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Pg(...It(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Gg.linearStep,Vg("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))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?Hg:[],...r?Xg:[])):rt(t)&&(l=`lgradient${e.length},${r},${s}`,d.push(Pg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Pg(...It(e.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Gg.linearStep,Vg("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))",...e.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?Hg:[],...r?Xg:[]))}if(s||r){const t="maskTexture";a=a?`${a} ${t}`:`Color:${t}`,u.push(Og("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return n&&d.push(Pg("uniform float uOpacity"),zg("colorFragment =","colorFragment.a *= uOpacity")),{vertexShaderModifiers:u,fragmentShader:c,fragmentShaderModifiers:d,idVertex:a,idFragment:l}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${$g(t)}`;return{idFeature:"ColorShaded3D",sE:{hE:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,nE:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&Og("normal","varying vec3 vNormal"),Og("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(Pg("uniform vec4 uColorDiffuse"),Vg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(Og("attribute vec4 aColor","varying vec4 vColor")),a.push(Pg("varying vec4 vColor"),Vg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(Og("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(Og(e,"varying float vLookupValue"))}a.push(Pg("varying float vLookupValue"),...Yg("vLookupValue",e[2]))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(Og("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(Pg("varying vec3 vTriangleBary"),Pg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Gg.computeScreenSpaceWireframe,zg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Wg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Zg(e),r=t.coordType?t.coordType:s?"vec3":"vec2";return"linear-highPrecision"!==t.axisWorldTranslation?!0!==t.splitPosAttribute?i.push(Pg(`attribute ${r} aPos`)):i.push(Pg("attribute float aPosX"),Pg("attribute float aPosY"),s&&Pg("attribute float aPosZ")):!0===t.splitPosAttribute?i.push(Pg("attribute float aPos_highpartX"),Pg("attribute float aPos_lowpartX"),Pg("attribute float aPos_highpartY"),Pg("attribute float aPos_lowpartY")):i.push(Pg(`attribute ${r} aPos_highpart`),Pg(`attribute ${r} aPos_lowpart`)),i.push(...Jg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"vec4"===t.coordType?void 0:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),Model3D:t=>({idFeature:"Model3D",apply:e=>{const i=[];return i.push(Pg("attribute vec3 aGeoPos"),Pg("uniform mat4 uModelRotation"),Pg("uniform mat4 uModelRotationNormals"),Pg("uniform vec3 uLocationAxis"),Pg("uniform vec3 uModelAlignment"),Pg("uniform vec3 uModelScale"),Pg("uniform vec3 uModelSize"),...Jg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,{attributeNameAxisCoord:"uLocationAxis",variableNameAxisCoord:"locationAxis",variableNameWorldCoord:"locationWorld"}),Bg("gl_Position =","vec3 posWorld = locationWorld + ((uModelRotation * vec4(aGeoPos, 1.0)).xyz - (uModelAlignment + 1.0) * uModelSize/2.0) * uModelScale;"),"attribute"===t.normalSource&&zg("vec3 normal ="," normal = (uModelRotationNormals * vec4(normal, 1.0)).xyz;"),...Kg(e)?qg({axisWorldTranslation:"linear",normalSource:t.normalSource},!0,"posWorld","posAxis"):[]),{vertexShaderModifiers:i,idVertex:`Model3D:${$g(t)}`,idFragment:void 0}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[Pg("uniform float uThicknessPixels"),Pg("uniform vec2 uRatioPxClip"),..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA"),Pg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA_highpart"),Pg("attribute vec2 aLocationB_highpart"),Pg("attribute vec2 aLocationA_lowpart"),Pg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationAX"),Pg("attribute float aLocationAY"),Pg("attribute float aLocationBX"),Pg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationA_highpartX"),Pg("attribute float aLocationA_highpartY"),Pg("attribute float aLocationB_highpartX"),Pg("attribute float aLocationB_highpartY"),Pg("attribute float aLocationA_lowpartX"),Pg("attribute float aLocationA_lowpartY"),Pg("attribute float aLocationB_lowpartX"),Pg("attribute float aLocationB_lowpartY")]:[],Pg("attribute vec2 aSegmentPosition"),Pg("attribute float aSegmentSide"),...Jg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),t.ensureMinimumSegmentLength&&Pg("uniform vec2 uMinSegmentPixelVector"),zg("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"),...tm(e),...Qg(e),...Kg(e)?qg(t,!1,"posWorld","posAxis"):[]]})}),Area2D:t=>({idFeature:"Area2D",apply:e=>({idVertex:`Area2D:${$g(t)}`,idFragment:void 0,vertexShaderModifiers:[..."linear-highPrecision"!==t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA"),Pg("attribute vec2 aLocationB")]:"linear-highPrecision"===t.axisWorldTranslation&&!0!==t.splitPosAttribute?[Pg("attribute vec2 aLocationA_highpart"),Pg("attribute vec2 aLocationB_highpart"),Pg("attribute vec2 aLocationA_lowpart"),Pg("attribute vec2 aLocationB_lowpart")]:"linear-highPrecision"!==t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationAX"),Pg("attribute float aLocationAY"),Pg("attribute float aLocationBX"),Pg("attribute float aLocationBY")]:"linear-highPrecision"===t.axisWorldTranslation&&!0===t.splitPosAttribute?[Pg("attribute float aLocationA_highpartX"),Pg("attribute float aLocationA_highpartY"),Pg("attribute float aLocationB_highpartX"),Pg("attribute float aLocationB_highpartY"),Pg("attribute float aLocationA_lowpartX"),Pg("attribute float aLocationA_lowpartY"),Pg("attribute float aLocationB_lowpartX"),Pg("attribute float aLocationB_lowpartY")]:[],Pg("attribute float aCurveOrBaseline"),Pg("attribute float aSegmentSide"),...Jg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),zg("worldB = ","vec2 posCoord = mix(worldA, worldB, aSegmentSide)","float baseline = min(posCoord.y, -1.0)","vec2 posWorld = vec2(posCoord.x, mix(posCoord.y, baseline, aCurveOrBaseline))"),...tm(e),...Qg(e),...Kg(e)?qg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${$g(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Pg("uniform float uOffsetWU"),Pg("attribute vec3 aLocationA"),Pg("attribute vec3 aLocationB"),Pg("attribute float aSegmentPosition"),Pg("attribute float aPerpendHorizontal"),Pg("attribute float aPerpendVertical"),...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Zg(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),zg("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"),...Kg(e)?qg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[Pg("attribute vec3 aEdge"),Pg("uniform float uEdgeRoundness"),zg("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:(r,n)=>({idVertex:void 0,idFragment:`ColorGrid2D:${$g(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[Pg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&Gg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?Vg("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"})`):Vg("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})`)),...Yg("intensityP",t.lut)]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",apply:(o,h)=>{const a=[],l=[];return a.push(Pg("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&&Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[h],"ubyte"===r&&Gg.decodeUbyteRGBAEncodedFloat,Vg(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"===r?"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)), ${n})`} ,\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"===r?"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)), ${n})`},\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"===r?"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)), ${n})`},\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"===r?"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)), ${n})`},\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(Pg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),Vg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${$g(t)}`,idFragment:`DrawToNormalTexture:${$g(t)}`,vertexShaderModifiers:a,fragmentShaderModifiers:l,fragmentShader:"Empty",hints:["uint"===s&&{type:"fragOutput",fragOutput:"uvec4"}]}}}},SurfaceGrid:t=>{const e=t.fillColor,i=t.interpolation,s=t.flipXZ,r=t.shadingStyle,n=t.wireframe,o=t.instanceIdSource,h=t.normalTextureType,a=t.heightmapTextureType,l=t.intensityTextureType,u=t.littleEndian;return{idFeature:"SurfaceGrid",apply:(c,d)=>{const f=[],g=[];return f.push(Pg("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&&Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[d],"ubyte"===a&&Gg.decodeUbyteRGBAEncodedFloat,Vg(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"===a?"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(...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&f.push(Og("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Gg.texelFetchUnsignedWithFallback[d],Ng("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Ng("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Ng("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Pg("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(Pg("varying vec3 vTriangleBary")),"uniform"===e?g.push(Pg("uniform vec4 uColorDiffuse"),Vg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(Og("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(Pg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&Gg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?Vg("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"})`):Vg("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"),...Yg("intensityP",e[2]))):(f.push(Og(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(Pg("varying float vLookupValue"),...Yg("vLookupValue",e[2]))):void 0===e&&g.push(Vg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&g.push(...Wg),n&&(f.push(Pg("attribute vec3 aTriangleBary"),Og("aTriangleBary","varying vec3 vTriangleBary")),g.push(Pg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Gg.computeScreenSpaceWireframe,zg("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:${$g(t)}`,idFragment:`SurfaceGrid:${$g(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${$g(t)}`,idFragment:`DebugSurfaceGridNormals:${$g(t)}`,vertexShaderModifiers:[Pg("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"]),Gg.roundUnsigned,Gg.modulus,Gg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&Gg.decodeUbyteRGBAEncodedFloat,Vg(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?[Gg.texelFetchUnsignedWithFallback[i]]:[],...Jg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),zg("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:[Ng("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[Pg("uniform vec3 uCameraLoc"),zg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[Pg("attribute float aSegmentInside"),Pg("varying float vSegmentInside"),Pg("varying float vSegmentSide"),zg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Ug("#extension GL_OES_standard_derivatives : enable"),Pg("uniform float uAALimit"),Pg("varying float vSegmentInside"),Pg("varying float vSegmentSide"),zg("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,r=t.firstPass,n=[];for(let t=-s;t<=s;t+=1){const e=Math.abs(t);n.push(r?{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:${$g(t)}`,idFragment:`Glow1D:${$g(t)}`,vertexShaderModifiers:[Og("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Pg("uniform sampler2D uTexture"),Pg("varying vec2 vTextureCoord"),Pg("uniform vec2 uTextureSize"),r&&Pg("uniform vec2 uOffsetPx"),!r&&Pg("uniform sampler2D uTextureFirstGlowPass"),!r&&Pg("uniform vec4 uGlowColor"),zg("antiAliasFactor =","vec2 oneTexel = vec2(1.0, 1.0) / uTextureSize",...r?[]:["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)",...r?["vec2 texCoordOffset = vTextureCoord - uOffsetPx * oneTexel",...n.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",...n.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:[Pg("uniform vec4 uColor"),Vg("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:[Og("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Pg("varying vec4 vColor"),Vg("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:[Og("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:[Pg("attribute vec2 aLengthSoFar"),Pg("varying float vLengthSoFar"),Pg("uniform vec2 uStippleCount"),Ng("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Pg("uniform sampler2D uStippleTexture"),Pg("uniform float uStippleScale"),Pg("varying float vLengthSoFar"),"webgl1"===e&&Pg("uniform float uStippleTextureWidthLimiter"),zg("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:[Pg("attribute vec2 aLengthSoFarA"),Pg("attribute vec2 aLengthSoFarB"),Pg("varying float vLengthSoFar"),Pg("uniform vec2 uStippleCount"),Ng("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Pg("uniform sampler2D uStippleTexture"),Pg("uniform float uStippleScale"),Pg("varying float vLengthSoFar"),"webgl1"===e&&Pg("uniform float uStippleTextureWidthLimiter"),zg("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,r="interpolation"in t?t:void 0,n="bilinear"===(null==r?void 0:r.interpolation),o=null==r?void 0:r.intensityTextureType,h=null==r?void 0:r.littleEndian;return{idVertex:void 0,idFragment:`PolarHeatmap:${$g(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[Pg("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",r&&"uniform sampler2D uTileIntensityValues",s&&"uniform vec4 uColor"),Gg.texelFetchWithFallback[i],"ubyte"===o&&Gg.decodeUbyteRGBAEncodedFloat,Vg("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&&Vg("vec4 colorFragment = uColor"),r&&zg("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); }",r.flipXY&&"cellIndex = vec2(cellIndex.y, cellIndex.x)",r.flipXY&&"cellStart = ivec2(cellStart.y, cellStart.x)",r.flipXY&&"cellEnd = ivec2(cellEnd.y, cellEnd.x)","vec2 tileDimensions = "+(r.flipXY?"vec2(uAnnuli, uSectors)":"vec2(uSectors, uAnnuli)"),n&&"vec4 sample00 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",n&&"vec4 sample01 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellStart.x, cellEnd.y), tileDimensions)",n&&"vec4 sample10 = texelFetchWithFallback(uTileIntensityValues, ivec2(cellEnd.x, cellStart.y), tileDimensions)",n&&"vec4 sample11 = texelFetchWithFallback(uTileIntensityValues, cellEnd, tileDimensions)",n&&"float intensity00 = "+("float"===o?"sample00.x":`decodeUbyteRGBAEncodedFloat(sample00, ${h})`),n&&"float intensity01 = "+("float"===o?"sample01.x":`decodeUbyteRGBAEncodedFloat(sample01, ${h})`),n&&"float intensity10 = "+("float"===o?"sample10.x":`decodeUbyteRGBAEncodedFloat(sample10, ${h})`),n&&"float intensity11 = "+("float"===o?"sample11.x":`decodeUbyteRGBAEncodedFloat(sample11, ${h})`),n&&"vec2 lerpFactors = cellIndex - vec2(cellStart)",n&&"float intensityR1 = mix(intensity00, intensity10, lerpFactors.x)",n&&"float intensityR2 = mix(intensity01, intensity11, lerpFactors.x)",n&&"float intensityP = mix(intensityR1, intensityR2, lerpFactors.y)",!n&&"vec4 sample0 = texelFetchWithFallback(uTileIntensityValues, cellStart, tileDimensions)",!n&&"float intensityP = "+("float"===o?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${h})`)),...r?Yg("intensityP",r.lut):[]]}}})},im={"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"},sm={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 rm{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new pt(`Could not find ${this.oE()} ${this.aE()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}oE(){return this.id.toString()}aE(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class nm extends rm{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class om extends rm{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class hm{constructor(t,e,i,s){this.lE=new Map,this.uE=new Map,this.cE=i,this.dE=i.createProgram(),this.fE=`${t.oE()} vertex`,this.AE=`${e.oE()} fragment`,i.attachShader(this.dE,t.shader),i.attachShader(this.dE,e.shader),i.bindAttribLocation(this.dE,0,"aPos"),i.linkProgram(this.dE),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""}gE(t){return me(0,(()=>ye()))}pE(t){const e=this.mE(t);if(void 0===e)throw this.gE(`Could not get ${t} uniform from ${this.fE} and ${this.AE} shaders.`);return e}mE(t){const e=this.lE.get(t);if(e)return e;const i=this.cE.getUniformLocation(this.dE,t);return i?(this.lE.set(t,i),i):void 0}yE(t){const e=this.SE(t);if(void 0===e)throw this.gE(`Could not get ${t} attribute from ${this.fE} and ${this.AE} shaders.`);return e}SE(t){const e=this.uE.get(t);if(e||0===e)return e;const i=this.cE.getAttribLocation(this.dE,t);return i>=0?(this.uE.set(t,i),i):void 0}U(){this.cE.deleteProgram(this.dE)}}const am=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/,lm=t=>{let e;try{e=bt.getComputedStyle(t)}catch(t){return null}return e};function um(t){const e=lm(t);return!!e&&("fixed"===e.position||!!("auto"!==e.zIndex&&"static"!==e.position||function(t){const e=lm(gm(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||!!am.test(e.willChange)||"touch"===e.webkitOverflowScrolling)}function cm(t){let e=t.length;for(;e--;)if(um(t[e]))return t[e];return null}function dm(t){var e;return t&&Number((null===(e=lm(t))||void 0===e?void 0:e.zIndex)||0)||0}function fm(t){const e=[];for(;t;)e.push(t),t=gm(t);return e}function gm(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.host)||t.parentNode}class mm extends xg{constructor(t){if(super(),this.vE=new Map,this.xE=new Map,this.bE=new Map,this.ME=!0,this._E=null,this.wE=null,this.CE=null,this.kE=null,this.TE=0,this.FE=0,this.IE=0,this.PE=!1,this.DE=!0,this.Xi=!1,this.BE=ce(`chart-engine-${(new Date).getTime()}${Math.trunc(1e6*Math.random()).toString()}`),this.j={x:100,y:100},this.LE=()=>{this.RE&&clearTimeout(this.RE),this.RE=setTimeout((()=>this.Qr()),12)},this.EE=t=>{const e=t.intersectionRatio>0,i=t.target.getAttribute("data-lcjs-engine-id");if(i){const t=this.vE.get(i);if(t){const s=t.zE();t.VE(e),e?this.xE.set(i,t):this.xE.delete(i),s!==e&&t.vs()}}},this.OE=(t,e,i,s,r)=>{const n=r[0],o=this.gl;if(o.bindFramebuffer(null==o?void 0:o.FRAMEBUFFER,null),o.useProgram(this.wE.dE),o.clear(o.COLOR_BUFFER_BIT),n.Wr.getBoundingClientRect()){const t=n.NE();o.viewport(0,0,t.x,t.y),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,n.GE),o.uniform1i(this.TE,0),o.uniformMatrix4fv(this.FE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),o.bindBuffer(o.ARRAY_BUFFER,this.CE),o.enableVertexAttribArray(0),o.vertexAttribPointer(this.IE,2,o.FLOAT,!1,0,0),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),n.WE&&(n.WE.clearRect(0,0,n.WE.canvas.width,n.WE.canvas.height),n.WE.drawImage(this.UE,0,this.UE.height-t.y,t.x,t.y,0,0,n.WE.canvas.width,n.WE.canvas.height))}},this.YE=(t,e,i,s,r)=>{const n=this.gl;n.bindFramebuffer(null==n?void 0:n.FRAMEBUFFER,null),n.useProgram(this.wE.dE),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Wr.getBoundingClientRect();if(r){const i=r.right-r.left,o=r.bottom-r.top,h=r.left,a=s-r.bottom;n.viewport(h*this.HE-t*this.HE,a*this.HE+e*this.HE,i*this.HE,o*this.HE)}n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.GE),n.uniform1i(this.TE,0),n.uniformMatrix4fv(this.FE,!1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),n.bindBuffer(n.ARRAY_BUFFER,this.CE),n.enableVertexAttribArray(0),n.vertexAttribPointer(this.IE,2,n.FLOAT,!1,0,0),n.drawArrays(n.TRIANGLES,0,6)})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.$E=(t,e,i,s,r)=>{const n=r[0],o=this.gl2.ctx;o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null),o.clear(o.COLOR_BUFFER_BIT);const h=n.NE();o.bindFramebuffer(o.READ_FRAMEBUFFER,n.XE[1]),o.blitFramebuffer(0,0,h.x,h.y,0,this.UE.height-h.y,h.x,this.UE.height,o.COLOR_BUFFER_BIT,o.LINEAR),n.WE&&(n.WE.clearRect(0,0,n.WE.canvas.width,n.WE.canvas.height),n.WE.drawImage(this.UE,0,0)),o.bindFramebuffer(o.FRAMEBUFFER,null)},this.jE=(t,e,i,s,r)=>{const n=this.gl2.ctx;n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null),n.clear(n.COLOR_BUFFER_BIT),r.forEach((i=>{const r=i.Wr.getBoundingClientRect();if(r){const o=r.right-r.left,h=r.bottom-r.top,a=r.left,l=s-r.bottom,u=i.NE();n.bindFramebuffer(n.READ_FRAMEBUFFER,i.XE[1]),n.blitFramebuffer(0,0,u.x,u.y,a*this.HE-t*this.HE,l*this.HE+e*this.HE,(a-t+o)*this.HE,(l+e+h)*this.HE,n.COLOR_BUFFER_BIT,n.LINEAR)}})),n.bindFramebuffer(n.FRAMEBUFFER,null)},this.RE=void 0,this.Yn=t,!bt.requestAnimationFrame||!bt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");let e=1;if(t&&t.ZE)e=!0===t.ZE?bt.devicePixelRatio||1:t.ZE||1;else{const t=bt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(e=bt.devicePixelRatio||1)}this.HE=e,t.$n=!0===t.$n,this.DE=!1!==t.QE,this.JE=!1!==t.KE,this.qE=t.qE||!1;let i=!1;if(t.UE)if("string"==typeof t.UE){const e=bt.document.getElementById(t.UE);if(!e)throw new Error(`Canvas "${t.UE}" doesn't exist.`);this.UE=e,i=!0}else this.UE=t.UE,i=!0;else this.UE=bt.document.createElement("canvas");const s={preserveDrawingBuffer:!0,alpha:!0,antialias:!1};if(2!==t.tz&&t.tz){const e=this.UE.getContext("webgl",{...s,antialias:!!t.QE})||this.UE.getContext("experimental-webgl",{...s,antialias:!!t.QE});this.gl=e,this.iz=!1}else{const t=this.UE.getContext("webgl2",s);this.gl2={ctx:t},this.gl=t,this.iz=!0}if(!this.gl)throw new yt("No WebGL context available."+((null==t?void 0:t.tz)?`\nSelected explicit target: WebGL ${t.tz}`:""));const r=[];if(this.sz={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.sz).forEach((t=>{null===this.sz[t]&&r.push(t)})),this.iz)this.ez=!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.ME=!1),Object.keys(t).forEach((e=>{null===t[e]&&r.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.ez=!!e.OES_texture_float,this.gl1={ctx:this.gl,sz:t,optional:e}}const n=r;if(n.length>0&&!1!==t.$n){const t=bt.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=bt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),bt.document.body.appendChild(t),t.appendChild(e),bt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",n.join(", "))}if(this.hz=this.qE?this.rz(this.iz?this.$E.bind(this):this.OE.bind(this)).bind(this):this.nz(this.iz?this.jE.bind(this):this.YE.bind(this)).bind(this),bt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.UE&&this.oz()};this.Qn=new bt.ResizeObserver(t.bind(this)),this.Qn.observe(this.UE)}if(this.az=((t,e)=>{const i=t,s=new Map,r=new Map,n=new Map,o={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},h=(t,i,s=[])=>{const r=[],n=[],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&&n.push(...e),t=t.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(t=(t=(t=t.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.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 n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:t=`${r.join("\n")}\n${t}`,info:o}};return(...t)=>{const a=e?"webgl1":"webgl2";let l,u,c,d,f,g,m,y,p;try{const e=bt.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(" "),r=i.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" "),n=`vert: ${s} frag: ${r}`;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(i.forEach((t=>{if(t.defaultVertexShader&&(h||(o=t.defaultVertexShader)),t.vertexShader){if(o&&h&&o!==t.vertexShader)throw new jg(`Conflicting vertex shader templates ${o} vs ${t.vertexShader}`,n,t);o=t.vertexShader,h=!0}if(t.vertexShaderModifiers)for(const e of t.vertexShaderModifiers)void 0!==e&&!1!==e&&l.push(e);if(t.defaultFragmentShader&&(a||(u=t.defaultFragmentShader)),t.fragmentShader){if(u&&a&&u!==t.fragmentShader)throw new jg(`Conflicting fragment shader templates ${u} vs ${t.fragmentShader}`,n,t);u=t.fragmentShader,a=!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 jg("No vertex shader template defined",n);if(!u)throw new jg("Fragment shader not defined",n);return{id:n,vertexShader:{id:s,template:o,modifiers:l},fragmentShader:{id:r,template:u,modifiers:c},hints:d}})(l,a);const x=n.get(u.id);if(c="new",x)return c="existing",g=x.vertexShaderSrc,m=x.fragmentShaderSrc,x;const S=u.vertexShader.id;let A=s.get(S);if(A)g=A.src,d="existing";else{d="new";const t=new Fg(u.vertexShader.modifiers).build(im[u.vertexShader.template]),{source:e,info:r}=h(t,"vertex");g=e,y=r,A=new nm(S,e,i,r),s.set(S,A),o.vertexShaders+=1}const v=u.fragmentShader;let b;const M=v.id;if(b=r.get(M),b)m=b.src,f="existing";else{f="new";const t=sm[v.template],e=new Fg([...v.modifiers]).build(t),{source:s,info:n}=h(e,"fragment",u.hints);m=s,p=n,b=new om(M,s,i,n),r.set(M,b),o.fragmentShaders+=1}const E=new hm(A,b,i,u);return n.set(u.id,E),o.programs+=1,o.totalMs+=bt.performance.now()-e,E}catch(t){throw me(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 bt.alert(t),new Error(t)}))}}})(this.gl,!this.iz),this.qR=(()=>{const t=bt.document.createElement("canvas"),e=t.getContext("2d",{willReadFrequently:!0});if(!e)throw new yt("Failed to get Text canvas rendering context");return e.fillStyle="#fff",(i,s,r,n)=>{const o=`${s.style} ${s.weight} ${s.size*r}px ${s.family}`;e.font=o,e.textBaseline="alphabetic",e.textAlign="left";const h=e.measureText(i);if(0===h.width)return;const a=void 0!==h.actualBoundingBoxLeft&&void 0!==h.actualBoundingBoxRight?Math.ceil(h.actualBoundingBoxLeft+h.actualBoundingBoxRight):Math.ceil(h.width),l=h.width,c=Math.round(s.size*r),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;t.width=a>0?a:l,t.height=2*c,e.font=o,e.textBaseline="alphabetic",e.textAlign="left",n?(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 y=f.width;for(let t=0;t=0;t-=1){for(let e=0;e{for(let e=0;ee/100))})),bt.addEventListener("resize",this.LE,{passive:!0}),!this.iz){if(this.wE=this.az(em["2DCompose"],em.Color({dataType:"texture-coord-calc-gpu"}),em.VertexLocation({axisWorldTranslation:"matrix4",normalSource:void 0,coordType:"vec4"})),!this.wE.dE)throw new yt("Unable to setup composition shader!");const t=this.gl,e=t.getUniformLocation(this.wE.dE,"uColorTexture");if(!e)throw new yt("Unable to setup composition shader! Failed to find uColorTexture");const i=t.getUniformLocation(this.wE.dE,"uMatrix");if(!i)throw new yt("Unable to setup composition shader! Failed to find uMatrix");this.TE=e,this.FE=i,this.IE=t.getAttribLocation(this.wE.dE,"aPos"),this.CE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.CE),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.kE=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.kE),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)}}rz(t){return e=>{this._E=null;const i=this.gl.canvas,s=Array.from(this.xE.values());this.PE=!1,s.forEach((s=>{const r=s.NE();(this.j.x{this._E=null,"style"in this.gl.canvas&&!this.Yn.fz&&(this.gl.canvas.style.transform=`translateX(${window.scrollX}px) translateY(${window.scrollY}px)`);const i=this.gl.canvas,s=this.UE.clientHeight,r=this.UE.clientWidth;let n=0,o=0;if(i instanceof HTMLCanvasElement){i.width===r*this.HE&&i.height===s*this.HE||(i.width=r*this.HE,i.height=s*this.HE);const t=i.getBoundingClientRect();n=t.x,o=t.y}const h=Array.from(this.xE.values());this.PE=!1,h.sort(((t,e)=>t.Az()-e.Az())).forEach((t=>{t.rn&&t.dz(e)})),t(n,o,r,s,h),this.PE&&this.oz()}}oz(t){return!this.PE&&t&&(this.PE=!0),this._E||this.Xi||(this._E=bt.requestAnimationFrame(this.hz)),this}gz(t){const e=this.BE();return t.Wr.setAttribute("data-lcjs-engine-id",e),this.vE.set(e,t),t.pz(this.vE.size-1),t.VE(!0),this.xE.set(e,t),this.cz&&this.cz.observe(t.Wr),this.RE&&clearTimeout(this.RE),this.RE=setTimeout((()=>this.Qr()),0),this}mz(t){const e=t.Wr.getAttribute("data-lcjs-engine-id");return e?(this.vE.delete(e),this.xE.delete(e),this.cz&&this.cz.unobserve(t.Wr),t.Wr.removeAttribute("data-lcjs-engine-id"),this):this}Qr(){if(this.cz){const t=this.cz.takeRecords();for(let e=0;efunction(t,e){if(t===e)throw new Error("Cannot compare node with itself");const i={a:fm(t),b:fm(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 r=dm(cm(i.a)),n=dm(cm(i.b));if(r===n&&s){const t=s.childNodes,e={a:i.a[i.a.length-1],b:i.b[i.b.length-1]};let r=t.length;for(;r--;){const i=t[r];if(i===e.a)return 1;if(i===e.b)return-1}}return Math.sign(r-n)}(t.Wr,e.Wr))).forEach(((t,e)=>t.pz(e))),this.oz(!0),this}fP(){return this.oz(),this}yz(){this.Xi||this.vE.forEach((t=>t.hp.layout()))}U(){var t;if(this.Xi)return;this.Xi=!0,super.U(),this._E&&(bt.cancelAnimationFrame(this._E),this._E=null),this.PE=!1,this.Qn&&(this.Qn.disconnect(),this.Qn=void 0),this.cz&&(this.cz.disconnect(),this.cz=void 0),bt.removeEventListener("resize",this.LE),this.LE=void 0,this.vE.forEach((t=>{t.U()})),this.vE.clear(),Array.from(this.bE.values()).forEach((t=>{t.OR(!0)})),this.bE.clear();const e=this.gl;e.deleteBuffer(this.CE),e.deleteBuffer(this.kE),this.UE&&!this.Yn.UE?(this.UE.width=1,this.UE.height=1,null===(t=this.UE.parentElement)||void 0===t||t.removeChild(this.UE),this.UE=void 0):this.UE=void 0,this.az=void 0,this.qR=void 0,this.hz=()=>{},this.sz.WEBGL_lose_context&&this.sz.WEBGL_lose_context.loseContext()}}const ym=(t,e,i,s)=>r=>{const n={theme:mg,...i,...r},o=t(n),h=e||s?yg(o,s):void 0,a=new Ff(o.Yn,r,o,o.U.bind(o),h);return o.co((t=>a.VL(t))).uo((()=>a.Z())).vs(),a},pm=(t,e)=>{t.co((t=>{e.Fe(t)})).uo((()=>e.Z())).vs()},xm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Jh(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h);return pm(o,a),a},Sm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Vc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},Am=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Ud(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},vm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Zc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},bm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:Oa)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Mm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:yd)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,!0!==(null==r?void 0:r.disableAnimations)&&!1!==(null==r?void 0:r.animationsEnabled));return pm(o,a),a},Em=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:nd)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},wm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new(r&&r.type?r.type:Ed)(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Tm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Rl(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r,void 0);return pm(o,a),a},km=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Sl(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Cm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new ff(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0);return pm(o,a),a},Rm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Ef(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,void 0,r);return pm(o,a),a},Im=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Uc(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a},Fm=(t,e,i,s)=>r=>{const n={...i,...r,theme:(null==r?void 0:r.theme)||mg},o=t(n),h=e||s?yg(o,s):void 0,a=new Qf(o.Yn,Gd(o,1).BI(0),ut,o.U.bind(o),h,r);return pm(o,a),a};function Dm(t,i,s,r,n,o){let h=i.x.dt(t.max.x),a=i.x.dt(t.min.x),l=i.y.dt(t.max.y),u=i.y.dt(t.min.y),c=h-a,d=l-u;if(c<1){const t=(a+h)/2;a=t-.5,h=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,y=c-g,p=d-m,x=g>y?[y,g]:[g,y],S=m>p?[p,m]:[m,p];let A,v,b=1,M=1;switch(r){default:case e.GradientExtent.closestSide:if(A=x[0]/c,v=S[0]/d,n===e.GradientShape.circle){const t=Math.min(A*f,v);b=t,M=t}else b=A*f,M=v;break;case e.GradientExtent.farthestSide:if(A=x[1]/c,v=S[1]/d,n===e.GradientShape.circle){const t=Math.max(A*f,v);b=t,M=t}else b=A*f,M=v;break;case e.GradientExtent.closestCorner:if(v=S[0]/d,n===e.GradientShape.circle){A=x[0]/c*f;const t=Math.sqrt(A*A+v*v);b=t,M=t}else{A=x[0]/c;const t=Math.sqrt(A*A+v*v);b=t*f,M=t}break;case e.GradientExtent.farthestCorner:if(v=S[1]/d,n===e.GradientShape.circle){A=x[1]/c*f;const t=Math.sqrt(A*A+v*v);b=t,M=t}else{A=x[1]/c;const t=Math.sqrt(A*A+v*v);b=t*f,M=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(b,1e-4),Math.max(M,1e-4)],aspectRatio:f}}function Lm(t,e,i,s){const r=e.x.dt(t.max.x),n=e.x.dt(t.min.x),o=e.y.dt(t.max.y),h=e.y.dt(t.min.y),a=r-n,l=o-h,c=Math.abs(a*Math.sin(i))+Math.abs(l*Math.cos(i)),d=u(a/2-Math.sin(i)*(c/2),l/2-Math.cos(i)*(c/2)),f=u(a/2+Math.sin(i)*(c/2),l/2+Math.cos(i)*(c/2));return{bounds:[n*s,h*s,a*s,l*s],startPoint:[d.x*s,d.y*s],endPoint:[f.x*s,f.y*s]}}class Pm{constructor(t){this.ER=t}}class _m{constructor(){this.Sz=new Array,this.vz=t=>(this.Sz.push(t),t),this.xz=this.vz(new Map),this.bz=this.vz(new Map),this.Mz=this.vz(new Map),this._z=this.vz(new Map),this.wz=this.vz(new Map),this.Cz=this.vz(new Map),this.kz=this.vz(new Map)}Tz(){this.Sz.forEach((t=>{t.forEach((t=>t.Tz())),t.clear()}))}}const Vm=(t,e,i)=>()=>{t.Fz=e,i&&i()},Bm=(t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,y=1;switch(n){case e.ImageFitMode.Fill:u{this.Lz=!0,this.Oz()})),this.nc.addEventListener("error",(()=>{this.Rz=!0})),this.nc.complete&&(this.Lz=!0,this.Oz());else if(this.nc instanceof bt.HTMLVideoElement){const t=this;this.nc.addEventListener("canplay",(function(){t.Pz=this.videoHeight,t.Iz=this.videoWidth,t.Lz=!0,t.Oz()}),!0),this.nc.addEventListener("play",Vm(this,!0,(()=>this.Oz()))),this.nc.addEventListener("playing",Vm(this,!0,(()=>this.Oz()))),this.nc.addEventListener("pause",Vm(this,!1)),this.nc.addEventListener("ended",Vm(this,!1)),this.nc.readyState>=1&&(this.Iz=this.nc.videoWidth,this.Pz=this.nc.videoHeight,this.Fz=!this.nc.paused,this.Lz=!0,this.Oz())}else this.Lz=!0,this.Oz()}ZR(t){0===this.zz.size&&this.Lz&&this.Oz(),this.zz.add(t)}QR(t){this.zz.delete(t),0===this.zz.size&&this.unbindResources()}Nz(t){this.Ez.add(t),this.Bz&&(t(),this.Gz(t))}Gz(t){this.Ez.delete(t)}Oz(){if(this.Rz||this.Bz||!this.Lz)return;const t=this.cE.gl;if(!this.Vz&&this.nc&&t){this.Vz=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.Vz),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.nc,o=this.Iz>0?this.Iz:n.width,h=this.Pz>0?this.Pz:n.height;t.texImage2D(t.TEXTURE_2D,e,i,s,r,n),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.Iz=o,this.Pz=h,t.bindTexture(t.TEXTURE_2D,null)}this.Bz=!0,this.Ez&&this.Ez.forEach((t=>{t(),this.Gz(t)}))}Ds(){const t=this.cE.gl;if(!this.Rz&&this.Bz&&this.Vz){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.nc;n&&(t.bindTexture(t.TEXTURE_2D,this.Vz),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}Wz(){return this.Vz}unbindResources(){return this.Bz&&(this.Vz&&(this.cE.NR(this.Vz),this.Vz=null),this.Bz=!1),this}}class Nm extends Gr{constructor(t,e,i){super(t.cs,e,i),this.sS=!0,this.Zy={},this.tS=p(Gn),this.Ts=t,this.ft=t.ft}Uz(){var t;return this.tS.o&&this.tS._().type!==(null===(t=this.Yz)||void 0===t?void 0:t.type)}oS(t){return this.sS=t,this}$z(t){return this.Zy=t,this}}class Om{constructor(t){this.SV=[],this.ER=t}vV(t,e){((t,e,i,s)=>{const r=t.Xz(),n=Math.round(Math.min(i.spread,10)*r),o=Math.round(Math.min(i.blur,10)*r),h={x:Math.round(i.offset.x*r),y:Math.round(i.offset.y*r)},a=t.jz(),l=t.Zz(),u=t.Qz(),c=t.Jz(),d=t.Kz();t.qz("disabled"),t.oS(!1),t.tV(!1);const f=e.iV(),g=n+o/2;((t,e,i,s)=>{const r=t.gl,n=t.Xz(),o=t.sV();t.eV(r.FRAMEBUFFER,s.frameBuffer),r.bindRenderbuffer(r.RENDERBUFFER,s.depthBuffer),r.bindTexture(r.TEXTURE_2D,s.texture),r.clearDepth(1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT);const h=s.sizeDpr;t.hV(0,0,h.x,h.y),e.forEach((e=>{let s;if(e instanceof Hr?s=e.Ts.wp():e instanceof Nm&&(s=e.Ts.qv()),s){const e=s.x+i.left,r=s.y+i.bottom,o=Math.max(s.width-(i.left+i.right),0),h=Math.max(s.height-(i.bottom+i.top),0);t.rV(e*n,r*n,o*n,h*n)}else t.tV(!1);e.VL(2)})),t.eV(r.FRAMEBUFFER,o),r.bindRenderbuffer(r.RENDERBUFFER,null),r.bindTexture(r.TEXTURE_2D,null),t.tV(!1)})(t,s,{left:g+(h.x<0?-h.x:0),top:g+(h.y>0?h.y:0),right:g+(h.x>0?h.x:0),bottom:g+(h.y<0?-h.y:0)},f);let m=f;const y=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;ize(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=Je(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Hr||t instanceof Nm?t.Ts.nV(t):_e;if(pe(e))return _e;const r={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 r.max.x<=r.min.x||r.max.y<=r.min.y?_e:r})).filter((t=>!pe(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=li(t.min,s),i=li(t.max,s),r=e,n=i;o[h+0]=e.x,o[h+1]=e.y,o[h+2]=r.x,o[h+3]=r.y,o[h+4]=i.x,o[h+5]=e.y,o[h+6]=n.x,o[h+7]=r.y,o[h+8]=i.x,o[h+9]=i.y,o[h+10]=n.x,o[h+11]=n.y,o[h+12]=i.x,o[h+13]=i.y,o[h+14]=n.x,o[h+15]=n.y,o[h+16]=e.x,o[h+17]=i.y,o[h+18]=r.x,o[h+19]=n.y,o[h+20]=e.x,o[h+21]=e.y,o[h+22]=r.x,o[h+23]=r.y,h+=24})),{vertexBuffer:t.oV(o),vertexCount:n}})(t,s,{left:y+(h.x<0?-h.x:0),top:y+(h.y>0?h.y:0),right:y+(h.x>0?h.x:0),bottom:y+(h.y<0?-h.y:0)},e.aV()),x=e.iV(f,m),S=t.az(em["2D"],em.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl,h=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,((h,a,l,u)=>(t.ZR(s),n&&n(h),t.fV(h("uIsHighlighted"),0).gR(h("uHighlightColorOffset"),R).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),i.uniforms.AV()).cV(h("uDisp"),i.uniforms.gV()).cV(h("uScaling"),[i.size.x,i.size.y]).cV(h("uTranslationAxis"),[0,0]).uV(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Zm(o.TRIANGLES,r.vertexCount,0),!0))),t.eV(o.FRAMEBUFFER,h),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,m,x,S,p,((e,i,s,r)=>(t.cV(e("uOffsetPx"),[h.x,h.y]),!0))),m=x,t.tV(l),t.pV(d);const A=t.az(em["2D"],em.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r)=>{const n=t.gl,o={x:t.cs.ai().x,y:t.cs.ai().y};t.hV(0,0,o.x*t.Xz(),o.y*t.Xz());const h=ut.d2({scaleXYConstructor:_i}).tt(o).Oi(0,o.x).Ni(0,o.y),a=new Ym;a.mV(h),t.lV(i,((h,l,u,c)=>(t.ZR(i),r&&r(h),t.fV(h("uIsHighlighted"),0).gR(h("uHighlightColorOffset"),R).fV(h("uRenderEffectMask"),0).dV(h("uTexture"),e.texture,0).cV(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).cV(h("uScale"),a.AV()).cV(h("uDisp"),a.gV()).cV(h("uScaling"),[o.x,o.y]).cV(h("uTranslationAxis"),[0,0]).uV(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Zm(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,A,p,((e,s,r,n)=>(t.dV(e("uTextureFirstGlowPass"),x.texture,1).gR(e("uGlowColor"),i.color),!0))),t.hV(a.x,a.y,a.width,a.height),t.qz(u),t.oS(c),t.yV(p.vertexBuffer)})(this.ER,this,e,t)}aV(){const t=this.ER.cs.ai();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}iV(...t){const e=this.SV,i=this.aV(),s={x:Math.ceil(i.x*this.ER.Xz()),y:Math.ceil(i.y*this.ER.Xz())},r=this.ER.gl,n=e.find((e=>!t.includes(e)));if(n)return n.sizeDpr.x===s.x&&n.sizeDpr.y===s.y||(n.size=i,n.sizeDpr=s,r.bindTexture(r.TEXTURE_2D,n.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.bindRenderbuffer(r.RENDERBUFFER,n.depthBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.bindTexture(r.TEXTURE_2D,null),r.bindRenderbuffer(r.RENDERBUFFER,null),n.scale.tt(i).Oi(0,i.x).Ni(0,i.y),n.uniforms.mV(n.scale)),n;const o=r.createTexture(),h=this.ER.xV(),a=this.ER.bV();r.bindTexture(r.TEXTURE_2D,o),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,s.x,s.y,0,r.RGBA,r.UNSIGNED_BYTE,null),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const l=this.ER.sV();this.ER.eV(r.FRAMEBUFFER,h),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,o,0),r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_COMPONENT16,s.x,s.y),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,a),r.bindTexture(r.TEXTURE_2D,null),this.ER.eV(r.FRAMEBUFFER,l),r.bindRenderbuffer(r.RENDERBUFFER,null);const u=ut.d2({scaleXYConstructor:_i}).tt(i).Oi(0,i.x).Ni(0,i.y),c=new Ym;c.mV(u);const d={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:u,uniforms:c};return e.push(d),d}U(){[this.SV].forEach((t=>{t.forEach((t=>{this.ER.MV(t.depthBuffer),this.ER._V(t.frameBuffer),this.ER.NR(t.texture)})),t.length=0}))}}class Um{constructor(t,i,s,r,n=!0){this.wV=new _m,this.CV=new Map,this.kV=new Map,this.TV=[],this.ZE=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(bt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.sS=!1,this.cV=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.FV=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.IV=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.PV=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.DV=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.BV=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.gR=(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.LV=(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 yt("Could not bind a texture.")},this.RV=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,s=Float32Array)=>{const r=t.length,n=this.EV(r,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,n),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof s?t:new s(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),n)return n;throw new yt("Could not create vertex buffer")},this.zV=(t,e,i,s=Float32Array)=>{const r=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),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),r)return r;throw new yt("Could not create vertex buffer")},this.VV=(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.OV=(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.NV=(t,e)=>{const i=t.length,s=this.EV(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 yt("Could not create index buffer")},this.GV=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 yt("Could not create float buffer")},this.WV=(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.UV=(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 r=0;for(let t=0;t-1&&this.gl.enableVertexAttribArray(e)}let n=0;for(let t=0;t-1&&this.gl.vertexAttribPointer(e.location,e.size,this.gl.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),n+=e.size}if(void 0!==e)for(let t=0;t-1&&this.YV(s,e)}return this},this.HV=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.$V=(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.XV=(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.YV(t,i)),this),this.jV=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.ZV=null,this.Zm=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.QV=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.JV=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.KV=(t,e,i,s,r=this.gl.UNSIGNED_SHORT)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawElementsInstanced(t,e,r,i,s),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.YV=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.sz.ANGLE_instanced_arrays)return bt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.sz.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.qV=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r);const n=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.Zz();o&&this.tV(!1),t(),o&&this.tV(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.eV(this.gl.FRAMEBUFFER,n)},this.Gt=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT),this),this.tO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.ZR=t=>(this.gl.useProgram(t.dE),this),this.iO=!1,this.sO=[],this.cs=t,this.dA=i,this.cs=t,this.gl=s.ctx,this.eO=s.antialias,this.hO=!!this.cs.Jr.ME&&s.lineAntialias,this.ez=this.cs.Jr.ez,this.rO=new Map,this.gl1=this.cs.Jr.gl1,this.gl2=this.cs.Jr.gl2,n&&(this.pV(!0),this.nO()),this.sz=this.cs.Jr.sz,this.VR=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.YR=this.oO(),this.az=this.cs.Jr.az,this.aO=new Xm(this),this.qR=this.cs.Jr.qR,this.lO=new Om(this),this.bE=this.cs.Jr.bE,this.uO=this.oV([0,0,1,0,1,1,0,1]),this.cO=this.oV([0,0,1,0,0,1,0,1,1,0,1,1])}qz(t){return t!==this.dO&&(this.dO=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}Qz(){return this.dO||"disabled"}oS(t){return t!==this.sS&&(this.sS=t,t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST)),this}Jz(){return this.sS}fO(t){return this.ZE=t,this}Xz(){return this.ZE}EV(t,e){let i;if(e){const s=this.rO.get(e);s&&s.size>=t&&s.size-t<1e6?i=e:this.yV(e)}return i||(i=this.gl.createBuffer(),this.rO.set(i,{size:t})),i}AO(t,e=this.gl.RGBA,i=!1,s,r,n=!1,o=this.gl.UNSIGNED_BYTE,h=e){const a=this.gl.createTexture();if(!a)throw new yt("Couldn't reserve Texture.");return this.gl.bindTexture(this.gl.TEXTURE_2D,a),this.gl.pixelStorei(this.gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),t&&null===r?this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,e,o,t):r&&this.gl.texImage2D(this.gl.TEXTURE_2D,0,h,r.x,r.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),a}NR(t){this.gl.deleteTexture(t)}xV(){const t=this.gl.createFramebuffer();if(!t)throw new yt("Couldn't reserve Framebuffer.");return t}eV(t,e){this.ZV=e,this.gl.bindFramebuffer(t,e)}sV(){return this.ZV}_V(t){this.gl.deleteFramebuffer(t)}bV(){const t=this.gl.createRenderbuffer();if(!t)throw new yt("Couldn't reserve Render buffer.");return t}MV(t){this.gl.deleteRenderbuffer(t)}hV(t,e,i,s){return this.gl.viewport(t,e,i,s),this.gO&&t===this.gO.x&&e===this.gO.y&&i===this.gO.width&&s===this.gO.height||(this.gO={x:t,y:e,width:i,height:s}),this}jz(){return this.gO||{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.pO||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.pO=t),this}pV(t){return t!==this.iO&&(this.iO=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}Kz(){return this.iO}nO(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)}Zz(){return void 0!==this.pO&&this.pO}lV(t,e){const i=new Wm(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}yV(t){t&&(this.gl.deleteBuffer(t),this.rO.delete(t))}mO(t,e,i){this.cV(t.uniform("uCenter"),e.center).cV(t.uniform("uDistance"),e.distance).IV(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._O.buffer;this._O&&(this.yV(this._O.buffer),this._O=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.sO.splice(this.sO.indexOf(l),1)}))}IO(t,e,i,s,r,n,o,h){const a=this.gl,l=this.sV();this.eV(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),this.eV(this.gl.FRAMEBUFFER,l)}PO(t){const e=this.kV.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new yt("Couldn't reserve Texture.");this.gl.bindTexture(this.gl.TEXTURE_2D,e);const s=[];let r=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}EO(t,i,s,r,n,o){const h=s&&s.getSource()||r&&r.nc,a=s?s.getFitMode():e.ImageFitMode.Stretch,l=t=>{t.texCoordsBuffer=this.oV(o(t.texture.Iz,t.texture.Pz,a),!1,t.texCoordsBuffer)};if(h){let e=i;if((!i||h!==i.source)&&h){i&&(i.texture.QR(t),this.yV(i.texCoordsBuffer));const r=this.SO(h);r.ZR(t);const n=s?s.getSourceMissingColor():ks.color;e={texture:r,source:h,texCoordsBuffer:this.oV([]),sourceMissingTexture:this.AO(new Uint8Array([n.getR(),n.getG(),n.getB(),n.getA()]),this.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{e&&h&&(l(e),this.cs.vs())}},r.Nz(e.textureReadyCallback),l(e)}return e&&e.texture.Bz&&e.texture.Dz&&e.texture.Fz&&(e.texture.Ds(),this.cs.vs()),n&&e&&e.texture.Bz&&l(e),e}i&&this.zO(t,i)}zO(t,e){e&&(e.texture.QR(t),e.texture.Gz(e.textureReadyCallback),this.NR(e.sourceMissingTexture),this.yV(e.texCoordsBuffer))}VO(t,e,i,s){const{uniform:r,uniformOptional:n,attribute:o}=t,h=i.ft,a=this.Xz();this.fV(r("uIsHighlighted"),1===e||2===e?0:i.Vo).gR(r("uHighlightColorOffset"),1===e||2===e?I:i.Wo).fV(r("uRenderEffectMask"),2===e?1:0).cV(n("uRatioPxClip"),[2/this.cs.ai().x,2/this.cs.ai().y]).fV(n("uDevicePixelRatio"),a),h instanceof _i||h instanceof $c?this.cV(r("uScale"),s.uniforms.AV()).cV(r("uDisp"),s.uniforms.gV()).cV(n("uScaleStart_highpart"),s.uniforms.OO()).cV(n("uScaleStart_lowpart"),s.uniforms.NO()):h instanceof Vi&&this.cV(n("uScaleStart"),s.uniforms.MixedScaleXY.uScaleStart).cV(n("uScaleStartLog"),s.uniforms.MixedScaleXY.uScaleStartLog).cV(n("uScaleInterval"),s.uniforms.MixedScaleXY.uScaleInterval).cV(n("uScaleIntervalLog"),s.uniforms.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),s.uniforms.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),s.uniforms.MixedScaleXY.uViewportSize);const l=!0===s.coordsHighPrecision;if(s.coordsX)if(l){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.XV(o("aPosX"),s.coordsX);if(s.coordsY)if(l){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.XV(o("aPosY"),s.coordsY);if(1===e)this.gR(r("uColor"),s.mousePickingColor);else{if(s.fillStyleSolid&&this.gR(r("uColor"),s.fillStyleSolid.getColor()),s.fillStylePaletted){if("value"===s.fillStylePaletted.getLookUpProperty()&&null!==s.lookupValueBuffer){if(!s.lookupValueBuffer)return!1;const t=o("aLookupValue");this.XV(t,s.lookupValueBuffer),void 0!==s.lookupValueAttribDivisor&&this.YV(t,s.lookupValueAttribDivisor)}this.RO(t,s.fillStylePaletted.lut,s.lookupValueRange)}if(s.fillStyleLinearGradient){if(!s.linearGradientInfo)return!1;this.yO(t,s.linearGradientInfo,s.fillStyleLinearGradient)}if(s.fillStyleRadialGradient){if(!s.radialGradientInfo)return!1;this.mO(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.YV(t,s.colorAttribDivisor)}if(s.fillStyleImage){if(!s.texturedFillGLInfo)return!1;const t=s.texturedFillGLInfo&&s.texturedFillGLInfo.texture.Wz();this.gR(n("uColor"),s.fillStyleImage.getSurroundingColor()).dV(r("uColorTexture"),t||s.texturedFillGLInfo.sourceMissingTexture,0).uV(s.texturedFillGLInfo.texCoordsBuffer,s.texCoordAttribDivisor,{location:o("aTextureCoord"),size:2}).RV(s.fillStyleImage.fitMode)}if(s.maskTexture){const t=s.maskTexture&&s.maskTexture.texture.Wz();this.dV(r("uMaskTexture"),t||s.maskTexture.sourceMissingTexture,0).uV(s.maskTexture.texCoordsBuffer,s.maskTextureCoordsAttribDivisor,{location:o("aMaskTextureCoord"),size:2})}}return!0}GO(t,e,i){if(t)return Lm(i||e.$o(),e.ft,t.getAngle(!0),this.Xz())}WO(t,e,i){if(t)return Dm(i||e.$o(),e.ft,t.getPosition(),t.getExtent(),t.getShape(),this.Xz())}}const Gm=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void bt.setTimeout(o,r)};bt.setTimeout(o,0)}))})(t,h,{retryTimeout:10}).then((()=>(t.deleteSync(h),t.bindBuffer(e,i),t.getBufferSubData(e,s,r,n,o),t.bindBuffer(e,null),r))).catch((t=>{throw t}))};class Ym{mV(t){if(t instanceof _i||t instanceof $c){const e=t.Si();this.UO=e.x.scaling,this.YO=-e.x.displacement,this.HO=e.y.scaling,this.$O=-e.y.displacement,this.XO=e.x.highPrecisionOffset,this.jO=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.ZO=e.y.highPrecisionOffset,this.QO=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Vi&&(this.MixedScaleXY=t.Si());return this}gV(){return[this.YO,this.$O]}AV(){return[this.UO,this.HO]}OO(){return[this.XO,this.ZO]}NO(){return[this.jO,this.QO]}}class Hm{constructor(){this.UO=0,this.HO=0,this.JO=0,this.YO=0,this.$O=0,this.KO=0}qO(t){return this.UO=t.ht(),this.YO=t.getInnerStart()+.5*this.UO*t.rt(),this}tN(t){return this.HO=t.ht(),this.$O=t.getInnerStart()+.5*this.HO*t.rt(),this}iN(t){return this.JO=t.ht(),this.KO=t.getInnerStart()+.5*this.JO*t.rt(),this}AV(){return[this.UO,this.HO,this.JO]}gV(){return[this.YO,this.$O,this.KO]}sN(t,e,i,s,r){const n=u(2*(t-i.x)/(i.width-i.x)-1,2*(e-i.y)/(i.height-i.y)-1),o=pl.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Xm{constructor(t){this.ER=t}VL(t,e,i,s,r,n=0){const o=this.ER,h=void 0===s;if(!(s=s||o.xV()))throw new yt("Could not bind a framebuffer.");const a=o.jz(),l=o.Kz();o.pV(!1),o.qV((()=>{o.hV(0,0,i.x,i.y),t()}),s,e,n),h&&o._V(s),this.ER.tO(r),this.ER.hV(a.x,a.y,a.width,a.height),o.pV(l)}}class Wm{constructor(t,e){this.eN=[],this.hN=[],this.uniform=t=>{const e=this.shader.pE(t);return this.hN.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.mE(t);return this.hN.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.yE(t);return this.eN.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.eN)this.glUtils.HV(t.location),this.glUtils.YV(t.location,0)}}class jm extends Hr{constructor(t,e,i,s,r){super(t,e,i,s),this.rN=new Map,this.nN=t,this.oN=e,this.ER=t.aN(),this.lN=r,this.oN=e}uN(t){return!1}OR(){return this}VL(t){if(!this.lN||0!==t||0===this.rN.size)return this;const e=Array.from(this.rN.values()).map((t=>t.cN.filter((t=>t.dN)).map((t=>t.ss)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.lN;return this.ER.lO.vV(e,i),this}Ds(){return this}bt(){return 0}xt(){return 0}_t(){return 0}Mt(){return 0}xl(){return 0}bl(){return 0}rs(t,e){const i={cN:[]},s=(t,e)=>{const s={ss:t||[],dN:void 0===e||e};i.cN.push(s);const r={As:t=>(s.ss=t,r),Ss:t=>(s.dN=t,r),xs:()=>s.dN};return r},r={};Object.keys(e).forEach((t=>{const i=e[t],n=i.shapes||[],o=void 0===i.themeEffectEnabled||i.themeEffectEnabled,h=s(n,o);r[t]=h}));const n={yg:s,...r};this.rN.set(t,i);const o=t.onDispose((()=>{this.rN.delete(t),t.offDispose(o)}));return n}}const $m=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=ni(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),Mt(h,d)&&(d=oi(h,ii(ni(hi(a,h),-1)))),Mt(h,a)&&(a=oi(h,ii(ni(hi(d,h),-1))));const s=li(d,e),g=li(h,e),m=li(a,e),y=ii(hi(g,s)),p=ii(hi(m,g)),x=oi(y,p),S=u(-x.y,x.x),A=u(-y.y,y.x),v=1/ci(S,A),b=ri(S),M=ii(hi(y,p)),E=Math.sign(ci(S,M))||1,w=ai(S,ni(o,v)),T=ai(S,ni(o,-v));if(b<1||v===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(-p.y,p.x),c=Math.sign(ci(y,S))||E,g=ai(A,ni(o,c)),m=ai(l,ni(o,c));1===E?(t=g,e=T,i=m,s=T):(t=w,e=g,i=w,s=m);const x=4*Xe(d,h),b=4*Xe(h,a);(v>x||v>b)&&(1===E?(t=g,e=m,i=m,s=g):(t=m,e=g,i=g,s=m));const M=oi(h,t),k=oi(h,e),C=oi(h,i),R=oi(h,s);r[n]=M,n+=1,r[n]=k,n+=1,r[n]=C,n+=1,r[n]=R,n+=1,f=4}else{const t=oi(h,w),e=oi(h,T);r[n]=t,n+=1,r[n]=e,n+=1,f=2}c=l,l=t[i]}return r[n]=r[0],n+=1,r[n]=r[1],n+=1,[r,f,[c,l]]})(t,e,i)[0];class Zm extends on{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.fN=_e,this.AN=_e,this.gN=Tg({arcStyleSolid:()=>Y(this.be)&&this.be,arcStyleRadialGradient:()=>et(this.be)&&this.be,arcStyleLinearGradient:()=>rt(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}yN(t,e){let i=0,s=Array(0),r=0;if(void 0!==e){const r=t.length,n=Array(r+e.length);let o=0,h=0;for(;o0?md(this.ca._(),this.Wl._(),this.Ii._(),this.Ul._()*l/100,this.Yl._()*l/100,a)[0]:[this.ca._()],d=h.length-1;if(2===d){const t=(h[d-1].x+h[1].x)/2,e=(h[d-1].y+h[1].y)/2;this.Xl=u(t,e)}else{const t=Math.floor(d/2);this.Xl=u(h[t].x,h[t].y)}this.jl=h[1];const f=h.length-1;this.Zl=h[f],this.Hl._()&&(h.shift(),c.shift());let g=!1;(this.ca.o||this.Wl.o||this.Ii.o||this.Ul.o||this.Yl.o||this.Hl.o||this.$l.o||s)&&(this.AN=m(u(this.Ia().x-n,this.Ia().y-o),u(this.Ia().x+n,this.Ia().y+o)),g=!0,this.ca.o=!1,this.Wl.o=!1,this.Ii.o=!1,this.Ul.o=!1,this.Yl.o=!1,this.Hl.o=!1,this.$l.o=!1);const y=this.ia();(g||y)&&this.be!==z&&(this.Hl._()?(this.vN&&this.ER.yV(this.vN),[this.xN,this.vN,this.bN,this.MN]=this.yN(h,c)):(this.vN&&this.ER.yV(this.vN),[this.xN,this.vN,this.bN,this.MN]=this.yN(h,void 0)),et(this.be)?this._N=Dm(this.AN,this.ft,this.be.getPosition(),this.be.getExtent(),this.be.getShape(),this.ER.Xz()):rt(this.be)?this.wN=Lm(this.AN,this.ft,this.be.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0));const p=this.gN.arcStyleSolid(y),x=this.gN.arcStyleLinearGradient(y),S=this.gN.arcStyleRadialGradient(y),A=p||x||S;y&&(this.CN=A?this.ER.az(em["2D"],em.Color({dataType:et(this.be)||rt(this.be)?["gradient",this.be]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.ra(this.be));const v=this.Me;if(qi(v)&&(g||this.aa(v.getThickness())||s)){this.Hl._()?360===i?(h.pop(),c.pop(),[this.kN,this.TN]=this.SN(h,void 0,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0),[this.IN,this.PN]=this.SN(c,void 0,v.getThickness(),r),this.DN&&this.IN?this.ER.OV(this.DN,this.IN,!0):!this.DN&&this.IN?this.DN=this.ER.oV(this.IN,!0):this.DN&&!this.IN&&(this.ER.yV(this.DN),this.DN=void 0)):([this.kN,this.TN]=this.SN(h,c,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0),this.IN&&(this.DN&&this.ER.yV(this.DN),this.DN=void 0,this.PN=0)):(360===i&&(h.shift(),h.pop()),[this.kN,this.TN]=this.SN(h,void 0,v.getThickness(),r),this.FN&&this.kN?this.ER.OV(this.FN,this.kN,!0):!this.FN&&this.kN?this.FN=this.ER.oV(this.kN,!0):this.FN&&!this.kN&&(this.ER.yV(this.FN),this.FN=void 0));const t=v.getFillStyle();et(t)?this.LN=Dm(this.AN,this.ft,t.getPosition(),t.getExtent(),t.getShape(),this.ER.Xz()):rt(t)?this.RN=Lm(this.AN,this.ft,t.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.EN=t===z?void 0:this.ER.az(em["2D"],em.Color({dataType:et(t)||rt(t)?["gradient",t]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})),this.la(v)}if(g){let t=1,e=1;qi(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.fN=m(u(this.AN.min.x-t,this.AN.min.y-e),u(this.AN.max.x+t,this.AN.max.y+e))}this.zN=e&&A?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.VN=e&&this.Me!==ot?this.VN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0}return this}VL(t){if(this.ha()){const e=1===t?this.zN:this.CN,i=this.be,s=this.vN;e&&s&&this.ER.ZR(e).lV(e,((e,r,n,o)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(o("uScaleStart_highpart"),this.lE.OO()).cV(o("uScaleStart_lowpart"),this.lE.NO()).xO(n,s,this.ft.wi(),void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(i))this.ER.gR(e("uColor"),i.getColor());else if(et(i)){if(!this._N)return!1;this.ER.mO(n,this._N,i)}else if(rt(i)){if(!this.wN)return!1;this.ER.yO(n,this.wN,i)}return this.ER.Zm(this.MN,this.bN),!0}));const r=this.Me;qi(r)&&(void 0!==this.FN&&this.ON(t,this.FN,this.TN,r),void 0!==this.DN&&this.ON(t,this.DN,this.PN,r))}return this}ON(t,e,i,s){const r=1===t?this.VN:this.EN,n=s.getFillStyle();r&&this.ER.ZR(r).lV(r,((r,o,h,a)=>{if(this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()).xO(h,e,this.ft.wi(),void 0).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(r("uColor"),this.mN);else if(Y(n))this.ER.gR(r("uColor"),n.getColor());else if(et(n)){if(!this.LN)return!1;this.ER.mO(h,this.LN,n)}else if(rt(n)){if(!this.RN)return!1;this.ER.yO(h,this.RN,n)}const l=s.getThickness(),u=-1===l||1===l;return this.ER.Zm(u?this.ER.gl.LINE_LOOP:this.ER.gl.TRIANGLE_STRIP,i),!0}))}uN(t){return this.pN===t&&{}}OR(){return this.NN&&(this.ER.yV(this.NN),this.NN=void 0),this.GN&&(this.ER.yV(this.GN),this.GN=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.DN&&(this.ER.yV(this.DN),this.DN=void 0),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this}bt(){return this.AN.max.x}xt(){return this.AN.min.x}_t(){return this.AN.max.y}Mt(){return this.AN.min.y}xl(){return we(this.Me)}bl(){return we(this.Me)}}class Km{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}WN(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}UN(){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}YN(){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}HN(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.UN(),this}$N(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.YN(),this}XN(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Km).WN(t))(),qm=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Jm.UN(),n.push(t,e),r.push(Jm.first,Jm.second,Jm.third),h=void 0,o=void 0,r.push(Jm.third,Jm.fourth,Jm.second),a=Jm.third,Jm.YN(),l&&n.push(i,s),[o,h,a]),Qm=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Jm.UN(),o.push(t,e),r.push(Jm.first,Jm.second,Jm.third);const c=Si(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Jm.third,Jm.fourth,Jm.fifth),l=Jm.fourth),Jm.YN(),u&&o.push(i,s),[h,a,l]},ty=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Jm.UN(),r.push(t,e),s.push(Jm.first,Jm.second,Jm.third),n=i,o=void 0,h=Jm.third,l?r.push(i):a=!0,[n,o,h,a]),ey=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Jm.UN(),Jm.UN()):a>0&&(Jm.UN(),u>0&&(u-=1)),n.push(t),r.push(Jm.first,Jm.second,Jm.third),a=Jm.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),iy=(t,e=0)=>{Jm.WN(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],y=!1,p=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=qm(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Qm(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,y]=ty(g,m,d,o,h,a,l,u,y,t):d.y===f.y?(a=g,y&&(h.push(g),y=!1,Jm.UN()),0===h.length&&u>0&&p>0&&(p-=1)):d.y>f.y?[a,l,u,p]=ey(g,0,d,f,n,h,a,l,u,t,p):[a,l,u,p]=ey(g,0,d,f,o,h,a,l,u,t,p)}return[h,new Uint16Array(n),new Uint16Array(o),u,p]};class sy extends nn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.ZN=0,this.Na=Array(),this.QN=0,this.JN=new Uint16Array(0),this.KN=new Uint16Array(0),this.gN=Tg({hightFillSolid:()=>Y(this.be)&&this.be,hightFillRadialGradient:()=>et(this.be)&&this.be,hightFillLinearGradient:()=>rt(this.be)&&this.be,hightFillPaletted:()=>j(this.be)&&this.be,lowFillSolid:()=>Y(this.Fl)&&this.Fl,lowFillRadialGradient:()=>et(this.Fl)&&this.Fl,lowFillLinearGradient:()=>rt(this.Fl)&&this.Fl,lowFillPaletted:()=>j(this.Fl)&&this.Fl}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}Ds(){const t=this.ea(),e=this.Lo._(),i=this.Ja;if(this.ha()){this.lE.mV(this.ft);const s=this.ft instanceof Vi==0,r=s?this.ft.Ui():void 0,n=this.Bl(),o=this.ft.Gi()||t,h=i||this.wl.o||o&&"disabled"!==n.type;if(h){if(this.ZN=0,this.JN=new Uint16Array(0),this.KN=new Uint16Array(0),this.Na.length=0,this.QN=0,this.Cl>1){const[t,e,i,o]=iy([s?n.packager(this.Ml,r,.5):this.Ml,s?n.packager(this._l,r,.5):this._l]);this.ZN=o,this.JN=e,this.KN=i,this.Na=t,this.QN=t.length}this.wl.o=!1}if(this.Tl&&this.Xa[0].length>1){const[t,e]=this.Xa,i=t.length,[o,h,a,l,u]=iy([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.ZN);this.ZN=l;const c=o.length;for(let t=u;t0||this.Cl>0?1:u;s{if(this.ER.xO(o,e,this.ft.wi(),void 0).jV(r).fV(s("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(s("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(s("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(s("uScale"),this.lE.AV()).cV(s("uDisp"),this.lE.gV()).cV(h("uScaleStart_highpart"),this.lE.OO()).cV(h("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(h("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(s("uColor"),this.mN);else if(Y(i))this.ER.gR(s("uColor"),i.getColor());else if(et(i)){if(!this.iG)return!1;this.ER.mO(o,this.iG,i)}else if(rt(i)){if(!this.sG)return!1;this.ER.yO(o,this.sG,i)}else if(j(i)){const t=kg(i,this,void 0);if(!t&&i.lut.percentageValues)return!1;this.ER.RO(o,i.lut,t)}return this.ER.QV(this.oG),!0}))}const r=1===t?this.zN:this.qN;if(r&&this.eG&&this.hG){const i=this.eG,s=this.hG;this.ER.ZR(r).lV(r,((r,n,o,h)=>{if(this.ER.xO(o,i,this.ft.wi(),void 0).jV(s).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()).cV(h("uScaleStart_highpart"),this.lE.OO()).cV(h("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(h("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(h("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(h("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(h("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(r("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(r("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(r("uColor"),this.mN);else if(Y(e))this.ER.gR(r("uColor"),e.getColor());else if(et(e)){if(!this._N)return!1;this.ER.mO(o,this._N,e)}else if(rt(e)){if(!this.wN)return!1;this.ER.yO(o,this.wN,e)}else if(j(e)){const t=kg(e,this,void 0);if(!t&&e.lut.percentageValues)return!1;this.ER.RO(o,e.lut,t)}return this.ER.QV(this.rG),!0}))}return this}uN(t){return this.pN===t&&{}}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}Yb(t){this.ll()>0&&this.Ds();const[e,i]=this.il(),s=e.length>2&&e[1].x0&&this.Ds();const[e,i]=this.il(),s=e.length;if(0===s)return;const r=this.Il?1:0,n=s-(this.Pl?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.aG;s+=1){const r=i-s*Math.PI/this.aG;t.push(.5*Math.cos(r),.5*Math.sin(r),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.wV.Mz.get(e);return i||(i=new ry(t,e),t.wV.Mz.set(e,i),i)})(t,i?e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2:1),oy={AG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i)}},gG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.YV(r,1),h.enableVertexAttribArray(r)},pG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aLocationA_highpart"),i=o("aLocationA_lowpart"),s=o("aLocationB_highpart"),a=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.YV(a,1),h.enableVertexAttribArray(a)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.YV(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.YV(i,1),h.enableVertexAttribArray(i)}},mG:(t,e,i,s,r,n,o)=>{const h=t.gl;h.bindBuffer(h.ARRAY_BUFFER,i),h.vertexAttribPointer(s,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,o*Float32Array.BYTES_PER_ELEMENT),t.YV(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,2*n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.YV(r,1),h.enableVertexAttribArray(r)},VL:(t,e,i,s,r,n,o)=>{const h=t.aN(),{uniform:a,uniformOptional:l}=i,u=1/t.Yn.Xn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.fV(a("uThicknessPixels"),c).fV(l("uAALimit"),1-(c-1)/c).cV(a("uRatioPxClip"),[2/t.ai().x,2/t.ai().y]),e.ZR(i,s).Zm(o)}},hy={AG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),t){const t=o("aPos_highpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t);const e=o("aPos_lowpart");h.vertexAttribPointer(e,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(e)}else{const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},gG:(t,e,i,s,r,n)=>{const o=t.gl;o.bindBuffer(o.ARRAY_BUFFER,i),o.vertexAttribPointer(s,r,o.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),o.enableVertexAttribArray(s)},pG:(t,e,i,s,r,n)=>{const{attribute:o}=s,h=e.gl;if(h.bindBuffer(h.ARRAY_BUFFER,i),!t){const t=o("aPos");h.vertexAttribPointer(t,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),h.enableVertexAttribArray(t)}},yG:(t,e)=>{const i=t.aN();i.Zm(i.gl.LINE_STRIP,e,0)},SG:(t,e)=>{const i=t.aN();i.Zm(i.gl.LINES,2*e,0)}};class ay extends ln{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.Ha=_e,this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t}}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.vG=this.ER.hO}Ds(){const t=this.na(),e=this.uu,i=this.gN.lineStyleSolid(t),s=this.gN.lineStyleDashed(t),r=i||s,n=this.gN.strokeFillSolid(t),o=this.gN.strokeFillLinearGradient(t),h=this.gN.strokeFillRadialGradient(t),a=this.gN.strokeFillPaletted(t),l=n||o||h||a&&["x","y"].includes(a.getLookUpProperty())&&a,c=this.Pi(),d=this.Fi(),f=this.Lo._(),g=this.Lo.o,y=e.O();if(s&&this.ft instanceof Vi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.lE.mV(this.ft),this.gu&&(this.xG=this.ER.oV(Jt([c,d],this.ft.wi()),!1,this.xG),this.Ha=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.ha()&&r&&l&&y>0,e=o?["gradient",o]:h?["gradient",h]:a?["lookup",a.getLookUpProperty(),a.lut]:"uniform";this.bG=t?{type:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),this.vG?em.AliasedEdge:void 0,s&&em.StippleTextureInstanced),mousePickingShader:f?this.ER.az(em["2D"],em.MousePicking,em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),s&&em.StippleTextureInstanced):void 0,geometry:ny(this.ER,y),thickness:y,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}:void 0}if(h?this.LN=Dm(Wr(this.Ha,{x:this.xl(),y:this.bl()},this.ft),this.ft,h.getPosition(),h.getExtent(),h.getShape(),this.ER.Xz()):o?this.RN=Lm(Wr(this.Ha,{x:this.xl(),y:this.bl()},this.ft),this.ft,o.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),s){if(t||this.gu){const t=[0,0,Math.abs(d.x-c.x),Math.abs(d.y-c.y)];this.MG=this.ER.oV(t,!1,this.MG)}this._G=this.ER.PO(s.getPattern())}else this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this._G=void 0;return this.Au(e),this.gu=!1,this.Lo.o=!1,this}VL(t){var e,i;const s=this.xG;if(!s)return this;const r=this.bG;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.bG)||void 0===e?void 0:e.mousePickingShader:null===(i=this.bG)||void 0===i?void 0:i.shader;return c?(this.ER.ZR(c).lV(c,((e,i,c,d)=>{if(this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(d("uScaleStart_highpart"),this.lE.OO()).cV(d("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(d("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(d("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(d("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(d("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(n)this.ER.gR(e("uColor"),n.getColor());else if(h){if(!this.LN)return!1;this.ER.mO(c,this.LN,h)}else if(o){if(!this.RN)return!1;this.ER.yO(c,this.RN,o)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ER.RO(c,a.lut,t)}if(l){if(!this.MG||!this._G)return!1;oy.gG(this.ER,c,this.MG,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.ER.cV(e("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(d("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(e("uStippleScale"),l.getPatternScale()).dV(e("uStippleTexture"),this._G.DO,1)}return oy.AG(this.ft.wi(),this.ER,s,c,this.ft.wi()?4:2,0),oy.VL(this.nN,r.geometry,c,this.vG&&1!==t,1===t,u,1),!0})),this):this}uN(t){return this.pN===t&&{}}dispose(){return super.dispose(),this.bG=void 0,this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this._G=void 0,this}OR(){return this}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return we(this.uu)}bl(){return we(this.uu)}}class ly extends un{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.wG=[],this.CG=!1,this.kG=!1,this.TG=!1,this.FG=!1,this.lE=new Ym,this.Ha=_e,this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,lineFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},lineFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},lineFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},lineIndividualPointFill:()=>{const t=this.uu.getFillStyle();return X(t)&&t}}),this.nN=t,this.oN=e,this.IG=n,this.ER=t.aN(),this.vG=this.ER.hO,this.PG=t.Yn.Zn;const{color:o,id:h}=this.IG();this.mN=o,this.pN=h}Vr(){const t=this.mu?void 0:this.IG(),e={ys:t=>this.DG(e,t),ds:t=>this.BG(e,t),zg:(t,i)=>this.LG(e,t,i),gR:t=>this.EG(e,t),Di:{x:0,y:0},Ii:{x:0,y:0},Vo:0,zG:void 0,pN:null==t?void 0:t.id,mN:null==t?void 0:t.color};return this.wG.push(e),e}Gt(){var t;return this.wG.length=0,this.CG=!0,this.Zi&&this.Fn&&(null===(t=this.cs.kn)||void 0===t?void 0:t.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember),this}VG(){return this.wG.length}_(t){const e=this.wG[t];return[e.Di,e.Ii]}py(){return this.wG}bd(t){var e;const i=this.wG.indexOf(t);i>=0&&(this.wG.splice(i,1),this.CG=!0,this.Zi&&this.Fn&&(null===(e=this.cs.kn)||void 0===e?void 0:e.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember))}DG(t,e){if(e&&!this.wG.includes(t))this.wG.push(t);else if(!e){const e=this.wG.indexOf(t);this.wG.splice(e,1)}return this.TG=!0,t}BG(t,e){return t.Vo=e,this.kG=!0,t}LG(t,e,i){return t.Di=e,t.Ii=i,this.CG=!0,t}EG(t,e){return t.zG=e,this.FG=!0,t}Ds(){const t=this.Lo._(),e=this.Lo.o,i=this.na(),s=this.uu,r=this.wG,n=this.kG,o=this.CG,h=this.TG,a=this.FG,l=this.gN.lineStyleSolid(i),u=this.gN.lineStyleDashed(i),c=l||u,d=this.gN.lineFillSolid(i),f=this.gN.lineIndividualPointFill(i),g=this.gN.lineFillRadialGradient(i),m=this.gN.lineFillLinearGradient(i),y=d||f||m||g,p=s.O(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.ft instanceof Vi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.lE.mV(this.ft);const S=o||h;if(S){const t=[];for(let e=0;e0&&e;this.bG=i?"triangulated"===x?{type:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG,ensureMinimumSegmentLength:void 0!==this.pu}),this.vG?em.AliasedEdge:void 0,u&&em.StippleTextureInstanced,em.AttributeHighlight),mousePicking:t?{shader:this.ER.az(em["2D"],this.mu?em.MousePicking:em.MousePickingAttribute,em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG,ensureMinimumSegmentLength:void 0!==this.pu}),u&&em.StippleTextureInstanced,em.AttributeHighlight)}:void 0,geometry:ny(this.ER,p,!1),thickness:p,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:{type:"primitive",shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG}),em.AttributeHighlight),mousePicking:t?{shader:this.ER.az(em["2D"],this.mu?em.MousePicking:em.MousePickingAttribute,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,snapToNearestPixel:this.PG}),em.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:d,fillStyleIndividual:f,fillStyleLinearGradient:m,fillStyleRadialGradient:g}:void 0}if(u){if(i||S){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.Vo,e+=1})),this.OG=this.ER.oV(t,!0,this.OG)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.zG||f.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.NG=this.ER.oV(t,!1,this.NG)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.zG||f.color;for(let i=e;i{var s,r,n,o;t[e+0]=(null===(s=i.mN)||void 0===s?void 0:s.r)||0,t[e+1]=(null===(r=i.mN)||void 0===r?void 0:r.g)||0,t[e+2]=(null===(n=i.mN)||void 0===n?void 0:n.b)||0,t[e+3]=(null===(o=i.mN)||void 0===o?void 0:o.a)||0,e+=4})),this.GG=this.ER.oV(t,!0,this.GG)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{var s,r,n,o;for(let h=e;h{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(g("uScaleStart_highpart"),this.lE.OO()).cV(g("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(g("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(g("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(g("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(g("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.PG&&this.ER.cV(g("uViewportSizePx"),[this.cs.ai().x*this.ER.Xz(),this.cs.ai().y*this.ER.Xz()]),void 0!==this.pu&&this.ER.cV(e("uMinSegmentPixelVector"),[this.pu.x,this.pu.y]),this.ER.gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)if(this.mu)this.ER.gR(e("uColor"),this.mN);else{if(!r)return!1;"triangulated"===o?this.ER.uV(r,1,{location:d("aColor"),size:4}):this.ER.$V(d("aColor"),r)}else if(h)this.ER.gR(e("uColor"),h.getColor());else if(a){if(!this.NG)return!1;this.ER.uV(this.NG,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this._N)return!1;this.ER.mO(f,this._N,u)}else if(l){if(!this.wN)return!1;this.ER.yO(f,this.wN,l)}if(c){if(!this.MG||!this._G)return!1;oy.mG(this.ER,f,this.MG,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.ER.cV(e("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(g("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(e("uStippleScale"),c.getPatternScale()).dV(e("uStippleTexture"),this._G.DO,0)}if("triangulated"===o){const{geometry:e,thickness:r}=n;oy.pG(this.ft.wi(),this.ER,i,f,this.ft.wi()?4:2,0),this.ER.uV(s,1,{location:d("aIsHighlighted"),size:1}),oy.VL(this.nN,e,f,this.vG&&1!==t,1===t,r,this.wG.length)}else hy.pG(this.ft.wi(),this.ER,i,f,this.ft.wi()?4:2,0),this.ER.XV(d("aIsHighlighted"),s),hy.SG(this.nN,this.wG.length);return!0})),this):this}uN(t){if(t===this.pN)return{};const e=this.wG.find((e=>e.pN===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.bG=void 0,this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.MG&&(this.ER.yV(this.MG),this.MG=void 0),this.OG&&(this.ER.yV(this.OG),this.OG=void 0),this.GG&&(this.ER.yV(this.GG),this.GG=void 0),this.NG&&(this.ER.yV(this.NG),this.NG=void 0),this._G=void 0,this}OR(){return this}ds(t){super.ds(t);for(const e of this.wG)e.ds(t);return this}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return we(this.uu)}bl(){return we(this.uu)}}class uy{constructor(t,e){this.WG=!1,this.UG=!1,this.YG=!1,this.ft=t,this.HG=e,this.HG.Yo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.WG="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.WG="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.UG=!0),!0===t.regularProgressiveStep&&(this.YG=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.WG?t[0].x:t[0].y,end:"x"===this.WG?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.WG?"x"===this.WG?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 r=t[0].y,n=t[0].y;for(let i=0;ir&&(r=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 r=t[0].x,n=t[0].x;for(let i=0;ir&&(r=e.x),e.x{!1===t.allowDataGrouping&&(this.$G=!0)}))}QG(t,e=!1){if(this.$G||!this.WG||"linear"!==this.ZG.type)return!1;!1===e&&this.JG&&(clearTimeout(this.JG),this.JG=void 0);const i="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!i)throw new Error("CP helper has no information about Axis state.");const s=t.length;if(s<2)return!1;const r=t[0],n=t[s-1],o=this.calculateAvgStepBetweenDataPoints("x"===this.WG?r.x:r.y,"x"===this.WG?n.x:n.y,s),h=this.ZG.scale,a=Math.abs("x"===this.WG?h.Ui().x:h.Ui().y),l=a/o,u=Math.floor(l*cy),c=u*o,d=bt.performance.now(),f=!(d-i.lh<500)&&(i.sh?d-i.ah<1e3:d-i.eh<2e3||i.rh),g=s>2*this.XG.totalDataPointsAtTime;if(f&&!g)return this.JG=setTimeout((()=>this.KG(t)),1e3),!1;const m=u>=10,y=this.XG.enabled?this.XG.columnWidthAxis/a<1.5:void 0,p=this.XG.enabled&&u>this.XG.dataPointsPerColumn?u/this.XG.dataPointsPerColumn>=2:void 0;let x;!0===this.XG.enabled?y?p&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const S=!1===e;return x?(S&&(this.XG=x),!0):(S&&(this.XG={...this.XG,totalDataPointsAtTime:s}),!1)}Zp(){this.qG=void 0,this.jG.length=0,this.JG&&(clearTimeout(this.JG),this.JG=void 0)}tW(t){if(0===t.length)return t;if(this.$G||!this.WG||"linear"!==this.ZG.type||!this.XG.enabled)return t;let e;e=this.jG.length>0?ne(this.jG,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.qG,h=-1,a=-1,l=0,u=0;if("x"!==this.WG||this.UG)if("x"===this.WG&&this.UG){const t=this.XG.columnWidthAxis;let c=this.qG?this.qG.x:e[0].x,d=c-t;for(let f=0;f=d?((!r||i.y>r.y)&&(r=i,h=f),(!n||i.y=d?((!r||i.x>r.x)&&(r=i,h=f),(!n||i.xr.x)&&(r=i,h=f),(!n||i.xr.y)&&(r=i,h=f),(!n||i.y0&&(this.qG=s[c-1]),s}iW(t){if(this.WG&&"linear"===this.ZG.type){const e="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Ke===zs.progressive||e.Ke===zs.regressive){const e=Math.abs("x"===this.WG?this.ZG.scale.x.getInnerInterval():this.ZG.scale.y.getInnerInterval());if(this.XG.enabled)return 2*e/this.XG.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.WG?s.x:s.y,"x"===this.WG?r.x:r.y,i)}}}sW(t,e,i){if(!this.WG)return e;const s=i.length;let r=Nr(i,t.min,this.WG,this.UG,0,s-1);void 0===r&&(r=this.UG?s-1:0);let n=Nr(i,t.max,this.WG,this.UG,0,s-1);return void 0===n&&(n=this.UG?0:s-1),1+Math.abs(n-r)}eW(){this.JG&&(clearTimeout(this.JG),this.JG=void 0)}KG(t){this.QG(t,!0)&&this.vs()}}class fy extends uy{renderVisibleOnly(t,e){const i=this.ft.x.getInnerStart(),s=this.ft.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ft.y.getInnerStart(),h=this.ft.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);t.forEach(((t,i)=>{t.existingCoordinatesCount<=1||t.boundaries.max.xn||t.boundaries.max.yl||e(t)}))}}class gy{constructor(t,e,i){this.hW=e,this.rW=i,this.nW=t,this.oW=[]}aW(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.nW[this.nW.length-1];do{const t=this.nW.length;let r;h||(h=this.lW(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.rW&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.nW[t-1].lastDataPoint;e?(n.splice(0,0,e),a=1,o+=1):console.error("SegmentationHelper _connectSegments = true, but segment has no lastDataPoint information!")}if(h)r=Math.min(o,h.allocatedCoordinatesCount-h.existingCoordinatesCount),s(h,n.slice(0,r),r,a);else{const t=Math.ceil(e)+a;r=Math.min(t,o);const s={...i(t,n.slice(0,r),r,a),isDropped:!1};this.nW.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.uW()}cW(t){const e=t,i=this.nW.indexOf(e);i>=0&&this.nW.splice(i,1),e.droppedTimestamp=bt.performance.now(),this.oW.push(e)}dW(){this.nW.slice().forEach((t=>this.cW(t)))}fW(){this.nW.forEach((t=>this.hW(t))),this.oW.forEach((t=>this.hW(t))),this.nW.length=0,this.oW.length=0}lW(t,e){const i=2*t/3,s=4*t/3,r=this.oW.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.oW[r];return this.oW.splice(r,1),this.nW.push(t),t}}uW(){if(this.oW.length>5){const t=bt.performance.now();for(let e=0;e=1e4)&&(this.hW(i),this.oW.splice(e,1),e-=1)}}}}class my extends uy{AW(t,e){if(!e||"object"!=typeof e)return 0;const i=this.ft.x.getInnerStart(),s=this.ft.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ft.y.getInnerStart(),h=this.ft.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.gW(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.pW(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.mW(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}gW(t,e,i,s,r,n){if(void 0===e||e<=0)return 0;const o=t.reduce(((t,e)=>t+e.existingDataPointsCount),0);if(o<=e)return 0;let h=0,a=o;for(let i=0;ie&&(h+=1,a-=s.existingDataPointsCount)}return h}mW(t,e,i,s,r,n){if(void 0===e||!this.WG)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.WG?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.WG?a.boundaries.max.x2))break;o+=1}return o}pW(t,e,i,s,r,n){if(void 0===e||0===e)return 0;let o=0,h=0;for(let a=t.length-1;a>=0;a-=1){const l=t[a];if(h>e)if(this.WG){if(this.UG?"x"===this.WG?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.WG?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}yW(t,e){const i=t.reduce(((t,e)=>Je(t,e.boundaries)),_e);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.WG||this.UG?"x"===this.WG&&this.UG?i.max.x=Math.min(i.max.x,t):"y"!==this.WG||this.UG?"y"===this.WG&&this.UG&&(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 yy extends cn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.lE=new Ym,this.JM=[],this.SW=new fy(this.ft,this),this.vW=new dy(this.ft,this,(()=>this.cs.vs())),this.xW=new gy(this.JM,(t=>{t.coordsBuffer&&this.ER.yV(t.coordsBuffer),t.MG&&this.ER.yV(t.MG)}),!0),this.bW=new my(this.ft,this),this.MW=0,this._W=0,this.wW=!1,this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t}}),this.oN=e,this.pN=n,this.mN=o,this.Yn=h,this.bG={type:"none"},this.ER=t.aN(),this.nN=t,this.vG=this.ER.hO;const a=this.ft.wi(),l=!0===(null==h?void 0:h.individualLookupValuesEnabled);let u,c,d,f=0;a||(u=f,f+=2),a&&(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,r=0;sJt(e,t))(a,l);this.kW={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.uu.getFillStyle())}}TW(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.Lo._(),h=this.Lo.o,a=this.gN.lineStyleSolid(i),l=this.gN.lineStyleDashed(i),u=a||l,c=u&&u.getThickness(),d=this.gN.strokeFillSolid(i),f=this.gN.strokeFillLinearGradient(i),g=this.gN.strokeFillRadialGradient(i),m=this.gN.strokeFillPaletted(i),y=d||f||g||m,p=this.kW.individualLookupValuesEnabled;if(l&&this.ft instanceof Vi)return bt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.yu=ne(this.yu,s,{canReturnB:!0}),this.$a+=r);let x=this.Su.o;const S=this.bW.AW(this.JM,this.Su._());if(S>0){let t=0;for(let e=0;e{t.MG&&(this.ER.yV(t.MG),t.MG=void 0)})),this.wW=!1),v&&(this.vW.Zp(),this.JM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=_e,t.lastDataPoint=void 0})),this.xW.dW(),A=this.yu,this.MW=0,this._W=0);const b=this.vW.tW(A),M=b.length;if(M>0){let t=this.vW.iW(this.yu)||(this.Yo("ApplicationType",(t=>"InternalUI"===t.type))?this.$a:1e5);M/t>10&&(t=M/10),this.xW.aW(b,t,((t,e,i,s)=>{const r=this.SW.calculateUserDataPointsBoundaries(e),n=this.vW.sW(r,i,this.yu)-s;return this.FW=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),lastDataPoint:e[i-1],MG:this.wW?this.ER.zV(2*t,this.TW(e,i,this.FW)):void 0}}),((t,e,i,s)=>{const r=Je(t.boundaries,this.SW.calculateUserDataPointsBoundaries(e)),n=this.vW.sW(r,t.existingCoordinatesCount+i,this.yu)-(t.jointPointsCount+s);this.ER.VV(t.coordsBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),this.wW&&t.MG&&this.ER.VV(t.MG,2*t.existingCoordinatesCount,this.TW(e,i,this.FW)),this.FW=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ha=this.bW.yW(this.JM,this.Su._())),this.lE.mV(this.ft),g?this.LN=Dm(this.zo||this.Ha,this.ft,g.getPosition(),g.getExtent(),g.getShape(),this.ER.Xz()):f?this.RN=Lm(this.zo||this.Ha,this.ft,f.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!p){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw bt.alert(t),new Error(t)}if(y&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=f?["gradient",f]:g?["gradient",g]:m?["lookup",m.getLookUpProperty(),m.lut]:"uniform";this.bG="primitive"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}),l&&em.StippleTexture),mousePickingShader:o?this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}),l&&em.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),this.vG?em.AliasedEdge:void 0,l&&em.StippleTextureInstanced),mousePickingShader:o?this.ER.az(em["2D"],em.MousePicking,em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0}),l&&em.StippleTextureInstanced):void 0,geometry:ny(this.ER,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:d,fillStyleLinearGradient:f,fillStyleRadialGradient:g,fillStylePaletted:m}:{type:"none"}}else this.bG={type:"none"}}return this._G=l?this.ER.PO(l.getPattern()):void 0,this.Au(e),this.Ja=!1,this.Xa=[],this.Lo.o=!1,this.Su.o=!1,this}VL(t){const e=this.ER.gl,i=this.bG;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyleDashed:r,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}=i;return this.ER.ZR(s).lV(s,((s,l,u,c)=>{let d=!1;if(this.ER.fV(s("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(s("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(s("uRenderEffectMask"),2===t?1:0),this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(s("uScale"),this.lE.AV()).cV(s("uDisp"),this.lE.gV()).cV(c("uScaleStart_highpart"),this.lE.OO()).cV(c("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(c("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(s("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(s("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(s("uColor"),this.mN);else if(n)this.ER.gR(s("uColor"),n.getColor());else if(h){if(!this.LN)return!1;this.ER.mO(u,this.LN,h)}else if(o){if(!this.RN)return!1;this.ER.yO(u,this.RN,o)}else if(a){const t=kg(a,this,void 0);if(!t&&a.lut.percentageValues)return!1;this.ER.RO(u,a.lut,t)}return this.SW.renderVisibleOnly(this.JM,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?oy.AG:hy.AG;if(this.ft.wi()||void 0===this.kW.attributeOffsetCoordinateLowPrecision?this.ft.wi()&&void 0!==this.kW.attributeOffsetCoordinateHighPrecision&&h(!0,this.ER,o,u,this.kW.attributesPerVertex,this.kW.attributeOffsetCoordinateHighPrecision):h(!1,this.ER,o,u,this.kW.attributesPerVertex,this.kW.attributeOffsetCoordinateLowPrecision),r){if(!n.MG||!this._G)return;"triangulated"===i.type?oy.gG(this.ER,u,n.MG,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):hy.gG(this.ER,u,n.MG,l("aLengthSoFar"),2,0),this.ER.cV(s("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(c("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(s("uStippleScale"),r.getPatternScale()).dV(s("uStippleTexture"),this._G.DO,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this.kW.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kW.attributeOffsetLookUpValue+this.kW.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;oy.VL(this.nN,i.geometry,u,this.vG&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else hy.yG(this.nN,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}uN(t){return this.pN===t&&{}}ol(t,e){return Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.Ha=Je(this.Ha,e||e||this.SW.calculateUserDataPointsBoundaries(t)),this}Gt(){return super.Gt(),this.MW=0,this._W=0,this.FW=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.vW.eW(),this.bG={type:"none"},this._G=void 0,this}OR(){return this}Yb(t){this.ll()>0&&this.Ds();const e=this.il(),i=_r(e,t,this.Qa,this.Il,this.Pl,this.ft,this.engine.ft,this.Ha,this.SW.WG,this.SW.UG);return void 0!==i?e[i]:void 0}ew(t){this.ll()>0&&this.Ds();const e=this.il(),i=e.length;if(0===i)return;const s=this.Il?1:0,r=i-(this.Pl?2:1);if(this.Qa===Lr.Nearest){let s,r,n=Le;for(let o=0;o1}Zm(t,e,i,s,r){return"object"==typeof s?e?this.ER.XV(t.attribute("aOffsetScale"),e,1).cV(t.uniform("uSizePixels"),[s.width,s.height]):this.ER.fV(t.uniform("uOffsetScale"),s.scale).cV(t.uniform("uSizePixels"),[s.width,s.height]):r?e?this.ER.XV(t.attribute("aOffsetPixels"),e,1):this.ER.fV(t.uniform("uOffsetPixels"),s):this.ER.fV(t.uniform("uPointSize"),s),r?this.ER.uV(this.CR,0,{location:t.attribute("aInstanceGeo"),size:2}).JV(this.fG,0,this.DW,i):this.ER.Zm(this.ER.gl.POINTS,i),this}Tz(){this.ER.yV(this.CR)}}const xy=(t,e=0)=>{const i=[u(-.5,-.5),u(.5,-.5),u(.5,.5),u(-.5,.5)];return new py(t,i,t.gl.TRIANGLE_FAN,e)},Sy=(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 py(t,s,t.gl.TRIANGLES,e)},Ay=(t,i,s)=>{if(io(t))return Ay(e.PointShape.Square,i,s);let r=i.wV.xz.get(t);if(t===e.PointShape.Circle){const t=s<=3?4:s<=5?8:s<=10?16:24;return r=i.wV.bz.get(t)||((t,e,i=0)=>{const s=function(t=25){return md(u(0,0),0,360,.5,.5,t)[0]}(e);return new py(t,s,t.gl.TRIANGLE_FAN,i)})(i,t),i.wV.bz.set(t,r),r}if(!r){switch(t){case e.PointShape.Triangle:r=((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 py(t,i,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Square:r=xy(i);break;case e.PointShape.Plus:r=Sy(i);break;case e.PointShape.Cross:r=Sy(i,45);break;case e.PointShape.Diamond:r=xy(i,45);break;case e.PointShape.Arrow:r=((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 py(t,s,t.gl.TRIANGLES,e)})(i);break;case e.PointShape.Star:r=((t,e=0)=>new py(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:r=((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 py(t,s,t.gl.TRIANGLES,e)})(i);break;default:return be(0,"LightningChart JS unidentified point shape")}i.wV.xz.set(t,r)}return r};class vy extends tn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.fN=m(c(Pe,Pe),c(Le,Le)),this.gN=Tg({pointStyleSolid:()=>Y(this.be)&&this.be,pointStyleRadialGradient:()=>et(this.be)&&this.be,pointStyleLinearGradient:()=>rt(this.be)&&this.be,pointStylePaletted:()=>j(this.be)&&this.be,pointStyleIndividual:()=>X(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN()}Ds(){var t;const e=this.Lo._(),i=this.Lo.o,s=this.Xa,r=s.length,n=r>0,o=this.Ga._(),h=this.be,a=this.size._(),l=this.Ga.o||this.ga.o,u=this.ft.Gi(),c=this.size.o||this.Ga.o,d=this.Ja||s&&s.length>0,f=u||c,g=this.ia(),m=this.gN.pointStyleSolid(g),y=this.gN.pointStyleRadialGradient(g),p=this.gN.pointStyleLinearGradient(g),x=this.gN.pointStylePaletted(g),S=this.gN.pointStyleIndividual(g),A=m||y||p||x||S;if(n&&(this.Na=ne(this.Na,s,{canReturnB:!0}),this.$a+=r),n||this.Ja){this.Ha=this.Za?Je(this.Ha,this.Za):Je(this.Ha,Ze(this.Na));const t=Jt(this.Na,this.ft.wi());this.RW=this.$a,this.EW=this.ER.oV(t,!1,this.EW)}this.lE.mV(this.ft),h!==z?f&&(this.zW&&(this.zW=void 0),a>1||this.Wa._()?a<=1&&!this.Wa._()?this.fG=this.ER.gl.POINTS:(this.zW=Ay(o,this.ER,this.Wa._()?25:a),this.fG=this.zW.fG):this.fG=this.ER.gl.POINTS):this.zW&&(this.zW=void 0);const v=(null===(t=this.zW)||void 0===t?void 0:t.BW)||0,b=this.ga._()+v;if(c||g||i||l){const t=this.Wa._()?"attribute":"uniform",i=a<=1&&em.PointSize(t),s=em.VertexLocation({offset:a>1?{dataType:t,sizeUnit:"px",symmetric:!0,rotation:(this.Ua._()||b%360!=0)&&{dataType:this.Ua._()?"attribute":"uniform"}}:void 0,axisWorldTranslation:wg(this.ft),normalSource:void 0});this.dE=A?this.ER.az(em["2D"],i,s,m?em.Color({dataType:"uniform"}):S?em.Color({dataType:"attribute"}):x?em.Color({dataType:["lookup",x.getLookUpProperty(),x.lut]}):y?em.Color({dataType:["gradient",y]}):p?em.Color({dataType:["gradient",p]}):void 0):void 0,this.zN=e&&A?this.ER.az(em["2D"],i,s,em.MousePicking):void 0}if(d||g){const t=this.Na.length;if(X(h)&&this.RW&&this.RW>0){const e=h.getFallbackColor(),i=new Float32Array(4*t);for(let s=0;s0&&a>1){const e=new Float32Array(t);for(let i=0;i0&&a>1){const e=new Float32Array(2*t),i=gi(b),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;it&&(t=s.value)}this.Ka={min:e,max:t}}return this.sa=h,this.Ga.o=!1,this.size.o=!1,this.ga.o=!1,this.Lo.o=!1,this.Ja=!1,this}VL(t){const e=1===t?this.zN:this.dE,i=this.EW,s=this.RW;return e&&i&&s&&(this.ER.ZR(e),this.ER.lV(e,((e,r,n,o)=>{var h;if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(o("uScaleStart_highpart"),this.lE.OO()).cV(o("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(o("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(o("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(o("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(o("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.xO(n,i,this.ft.wi(),this.zW?1:void 0).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).fV(o("uDevicePixelRatio"),this.ER.Xz()),this.zW){const t=r("aInstanceGeo");this.ER.WV(t,this.zW.CR).YV(t,0)}if(1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(this.be))this.ER.gR(e("uColor"),this.be.getColor());else if(X(this.be)&&this.VW){const t=r("aColor");this.ER.$V(t,this.VW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(j(this.be)){if("value"===this.be.getLookUpProperty()&&this.GW){const t=r("aLookupValue");this.ER.XV(t,this.GW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}const t=kg(this.be,this,this.Ka);if(!t&&this.be.lut.percentageValues)return!1;this.ER.RO(n,this.be.lut,t)}else if(et(this.be)){if(!this._N)return!1;this.ER.mO(n,this._N,this.be)}else if(rt(this.be)){if(!this.wN)return!1;this.ER.yO(n,this.wN,this.be)}if(this.OW&&this.fG!==this.ER.gl.POINTS){const t=r("aOffsetPixels");this.ER.XV(t,this.OW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(this.fG!==this.ER.gl.POINTS){const t=e("uOffsetPixels");this.ER.fV(t,this.size._())}const a=((null===(h=this.zW)||void 0===h?void 0:h.BW)||0)+this.ga._();if(this.NW&&this.fG!==this.ER.gl.POINTS){const t=r("aRot");this.ER.WV(t,this.NW),this.fG!==this.ER.gl.POINTS&&this.ER.YV(t,1)}else if(this.fG!==this.ER.gl.POINTS&&a%360!=0){const t=gi(a),i=Math.sin(t),s=Math.cos(t);this.ER.cV(e("uRot"),[i,s])}if(this.fG===this.ER.gl.POINTS)this.ER.fV(e("uPointSize"),this.size._());else{const t={x:2/this.cs.ai().x,y:2/this.cs.ai().y};this.ER.cV(e("uRatioPxClip"),[t.x,t.y])}let l=!1;return this.fG===this.ER.gl.POINTS?(this.ER.Zm(this.fG,s),l=!0):this.zW&&(this.ER.JV(this.fG,0,this.zW.DW,s),l=!0),l}))),this}uN(t){return this.pN===t&&{}}$c(t){this.ll()>0&&this.Ds();const e=this.il(),i=_r(e,t,this.Qa,!1,!1,this.ft,this.cs.ft,this.Ha,void 0,void 0);return void 0!==i?e[i]:void 0}ke(t){return super.ke(t)}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return this.Wa._()?25:this.size._()}bl(){return this.Wa._()?25:this.size._()}OR(){return this.EW&&(this.ER.yV(this.EW),this.EW=void 0),this.zW&&(this.zW=void 0),this.VW&&(this.ER.yV(this.VW),this.VW=void 0),this.NW&&(this.ER.yV(this.NW),this.NW=void 0),this.GW&&(this.ER.yV(this.GW),this.GW=void 0),this}}class by extends Jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.bG={fill:void 0,border:void 0},this.lE=new Ym,this.Ha=_e,this.WW=!1,this.UW=!1,this.YW=!1,this.HW=!1,this.$W=!1,this.vd=[],this.gN=Tg({polygonStyleSolid:()=>Y(this.be)&&this.be,polygonStyleImage:()=>Zn(this.be)&&this.be,polygonStyleRadialGradient:()=>et(this.be)&&this.be,polygonStyleLinearGradient:()=>rt(this.be)&&this.be,polygonStylePaletted:()=>j(this.be)&&this.be,polygonStyleIndividual:()=>X(this.be)&&this.be,lineStyleSolid:()=>qi(this.Me)&&this.Me,lineStyleFilled:()=>{const t=this.Me&&this.Me.getFillStyle();return Y(t)&&t}}),this.nN=t,this.oN=e,this.IG=n,this.ER=t.aN(),this.vG=this.ER.hO}Vr(){const t=this.IG(),e={ys:t=>this.DG(e,t),ds:t=>this.BG(e,t),Sl:t=>this.XW(e,t),Jx:t=>this.jW(e,t),gR:t=>this.EG(e,t),Na:[],S:void 0,ZW:void 0,Vo:0,QW:!0,pN:t.id,mN:t.color};return this.vd.push(e),e}Gt(){var t;return this.vd.length=0,this.WW=!0,this.Zi&&this.Fn&&(null===(t=this.cs.kn)||void 0===t?void 0:t.entity)===this&&this.Fn(this,void 0,this.cs.kn.collectionMember),this}py(){return this.vd}bd(t){var e;const i=this.vd.indexOf(t);i>=0&&(this.vd.splice(i,1),this.$W=!0,this.Zi&&this.Fn&&(null===(e=this.cs.kn)||void 0===e?void 0:e.entity)===this&&this.cs.kn.collectionMember===t&&this.Fn(this,void 0,this.cs.kn.collectionMember))}DG(t,e){var i;return t.QW=e,this.$W=!0,this.Zi&&this.Fn&&(null===(i=this.cs.kn)||void 0===i?void 0:i.entity)===this&&this.cs.kn.collectionMember===t&&this.Fn(this,void 0,this.cs.kn.collectionMember),t}BG(t,e){return t.Vo=e,this.HW=!0,t}XW(t,e){return t.Na=e,this.WW=!0,t}jW(t,e){return t.S=e,this.UW=!0,t}EG(t,e){return t.ZW=null==e?void 0:e.toUint32(),this.YW=!0,t}Ds(){const t=this.Lo._(),e=this.Lo.o,i=this.ia(),s=this.HW,r=this.WW,n=this.UW,o=this.YW,a=this.$W,l=this.Me,u=this.na(),c=this.vd.filter((t=>t.QW&&t.Na.length>0));if(this.lE.mV(this.ft),(r||a)&&(this.Ha=Je(...c.map((t=>Ze(t.Na))))),r||a){const t=Jt(c.map((t=>[...t.Na,t.Na[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.ft.wi()),e=this.ft.wi()?4:2;this.xG=this.ER.oV(t,!1,this.xG);let i=[];c.reduce(((s,r)=>{const n=s,o=(r.Na.length+1)*e,a=new Float32Array(t.buffer,n,o),l=h.default(a,void 0,e),u=s/(Float32Array.BYTES_PER_ELEMENT*e);for(let t=0;tt+e.Na.length+2),0),e=new Float32Array(t);let i=0;c.forEach((t=>{const s=t.Na.length+2;for(let r=i;rt+e.Na.length+2),0),e=new Float32Array(4*t);let i=0;c.forEach((t=>{const s=t.Na.length+2;for(let r=i;rt+e.Na.length+2),0),e=new Float32Array(t);let i=0;const s={min:Le,max:Pe};c.forEach((t=>{const r=void 0!==t.S?t.S:-34028234663852886e22,n=t.Na.length+2;for(let t=i;tt+e.Na.length+2),0),e=new Uint32Array(t);let i=0;const s=g?g.getFallbackColor().toUint32():R.toUint32();c.forEach((t=>{const r=void 0!==t.ZW?t.ZW:s,n=t.Na.length+2;for(let t=i;tthis.nU(t,e,i,c))),this.HW=!1,this.$W=!1,this.WW=!1,this.UW=!1,this.YW=!1,this.Lo.o=!1,this.ra(this.be),this.la(l),this}VL(t){var e,i;const{fill:s,border:r}=this.bG,n=this.xG,o=this.tU,h=this.iU;if(!n||!o)return this;if(s){const{fillStyleSolid:i,fillStyleLinearGradient:r,fillStyleRadialGradient:a,fillStylePaletted:l,fillStyleImage:u,fillStyleIndividual:c}=s,d=this.JW,f=this.KW,g=1===t?null===(e=s.mousePicking)||void 0===e?void 0:e.shader:s.shader;if(!g||!n||!d||void 0===f)return this;this.ER.ZR(g).lV(g,((e,s,g,m)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(m("uScaleStart_highpart"),this.lE.OO()).cV(m("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(m("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(m("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(m("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(m("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.xO(g,n,this.ft.wi(),void 0).jV(d).XV(s("aIsHighlighted"),o).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.ER.$V(s("aColor"),h)}else if(i)this.ER.gR(e("uColor"),i.getColor());else if(a){if(!this._N)return!1;this.ER.mO(g,this._N,a)}else if(r){if(!this.wN)return!1;this.ER.yO(g,this.wN,r)}else if(l){const t=kg(l,this,this.sU);if(!t&&l.lut.percentageValues)return!1;if(this.ER.RO(g,l.lut,t),"value"===l.getLookUpProperty()){if(!this.eU)return!1;this.ER.XV(s("aLookupValue"),this.eU)}}else if(u){if(!this.rU)return!1;this.ER.gR(m("uColor"),u.getSurroundingColor()).dV(e("uColorTexture"),this.rU.texture.Wz()||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).RV(u.fitMode)}else if(c){if(!this.hU)return!1;const t=s("aColor");this.ER.gl.bindBuffer(this.ER.gl.ARRAY_BUFFER,this.hU),this.ER.gl.vertexAttribPointer(t,4,this.ER.gl.UNSIGNED_BYTE,!0,0,0),this.ER.gl.enableVertexAttribArray(t)}return this.ER.QV(f,void 0,void 0,this.ER.gl.UNSIGNED_INT),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.qW,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.ER.ZR(u).lV(u,((i,r,u,c)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()).cV(c("uScaleStart_highpart"),this.lE.OO()).cV(c("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(c("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(c("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(c("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(c("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(i("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(i("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),this.ER.uV(o,1,{location:r("aIsHighlighted"),size:1}).gR(i("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.ER.uV(h,1,{location:r("aColor"),size:4})}else s&&this.ER.gR(i("uColor"),s.getColor());return oy.AG(this.ft.wi(),this.ER,n,u,this.ft.wi()?4:2,0),oy.VL(this.nN,e,u,this.vG&&1!==t,1===t,a,l),!0}))}return this}nU(t,e,i,s){const r=dt({x:this.Ha.min.x,y:this.Ha.min.y},this.ft,this.cs.ft),n=dt({x:this.Ha.max.x,y:this.Ha.max.y},this.ft,this.cs.ft),o={x:Math.abs(r.x-n.x),y:Math.abs(r.y-n.y)},h=Bm(t,e,o.x,o.y,i),a=h[1],l=h[4],u=h[6],c=h[7],d=s.reduce(((t,e)=>t+e.Na.length+2),0),f=new Float32Array(2*d),g=this.Ha.max.x-this.Ha.min.x,m=this.Ha.max.y-this.Ha.min.y,y=l-u,p=c-a;let x=0;for(const t of s){for(const e of t.Na){const t=u+y*((e.x-this.Ha.min.x)/g),i=a+p*((e.y-this.Ha.min.y)/m);f[x]=t,f[x+1]=i,x+=2}const e=u+y*((t.Na[0].x-this.Ha.min.x)/g),i=a+p*((t.Na[0].y-this.Ha.min.y)/m);f[x]=e,f[x+1]=i,x+=2,f[x]=Number.NaN,f[x+1]=Number.NaN,x+=2}return f}uN(t){const e=this.vd.find((e=>e.pN===t));return!!e&&{collectionMember:e}}OR(){return this.JW&&(this.ER.yV(this.JW),this.JW=void 0),this.xG&&(this.ER.yV(this.xG),this.xG=void 0),this.tU&&(this.ER.yV(this.tU),this.tU=void 0),this.iU&&(this.ER.yV(this.iU),this.iU=void 0),this.eU&&(this.ER.yV(this.eU),this.eU=void 0),this.hU&&(this.ER.yV(this.hU),this.hU=void 0),this.bG={fill:void 0,border:void 0},this.rU=this.ER.zO(this,this.rU),this}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return we(this.Me)}bl(){return we(this.Me)}}class My extends en{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.oU=_e,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be,fillStyleImage:()=>Zn(this.be)&&this.be,strokeStyleSolid:()=>qi(this.Me)&&this.Me,strokeFillSolid:()=>{const t=this.Me.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.Me.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.Me.getFillStyle();return et(t)&&t}}),this.nU=(t,e,i)=>{const s=dt(this.Ia(),this.ft,this.cs.ft),r=hi(dt(oi(this.Ia(),this.ai()),this.ft,this.cs.ft),s);return Bm(t,e,r.x,r.y,i)},this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e}Ds(){super.Ds();const t=this.Lo._(),e=this.ia(),i=this.ca.o||this.j.o||this.ga.o||this.ma.o,s=this.Me,r=this.na(),n=s.getThickness(),o=this.ga._();this.lE.mV(this.ft);const h=this.ft.Gi();if(i){const t=this.j._();this.Na=function(t,e,i,s,r){const n=((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;n[0]=ti(n[0],r,t),n[1]=ti(n[1],r,t),n[2]=ti(n[2],r,t),n[3]=ti(n[3],r,t)}return n}(this.ca._(),t.x,t.y,o,this.ma._());const e=Jt(this.Na,this.ft.wi());this.vN=this.ER.oV(e,!1,this.vN),this.bN=this.Na.length,this.oU=Ze(this.Na)}const a=this.gN.fillStyleSolid(e),l=this.gN.fillStyleRadialGradient(e),c=this.gN.fillStyleLinearGradient(e),d=this.gN.fillStyleImage(e),f=a||l||c||d;e&&(this.CN=f?this.ER.az(em["2D"],a&&em.Color({dataType:"uniform"}),c&&em.Color({dataType:["gradient",c]}),l&&em.Color({dataType:["gradient",l]}),d&&em.Color({dataType:["image",d]}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),l?this._N=Dm(this.zo||this.oU,this.ft,l.getPosition(),l.getExtent(),l.getShape(),this.ER.Xz()):c?this.wN=Lm(this.zo||this.oU,this.ft,c.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0),this.rU=this.ER.EO(this,this.rU,d,void 0,h||i,this.nU);const g=this.gN.strokeStyleSolid(r),m=this.gN.strokeFillSolid(r),y=this.gN.strokeFillLinearGradient(r),p=this.gN.strokeFillRadialGradient(r),x=g,S=m||y||p;if(x&&(i||r||h&&1!==n)){if(1===n||-1===n)[this.kN,this.aU]=[this.Na,void 0];else{const t=this.ft;[this.kN,this.aU]=t instanceof Vi?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Yi(s,r,h,-h),i.Yi(r,s,-h,-h),i.Yi(o,n,-h,-h),i.Yi(n,o,h,-h),i.Yi(s,r,-h,h),i.Yi(r,s,h,h),i.Yi(o,n,h,h),i.Yi(n,o,-h,h)],[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.Na,n,t):((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=u(e.x*i*.5,e.y*i*.5),a=ii(ei(r,s)),l=ii(ei(o,s)),c=ui(a),d=ui(l);return[[oi(s,oi(ni(c,h.x),ni(d,h.y))),oi(r,oi(ni(a,h.x),ni(d,h.y))),oi(o,oi(ni(c,h.x),ni(l,h.y))),oi(n,oi(ni(a,h.x),ni(l,h.y))),oi(s,oi(ni(a,h.x),ni(l,h.y))),oi(r,oi(ni(c,h.x),ni(l,h.y))),oi(o,oi(ni(a,h.x),ni(d,h.y))),oi(n,oi(ni(c,h.x),ni(d,h.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.Na,t.Ui(),n)}this.FN=this.ER.oV(Jt(this.kN,this.ft.wi()),!1,this.FN),this.aU?(this.cG=this.ER.NV(new Uint16Array(this.aU),this.cG),this.TN=this.aU.length):(this.cG&&this.ER.yV(this.cG),this.cG=void 0,this.TN=this.kN.length)}return r&&(this.EN=x&&S?this.ER.az(em["2D"],em.Color({dataType:p?["gradient",p]:y?["gradient",y]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),p?this.LN=Dm(this.oU,this.ft,p.getPosition(),p.getExtent(),p.getShape(),this.ER.Xz()):y?this.RN=Lm(this.oU,this.ft,y.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.zN=t&&f?this.zN||this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.VN=t&&this.Me!==ot?this.VN||this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.ra(this.be),this.la(s),this.ca.o=!1,this.ga.o=!1,this.j.o=!1,this.ma.o=!1,this}uN(t){return this.pN===t&&{}}VL(t){const e=1===t?this.zN:this.CN,i=this.vN,s=this.bN,r=this.gN.fillStyleSolid(!1),n=this.gN.fillStyleRadialGradient(!1),o=this.gN.fillStyleLinearGradient(!1),h=this.gN.fillStyleImage(!1);e&&i&&s&&this.be!==z&&(this.ER.ZR(e),this.ER.lV(e,((e,a,l,u)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(u("uScaleStart_highpart"),this.lE.OO()).cV(u("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(u("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(u("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(u("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(u("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(r)this.ER.gR(e("uColor"),r.getColor());else if(n){if(!this._N)return!1;this.ER.mO(l,this._N,n)}else if(o){if(!this.wN)return!1;this.ER.yO(l,this.wN,o)}else if(h){if(!this.rU)return!1;const t=this.rU&&this.rU.texture.Wz();this.ER.gR(u("uColor"),h.getSurroundingColor()).dV(e("uColorTexture"),t||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:a("aTextureCoord"),size:2}).RV(h.fitMode)}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).xO(l,i,this.ft.wi(),void 0).Zm(this.ER.gl.TRIANGLE_FAN,s),!0})));const a=1===t?this.VN:this.EN,l=this.gN.strokeStyleSolid(!1),u=this.gN.strokeFillSolid(!1),c=this.gN.strokeFillLinearGradient(!1),d=this.gN.strokeFillRadialGradient(!1),f=this.FN;return a&&f&&l&&(this.ER.ZR(a),this.ER.lV(a,((e,i,s,r)=>{if(this.ft instanceof _i||this.ft instanceof $c?this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(r("uScaleStart_highpart"),this.lE.OO()).cV(r("uScaleStart_lowpart"),this.lE.NO()):this.ft instanceof Vi&&this.ER.cV(r("uScaleStart"),this.lE.MixedScaleXY.uScaleStart).cV(r("uScaleStartLog"),this.lE.MixedScaleXY.uScaleStartLog).cV(r("uScaleInterval"),this.lE.MixedScaleXY.uScaleInterval).cV(r("uScaleIntervalLog"),this.lE.MixedScaleXY.uScaleIntervalLog).cV(e("uViewportStart"),this.lE.MixedScaleXY.uViewportStart).cV(e("uViewportSize"),this.lE.MixedScaleXY.uViewportSize),1===t)this.ER.gR(e("uColor"),this.mN);else if(u)this.ER.gR(e("uColor"),u.getColor());else if(d){if(!this.LN)return!1;this.ER.mO(s,this.LN,d)}else if(c){if(!this.RN)return!1;this.ER.yO(s,this.RN,c)}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).xO(s,f,this.ft.wi(),void 0),this.cG?this.ER.jV(this.cG).QV(this.TN):this.ER.Zm(this.ER.gl.LINE_LOOP,this.TN),!0}))),this}OR(){return this.cG&&(this.ER.yV(this.cG),this.cG=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.rU=this.ER.zO(this,this.rU),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this}bt(){return Math.max(this.ca._().x,this.ca._().x+this.j._().x)}xt(){return Math.min(this.ca._().x,this.ca._().x+this.j._().x)}_t(){return Math.max(this.ca._().y,this.ca._().y+this.j._().y)}Mt(){return Math.min(this.ca._().y,this.ca._().y+this.j._().y)}xl(){return we(this.Me)}bl(){return we(this.Me)}}class Ey extends rn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.lE=new Ym,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be,fillStyleImage:()=>Zn(this.be)&&this.be,strokeLineStyleSolid:()=>qi(this.Me)&&this.Me,strokeLineSolidFill:()=>{const t=this.Me.getFillStyle();return Y(t)&&t},strokeLinearGradientFill:()=>{const t=this.Me.getFillStyle();return rt(t)&&t},strokeRadialGradientFill:()=>{const t=this.Me.getFillStyle();return et(t)&&t}}),this.nU=(t,e,i)=>{const s=dt({x:this.Ha.min.x,y:this.Ha.min.y},this.ft,this.cs.ft),r=dt({x:this.Ha.max.x,y:this.Ha.max.y},this.ft,this.cs.ft),n={x:Math.abs(s.x-r.x),y:Math.abs(s.y-r.y)},o=Bm(t,e,n.x,n.y,i),h=o[1],a=o[4],l=o[6],u=o[7],c=new Float32Array(2*this.Na.length),d=this.Ha.max.x-this.Ha.min.x,f=this.Ha.max.y-this.Ha.min.y,g=a-l,m=u-h;let y=0;for(const t of this.Na){const e=l+g*((t.x-this.Ha.min.x)/d),i=h+m*((t.y-this.Ha.min.y)/f);c[y]=e,c[y+1]=i,y+=2}return c},this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e}$c(t){let e,i=Number.MAX_VALUE;for(const s of this.Na){const r=Xe(dt(s,this.ft,this.cs.ft),t);r=3,r=this.Me,n=this.na(),o=r.getThickness(),a=this.aa(o);this.lE.mV(this.ft),this.IT=this.ft.Ui();const l=this.ft.Gi();if(i&&(this.Ha=Ze(this.Na)),i&&s){const t=Jt(this.Na,this.ft.wi());this.vN=this.ER.oV(t,!1,this.vN),this.lU=new Uint16Array(h.default(t)),this.uU=this.ER.NV(this.lU,this.uU),this.bN=this.lU.length}const u=this.gN.fillStyleSolid(e),c=this.gN.fillStylePaletted(e),d=this.gN.fillStyleRadialGradient(e),f=this.gN.fillStyleLinearGradient(e),g=this.gN.fillStyleImage(e),m=u||c&&"value"!==c.getLookUpProperty()&&c||f||d||g;if(e&&(this.CN=m?this.ER.az(em["2D"],u&&em.Color({dataType:"uniform"}),f&&em.Color({dataType:["gradient",f]}),d&&em.Color({dataType:["gradient",d]}),c&&em.Color({dataType:["lookup",c.getLookUpProperty(),c.lut]}),g&&em.Color({dataType:["image",g]}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),d?this._N=Dm(this.zo||this.Ha,this.ft,d.getPosition(),d.getExtent(),d.getShape(),this.ER.Xz()):f?this.wN=Lm(this.zo||this.Ha,this.ft,f.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0),this.rU=this.ER.EO(this,this.rU,g,void 0,l||i,this.nU),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this.Na:$m(this.Na,this.IT,o);this.kN=Jt(t,this.ft.wi()),this.FN=this.ER.oV(this.kN,!0,this.FN),this.TN=t.length}const y=this.gN.strokeLineStyleSolid(n),p=this.gN.strokeLineSolidFill(n),x=this.gN.strokeLinearGradientFill(n),S=this.gN.strokeRadialGradientFill(n),A=y,v=p||x||S;return n&&(this.EN=A&&v?this.ER.az(em["2D"],em.Color({dataType:S?["gradient",S]:x?["gradient",x]:"uniform"}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0),S?this.LN=Dm(this.zo||this.Ha,this.ft,S.getPosition(),S.getExtent(),S.getShape(),this.ER.Xz()):x?this.RN=Lm(this.zo||this.Ha,this.ft,x.getAngle(!0),this.ER.Xz()):(this.LN=void 0,this.RN=void 0),this.zN=t&&m?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.VN=t&&this.Me!==ot?this.zN||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})):void 0,this.yl=!1,this.ra(this.be),this.la(r),this}VL(t){const e=1===t?this.zN:this.CN,i=this.vN,s=this.bN,r=this.gN.fillStyleSolid(!1),n=this.gN.fillStyleRadialGradient(!1),o=this.gN.fillStyleLinearGradient(!1),h=this.gN.fillStylePaletted(!1),a=this.gN.fillStyleImage(!1);e&&i&&s&&this.ER.ZR(e).lV(e,((e,s,l,u)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).cV(u("uScaleStart_highpart"),this.lE.OO()).cV(u("uScaleStart_lowpart"),this.lE.NO()).xO(l,i,this.ft.wi(),void 0).jV(this.uU).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(e("uColor"),this.mN);else if(r)this.ER.gR(e("uColor"),r.getColor());else if(n){if(!this._N)return!1;this.ER.mO(l,this._N,n)}else if(o){if(!this.wN)return!1;this.ER.yO(l,this.wN,o)}else if(h){const t=kg(h,this,void 0);if(!t&&h.lut.percentageValues)return!1;this.ER.RO(l,h.lut,t)}else if(a){if(!this.rU)return!1;this.ER.gR(u("uColor"),a.getSurroundingColor()).dV(e("uColorTexture"),this.rU.texture.Wz()||this.rU.sourceMissingTexture,0).uV(this.rU.texCoordsBuffer,void 0,{location:s("aTextureCoord"),size:2}).RV(a.fitMode)}return this.ER.QV(this.bN),!0}));const l=1===t?this.VN:this.EN,u=this.Me,c=this.FN,d=this.TN;return l&&c&&d&&this.ER.ZR(l).lV(l,((e,i,s,r)=>{this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).xO(s,c,this.ft.wi(),void 0);const n=u.getFillStyle();if(1===t)this.ER.gR(e("uColor"),this.mN);else if(Y(n))this.ER.gR(e("uColor"),n.getColor());else if(et(n)){if(!this.LN)return!1;this.ER.mO(s,this.LN,n)}else if(rt(n)){if(!this.RN)return!1;this.ER.yO(s,this.RN,n)}const o=u.getThickness(),h=-1===o||1===o;return this.ER.Zm(h?this.ER.gl.LINE_LOOP:this.ER.gl.TRIANGLE_STRIP,this.TN),!0})),this}uN(t){return this.pN===t&&{}}OR(){return this.uU&&(this.ER.yV(this.uU),this.uU=void 0),this.vN&&(this.ER.yV(this.vN),this.vN=void 0),this.FN&&(this.ER.yV(this.FN),this.FN=void 0),this.CN=void 0,this.EN=void 0,this.zN=void 0,this.VN=void 0,this.rU=this.ER.zO(this,this.rU),this}}const wy=(t,e)=>{let i=0;const s=[];for(;i0;n-=o?1:0,n-=i+n{let i=0;const s=[];for(;i0;n-=o?1:0,n-=0;const h=Math.min(n,t-r),a=i-(o?1:0),l={start:a,startUnique:r,sizeData:Math.min(e,t-a),sizeUniqueData:h};s.push(l),i+=h}return s},ky=(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 r=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},h=[{x:e.primary,y:e.secondary},{x:o.x,y:e.secondary},o,{x:e.primary,y:o.y}];if(!Ne(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=Oe(a,h),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),r=Math.max(e.startPrimary,t.iFirstVector.primary),n=Math.min(e.startPrimary+e.lengthPrimary-1,t.iFirstVector.primary+t.sizeHeatmapDataVectors.primary-1),o=Math.max(e.startSecondary,t.iFirstVector.secondary),h=Math.min(e.startSecondary+e.lengthSecondary-1,t.iFirstVector.secondary+t.sizeHeatmapDataVectors.secondary-1);for(let i=r;i<=n;i+=1){const r=i-e.startPrimary,n=e.values[r],a=(i-t.iFirstVector.primary)*t.sizeHeatmapDataVectors.secondary;for(let i=o;i<=h;i+=1){const r=i-e.startSecondary,o=i-t.iFirstVector.secondary,h=n[r];s[a+o]=h}}}));else{const s=t[0],r=i(s);for(let t=0;t{var s,r;const n=null===(s=t.gl2)||void 0===s?void 0:s.ctx;if(n)return t.AO(null,n.RED,!1,!0,{x:e,y:i},!1,n.FLOAT,n.R32F);const o=t.gl;return(null===(r=t.gl1)||void 0===r?void 0:r.optional.OES_texture_float)?t.AO(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.AO(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Iy=(t,e,i,s)=>{e.forEach(((e,r)=>{var n,o;const h=i(r),a=s(r),l=t.gl;l.bindTexture(l.TEXTURE_2D,a),l.pixelStorei(l.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const u=null===(n=t.gl2)||void 0===n?void 0:n.ctx,c=e.dataInvalidationRanges.length,d=e.dataInvalidationRanges.reduce(((t,e)=>t+e.tileInvalidationLength.primary),0)/r.sizeHeatmapDataVectors.primary;1===c&&d<1||d<.5&&c<10?e.dataInvalidationRanges.forEach((e=>{var i;const s=e.tileInvalidationOffset.primary*r.sizeHeatmapDataVectors.secondary,n=s+e.tileInvalidationLength.primary*r.sizeHeatmapDataVectors.secondary;if(u)u.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,u.RED,u.FLOAT,h.subarray(s,n));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,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.LUMINANCE,l.FLOAT,h.subarray(s,n));else{const t=new Uint8Array(h.buffer).subarray(4*s,4*n);l.texSubImage2D(l.TEXTURE_2D,0,0,e.tileInvalidationOffset.primary,r.sizeHeatmapDataVectors.secondary,e.tileInvalidationLength.primary,l.RGBA,l.UNSIGNED_BYTE,t)}})):u?u.texImage2D(l.TEXTURE_2D,0,u.R32F,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,u.RED,u.FLOAT,h):(null===(o=t.gl1)||void 0===o?void 0:o.optional.OES_texture_float)?l.texImage2D(l.TEXTURE_2D,0,l.LUMINANCE,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.LUMINANCE,l.FLOAT,h):l.texImage2D(l.TEXTURE_2D,0,l.RGBA,r.sizeHeatmapDataVectors.secondary,r.sizeHeatmapDataVectors.primary,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array(h.buffer)),l.bindTexture(l.TEXTURE_2D,null)}))};class Fy extends Kr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.cU=p("bilinear"),this.Di={x:0,y:0},this.Xw={x:1,y:1},this.pv=wr.lineStyle,this.engine=t;const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Yn={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}Mv(t){return this.cU.M(t),this}_v(){return this.cU._()}vv(t,e){return this.Di=t,this.Xw=e,this}xv(){return{start:this.Di,step:this.Xw,end:{x:this.Di.x+this.Xw.x*this.Yn.columns,y:this.Di.y+this.Xw.y*this.Yn.rows}}}mv(t){return this.pv="function"==typeof t?t(this.pv):t,this}bv(){return this.pv}}class Dy extends Fy{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.lE=new Ym,this.bG={},this.dU=[],this.fU=!1,this.Ja=!1,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,wireframeStyleLine:()=>qi(this.pv)&&this.pv,wireframeStyleFill:()=>{const t=this.pv&&this.pv.getFillStyle();return Y(t)&&t}}),this.AU=wy,this.nN=t,this.oN=e,this.pN=o,this.mN=h,this.ER=t.aN(),this.oN=e;const a=Math.min(this.ER.VR,void 0!==n.gU?n.gU:2048),l={x:Math.min(a,this.Yn.primaryDimensionVectorsCount),y:Math.min(a,this.Yn.secondaryDimensionVectorsCount)},u=((t,e,i,s)=>{const r=[],n=i(t.primaryDimensionVectorsCount,e.x),o=i(t.secondaryDimensionVectorsCount,e.y);let h;return n.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}};r.push(i)})))),h=[],r.forEach((t=>{let e=h.find((e=>e.sizeHeatmapData.primary===t.sizeHeatmapDataVectors.primary&&e.sizeHeatmapData.secondary===t.sizeHeatmapDataVectors.secondary));e||(e={sizeHeatmapData:t.sizeHeatmapDataVectors,tiles:[]},h.push(e)),e.tiles.push(t)})),{gridTiles:r,gridTileSizes:h}})(this.Yn,l,this.AU),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.pU={gridTiles:c,gridTileSizes:d},this.vv(this.Di,this.Xw)}Ds(){const t=this.dU,e=this.be,i=this.ia(),s=this.pv,r=s!==this.mU,n=this.gN.fillStylePaletted(i),o=this.gN.fillStyleSolid(i),h=this.cU.o,a=this.cU._(),l=this.Ja,u=this.Lo._();this.yU=this.yU||this.SU();const c=this.yU,d=ky(t,c,l?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));d.size>0&&(Iy(this.ER,d,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.fU=!0),this.lE.mV(this.ft);const f=this.bG;if((i||h)&&(f.tile=n?{renderMode:"paletted",fillStylePaletted:n,shader:this.ER.az(em["2D"],em.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===a&&"bilinear",flipXY:"rows"===this.Yn.dataOrder,intensityTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN,lut:n.lut}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:void 0),r){const t=this.gN.wireframeStyleLine(r),e=this.gN.wireframeStyleFill(r);f.wireframe=t&&e?-1===t.getThickness()?{renderMode:"primitive",shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Yn.dataOrder,axisWorldTranslation:wg(this.ft),normalSource:void 0})),fillStyleSolid:e}:{renderMode:"triangulated",shader:this.ER.az(em["2D"],em.Color({dataType:"uniform"}),em.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Yn.dataOrder,axisWorldTranslation:wg(this.ft),normalSource:void 0})),geometry:ny(this.ER,1),solidLine:t,fillStyleSolid:e}:void 0,f.wireframe?this.vU=this.vU||this.xU():this.vU&&(this.ER.yV(this.vU.wireframeCoordinatesBuffer),this.vU=void 0)}if(f.mousePicking=u?this.bG.mousePicking||{shader:this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),flipXY:"rows"===this.Yn.dataOrder,normalSource:void 0}))}:void 0,this.bG=f,void 0===this.Ka&&n&&"value"===n.lookUpProperty&&n.lut.percentageValues){let t=Le,e=Pe;this.yU.gridTiles.forEach((i=>{for(let s=0;se&&(e=r)}})),this.Ka={min:t,max:e}}return this.Ja=!1,this.dU.length=0,this.ra(e),this.mU=s,this.cU.o=!1,this}SU(){const t=this.pU.gridTiles.map((t=>{const e=Ry(this.ER,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e,tileData:t}})),e=this.pU.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.ER.oV([0,0,1,0,0,1,1,1]),s=this.ER.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}xU(){const t=this.Yn.primaryDimensionVectorsCount+1+this.Yn.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{const e="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstVector.primary,y:this.Di.y+this.Xw.y*t.iFirstVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstVector.secondary,y:this.Di.y+this.Xw.y*t.iFirstVector.primary},i="columns"===this.Yn.dataOrder?{x:this.Xw.x*t.sizeHeatmapDataVectors.primary,y:this.Xw.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Xw.x*t.sizeHeatmapDataVectors.secondary,y:this.Xw.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstUniqueVector.primary,y:this.Di.y+this.Xw.y*t.iFirstUniqueVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstUniqueVector.secondary,y:this.Di.y+this.Xw.y*t.iFirstUniqueVector.primary},n="columns"===this.Yn.dataOrder?{x:this.Xw.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Xw.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Xw.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Xw.y*t.sizeUniqueHeatmapDataVectors.primary};r.set(t,{startLocationAxis:e,sizeAxis:i,startRenderLocationAxis:s,renderSizeAxis:n})})),this.bU={boundaries:s,tilesInfo:r},this}VL(t){var e,i;const s=this.yU,r=this.bU,n=1===t?null===(e=this.bG.mousePicking)||void 0===e?void 0:e.shader:null===(i=this.bG.tile)||void 0===i?void 0:i.shader;if(this.bG.tile&&n&&s&&r){const e=n,i=this.bG.tile,o={x:(r.boundaries.max.x-r.boundaries.min.x)*Math.sign(this.Xw.x),y:(r.boundaries.max.y-r.boundaries.min.y)*Math.sign(this.Xw.y)},h={x:o.x/this.Yn.columns,y:o.y/this.Yn.rows},a=this.ft.Ui(),l={x:h.x/a.x,y:h.y/a.y};if("solid"===i.renderMode||1===t)this.ER.ZR(e).lV(e,((e,r,n)=>{if(1===t)this.ER.gR(e("uColor"),this.mN);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.ER.gR(e("uColor"),t.getColor())}return this.ER.fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).uV(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).cV(e("uScaling"),[this.Xw.x*this.Yn.columns,this.Xw.y*this.Yn.rows]).cV(e("uTranslationAxis"),[this.Di.x,this.Di.y]).Zm(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{fillStylePaletted:n}=i,o=this.Ka;this.ER.lV(e,((i,h,a)=>{let u=!1;var c,d;return this.ER.ZR(e).cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()).RO(a,n.lut,o).uV(s.rectangleLocationsBuffer,void 0,{location:h("aPos"),size:2}).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),c=t=>{this.ER.cV(i("uTileDimensions"),["columns"===this.Yn.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},d=(t,e)=>{const n=r.tilesInfo.get(t.tileData);if(!n)return;let o;const h=this.ER.Xz();if("bilinear"===this.cU._()){const t=(this.ft.x.dt(n.startLocationAxis.x)+l.x/2)*h,e=(this.ft.y.dt(n.startLocationAxis.y)+l.y/2)*h;o=[t,e,(this.ft.x.dt(n.startLocationAxis.x+n.sizeAxis.x)-l.x/2)*h-t,(this.ft.y.dt(n.startLocationAxis.y+n.sizeAxis.y)-l.y/2)*h-e]}else{const t=this.ft.x.dt(n.startLocationAxis.x)*h,e=this.ft.y.dt(n.startLocationAxis.y)*h;o=[t,e,this.ft.x.dt(n.startLocationAxis.x+n.sizeAxis.x)*h-t,this.ft.y.dt(n.startLocationAxis.y+n.sizeAxis.y)*h-e]}this.ER.IV(i("uTileBounds"),o).cV(i("uScaling"),[n.renderSizeAxis.x,n.renderSizeAxis.y]).cV(i("uTranslationAxis"),[n.startRenderLocationAxis.x,n.startRenderLocationAxis.y]).dV(i("uTileIntensityValues"),t.intensityDataTexture,1).Zm(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),u=!0},s.gridTileSizes.forEach((t=>{c(t),t.tiles.forEach((t=>{d(t)}))})),u}))}}const o=this.vU,h=this.bG.wireframe,a=1===t||null==h?void 0:h.shader;if(o&&h&&a&&"primitive"===h.renderMode){const{fillStyleSolid:e}=h;this.ER.ZR(a).lV(a,((i,s,r)=>((this.ft instanceof _i||this.ft instanceof $c)&&this.ER.cV(i("uScale"),this.lE.AV()).cV(i("uDisp"),this.lE.gV()),this.ER.fV(i("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(i("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0).gR(i("uColor"),e.getColor()).uV(o.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).cV(i("uScaling"),[this.Xw.x,this.Xw.y]).cV(i("uTranslationAxis"),[this.Di.x,this.Di.y]).Zm(this.ER.gl.LINES,2*o.wireframeSegmentsLength),!0)))}else if(o&&h&&a&&"triangulated"===h.renderMode){const{geometry:e,solidLine:i,fillStyleSolid:s}=h;this.ER.ZR(a).lV(a,((r,n,h)=>((this.ft instanceof _i||this.ft instanceof $c)&&this.ER.cV(r("uScale"),this.lE.AV()).cV(r("uDisp"),this.lE.gV()),this.ER.fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0).gR(r("uColor"),s.getColor()).fV(r("uThicknessPixels"),i.getThickness()).cV(r("uRatioPxClip"),[2/this.cs.ai().x,2/this.cs.ai().y]).uV(o.wireframeCoordinatesBuffer,1,{location:n("aLocationA"),size:2},{location:n("aLocationB"),size:2}).cV(r("uScaling"),[this.Xw.x,this.Xw.y]).cV(r("uTranslationAxis"),[this.Di.x,this.Di.y]),e.ZR(h,!1).Zm(o.wireframeSegmentsLength),!0)))}return this}wv(t){return this.dU.push(t),Cy(this.pU.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this.Ka=void 0,this}Gt(){return this.fU&&(this.pU.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Ja=!0,this.fU=!1,this.Ka=void 0),this}dispose(){super.dispose();const t=this.yU;t&&(t.gridTiles.forEach((t=>{this.ER.NR(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.ER.yV(t.rectangleLocationsBuffer)),this.yU=void 0;const e=this.vU;return e&&this.ER.yV(e.wireframeCoordinatesBuffer),this.vU=void 0,this.bG={},this}OR(){return this.dispose(),this}uN(t){return this.pN===t&&{}}$c(t){const e=t,i="columns"===this.Yn.dataOrder?e.x:e.y,s="columns"===this.Yn.dataOrder?e.y:e.x,r="columns"===this.Yn.dataOrder?this.Di.x:this.Di.y,n="columns"===this.Yn.dataOrder?this.Di.y:this.Di.x;let o=(i-r)/("columns"===this.Yn.dataOrder?this.Xw.x:this.Xw.y),h=(s-n)/("columns"===this.Yn.dataOrder?this.Xw.y:this.Xw.x);o=Math.floor(Rt(o,0,this.Yn.primaryDimensionVectorsCount-1)),h=Math.floor(Rt(h,0,this.Yn.secondaryDimensionVectorsCount-1));const a=this.MU(o,h),l="columns"===this.Yn.dataOrder?{x:this.Di.x+(o+.5)*this.Xw.x,y:this.Di.y+(h+.5)*this.Xw.y}:{x:this.Di.x+(h+.5)*this.Xw.x,y:this.Di.y+(o+.5)*this.Xw.y},u="columns"===this.Yn.dataOrder?o:h,c="columns"===this.Yn.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}Vb(t){const e=this.bU;if(!e||t.xe.boundaries.max.x||t.ye.boundaries.max.y)return;const i=t,s="columns"===this.Yn.dataOrder?i.x:i.y,r="columns"===this.Yn.dataOrder?i.y:i.x,n="columns"===this.Yn.dataOrder?this.Di.x:this.Di.y,o="columns"===this.Yn.dataOrder?this.Di.y:this.Di.x,h="columns"===this.Yn.dataOrder?this.Xw.x:this.Xw.y,a="columns"===this.Yn.dataOrder?this.Xw.y:this.Xw.x,l=Rt((s-n)/h-.5,0,this.Yn.primaryDimensionVectorsCount-1),u=Rt((r-o)/a-.5,0,this.Yn.secondaryDimensionVectorsCount-1),c=Rt(Math.ceil(l)-1,0,this.Yn.primaryDimensionVectorsCount-1),d=Rt(Math.ceil(u)-1,0,this.Yn.secondaryDimensionVectorsCount-1),f={point:{x:c,y:d},value:this.MU(c,d)},g={point:{x:c,y:d+1},value:this.MU(c,d+1)},m={point:{x:c+1,y:d},value:this.MU(c+1,d)},y={point:{x:c+1,y:d+1},value:this.MU(c+1,d+1)},p=_n({x:l,y:u},f,g,m,y);if(void 0===p)return;const x=Rt(Math.floor(l+.5),0,this.Yn.primaryDimensionVectorsCount-1),S=Rt(Math.floor(u+.5),0,this.Yn.secondaryDimensionVectorsCount-1),A="columns"===this.Yn.dataOrder?x:S,v="columns"===this.Yn.dataOrder?S:x,b=t;return{x:b.x,y:b.y,column:A,row:v,cellValue:p}}MU(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,r=e-s.iFirstVector.secondary,n=i*s.sizeHeatmapDataVectors.secondary+r;return s.intensityData[n]}}return 0}bt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.max.x)||0}xt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.min.x)||0}_t(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.max.y)||0}Mt(){var t;return(null===(t=this.bU)||void 0===t?void 0:t.boundaries.min.y)||0}xl(){return 0}bl(){return 0}B_(){const t=[];return this.pU.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.Xw.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}),this.bW=new my(this.ft,this));const t=this.bW.AW(this.JM,this.Su._());if(t>0){for(let e=0;e0?this.JM[0].boundaries.min.x:Le:this.Ha.min.y=this.JM.length>0?this.JM[0].boundaries.min.y:Le}this.JM.forEach((t=>t.shape.Ds()));const e=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.Ka)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.Ka)||void 0===s?void 0:s.max,Pe)),t}),{min:Le,max:Pe});return this.JM.forEach((t=>{t.shape.Ka=e})),this.Su.o=!1,this}VL(t){return this.JM.forEach((e=>e.shape.VL(t))),this}Iv(t){if(0===t.length)return this;let e=0;const i=this.wU.dataPerSegment,s=t.length;do{let r=this.JM[this.JM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Yn.scrollDimension?i:this.Yn.resolution,rows:"rows"===this.Yn.scrollDimension?i:this.Yn.resolution,heatmapDataType:this.Yn.heatmapDataType,dataOrder:this.Yn.scrollDimension};let e="columns"===this.Yn.scrollDimension?{x:this.Di.x+this.Xw.x*this._U,y:this.Di.y}:{x:this.Di.x,y:this.Di.y+this.Xw.y*this._U};this.JM.length>0&&(e="columns"===this.Yn.scrollDimension?{x:e.x-1*this.Xw.x,y:e.y}:{x:e.x,y:e.y-1*this.Xw.y},o=!0);const s=new Dy(this.nN,this.oN,this.ft,kt,[],t,this.pN,this.mN).Mv(this.cU._()).ke(this.be).mv(this.pv).vv(e,this.Xw);r={shape:s,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this._U,hasJoint:!1,boundaries:{min:{x:s.xt(),y:s.Mt()},max:{x:s.bt(),y:s._t()}}},this.JM.push(r),n=i-(o?1:0)}const h=s-e,a=Math.min(n,h),l=t.slice(e,e+a),u={type:"intensity",values:l,startPrimary:r.existingDataPointsCount+(r.hasJoint?1:0),startSecondary:0,lengthPrimary:a,lengthSecondary:this.Yn.resolution};o&&(u.values.unshift(this.CU),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.wv(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),this.CU=l[l.length-1],this._U+=a,e+=a}while(e{const n=t.dataStartIndex,o=t.dataStartIndex+t.existingDataPointsCount-1;if(so)return;const h=i-n,a=Math.min(s,o),l=a-h+1,u=e.slice(h-i,a-i+1),c={type:"intensity",startSecondary:0,lengthSecondary:r,startPrimary:h,lengthPrimary:l,values:u};t.shape.wv(c)}));const n=this._U-1;if(s>n){const t=s-n,i=e.slice(-t);if(i.length{t.shape.dispose().OR()})),this.JM.length=0,this.Ha="columns"===this.Yn.scrollDimension?m({x:this.Di.x,y:this.Di.y},{x:this.Di.x,y:this.Di.y+this.Yn.resolution*this.Xw.y}):m({x:this.Di.x,y:this.Di.y},{x:this.Di.x+this.Yn.resolution*this.Xw.x,y:this.Di.y}),this._U=0,this.CU=void 0,this}vv(t,e){return super.vv(t,e),this.JM.forEach(((i,s)=>{const r={x:t.x+i.dataStartIndex*e.x,y:t.y+i.dataStartIndex*e.y};i.shape.vv(r,e),i.boundaries={min:{x:i.shape.xt(),y:i.shape.Mt()},max:{x:i.shape.bt(),y:i.shape._t()}}})),this.JM.length>0?this.Ha=Je(...this.JM.map((t=>t.boundaries))):this.Ha="columns"===this.Yn.scrollDimension?m({x:this.Di.x,y:this.Di.y},{x:this.Di.x,y:this.Di.y+this.Yn.resolution*this.Xw.y}):m({x:this.Di.x,y:this.Di.y},{x:this.Di.x+this.Yn.resolution*this.Xw.x,y:this.Di.y}),this}ke(t){return super.ke(t),this.JM.forEach((t=>t.shape.ke(this.be))),this}mv(t){return super.mv(t),this.JM.forEach((t=>t.shape.mv(this.pv))),this}Mv(t){return super.Mv(t),this.JM.forEach((e=>e.shape.Mv(t))),this}dispose(){return super.dispose(),this.JM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.JM.forEach((e=>e.shape.setVisible(t))),this}OR(){return this.JM.forEach((t=>t.shape.OR())),this}uN(t){return this.pN===t&&{}}$c(t){const e=dt(t,this.ft,this.engine.ft),i=this.JM.reduce(((i,s)=>{const r=s.shape.$c(t);if(r){const t=We(dt(r,this.ft,this.engine.ft),e);if(void 0===i||t=this._U||"rows"===this.Yn.scrollDimension&&e>=this._U)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}Vb(t){const e=dt(t,this.ft,this.engine.ft),i=this.JM.reduce(((i,s)=>{const r=s.shape.Vb(t);if(r){const t=We(dt(r,this.ft,this.engine.ft),e);if(void 0===i||t=this._U||"rows"===this.Yn.scrollDimension&&e>=this._U)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}xl(){return 0}bl(){return 0}ds(t){return super.ds(t),this.JM.forEach((e=>e.shape.ds(t))),this}}class _y extends Kr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.cU=p("bilinear"),this.pv=wr.lineStyle,this.Yn=n}Mv(t){return this.cU.M(t),this}_v(){return this.cU._()}mv(t){return this.pv="function"==typeof t?t(this.pv):t,this}bv(){return this.pv}}class Vy extends _y{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.lE=new Ym,this.bG={},this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=o,this.mN=h,this.ER=t.aN(),this.oN=e,this.P_=new Dy(this.nN,t.kU,t.ft,kt,[],{columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",gU:this.ER.VR},-1,R).mv(ot);const a=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*a,i=Math.cos(e),s=Math.sin(e);l[u+0]=i,l[u+1]=s,u+=2}this.TU={vertexBuffer:this.ER.oV(l),drawMode:this.ER.gl.TRIANGLE_FAN,drawLength:362}}Ds(){const t=this.ia(),e=this.be,i=this.gN.fillStyleSolid(t),s=this.gN.fillStylePaletted(t),r=i||s,n=this.cU._(),o=this.cU.o,h=this.Lo._(),a=this.Lo.o;return this.lE.mV(this.ft),this.P_.Ds(),this.P_.yU?((t||o)&&(this.bG.fill=r?{shader:this.ER.az(em["2D"],em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),normalSource:void 0}),s&&em.PolarHeatmap({interpolation:"bilinear"===n&&"bilinear",intensityTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this.Yn.dataOrder,lut:s.lut}),i&&em.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:s,fillStyleSolid:i}:void 0),a&&(this.bG.mousePicking=h?{shader:this.ER.az(em["2D"],em.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:wg(this.ft),normalSource:void 0}),em.Color({dataType:"uniform"}))}:void 0),this.ra(e),this.cU.o=!1,this.Lo.o=!1,this):this}VL(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:r}=this.TU,n=this.P_.yU;if(!this.bG.fill||!n)return this;const{fillStylePaletted:o,fillStyleSolid:h}=this.bG.fill,a=1===t?null===(e=this.bG.mousePicking)||void 0===e?void 0:e.shader:this.bG.fill.shader;if(!a)return this;const l=this.ft.yb(),u=Math.min(l.start,l.end),c=Math.max(l.start,l.end),d=Math.min(this.Yn.amplitudeStart,this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep),f=Math.max(this.Yn.amplitudeStart,this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep);let g;return g=l.end>l.start?Math.min(f,c)-l.start:Math.max(d,u)-l.start,this.ER.ZR(a).lV(a,((e,a,l,u)=>{if(this.ER.cV(e("uScale"),this.lE.AV()).cV(e("uDisp"),this.lE.gV()).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0).cV(u("uViewportSize"),[this.nN.ai().x*this.ER.Xz(),this.nN.ai().y*this.ER.Xz()]).cV(e("uScaling"),[g,g]).cV(e("uTranslationAxis"),[0,0]).uV(i,void 0,{location:a("aPos"),size:2}).fV(u("uAngleOffset"),this.ft.Mb()%(2*Math.PI)).fV(u("uAngleDirection"),this.ft.Tb()?1:-1).fV(u("uSectors"),this.Yn.sectors).fV(u("uAnnuli"),this.Yn.annuli),1===t)this.ER.gR(e("uColor"),this.mN);else{if(this.ER.fV(e("uAmplitudeStart"),this.Yn.amplitudeStart).fV(e("uAmplitudeStep"),this.Yn.amplitudeStep).fV(e("uAmplitudeAxisStart"),this.ft.yb().start).fV(e("uAmplitudeAxisEnd"),this.ft.yb().end),o){const t=this.P_.Ka;this.ER.RO(l,o.lut,t).dV(e("uTileIntensityValues"),n.gridTiles[0].intensityDataTexture,0)}h&&this.ER.gR(e("uColor"),h.getColor())}return this.ER.Zm(r,s),!0})),this}wv(t){return this.P_.wv(t),this}Gt(){return this.P_.Gt(),this}dispose(){return super.dispose(),this.P_.dispose(),this.bG={},this.ER.yV(this.TU.vertexBuffer),this}OR(){return this.dispose(),this}ke(t){return super.ke(t),this.P_.ke(this.be),this}uN(t){return this.pN===t&&{}}$c(t){const e=this.Yn.amplitudeStart,i=this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;let n=Math.round((t.angle-0)/360*this.Yn.sectors);n>=this.Yn.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this.Yn.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.MU(o,n),angle:n*(360/this.Yn.sectors),amplitude:e+o*(i-e)/(this.Yn.annuli-1)}}Vb(t){const e=this.Yn.amplitudeStart,i=this.Yn.amplitudeStart+(this.Yn.annuli-1)*this.Yn.amplitudeStep,s=Math.min(e,i),r=Math.max(e,i);if(t.angle<0||t.angle>360||t.amplituder)return;const n=(t.angle-0)/360*this.Yn.sectors,o=(t.amplitude-e)/(i-e)*(this.Yn.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.MU(a,h)},u={point:{x:a,y:h+1},value:this.MU(a,h+1)},c={point:{x:a+1,y:h},value:this.MU(a+1,h)},d={point:{x:a+1,y:h+1},value:this.MU(a+1,h+1)},f=_n({x:o,y:n},l,u,c,d);return void 0!==f?{iAnnulus:a,iSector:h,cellValue:f,angle:t.angle,amplitude:t.amplitude}:void 0}MU(t,e){const i="annuli"===this.Yn.dataOrder?t:e,s="annuli"===this.Yn.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,r=s-e.iFirstVector.secondary,n=t*e.sizeHeatmapDataVectors.secondary+r;return e.intensityData[n]}}return 0}bt(){return 0}xt(){return 0}_t(){return 0}Mt(){return 0}xl(){return 0}bl(){return 0}}class By extends Pm{constructor(t){super(t);const{vertices:e,drawMode:i,drawSize:s}=this.lG();this.uG=t.oV(e),this.dG=s,this.fG=i}ZR(t){return this.ER.uV(this.uG,0,{location:t.attribute("aCurveOrBaseline"),size:1},{location:t.attribute("aSegmentSide"),size:1}),this}Zm(t,e,i){return this.ER.JV(void 0!==e?e:this.fG,i||0,this.dG,t),this}lG(){return{vertices:new Float32Array([1,0,0,0,0,1,0,1,1,1,1,0]),drawMode:this.ER.gl.TRIANGLES,drawSize:6}}Tz(){this.ER.yV(this.uG)}}const zy=t=>{let e=t.wV._z.get(void 0);return e||(e=new By(t),t.wV._z.set(void 0,e),e)};class Ny extends an{constructor(t,i,s,r){super(t,i,s,r,[{type:"DataPattern",args:{pattern:"ProgressiveX"}}]),this.FU=wr.fillStyle,this.IU=wr.fillStyle,this.PU=p(e.PointShape.Circle),this.DU=p(5),this.BU=p(0),this.LU=p(void 0),this.jC=!0,this.RU={x:0,y:0}}dd(t){return this.FU=jr(this.FU,t),this}QC(){return this.FU}EU(){return $r(this.zU,this.FU)}VU(){return $r(this.OU,this.IU)}ud(t){return this.IU=jr(this.IU,t),Zn(this.IU)&&(this.Ad(e.PointShape.Square),this.Sd(1)),this}yd(){return this.IU}Ad(t){return this.PU.M(t),io(this.PU._())&&this.Sd(1),this}gd(){return this.PU._()}Sd(t){return this.DU.M(t),this}JC(){return this.DU._()}pd(t){return this.BU.M(t),this}md(){return this.BU._()}KC(t){return this.RU=t,this}qC(){return this.RU}XC(t){return this.LU.M(t),this}tk(){return this.LU._()}}class Oy extends uy{constructor(t,e){super(t,e),this.$G=!1,this.XG={enabled:!1,totalDataPointsAtTime:0},this.ZG=t instanceof _i?{type:"linear",scale:t}:{type:"unknown"},this.HG.Yo("DataPattern",(t=>{!1===t.allowDataGrouping&&(this.$G=!0)}))}NU(t,e){var i,s;const r=null==t?void 0:t.kc,n=null==t?void 0:t.Tc,o=null==t?void 0:t.uc,h=null==t?void 0:t.lc;if(!t||this.$G||!this.WG||"linear"!==this.ZG.type||!r||!n||void 0===o||void 0===h||!e)return{cpStateChanged:!1,cpActive:!1};const a=null===(i=t.Cc())||void 0===i?void 0:i.x,l=null===(s=t.Hc())||void 0===s?void 0:s.x;if(o<2||void 0===a||void 0===l)return{cpStateChanged:!1,cpActive:!1};const u=this.calculateAvgStepBetweenDataPoints(l,a,o),c=this.ZG.scale,d=Math.abs("x"===this.WG?c.Ui().x:c.Ui().y),f=d/u,g=Math.floor(.8*f),m=g*u,y=g>=4,p=this.XG.enabled?this.XG.columnWidthAxis/d<1.5:void 0,x=this.XG.enabled&&g>this.XG.dataPointsPerColumn?g/this.XG.dataPointsPerColumn>=2:void 0;let S;return!0===this.XG.enabled?p?x&&(S={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}):S=y?{enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}:{enabled:!1,totalDataPointsAtTime:o}:y&&(S={enabled:!0,columnWidthAxis:m,dataPointsPerColumn:g,totalDataPointsAtTime:o}),this.XG=S||{...this.XG,totalDataPointsAtTime:o},!!S&&this.Zp(),{cpStateChanged:!!S,cpActive:this.XG.enabled}}GU(t,e){var i,s,r;const n=t.kc,o=t.Tc,h=t.cc,a=t.uc,l=t.lc;if(this.$G||!this.XG.enabled||!n||!o||void 0===e)return;const u=n.length,c=this.XG.columnWidthAxis,d=this.ft.x.getInnerStart(),f=this.ft.x.getInnerEnd(),g=ho(d,f,n,h,a,l,e,1);if(!g)return;const m=n[g.iFirstSampleDataArray];if(this.WU){if(this.WU.iFirstPackedSample0)if(this.WU.packedColumnsCount-=t,this.WU.packedColumnsCount>0){this.WU.packedDataX.splice(0,2*t),this.WU.packedDataY.splice(0,2*t),this.WU.packedDataColors&&this.WU.packedDataColors.splice(0,2*t),this.WU.packedDataLookupValues&&this.WU.packedDataLookupValues.splice(0,2*t),this.WU.origin+=t*c;const e=ao(this.WU.origin,Math.max(h-1-u+1,0),h-1,(t=>n[oo(t,h,u)])),i=oo(e,h,u);this.WU.iFirstPackedSample=n[i]>=this.WU.origin?e:e+1}else this.WU=void 0}if(void 0!==(null===(i=this.WU)||void 0===i?void 0:i.iLastPackedSample)&&this.WU.iLastPackedSample>g.iLastSample){const t=n[g.iLastSampleDataArray],e=Math.min(Math.floor((this.WU.origin+this.WU.packedColumnsCount*c-t)/c),this.WU.packedColumnsCount);if(e>0)if(this.WU.packedColumnsCount-=e,this.WU.packedColumnsCount>0){for(let t=0;t<2*e;t+=1)this.WU.packedDataX.pop(),this.WU.packedDataY.pop(),this.WU.packedDataColors&&this.WU.packedDataColors.pop(),this.WU.packedDataLookupValues&&this.WU.packedDataLookupValues.pop();const t=ao(this.WU.origin+this.WU.packedColumnsCount*c,Math.max(h-1-u+1,0),h-1,(t=>n[oo(t,h,u)])),i=oo(t,h,u);this.WU.iLastPackedSample=n[i]<=this.WU.origin+this.WU.packedColumnsCount*c?t:t-1}else this.WU=void 0}}const y=this.WU||{origin:m,packedColumnsCount:0,packedDataX:[],packedDataY:[],packedDataColors:t.Ec?[]:void 0,packedDataLookupValues:t.Rc?[]:void 0,packedDataSize:t.zc?[]:void 0,packedDataRotation:t.Vc?[]:void 0,iFirstPackedSample:g.iFirstSample,iLastPackedSample:void 0},p=(t,e,i)=>{let s=Math.min(t,t+e*c),r=Math.max(t,t+e*c),a=i;const l=[];let m=Pe,p=Pe,x=-1,S=Le,A=Le,v=-1,b=0;for(;a<=g.iLastSample&&a>=g.iFirstSample;){const i=a%u,g=n[i],M=o[i];if(s<=g&&g<=r)b+=1,Number.isNaN(M)||(M>p&&(m=g,p=M,x=a),M0)m=m===Pe?Number.NaN:m,p=p===Pe?Number.NaN:p,S=S===Le?Number.NaN:S,A=A===Le?Number.NaN:A,x0?(y.packedDataX.push(m),y.packedDataY.push(p),y.packedDataX.push(S),y.packedDataY.push(A)):(y.packedDataX.unshift(S),y.packedDataY.unshift(A),y.packedDataX.unshift(m),y.packedDataY.unshift(p))):(l.push({iFirst:v,iSecond:x}),e>0?(y.packedDataX.push(S),y.packedDataY.push(A),y.packedDataX.push(m),y.packedDataY.push(p)):(y.packedDataX.unshift(m),y.packedDataY.unshift(p),y.packedDataX.unshift(S),y.packedDataY.unshift(A)));else{const t=e>0?y.iLastPackedSample:y.iFirstPackedSample;if(void 0===t)l.push({iFirst:0,iSecond:0}),e>0?(y.packedDataX.push(Number.NaN),y.packedDataY.push(Number.NaN),y.packedDataX.push(Number.NaN),y.packedDataY.push(Number.NaN)):(y.packedDataX.unshift(Number.NaN),y.packedDataY.unshift(Number.NaN),y.packedDataX.unshift(Number.NaN),y.packedDataY.unshift(Number.NaN));else{const i=oo(t,h,u),a=n[i],d=o[i],f=(s+r)/2,m=f-e*c/6,p=d+(m-a)/(g-a)*(M-d),x=f+e*c/6,S=d+(x-a)/(g-a)*(M-d);l.push({iFirst:t,iSecond:t}),e>0?(y.packedDataX.push(m),y.packedDataY.push(p),y.packedDataX.push(x),y.packedDataY.push(S)):(y.packedDataX.unshift(m),y.packedDataY.unshift(p),y.packedDataX.unshift(x),y.packedDataY.unshift(S))}}if(y.packedColumnsCount+=1,e>0?y.iLastPackedSample=a-1:(y.iFirstPackedSample=a+1,y.origin=s),s=Math.min(t+l.length*e*c,t+(l.length+1)*e*c),r=Math.max(t+l.length*e*c,t+(l.length+1)*e*c),b=0,m=Pe,p=Pe,x=-1,S=Le,A=Le,v=-1,sf)break}}return l},x=p(y.origin+y.packedColumnsCount*c,1,void 0!==(null===(s=this.WU)||void 0===s?void 0:s.iLastPackedSample)?this.WU.iLastPackedSample+1:g.iFirstSample),S=p(y.origin,-1,void 0!==(null===(r=this.WU)||void 0===r?void 0:r.iFirstPackedSample)?this.WU.iFirstPackedSample-1:g.iFirstSample),A=t.Ec&&y.packedDataColors?[t.Ec,y.packedDataColors]:void 0,v=t.Rc&&y.packedDataLookupValues?[t.Rc,y.packedDataLookupValues]:void 0,b=t.zc&&y.packedDataSize?[t.zc,y.packedDataSize]:void 0,M=t.Vc&&y.packedDataRotation?[t.Vc,y.packedDataRotation]:void 0;if(A||v||b||M){for(const t of x){const e=oo(t.iFirst,h,u),i=oo(t.iSecond,h,u);A&&A[1].push(A[0][e],A[0][i]),v&&v[1].push(v[0][e],v[0][i]),b&&b[1].push(b[0][e],b[0][i]),M&&M[1].push(M[0][e],M[0][i])}for(const t of S){const e=oo(t.iFirst,h,u),i=oo(t.iSecond,h,u);A&&A[1].unshift(A[0][i],A[0][e]),v&&v[1].unshift(v[0][i],v[0][e]),b&&b[1].unshift(b[0][i],b[0][e]),M&&M[1].unshift(M[0][i],M[0][e])}}return this.WU=y.packedColumnsCount>0?y:void 0,{x:y.packedDataX,y:y.packedDataY,color:y.packedDataColors,lookup:y.packedDataLookupValues,size:y.packedDataSize,rotation:y.packedDataRotation}}Zp(){this.WU=void 0}iW(t){if(this.WG&&"linear"===this.ZG.type){const e="x"===this.WG?this.ZG.scale.x.sg:this.ZG.scale.y.sg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Ke===zs.progressive||e.Ke===zs.regressive){const e=Math.abs("x"===this.WG?this.ZG.scale.x.getInnerInterval():this.ZG.scale.y.getInnerInterval());if(this.XG.enabled)return 2*e/this.XG.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.WG?s.x:s.y,"x"===this.WG?r.x:r.y,i)}}}sW(t,e,i){if(!this.WG)return e;const s=i.length;let r=Nr(i,t.min,this.WG,this.UG,0,s-1);void 0===r&&(r=this.UG?s-1:0);let n=Nr(i,t.max,this.WG,this.UG,0,s-1);return void 0===n&&(n=this.UG?0:s-1),1+Math.abs(n-r)}eW(){}}class Uy extends Ny{constructor(t,e,i,s,r,n){super(t,e,i,s),this.lE=new Ym,this.vW=new Oy(this.ft,this),this.gN=Tg({lineStyleSolid:()=>qi(this.uu)&&this.uu,lineStyleDashed:()=>Qn(this.uu)&&this.uu,strokeFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},strokeFillLinearGradient:()=>{const t=this.uu.getFillStyle();return rt(t)&&t},strokeFillRadialGradient:()=>{const t=this.uu.getFillStyle();return et(t)&&t},strokeFillIndividual:()=>{const t=this.uu.getFillStyle();return X(t)&&t},strokeFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t},areaFillSolid:()=>Y(this.FU)&&this.FU,areaFillLinearGradient:()=>rt(this.FU)&&this.FU,areaFillRadialGradient:()=>et(this.FU)&&this.FU,areaFillIndividual:()=>X(this.FU)&&this.FU,areaFillPaletted:()=>j(this.FU)&&this.FU,markerFillSolid:()=>Y(this.IU)&&this.IU,markerFillLinearGradient:()=>rt(this.IU)&&this.IU,markerFillRadialGradient:()=>et(this.IU)&&this.IU,markerFillPaletted:()=>j(this.IU)&&this.IU,markerFillIndividual:()=>X(this.IU)&&this.IU,markerFillImage:()=>Zn(this.IU)&&this.IU,markerShapeIcon:()=>{const t=this.PU._();return io(t)&&t}}),this.ad=p(void 0),this.UU=[],this.Ja=!1,this.YU=[],this.HU=void 0,this.nU=(t,e,i)=>{var s;const r=null===(s=this.$U)||void 0===s?void 0:s.shapeIcon;let n=t,o=e;return r&&(n=r.ai().x,o=r.ai().y),Bm(t,e,n*this.DU._(),o*this.DU._(),i)},this.oN=e,this.bG={type:"none"},this.ER=t.aN(),this.nN=t,this.vG=this.ER.hO,this.pN=r,this.mN=n}ld(t){return this.ad.M(Fe(t,this.ad._(),(()=>[t.Xc(((e,i)=>{this.UU.push({min:e,max:i}),void 0===t.Wc()&&this.XU&&this.YU.push({min:e,max:i})})),t.jc((()=>{this.Ja=!0,this.XU=void 0,this.HU=void 0,this.vW.Zp()}))]))),this.HU=void 0,this}Ds(){var t,i,s,r,n,o,h,a,l,c,d,f,g,m,y;const p=null===(t=this.ad._())||void 0===t?void 0:t.Ut,x=this.ad.o,S=null==p?void 0:p.kc,A=null==p?void 0:p.Tc;if(!p||!S||!A)return this;const v=p.Rc,b=p.Ec,M=p.zc,E=p.Vc,w=p.cc,T=p.uc,k=p.lc,C=this.uu,R=this.FU,I=x||this.na()||this.EU()||this.VU(),F=this.gN.lineStyleSolid(I),D=this.gN.lineStyleDashed(I),L=F||D,P=L&&L.getThickness(),_=this.gN.strokeFillSolid(I),V=this.gN.strokeFillLinearGradient(I),B=this.gN.strokeFillRadialGradient(I),z=this.gN.strokeFillIndividual(I),N=this.gN.strokeFillPaletted(I),O=_||V||B||z||N,U=this.gN.areaFillSolid(I),G=this.gN.areaFillLinearGradient(I),Y=this.gN.areaFillRadialGradient(I),H=this.gN.areaFillIndividual(I),X=this.gN.areaFillPaletted(I),W=U||G||Y||H||X,j=this.gN.markerFillSolid(I),$=this.gN.markerFillLinearGradient(I),Z=this.gN.markerFillRadialGradient(I),K=this.gN.markerFillPaletted(I),J=this.gN.markerFillIndividual(I),q=this.gN.markerFillImage(I),Q=j||$||Z||K||J||q,tt=this.PU._(),et=this.PU.o,it=this.gN.markerShapeIcon(et),st=this.DU._(),rt=this.DU.o,nt=this.LU.o,ot=this.UU.length>0||nt,ht=this.Ja,at=ht?[p.Uc()]:(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.UU),lt=this.ft.x.Ht,ut=this.ft.x.getInnerStart(),ct=this.ft.x.getInnerEnd(),dt=p.Wc(),ft=!!D,gt=this.Lo._(),mt=this.Lo.o,{cpStateChanged:yt,cpActive:pt}=this.vW.NU(p,this.jC);if(dt&&pt&&(yt||ht||ot||lt||I)){const t=this.vW.GU(p,dt);if(t){const e=!yt&&!ht&&!I;this.jU=Gy(this.ER,[t.x,t.y],t.color,t.lookup,t.size,t.rotation,ft,this.jU,e,dt,1e3,this.ft.wi(),(t=>Kt(t,this.ft.wi()))),this.ZU={min:Le,max:Pe};const s=t.y.length;for(let e=0;ethis.KU.iLastSample||I){let i,s,r,n,o,h;if(1===t.dataRanges.length){const e=t.dataRanges[0];i=S.subarray(e.offset,e.offset+e.count),s=A.subarray(e.offset,e.offset+e.count),r=b?b.subarray(e.offset,e.offset+e.count):void 0,n=v?v.subarray(e.offset,e.offset+e.count):void 0,o=M?M.subarray(e.offset,e.offset+e.count):void 0,h=E?E.subarray(e.offset,e.offset+e.count):void 0}else{const e=t.dataRanges[0],a=t.dataRanges[1],l=e.count+a.count;i=new Float32Array(l),i.set(S.subarray(e.offset),0),i.set(S.subarray(a.offset,a.offset+a.count),e.count),s=new Float32Array(l),s.set(A.subarray(e.offset),0),s.set(A.subarray(a.offset,a.offset+a.count),e.count),b&&(r=new Uint32Array(l),r.set(b.subarray(e.offset),0),r.set(b.subarray(a.offset,a.offset+a.count),e.count)),v&&(n=new Float32Array(l),n.set(v.subarray(e.offset),0),n.set(v.subarray(a.offset,a.offset+a.count),e.count)),M&&(o=new Float32Array(l),o.set(M.subarray(e.offset),0),o.set(M.subarray(a.offset,a.offset+a.count),e.count)),E&&(h=new Float32Array(l),h.set(E.subarray(e.offset),0),h.set(E.subarray(a.offset,a.offset+a.count),e.count))}const l=!yt&&!ht&&!I;this.JU=Gy(this.ER,[i,s],r,n,o,h,ft,this.JU,l,dt,1e3,this.ft.wi(),(t=>Kt(t,this.ft.wi())));let c=i,d=s,f=r,g=n;const m=this.LU._();if(m){const t="spline"===m.type?((t,e)=>{const{xValues:i,yValues:s,lookupValues:r,colors:n}=t;if(i.length<=2)return{xValues:Array.from(i),yValues:Array.from(s),lookupValues:r?Array.from(r):void 0,colors:n?Array.from(n):void 0};const o=((t,e)=>{const i=1e-5,s=t.length-1,r=Array(s);if(s>1){let n=u(0,0),o=u(0,0),h=u(0,0),a=ii(hi({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*n.x)):1,d=Math.abs(o.x)>i?Math.abs(e/(l*o.x)):1}g[1]=oi(ni(n,c),g[1]),g[2]=hi(g[2],ni(o,d)),r[f]=g}}return r.length>0?r:[]})(i,s),h=o.length,a=[],l=[],c=[],d=[];for(let t=0;t{const{xValues:s,yValues:r,lookupValues:n,colors:o}=t,h=[],a=[],l=[],u=[],c=s.length,d=i;if(c>0){let t=0,e=s[0],i=r[0];h[t]=e,a[t]=i,t+=1;for(let n=1;nKt(t,this.ft.wi()))),this.KU=t}}if(!dt&&(ht||ot||I)){if(!this.jU||this.jU.bufferSize{var s,r,n,o;const h=S.subarray(i.min,i.max+1),a=A.subarray(i.min,i.max+1);if(this.ER.VV(t,i.min*(this.ft.wi()?2:1),Kt(h,this.ft.wi())),this.ER.VV(e,i.min*(this.ft.wi()?2:1),Kt(a,this.ft.wi())),b&&(null===(s=this.jU)||void 0===s?void 0:s.bufferColors)){const t=b.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferColors,i.min,t,Uint32Array)}if(v&&(null===(r=this.jU)||void 0===r?void 0:r.bufferLookupValues)){const t=v.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferLookupValues,i.min,t,Float32Array)}if(E&&(null===(n=this.jU)||void 0===n?void 0:n.bufferRotations)){const t=E.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferRotations,i.min,t,Float32Array)}if(M&&(null===(o=this.jU)||void 0===o?void 0:o.bufferSizes)){const t=M.subarray(i.min,i.max+1);this.ER.VV(this.jU.bufferSizes,i.min,t,Float32Array)}})),this.jU.valueCount=p.uc}this.JU=this.jU}if(this.lE.mV(this.ft),I||rt||et||mt){if(O&&L&&!1!==P){const t=-1===P?"primitive":"triangulated",e=N?["lookup",N.lookUpProperty,N.lut]:z?"attribute":V?["gradient",V]:B?["gradient",B]:"uniform";this.bG="primitive"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTexture),lineStyleSolid:F,lineStyleDashed:D,fillStyleSolid:_,fillStyleLinearGradient:V,fillStyleRadialGradient:B,fillStyleIndividual:z,fillStylePaletted:N,mousePickingShader:gt&&this.ER.az(em["2D"],em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTexture,em.MousePicking)}:"triangulated"===t?{type:t,shader:this.ER.az(em["2D"],em.Color({dataType:e}),em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),this.vG?em.AliasedEdge:void 0,D&&em.StippleTextureInstanced),geometry:ny(this.ER,P),thickness:P,lineStyleSolid:F,lineStyleDashed:D,fillStyleSolid:_,fillStyleLinearGradient:V,fillStyleRadialGradient:B,fillStyleIndividual:z,fillStylePaletted:N,mousePickingShader:gt&&this.ER.az(em["2D"],em.LineInstanced2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),D&&em.StippleTextureInstanced,em.MousePicking)}:{type:"none"}}else this.bG={type:"none"};if(this.qU=W?{shader:this.ER.az(em["2D"],X&&em.Color({dataType:["lookup",X.lookUpProperty,X.lut]}),H&&em.Color({dataType:"attribute"}),U&&em.Color({dataType:"uniform"}),G&&em.Color({dataType:["gradient",G]}),Y&&em.Color({dataType:["gradient",Y]}),em.Area2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0})),geometry:zy(this.ER),fillStyleSolid:U,fillStyleLinearGradient:G,fillStyleRadialGradient:Y,fillStyleIndividual:H,fillStylePaletted:X,mousePickingShader:gt&&this.ER.az(em["2D"],em.Area2D({axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0}),em.MousePicking)}:void 0,Q){const t=!(!q&&!it),e=st>1||t,i=M?"attribute":"uniform",s=!e&&em.PointSize("uniform"),r=em.VertexLocation({offset:e&&!t?{dataType:i,sizeUnit:"px",symmetric:!0,rotation:{dataType:E?"attribute-deg":"uniform"},useAlignment:!0}:e&&t?{dataType:i,sizeUnit:"scale",rotation:{dataType:E?"attribute-deg":"uniform"},useAlignment:!0}:void 0,axisWorldTranslation:wg(this.ft),normalSource:void 0,splitPosAttribute:!0});this.$U={shader:this.ER.az(em["2D"],s,r,j&&em.Color({dataType:"uniform",overrideOpacity:!0,maskTexture:!!it}),$&&em.Color({dataType:["gradient",$],overrideOpacity:!0,maskTexture:!!it}),Z&&em.Color({dataType:["gradient",Z],overrideOpacity:!0,maskTexture:!!it}),K&&em.Color({dataType:["lookup",K.getLookUpProperty(),K.getPalette()],overrideOpacity:!0,maskTexture:!!it}),J&&em.Color({dataType:"attribute",overrideOpacity:!0,maskTexture:!!it}),q&&em.Color({dataType:["image",q],overrideOpacity:!0,maskTexture:!!it})),geometry:Ay(tt,this.ER,"uniform"===i?st:25),fillStyleSolid:j,fillStyleLinearGradient:$,fillStyleRadialGradient:Z,fillStylePaletted:K,fillStyleIndividual:J,fillStyleImage:q,mousePickingShader:gt&&this.ER.az(em["2D"],s,r,em.MousePicking),shapeIcon:it,pointSizeAsScale:t,instancedRendering:e}}else this.$U=void 0}const xt=Wr({min:{x:this.xt(),y:this.ft.y.getInnerStart()},max:{x:this.bt(),y:this._t()}},{x:this.xl(),y:this.bl()},this.ft),St=Wr({min:{x:this.xt(),y:this.Mt()},max:{x:this.bt(),y:this._t()}},{x:this.xl(),y:this.bl()},this.ft);if(this.tY=this.ER.GO(V,this,St),this.iY=this.ER.WO(B,this,St),this.sY=this.ER.GO(G,this,xt),this.eY=this.ER.WO(Y,this,xt),this.hY=this.ER.GO($,this,St),this.rY=this.ER.WO(Z,this,St),(void 0===this.HU||ot)&&v&&(Cg(N)||Cg(X)||Cg(K))){const t=this.HU?at:[p.Uc()];let e=this.HU?this.HU.max:Pe,i=this.HU?this.HU.min:Le;const s=v;t.forEach((t=>{for(let r=t.min;r<=t.max;r+=1){const t=s[r];i=te?t:e}})),this.HU={min:i,max:e}}return this._G=D?this.ER.PO(D.getPattern()):void 0,this.rU=this.ER.EO(this,this.rU,q,it,rt,this.nU),this.Au(C),this.zU=R,this.OU=this.IU,this.PU.o=!1,this.DU.o=!1,this.UU.length=0,this.Ja=!1,this.LU.o=!1,this.ad.o=!1,this.Lo.o=!1,this}VL(t){var e,i,s,r,n,o,h,a,l,u,c,d,f,g,m,y,p;const x=this.ER.gl,S=null===(e=this.jU)||void 0===e?void 0:e.bufferX,A=null===(i=this.jU)||void 0===i?void 0:i.bufferY,v=null===(s=this.jU)||void 0===s?void 0:s.bufferColors,b=null===(r=this.jU)||void 0===r?void 0:r.bufferLookupValues,M=null===(n=this.jU)||void 0===n?void 0:n.valueCount,E=null===(o=this.JU)||void 0===o?void 0:o.valueCount,w=null===(h=this.ad._())||void 0===h?void 0:h.Ut,T=null==w?void 0:w.Wc();if(!S||!A||!w)return this;const k=(e,i,s)=>{if(Hy(this.ER,e,this.ft.wi(),S,"aLocation","X",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT),Hy(this.ER,e,this.ft.wi(),A,"aLocation","Y",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT),i&&1!==t){if(!v)return!1;Hy(this.ER,e,!1,v,"aColor","",4,!0,x.UNSIGNED_BYTE,1)}if(s&&"value"===s.lookUpProperty&&1!==t){if(!b)return!1;Hy(this.ER,e,!1,b,"aLookupValue","",1,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT)}return!0},C=1===t?null===(a=this.qU)||void 0===a?void 0:a.mousePickingShader:null===(l=this.qU)||void 0===l?void 0:l.shader;if(this.qU&&C&&void 0!==M&&M>0&&T){const e=this.qU;this.ER.ZR(C).lV(C,((i,s,r,n)=>!!this.ER.VO(r,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStylePaletted:e.fillStylePaletted,linearGradientInfo:this.sY,radialGradientInfo:this.eY,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:null})&&!!k(r,e.fillStyleIndividual,e.fillStylePaletted)&&(null==e||e.geometry.ZR(r).Zm(M-1),!0)))}const R="none"===this.bG.type?void 0:1===t?this.bG.mousePickingShader:this.bG.shader;if("none"!==this.bG.type&&R&&void 0!==M&&M>0){const e=this.bG;this.ER.ZR(R).lV(R,((i,s,r,n)=>{var o,h;if(!this.ER.VO(r,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStylePaletted:e.fillStylePaletted,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,fillStyleIndividual:e.fillStyleIndividual,linearGradientInfo:this.tY,radialGradientInfo:this.iY,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:"primitive"===e.type?b:null,colorBuffer:"primitive"===e.type?v:null,coordsX:"primitive"===e.type?S:void 0,coordsY:"primitive"===e.type?A:void 0,coordsHighPrecision:this.ft.wi()}))return!1;if(e.lineStyleDashed){if(!this._G)return!1;this.ER.cV(i("uStippleCount"),[this.cs.ai().x/this._G.LO,this.cs.ai().y/this._G.LO]).fV(n("uStippleTextureWidthLimiter"),this._G.BO/this._G.LO).fV(i("uStippleScale"),e.lineStyleDashed.getPatternScale()).dV(i("uStippleTexture"),this._G.DO,1)}if("primitive"===e.type){if(e.lineStyleDashed){if(!(null===(o=this.jU)||void 0===o?void 0:o.bufferLengthSoFar))return!1;this.ER.WV(s("aLengthSoFar"),this.jU.bufferLengthSoFar)}hy.yG(this.nN,M)}else{if(!k(r,e.fillStyleIndividual,e.fillStylePaletted))return!1;if(e.lineStyleDashed){if(!(null===(h=this.jU)||void 0===h?void 0:h.bufferLengthSoFar))return!1;Hy(this.ER,r,!1,this.jU.bufferLengthSoFar,"aLengthSoFar","",2,!1,x.FLOAT,Float32Array.BYTES_PER_ELEMENT)}oy.VL(this.nN,e.geometry,r,this.vG&&1!==t,1===t,e.thickness,M-1)}return!0}))}const I=null===(u=this.JU)||void 0===u?void 0:u.bufferX,F=null===(c=this.JU)||void 0===c?void 0:c.bufferY,D=null===(d=this.JU)||void 0===d?void 0:d.bufferColors,L=null===(f=this.JU)||void 0===f?void 0:f.bufferLookupValues,P=null===(g=this.JU)||void 0===g?void 0:g.bufferSizes,_=null===(m=this.JU)||void 0===m?void 0:m.bufferRotations,V=1===t?null===(y=this.$U)||void 0===y?void 0:y.mousePickingShader:null===(p=this.$U)||void 0===p?void 0:p.shader,B=this.$U;let z=1;if(T){const t=this.ad?Math.abs((this.bt()-this.xt())/w.getSampleCount()):0,e=this.ft.x.getInnerInterval()/t,i=this.DU._(),s=this.ft.x.ni()/i/1,r=2*s;z=e<=s?1:Math.max(1-(e-s)/(r-s),0)}if(V&&B&&I&&F&&z>0&&void 0!==E&&E>0){const e=B,i=e.instancedRendering?1:0;this.ER.ZR(V).lV(V,((s,r,n,o)=>{if(!this.ER.VO(n,t,this,{uniforms:this.lE,mousePickingColor:this.mN,fillStyleSolid:e.fillStyleSolid,fillStyleLinearGradient:e.fillStyleLinearGradient,fillStyleRadialGradient:e.fillStyleRadialGradient,linearGradientInfo:this.hY,radialGradientInfo:this.rY,fillStylePaletted:e.fillStylePaletted,fillStyleIndividual:e.fillStyleIndividual,lookupValueRange:e.fillStylePaletted?kg(e.fillStylePaletted,this,this.HU):void 0,lookupValueBuffer:L,lookupValueAttribDivisor:i,colorBuffer:D,colorAttribDivisor:i,fillStyleImage:e.fillStyleImage,texturedFillGLInfo:this.rU,texCoordAttribDivisor:0,maskTexture:e.shapeIcon&&this.rU,maskTextureCoordsAttribDivisor:0}))return!1;if(this.ft.wi()?this.ER.uV(I,i,{location:r("aPos_highpartX"),size:1},{location:r("aPos_lowpartX"),size:1}).uV(F,i,{location:r("aPos_highpartY"),size:1},{location:r("aPos_lowpartY"),size:1}):this.ER.XV(r("aPosX"),I,i).XV(r("aPosY"),F,i),1!==t&&this.ER.fV(s("uOpacity"),z),e.instancedRendering)if(_)this.ER.XV(r("aRotDeg"),_,i).fV(s("uBaseRotDeg"),e.geometry.BW);else{const t=gi(this.BU._()+e.geometry.BW),i=Math.sin(t),r=Math.cos(t);this.ER.cV(s("uRot"),[i,r])}return this.ER.cV(o("uOffsetAlignment"),[-this.RU.x/2,-this.RU.y/2]),e.geometry.Zm(n,P,E,e.pointSizeAsScale&&this.rU?{scale:this.DU._(),width:e.shapeIcon?e.shapeIcon.ai().x:this.rU.texture.Iz,height:e.shapeIcon?e.shapeIcon.ai().y:this.rU.texture.Pz}:this.DU._(),e.instancedRendering),!0}))}return this}uN(t){return this.pN===t&&{}}dispose(){var t,e,i,s,r,n,o,h,a;return super.dispose(),this.ER.yV(null===(t=this.jU)||void 0===t?void 0:t.bufferX),this.ER.yV(null===(e=this.jU)||void 0===e?void 0:e.bufferY),this.ER.yV(null===(i=this.jU)||void 0===i?void 0:i.bufferColors),this.ER.yV(null===(s=this.jU)||void 0===s?void 0:s.bufferLookupValues),this.ER.yV(null===(r=this.JU)||void 0===r?void 0:r.bufferX),this.ER.yV(null===(n=this.JU)||void 0===n?void 0:n.bufferY),this.ER.yV(null===(o=this.JU)||void 0===o?void 0:o.bufferColors),this.ER.yV(null===(h=this.JU)||void 0===h?void 0:h.bufferLookupValues),this.bG={type:"none"},this.qU=void 0,this.$U=void 0,this.vW.Zp(),null===(a=this.ad._())||void 0===a||a.Wt(),this.jU=void 0,this.JU=void 0,this.tY=void 0,this.iY=void 0,this.sY=void 0,this.eY=void 0,this.hY=void 0,this.rY=void 0,this.ER.zO(this,this.rU),this}OR(){return this.dispose(),this}nY(t){if(!this.XU){const{xValues:e,yValues:i}=t.readBack();this.XU={min:{x:Le,y:Le},max:{x:Pe,y:Pe}};const s=e.length;for(let t=0;tthis.XU.max.x?s:this.XU.max.x,this.XU.max.y=r>this.XU.max.y?r:this.XU.max.y}return this.YU.length=0,this.XU}const e=t.kc,i=t.Tc;if(this.YU.length>0&&e&&i){for(const t of this.YU){for(let s=t.min;s<=t.max;s+=1){const t=e[s],r=i[s];this.XU.min.x=tthis.XU.max.x?t:this.XU.max.x,this.XU.max.y=r>this.XU.max.y?r:this.XU.max.y}this.YU.length=0}return this.XU}return this.XU}bt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?(null===(e=n.Cc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Hc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.ZU)||void 0===s?void 0:s.max)||0:"RegressiveY"===o?(null===(r=this.ZU)||void 0===r?void 0:r.max)||0:this.nY(n).max.x}xt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?(null===(e=n.Hc())||void 0===e?void 0:e.x)||0:"RegressiveX"===o?(null===(i=n.Cc())||void 0===i?void 0:i.x)||0:"ProgressiveY"===o?(null===(s=this.ZU)||void 0===s?void 0:s.min)||0:"RegressiveY"===o?(null===(r=this.ZU)||void 0===r?void 0:r.min)||0:this.nY(n).min.x}_t(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?Ft(null===(e=this.ZU)||void 0===e?void 0:e.max,0):"RegressiveX"===o?Ft(null===(i=this.ZU)||void 0===i?void 0:i.max,0):"ProgressiveY"===o?Ft(null===(s=n.Cc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Ft(null===(r=n.Hc())||void 0===r?void 0:r.y,0):this.nY(n).max.y}Mt(){var t,e,i,s,r;const n=null===(t=this.ad._())||void 0===t?void 0:t.Ut;if(!n)return 0;const o=n.Wc();return"ProgressiveX"===o?Ft(null===(e=this.ZU)||void 0===e?void 0:e.min,0):"RegressiveX"===o?Ft(null===(i=this.ZU)||void 0===i?void 0:i.min,0):"ProgressiveY"===o?Ft(null===(s=n.Hc())||void 0===s?void 0:s.y,0):"RegressiveY"===o?Ft(null===(r=n.Cc())||void 0===r?void 0:r.y,0):this.nY(n).min.y}xl(){var t,e;let i=this.DU._();this.rU&&(i=Math.max(this.rU.texture.Iz,this.rU.texture.Pz)*this.DU._());const s=Math.max(we(this.uu),(null===(t=this.ad._())||void 0===t?void 0:t.Ut.xc)?25:i),r=null===(e=this.ad._())||void 0===e?void 0:e.Ut.Wc();return!r||"ProgressiveX"!==r&&"RegressiveX"!==r?s:0}bl(){var t,e;let i=this.DU._();this.rU&&(i=Math.max(this.rU.texture.Iz,this.rU.texture.Pz)*this.DU._());const s=Math.max(we(this.uu),(null===(t=this.ad._())||void 0===t?void 0:t.Ut.xc)?25:i),r=null===(e=this.ad._())||void 0===e?void 0:e.Ut.Wc();return!r||"ProgressiveY"!==r&&"RegressiveY"!==r?s:0}}const Gy=(t,e,i,s,r,n,o,h,a,l,u,c,d)=>{if("ProgressiveX"!==l)throw new Error("Unimplemented data pattern");const f=e[0],g=e[1],m=f.length,y=f[0],p=f[m-1],x=g[0],S=g[m-1],A=c?2:1;if(h&&a&&h.firstX&&h.lastX&&y>=h.firstX){const e=ao(h.lastX,0,m-1,(t=>f[t]));if(f[e]===h.lastX){const a=h.bufferSize-h.valueCount,l=e+1,u=m-l;if(0===u)return h;if(a>=u){const e=co(f,l,void 0),a=co(g,l,void 0);if(t.VV(h.bufferX,h.valueCount*A,d(e)),t.VV(h.bufferY,h.valueCount*A,d(a)),i&&h.bufferColors){const e=i.slice(l);t.VV(h.bufferColors,h.valueCount,e,Uint32Array)}if(s&&h.bufferLookupValues){const e=s.slice(l);t.VV(h.bufferLookupValues,h.valueCount,e,Float32Array)}if(r&&h.bufferSizes){const e=r.slice(l);t.VV(h.bufferSizes,h.valueCount,e,Float32Array)}if(n&&h.bufferRotations){const e=n.slice(l);t.VV(h.bufferRotations,h.valueCount,e,Float32Array)}if(o&&h.bufferLengthSoFar){const[i,s,r]=Yy(e,a,h.lastX||0,h.lastY||0,h.lengthSoFarX,h.lengthSoFarY);t.VV(h.bufferLengthSoFar,2*h.valueCount,i,Float32Array),h.lengthSoFarX=s,h.lengthSoFarY=r}return h.valueCount+=u,h.lastX=p,h.lastY=S,h}}}const v=m+u,b=t.zV(v*A,d(f),null==h?void 0:h.bufferX),M=t.zV(v*A,d(g),null==h?void 0:h.bufferY),E=i?t.zV(v,i,null==h?void 0:h.bufferColors,Uint32Array):void 0,w=s?t.zV(v,s,null==h?void 0:h.bufferLookupValues,Float32Array):void 0,T=r?t.zV(v,r,null==h?void 0:h.bufferSizes,Float32Array):void 0,k=n?t.zV(v,n,null==h?void 0:h.bufferRotations,Float32Array):void 0;let C,R=0,I=0;if(o){const e=Yy(f,g,f[0],g[0],0,0);C=t.zV(2*v,e[0],null==h?void 0:h.bufferLengthSoFar,Float32Array),R=e[1],I=e[2]}return{bufferX:b,bufferY:M,bufferColors:E,bufferLookupValues:w,bufferSizes:T,bufferRotations:k,bufferSize:v,bufferLengthSoFar:C,valueCount:m,firstX:y,lastX:p,firstY:x,lastY:S,lengthSoFarX:R,lengthSoFarY:I}},Yy=(t,e,i,s,r,n)=>{const o=t.length,h=new Float32Array(2*o);if(0===o)return[h,0,0];let a=0,l=i,u=s,c=r,d=n;for(let i=0;i{const u=t.gl;if(i){const i=e.attribute(`${r}A_highpart${n}`),c=e.attribute(`${r}A_lowpart${n}`),d=e.attribute(`${r}B_highpart${n}`),f=e.attribute(`${r}B_lowpart${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,2*o*l,0*l),u.vertexAttribPointer(c,o,a,h,2*o*l,o*l),t.YV(i,1),t.YV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.vertexAttribPointer(d,o,a,h,2*o*l,2*o*l),u.vertexAttribPointer(f,o,a,h,2*o*l,3*o*l),t.YV(d,1),t.YV(f,1),u.enableVertexAttribArray(d),u.enableVertexAttribArray(f),u.bindBuffer(u.ARRAY_BUFFER,null)}else{const i=e.attribute(`${r}A${n}`),c=e.attribute(`${r}B${n}`);u.bindBuffer(u.ARRAY_BUFFER,s),u.vertexAttribPointer(i,o,a,h,o*l,0*l),u.vertexAttribPointer(c,o,a,h,o*l,o*l),t.YV(i,1),t.YV(c,1),u.enableVertexAttribArray(i),u.enableVertexAttribArray(c),u.bindBuffer(u.ARRAY_BUFFER,null)}},Xy={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)=>Xy.multiply(t,Xy.translation(e,i)),rotate:(t,e)=>Xy.multiply(t,Xy.rotation(e)),scale:(t,e,i)=>Xy.multiply(t,Xy.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],y=e[5],p=e[6],x=e[7],S=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+m*n+y*a,g*s+m*o+y*l,g*r+m*h+y*u,p*i+x*n+S*a,p*s+x*o+S*l,p*r+x*h+S*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class Wy extends Qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.oY=[],this.lE=new Ym,this.aY=[u(0,0),u(0,0),u(0,0),u(0,0)],this.lY=m(u(0,0),u(0,0)),this.uY=m(u(0,0),u(0,0)),this.cY=u(0,0),this.dY=u(0,0),this.IT=u(0,0),this.fY=u(0,0),this.AY=0,this.gY=0,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleRadialGradient:()=>et(this.be)&&this.be,fillStyleLinearGradient:()=>rt(this.be)&&this.be}),this.nN=t,this.oN=e,this.pN=n,this.mN=o,this.ER=t.aN(),this.oN=e,this.PG=t.Yn.Zn}Ds(){const t=this.ha(),e=this.ea(),i=this.Lo._();if(t){const t=this.ia(),s=this.gN.fillStyleSolid(t),r=this.gN.fillStyleRadialGradient(t),n=this.gN.fillStyleLinearGradient(t),o=s||r||n,h=this.ER,a=this.ER.Xz(),l=a!==this.gY;if(this.gY=a,this.lE.mV(this.ft),this.pa.o||l){this.pY&&this.pY.QR(this),this.font.M(pr(this.pa._(),a));const t=this.font._();this.pY=this.ER.Oh(t.properties.family),this.pY.ZR(this)}const c=this.font.o,d=c||this.ua.o;if(d&&this.pY){const t=this.font._();[this.mY,this.uY]=this.pY.KR(this.ua._(),t,this.nN.ts.isDark),this.oY.forEach((t=>{t.texCoordBuff&&h.yV(t.texCoordBuff),t.vertexBuff&&h.yV(t.vertexBuff)})),this.oY=this.mY.map((t=>({texCoordBuff:h.oV(t.texCoords,!1),texture:t.texture,info:t}))),this.pa.o=!1,this.font.o=!1,this.ua.o=!1}const f=this.ft.Gi()||e,g=this.ca.o||this.fa.o||this.da.o||this.Aa.o||this.ya.o||this.jt.o||d||f,m=this.ya._(),y=ni(u(this.fa._()+1,this.da._()+1),.5);if(g&&this.mY&&(this.cY=u(-(m.left*a+this.uY.max.x-this.uY.min.x+m.right*a)*y.x-this.uY.min.x+m.right*a,-(m.bottom*a+this.uY.max.y-this.uY.min.y+m.top*a)*y.y-this.uY.min.y+m.top*a)),(g||f||this.ga.o||this.ia())&&this.be!==z){if(this.mY){const t=oi(this.ca._(),this.Aa._()),e=dt(t,this.ft,this.cs.ft),i=ni(e,a);this.fY=i;const s=gi(this.ga._());this.AY=s,d&&this.oY.forEach((t=>{const e=t.info;e&&(t.vertexBuffLen=e.vertices.length/2,t.vertexBuff=h.oV(e.vertices,!0,t.vertexBuff))}));const r=this.jt._(),n=[oi(ti(u((this.uY.min.x+(-r.left-m.left)*a+this.cY.x)/a,(this.uY.max.y+(r.top+m.top)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.max.x+(r.right+m.right)*a+this.cY.x)/a,(this.uY.max.y+(r.top+m.top)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.max.x+(r.right+m.right)*a+this.cY.x)/a,(this.uY.min.y+(-r.bottom-m.bottom)*a+this.cY.y)/a),this.ma,s),e),oi(ti(u((this.uY.min.x+(-r.left-m.left)*a+this.cY.x)/a,(this.uY.min.y+(-r.bottom-m.bottom)*a+this.cY.y)/a),this.ma,s),e)];this.aY=[dt(n[0],this.cs.ft,this.ft),dt(n[1],this.cs.ft,this.ft),dt(n[2],this.cs.ft,this.ft),dt(n[3],this.cs.ft,this.ft)];const o=Ze(n);this.dY=u(-(o.max.x-o.min.x)*a*y.x-o.min.x*a+this.fY.x,-(o.max.y-o.min.y)*a*y.y-o.min.y*a+this.fY.y),this.Ig=hi(o.max,o.min);const l=Ze(this.aY),c=this.ft.mi(l.min,this.dY),f=this.ft.mi(l.max,this.dY);this.lY=Ze([c,f])}r?this._N=Dm(this.lY,this.ft,r.getPosition(),r.getExtent(),r.getShape(),this.ER.Xz()):n?this.wN=Lm(this.lY,this.ft,n.getAngle(!0),this.ER.Xz()):(this._N=void 0,this.wN=void 0)}(this.ia()||c)&&(this.dE=o?this.ER.az(em["2D"],em.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.PG}),em.Color({dataType:r?["gradient",r]:n?["gradient",n]:"uniform",maskTextureText:!0})):void 0),this.yY=i&&o?this.yY||this.ER.az(em["2D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.PG})):void 0,this.ca.o=!1,this.fa.o=!1,this.da.o=!1,this.Aa.o=!1,this.ga.o=!1,this.ra(this.be)}return this.Sa=t,this}VL(t){if(this.ha()){const e=1===t?this.yY:this.dE;if(!e||0===this.oY.length)return this;const i=this.gN.fillStyleSolid(!1),s=this.gN.fillStyleRadialGradient(!1),r=this.gN.fillStyleLinearGradient(!1),n=this.cs.NE(),o=n.x,h=n.y;let a=Xy.projection(o,h,-1);const l=Xy.translation(this.cY.x,this.cY.y),u=Xy.translation(this.dY.x,this.dY.y);a=Xy.translate(a,this.fY.x,this.fY.y),a=Xy.multiply(a,u),a=Xy.rotate(a,this.AY),a=Xy.multiply(a,l),1===t&&(a=Xy.scale(a,this.uY.max.x,this.uY.max.y)),this.ER.ZR(e).lV(e,((e,o,h,l)=>{if(this.ER.DV(e("uMatrix"),a).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),this.PG&&this.ER.cV(l("uViewportSizePx"),[n.x*this.ER.Xz(),n.y*this.ER.Xz()]),1===t)this.ER.gR(e("uColor"),this.mN);else if(i)this.ER.gR(e("uColor"),i.getColor());else if(s&&this._N){this.ER.cV(e("uCenter"),this._N.center).cV(e("uDistance"),this._N.distance).IV(e("uBounds"),this._N.bounds).fV(e("uAspect"),this._N.aspectRatio);const t=s.getColorStops();for(let i=0;i{this.ER.WV(o("aPos"),t.vertexBuff).WV(o("aMaskTextureCoord"),t.texCoordBuff).dV(e("uMaskTexture"),t.texture,0).Zm(this.ER.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}uN(t){return this.pN===t&&{}}Ue(){return this.ha()?this.aY:[]}Zc(){return this.ha()&&this.Ig?this.Ig:u(0,0)}ai(){if(this.ha()&&this.lY){const t=this.lY;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}OR(){return this.oY.forEach((t=>{t.texCoordBuff&&this.ER.yV(t.texCoordBuff),t.vertexBuff&&this.ER.yV(t.vertexBuff)})),this.oY=[],this.pY&&this.pY.QR(this),this}bt(){return this.lY.max.x}xt(){return this.lY.min.x}_t(){return this.lY.max.y}Mt(){return this.lY.min.y}xl(){return 0}bl(){return 0}}class jy{constructor(t,e,i){this.SY=new Set,this.vY=t=>(this.SY.add(t),t),this.xY=t=>(this.SY.delete(t),t.OR(),this),this.cs=t,this.Qo=e,this.bY=i}zL(t){this.SY.delete(t)&&this.SY.add(t)}U(){for(const t of this.SY)t.OR().dispose();this.cs.Mn(this.Qo)}vs(){return this.cs.vs(),this}bn(){return this.Qo}}class $y extends jy{constructor(){super(...arguments),this.MY=p(void 0),this.Jo=!1}tx(t){return this.MY.M(t),this}wp(){return this.MY._()}}class Zy extends $y{constructor(t,e,i){super(t,e,i),this.nN=t,this.gl=t.aN(),this._Y=this.SY}nV(t){const e=t instanceof Xr&&t;if(!e)return _e;const i=e.xt(),s=e.bt(),r=e.Mt(),n=e._t();if(i===Le||s===Pe||r===Le||n===Pe)return _e;const o=e.xl(),h=e.bl(),a=Wr({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ft),l={min:dt(a.min,e.ft,t.cs.ft),max:dt(a.max,e.ft,t.cs.ft)},u=this.MY._();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.nN.CY();return{id:t,color:this.nN.kY(t)}})))}sy(t,e,i){const s=this.nN.CY();return this.vY(new yy(this.nN,this,t,this.xY,i,s,this.nN.kY(s),e))}fd(t){const e=this.nN.CY();return this.vY(new Uy(this.nN,this,t,this.xY,e,this.nN.kY(e)))}Dr(t){const e=this.nN.CY();return this.vY(new Wy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}bS(t){const e=this.nN.CY();return this.vY(new vy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}sc(t,e=hn.Simple){const i=this.nN.CY();if(e===hn.Simple)return this.vY(new Ey(this.nN,this,t,this.xY,[],i,this.nN.kY(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}$x(t){return this.vY(new by(this.nN,this,t,this.xY,[],(()=>{const t=this.nN.CY();return{id:t,color:this.nN.kY(t)}})))}Te(t){const e=this.nN.CY();return this.vY(new My(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}uw(t){const e=this.nN.CY();return this.vY(new sy(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}Kc(t){const e=this.nN.CY();return this.vY(new Zm(this.nN,this,t,this.xY,[],e,this.nN.kY(e)))}O_(t,e,i){if("intensity"===i.heatmapDataType){const s=this.nN.CY();return this.vY(new Py(this.nN,this,t,this.xY,e,s,this.nN.kY(s),i))}throw new yt("Unimplemented Heatmap Grid Static type")}D_(t,e,i){const s=this.nN.CY();return this.vY(new Dy(this.nN,this,t,this.xY,e,i,s,this.nN.kY(s)))}zb(t,e,i){const s=this.nN.CY();return this.vY(new Vy(this.nN,this,t,this.xY,e,i,s,this.nN.kY(s)))}TY(t){return this.vY(new jm(this.nN,this,this.xY,[],t))}Ds(){if(this.Jo){this.Jo=!1;const t=Array.from(this.SY).sort(((t,e)=>t.qo()-e.qo()));this.SY.clear();for(const e of t)this.SY.add(e)}for(const t of this.SY)t.Ds();return this}VL(t,e){const i=this.MY._();if(i&&this.gl.rV(i.x*this.gl.Xz()*e,i.y*this.gl.Xz()*e,i.width*this.gl.Xz()*e,i.height*this.gl.Xz()*e),1!==t)for(const e of this.SY)e.getVisible()&&e.VL(t);else for(const e of this.SY)e.getMouseInteractions()&&e.getVisible()&&e.VL(t);return this.gl.tV(!1),this}}class Ky extends Pm{constructor(t){super(t)}}class Jy extends Ky{constructor(t){super(t),this.FY="attribute";const{vertices:e,drawSize:i,drawMode:s}=qy(t.gl);this.CR=t.oV(e),this.dG=i,this.fG=s}Zm(t,e,i,s){return this.ER.uV(this.CR,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}).JV(this.fG,0,this.dG,e),this}Tz(){this.ER.yV(this.CR)}}const qy=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 Qy extends Ky{constructor(t,e){super(t),this.FY="attribute",this.IY=e;const{vertices:i,indices:s}=tp();this.CR=t.oV(i),this.cG=t.NV(s),this.dG=s.length,this.fG=t.gl.TRIANGLES}Zm(t,e,i,s){return this.ER.uV(this.CR,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).jV(this.cG).fV(t.uniform("uEdgeRoundness"),this.IY/2).KV(this.fG,this.dG,0,e),this}Tz(){this.ER.yV(this.CR),this.ER.yV(this.cG)}PY(t){return this.IY=t,this}DY(){return this.IY}}const tp=()=>{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 r=0;for(const n of t){const{normal:t,perpendA:o,perpendB:h}=n,a=De.multiply(o,-1),l=De.multiply(h,-1),u=i;e[i]={thicknessDirection:De.addVec(t,o,h),edge:De.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:De.addVec(t,a,h),edge:De.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:De.addVec(t,a,l),edge:De.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:De.addVec(t,o,l),edge:De.addVec(a,h),normal:t},i+=1,s[r+0]=d,s[r+1]=u,s[r+2]=f,s[r+3]=d,s[r+4]=c,s[r+5]=u,r+=6;const g=[{A:o,B:h},{A:a,B:h},{A:a,B:l},{A:o,B:l}];for(const s of g){s.thicknessDirection=De.addVec(t,s.A,s.B),s.stripVerticesA=[],s.stripVerticesB=[];const r=[{direction:s.A,other:s.B,vertices:s.stripVerticesA},{direction:s.B,other:s.A,vertices:s.stripVerticesB}];for(const n of r)for(let r=0;r<8;r+=1){const o=.5*r/7,h=De.normalize(De.lerp(t,n.direction,o)),a=Math.PI/2-De.angle(h,t),l=De.addVec(De.multiply(De.multiply(n.direction,-1),1-Math.cos(a)),De.multiply(De.multiply(t,-1),1-Math.sin(a)),De.multiply(n.other,-1)),u=i;e[i]={thicknessDirection:s.thicknessDirection,normal:h,edge:l};const c=e[i];i+=1,n.vertices.push({index:u,vertex:c})}}for(let t=0;t{let i=t.wV.kz.get(e);return i||(i=void 0!==e&&e>0?new Qy(t,Rt(e,0,1)):new Jy(t),t.wV.kz.set(e,i),i)};class ip extends Nm{nS(t){return this.Yz=this.tS._(),this.tS.M(t),this}kv(t){return this.BY=t,this}Tv(){return this.BY}}class sp extends ip{constructor(t,e,i,s,r){super(t,e,i),this.LY=t,this.pN=s,this.mN=r,this.nN=t.nN,this.ER=this.nN.aN()}uN(t){return t===this.pN&&{}}}class rp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.Ha=Ve,this.RY={},this.EY=[],this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleIndividual:()=>X(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be}),this.be=wr.fillStyle,this.tS.M(Hn)}Ds(t){const e=this.EY,i=this.be,s=i!==z,r=this.zY,n=this.ia()||this.VY!==r,o=this.Uz(),h=this.Lo._(),a=this.Lo.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.OY||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.RY[e]||(r+=1)}let l,u=!1,c=!1;if(u=r!==s,c=u,l=!c&&(e.length<100?"chunks":"all"),u){const e=r*t,i=new Float32Array(e);this.PW&&i.set(this.PW),this.PW=i,this.NY=e,this.GY=s*t}const d=X(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.RY[e],r=[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:Le,y:Le,z:Le},{x:Pe,y:Pe,z:Pe});for(let i=0;in?e.max.x:n,e.max.y=e.max.y>l?e.max.y:l,e.max.z=e.max.z>f?e.max.z:f}this.Ha=e}this.OY=r,this.EY.length=0}return this.ra(i),this.VY=r,this.tS.o=!1,this.Lo.o=!1,this}VL(t){const e=1===t?this.yY:this.dE,i=this.WY,s=this.uG,r=this.be,n=this.OY,o=this.tS._();return e&&s&&void 0!==n&&this.ER.lV(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.ER.ZR(e).PV(h("uScale"),this.LY.lE.AV()).PV(h("uDisp"),this.LY.lE.gV()).BV(h("uViewProjectionMatrix"),this.YY).fV(h("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(h("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(h("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.ER.PV(h("uCameraLoc"),this.HY).PV(h("uLightLoc"),this.$Y).fV(h("uAmbientReflection"),o.ambientReflection).fV(h("uSpecularReflection"),o.specularReflection).fV(h("uDiffuseReflection"),o.diffuseReflection).fV(h("uShininess"),o.shininess).gR(h("uLightColor"),o.specularColor).gR(h("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(h("uColor"),this.mN);else if(Y(r))this.ER.gR(h("uColorDiffuse"),r.getColor());else if(X(r)){const t=a("aColor");m.location=t}else if(j(r)){const t=kg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.ER.RO(l,r.lut,t)}return s&&(this.ER.uV(s,1,f,g,m,{location:void 0,size:1}),i.Zm(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.uG&&(this.ER.yV(this.uG),this.uG=void 0),this.dE=void 0,this}OR(){return this.dispose(),this}pS(t){this.EY=ne(this.EY,t,{canReturnB:!0})}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}AS(t){return this.zY=void 0!==t&&t>0?Rt(t,0,1):void 0,this}UY(){return this.zY}bt(){return this.Ha.max.x}xt(){return this.Ha.min.x}_t(){return this.Ha.max.y}Mt(){return this.Ha.min.y}lS(){return this.Ha.max.z}uS(){return this.Ha.min.z}xl(){return 0}bl(){return 0}cS(){return 0}ia(){return $r(this.sa,this.be)}ra(t){this.sa=t}}class np extends Pm{constructor(t,e){super(t),this.FY="custom",this.aG=e;const{vertices:i,drawSize:s}=this.lG();this.uG=t.oV(i),this.dG=s}ZR(t){return this.ER.uV(this.uG,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Zm(t){return this.ER.JV(this.ER.gl.TRIANGLE_STRIP,0,this.dG,t),this}lG(){const t=this.aG,e=new Float32Array(2*(t+1)*3);let i=0;for(let s=0;s<=t;s+=1){const r=2*Math.PI*s/t,n=Math.cos(r),o=Math.sin(r);for(const t of[0,1])e[i+0]=t,e[i+1]=n,e[i+2]=o,i+=3}return{vertices:e,drawSize:i/3}}Tz(){this.ER.yV(this.uG)}}const op=(t,e=16)=>{let i=t.wV.wz.get(e);return i||(i=new np(t,e),t.wV.wz.set(e,i),i)};class hp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.jY=Ve,this.ZY=[],this.QY=!1,this.uu=wr.lineStyle,this.tS.M(Gn)}Ds(t){const e=this.QY,i=this.uu,s=this.du!==i,r=this.Uz(),n=e;if(e){const t=qt(this.ZY);this.JY=this.ER.oV(t,!1,this.JY)}if(n&&(this.jY=Ke(this.ZY)),s||r){const t=8,e=qi(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.bG=void 0,Y(e)&&("primitive"===s?this.bG={type:s,shader:this.ER.az(em["3D"],em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}),em.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.bG={type:s,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:"uniform",shadingStyle:this.tS._().type}),em.LineInstanced3D({axisWorldTranslation:wg(this.ft)})),geometry:op(this.ER,t),fillStyle:e}))}return this.QY=!1,this.du=i,this.tS.o=!1,this}VL(t){if(1===t)return this;const e=this.ER.gl,i=this.bG,s=this.JY,r=this.uu,n=this.tS._();if(i&&s&&qi(r))switch(i.type){case"instanced":{const o=.5*this.Ts.Gy(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.ER.lV(a,((i,r,u)=>{this.ER.ZR(a).PV(i("uScale"),this.LY.lE.AV()).PV(i("uDisp"),this.LY.lE.gV()).BV(i("uViewProjectionMatrix"),this.YY).gR(i("uColorDiffuse"),h).fV(i("uOffsetWU"),o).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.ER.PV(i("uCameraLoc"),this.HY).PV(i("uLightLoc"),this.$Y).fV(i("uAmbientReflection"),n.ambientReflection).fV(i("uSpecularReflection"),n.specularReflection).fV(i("uDiffuseReflection"),n.diffuseReflection).fV(i("uShininess"),n.shininess).gR(i("uLightColor"),n.specularColor).gR(i("uAmbientColor"),n.ambientColor),e.bindBuffer(e.ARRAY_BUFFER,s);const c=r("aLocationA"),d=r("aLocationB");return e.vertexAttribPointer(c,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(d,1),e.enableVertexAttribArray(d),l.ZR(u).Zm(this.ZY.length/2),!0}));break}case"primitive":{const n=qi(r)?r.getFillStyle():void 0,o=n&&Y(n)?n.getColor():void 0;if(o){const r=i.shader;this.ER.lV(r,((i,n)=>(this.ER.ZR(r).PV(i("uScale"),this.LY.lE.AV()).PV(i("uDisp"),this.LY.lE.gV()).BV(i("uViewProjectionMatrix"),this.YY).gR(i("uColor"),o).fV(i("uIsHighlighted"),this.Vo).gR(i("uHighlightColorOffset"),2===t?I:this.Wo).fV(i("uRenderEffectMask"),2===t?1:0).uV(s,void 0,{location:n("aPos"),size:3}).Zm(e.LINES,this.ZY.length),!0)))}break}}return this}ol(t){for(let e=0;e{const l=e*r,u=Math.PI/2-t*n,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]=h,i[s+5]=a,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.ER.dA.$n&&s>i.length&&bt.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}}Tz(){this.ER.yV(this.uG)}}const lp=(t,e)=>{const i=Math.round(e);i<3&&me(0,kt);const s=i;let r=t.wV.Cz.get(Array.from(t.wV.Cz.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new ap(t,i,s),t.wV.Cz.set({sectors:i,stacks:s},r),r)};class up extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="cull-back",this.JM=[],this.bG={},this.xW=new gy(this.JM,(t=>t.vertexBuffer&&this.ER.yV(t.vertexBuffer)),!0),this.yu=[],this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=Ve,this.gN=Tg({lineStyleSolid:()=>{const t=this.uu;return qi(t)&&t},lineFillSolid:()=>{const t=this.uu.getFillStyle();return Y(t)&&t},lineFillPaletted:()=>{const t=this.uu.getFillStyle();return j(t)&&t},jointStyleTriangulatedPoints:()=>ur(this.mS)&&this.mS,jointSizeTriangulated:()=>{const t=this.mS;return ur(t)&&t.getSize()},jointFillSolid:()=>{const t=this.mS.getFillStyle();return Y(t)&&t},jointFillPaletted:()=>{const t=this.mS.getFillStyle();return j(t)&&t},wireframeLineStyleSolid:()=>{const t=ur(this.mS)&&this.mS.getWireframeStyle();return qi(t)&&t},wireframeFillSolid:()=>{const t=ur(this.mS)&&this.mS.getWireframeStyle(),e=t&&t.getFillStyle();return Y(e)&&e}}),this.Ja=!1,this.uu=wr.lineStyle,this.mS=wr.pointStyle3D,this.tS.M(Hn),this.kW={attributesPerVertex:3,prepareRenderData:(t,e)=>qt(t)}}Ds(t){const e=this.Ja,i=this.Xa,s=this.ja,r=s>0,n=this.uu,o=n!==this.du,h=this.mS,a=h!==this.tH,l=this.Uz(),u=this.Lo.o,c=this.Lo._();this.Za&&(this.Ha=qe(this.Ha,this.Za),this.Za=void 0),r&&(this.yu=ne(this.yu,i,{canReturnB:!0}),this.$a+=s);let d=i,f=s;if(e&&(this.JM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Ve})),this.xW.dW(),d=this.yu,f=this.$a),f>0){const t=1e5,e=Math.floor(this.nN.iH/(this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Yo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Rt(i,t,e);this.xW.aW(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Ve,vertexBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i))})),((t,e,i,s)=>{this.ER.VV(t.vertexBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),t.existingDataPointsCount+=i-s,t.existingCoordinatesCount+=i,t.jointPointsCount+=s,t.lastDataPoint=e[i-1]}))}if(o||a||l||u){const t={},e=this.gN.lineStyleSolid(o),i=this.gN.lineFillSolid(o),s=this.gN.lineFillPaletted(o),r=i||s,h=this.gN.jointStyleTriangulatedPoints(a),l=this.gN.jointSizeTriangulated(a),u=this.gN.jointFillSolid(a),d=this.gN.jointFillPaletted(a),f=u||d,g=this.gN.wireframeLineStyleSolid(a),m=this.gN.wireframeFillSolid(a),y=n.getThickness()<0||1===n.getThickness()&&this.Yo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",p=s?["lookup",s.getLookUpProperty(),s.lut]:"uniform";if("primitive"===y&&r?t.lines={type:"primitive",fillStyleSolid:i,fillStylePaletted:s,shader:this.ER.az(em["3D"],em.Color({dataType:p}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}))}:void 0}:"instanced"===y&&e&&r&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:i,fillStylePaletted:s,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:p,shadingStyle:this.tS._().type}),em.LineInstanced3D({axisWorldTranslation:wg(this.ft)})),geometry:cp(this.ER,e.getThickness()),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.LineInstanced3D({axisWorldTranslation:wg(this.ft)}))}:void 0}),t.markers=void 0,f&&h){const e=se(h.getShape(),{cube:()=>ep(this.ER),sphere:()=>dp(this.ER,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof l&&l,pointSizeAxis:"object"==typeof l&&l,fillStyleSolid:u,fillStylePaletted:d,shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty(),d.lut]:"uniform",shadingStyle:this.tS._().type,wireframe:!1!==m}),em.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.ft),normalSource:e.FY})),mousePicking:c?{shader:this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof l?"nwu":"axis",symmetric:"number"==typeof l,halved:!0},axisWorldTranslation:wg(this.ft),normalSource:void 0}))}:void 0,wireframe:g&&m&&{thickness:g.getThickness(),fillStyleSolid:m}}}this.bG=t}return this.Ja=!1,this.Xa=[],this.ja=0,this.du=n,this.tH=h,this.tS.o=!1,this.Lo.o=!1,this}VL(t){var e,i;const s=this.ER.gl,{lines:r,markers:n}=this.bG,o=this.tS._(),h=1===t?null===(e=null==r?void 0:r.mousePicking)||void 0===e?void 0:e.shader:null==r?void 0:r.shader;if(r&&h&&"instanced"===r.type){const e=h,{geometry:i,lineStyleSolid:n,fillStyleSolid:a,fillStylePaletted:l}=r;this.ER.lV(e,((r,h,u)=>{let c=!1;if(this.ER.ZR(e).PV(r("uScale"),this.LY.lE.AV()).PV(r("uDisp"),this.LY.lE.gV()).BV(r("uViewProjectionMatrix"),this.YY).fV(r("uOffsetWU"),this.Ts.Gy(n.getThickness())).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.ER.PV(r("uCameraLoc"),this.HY).PV(r("uLightLoc"),this.$Y).fV(r("uAmbientReflection"),o.ambientReflection).fV(r("uSpecularReflection"),o.specularReflection).fV(r("uDiffuseReflection"),o.diffuseReflection).fV(r("uShininess"),o.shininess).gR(r("uLightColor"),o.specularColor).gR(r("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(r("uColor"),this.mN);else if(a)this.ER.gR(r("uColorDiffuse"),a.getColor());else if(l){const t=kg(l,this,void 0);if(!t&&l.lut.percentageValues)return!1;this.ER.RO(u,l.lut,t)}return this.JM.forEach((t=>{s.bindBuffer(s.ARRAY_BUFFER,t.vertexBuffer);const e=h("aLocationA"),r=h("aLocationB");s.vertexAttribPointer(e,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.ER.YV(r,1),s.enableVertexAttribArray(r),i.ZR(u).Zm(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.ER.lV(e,((r,o,h)=>{let a=!1;if(this.ER.ZR(e).PV(r("uScale"),this.LY.lE.AV()).PV(r("uDisp"),this.LY.lE.gV()).BV(r("uViewProjectionMatrix"),this.YY).fV(r("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(r("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(r("uRenderEffectMask"),2===t?1:0),1===t)this.ER.gR(r("uColor"),this.mN);else if(i)this.ER.gR(r("uColor"),i.getColor());else if(n){const t=kg(n,this,void 0);if(!t&&n.lut.percentageValues)return!1;this.ER.RO(h,n.lut,t)}return this.JM.forEach((t=>{this.ER.uV(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Zm(s.LINE_STRIP,t.existingCoordinatesCount),a=!0})),a}))}const a=1===t?null===(i=null==n?void 0:n.mousePicking)||void 0===i?void 0:i.shader:null==n?void 0:n.shader;if(n&&a){const e=a,{geometry:i,fillStyleSolid:s,fillStylePaletted:r,pointSizeAxis:h,pointSizeNWU:l,wireframe:u}=n;this.ER.lV(e,((n,a,c,d)=>{let f=!1;if(this.ER.ZR(e).PV(n("uScale"),this.LY.lE.AV()).PV(n("uDisp"),this.LY.lE.gV()).BV(n("uViewProjectionMatrix"),this.YY).fV(d("uRatioNwuWu"),this.LY.sH()).fV(n("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(n("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.ER.PV(n("uCameraLoc"),this.HY).PV(n("uLightLoc"),this.$Y).fV(n("uAmbientReflection"),o.ambientReflection).fV(n("uSpecularReflection"),o.specularReflection).fV(n("uDiffuseReflection"),o.diffuseReflection).fV(n("uShininess"),o.shininess).gR(n("uLightColor"),o.specularColor).gR(n("uAmbientColor"),o.ambientColor),1===t)this.ER.gR(n("uColor"),this.mN);else if(s)this.ER.gR(n("uColorDiffuse"),s.getColor());else if(r){const t=kg(r,this,void 0);if(!t&&r.lut.percentageValues)return!1;this.ER.RO(c,r.lut,t)}return u&&1!==t&&this.ER.fV(n("uWireframeThickness"),u.thickness).gR(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.ER.PV(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.ER.fV(n("uOffsetNWU"),l),this.JM.forEach((e=>{this.ER.uV(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Zm(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}ol(t,e){Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.ja+=t.length;const i=e||Ke(t);return this.Za=this.Za?qe(this.Za,i):i,this}Ee(t){return this.uu="function"==typeof t?t(this.uu):t,this}cu(){return this.uu}zy(t){return this.mS="function"==typeof t?t(this.mS):t,this}eH(){return this.mS}bt(){return this.Za?Math.max(this.Za.max.x,this.Ha.max.x):this.Ha.max.x}xt(){return this.Za?Math.min(this.Za.min.x,this.Ha.min.x):this.Ha.min.x}_t(){return this.Za?Math.max(this.Za.max.y,this.Ha.max.y):this.Ha.max.y}Mt(){return this.Za?Math.min(this.Za.min.y,this.Ha.min.y):this.Ha.min.y}lS(){return this.Za?Math.max(this.Za.max.z,this.Ha.max.z):this.Ha.max.z}uS(){return this.Za?Math.min(this.Za.min.z,this.Ha.min.z):this.Ha.min.z}xl(){return we(this.uu)}bl(){return we(this.uu)}cS(){return we(this.uu)}il(){return this.yu}tl(){return this.Xa}al(){return this.$a}ll(){return this.ja}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.bG={},this}OR(){return this.dispose(),this}}const cp=(t,e)=>op(t,e>50?20:e>20?16:e>10?12:e>5?8:6),dp=(t,e)=>{const i=e.getSize();return lp(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class fp extends sp{constructor(t,e,i,s,r){super(t,e,i,s,r),this.BY="disabled",this.hH=!1,this.rH=!1,this.nH={x:1,y:1,z:1},this.Bv={x:0,y:0,z:0},this.Dv={x:0,y:0,z:0},this.Lv={x:0,y:0,z:0},this.Rv={x:1,y:1,z:1},this.oH=pl.projectionOrthographic(-1,1,-1,1,1,-1),this.aH=pl.projectionOrthographic(-1,1,-1,1,1,-1),this.lH=!1,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStyleValuePalette:()=>j(this.be)&&"value"===this.be.lookUpProperty&&this.be}),this.be=wr.fillStyle,this.tS.M(Hn)}Ds(t){var e;const i=this.Uz(),s=this.Lo._(),r=this.Lo.o,n=this.ia();this.gN.fillStyleSolid(n);const o=this.gN.fillStyleValuePalette(n),h=this.Lv,a=this.Rv;if(this.hH&&this.uH&&(this.uG=this.ER.oV(this.uH.vertices,void 0,this.uG),this.cG=this.ER.NV(this.uH.indices,this.cG),this.cH=this.uH.indices.length),"phong"===this.tS._().type&&(i||this.hH)&&(null===(e=this.uH)||void 0===e?void 0:e.normals)&&(this.dH=this.ER.oV(this.uH.normals,void 0,this.dH)),!this.fH&&o&&"value"===o.lookUpProperty&&this.uH&&(this.fH=new Float32Array(this.uH.vertices.length/3),this.rH=!0),this.fH&&this.rH&&(this.AH=this.ER.oV(this.fH,void 0,this.AH)),i||n||r){if(o&&"value"!==o.lookUpProperty)throw new Error("LightningChart JS MeshModel3D does not support look up by x/y/z. Must be value");this.dE=this.ER.az(em["3D"],em.ColorShaded3D({dataType:o?["lookup","value",o.lut]:"uniform",shadingStyle:this.tS._().type,wireframe:!1}),em.Model3D({normalSource:"phong"===this.tS._().type?"attribute":void 0})),this.yY=s?this.ER.az(em["3D"],em.MousePicking,em.Model3D({normalSource:void 0})):void 0}if(this.lH){const t=pl.projectionOrthographic(-1,1,-1,1,1,-1);this.aH=pl.rotateXYZ(t,h),this.oH=pl.translate(t,a.x/2,a.y/2,a.z/2),this.oH=pl.rotateXYZ(this.oH,h),this.oH=pl.translate(this.oH,-a.x/2,-a.y/2,-a.z/2),this.lH=!1}return this.tS.o=!1,this.ra(this.be),this.Lo.o=!1,this.hH=!1,this.rH=!1,this}VL(t){const e=1===t?this.yY:this.dE,i=1===t,s=this.cG,r=this.cH,n=this.uG,o=this.dH,h=this.AH,a=this.Bv,l=this.Dv,u=this.nH,c=this.Rv,d=this.oH,f=this.aH,g=this.gN.fillStyleValuePalette(!1),m=this.gN.fillStyleSolid(!1),y=this.tS._(),p={location:void 0,size:1};return e&&n&&s&&r?(this.ER.lV(e,((x,S,A,v)=>{if(this.ER.ZR(e).PV(x("uScale"),this.LY.lE.AV()).PV(x("uDisp"),this.LY.lE.gV()).BV(x("uViewProjectionMatrix"),this.YY).fV(x("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(x("uHighlightColorOffset"),this.Wo).fV(x("uRenderEffectMask"),2===t?1:0),i)this.ER.gR(x("uColor"),this.mN);else{if(this.be===z)return!1;if(m)this.ER.gR(x("uColorDiffuse"),m.getColor());else if(g){if(!h)return!1;const t=g.getPalette();p.location=S("aLookupValue"),this.ER.RO(A,t,void 0).uV(h,void 0,p)}}return"phong"!==y.type||i||(this.ER.PV(x("uCameraLoc"),this.HY).PV(x("uLightLoc"),this.$Y).fV(x("uAmbientReflection"),y.ambientReflection).fV(x("uSpecularReflection"),y.specularReflection).fV(x("uDiffuseReflection"),y.diffuseReflection).fV(x("uShininess"),y.shininess).gR(x("uLightColor"),y.specularColor).gR(x("uAmbientColor"),y.ambientColor).BV(x("uModelRotationNormals"),f),o&&this.ER.uV(o,void 0,{location:A.attribute("aNormal"),size:3})),this.ER.BV(x("uModelRotation"),d).PV(x("uModelScale"),[u.x,u.y,u.z]).PV(x("uLocationAxis"),[a.x,a.y,a.z]).PV(x("uModelAlignment"),[l.x,l.y,l.z]).PV(x("uModelSize"),[c.x,c.y,c.z]),this.ER.uV(n,0,{location:A.attribute("aGeoPos"),size:3}).jV(s).QV(r,this.ER.gl.TRIANGLES),!0})),this):this}dispose(){return super.dispose(),this.uG&&(this.ER.yV(this.uG),this.uG=void 0),this.cG&&(this.ER.yV(this.cG),this.cG=void 0),this.dH&&(this.ER.yV(this.dH),this.dH=void 0),this.AH&&(this.ER.yV(this.AH),this.AH=void 0),this.dE=void 0,this.yY=void 0,this.uH=void 0,this.fH=void 0,this}OR(){return this.dispose(),this}zv(t){return this.uH=t,this.hH=!0,this.Rv=t.modelSize,this}Ov(t){return this.fH=t,this.rH=!0,this}ke(t){return this.be=jr(this.be,t),this}zh(){return this.be}Nv(t){return this.nH=t,this}AV(){return this.nH}Gv(t){return this.Bv=t,this}Wv(t){return this.Dv=t,this}Uv(t){return this.Lv=t,this.lH=!0,this}Yv(t){return this.BY=t,this}Hv(){return this.BY}bt(){return Pe}xt(){return Le}_t(){return Pe}Mt(){return Le}lS(){return Pe}uS(){return Le}xl(){return 0}bl(){return 0}cS(){return 0}ia(){return $r(this.sa,this.be)}ra(t){this.sa=t}}class gp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.BY="cull-back",this.JM=[],this.xW=new gy(this.JM,(t=>t.vertexBuffer&&this.ER.yV(t.vertexBuffer)),!1),this.yu=[],this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=Ve,this.Ja=!1,this.gN=Tg({fillStyleSolid:()=>{const t=this.vS.getFillStyle();return Y(t)&&t},fillStyleIndividual:()=>{const t=this.vS.getFillStyle();return X(t)&&t},fillStylePalette:()=>{const t=this.vS.getFillStyle();return j(t)&&t},triangulatedPointStyle:()=>{const t=this.vS;return ur(t)&&t},wireframeLineStyleSolid:()=>{const t=ur(this.vS)&&this.vS,e=t&&t.getWireframeStyle();return qi(e)&&e},wireframeFillStyleSolid:()=>{const t=ur(this.vS)&&this.vS,e=t&&t.getWireframeStyle(),i=e&&e.getFillStyle();return Y(i)&&i}}),this.Ka=void 0,this.Yn=n,this.vS=wr.pointStyle3D,this.tS.M(Hn);const o=!0===(null==n?void 0:n.individualPointColorEnabled),h=!0===(null==n?void 0:n.individualPointSizeEnabled),a=!0===(null==n?void 0:n.individualLookupValuesEnabled),l=!0===(null==n?void 0:n.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),h&&(c=g,g+=1),a&&(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?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);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 r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&X(e)&&e.getFallbackColor()||R,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eqt(t))(o,h,a,l);this.kW={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.vS,this.vS.fillStyle)}}Ds(t){const e=this.Ja,i=this.Xa,s=this.ja,r=s>0,n=this.vS,o=this.vS!==this.gH,h=this.Lo._(),a=this.Lo.o,l=this.Uz();this.Za&&(this.Ha=qe(this.Ha,this.Za),this.Za=void 0),r&&(this.yu=ne(this.yu,i,{canReturnB:!0}),this.$a+=s);let u=i,c=s;if(e&&(this.JM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Ve})),this.xW.dW(),u=this.yu,c=this.$a),c>0){const t=Math.floor(this.nN.iH/(this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Rt(c,1e5,t);this.xW.aW(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Ve,vertexBuffer:this.ER.zV(t*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i))})),((t,e,i)=>{this.ER.VV(t.vertexBuffer,t.existingCoordinatesCount*this.kW.attributesPerVertex,this.kW.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}const d=n.getFillStyle(),f=this.gN.fillStyleSolid(o),g=this.gN.fillStyleIndividual(o),m=this.gN.fillStylePalette(o),y=d===z&&z;if(o||l||a){let t;const e=n.getSize(),i=this.kW.individualPointColorEnabled,s=this.kW.individualPointSizeEnabled,r=this.kW.individualPointSizeAxisEnabled,a=this.kW.individualLookupValuesEnabled;if(g&&!i){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw bt.alert(t),new Error(t)}if(m&&"value"===m.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw bt.alert(t),new Error(t)}const l=this.gN.wireframeLineStyleSolid(o),u=this.gN.wireframeFillStyleSolid(o);if(f||g||m||u){const i=g?"attribute":m?["lookup",m.getLookUpProperty(),m.lut]:"uniform",o=s&&"number"==typeof e,a=r&&"object"==typeof e,c=o||a?"attribute":"uniform";if(ur(n)){const r=se(n.getShape(),{cube:()=>ep(this.ER),sphere:()=>mp(this.ER,n,s)});t={type:"instanced",shader:this.ER.az(em["3D"],em.ColorShaded3D({dataType:i,shadingStyle:this.tS._().type,wireframe:!1!==u}),em.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.ft),normalSource:r.FY})),pointStyle:n,useIndividualPointSize:o,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,fillStyleEmpty:y,mousePickingShader:h&&this.ER.az(em["3D"],em.MousePicking,em.VertexLocation({offset:{dataType:c,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:wg(this.ft),normalSource:void 0})),geometry:r,wireframe:l&&u&&{thickness:l.getThickness()<0?1:l.getThickness(),fillStyleSolid:u}}}else fr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.ER.az(em["3D"],em.PointSize(c),em.Color({dataType:i}),em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:o,fillStyleSolid:f,fillStyleIndividual:g,fillStylePaletted:m,mousePickingShader:h&&this.ER.az(em["3D"],em.PointSize(c),em.MousePicking,em.VertexLocation({axisWorldTranslation:wg(this.ft),normalSource:void 0}))})}this.bG=t}if(void 0===this.Ka&&m&&"value"===m.lookUpProperty&&m.lut.percentageValues){let t=Pe,e=Le;for(let i=0;it&&(t=s.value)}this.Ka={min:e,max:t}}return this.Ja=!1,this.Xa=[],this.ja=0,this.gH=n,this.tS.o=!1,this}VL(t){const e=this.ER.gl,i=this.bG;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.tS._(),{fillStyleSolid:n,fillStylePaletted:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.ER.lV(s,((u,c,d,f)=>{let g=!1;if(this.ER.ZR(s).PV(u("uScale"),this.LY.lE.AV()).PV(u("uDisp"),this.LY.lE.gV()).BV(u("uViewProjectionMatrix"),this.YY).fV(u("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(u("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.ER.PV(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.ER.fV(u("uOffsetNWU"),e).fV(f("uRatioNwuWu"),this.LY.sH())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.ER.fV(u("uPointSize"),t).fV(u("uDevicePixelRatio"),this.ER.Xz())}if(1===t)this.ER.gR(u("uColor"),this.mN);else if("instanced"===i.type?("phong"===r.type&&this.ER.PV(u("uCameraLoc"),this.HY).PV(u("uLightLoc"),this.$Y).fV(u("uAmbientReflection"),r.ambientReflection).fV(u("uSpecularReflection"),r.specularReflection).fV(u("uDiffuseReflection"),r.diffuseReflection).fV(u("uShininess"),r.shininess).gR(u("uLightColor"),r.specularColor).gR(u("uAmbientColor"),r.ambientColor),l&&this.ER.fV(u("uWireframeThickness"),l.thickness).gR(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.ER.gR(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.ER.gR(u("uColorDiffuse"),I)):"primitive"===i.type&&n&&this.ER.gR(u("uColor"),n.getColor()),o){const t=kg(o,this,this.Ka);if(!t&&o.lut.percentageValues)return!1;this.ER.RO(d,o.lut,t)}return this.JM.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kW.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kW.attributeOffsetSize){"instanced"===i.type?this.ER.fV(f("uRatioNwuWu"),this.LY.sH()):"primitive"===i.type&&this.ER.fV(u("uDevicePixelRatio"),this.ER.Xz());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kW.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePaletted&&"value"===i.fillStylePaletted.getLookUpProperty()&&void 0!==this.kW.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kW.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kW.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.ER.YV(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Zm(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.ER.Zm(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}ol(t,e){Array.isArray(t)||(t=[t]),this.Xa=ne(this.Xa,t,{canReturnB:!0}),this.ja+=t.length;const i=e||Ke(t);return this.Za=this.Za?qe(this.Za,i):i,this.Ka=void 0,this}xS(t){return this.vS="function"==typeof t?t(this.vS):t,this}pH(){return this.vS}bt(){return this.Za?Math.max(this.Za.max.x,this.Ha.max.x):this.Ha.max.x}xt(){return this.Za?Math.min(this.Za.min.x,this.Ha.min.x):this.Ha.min.x}_t(){return this.Za?Math.max(this.Za.max.y,this.Ha.max.y):this.Ha.max.y}Mt(){return this.Za?Math.min(this.Za.min.y,this.Ha.min.y):this.Ha.min.y}lS(){return this.Za?Math.max(this.Za.max.z,this.Ha.max.z):this.Ha.max.z}uS(){return this.Za?Math.min(this.Za.min.z,this.Ha.min.z):this.Ha.min.z}xl(){const t=this.vS,e=t.getSize();return"number"==typeof e?ur(t)?e/2:fr(t)?5:0:0}bl(){return this.xl()}cS(){return this.xl()}il(){return this.yu}tl(){return this.Xa}al(){return this.$a}ll(){return this.ja}Gt(){return this.Ja=!0,this.yu.length=0,this.$a=0,this.Xa=[],this.ja=0,this.Ha=Ve,this.Za=void 0,this.Ka=void 0,this}dispose(){return super.dispose(),this.xW.fW(),this.bG=void 0,this}OR(){return this.dispose(),this}}const mp=(t,e,i)=>{const s=e.getSize();return lp(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class yp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.BY="disabled",this.be=wr.fillStyle,this.pv=wr.lineStyle,this.cU=p("bilinear"),this.mH=[],this.yH=void 0,this.bG={},this.SH=!1,this.gN=Tg({fillStyleSolid:()=>Y(this.be)&&this.be,fillStylePaletted:()=>j(this.be)&&this.be,wireframeStyleLine:()=>qi(this.pv)&&this.pv,wireframeStyleFill:()=>{const t=this.pv&&this.pv.getFillStyle();return Y(t)&&t}}),this.Di={x:0,z:0},this.Xw={x:1,z:1},this.tS.M(Gn);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.Yn={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.vH=new Array(this.Yn.primaryDimensionVectorsCount).fill(void 0),this.P_=new Dy(this.nN,t.nN.kU,t.cs.ft,kt,[],this.Yn,-1,R).mv(ot),this.P_.AU=Ty;const a=this.P_.pU.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n=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:r,sizeGeometryDataVectors:e,sizeUniqueGeometryDataVectors:i,heightmapData:n,normalmapSize:o}})),l=this.P_.pU.gridTileSizes.map((t=>{const e=a.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=a.reduce(((t,e)=>{const i=e.sizeHeatmapDataVectors.primary,s=e.sizeHeatmapDataVectors.secondary,r=i*s;return r>t.cells?{primary:i,secondary:s,cells:r}:t}),{primary:0,secondary:0,cells:0});this.xH={gridTiles:a,gridTileSizes:l,largestGridTileSize:u},this.vv(this.Di,this.Xw)}bH(t){this.MH=t,this.yH=void 0}vv(t,e){this.Di=t,this.Xw=e;const i=this.Yn,s={min:{x:Math.min(this.Di.x,this.Di.x+(i.columns-1)*this.Xw.x),z:Math.min(this.Di.z,this.Di.z+(i.rows-1)*this.Xw.z)},max:{x:Math.max(this.Di.x,this.Di.x+(i.columns-1)*this.Xw.x),z:Math.max(this.Di.z,this.Di.z+(i.rows-1)*this.Xw.z)}},r=new Map;return this.xH.gridTiles.forEach((t=>{const e="columns"===this.Yn.dataOrder?{x:this.Xw.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Xw.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Xw.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Xw.z*(t.sizeHeatmapDataVectors.primary-1)},i="columns"===this.Yn.dataOrder?{x:this.Di.x+this.Xw.x*t.iFirstVector.primary,z:this.Di.z+this.Xw.z*t.iFirstVector.secondary}:{x:this.Di.x+this.Xw.x*t.iFirstVector.secondary,z:this.Di.z+this.Xw.z*t.iFirstVector.primary};r.set(t,{sizeAxis:e,startLocationAxis:i})})),this.bU={_H:s,tilesInfo:r},this}xv(){return{start:this.Di,step:this.Xw,end:{x:this.Di.x+this.Xw.x*this.Yn.columns,z:this.Di.z+this.Xw.z*this.Yn.rows}}}Ds(t){const e=this.mH,i=$r(this.sa,this.be),s=this.gN.fillStyleSolid(i),r=this.gN.fillStylePaletted(i),n=this.pv,o=this.pv!==this.mU,h=this.gN.wireframeStyleLine(o),a=this.gN.wireframeStyleFill(o),l=!1!==a,u=this.cU.o,c=this.cU._(),d=this.tS._(),f=this.Uz(),g=this.Lo._();this.P_.Ds();const m=this.P_.yU;if(!m)return this;this.wH=this.wH||this.CH(m);const y=this.wH;this.kH(y);const p=ky(e,y,void 0,(t=>t.sizeGeometryDataVectors));if(p.size>0&&(Iy(this.ER,p,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.SH=!0),"phong"===d.type&&(p.size>0||f)){const t=this.ER.gl,e=this.ER.az(em["2D"],em.DrawToNormalTexture({flipXZ:"rows"===this.Yn.dataOrder,vertexIdSource:this.ER.wO(),normalTextureType:this.ER.gl2?"uint":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN}));y.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{var r;const n=s.normalmapTexture,o=null===(r=this.bU)||void 0===r?void 0:r.tilesInfo.get(s.tileData);if(!n||!o)return;const h={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},a=h.x*h.y;this.ER.aO.VL((()=>{this.ER.lV(e,((r,n,h,l)=>(this.ER.ZR(e).CO(h,a).cV(r("uTileDimensionsXZ"),["columns"===this.Yn.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).FV(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).cV(r("uTileStartLocationAxisXZ"),[o.startLocationAxis.x,o.startLocationAxis.z]).cV(r("uTileSizeAxisXZ"),[o.sizeAxis.x,o.sizeAxis.z]).dV(r("uHeightmapTexture"),s.heightmapDataTexture,1).Zm(t.POINTS,a),!0)))}),n,h,void 0,this.cs.mn(),0)}))}))}const x=this.bG;if(i||o||u){const t=h&&a?{wireframeSolid:h,wireframeFillSolid:a}:void 0;s?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:r&&"value"===r.getLookUpProperty()?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:["lookup","value",r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r},wireframe:t}:r?x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:["lookup",r.getLookUpProperty(),r.lut],interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r},wireframe:t}:l&&(x.surface={shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:void 0,interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:d.type,wireframe:l,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return x.mousePicking=g?this.bG.mousePicking||{shader:this.ER.az(em["3D"],em.SurfaceGrid({axisWorldTranslation:wg(this.ft),fillColor:"uniform",interpolation:"bilinear"===c&&"bilinear",flipXZ:"rows"===this.Yn.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.ER.kO(),normalTextureType:this.ER.gl2?"uint":"ubyte",intensityTextureType:this.ER.ez?"float":"ubyte",heightmapTextureType:this.ER.ez?"float":"ubyte",littleEndian:this.ER.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.bG=x,this.mH.length=0,this.sa=this.be,this.mU=n,this.tS.o=!1,this}CH(t){const e=this.xH.gridTiles.map((e=>{const i=Ry(this.ER,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.xH.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.ER.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]),r=this.ER.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}kH(t){var e;if("phong"===this.tS._().type)for(let i=0;i{t.normalmapTexture&&(this.ER.NR(t.normalmapTexture),t.normalmapTexture=void 0)}))}VL(t){var e,i,s,r;const n=this.ER.gl,o=this.wH;if(!o)return this;const h=this.tS._(),a=this.bG,l=1===t?null===(e=a.mousePicking)||void 0===e?void 0:e.shader:null===(i=a.surface)||void 0===i?void 0:i.shader;if(!l)return this;const u=1!==t?null===(s=a.surface)||void 0===s?void 0:s.wireframe:void 0,c=1!==t?null===(r=a.surface)||void 0===r?void 0:r.fill:void 0;return this.ER.lV(l,((e,i,s,r)=>{let a=!1;if(this.ER.ZR(l).TO(s,this.xH.largestGridTileSize.cells).PV(e("uScale"),this.LY.lE.AV()).PV(e("uDisp"),this.LY.lE.gV()).BV(e("uViewProjectionMatrix"),this.YY).fV(e("uIsHighlighted"),1===t||2===t?0:this.Vo).gR(e("uHighlightColorOffset"),1===t||2===t?I:this.Wo).fV(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.ER.PV(e("uCameraLoc"),this.HY).PV(e("uLightLoc"),this.$Y).fV(e("uAmbientReflection"),h.ambientReflection).fV(e("uSpecularReflection"),h.specularReflection).fV(e("uDiffuseReflection"),h.diffuseReflection).fV(e("uShininess"),h.shininess).gR(e("uLightColor"),h.specularColor).gR(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.ER.gR(e("uWireframeColor"),t.getColor()).fV(e("uWireframeThickness"),s)}return 1===t?this.ER.gR(e("uColorDiffuse"),this.mN):"solid"===(null==c?void 0:c.fillMode)&&this.ER.gR(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.ER.cV(e("uTileDimensionsXZ"),["columns"===this.Yn.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this.Yn.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).FV(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{var l;const d=null===(l=this.bU)||void 0===l?void 0:l.tilesInfo.get(h.tileData);if(!d)return;let f=0,g=(h.sizeHeatmapDataVectors.primary-1)*(h.sizeHeatmapDataVectors.secondary-1);if(this.MH){const t=this.MH.fill.iFirstPrimary,e=this.MH.fill.iFirstPrimary+this.MH.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sm(Math.max(t,i),Math.min(e,s)))(t,e,i,s);f=(n.min-h.iFirstVector.primary)*(r.sizeGeometryData.secondary-1),g=(n.max-n.min)*(r.sizeGeometryData.secondary-1)}if(!(f<0||g<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{fillStylePaletted:t}=c,i=this.P_.Ka;this.ER.RO(s,t.lut,i).dV(e("uTileIntensityValues"),h.intensityDataTexture,2).IV(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.xt(),max:this.bt()}:"y"===t.getLookUpProperty()?{min:this.Mt(),max:this._t()}:"z"===t.getLookUpProperty()?{min:this.uS(),max:this.lS()}:void 0;if(!e&&t.lut.percentageValues)return;this.ER.RO(s,t.lut,e)}1!==t&&"phong"===this.tS._().type&&h.normalmapTexture&&this.ER.dV(e("uNormalmapTexture"),h.normalmapTexture,3),this.ER.uV(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).LV(e("uBaseInstance"),f).cV(e("uTileStartLocationAxisXZ"),[d.startLocationAxis.x,d.startLocationAxis.z]).cV(e("uTileSizeAxisXZ"),[d.sizeAxis.x,d.sizeAxis.z]).dV(e("uHeightmapTexture"),h.heightmapDataTexture,0).JV(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,g),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.P_.dispose(),this.wH&&(this.wH.gridTileSizes.forEach((t=>{})),this.wH.gridTiles.forEach((t=>{this.ER.NR(t.heightmapDataTexture),t.normalmapTexture&&this.ER.NR(t.normalmapTexture)})),this.ER.yV(this.wH.rectangleLocationsBuffer),this.wH=void 0),this.bG={},this}OR(){return this.dispose(),this.P_.OR(),this}wv(t){return this.P_.wv(t),this}Cv(t){this.mH.push(t),Cy(this.xH.gridTiles,t,(t=>t.heightmapData));for(let e=t.startPrimary;e{for(let n=Math.max(t,r.iFirstUniqueVector.primary);n<=Math.min(e,r.iFirstUniqueVector.primary+r.sizeUniqueHeatmapDataVectors.primary-1);n+=1){const t=(n-r.iFirstUniqueVector.primary)*r.sizeHeatmapDataVectors.secondary;let e=this.vH[n];if(e)i=ie.max?s:e.max;else{e={min:Le,max:Pe},this.vH[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.yH={min:i,max:s},this.yH}}class pp extends sp{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.BY="disabled",this._U=0,this.CU={},this.Di={x:0,z:0},this.Xw={x:1,z:1},this.Yn={...s,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this._H={min:{x:this.Di.x,z:this.Di.z},max:{x:"rows"===s.scrollDimension?this.Di.x+(s.columns-1)*this.Xw.x:this.Di.x,z:"columns"===s.scrollDimension?this.Di.z+(s.rows-1)*this.Xw.z:this.Di.z}};const o=()=>({shape:new yp(this.LY,kt,this.No,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.pN,this.mN).setVisible(!1),hasData:!1});this.JM=[o(),o()]}Ds(t){this.JM.forEach((e=>{e.shape.Ds(t)}));const e=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.P_.Ka)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.P_.Ka)||void 0===s?void 0:s.max,Pe)),t}),{min:Le,max:Pe}),i=this.JM.reduce(((t,e)=>{var i,s;return t.min=Math.min(t.min,Ft(null===(i=e.shape.yH)||void 0===i?void 0:i.min,Le)),t.max=Math.max(t.max,Ft(null===(s=e.shape.yH)||void 0===s?void 0:s.max,Pe)),t}),{min:Le,max:Pe});return this.JM.forEach((t=>{t.shape.P_.Ka=e,t.shape.yH=i})),this}VL(t){return this.JM.forEach((e=>{e.hasData&&(e.shape.YY=this.YY,e.shape.HY=this.HY,e.shape.$Y=this.$Y,e.shape.VL(t))})),this}vv(t,e){return this.Di=t,this.Xw=e,this.JM.forEach((t=>{t.shape.vv("columns"===this.Yn.scrollDimension?{x:t.shape.xv().start.x,z:this.Di.z}:{x:this.Di.x,z:t.shape.xv().start.z},this.Xw)})),"columns"===this.Yn.scrollDimension?(this._H.min.z=t.z,this._H.max.z=this.Di.z+(this.Yn.rows-1)*this.Xw.z):(this._H.min.x=t.x,this._H.max.x=this.Di.x+(this.Yn.columns-1)*this.Xw.x),this}xv(){return{start:this.Di,step:this.Xw}}Gt(){return this._U=0,this.CU={},this._H={min:{x:this.Di.x,z:this.Di.z},max:{x:"rows"===this.Yn.scrollDimension?this.Di.x+(this.Yn.columns-1)*this.Xw.x:this.Di.x,z:"columns"===this.Yn.scrollDimension?this.Di.z+(this.Yn.rows-1)*this.Xw.z:this.Di.z}},this.JM.forEach((t=>{t.shape.setVisible(!1),t.shape.SH=!1,t.hasData=!1})),this}Iv(t){var e;const i=this.JM[0],s=this.JM[1],r=t.heightMapValues?t.heightMapValues.length:null===(e=t.intensityValues)||void 0===e?void 0:e.length;let n=0;if(!r)return this;do{const e=Math.floor(this._U/this.Yn.scrollDimensionSize)%this.JM.length,o=this.JM[e],h=this._U%this.Yn.scrollDimensionSize,a=this.Yn.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,y=this._U>=this.Yn.scrollDimensionSize&&c<=this.Yn.scrollDimensionSize-1,p=l;l&&(o.shape.vv("columns"===this.Yn.scrollDimension?{x:this.Di.x+(this._U-1)*this.Xw.x,z:this.Di.z}:{x:this.Di.x,z:this.Di.z+(this._U-1)*this.Xw.z},this.Xw),o.shape.setVisible(!0));const x=y?0:1,S=c+(y?1:0);o.shape.bH({fill:{iFirstPrimary:x,amountPrimary:S},wireframe:{iFirstPrimary:x,amountPrimary:S,connectNext:!1}});const A=o===i?s:i,v=c+1,b=1+this.Yn.scrollDimensionSize-v;A.shape.bH({fill:{iFirstPrimary:v,amountPrimary:b},wireframe:{iFirstPrimary:v,amountPrimary:b-1,connectNext:!0}});const M={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;p&&this.CU.yValues&&(i=!0,e.splice(0,0,this.CU.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Yn.staticDimensionSize,values:e,type:"y"};o.shape.Cv(s),o.hasData=!0,M.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;p&&this.CU.intensityValues&&(i=!0,e.splice(0,0,this.CU.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Yn.staticDimensionSize,values:e,type:"intensity"};o.shape.wv(s),o.hasData=!0,M.intensityValues=e[u-1]}this._U+=u,n+=u,this.CU=M}while(ne.shape.Mv(t))),this}_v(){return this.JM[0].shape._v()}ke(t){return this.JM.forEach((e=>e.shape.ke(t))),this}zh(){return this.JM[0].shape.zh()}mv(t){return this.JM.forEach((e=>e.shape.mv(t))),this}bv(){return this.JM[0].shape.bv()}OR(){return this.dispose(),this.JM.forEach((t=>t.shape.OR())),this}dispose(){return super.dispose(),this.JM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.JM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}nS(t){return super.nS(t),this.JM.forEach((e=>e.shape.nS(t))),this}bt(){return this._H.max.x}xt(){return this._H.min.x}_t(){return Math.max(this.JM[0].shape._t(),this.JM[1].shape._t())}Mt(){return Math.min(this.JM[0].shape.Mt(),this.JM[1].shape.Mt())}lS(){return this._H.max.z}uS(){return this._H.min.z}xl(){return 0}bl(){return 0}cS(){return 0}ds(t){return super.ds(t),this.JM.forEach((e=>e.shape.ds(t))),this}}class xp extends jy{constructor(t,e,i,s){super(t,e,i),this.FH=45,this.IH=.1,this.PH=100,this.HY=f(0,0,1),this.DH=f(0,0,-1),this.BH=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.tS=new Un,this.ft=s}qv(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.ft,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.cs.ai();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.HY=t,this}getCameraLocation(){return this.HY}setCameraDirection(t){return this.DH=De.normalize(t),this}getCameraDirection(){return this.DH}setLightLocation(t){return this.$Y=t,this}getLightLocation(){return this.$Y}LH(){return f(this.BH[0],this.BH[1],this.BH[2])}RH(){return f(this.BH[4],this.BH[5],this.BH[6])}}class Sp extends xp{constructor(t,e,i,s){super(t,e,i,s),this.lE=new Hm,this.EH=!0,this.nN=t,this.gl=t.aN(),this._Y=this.SY,this.zH=this.cs.ko((()=>{this.EH=!0})),this.VH=s.Y((()=>{this.EH=!0}))}nV(t){const e=t.xt(),i=t.Mt(),s=t.uS(),r=t.bt(),n=t._t(),o=t.lS();if(e===Le||r===Pe||i===Le||n===Pe||s===Le||o===Pe)return _e;const h=t.xl(),a=t.bl(),l=t.cS(),u=Math.abs(t.Ts.Gy(h)*t.ft.x.ht()),c=Math.abs(t.Ts.Gy(a)*t.ft.y.ht()),d=Math.abs(t.Ts.Gy(l)*t.ft.z.ht()),f=e-u,g=r+u,m=i-c,y=n+c,p=s-d,x=o+d;let S;return[{x:f,y:m,z:p},{x:g,y:m,z:p},{x:f,y,z:p},{x:g,y,z:p},{x:f,y:m,z:x},{x:g,y:m,z:x},{x:f,y,z:x},{x:g,y,z:x}].map((e=>t.Ts.Uy(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};S=S?Je(S,{min:t,max:t}):e})),S||_e}wY(t){const e=Array.from(this._Y.values());for(let i=0;iye()));const{viewProjectionMatrix:s}=this.OH();this.NH();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.SY.forEach((t=>{t.YY=s,t.HY=r,t.$Y=n,t.Ds(i)})),this}OH(){if(!this.EH&&this.YY)return{viewProjectionMatrix:this.YY};const t=this.qv(),e=t.width/t.height;this.GH=pl.projectionPerspective(this.FH,e,this.IH,this.PH);const i=this.HY;this.BH[12]=i.x,this.BH[13]=i.y,this.BH[14]=i.z;const s=this.DH,r=f(0,1,0),n=De.multiply(s,-1),o=De.normalize(De.cross(r,n)),h=De.normalize(De.cross(n,o));this.BH[0]=o.x,this.BH[1]=o.y,this.BH[2]=o.z,this.BH[4]=h.x,this.BH[5]=h.y,this.BH[6]=h.z,this.BH[8]=n.x,this.BH[9]=n.y,this.BH[10]=n.z,this.WH=pl.inverse(this.BH);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.ft,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,m=(a.y+l.y/2)/u.y,y=pl.multiply(pl.translation(Pn(-1,1,g),Pn(-1,1,m),0),pl.scaling(c,d,1));return this.YY=pl.multiply(y,pl.multiply(this.GH,this.WH)),this.UH=pl.inverse(this.YY),this.EH=!1,{viewProjectionMatrix:this.YY}}NH(){this.lE.qO(this.ft.x),this.lE.tN(this.ft.y),this.lE.iN(this.ft.z)}VL(t,e){const i=this.gl.Xz(),s=this.qv(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.rV(r.x,r.y,r.width,r.height),this.SY.forEach((e=>{e.getVisible()&&(this.gl.qz(e.BY),1!==t&&this.gl.oS(e.sS),(1!==t||e.getMouseInteractions())&&e.VL(t))})),this.gl.qz("disabled"),this.gl.oS(!1),this.gl.tV(!1),this}setCameraLocation(t){return this.HY.x===t.x&&this.HY.y===t.y&&this.HY.z===t.z||(this.EH=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.DH.x===t.x&&this.DH.y===t.y&&this.DH.z===t.z||(this.EH=!0),super.setCameraDirection(t),this}U(){super.U(),this.cs.To(this.zH),this.ft.H(this.VH)}bS(t){const e=this.nN.CY();return this.vY(new gp(this,this.xY,[],e,this.nN.kY(e),t))}sy(t){const e=this.nN.CY();return this.vY(new up(this,this.xY,t,e,this.nN.kY(e)))}gS(){const t=this.nN.CY();return this.vY(new rp(this,this.xY,[],t,this.nN.kY(t)))}Ev(){const t=this.nN.CY();return this.vY(new fp(this,this.xY,[],t,this.nN.kY(t)))}Rg(){const t=this.nN.CY();return this.vY(new hp(this,this.xY,[],t,this.nN.kY(t)))}yv(t){const e=this.nN.CY();return this.vY(new yp(this,this.xY,[],t,e,this.nN.kY(e)))}Fv(t){const e=this.nN.CY();return this.vY(new pp(this,this.xY,[],t,e,this.nN.kY(e)))}}class Ap extends Tr{constructor(t,e,i,s=Um){if(super(t,e,i),this.j=c(1,1),this.YH=!1,this.HH=0,this.$H=!0,this.XH=0,this.iH=8388608,this.XE=[null,null],this.jH=null,this.ZH=null,this.QH=0,this.Jg=!1,this.JH=0,this.vs=(t=!1)=>(this.Xi||this.fn||this.KH()||(t&&(this.YH=!0),this.rn=!0,this.qH||this.Jr.oz(t)),this),this.qH=!1,this.dz=t=>{if(this.Xi||this.fn)return;const e=t-this.HH;if(e>=this.Jn||-1===this.Jn){this.qH=!0,this.HH=t,this.YH=!1;const i=e>50?1e3/60:e;this.nn&&this.nn(i),this.rn=!1,-1!==this.Jn&&this.YH&&(this.Jr.oz(this.YH),this.rn=!0),this.us.Ds(e),this.Sn(),this.vn(),this.an&&this.an(),this.qH=!1,this.L.emit("render"),this.rn&&this.vs(this.YH)}else this.rn=!0,this.Jr.oz()},this.t$=new Map,this.aN=()=>this.ER,this.i$=()=>{var t,e,i;const s=this.Nn(),r=this.$H,n=bt.performance.now(),o=null===(t=this.s$)||void 0===t?void 0:t.e$.reduce(((t,e)=>t?e.h$&&t.h$&&e.h$>t.h$?e:t:e),void 0),h=null==o?void 0:o.h$,a=null===(e=this.Bn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Mo)||void 0===i?void 0:i.timeStamp;return r?(this.vs(!0),!1):void 0===o||(void 0===o||!o.r$)&&(void 0!==l&&void 0!==h&&l>h||(void 0!==h&&void 0===s?n-h>=1e3:!(void 0!==h&&void 0!==a&&n-a>=2e3)||n-h>=1e3))},this.n$=()=>{var t,e;this.o$=void 0;const i=null===(e=null===(t=this.s$)||void 0===t?void 0:t.a$)||void 0===e?void 0:e.l$;void 0===i||i>=this.XH||this.u$()},this.vn=()=>{if(this.Xi||this.fn)return this;const t=this.ER.gl,e=bt.performance.now();this.ER.eV(t.FRAMEBUFFER,this.Jr.iz?this.XE[0]:null);const i=this.j,s=i.x>0&&i.y>0;if(this.pn.o&&this.ER.tO(this.pn._()),t.resize&&s&&t.resize(i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.hV(0,0,i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.rV(0,0,i.x*this.ER.Xz(),i.y*this.ER.Xz()),this.ER.Gt(),s)for(const t of this.sn.values())t.VL(0,1);if(this.Yn.jn&&s&&(this.o$&&(bt.clearTimeout(this.o$),this.o$=void 0),this.i$()?(this.u$(),this.ER.eV(t.FRAMEBUFFER,this.Jr.iz?this.XE[0]:null)):this.o$=bt.setTimeout(this.n$,500)),this.Z(),this.Zr(),this.wn&&this._n(this.wn),this.Jr.iz){const e=this.ER.gl2.ctx;e.bindFramebuffer(e.READ_FRAMEBUFFER,this.XE[0]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.XE[1]),e.clearBufferfv(e.COLOR,0,[1,1,1,1]),e.blitFramebuffer(0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),t.COLOR_BUFFER_BIT,t.LINEAR)}else t.bindTexture(t.TEXTURE_2D,this.GE),t.copyTexImage2D(t.TEXTURE_2D,0,t.RGBA,0,0,this.j.x*this.ER.Xz(),this.j.y*this.ER.Xz(),0),t.bindTexture(t.TEXTURE_2D,null);return this.ER.eV(t.FRAMEBUFFER,null),this.Jr.oz(),this.$H=!1,this.XH=e,this},this.Sn=()=>{if("use-window"===this.c$.mode){const t=bt.devicePixelRatio||1;this.ER.fO(t)}const t=this.j;if(0===t.x||0===t.y)return this;this.ao.tt(t);for(const t of this.sn.values())t.Ds();return this.Z(),this},this.d$=1,this.Jr=t,this.Jr.qE){this.f$=bt.document.createElement("canvas"),this.f$.style.width="100%",this.f$.style.height="100%",this.f$.style.display="block",this.f$.style.boxSizing="content-box",this.f$.style.position="absolute";const t=this.f$.getContext("2d",{willReadFrequently:!1,alpha:!0,desynchronized:!1});if(!t)throw new yt("No Canvas context available.");this.WE=t,this.Wr.appendChild(this.f$)}this.Jr.gz(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 n;if(this.Jr.iz&&t.gl2&&(n=new s(this,this.Yn,{type:"webgl2",ctx:t.gl2.ctx,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),n||this.Jr.iz||(n=new s(this,this.Yn,{type:"webgl1",ctx:t.gl,antialias:r.antialias,lineAntialias:r.lineAntialias},this.ts.isDark)),!n)throw new yt("No WebGL context available");if(this.ER=n,"number"==typeof(null==e?void 0:e.devicePixelRatio))this.c$={mode:"fixed",value:e.devicePixelRatio},this.ER.fO(e.devicePixelRatio);else{const t=bt.document.head.querySelector('meta[name="viewport"]'),i=!0===e.devicePixelRatio||(null==t?void 0:t.content.includes("width=device-width")),s=bt.devicePixelRatio||1;this.c$=i?{mode:"use-window"}:{mode:"fixed",value:s},this.ER.fO(s)}const o=e?e.width:void 0,h=e?e.height:void 0;this.ro=this.A$(o),this.oo=this.A$(h),this.g$(this.ro,this.oo),this.kU=this.II("engine offscreen",1e6),this.p$=this.II("engine bg",0);const a="function"==typeof this.ts.lcjsBackgroundFillStyle?this.ts.lcjsBackgroundFillStyle(this.Yn.Xs):this.ts.lcjsBackgroundFillStyle;this.ao=this.p$.Te(this.ft).ke(a).Ce(this.ts.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Ie({x:0,y:0});const l=this.II("engine effects",200001).TY(this.ts.effect);this.hs=l;const u=this.Jr.iz,d=this.ai();u&&(this.XE=[n.xV(),n.xV()]);const f=this.ER.gl;u&&(this.jH=f.createRenderbuffer(),this.ZH=f.createRenderbuffer()),this.GE=f.createTexture();const g=d.x*this.ER.Xz(),m=d.y*this.ER.Xz();if(u){f.bindRenderbuffer(f.RENDERBUFFER,this.jH);const t=this.ER.gl2.ctx;this.QH=this.Jr.DE&&!1!==e.antialias?t.getParameter(t.MAX_SAMPLES):0,t.renderbufferStorageMultisample(t.RENDERBUFFER,this.QH,t.RGBA8,g,m),f.bindRenderbuffer(f.RENDERBUFFER,this.ZH),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,g,m),t.renderbufferStorageMultisample(t.RENDERBUFFER,this.QH,t.DEPTH_COMPONENT16,g,m)}u&&(this.ER.eV(f.FRAMEBUFFER,this.XE[0]),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.RENDERBUFFER,this.jH),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.ZH)),f.bindTexture(f.TEXTURE_2D,this.GE),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,g,m,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),u&&(this.ER.eV(f.FRAMEBUFFER,this.XE[1]),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.GE,0)),this.ER.eV(f.FRAMEBUFFER,null),this.An(),this.Zr(),this.hp=Ar(this),this.rp={ts:this.ts,us:this.us,ft:this.ft,vs:t=>this.vs(t),Nn:()=>this.Nn(),dB:t=>this.dB(t),Yn:this.Yn,Gn:t=>this.Gn(t),hs:this.hs,Do:t=>this.Do(t),Bo:t=>this.Bo(t),Pg:{Ig:(t,e,i)=>this.ER.Oh(e.family).JR(t,e,i,this.ts.isDark)}};const y=()=>{this.U()};bt.addEventListener("unload",y),this.ln.push((()=>{bt.removeEventListener("unload",y)}))}get m$(){return this.sn}Kr(t,e){let i=this.t$.get(t);if(!i){const e=this.ER.SO(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.t$.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{fB:()=>e.Bz,AB:t=>{e.Bz?t():o.push(t)}}},this.t$.set(t,i),e.ZR(this),e.Nz((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new eo(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}dB(t){const e=Array.from(this.t$.values()).find((e=>e.instances.has(t)));if(!e)throw me(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}Cn(t,e){var i;const s=null===(i=this.s$)||void 0===i?void 0:i.a$;if(!s)return;const r=this.De(e.x,e.y),n=Math.round(r.x*this.ER.Xz()),o=Math.round(r.y*this.ER.Xz());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.y$(s,n+t[0]/s.S$,o+t[1]/s.S$))).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)}y$(t,e,i){const s=Math.round(e*t.S$),r=Math.round(i*t.S$);if(s<0||s>=t.j.x||r<0||r>=t.j.y)return;const n=4*(s+r*t.j.x),o=t.v$[n+0],h=t.v$[n+1],a=t.v$[n+2],l=t.v$[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.x$(o,h,a,l):void 0}$r(t,e,i){const s=this.ER.gl;this.Jr.iz?(this.ER.eV(s.FRAMEBUFFER,this.XE[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.GE,0)):this.ER.eV(s.FRAMEBUFFER,null);const r=this.NE(),n=r.x,o=r.y,h=new Uint8Array(n*o*4);this.Jr.iz||this.vn(),s.readPixels(0,0,n,o,s.RGBA,s.UNSIGNED_BYTE,h);const a=new ImageData(new Uint8ClampedArray(h),n,o),l=document.createElement("canvas"),u=l.getContext("2d");if(!u)throw new Error("Failed to create 2D context for saving image.");l.width=n,l.height=o,u.putImageData(a,0,0),u.translate(0,o),u.scale(1,-1),u.drawImage(l,0,0),this.Jr.iz&&(this.ER.eV(s.FRAMEBUFFER,this.XE[0]),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,this.jH),this.ER.eV(s.FRAMEBUFFER,this.XE[1]),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,this.GE,0)),this.ER.eV(s.FRAMEBUFFER,null);const c=l.toDataURL(t,e);return i?c:(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=bt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof Zy))throw new Error("Unexpected Engine Layer error");return i}return this.xn(new Zy(this,e,t))}LI(t,e,i){const s=this.do(e);if(s){if(me(0,(()=>{})),!(s instanceof Sp))throw new Error("Unexpected Engine Layer error");return s}return this.xn(new Sp(this,e,t,i))}ai(){return this.j}NE(){const t=this.ER.Xz();return{x:Math.round(this.j.x*t),y:Math.round(this.j.y*t)}}A$(t){return t instanceof Array||(t=[t,t]),t}b$(){return this.Jr.UE}KH(){const t=this.ER.gl;return t&&"resize"in t}u$(){var t;const e=this.ER.gl,i=bt.performance.now(),s=this.Nn(),r=this.Yn.Xn,n={x:Math.ceil(this.j.x*this.ER.Xz()*r),y:Math.ceil(this.j.y*this.ER.Xz()*r)};this.s$||(this.s$={S$:r,M$:n,e$:[],a$:void 0});let o=this.s$.e$.find((t=>!t.r$)),h=!1;o||(h=!0,o={r$:!1,j:n,DO:e.createTexture(),_$:this.ER.xV(),ZH:this.ER.bV(),w$:new Uint8Array,h$:void 0},this.s$.e$.push(o));const a=o;(h||a.j.x!==n.x||a.j.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.DO),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n.x,n.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.ER.eV(e.FRAMEBUFFER,a._$),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.DO,0),e.bindRenderbuffer(e.RENDERBUFFER,a.ZH),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.ZH),a.w$=new Uint8Array(n.x*n.y*4),a.j=n),a.r$=!0,a.h$=i,this.ER.eV(e.FRAMEBUFFER,a._$),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(n.x,n.y),this.ER.hV(0,0,n.x,n.y);for(const t of this.sn.values())t.VL(1,r);this.ER.eV(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.ER.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.s$){const t=this.s$.a$;if(t&&t.l$>i)return;this.s$.a$={l$:i,S$:r,j:n,v$:a.w$,C$:s}}};l?this.ER.FO(l,a._$,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.w$).then((()=>{this.Xi||(a.r$=!1,u())})).catch((t=>{this.Xi||(a.r$=!1,bt.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.ER.IO(a._$,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.w$),a.r$=!1,u())}An(t){if("use-window"===this.c$.mode){const t=bt.devicePixelRatio||1;this.ER.fO(t)}const e=this.j.x,i=this.j.y,s=t||{x:this.Wr.offsetWidth,y:this.Wr.offsetHeight};if(0!==s.x&&0!==s.y&&(s.x!==e||s.y!==i)){this.j=s,this.ft.x.K(0,s.x).tt(s.x),this.ft.y.K(0,s.y).tt(s.y);const t=s.x*this.ER.Xz(),e=s.y*this.ER.Xz(),i=this.ER.gl;this.Jr.qE&&this.WE&&(this.WE.canvas.width=t,this.WE.canvas.height=e);const r=this.Jr.iz;if(this.GE&&(i.bindTexture(i.TEXTURE_2D,this.GE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,e,0,i.RGBA,i.UNSIGNED_BYTE,null)),r){const s=this.ER.gl2.ctx;this.jH&&(i.bindRenderbuffer(i.RENDERBUFFER,this.jH),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.QH,s.RGBA8,t,e)),this.ZH&&(i.bindRenderbuffer(i.RENDERBUFFER,this.ZH),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_COMPONENT16,t,e),s.renderbufferStorageMultisample(s.RENDERBUFFER,this.QH,s.DEPTH_COMPONENT16,t,e))}i.bindRenderbuffer(i.RENDERBUFFER,null),this.L.emit("resize",[this.j.x,this.j.y])}}U(){var t;this.Xi||(super.U(),this.o$&&(bt.clearTimeout(this.o$),this.o$=void 0),Array.from(this.ER.bE.entries()).forEach((([t,e])=>{e.OR(!1),this.ER.bE.delete(t)})),Array.from(this.ER.CV.values()).forEach((t=>{t.unbindResources()})),this.ER.CV.clear(),this.ER.wV.Tz(),this.ER.lO.U(),this.ER.yV(this.ER.uO),this.ER.yV(this.ER.cO),this.ER.rO.forEach(((t,e)=>{this.ER.gl.deleteBuffer(e)})),this.ER.rO.clear(),this.ER._O&&(this.ER.yV(this.ER._O.buffer),this.ER._O=void 0),this.ER._V(this.XE[0]),this.ER._V(this.XE[1]),this.ER.MV(this.jH),this.ER.NR(this.GE),this.ER.MV(this.ZH),this.s$&&(this.s$.e$.forEach((t=>{this.ER.MV(t.ZH),this.ER._V(t._$),this.ER.NR(t.DO)})),this.s$=void 0),this.ER.sO.forEach((t=>this.ER.yV(t))),this.t$.clear(),this.Jr.mz(this),this.f$&&(null===(t=this.f$.parentElement)||void 0===t||t.removeChild(this.f$),this.f$=void 0),this.WE&&(this.WE=void 0),this.ER.gl=void 0)}CY(){const t=this.d$;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.d$=1),this.d$+=1,t}kY(t){let e=t;const i=Math.floor(e/16777216);e-=16777216*i;const s=Math.floor(e/65536);e-=65536*s;const r=Math.floor(e/256);return e-=256*r,E(i,s,r,e)}x$(t,e,i,s){if(0===t&&0===e&&0===i&&0===s)return;const r=16777216*t+65536*e+256*i+s;for(const t of this.m$.values()){const e=t.wY(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.bn()}}}}var vp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},bp={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 r(t,e,i){if(r.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.Oz(t||0,e||10,i||"be"))}var n;"object"==typeof bp?bp.exports=r:e.BN=r,r.BN=r,r.wordSize=26;try{n=(void 0).Buffer}catch(t){}function o(t,e,s){for(var r=0,n=Math.min(t.length,s),o=0,h=e;h=49&&l<=54?l-49+10:l>=17&&l<=22?l-17+10:l,o|=a}return i(!(240&o),"Invalid character in "+t),r}function h(t,e,s,r){for(var n=0,o=0,h=Math.min(t.length,s),a=e;a=49?l-49+10:l>=17?l-17+10:l,i(l>=0&&o0?t:e},r.min=function(t,e){return t.cmp(e)<0?t:e},r.prototype.Oz=function(t,e,s){if("number"==typeof t)return this.k$(t,e,s);if("object"==typeof t)return this.T$(t,e,s);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var r=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&r++,16===e?this.F$(t,r):this.I$(t,e,r),"-"===t[0]&&(this.negative=1),this.P$(),"le"===s&&this.T$(this.toArray(),e,s)},r.prototype.k$=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.T$(this.toArray(),e,s)},r.prototype.T$=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 r=0;r=0;r-=3)o=t[r]|t[r-1]<<8|t[r-2]<<16,this.words[n]|=o<>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);else if("le"===s)for(r=0,n=0;r>>26-h&67108863,(h+=24)>=26&&(h-=26,n++);return this.P$()},r.prototype.F$=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)r=o(t,i,i+6),this.words[s]|=r<>>26-n&4194303,(n+=24)>=26&&(n-=26,s++);i+6!==e&&(r=o(t,e,i+6),this.words[s]|=r<>>26-n&4194303),this.P$()},r.prototype.I$=function(t,e,i){this.words=[0],this.length=1;for(var s=0,r=1;r<=67108863;r*=e)s++;s--,r=r/e|0;for(var n=t.length-i,o=n%s,a=Math.min(n,n-o)+i,l=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this.R$()},r.prototype.R$=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(t){r.prototype.inspect=l}else r.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 r=0|t.words[0],n=0|e.words[0],o=r*n,h=67108863&o,a=o/67108864|0;i.words[0]=h;for(var l=1;l>>26,c=67108863&a,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=(r=0|t.words[g])*(n=0|e.words[f])+c)/67108864|0,c=67108863&o}i.words[l]=0|c,a=0|u}return 0!==a?i.words[l]=0|a:i.length--,i.P$()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.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")},r.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},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.P$();var r=this.byteLength(),n=s||Math.max(1,r);i(r<=n,"byte array longer than desired length"),i(n>0,"Requested array length <= 0");var o=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,n);return this["_toArrayLike"+("le"===e?"LE":"BE")](o,r),o},r.prototype.E$=function(t,e){for(var i=0,s=0,r=0,n=0;r>8&255),i>16&255),6===n?(i>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i=0&&(t[i--]=o>>8&255),i>=0&&(t[i--]=o>>16&255),6===n?(i>=0&&(t[i--]=o>>24&255),s=0,n=0):(s=o>>>24,n+=2)}if(i>=0)for(t[i--]=s;i>=0;)t[i--]=0},Math.clz32?r.prototype.V$=function(t){return 32-Math.clz32(t)}:r.prototype.V$=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},r.prototype.O$=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},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.V$(t);return 26*(this.length-1)+e},r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},r.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},r.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)},r.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},r.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)},r.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},r.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),s=t%26;this.L$(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.P$()},r.prototype.notn=function(t){return this.clone().inotn(t)},r.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var s=t/26|0,r=t%26;return this.L$(s+1),this.words[s]=e?this.words[s]|1<t.length?(i=this,s=t):(i=t,s=this);for(var r=0,n=0;n>>26;for(;0!==r&&n>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;nt.length?this.clone().iadd(t):t.clone().iadd(this)},r.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e.R$()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.R$();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,y=0|o[2],p=8191&y,x=y>>>13,S=0|o[3],A=8191&S,v=S>>>13,b=0|o[4],M=8191&b,E=b>>>13,w=0|o[5],T=8191&w,k=w>>>13,C=0|o[6],R=8191&C,I=C>>>13,F=0|o[7],D=8191&F,L=F>>>13,P=0|o[8],_=8191&P,V=P>>>13,B=0|o[9],z=8191&B,N=B>>>13,O=0|h[0],U=8191&O,G=O>>>13,Y=0|h[1],H=8191&Y,X=Y>>>13,W=0|h[2],j=8191&W,$=W>>>13,Z=0|h[3],K=8191&Z,J=Z>>>13,q=0|h[4],Q=8191&q,tt=q>>>13,et=0|h[5],it=8191&et,st=et>>>13,rt=0|h[6],nt=8191&rt,ot=rt>>>13,ht=0|h[7],at=8191&ht,lt=ht>>>13,ut=0|h[8],ct=8191&ut,dt=ut>>>13,ft=0|h[9],gt=8191&ft,mt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var yt=(l+(s=Math.imul(c,U))|0)+((8191&(r=(r=Math.imul(c,G))+Math.imul(d,U)|0))<<13)|0;l=((n=Math.imul(d,G))+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(g,U),r=(r=Math.imul(g,G))+Math.imul(m,U)|0,n=Math.imul(m,G);var pt=(l+(s=s+Math.imul(c,H)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,H)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(p,U),r=(r=Math.imul(p,G))+Math.imul(x,U)|0,n=Math.imul(x,G),s=s+Math.imul(g,H)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(m,H)|0,n=n+Math.imul(m,X)|0;var xt=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(A,U),r=(r=Math.imul(A,G))+Math.imul(v,U)|0,n=Math.imul(v,G),s=s+Math.imul(p,H)|0,r=(r=r+Math.imul(p,X)|0)+Math.imul(x,H)|0,n=n+Math.imul(x,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,j)|0,n=n+Math.imul(m,$)|0;var St=(l+(s=s+Math.imul(c,K)|0)|0)+((8191&(r=(r=r+Math.imul(c,J)|0)+Math.imul(d,K)|0))<<13)|0;l=((n=n+Math.imul(d,J)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(M,U),r=(r=Math.imul(M,G))+Math.imul(E,U)|0,n=Math.imul(E,G),s=s+Math.imul(A,H)|0,r=(r=r+Math.imul(A,X)|0)+Math.imul(v,H)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(p,j)|0,r=(r=r+Math.imul(p,$)|0)+Math.imul(x,j)|0,n=n+Math.imul(x,$)|0,s=s+Math.imul(g,K)|0,r=(r=r+Math.imul(g,J)|0)+Math.imul(m,K)|0,n=n+Math.imul(m,J)|0;var At=(l+(s=s+Math.imul(c,Q)|0)|0)+((8191&(r=(r=r+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;l=((n=n+Math.imul(d,tt)|0)+(r>>>13)|0)+(At>>>26)|0,At&=67108863,s=Math.imul(T,U),r=(r=Math.imul(T,G))+Math.imul(k,U)|0,n=Math.imul(k,G),s=s+Math.imul(M,H)|0,r=(r=r+Math.imul(M,X)|0)+Math.imul(E,H)|0,n=n+Math.imul(E,X)|0,s=s+Math.imul(A,j)|0,r=(r=r+Math.imul(A,$)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,$)|0,s=s+Math.imul(p,K)|0,r=(r=r+Math.imul(p,J)|0)+Math.imul(x,K)|0,n=n+Math.imul(x,J)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(m,Q)|0,n=n+Math.imul(m,tt)|0;var vt=(l+(s=s+Math.imul(c,it)|0)|0)+((8191&(r=(r=r+Math.imul(c,st)|0)+Math.imul(d,it)|0))<<13)|0;l=((n=n+Math.imul(d,st)|0)+(r>>>13)|0)+(vt>>>26)|0,vt&=67108863,s=Math.imul(R,U),r=(r=Math.imul(R,G))+Math.imul(I,U)|0,n=Math.imul(I,G),s=s+Math.imul(T,H)|0,r=(r=r+Math.imul(T,X)|0)+Math.imul(k,H)|0,n=n+Math.imul(k,X)|0,s=s+Math.imul(M,j)|0,r=(r=r+Math.imul(M,$)|0)+Math.imul(E,j)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(A,K)|0,r=(r=r+Math.imul(A,J)|0)+Math.imul(v,K)|0,n=n+Math.imul(v,J)|0,s=s+Math.imul(p,Q)|0,r=(r=r+Math.imul(p,tt)|0)+Math.imul(x,Q)|0,n=n+Math.imul(x,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(m,it)|0,n=n+Math.imul(m,st)|0;var bt=(l+(s=s+Math.imul(c,nt)|0)|0)+((8191&(r=(r=r+Math.imul(c,ot)|0)+Math.imul(d,nt)|0))<<13)|0;l=((n=n+Math.imul(d,ot)|0)+(r>>>13)|0)+(bt>>>26)|0,bt&=67108863,s=Math.imul(D,U),r=(r=Math.imul(D,G))+Math.imul(L,U)|0,n=Math.imul(L,G),s=s+Math.imul(R,H)|0,r=(r=r+Math.imul(R,X)|0)+Math.imul(I,H)|0,n=n+Math.imul(I,X)|0,s=s+Math.imul(T,j)|0,r=(r=r+Math.imul(T,$)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,$)|0,s=s+Math.imul(M,K)|0,r=(r=r+Math.imul(M,J)|0)+Math.imul(E,K)|0,n=n+Math.imul(E,J)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(p,it)|0,r=(r=r+Math.imul(p,st)|0)+Math.imul(x,it)|0,n=n+Math.imul(x,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(m,nt)|0,n=n+Math.imul(m,ot)|0;var Mt=(l+(s=s+Math.imul(c,at)|0)|0)+((8191&(r=(r=r+Math.imul(c,lt)|0)+Math.imul(d,at)|0))<<13)|0;l=((n=n+Math.imul(d,lt)|0)+(r>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(_,U),r=(r=Math.imul(_,G))+Math.imul(V,U)|0,n=Math.imul(V,G),s=s+Math.imul(D,H)|0,r=(r=r+Math.imul(D,X)|0)+Math.imul(L,H)|0,n=n+Math.imul(L,X)|0,s=s+Math.imul(R,j)|0,r=(r=r+Math.imul(R,$)|0)+Math.imul(I,j)|0,n=n+Math.imul(I,$)|0,s=s+Math.imul(T,K)|0,r=(r=r+Math.imul(T,J)|0)+Math.imul(k,K)|0,n=n+Math.imul(k,J)|0,s=s+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,tt)|0)+Math.imul(E,Q)|0,n=n+Math.imul(E,tt)|0,s=s+Math.imul(A,it)|0,r=(r=r+Math.imul(A,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(p,nt)|0,r=(r=r+Math.imul(p,ot)|0)+Math.imul(x,nt)|0,n=n+Math.imul(x,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(m,at)|0,n=n+Math.imul(m,lt)|0;var Et=(l+(s=s+Math.imul(c,ct)|0)|0)+((8191&(r=(r=r+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;l=((n=n+Math.imul(d,dt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,U),r=(r=Math.imul(z,G))+Math.imul(N,U)|0,n=Math.imul(N,G),s=s+Math.imul(_,H)|0,r=(r=r+Math.imul(_,X)|0)+Math.imul(V,H)|0,n=n+Math.imul(V,X)|0,s=s+Math.imul(D,j)|0,r=(r=r+Math.imul(D,$)|0)+Math.imul(L,j)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(R,K)|0,r=(r=r+Math.imul(R,J)|0)+Math.imul(I,K)|0,n=n+Math.imul(I,J)|0,s=s+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,tt)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,tt)|0,s=s+Math.imul(M,it)|0,r=(r=r+Math.imul(M,st)|0)+Math.imul(E,it)|0,n=n+Math.imul(E,st)|0,s=s+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(p,at)|0,r=(r=r+Math.imul(p,lt)|0)+Math.imul(x,at)|0,n=n+Math.imul(x,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(m,ct)|0,n=n+Math.imul(m,dt)|0;var wt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(z,H),r=(r=Math.imul(z,X))+Math.imul(N,H)|0,n=Math.imul(N,X),s=s+Math.imul(_,j)|0,r=(r=r+Math.imul(_,$)|0)+Math.imul(V,j)|0,n=n+Math.imul(V,$)|0,s=s+Math.imul(D,K)|0,r=(r=r+Math.imul(D,J)|0)+Math.imul(L,K)|0,n=n+Math.imul(L,J)|0,s=s+Math.imul(R,Q)|0,r=(r=r+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(T,it)|0,r=(r=r+Math.imul(T,st)|0)+Math.imul(k,it)|0,n=n+Math.imul(k,st)|0,s=s+Math.imul(M,nt)|0,r=(r=r+Math.imul(M,ot)|0)+Math.imul(E,nt)|0,n=n+Math.imul(E,ot)|0,s=s+Math.imul(A,at)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(p,ct)|0,r=(r=r+Math.imul(p,dt)|0)+Math.imul(x,ct)|0,n=n+Math.imul(x,dt)|0;var Tt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,j),r=(r=Math.imul(z,$))+Math.imul(N,j)|0,n=Math.imul(N,$),s=s+Math.imul(_,K)|0,r=(r=r+Math.imul(_,J)|0)+Math.imul(V,K)|0,n=n+Math.imul(V,J)|0,s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(R,it)|0,r=(r=r+Math.imul(R,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(T,nt)|0,r=(r=r+Math.imul(T,ot)|0)+Math.imul(k,nt)|0,n=n+Math.imul(k,ot)|0,s=s+Math.imul(M,at)|0,r=(r=r+Math.imul(M,lt)|0)+Math.imul(E,at)|0,n=n+Math.imul(E,lt)|0,s=s+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var kt=(l+(s=s+Math.imul(p,gt)|0)|0)+((8191&(r=(r=r+Math.imul(p,mt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,K),r=(r=Math.imul(z,J))+Math.imul(N,K)|0,n=Math.imul(N,J),s=s+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,tt)|0)+Math.imul(V,Q)|0,n=n+Math.imul(V,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(R,nt)|0,r=(r=r+Math.imul(R,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(T,at)|0,r=(r=r+Math.imul(T,lt)|0)+Math.imul(k,at)|0,n=n+Math.imul(k,lt)|0,s=s+Math.imul(M,ct)|0,r=(r=r+Math.imul(M,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var Ct=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,mt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,mt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,Q),r=(r=Math.imul(z,tt))+Math.imul(N,Q)|0,n=Math.imul(N,tt),s=s+Math.imul(_,it)|0,r=(r=r+Math.imul(_,st)|0)+Math.imul(V,it)|0,n=n+Math.imul(V,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(R,at)|0,r=(r=r+Math.imul(R,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(T,ct)|0,r=(r=r+Math.imul(T,dt)|0)+Math.imul(k,ct)|0,n=n+Math.imul(k,dt)|0;var Rt=(l+(s=s+Math.imul(M,gt)|0)|0)+((8191&(r=(r=r+Math.imul(M,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(N,it)|0,n=Math.imul(N,st),s=s+Math.imul(_,nt)|0,r=(r=r+Math.imul(_,ot)|0)+Math.imul(V,nt)|0,n=n+Math.imul(V,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(R,ct)|0,r=(r=r+Math.imul(R,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(T,gt)|0)|0)+((8191&(r=(r=r+Math.imul(T,mt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((n=n+Math.imul(k,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(N,nt)|0,n=Math.imul(N,ot),s=s+Math.imul(_,at)|0,r=(r=r+Math.imul(_,lt)|0)+Math.imul(V,at)|0,n=n+Math.imul(V,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(L,ct)|0,n=n+Math.imul(L,dt)|0;var Ft=(l+(s=s+Math.imul(R,gt)|0)|0)+((8191&(r=(r=r+Math.imul(R,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,mt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(N,at)|0,n=Math.imul(N,lt),s=s+Math.imul(_,ct)|0,r=(r=r+Math.imul(_,dt)|0)+Math.imul(V,ct)|0,n=n+Math.imul(V,dt)|0;var Dt=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(N,ct)|0,n=Math.imul(N,dt);var Lt=(l+(s=s+Math.imul(_,gt)|0)|0)+((8191&(r=(r=r+Math.imul(_,mt)|0)+Math.imul(V,gt)|0))<<13)|0;l=((n=n+Math.imul(V,mt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Pt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,mt))+Math.imul(N,gt)|0))<<13)|0;return l=((n=Math.imul(N,mt))+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,a[0]=yt,a[1]=pt,a[2]=xt,a[3]=St,a[4]=At,a[5]=vt,a[6]=bt,a[7]=Mt,a[8]=Et,a[9]=wt,a[10]=Tt,a[11]=kt,a[12]=Ct,a[13]=Rt,a[14]=It,a[15]=Ft,a[16]=Dt,a[17]=Lt,a[18]=Pt,0!==l&&(a[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,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.P$()}function y(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.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):y(this,t,e)},r.prototype.mul=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},r.prototype.mulf=function(t){var e=new r(null);return e.words=new Array(this.length+t.length),y(this,t,e)},r.prototype.imul=function(t){return this.clone().mulTo(t,this)},r.prototype.imuln=function(t){var e=t<0;e&&(t=-t),i("number"==typeof t),i(t<67108864);for(var s=0,r=0;r>=26,s+=n/67108864|0,s+=o>>>26,this.words[r]=67108863&o}return 0!==s&&(this.words[r]=s,this.length++),e?this.ineg():this},r.prototype.muln=function(t){return this.clone().imuln(t)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),i=0;i>>r&1}return e}(t);if(0===e.length)return new r(1);for(var i=this,s=0;s=0);var e,s=t%26,r=(t-s)/26,n=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!==r){for(e=this.length-1;e>=0;e--)this.words[e+r]=this.words[e];for(e=0;e=0),r=e?(e-e%26)/26:0;var n=t%26,o=Math.min((t-n)/26,this.length),h=67108863^67108863>>>n<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=r);l--){var c=0|this.words[l];this.words[l]=u<<26-n|c>>>n,u=c&h}return a&&0!==u&&(a.words[a.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.P$()},r.prototype.ishrn=function(t,e,s){return i(0===this.negative),this.iushrn(t,e,s)},r.prototype.shln=function(t){return this.clone().ishln(t)},r.prototype.ushln=function(t){return this.clone().iushln(t)},r.prototype.shrn=function(t){return this.clone().ishrn(t)},r.prototype.ushrn=function(t){return this.clone().iushrn(t)},r.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,s=(t-e)/26,r=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 r=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},r.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)-(a/67108864|0),this.words[r+s]=67108863&n}for(;r>26,this.words[r+s]=67108863&n;if(0===h)return this.P$();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.P$()},r.prototype.G$=function(t,e){var i=(this.length,t.length),s=this.clone(),n=t,o=0|n.words[n.length-1];0!=(i=26-this.V$(o))&&(n=n.ushln(i),s.iushln(i),o=0|n.words[n.length-1]);var h,a=s.length-n.length;if("mod"!==e){(h=new r(null)).length=a+1,h.words=new Array(h.length);for(var l=0;l=0;c--){var d=67108864*(0|s.words[n.length+c])+(0|s.words[n.length+c-1]);for(d=Math.min(d/o|0,67108863),s.N$(n,d,c);0!==s.negative;)d--,s.negative=0,s.N$(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.P$(),s.P$(),"div"!==e&&0!==i&&s.iushrn(i),{div:h||null,mod:s}},r.prototype.divmod=function(t,e,s){return i(!t.isZero()),this.isZero()?{div:new r(0),mod:new r(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,e),"mod"!==e&&(n=h.div.neg()),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),e),"mod"!==e&&(n=h.div.neg()),{div:n,mod:h.mod}):this.negative&t.negative?(h=this.neg().divmod(t.neg(),e),"div"!==e&&(o=h.mod.neg(),s&&0!==o.negative&&o.isub(t)),{div:h.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new r(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new r(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new r(this.modrn(t.words[0]))}:this.G$(t,e);var n,o,h},r.prototype.div=function(t){return this.divmod(t,"div",!1).div},r.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},r.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},r.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),r=t.andln(1),n=i.cmp(s);return n<0||1===r&&0===n?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},r.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(s*r+(0|this.words[n]))%t;return e?-r:r},r.prototype.modn=function(t){return this.modrn(t)},r.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var s=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*s;this.words[r]=n/t|0,s=n%t}return this.P$(),e?this.ineg():this},r.prototype.divn=function(t){return this.clone().idivn(t)},r.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 n=new r(1),o=new r(0),h=new r(0),a=new r(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;)(n.isOdd()||o.isOdd())&&(n.iadd(u),o.isub(c)),n.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;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.W$=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 n,o=new r(1),h=new r(0),a=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(a),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;)h.isOdd()&&h.iadd(a),h.iushrn(1);e.cmp(s)>=0?(e.isub(s),o.isub(h)):(s.isub(e),h.isub(o))}return(n=0===e.cmpn(1)?o:h).cmpn(0)<0&&n.iadd(t),n},r.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 r=e.cmp(i);if(r<0){var n=e;e=i,i=n}else if(0===r||0===i.cmpn(1))break;e.isub(i)}return i.iushln(s)},r.prototype.invm=function(t){return this.egcd(t).a.umod(t)},r.prototype.isEven=function(){return!(1&this.words[0])},r.prototype.isOdd=function(){return!(1&~this.words[0])},r.prototype.andln=function(t){return this.words[0]&t},r.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,s=(t-e)/26,r=1<>>26,h&=67108863,this.words[o]=h}return 0!==n&&(this.words[o]=n,this.length++),this},r.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},r.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.P$(),this.length>1)e=1;else{s&&(t=-t),i(t<=67108863,"Number is too big");var r=0|this.words[0];e=r===t?0:rt.length)return 1;if(this.length=0;i--){var s=0|this.words[i],r=0|t.words[i];if(s!==r){sr&&(e=1);break}}return e},r.prototype.gtn=function(t){return 1===this.cmpn(t)},r.prototype.gt=function(t){return 1===this.cmp(t)},r.prototype.gten=function(t){return this.cmpn(t)>=0},r.prototype.gte=function(t){return this.cmp(t)>=0},r.prototype.ltn=function(t){return-1===this.cmpn(t)},r.prototype.lt=function(t){return-1===this.cmp(t)},r.prototype.lten=function(t){return this.cmpn(t)<=0},r.prototype.lte=function(t){return this.cmp(t)<=0},r.prototype.eqn=function(t){return 0===this.cmpn(t)},r.prototype.eq=function(t){return 0===this.cmp(t)},r.red=function(t){return new M(t)},r.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).U$(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.U$=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.U$(t)},r.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},r.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},r.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},r.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},r.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},r.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.Y$(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.Y$(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.H$(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.H$(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.H$(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.H$(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.H$(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.H$(this),this.red.pow(this,t)};var p={k256:null,p224:null,p192:null,p25519:null};function x(t,e){this.name=t,this.p=new r(e,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this.$$()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=r.X$(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 E(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new r(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r.W$(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)}x.prototype.$$=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},x.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.P$(),i},x.prototype.split=function(t,e){t.iushrn(this.n,0,e)},x.prototype.imulK=function(t){return t.imul(this.k)},s(S,x),S.prototype.split=function(t,e){for(var i=4194303,s=Math.min(t.length,9),r=0;r>>22,n=o}n>>>=22,t.words[r-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},S.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]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.X$=function(t){if(p[t])return p[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new A;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return p[t]=e,e},M.prototype.H$=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype.Y$=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).U$(this):(a(t,t.umod(this.m).U$(this)),t)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).U$(this)},M.prototype.add=function(t,e){this.Y$(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.U$(this)},M.prototype.iadd=function(t,e){this.Y$(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.Y$(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.U$(this)},M.prototype.isub=function(t,e){this.Y$(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.H$(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this.Y$(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this.Y$(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 r(1)).iushrn(2);return this.pow(t,s)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var h=new r(1).toRed(this),a=h.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new r(2*u*u).toRed(this);0!==this.pow(u,l).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),g=o;0!==f.cmp(h);){for(var m=f,y=0;0!==m.cmp(h);y++)m=m.redSqr();i(y=0;s--){for(var l=e.words[s],u=a-1;u>=0;u--){var c=l>>u&1;n!==i[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4==++h||0===s&&0===u)&&(n=this.mul(n,i[o]),h=0,o=0)):h=0}a=26}return n},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},r.mont=function(t){return new E(t)},s(E,M),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.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),r=i.isub(s).iushrn(this.shift),n=r;return r.cmp(this.m)>=0?n=r.isub(this.m):r.cmpn(0)<0&&(n=r.iadd(this.m)),n.U$(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).U$(this);var i=t.mul(e),s=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=i.isub(s).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o.U$(this)},E.prototype.invm=function(t){return this.imod(t.W$(this.m).mul(this.r2)).U$(this)}}(0,vp);var Mp=bp.exports;function Ep(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];const i=[];if("string"!=typeof t){for(let e=0;e>8,n=255&s;r?i.push(r,n):i.push(n)}return i}const wp=function(t,e,i){const s=new Array(Math.max(t.bitLength(),i)+1);s.fill(0);const r=1<(r>>1)-1?(r>>1)-i:i,n.isubn(e)):e=0,s[t]=e,n.iushrn(1)}return s},Tp=function(t,e){const i=[[],[]];t=t.clone(),e=e.clone();let s=0,r=0;for(;t.cmpn(-s)>0||e.cmpn(-r)>0;){let n,o,h=t.andln(3)+s&3,a=e.andln(3)+r&3;if(3===h&&(h=-1),3===a&&(a=-1),1&h){const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}else n=0;if(i[0].push(n),1&a){const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}else o=0;i[1].push(o),2*s===n+1&&(s=1-s),2*r===o+1&&(r=1-r),t.iushrn(1),e.iushrn(1)}return i};class kp{constructor(t,e){this.type=t,this.p=new Mp(e.p,16),this.red=e.prime?Mp.red(e.prime):Mp.mont(this.p),this.zero=new Mp(0).toRed(this.red),this.one=new Mp(1).toRed(this.red),this.two=new Mp(2).toRed(this.red),this.n=e.n&&new Mp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.j$=new Array(4),this.Z$=new Array(4),this.Q$=new Array(4),this.J$=new Array(4),this.K$=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.q$=!0,this.redN=this.n.toRed(this.red))}tX(t,e){const i=t.iX(),s=wp(e,1,this.K$);let r=(1<=t;r--)e=(e<<1)+s[r];n.push(e)}let o=this.jpoint(null,null,null),h=this.jpoint(null,null,null);for(let t=r;t>0;t--){for(let e=0;e=0;i--){for(let t=0;i>=0&&0===n[i];i--)t++;if(i>=0&&e++,o=o.dblp(e),i<0)break;const s=n[i];o="affine"===t.type?s>0?o.mixedAdd(r[s-1>>1]):o.mixedAdd(r[-s-1>>1].neg()):s>0?o.add(r[s-1>>1]):o.add(r[-s-1>>1].neg())}return"affine"===t.type?o.toP():o}hX(t,e,i,s,r){const n=this.j$,o=this.Z$,h=this.Q$;let a=0;for(let i=0;i=1;t-=2){const s=t-1,r=t;if(1!==n[s]||1!==n[r]){h[s]=wp(i[s],n[s],this.K$),h[r]=wp(i[r],n[r],this.K$),a=Math.max(h[s].length,a),a=Math.max(h[r].length,a);continue}const l=[e[s],null,null,e[r]];0===e[s].y.cmp(e[r].y)?(l[1]=e[s].add(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg())):0===e[s].y.cmp(e[r].y.redNeg())?(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].add(e[r].neg())):(l[1]=e[s].toJ().mixedAdd(e[r]),l[2]=e[s].toJ().mixedAdd(e[r].neg()));const u=[-3,-1,-5,-7,0,7,5,1,3],c=Tp(i[s],i[r]);a=Math.max(c[0].length,a),h[s]=new Array(a),h[r]=new Array(a);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)}iX(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;const i=[this];let s=this;for(let r=0;r({a:new Mp(t.a,16),b:new Mp(t.b,16)}))):this.dX(i),{beta:e,lambda:i,basis:s}}cX(t){const e=t===this.p?this.red:Mp.mont(t),i=new Mp(2).toRed(e).redInvm(),s=i.redNeg(),r=new Mp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}dX(t){const e=this.n.ushrn(Math.floor(this.n.bitLength()/2));let i,s,r,n,o,h,a,l,u,c=t,d=this.n.clone(),f=new Mp(1),g=new Mp(0),m=new Mp(0),y=new Mp(1),p=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=y.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++p)break;a=l,d=c,c=l,m=f,f=u,y=g,g=o}o=l.neg(),h=u;const x=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(x)>=0&&(o=i,h=s),r.negative&&(r=r.neg(),n=n.neg()),o.negative&&(o=o.neg(),h=h.neg()),[{a:r,b:n},{a:o,b:h}]}fX(t){const e=this.endo.basis,i=e[0],s=e[1],r=s.b.mul(t).divRound(this.n),n=i.b.neg().mul(t).divRound(this.n),o=r.mul(i.a),h=n.mul(s.a),a=r.mul(i.b),l=n.mul(s.b);return{k1:t.sub(o).sub(h),k2:a.add(l).neg()}}point(t,e,i){return new Ip(this,t,e,i)}pointFromX(t,e){(t=new Mp(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 r=s.fromRed().isOdd();return(e&&!r||!e&&r)&&(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),r=e.redSqr().redMul(e).redIAdd(s).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)}AX(t,e,i){const s=this.lX,r=this.uX;let n=0;for(n=0;n":``}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(),r=i.redAdd(i).redIAdd(i).redIAdd(e).redMul(s),n=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,o)}getX(){return this.x.fromRed()}getY(){return this.y.fromRed()}mul(t){return t=new Mp(t,16),this.isInfinity()?this:this.oX(t)?this.curve.tX(this,t):this.curve.endo?this.curve.AX([this],[t]):this.curve.sX(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AX(s,r):this.curve.hX(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AX(s,r,!0):this.curve.hX(1,s,r,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 Fp extends Cp{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 Mp(0)):(this.x=new Mp(e,16),this.y=new Mp(i,16),this.z=new Mp(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 Fp(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),r=t.x.redMul(i),n=this.y.redMul(e.redMul(t.z)),o=t.y.redMul(i.redMul(this.z)),h=s.redSub(r),a=n.redSub(o);if(0===h.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const l=h.redSqr(),u=l.redMul(h),c=s.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),f=a.redMul(c.redISub(d)).redISub(n.redMul(u)),g=this.z.redMul(t.z).redMul(h);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),r=this.y,n=t.y.redMul(e).redMul(this.z),o=i.redSub(s),h=r.redSub(n);if(0===o.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();const a=o.redSqr(),l=a.redMul(o),u=i.redMul(a),c=h.redSqr().redIAdd(l).redISub(u).redISub(u),d=h.redMul(u.redISub(c)).redISub(r.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(r),0===this.x.cmp(i))return!0}}inspect(){return this.isInfinity()?"":``}isInfinity(){return 0===this.z.cmpn(0)}}class Dp{constructor(t){this.curve=new Rp(t),this.g=this.curve.g,this.n=this.curve.n}}const Lp={};var Pp;Lp.PresetCurve=Dp,Pp={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(Lp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Dp(Pp);return Object.defineProperty(Lp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class _p{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.yX(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof _p?e:new _p(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}yX(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 Vp(t,e){const i=t[e.place++];if(!(128&i))return i;const s=15&i;if(0===s||s>4)return!1;let r=0,n=e.place;for(let e=0;e>>=0;return!(r<=127)&&(e.place=n,r)}class Bp{constructor(){this.place=0}}class zp{constructor(t,e){if(t instanceof zp)return t;this.SX(t,e)||(this.r=new Mp(t.r,16),this.s=new Mp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}SX(t,e){t=Ep(t,e);const i=new Bp;if(48!==t[i.place++])return!1;const s=Vp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Vp(t,i);if(!1===r)return!1;let n=t.slice(i.place,r+i.place);if(i.place+=r,2!==t[i.place++])return!1;const o=Vp(t,i);if(!1===o)return!1;if(t.length!==o+i.place)return!1;let h=t.slice(i.place,o+i.place);if(0===n[0]){if(!(128&n[1]))return!1;n=n.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new Mp(n),this.s=new Mp(h),this.recoveryParam=null,!0}}class Np{constructor(t){if(!(this instanceof Np))return new Np(t);"string"==typeof t&&(t=Lp[t]),t instanceof Lp.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 _p.fromPublic(this,t,e)}vX(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.vX(new Mp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new zp(e,"hex")).r,n=e.s;if(r.cmpn(1)<0||r.cmp(this.n)>=0)return!1;if(n.cmpn(1)<0||n.cmp(this.n)>=0)return!1;const o=n.invm(this.n),h=o.mul(t).umod(this.n),a=o.mul(r).umod(this.n);if(!this.curve.q$){const t=this.g.mulAdd(h,i.getPublic(),a);return!t.isInfinity()&&0===t.getX().umod(this.n).cmp(r)}const l=this.g.jmulAdd(h,i.getPublic(),a);return!l.isInfinity()&&l.eqXToP(r)}}var Op,Up={exports:{}};Up.exports=(Op=Op||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!==vp&&vp.crypto&&(i=vp.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.")},r=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),n={},o=n.lib={},h=o.Base={extend:function(t){var e=r(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)}},a=o.WordArray=h.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,r=t.sigBytes;if(this.clamp(),s%4)for(var n=0;n>>2]>>>24-n%4*8&255;e[s+n>>>2]|=o<<24-(s+n)%4*8}else for(var h=0;h>>2]=i[h>>>2];return this.sigBytes+=r,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=h.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-r%4*8&255;s.push((n>>>4).toString(16)),s.push((15&n).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 a.init(i,e/2)}},c=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,s=[],r=0;r>>2]>>>24-r%4*8&255;s.push(String.fromCharCode(n))}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 a.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=h.extend({reset:function(){this.Kw=new a.init,this.xX=0},bX:function(t){"string"==typeof t&&(t=d.parse(t)),this.Kw.concat(t),this.xX+=t.sigBytes},MX:function(e){var i,s=this.Kw,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this._X,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,y=l[f-2],p=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;l[f]=m+l[f-7]+p+l[f-16]}var x=s&r^s&n^r&n,S=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),A=d+((h<<26|h>>>6)^(h<<21|h>>>11)^(h<<7|h>>>25))+(h&u^~h&c)+a[f]+l[f];d=c,c=u,u=h,h=o+A|0,o=n,n=r,r=s,s=A+(S+x)|0}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0,i[5]=i[5]+u|0,i[6]=i[6]+c|0,i[7]=i[7]+d|0},kX:function(){var t=this.Kw,i=t.words,s=8*this.xX,r=8*t.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=e.floor(s/4294967296),i[15+(r+64>>>9<<4)]=s,t.sigBytes=4*i.length,this.MX(),this.IX},clone:function(){var t=n.clone.call(this);return t.IX=this.IX.clone(),t}});i.SHA256=n.TX(u),i.HmacSHA256=n.FX(u)}(Math),t.SHA256}(Up.exports),Wp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({CX:function(){this.IX=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},kX:function(){var t=r.kX.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.TX(n),e.HmacSHA224=r.FX(n),t.SHA224;var e,i,s,r,n}(Up.exports),jp={exports:{}}.exports=Up.exports.enc.Hex,$p={exports:{}}.exports=Up.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.PX;t.clamp();for(var r=[],n=0;n>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,h=0;h<4&&n+.75*h>>6*(3-h)&63));var a=s.charAt(64);if(a)for(;r.length%4;)r.push(a);return r.join("")},parse:function(t){var e=t.length,s=this.PX,r=this.DX;if(!r){r=this.DX=[];for(var n=0;n>>6-o%4*2;r[n>>>2]|=h<<24-n%4*8,n++}return i.create(r,n)}(t,e,r)},PX:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Up.exports),function(t){(function(e){var i=t,s=i.lib,r=s.WordArray,n=s.Hasher,o=i.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var a=o.MD5=n.extend({CX:function(){this.IX=new r.init([1732584193,4023233417,2562383102,271733878])},wX:function(t,e){for(var i=0;i<16;i++){var s=e+i,r=t[s];t[s]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var n=this.IX.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],y=t[e+5],p=t[e+6],x=t[e+7],S=t[e+8],A=t[e+9],v=t[e+10],b=t[e+11],M=t[e+12],E=t[e+13],w=t[e+14],T=t[e+15],k=n[0],C=n[1],R=n[2],I=n[3];k=l(k,C,R,I,o,7,h[0]),I=l(I,k,C,R,a,12,h[1]),R=l(R,I,k,C,f,17,h[2]),C=l(C,R,I,k,g,22,h[3]),k=l(k,C,R,I,m,7,h[4]),I=l(I,k,C,R,y,12,h[5]),R=l(R,I,k,C,p,17,h[6]),C=l(C,R,I,k,x,22,h[7]),k=l(k,C,R,I,S,7,h[8]),I=l(I,k,C,R,A,12,h[9]),R=l(R,I,k,C,v,17,h[10]),C=l(C,R,I,k,b,22,h[11]),k=l(k,C,R,I,M,7,h[12]),I=l(I,k,C,R,E,12,h[13]),R=l(R,I,k,C,w,17,h[14]),k=u(k,C=l(C,R,I,k,T,22,h[15]),R,I,a,5,h[16]),I=u(I,k,C,R,p,9,h[17]),R=u(R,I,k,C,b,14,h[18]),C=u(C,R,I,k,o,20,h[19]),k=u(k,C,R,I,y,5,h[20]),I=u(I,k,C,R,v,9,h[21]),R=u(R,I,k,C,T,14,h[22]),C=u(C,R,I,k,m,20,h[23]),k=u(k,C,R,I,A,5,h[24]),I=u(I,k,C,R,w,9,h[25]),R=u(R,I,k,C,g,14,h[26]),C=u(C,R,I,k,S,20,h[27]),k=u(k,C,R,I,E,5,h[28]),I=u(I,k,C,R,f,9,h[29]),R=u(R,I,k,C,x,14,h[30]),k=c(k,C=u(C,R,I,k,M,20,h[31]),R,I,y,4,h[32]),I=c(I,k,C,R,S,11,h[33]),R=c(R,I,k,C,b,16,h[34]),C=c(C,R,I,k,w,23,h[35]),k=c(k,C,R,I,a,4,h[36]),I=c(I,k,C,R,m,11,h[37]),R=c(R,I,k,C,x,16,h[38]),C=c(C,R,I,k,v,23,h[39]),k=c(k,C,R,I,E,4,h[40]),I=c(I,k,C,R,o,11,h[41]),R=c(R,I,k,C,g,16,h[42]),C=c(C,R,I,k,p,23,h[43]),k=c(k,C,R,I,A,4,h[44]),I=c(I,k,C,R,M,11,h[45]),R=c(R,I,k,C,T,16,h[46]),k=d(k,C=c(C,R,I,k,f,23,h[47]),R,I,o,6,h[48]),I=d(I,k,C,R,x,10,h[49]),R=d(R,I,k,C,w,15,h[50]),C=d(C,R,I,k,y,21,h[51]),k=d(k,C,R,I,M,6,h[52]),I=d(I,k,C,R,g,10,h[53]),R=d(R,I,k,C,v,15,h[54]),C=d(C,R,I,k,a,21,h[55]),k=d(k,C,R,I,S,6,h[56]),I=d(I,k,C,R,T,10,h[57]),R=d(R,I,k,C,p,15,h[58]),C=d(C,R,I,k,E,21,h[59]),k=d(k,C,R,I,m,6,h[60]),I=d(I,k,C,R,b,10,h[61]),R=d(R,I,k,C,f,15,h[62]),C=d(C,R,I,k,A,21,h[63]),n[0]=n[0]+k|0,n[1]=n[1]+C|0,n[2]=n[2]+R|0,n[3]=n[3]+I|0},kX:function(){var t=this.Kw,i=t.words,s=8*this.xX,r=8*t.sigBytes;i[r>>>5]|=128<<24-r%32;var n=e.floor(s/4294967296),o=s;i[15+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(i.length+1),this.MX();for(var h=this.IX,a=h.words,l=0;l<4;l++){var u=a[l];a[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return h},clone:function(){var t=n.clone.call(this);return t.IX=this.IX.clone(),t}});function l(t,e,i,s,r,n,o){var h=t+(e&i|~e&s)+r+o;return(h<>>32-n)+e}function u(t,e,i,s,r,n,o){var h=t+(e&s|i&~s)+r+o;return(h<>>32-n)+e}function c(t,e,i,s,r,n,o){var h=t+(e^i^s)+r+o;return(h<>>32-n)+e}function d(t,e,i,s,r,n,o){var h=t+(i^(e|~s))+r+o;return(h<>>32-n)+e}i.MD5=n.TX(a),i.HmacMD5=n.FX(a)})(Math),t.MD5}(Up.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({CX:function(){this.IX=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},wX:function(t,e){for(var i=this.IX.words,s=i[0],r=i[1],n=i[2],h=i[3],a=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)+a+o[l];c+=l<20?1518500249+(r&n|~r&h):l<40?1859775393+(r^n^h):l<60?(r&n|r&h|n&h)-1894007588:(r^n^h)-899497514,a=h,h=n,n=r<<30|r>>>2,r=s,s=c}i[0]=i[0]+s|0,i[1]=i[1]+r|0,i[2]=i[2]+n|0,i[3]=i[3]+h|0,i[4]=i[4]+a|0},kX:function(){var t=this.Kw,e=t.words,i=8*this.xX,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.MX(),this.IX},clone:function(){var t=r.clone.call(this);return t.IX=this.IX.clone(),t}}),e.SHA1=r.TX(h),e.HmacSHA1=r.FX(h),t.SHA1;var e,i,s,r,n,o,h}(Up.exports),Yp=(Gp=Up.exports).lib.Base,Hp=Gp.enc.Utf8,Gp.algo.HMAC=Yp.extend({init:function(t,e){t=this.BX=new t.init,"string"==typeof e&&(e=Hp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.LX=e.clone(),n=this.RX=e.clone(),o=r.words,h=n.words,a=0;a>>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.VX==this.EX?t=s.createEncryptor:(t=s.createDecryptor,this._X=1),this.UX&&this.UX.YX==t?this.UX.init(this,i&&i.words):(this.UX=t.call(s,this,i&&i.words),this.UX.YX=t)},wX:function(t,e){this.UX.processBlock(t,e)},kX:function(){var t,e=this.cfg.padding;return this.VX==this.EX?(e.pad(this.Kw,this.blockSize),t=this.MX(!0)):(t=this.MX(!0),e.unpad(t)),t},blockSize:4});var m=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?n.create([1398893684,1701076831]).concat(i).concat(e):e).toString(a)},parse:function(t){var e,i=a.parse(t),s=i.words;return 1398893684==s[0]&&1701076831==s[1]&&(e=n.create(s.slice(2,4)),s.splice(0,4),i.sigBytes-=16),m.create({ciphertext:i,salt:e})}},p=s.SerializableCipher=r.extend({cfg:r.extend({format:y}),encrypt:function(t,e,i,s){s=this.cfg.extend(s);var r=t.createEncryptor(i,s),n=r.finalize(e),o=r.cfg;return m.create({ciphertext:n,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.HX(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},HX:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=(i.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=n.random(8));var r=l.create({keySize:e+i}).compute(t,s),o=n.create(r.words.slice(e),4*i);return r.sigBytes=4*e,m.create({key:r,iv:o,salt:s})}},S=s.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:x}),encrypt:function(t,e,i,s){var r=(s=this.cfg.extend(s)).kdf.execute(i,t.keySize,t.ivSize);s.iv=r.iv;var n=p.encrypt.call(this,t,e,r.key,s);return n.mixIn(r),n},decrypt:function(t,e,i,s){s=this.cfg.extend(s),e=this.HX(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,p.decrypt.call(this,t,e,r.key,s)}})}()}(Up.exports);var Zp={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],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,r[i]=g,n[g]=i;var m=t[i],y=t[m],p=t[y],x=257*t[g]^16843008*g;o[i]=x<<24|x>>>8,h[i]=x<<16|x>>>16,a[i]=x<<8|x>>>24,l[i]=x,x=16843009*p^65537*y^257*m^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=m^t[t[t[p^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({CX:function(){if(!this.$X||this.XX!==this.OX){for(var t=this.XX=this.OX,e=t.words,i=t.sigBytes/4,s=4*((this.$X=i+6)+1),n=this.jX=[],o=0;o6&&o%i==4&&(l=r[l>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l]):(l=r[(l=l<<8|l>>>24)>>>24]<<24|r[l>>>16&255]<<16|r[l>>>8&255]<<8|r[255&l],l^=g[o/i|0]<<24),n[o]=n[o-i]^l);for(var h=this.ZX=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.QX(t,e,this.jX,o,h,a,l,r)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this.QX(t,e,this.ZX,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},QX:function(t,e,i,s,r,n,o,h){for(var a=this.$X,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]^r[u>>>16&255]^n[c>>>8&255]^o[255&d]^i[f++],y=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],p=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],x=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=m,u=y,c=p,d=x}m=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],y=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],p=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],x=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=m,t[e+1]=y,t[e+2]=p,t[e+3]=x},keySize:8});e.AES=i.TX(m)}(),t.AES}(Up.exports),Kp={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.NX,s=i.blockSize,r=this.GX,n=this.JX;r&&(n=this.JX=r.slice(0),this.GX=void 0);var o=n.slice(0);i.encryptBlock(o,0),n[s-1]=n[s-1]+1|0;for(var h=0;h>>2]|=t[r]<<24-r%4*8;i.call(this,s,e)}else i.apply(this,arguments)};s.prototype=e}}(),t.lib.WordArray}(Up.exports),qp={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Up.exports);const Qp={"-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==","VHJlZQ=="],1:["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2FuZGJveA=="]},tx=bt,ex=(...t)=>t.slice(1).reduce(((e,i)=>e+tx.atob(Qp[t[0]][i].toString())),"");let ix,sx,rx,nx=new Uint8Array([]);class ox{set e(t){ix=t}get e(){sx={tf:!1,if:!1,sf:!1,ef:!1,hf:!1,rf:!1,nf:!1,af:!1,lf:!1,uf:!1,cf:!1,df:!1,ff:!1,Af:!1,gf:!1,pf:!1,mf:!1,yf:!1,Sf:!1,vf:!1,xf:!1,bf:!1,Mf:!1,_f:!1};const t=nx.length,e=t>=1?nx[0]:void 0,i=t>=2?nx[1]:void 0,s=t>=3?nx[2]:void 0;return void 0!==e&&(sx.tf=!!(1&e),sx.if=!!(2&e),sx.sf=!!(4&e),sx.ef=!!(8&e),sx.hf=!!(16&e),sx.rf=!!(32&e),sx.nf=!!(64&e),sx.af=!!(128&e)),void 0!==i&&(sx.lf=!!(1&i),sx.uf=!!(2&i),sx.cf=!!(4&i),sx.df=!!(8&i),sx.ff=!!(16&i),sx.Af=!!(32&i),sx.gf=!!(64&i),sx.pf=!!(128&i)),void 0!==s&&(sx.mf=!!(1&s),sx.yf=!!(2&s),sx.Sf=!!(4&s),sx.vf=!!(8&s),sx.xf=!!(16&s),sx.bf=!!(32&s),sx.Mf=!!(64&s),sx._f=!!(128&s)),sx.rf}set l(t){rx=t}get l(){return rx}}let hx=!1;const ax=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},lx=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")}`},ux=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),cx=t=>{const e={},i=t.split("-");if(3!==i.length)return{KX:ex(0,0,1,7,1,12,5)};let s=0;const r=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(0)));s+=1;const n=r.subarray(s,s+=20),o=new DataView(r.buffer).getUint16(s,!0);s+=2;const h=Uint8Array.from(Array(o));for(let t=0;tt+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");return gx(d,f)?e:{KX:ex(0,0,1,7,1,12,5)}},dx=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(ax(i,2)),e=t.slice(36,40),s=new Uint8Array(4),r=(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,r,!0);const n=t.slice(28,34);let o=0;for(let t=n.length-1;t>0;t-=1)o+=n[t]*2**(8*t);const h=new Date(o);if(ux(h)s[e]===t)))return{};break}case"0002":return cx(t);default:return{KX:ex(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}return{KX:ex(0,0,1,2,1,7,1,12,5)}},fx=t=>{if(!t)return{KX:ex(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5)};const e=(t[ex(-1,9)]||t[ex(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(tx[ex(-1,6)][ex(-1,7)])>-1)return{sj:!0};const i=e.filter((t=>t.indexOf("*")>-1));if(Sx(tx[ex(-1,6)][ex(-1,7)],i))return{sj:!0};const s=t[ex(-1,8)]||t[ex(-1,38)];if(""!==s&&null!=s){if(Sx(tx[ex(-1,6)][ex(-1,7)],[s]))return{sj:!1};if(s===tx[ex(-1,6)][ex(-1,7)])return{sj:!1}}return{KX:ex(0,14,1,20,5)}},gx=(t,e)=>{const i=new Np("secp256k1").keyFromPublic(ex(-4,0),"hex"),s=Wp(t).toString();return i.verify(s,e)},mx=t=>{switch(t.slice(0,4)){case"0001":return(t=>{let e,i="";try{const e=t.split("-"),s=e[1],r=e[2],n=e[3];if(!gx(r,n))return{KX:ex(0,21,1,2,1,7,1,12,5)};const o=jp.parse(r);i=Zp.decrypt({ciphertext:jp.parse(s)},o,{mode:Kp,padding:qp,iv:jp.parse("00000000000000000000000000000001")}).toString($p)}catch(t){return{KX:ex(0,21,1,2,1,7,1,12,5)}}try{e=JSON.parse(i)}catch(t){return{KX:ex(0,21,1,2,1,7,1,12,5)}}if(void 0===e[ex(-1,5)]||null===e[ex(-1,4)]||!e[ex(-1,9)])return{KX:ex(0,21,1,2,1,7,1,12,5)};const s=parseInt(ex(-3,0),10)||Number(parseInt(ex(-3,0),10));return e[ex(-1,5)]{const e=cx(t),i=e.qX,s=e.ij;if(e.KX||void 0===i||void 0===s)return e;let r,n="";try{const t=i.slice(e.ij,s+16),r=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{KX:ex(0,39,1,40,1,41,5)};const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!gx(`${s}-${r}`,n))return{KX:ex(0,21,1,2,1,7,1,12,5)};const o=Uint8Array.from(ax(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(ex(-3,0),10)||Number(parseInt(ex(-3,0),10))))return{KX:ex(0,21,1,2,1,3,1,4,5)};const a=Int32Array.from(ax(s,8)),l=Xp(e[ex(-1,31)]).toString(jp),u=Int32Array.from(ax(l,8)),c=Xp(e[ex(-1,32)]).toString(jp),d=Int32Array.from(ax(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t))?{}:{KX:ex(0,21,1,2,1,7,1,12,5)}})(t,e);case"0002":return((t,e)=>{if(!e)return{KX:ex(0,39,1,40,1,41,5)};const i=cx(t),s=i.qX,r=i.ij;if(i.KX||void 0===s||void 0===r)return i;const n=s.slice(r,s.length),o=new DataView(n.buffer),h=new Int32Array(8);for(let t=0;td[e]===t))?{}:{KX:ex(0,21,1,2,1,7,1,12,5)}})(t,e);default:return{KX:ex(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5)}}},px=(t,e,i=!0,s)=>{hx=!1,e.eo();const r=e.Wr,n=!!r&&(r===bt.document.body||bt.document.body.contains(r)),o=r&&n?r:document.body;if(void 0===Array.from(o.children).find((t=>"lcjs-error"===t.id))){const e=bt.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 r,n=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");if(n=(i?ex(0,0,1,2,1,23,1,24,25,1):"")+n.charAt(0).toUpperCase()+n.substr(1),s){const t=bt.document.createElement("a");t.href=s,r=t}else r=bt.document.createElement("p1");e.append(r),r.innerHTML=n,r.style.color="red"}},xx=(t,e,i)=>{e?(t[ex(-1,17)](ex(-1,19),i),t[ex(-1,17)](ex(-1,20),i),t[ex(-1,17)](ex(-1,21),i),t[ex(-1,17)](ex(-1,22),i)):(t[ex(-1,18)](ex(-1,19),i),t[ex(-1,18)](ex(-1,20),i),t[ex(-1,18)](ex(-1,21),i),t[ex(-1,18)](ex(-1,22),i))},Sx=(t,e)=>{const i=t.split(".").reverse();return e.some((t=>{const e=t.split(".").reverse();let s=!1;const r=e.findIndex((t=>"*"===t)),n=i.every(((t,i)=>{if(!s){if(!(i2,!s&&t!==e[i])return!1}return!0}));return!(r>i.length-1||!n)}))},Ax=new Map;e.Animation=Z,e.AnimationEasings=$,e.Animator=K,e.AreaRangeSeries=$u,e.AreaSeries=Uu,e.AreaSeriesBipolar=Gu,e.AreaSeriesMonopolar=Yu,e.AreaSeriesNegative=Hu,e.AreaSeriesPositive=Xu,e.AreaSeriesTypes=Wu,e.AutoCursor2DBuilder=ma,e.AutoCursorBuilders=_f,e.AutoCursorXYBuilder=nu,e.AutoFitStrategies=ha,e.AutoFitStrategy=ra,e.Axis=uh,e.Axis3D=ja,e.AxisScrollStrategies=zs,e.AxisTickStrategies=Ns,e.Band=Vs,e.BarChart=Ef,e.BarChartBar=vf,e.BarChartCategoryAxis=Sf,e.BarChartSorting=wf,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=Af,e.BasicSeries=vu,e.BorderedPicture=Dn,e.BoxFigure=tu,e.BoxSeries=wu,e.BoxSeries3D=tl,e.Button=zo,e.Chart=Qh,e.Chart3D=Sl,e.ChartComponent=Yi,e.ChartMarker=du,e.ChartMarker2D=class extends du{constructor(t,e,i,s,r,n){super(t,e,i,s.lm(t,e,i,n),r,n)}},e.ChartMarkerXY=gu,e.ChartWithSeries=al,e.ChartXY=Vc,e.Color=b,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return E(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 E(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,r=t/60,n=s*(1-Math.abs(r%2-1));let o=[];isNaN(t)?o=[0,0,0]:r<=1?o=[s,n,0]:r<=2?o=[n,s,0]:r<=3?o=[0,s,n]:r<=4?o=[0,n,s]:r<=5?o=[n,0,s]:r<=6&&(o=[s,0,n]);const h=i-.5*s;return[Math.round(255*(o[0]+h)),Math.round(255*(o[1]+h)),Math.round(255*(o[2]+h))]})(e[0],e[1],e[2]);return E(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?w(t):w((t=>{const e=C[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=T,e.ColorPalettes=Vn,e.ColorRGBA=E,e.ColorShadingStyles=Xn,e.ColorUint32=k,e.ConstantLine=Bs,e.CursorBuilder=ga,e.CursorBuilderXY=ru,e.CustomTick=An,e.Dashboard=Ff,e.DashedLine=qn,e.DataGrid=ff,e.DataPatternsNew=Dr,e.DataSetXY=no,e.DateTimeTickStrategy=Fh,e.EllipseFigure=Tu,e.EllipseSeries=ku,e.EmptyFill=B,e.EmptyUIElement=Rn,e.Figure=Ql,e.FigureSeries=Mu,e.FontSettings=rr,e.FormattingFunctions=Ii,e.FunnelChart=id,e.FunnelChartTypes=hd,e.FunnelChartWithLabelsInsideSlices=od,e.FunnelChartWithLabelsOnSides=nd,e.FunnelSlice=Jc,e.GaugeChart=ud,e.GaugeChartTypes=Wf,e.GaugeSlice=dd,e.GenericAxis=Js,e.GlowEffect=ro,e.HeatmapGridSeries=_u,e.HeatmapGridSeriesIntensityValues=Vu,e.HeatmapScrollingGridSeries=Bu,e.HeatmapScrollingGridSeriesIntensityValues=zu,e.Highlighter=Hi,e.Icon=eo,e.ImageFill=$n,e.IndividualPointFill=H,e.LUT=_,e.LegendBoxBuilders=sh,e.LineAndPointSeries3D=el,e.LineSeries=vc,e.LineSeries3D=il,e.LinearGradientFill=st,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new st({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Rl,e.MapRegions=Xf,e.MapRegionsAfrica=Vf,e.MapRegionsAsia=Bf,e.MapRegionsAustralia=zf,e.MapRegionsCanada=Nf,e.MapRegionsEurope=Of,e.MapRegionsNorthAmerica=Yf,e.MapRegionsSouthAmerica=Hf,e.MapRegionsUSA=Gf,e.MapRegionsWorld=Uf,e.MapTypes=bl,e.MarkerBuilders=Pf,e.MeshModel3D=xl,e.NumericTickStrategy=Nh,e.OHLCSeries=mc,e.OHLCSeriesBars=pc,e.OHLCSeriesCandlesticks=yc,e.OHLCSeriesTypes=xc,e.OnScreenMenu=Mc,e.OnScreenMenuAnimationsButton=vs,e.OnScreenMenuButton=fs,e.OnScreenMenuControlBase=Qi,e.OnScreenMenuCustomButton=Ms,e.OnScreenMenuOsmToggleButton=Es,e.OnScreenMenuToggleButton=gs,e.OnScreenMenuZoomInButton=ms,e.OnScreenMenuZoomInXButton=ys,e.OnScreenMenuZoomInYButton=ps,e.OnScreenMenuZoomOutButton=xs,e.OnScreenMenuZoomOutXButton=Ss,e.OnScreenMenuZoomOutYButton=As,e.OnScreenMenuZoomToFitButton=bs,e.PalettedFill=class extends W{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=Zh,e.PhongShadingStyle=Yn,e.Picture=Fn,e.PieChart=Ba,e.PieChartTypes=Ga,e.PieChartWithLabelsInsideSlices=Ua,e.PieChartWithLabelsOnSides=Oa,e.PieSlice=Da,e.PixelatedPoints3D=dr,e.PointCloudSeries3D=ol,e.PointLineAreaSeries=Ec,e.PointLineSeries=Qu,e.PointLineSeries3D=sl,e.PointSeries=bc,e.PointSeries3D=nl,e.PointSeriesTypes3D=hl,e.PointStyle3D=gr,e.PolarAreaSeries=Wc,e.PolarAreaSeriesInterior=jc,e.PolarAxis=Dl,e.PolarAxisAmplitude=Pl,e.PolarAxisTick=Ll,e.PolarChart=Zc,e.PolarHeatmapSeries=Zl,e.PolarLineSeries=Jl,e.PolarPointLineSeries=ql,e.PolarPointSeries=Yc,e.PolarPolygon=Hc,e.PolarPolygonSeries=Xc,e.PolarSector=Ul,e.PolarSeries=Yl,e.PolygonFigure=Cu,e.PolygonSeries=Ru,e.PyramidChart=vd,e.PyramidChartTypes=Td,e.PyramidChartWithLabelsInsideSlices=wd,e.PyramidChartWithLabelsOnSides=Ed,e.PyramidSlice=pd,e.RadialGauge=cd,e.RadialGradientFill=tt,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new tt({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Nu,e.RectangleFigure=Iu,e.RectangleSeries=Fu,e.SegmentFigure=Du,e.SegmentSeries=Lu,e.Series2D=Gl,e.Series3D=Qa,e.SeriesMarkerXY=mu,e.SeriesXY=yu,e.SimpleShadingStyle=Un,e.Slice=Ia,e.SliceLabelFormatters=Ca,e.SliceSorters=ka,e.SolidFill=G,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new G({color:s(t)})},e.SolidGauge=yd,e.SolidGaugeSlice=fd,e.SolidLine=Ji,e.SpiderAxis=Fd,e.SpiderChart=Ud,e.SpiderSeries=Ld,e.SplineSeries=ic,e.StaticCursor2DBuilder=ya,e.StaticCursorXYBuilder=ou,e.StepSeries=gc,e.StipplePatterns=Kn,e.SurfaceGridSeries3D=fl,e.SurfaceScrollingGridSeries3D=gl,e.TableContentBuilder=aa,e.Themes=gg,e.Tick=lh,e.TickStyle=mh,e.TimeFormattingFunctions=Gh,e.TimeTickStrategy=Hh,e.TreeMapChart=Qf,e.TriangulatedPoints3D=lr,e.UIBackgrounds=Lf,e.UICircle=yo,e.UIColumnGrid=class extends Mo{constructor(){super(...arguments),this.vd=[]}addColumn(){return this.addElement(Co,void 0)}getColumn(t,e=!1){return e&&this.vd.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.vd[t]}},e.UIDiamond=po,e.UIElementBuilders=ih,e.UIElementColumn=Eo,e.UIElementLine=bo,e.UIElementRow=Mo,e.UIElementWithBackground=xn,e.UIEmptyBackground=In,e.UILabel=fo,e.UILayoutBuilders=Al,e.UILayoutGap=vo,e.UILegendBoxPanel=vl,e.UIObject=fn,e.UIOrigins=Ts,e.UIPanel=Jh,e.UIPoint=So,e.UIPointer=xo,e.UIPolygon=Ln,e.UIRectangle=mo,e.UIRowGrid=To,e.VisibleFill=U,e.ZoomBandChart=Uc,e.defaultOsmBackgroundColor=Ps,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=z,e.emptyLine=ot,e.emptyPoints3D=hr,e.emptyTick=ph,e.formatLongitudeLatitude=Fl,e.formatNumberAsUnicodeSuperscript=Fi,e.isColor=M,e.isCoordinate3D=yl,e.isCoordinateBarChart=bf,e.isCoordinateClient=Ni,e.isCoordinatePolar=Ol,e.isCoordinateXY=Ui,e.isDashedLine=Qn,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=N,e.isEmptyTick=xh,e.isFontSettings=nr,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=io,e.isIndividualPointFill=X,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=rt,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=j,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=fr,e.isRadialGradientFill=et,e.isSeriesSupportedByZoomBandChart=t=>t instanceof vu||t instanceof Uu||t instanceof $u||t instanceof Vu||t instanceof mc||t instanceof gc||t instanceof Ec,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=Y,e.isSolidLine=qi,e.isTickStyle=yh,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=ur,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,n="object"==typeof t?t:void 0,o=new ox;o.e=i;let h=Ax.get(i||"E");return h||(h=((t,e)=>{let i,s,n=!1,o=!1,h=!1,a=!1,l="",u=!1,c=!1;try{if(ix){const s=(t=>{if(!ix)return;const e=ix.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){nx=new Uint8Array([2]);const e=(t=>{if(!ix)return;const e=ix.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();if(1===e){const t=mx(ix);h=!t.sj,i=t,n=!0}else 2===e?(i=yx(ix,t),o=!0):(hx=!0,i=dx(ix),a=!0)}else if("0002"===s){const e=(t=>{if(!ix)return;const e=ix.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)hx=!0,i=dx(ix),a=!0;else if(189===e){const t=mx(ix);h=!t.sj,i=t,n=!0}else 159===e?(i=yx(ix,t),o=!0):i={KX:ex(0,0,1,7,1,12,5)}}else if("T001"===s){const s=((t,e)=>{const i=ix.split("-");if(3!==i.length)return{KX:ex(0,0,1,7,1,12,5)};const s=`${i[1]}`,r=Array.prototype.reduce.call(atob(i[2]),((t,e)=>t+`0${e.charCodeAt(0).toString(16)}`.slice(-2)),"");if(!gx(s,r))return{KX:ex(0,0,1,7,1,12,5)};let n=0;const o=Uint8Array.from(atob(i[1]),(t=>t.charCodeAt(n))),h=o.subarray(n,n+=20),a=new DataView(o.buffer).getUint16(n,!0);n+=2;const l=Uint8Array.from(Array(a));for(let t=0;ty)return{KX:ex(0,0,1,2,1,3,1,4,5)};const p=u.getUint16(n,!0),x=l.subarray(n+=2,n+p);if(nx=new Uint8Array(x),e&&"dHJhZGVy"in e&&"dGVjaG5pY2FsIGFuYWx5c2lz"===e.dHJhZGVy)return{ej:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="};if(e&&"logoGraphic"in e&&e.logoGraphic){const t=e.logoGraphic.split("-");return 3===t.length&&gx(t[0],t[2])?{ej:t[0]}:{KX:ex(0,0,1,7,1,12,5)}}return{KX:ex(0,0,1,7,1,12,5)}})(0,t);i=s;const r=s.ej;r&&e?("string"==typeof r&&(e.l=r),n=!0):i={KX:ex(0,0,1,7,1,12,5)}}else i={KX:ex(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={KX:ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68),tj:ex(-2,2)}:window.location.host===tx.atob("c3RhY2tzbmlwcGV0cy5uZXQ=")?(c=!0,u=!1,nx=new Uint8Array([38]),i={}):(c=!0,u=!0,nx=new Uint8Array([38]),i={})}}catch(t){i={KX:ex(0,0,1,7,1,12,5)}}try{a&&(s=tx[ex(-1,34)][ex(-1,35)](ex(-1,39))||void 0)}catch(t){tx.console.error(t)}let d=!1;if(s){const t=s.split("-");if(2===t.length&&gx(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.KX||n||o||d),g=(()=>{const t=new(tx[ex(-1,0)]);return t.open(ex(0,26),ex(-2,0)),t.setRequestHeader(ex(-1,24),ex(-1,25)),t.withCredentials=!0,t})(),m=new r.Eventer;if(f){let t;try{t=parseInt(ix?ix.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="",r="",n="";ix=ix||"";const o=ex(-4,0);for(let t=0;t{const n=[],o={Gn:t=>{n.indexOf(t)>=0||(n.push(t),a())},Wn:t=>m.on("logoChange",t),Un:t=>m.off(t)},a=()=>{n.forEach((t=>{const e=d(t);if(!e)return;const{hj:i,rj:s}=e,r=s?ex(-2,1):void 0,n=`${ex(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${i}${r?ex(0,1,63,1,64,1,59,1,65,1,41):""}`;px(n,y,!1,r)}))},c=t=>t.toLowerCase().split("_").join(" "),d=t=>{var e;const i=null===(e=Object.entries(ah).find((e=>e[1]===t)))||void 0===e?void 0:e[0];if(i){switch(t){case ah.sf:return sx.tf||sx.sf?void 0:{hj:c(i),rj:!0};case ah.nf:return sx.tf||sx.nf?void 0:{hj:c(i),rj:!0};case ah.af:return sx.tf||sx.if||sx.af?void 0:{hj:c(i)};case ah.if:return sx.tf||sx.if?void 0:{hj:c(i)};case ah.ff:return sx.tf||sx.if||sx.ff?void 0:{hj:c(i)};case ah.pf:return sx.tf||sx.if||sx.pf?void 0:{hj:c(i)};case ah.vf:return sx.tf||sx.if||sx.vf?void 0:{hj:c(i)};case ah.bf:return sx.tf||sx.if||sx.bf?void 0:{hj:c(i)};case ah.Mf:return sx.tf||sx.if||sx.Mf?void 0:{hj:c(i)};case ah.xf:return sx.tf||sx.if||sx.xf?void 0:{hj:c(i)};case ah.uf:return sx.tf||sx.if||sx.uf?void 0:{hj:c(i)};case ah.gf:return sx.tf||sx.if||sx.gf?void 0:{hj:c(i)};case ah.df:return sx.tf||sx.if||sx.df?void 0:{hj:c(i)};case ah.mf:return sx.tf||sx.if||sx.mf?void 0:{hj:c(i)};case ah.Sf:return sx.tf||sx.if||sx.Sf?void 0:{hj:c(i)};case ah.yf:return sx.tf||sx.if||sx.yf?void 0:{hj:c(i)};case ah.lf:return sx.tf||sx.if||sx.lf?void 0:{hj:c(i)};case ah.cf:return sx.tf||sx.if||sx.cf?void 0:{hj:c(i)};case ah.Af:return sx.tf||sx.if||sx.Af?void 0:{hj:c(i)};case ah._f:return sx.tf||sx.if||sx._f?void 0:{hj:c(i)};case ah.tf:case ah.ef:case ah.rf:case ah.hf:return}return be(0,"")}},y=new Ap(r,t,o);(null==i?void 0:i.KX)&&px(i.KX,y,void 0,i.tj);const p=t=>{if("error"===(null==t?void 0:t.type)&&s){const t=s.split("-");if(2===t.length&&gx(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return hx=!1,void xx(g,!1,x)}}if(g.readyState===tx[ex(-1,0)].DONE)if(200===g.status){const t=JSON.parse(g[ex(-1,23)]);if(!gx(l+ex(-3,0),t.h)){const t=ex(0,0,1,27,1,28,1,29,1,30,1,31,5);px(t,y)}tx[ex(-1,34)][ex(-1,36)](ex(-1,39),t.t),tx[ex(-1,34)][ex(-1,36)](ex(-1,33),t.s),hx=!1}else{let e="";try{e=t&&"loadend"!==t.type?ex(0,0,1,23,1,32,1,24,5):JSON.parse(g[ex(-1,23)]).message,xx(g,!1,x)}catch(t){console.error(t)}px(ex(0,0,1,2,1,7,1,12,5)+e,y)}},x=t=>{p(t)};if(xx(g,!0,x),f?setTimeout((()=>{if(hx){let t=!0;if(s){const e=s.split("-");if(2===e.length&&gx(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&px(ex(0,25,1,23,1,32,1,24,5),y)}}),1e4):xx(g,!1,x),u){const t=(()=>{const t=new(tx[ex(-1,0)]);return t.open(ex(0,26),ex(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=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}if(t.readyState===tx.XMLHttpRequest.DONE){const s=t.getResponseHeader("X-LCJS-SANDBOX-V");if(200!==t.status||s&&"1"!==s){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}else{const s=JSON.parse(t.responseText);if(!gx(i,s.s)){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}void 0!==e&&(e.l=s.l),m.emit("logoChange",s.l)}}else{const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}},r=t=>{s(t)};xx(t,!0,r),t.send(i),setTimeout((()=>{if(t.readyState<2){const t=ex(0,0,1,2,1,43,1,66,5,1,63,1,64,1,46,1,67,1,68);px(t,y,!1,ex(-2,2)),xx(g,!1,r)}}),1e4)}return h?(t=>{let e;hx=!1;const i=t.ai(),s=()=>{e&&(t.Mn(e.bn()),e=void 0),e=t.II("deployment test"),e.Dr(t.ft).Eh(ex(0,34,1,33)).Ie({x:i.x/2,y:i.y/2}).ba(50).Gh(13).ke(new G({color:E(128,128,128,100)})).va("Arial")._a(500).setMouseInteractions(!1),t.Sn().vn()};t.ko((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.bn(){var r,n,o,h,a,l,u,c,d,f;let g;if(i&&i.license){const t=i.license.split("-");g=t[t.length-1]}const m=(null===(r=null==i?void 0:i.webgl)||void 0===r?void 0:r.version)||(null===(o=null===(n=null==i?void 0:i.sharedContextOptions)||void 0===n?void 0:n.webgl)||void 0===o?void 0:o.version),y={UE:null===(h=null==i?void 0:i.sharedContextOptions)||void 0===h?void 0:h.canvas,$n:null==i?void 0:i.warnings,tz:"webgl1"===m?1:"webgl2"===m?2:void 0,QE:!1!==(null===(a=null==i?void 0:i.sharedContextOptions)||void 0===a?void 0:a.antialias),ZE:(null===(l=null==i?void 0:i.sharedContextOptions)||void 0===l?void 0:l.devicePixelRatio)||void 0,lz:(null===(u=null==i?void 0:i.sharedContextOptions)||void 0===u?void 0:u.noCanvasStyles)||void 0,fz:(null===(c=null==i?void 0:i.sharedContextOptions)||void 0===c?void 0:c.noCanvasTransform)||void 0,KE:!1!==(null===(d=null==i?void 0:i.sharedContextOptions)||void 0===d?void 0:d.useStackingOrder),qE:!1!==(null===(f=null==i?void 0:i.sharedContextOptions)||void 0===f?void 0:f.useIndividualCanvas),uz:g||void 0},p=new mm(y),x=e=>t(e,p);return{Dashboard:ym(x,e,i,s),ChartXY:Sm(x,e,i,s),Spider:Am(x,e,i,s),Polar:vm(x,e,i,s),Pie:bm(x,e,i,s),UIPanel:xm(x,e,i,s),Gauge:Mm(x,e,i,s),Funnel:Em(x,e,i,s),Pyramid:wm(x,e,i,s),Chart3D:km(x,e,i,s),Map:Tm(x,e,i,s),DataGrid:Cm(x,e,i,s),BarChart:Rm(x,e,i,s),ZoomBandChart:Im(x,e,i,s),TreeMapChart:Fm(x,e,i,s),dispose:p.U.bind(p),layout:p.yz.bind(p)}})(h,o.e,n,o.l)},e.onScreenMenuControlBaseHeight=Rs,e.onScreenMenuControlBaseWidth=Is,e.onScreenMenuControlOpacity=Fs,e.onScreenMenuDefaultButtonShape=Ls,e.onScreenMenuSpriteURL=Ds,e.regularColorSteps=(t,e,i,s)=>{if(!i||0===i.length)throw new Error("Invalid use regularColorSteps 'colorPalette' is undefined or empty");const r=null==s?void 0:s.formatLabels,n=null==s?void 0:s.alpha;return i.map(((s,o)=>{const h=t+o/(i.length-1)*(e-t);return{color:void 0!==n?s.setA(n):s,value:h,label:r?r(h):void 0}}))},e.saveToFile=Xh,e.synchronizeAxisIntervals=gt,e.translatePoint=dt,e.translatePoint3D=ft,e.transparentFill=ks,e.transparentLine=Cs,e.uint32ColorFromObject=t=>F(255*t.r,255*t.g,255*t.b,255*t.a),e.uint32ColorFromRGBA=F,e.vec3Utils=De,e.xDimensionStrategy=ch,e.yDimensionStrategy=dh}}]); \ No newline at end of file diff --git a/resources/osm/osm-sprite-transparent.png b/resources/osm/osm-sprite-transparent.png index 8c85f62..c0bf780 100644 Binary files a/resources/osm/osm-sprite-transparent.png and b/resources/osm/osm-sprite-transparent.png differ diff --git a/resources/themes/LICENSE b/resources/themes/LICENSE index 665b9c2..9281f2c 100644 --- a/resources/themes/LICENSE +++ b/resources/themes/LICENSE @@ -1,19 +1,19 @@ -LightningChart®JS THEME ASSETS END USER LICENSE AGREEMENT - -By downloading, installing, copying or otherwise using LightningChart®JS, you are agreeing to be bound to the terms of this agreement. - -This license refers to the end user rights regarding all non-software assets distributed along side the LightningChart®JS library. - -Licensee may not: - -In no way use the assets outside of LightningChart®JS. -Redistribute, share, or sell the assets to anyone, neither for commercial or noncommercial purposes. -Expose or move the assets to a location where the licensee does not manage or can not affirm that these terms of use are not followed. -Edit, alter or in any way modify the assets for any purpose. -Separate the assets from this LICENSE file. - -The licensee may: - -Include the assets in their licensed LightningChart®JS application deployments along with this LICENSE file at the same root directory. -Privately host the assets as part of their licensed LightningChart®JS application deployment, in a way that only allows the application itself to access the assets. -Include the assets in their licensed LightningChart®JS product that is sold to a 3rd party, as long as this LICENSE is included in the same root directory. +LightningChart®JS THEME ASSETS END USER LICENSE AGREEMENT + +By downloading, installing, copying or otherwise using LightningChart®JS, you are agreeing to be bound to the terms of this agreement. + +This license refers to the end user rights regarding all non-software assets distributed along side the LightningChart®JS library. + +Licensee may not: + +In no way use the assets outside of LightningChart®JS. +Redistribute, share, or sell the assets to anyone, neither for commercial or noncommercial purposes. +Expose or move the assets to a location where the licensee does not manage or can not affirm that these terms of use are not followed. +Edit, alter or in any way modify the assets for any purpose. +Separate the assets from this LICENSE file. + +The licensee may: + +Include the assets in their licensed LightningChart®JS application deployments along with this LICENSE file at the same root directory. +Privately host the assets as part of their licensed LightningChart®JS application deployment, in a way that only allows the application itself to access the assets. +Include the assets in their licensed LightningChart®JS product that is sold to a 3rd party, as long as this LICENSE is included in the same root directory. diff --git a/resources/themes/cyberSpace.jpg b/resources/themes/cyberSpace.jpg index 2b81b78..289365f 100644 Binary files a/resources/themes/cyberSpace.jpg and b/resources/themes/cyberSpace.jpg differ diff --git a/resources/themes/turquoiseHexagon.jpg b/resources/themes/turquoiseHexagon.jpg index 88dab58..d0b0620 100644 Binary files a/resources/themes/turquoiseHexagon.jpg and b/resources/themes/turquoiseHexagon.jpg differ diff --git a/resources/zoomBandChart/cyberspace-selector.png b/resources/zoomBandChart/cyberspace-selector.png index b0f450f..2421e66 100644 Binary files a/resources/zoomBandChart/cyberspace-selector.png and b/resources/zoomBandChart/cyberspace-selector.png differ diff --git a/resources/zoomBandChart/darkgold-selector.png b/resources/zoomBandChart/darkgold-selector.png index 1bfe4cb..0e753d9 100644 Binary files a/resources/zoomBandChart/darkgold-selector.png and b/resources/zoomBandChart/darkgold-selector.png differ diff --git a/resources/zoomBandChart/light-selector.png b/resources/zoomBandChart/light-selector.png index bcf7501..a193b94 100644 Binary files a/resources/zoomBandChart/light-selector.png and b/resources/zoomBandChart/light-selector.png differ diff --git a/resources/zoomBandChart/lightnature-selector.png b/resources/zoomBandChart/lightnature-selector.png index f983e5c..a0e46c3 100644 Binary files a/resources/zoomBandChart/lightnature-selector.png and b/resources/zoomBandChart/lightnature-selector.png differ diff --git a/resources/zoomBandChart/turquoise-selector.png b/resources/zoomBandChart/turquoise-selector.png index 2890f4f..1228b3d 100644 Binary files a/resources/zoomBandChart/turquoise-selector.png and b/resources/zoomBandChart/turquoise-selector.png differ