From 8c2d1f1d85f7a5ee8f163083e3de2292d71c519d Mon Sep 17 00:00:00 2001 From: Snekw Date: Tue, 8 Aug 2023 07:47:36 +0000 Subject: [PATCH] deploy: 4ce0a27d551234922bf22e08728c77063743369a --- index.html | 2 +- js/vendor.d0bc38925540cdb42af4.bundle.js | 2 ++ ...SE.txt => vendor.d0bc38925540cdb42af4.bundle.js.LICENSE.txt} | 0 js/vendor.dbb0dca8faeafa463e66.bundle.js | 2 -- 4 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 js/vendor.d0bc38925540cdb42af4.bundle.js rename js/{vendor.dbb0dca8faeafa463e66.bundle.js.LICENSE.txt => vendor.d0bc38925540cdb42af4.bundle.js.LICENSE.txt} (100%) delete mode 100644 js/vendor.dbb0dca8faeafa463e66.bundle.js diff --git a/index.html b/index.html index bf77255..8aa4650 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/vendor.d0bc38925540cdb42af4.bundle.js b/js/vendor.d0bc38925540cdb42af4.bundle.js new file mode 100644 index 0000000..ddc4016 --- /dev/null +++ b/js/vendor.d0bc38925540cdb42af4.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.d0bc38925540cdb42af4.bundle.js.LICENSE.txt */ +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[736],{102:(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:()=>b,createOHLCGenerator:()=>S,createParametricFunctionGenerator:()=>E,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>w,createSpectrumDataGenerator:()=>P,createTraceGenerator:()=>p,createWaterDropDataGenerator:()=>B,createWhiteNoiseGenerator:()=>M});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}())}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 y({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var y=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 p(){return new m({numberOfPoints:1e3})}var m=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 S(){return new x({numberOfPoints:1e3,startTimestamp:0,dataFreq:1,start:100,volatility:.1})}var x=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 b(){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 M(){return new A({numberOfPoints:1e3})}var A=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 w(){return new T({inputData:[],samplingFrequency:50,step:0})}var T=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 E(){return new I({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 I=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 P(){return new k(C)}var k=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,y=e/3*2,p=y/(f*f)*this.options.narrowFactor1,m=50/(f*f)*this.options.narrowFactor2;for(a=0;ae&&(l=e),(u=50-(d=.8*a-o)*d*m)<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 B(){return new _(F)}var _=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,y,p,m,S,x;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&&y%1e3==0&&Date.now()-g>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:b.sent(),g=Date.now(),b.label=4;case 4:return S++,x+=d,[3,2];case 5:return p++,m+=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}()},187:t=>{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,y=e&&e.length,p=y?e[0]*s:t.length,m=i(t,0,p,s,!0),S=[];if(!m||m.next===m.prev)return S;if(y&&(m=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 x=s;xh&&(h=c),d>a&&(a=d);g=0!==(g=Math.max(h-n,a-o))?32767/g:0}return r(m,S,s,n,o,g,0),S}function i(t,e,i,s,r){var n,o;if(r===E(t,e,i,s)>0)for(n=e;n=e;n-=s)o=A(n,t[n],t[n+1],o);return o&&m(o,o.next)&&(w(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!m(s,s.next)&&0!==p(s.prev,s,s.next))s=s.next;else{if(w(s),(s=e=s.prev)===s.next)break;i=!0}}while(i||s!==e);return e}function r(t,e,i,l,u,c,f){if(t){!f&&c&&function(t,e,i,s){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,s)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,s,r,n,o,h,a,l=1;do{for(i=t,t=null,n=null,o=0;i;){for(o++,s=i,h=0,e=0;e0||a>0&&s;)0!==h&&(0===a||!s||i.z<=s.z)?(r=i,i=i.nextZ,h--):(r=s,s=s.nextZ,a--),n?n.nextZ=r:t=r,r.prevZ=n,n=r;i=s}n.nextZ=null,l*=2}while(o>1)}(r)}(t,l,u,c);for(var g,y,p=t;t.prev!==t.next;)if(g=t.prev,y=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(y.i/i|0),w(t),t=y.next,p=y.next;else if((t=y)===p){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(p(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,y=s.next;y!==e;){if(y.x>=u&&y.x<=d&&y.y>=c&&y.y<=f&&g(r,h,n,a,o,l,y.x,y.y)&&p(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(p(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,y=ha?h>l?h:l:a>l?a:l,x=u>c?u>f?u:f:c>f?c:f,b=d(y,m,e,i,s),v=d(S,x,e,i,s),M=t.prevZ,A=t.nextZ;M&&M.z>=b&&A&&A.z<=v;){if(M.x>=y&&M.x<=S&&M.y>=m&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,A.x>=y&&A.x<=S&&A.y>=m&&A.y<=x&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&p(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;M&&M.z>=b;){if(M.x>=y&&M.x<=S&&M.y>=m&&M.y<=x&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&p(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;A&&A.z<=v;){if(A.x>=y&&A.x<=S&&A.y>=m&&A.y<=x&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&p(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!m(n,o)&&S(n,r,r.next,o)&&v(n,o)&&v(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),w(r),w(r.next),r=t=o),r=r.next}while(r!==t);return s(r)}function a(t,e,i,n,o,h){var a=t;do{for(var l=a.next.next;l!==a.prev;){if(a.i!==l.i&&y(a,l)){var u=M(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=M(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return p(t.prev,t,e.prev)<0&&p(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function y(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&S(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)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||m(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function S(t,e,i,s){var r=b(p(t,e,i)),n=b(p(t,e,s)),o=b(p(i,s,t)),h=b(p(i,s,e));return r!==n&&o!==h||!(0!==r||!x(t,i,e))||!(0!==n||!x(t,s,e))||!(0!==o||!x(i,t,s))||!(0!==h||!x(i,e,s))}function x(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function b(t){return t>0?1:t<0?-1:0}function v(t,e){return p(t.prev,t,t.next)<0?p(t,e,t.next)>=0&&p(t,t.prev,e)>=0:p(t,e,t.prev)<0||p(t,t.next,e)<0}function M(t,e){var i=new T(t.i,t.x,t.y),s=new T(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 A(t,e,i,s){var r=new T(t,e,i);return s?(r.next=s.next,r.prev=s,s.next.prev=r,s.next=r):(r.prev=r,r.next=r),r}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},369:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>T,Iterable:()=>Is,List:()=>ai,Map:()=>Re,OrderedMap:()=>Mi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>Yi,Record:()=>ys,Repeat:()=>Ms,Seq:()=>Z,Set:()=>Vi,Stack:()=>Ci,default:()=>Cs,fromJS:()=>As,get:()=>ae,getIn:()=>ji,has:()=>he,hasIn:()=>$i,hash:()=>mt,is:()=>ft,isAssociative:()=>w,isCollection:()=>x,isImmutable:()=>_,isIndexed:()=>A,isKeyed:()=>v,isList:()=>hi,isMap:()=>ut,isOrdered:()=>D,isOrderedMap:()=>ct,isOrderedSet:()=>Di,isPlainObject:()=>re,isRecord:()=>B,isSeq:()=>k,isSet:()=>Li,isStack:()=>Ii,isValueObject:()=>dt,merge:()=>we,mergeDeep:()=>Ee,mergeDeepWith:()=>Ie,mergeWith:()=>Te,remove:()=>ue,removeIn:()=>pe,set:()=>ce,setIn:()=>ge,update:()=>Se,updateIn:()=>de,version:()=>Es});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&&!m(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return p(t,e,0)}function y(t,e){return p(t,e,e)}function p(t,e,i){return void 0===t?i:m(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function m(t){return t<0||0===t&&1/t==-1/0}var S="@@__IMMUTABLE_ITERABLE__@@";function x(t){return Boolean(t&&t[S])}var b="@@__IMMUTABLE_KEYED__@@";function v(t){return Boolean(t&&t[b])}var M="@@__IMMUTABLE_INDEXED__@@";function A(t){return Boolean(t&&t[M])}function w(t){return v(t)||A(t)}var T=function(t){return x(t)?t:Z(t)},E=function(t){function e(t){return v(t)?t:K(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(T),I=function(t){function e(t){return A(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(T),C=function(t){function e(t){return x(t)&&!w(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(T);T.Keyed=E,T.Indexed=I,T.Set=C;var P="@@__IMMUTABLE_SEQ__@@";function k(t){return Boolean(t&&t[P])}var F="@@__IMMUTABLE_RECORD__@@";function B(t){return Boolean(t&&t[F])}function _(t){return x(t)||B(t)}var L="@@__IMMUTABLE_ORDERED__@@";function D(t){return Boolean(t&&t[L])}var z=0,O=1,R=2,V="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",G=V||N,H=function(t){this.next=t};function U(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 W(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!J(t)}function Y(t){return t&&"function"==typeof t.next}function j(t){var e=J(t);return e&&e.call(t)}function J(t){var e=t&&(V&&t[V]||t[N]);if("function"==typeof e)return e}H.prototype.toString=function(){return"[Iterator]"},H.KEYS=z,H.VALUES=O,H.ENTRIES=R,H.prototype.inspect=H.prototype.toSource=function(){return this.toString()},H.prototype[G]=function(){return this};var $=Object.prototype.hasOwnProperty;function q(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 Z=function(t){function e(t){return null==t?nt():_(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=J(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=J(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new H((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return U(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(T),K=function(t){function e(t){return null==t?nt().toKeyedSeq():x(t)?v(t)?t.toSeq():t.fromEntrySeq():B(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}(Z),Q=function(t){function e(t){return null==t?nt():x(t)?v(t)?t.entrySeq():t.toIndexedSeq():B(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}(Z),tt=function(t){function e(t){return(x(t)&&!w(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}(Z);Z.isSeq=k,Z.Keyed=K,Z.Set=tt,Z.Indexed=Q,Z.prototype[P]=!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 H((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return U(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 $.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 H((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return U(t,o,i[o])}))},e}(K);it.prototype[L]=!0;var st,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var i=j(this._collection),s=0;if(Y(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(!Y(i))return new H(W);var s=0;return new H((function(){var e=i.next();return e.done?e:U(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 q(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)&&D(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function yt(t){return t>>>1&1073741824|3221225471&t}var pt=Object.prototype.valueOf;function mt(t){if(null==t)return St(t);if("function"==typeof t.hashCode)return yt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==pt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return St(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return yt(e)}(r);case"string":return r.length>Ct?(void 0===(s=Ft[i=r])&&(s=xt(i),kt===Pt&&(kt=0,Ft={}),kt++,Ft[i]=s),s):xt(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=At.get(t)))return e;if(void 0!==(e=t[It]))return e;if(!vt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[It]))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=Mt(),wt)At.set(t,e);else{if(void 0!==bt&&!1===bt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(vt)Object.defineProperty(t,It,{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[It]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[It]=e}}return e}(r);case"symbol":return function(t){var e=Tt[t];return void 0!==e||(e=Mt(),Tt[t]=e),e}(r);default:if("function"==typeof r.toString)return xt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function St(t){return null===t?1108378658:1108378659}function xt(t){for(var e=0,i=0;i=0&&(l.get=function(e,i){return(e=c(this,e))>=0&&eh)return{value:void 0,done:!0};var t=r.next();return s||e===O||t.done?t:U(e,a-1,e===z?void 0:t.value[1],t)}))},l}function Gt(t,e,i,s){var r=qt(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(R,n),a=!0,l=0;return new H((function(){var t,n,u;do{if((t=h.next()).done)return s||r===O?t:U(r,l++,r===z?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===R?t:U(r,n,u,t)}))},r}function Ht(t,e,i){var s=qt(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 Yt(t,e,i,s){var r=qt(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(O,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=T(t),j(r?t.reverse():t)})),o=0,h=!1;return new H((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}:U(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function jt(t,e){return t===e?t:k(t)?e:t.constructor(e)}function Jt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function $t(t){return v(t)?E:A(t)?I:C}function qt(t){return Object.create((v(t)?K:A(t)?Q:tt).prototype)}function Zt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Z.prototype.cacheResult.call(this)}function Kt(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 Ae(this,e,t)}function Ae(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Pe(t,e)}function Te(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Pe(e,i,t)}function Ee(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Ce(t,e)}function Ie(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 Pe(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=Z(i),h=Z(n),A(o)===A(h)&&v(o)===v(h))?Pe(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Pe(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(_(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?I:E,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=$.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 Be(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Pe(t,e)}))}function _e(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Ce(t,e)}))}function Le(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function De(){return this.__ownerID?this:this.__ensureOwner(new l)}function ze(){return this.__ensureOwner()}function Oe(){return this.__altered}var Re=function(t){function e(e){return null==e?qe():ut(e)&&!D(e)?e:qe().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 qe().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 Ze(this,t,e)},e.prototype.remove=function(t){return Ze(this,t,h)},e.prototype.deleteAll=function(t){var e=T(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):qe()},e.prototype.sort=function(t){return Mi(Ut(this,t))},e.prototype.sortBy=function(t,e){return Mi(Ut(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 Ye(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?$e(this.size,this._root,t,this.__hash):0===this.size?qe():(this.__ownerID=t,this.__altered=!1,this)},e}(E);Re.isMap=ut;var Ve=Re.prototype;Ve[lt]=!0,Ve[s]=Ve.remove,Ve.removeAll=Ve.deleteAll,Ve.setIn=ye,Ve.removeIn=Ve.deleteIn=me,Ve.update=xe,Ve.updateIn=be,Ve.merge=Ve.concat=ve,Ve.mergeWith=Me,Ve.mergeDeep=ke,Ve.mergeDeepWith=Fe,Ve.mergeIn=Be,Ve.mergeDeepIn=_e,Ve.withMutations=Le,Ve.wasAltered=Oe,Ve.asImmutable=ze,Ve["@@transducer/init"]=Ve.asMutable=De,Ve["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ve["@@transducer/result"]=function(t){return t.asImmutable()};var Ne=function(t,e){this.ownerID=t,this.entries=e};Ne.prototype.get=function(t,e,i,s){for(var r=this.entries,n=0,o=r.length;n=si)return function(t,e,i,s){t||(t=new l);for(var r=new We(t,mt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return 0==(h&n)?s:this.nodes[ei(h&n-1)].get(t+r,e,i,s)},Ge.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=mt(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 He(t,o+1,h)}(t,p,f,c,S);if(g&&!S&&2===p.length&&Qe(p[1^y]))return p[1^y];if(g&&S&&1===p.length&&Qe(S))return S;var x=t&&t===this.ownerID,b=g?S?f:f^d:f|d,v=g?S?ii(p,y,S,x):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},He.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=mt(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=Ke(f,t,e+r,i,s,n,a,l);if(g===f)return this;var y=this.count;if(f){if(!g&&--y>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new We(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=yi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?xi(t,e).set(0,i):xi(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=bi(t._capacity)?s=pi(s,t.__ownerID,0,e,i,n):r=pi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):yi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){xi(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=mi(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=mi(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=bi(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=pi(d,e,i-r,s,n,h);return f===d?t:((l=mi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=mi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function mi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function Si(t,e){if(e>=bi(t._capacity))return t._tail;if(e<1<0;)i=i.array[e>>>s&o],s-=r;return i}}function xi(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=bi(h),y=bi(u);y>=1<g?new ui([],s):p;if(p&&y>g&&ar;x-=r){var b=g>>>x&o;S=S.array[b]=mi(S.array[b],s)}S.array[g>>>r&o]=p}if(u=y)a-=y,u-=y,c=r,d=null,m=m&&m.removeBefore(s,0,a);else if(a>n||y>>c&o;if(v!==y>>>c&o)break;v&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&y>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Ai(s,r)}Mi.isOrderedMap=ct,Mi.prototype[L]=!0,Mi.prototype[s]=Mi.prototype.remove;var Ei="@@__IMMUTABLE_STACK__@@";function Ii(t){return Boolean(t&&t[Ei])}var Ci=function(t){function e(t){return null==t?Bi():Ii(t)?t:Bi().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&&Ii(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):Bi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(y(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Fi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Fi(this.size,this._head,t,this.__hash):0===this.size?Bi():(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 H((function(){if(s){var e=s.value;return s=s.next,U(t,i++,e)}return{value:void 0,done:!0}}))},e}(I);Ci.isStack=Ii;var Pi,ki=Ci.prototype;function Fi(t,e,i,s){var r=Object.create(ki);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Bi(){return Pi||(Pi=Fi(0))}ki[Ei]=!0,ki.shift=ki.pop,ki.unshift=ki.push,ki.unshiftAll=ki.pushAll,ki.withMutations=Le,ki.wasAltered=Oe,ki.asImmutable=ze,ki["@@transducer/init"]=ki.asMutable=De,ki["@@transducer/step"]=function(t,e){return t.unshift(e)},ki["@@transducer/result"]=function(t){return t.asImmutable()};var _i="@@__IMMUTABLE_SET__@@";function Li(t){return Boolean(t&&t[_i])}function Di(t){return Li(t)&&D(t)}function zi(t,e){if(t===e)return!0;if(!x(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||v(t)!==v(e)||A(t)!==A(e)||D(t)!==D(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!w(t);if(D(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 Oi(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 Ri(t){if(!t||"object"!=typeof t)return t;if(!x(t)){if(!ne(t))return t;t=Z(t)}if(v(t)){var e={};return t.__iterate((function(t,i){e[i]=Ri(t)})),e}var i=[];return t.__iterate((function(t){i.push(Ri(t))})),i}var Vi=function(t){function e(e){return null==e?Wi():Li(e)&&!D(e)?e:Wi().withMutations((function(i){var s=t(e);ee(s.size),s.forEach((function(t){return i.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(E(t).keySeq())},e.intersect=function(t){return(t=T(t).toArray()).length?Gi.intersect.apply(e(t.pop()),t):Wi()},e.union=function(t){return(t=T(t).toArray()).length?Gi.union.apply(e(t.pop()),t):Wi()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Hi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Hi(this,this._map.remove(t))},e.prototype.clear=function(){return Hi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Hi(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|0)^t)^e>>>16,2246822507),e=yt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(mt(t),mt(e))|0}:function(t,e){s=s+as(mt(t),mt(e))|0}:e?function(t){s=31*s+mt(t)|0}:function(t){s=s+mt(t)|0}),s)}(this))}});var Zi=T.prototype;Zi[S]=!0,Zi[G]=Zi.values,Zi.toJSON=Zi.toArray,Zi.__toStringMapper=oe,Zi.inspect=Zi.toSource=function(){return this.toString()},Zi.chain=Zi.flatMap,Zi.contains=Zi.includes,Oi(E,{flip:function(){return jt(this,zt(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 Ki=E.prototype;Ki[b]=!0,Ki[G]=Zi.entries,Ki.toJSON=qi,Ki.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Oi(I,{toKeyedSeq:function(){return new Bt(this,!1)},filter:function(t,e){return jt(this,Vt(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,Rt(this,!1))},slice:function(t,e){return jt(this,Nt(this,t,e,!1))},splice:function(t,e){var i=arguments.length;if(e=Math.max(e||0,0),0===i||2===i&&!e)return this;t=g(t,t<0?this.count():this.size);var s=this.slice(0,t);return jt(this,1===i?s:s.concat(Qt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var i=this.findLastEntry(t,e);return i?i[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return jt(this,Ht(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)|0}ts.has=Zi.includes,ts.contains=ts.includes,ts.keys=ts.values,Oi(K,Ki),Oi(Q,Qi),Oi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Di(t)?t:fs().withMutations((function(e){var i=C(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(E(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Vi);ls.isOrderedSet=Di;var us,cs=ls.prototype;function ds(t,e){var i=Object.create(cs);return i.size=t?t.size:0,i._map=t,i.__ownerID=e,i}function fs(){return us||(us=ds(wi()))}cs[L]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs={LeftThenRight:-1,RightThenLeft:1},ys=function(t,e){var i;!function(t){if(B(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(_(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var s=function(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function ws(t,e,i,s,r,n){if("string"!=typeof i&&!_(i)&&(q(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,Z(i).map((function(s,n){return ws(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function Ts(t,e){return A(e)?e.toList():v(e)?e.toMap():e.toSet()}var Es="4.3.2",Is=T;const Cs={version:Es,Collection:T,Iterable:T,Seq:Z,Map:Re,OrderedMap:Mi,List:ai,Stack:Ci,Set:Vi,OrderedSet:ls,PairSorting:gs,Record:ys,Range:Yi,Repeat:Ms,is:ft,fromJS:As,hash:mt,isImmutable:_,isCollection:x,isKeyed:v,isIndexed:A,isAssociative:w,isOrdered:D,isValueObject:dt,isPlainObject:re,isSeq:k,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ii,isSet:Li,isOrderedSet:Di,isRecord:B,get:ae,getIn:ji,has:he,hasIn:$i,merge:we,mergeDeep:Ee,mergeWith:Te,mergeDeepWith:Ie,remove:ue,removeIn:pe,set:ce,setIn:ge,update:Se,updateIn:de}},475:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(369),r=i(102),n=i(187),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}l(){return this.o}}class l extends a{constructor(t,e){super(),this.u=t,this.o=e}S(t){return t!==this.u&&(this.u=t,this.o=!0),this}M(){return this.u}l(){return super.l()}}const u=(t,e)=>({x:t,y:e}),c=(t,e)=>({x:t,y:e}),d=(t,e,i)=>({position:t,high:e,low:i}),f=(t,e,i)=>({x:t,y:e,z:i}),g=t=>{const e=Array(0),i=Array(0);return t.length>0&&t.forEach((t=>{e.push(u(t.position,t.high)),i.push(u(t.position,t.low))})),[e,i]},y=(t,e)=>({min:t,max:e}),p=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),m=(t,e=!0)=>new l(t,e),S=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),x=S,b=(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 M extends v{constructor(t){super(t)}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this._||(this._=new M({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._}getLighter(){return this.C||(this.C=new M({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.C}getDarker(){return this.T||(this.T=new M({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.T}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const A=t=>!(!t||"object"!=typeof t||!("type"in t)||"color"!==t.type),w=(t,e,i,s=255)=>new M({r:t/255,g:e/255,b:i/255,a:s/255}),T=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new M({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 M({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 M({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 M({r:Number(`0x${e.charAt(0)}${e.charAt(0)}`)/255,g:Number(`0x${e.charAt(1)}${e.charAt(1)}`)/255,b:Number(`0x${e.charAt(2)}${e.charAt(2)}`)/255});default:throw new Error(`ColorHEX parsing error | input: ${t}`)}},E=(t,e=1,i=1)=>{let s,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 M({r:s,g:r,b:n})},I={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},C=new M({}),P=w(0,0,0,0),k=(t,e)=>t.value-e.value,F=s.Record({type:"lut",steps:[],title:"",units:"",interpolate:!0,color:w(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1}),B=t=>{const{steps:e}=t,i=e.length;e.sort(k);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 F{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,color:t.color,length:e.length,min:e.min,max:e.max,subranges:e.subranges,isValid:e.isValid}))(t,B(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.map((t=>`${t.value},${t.color.toString()}`)).join(",")}`}setSteps(t){return this.merge(B({...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")}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 M({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 L=s.Record({type:"fillstyle",fillType:"empty"});class D extends L{toString(){return"emptyFill"}}const z=new D,O=s.Record({type:"fillstyle",fillType:"solid",color:w(255,255,255)});class R extends O{}class V extends R{constructor(t){super({...t,fillType:"solid"})}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return A(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 N=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"solid"===t.fillType);class G extends R{constructor(t){super({...t,fillType:"individual"})}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return A(t)?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const H=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"individual"===t.fillType),U=s.Record({type:"fillstyle",fillType:"palette",lut:new _({steps:[]}),lookUpProperty:"value"}),W=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"palette"===t.fillType),X={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=se(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.I)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.D=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.P.emit("start")}start(){return this.D.includes(this)||this.D.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 Y(t,e,i,s,this.D);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.P.on("start",t,e)}onAnimationEnd(t,e){return this.P.on("end",t,e)}onEveryAnimationEnd(t,e){return this.P.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.P.on("allEnd",t,e)}allOffAnimationEnd(){return this.P.topicOff("end"),this}allOffEveryAnimationEnd(){return this.P.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.P.topicOff("allEnd"),this}offAnimationEnd(t){return this.P.off(t,"end")}offEveryAnimationEnd(t){return this.P.off(t,"everyEnd")}offAllAnimationEnd(t){return this.P.off(t,"allEnd")}finish(t=!0){if(this.I=!0,this.D.splice(this.D.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.P.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.P.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.P.emit("end",e),this.P.emit("everyEnd",e)),e}t&&(this.P.emit("end",void 0),this.P.emit("everyEnd",void 0),this.P.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.O(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=xt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=X.linear)=>(r,n,h=t)=>{const a=new Y(r,n,h,e,i).start();return s||(s=xt.requestAnimationFrame(o)),a}};var J,$;e.GradientShape=void 0,(J=e.GradientShape||(e.GradientShape={})).circle="circle",J.ellipse="ellipse",e.GradientExtent=void 0,($=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",$.closestCorner="closest-corner",$.farthestSide="farthest-side",$.farthestCorner="farthest-corner";const q=s.Record({type:"fillstyle",fillType:"radial-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class Z 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 K=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"radial-gradient"===t.fillType),Q=s.Record({type:"fillstyle",fillType:"linear-gradient",stops:[{color:T("#f00"),offset:0},{color:T("#0f0"),offset:1}],angle:0});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("LinearGradientFill requires minimum two color stops to be defined.")}toString(){return`linearGradientFill:${this.angle},${this.stops.map((t=>`${t.offset},${t.color.toString()}`)).join(",")}`}setColorStops(t){if(t.length<2)throw new Error("Minimum of two color stops required");const e=t.sort(((t,e)=>t.offset-e.offset));return this.set("stops",e)}getColorStops(){return this.get("stops")}setAngle(t,e){return this.set("angle",e?fi(t):t)}getAngle(t){return t?di(this.get("angle")):this.get("angle")}}const et=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"linear-gradient"===t.fillType),it=s.Record({type:"linestyle",lineType:"empty"}),st=new class extends it{constructor(){super(...arguments),this.thickness=0}setThickness(t){return this}getThickness(){return 0}L(){return 0}setFillStyle(t){return this}getFillStyle(){return z}};class rt{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new nt,this.y=new nt,this.z=new nt,this.P=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Oe,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(Oe,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.N(e),s.y.N(r)}}}G(){return this.V&&(this.V(),this.V=void 0),this}W(t){return this.P.on("cell-resize",t)}H(t){return this.P.off(t,"cell-resize")}}class nt extends a{constructor(){super(...arguments),this.U=0,this.$=10,this.j=1}Y(){return this.o=!1,this}X(){return this.o=!0,this}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}Z(t,e){return this.U=t,this.$=e,this.K(),this}q(t){return this.j=t,this.K(),this}J(t){return t/this.j}K(){const t=this.J(this.$-this.U),e=this.j;void 0!==this.tt&&!1!==It(t,this.tt)||(this.o=!0,this.it=e,this.tt=t)}st(){return this.tt}et(){return this.it}ht(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).nt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new rt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},ht=(t,e,i)=>e===i?t:i.ot(e.ut(t)),at=(t,e,i)=>{if(e===i)return t;const s=e instanceof Bi?e.x:e.x instanceof Bi?e.x.x:e.x.ct,r=e instanceof Bi?e.y:e.y instanceof Bi?e.y.y:e.y.ct,n=i instanceof Bi?i.x:i.x instanceof Bi?i.x.x:i.x.ct,o=i instanceof Bi?i.y:i.y instanceof Bi?i.y.y:i.y.ct;return{...t,x:ht(t.x,s,n),y:ht(t.y,r,o)}},lt=(...t)=>{if(0===t.length)return{remove:Et};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.dt(s,r,!1,!1,"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 ut{constructor(t){this.ft=t,this.yt=new Map}St(t){const e=this.yt.get(t);return e&&e.length>0?e[0]:void 0}xt(t){let e=this.yt.get(t.lut);e?e.push(t):(e=[t],this.yt.set(t.lut,e))}bt(t){const e=this.yt.get(t.lut);if(e){const i=e.indexOf(t);i>=0&&e.splice(i,1),0===e.length&&(this.ft.deleteTexture(t.texture),this.yt.delete(t.lut))}}vt(){this.yt.forEach((t=>{var e;const i=null===(e=t[0])||void 0===e?void 0:e.texture;i&&this.ft.deleteTexture(i)})),this.yt.clear()}}const ct=t=>new ut(t);class dt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,dt.prototype)}}class ft extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&xt.alert(s),Object.setPrototypeOf(this,ft.prototype)}}class gt extends ft{constructor(t){super(t),Object.setPrototypeOf(this,gt.prototype)}}var yt,pt,mt,St;e.UISpace=void 0,(yt=e.UISpace||(e.UISpace={}))[yt.Content=0]="Content",yt[yt.PaddedContent=1]="PaddedContent",yt[yt.PaddedBackground=2]="PaddedBackground",yt[yt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(pt=e.UIVisibilityModes||(e.UIVisibilityModes={}))[pt.never=0]="never",pt[pt.always=1]="always",pt[pt.whenHovered=2]="whenHovered",pt[pt.whenDragged=3]="whenDragged",pt[pt.whenNotDragged=4]="whenNotDragged",pt[pt.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(mt=e.UIDraggingModes||(e.UIDraggingModes={}))[mt.notDraggable=0]="notDraggable",mt[mt.draggable=1]="draggable",mt[mt.onlyHorizontal=2]="onlyHorizontal",mt[mt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(St=e.UIDirections||(e.UIDirections={}))[St.Up=0]="Up",St[St.Right=1]="Right",St[St.Down=2]="Down",St[St.Left=3]="Left";const xt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},bt=(t,e)=>t.x===e.x&&t.y===e.y,vt=t=>t!==Pe&&t!==ke&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,Mt=(t,e)=>Math.min(t,e.y),At=(t,e)=>Math.max(t,e.y),wt=t=>t[1],Tt=t=>t.dispose(),Et=()=>{},It=(t,e)=>t===e,Ct=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Pt=t=>Array.prototype.concat.apply([],t),kt=(t,e)=>{const{x:i,y:s}={x:t[0].length,y:t.length},{column:r,row:n}=e,o=Math.max(0,r.start),h=Math.min(i,r.end),a=Math.max(0,n.start),l=Math.min(s,n.end),u=h-o,c=l-a,d=Array.from(Array(c)).map((()=>Array(u)));for(let e=a,i=0;e{const i=e&&void 0!==e.row.start?e.row.start:0,s=e&&void 0!==e.row.end?e.row.end:t.y,r=e&&void 0!==e.column.start?e.column.start:0,n=e&&void 0!==e.column.end?e.column.end:t.x;return[Math.min(i,s),Math.max(i,s),Math.min(r,n),Math.max(r,n)]},Bt=(t,e)=>{for(;e;)t.push(t.shift()),e-=1},_t=t=>{const e=[];for(const i of t)e.push(i.slice());return e},Lt=(t,e)=>void 0!==t?t:e,Dt=t=>t.Mt(),zt=t=>t._t(),Ot=t=>t.At(),Rt=t=>t.wt(),Vt=t=>t.min.x,Nt=t=>t.max.x,Gt=t=>t.min.y,Ht=t=>t.max.y,Ut=(t,e,i,s,r)=>{if(t.length>0){let n=r?s(r):void 0;for(let s=0;st.position===e.position&&t.high===e.high&&t.low===e.low,Xt=u(0,1),Yt=u(1,0),jt=u(0,-1),Jt=u(-1,0),$t=u(0,0),qt=t=>{switch(t){case e.UIDirections.Up:return Xt;case e.UIDirections.Right:return Yt;case e.UIDirections.Down:return jt;case e.UIDirections.Left:return Jt;default:return $t}},Zt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Kt=t=>{t.stopPropagation(),t.preventDefault()},Qt=(t,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)},ie=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},re=se(Math.E),ne=(t,e)=>{const i=e[t];return i?i():void 0},oe=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;igi(ni(t,i))-gi(ni(e,i))))},he=(t,e,i)=>{if(0===t.length)return!1===i.canReturnB?e.slice():e;const s=e.length;if(s<1e5)return t.push.apply(t,e),t;for(let i=0;ii<0?t:i>1?e:w(t.getR()+i*(e.getR()-t.getR()),t.getG()+i*(e.getG()-t.getG()),t.getB()+i*(e.getB()-t.getB()),t.getA()+i*(e.getA()-t.getA())),le=t=>255===t.getA()?t:t.setA(255),ue=(()=>{const t=w(0,0,0);return i=>(i=le(i),new Z({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ae(i,t,.5)}]}))})(),ce=(()=>{const t=t=>{var e;if(t){if(N(t)){if(0===t.getColor().getA())return;return t.getColor()}if(K(t)||et(t)){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}W(t)}};return(e,i,s)=>{const r=[];if(s.fill&&r.push(s.fill),s.fill2&&r.push(s.fill2),s.stroke){const t=s.stroke.getFillStyle();t!==z&&r.push(t)}if(s.point3D){const t=s.point3D;r.push(t.getFillStyle())}let n;if(s.behavior&&!0===s.behavior.colorStep){const[e,s]=r.reduce(((e,i)=>{if(e[0]&&e[1])return e;const s=t(i);return s&&(void 0===e[0]?e[0]=s:e[1]=s),e}),[void 0,void 0]);n=e&&s?(o=e)===(h=s)||o.getR()===h.getR()&&o.getG()===h.getG()&&o.getB()===h.getB()?ue(o):(o=le(o),h=le(h),new tt({angle:0,stops:[{offset:0,color:h},{offset:.5,color:h},{offset:.5,color:o},{offset:1,color:o}]})):i.uiButtonFillStyle}else{const e=r.reduce(((e,i)=>e||t(i)),void 0);n=e?ue(e):i.uiButtonFillStyle}var o,h;e.setButtonOffFillStyle(new V({color:w(255,255,255,0)})).setButtonOffStrokeStyle(i.uiButtonStrokeStyle).setButtonOnFillStyle(n).setButtonOnStrokeStyle(st)}})(),de=t=>{const e=t;if(W(e))return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},fe=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ge=(t,e)=>{let i="string"==typeof t?t:String(t);const s=i.indexOf(".");let r=s>=0?s:i.length;for(;r"function"==typeof t?t(e):t,pe=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),me=(t,e)=>e(),Se=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to https://lightningchart.com/js-charts/docs/contact");new V({color:w(255,255,255,1)});const xe=t=>t===Fe||t.min.x===Fe.min.x&&t.max.x===Fe.max.x&&t.min.y===Fe.min.y&&t.max.y===Fe.max.y,be=t=>Array.from(new Set(t)),ve=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,Me=(t,e)=>{throw new Error(e)},Ae=()=>{const t=j((()=>{}));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)||X.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)}},we=t=>{let e;return()=>e||(e=t(),e)},Te=t=>{if(t===st)return 0;const e=t.getThickness();return e<0?1:1*e},Ee=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/js-charts/api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw xt.alert(r),new Error(r);xt.console.warn(r)},Ie={left:0,right:0,top:0,bottom:0},Ce={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=>Ce.divide(t,Ce.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(Ce.dot(t,e)/(Ce.length(t)*Ce.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ce.dot(e,t),o=Ce.cross(e,t);return Ce.addVec(Ce.multiply(t,s),Ce.addVec(Ce.multiply(e,(1-s)*n),Ce.multiply(o,r)))},lerp:(t,e,i)=>(i=Ct(i,0,1),Ce.addVec(Ce.multiply(t,1-i),Ce.multiply(e,i))),equals:(t,e)=>It(t.x,e.x)&&It(t.y,e.y)&&It(t.z,e.z),abs:t=>({x:Math.abs(t.x),y:Math.abs(t.y),z:Math.abs(t.z)}),sign:t=>({x:Math.sign(t.x),y:Math.sign(t.y),z:Math.sign(t.z)})},Pe=Number.MAX_SAFE_INTEGER,ke=-Number.MAX_SAFE_INTEGER,Fe=y(u(Pe,Pe),u(ke,ke)),Be=y(f(Pe,Pe,Pe),f(ke,ke,ke)),_e=(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))},Le=(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),ze=(t,e)=>y(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Oe=(t,e)=>e+t,Re=(t,e,i)=>{const s=ni(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ni(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)},Ve=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Ne=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Ge=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},He=(t,e,i)=>{const s=Ge(e,i);if(0===s)return[Ge(t,e),e];let r=li(ni(t,e),ni(i,e))/s;r=Math.max(0,Math.min(1,r));const n=u(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y));return[Ge(t,n),n]},Ue=(t,e,i)=>ri(t,si(ni(e,t),i)),We=(t,e,i)=>Ce.addVec(t,Ce.multiply(Ce.subtractVec(e,t),i));function Xe(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:Pe,y:Pe},max:{x:ke,y:ke}};for(const i of t)e.min.x=e.min.xi.max.x?e.max.x:i.max.x,e.min.y=e.min.yi.max.y?e.max.y:i.max.y;return e},Je=(t,e)=>y(f(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y,t.max.z>e.max.z?t.max.z:e.max.z));function $e(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}const qe=(t,e,i,s)=>u((t.x+e.x+i.x+s.x)/4,(t.y+e.y+i.y+s.y)/4),Ze=(t,e,i,s,r)=>{if(e.x>i.x)if(e.x>s.x)if(e.x>r.x){if(t.x>e.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(t.xs.x)if(i.x>r.x){if(t.x>i.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(s.xi.y)if(e.y>s.y)if(e.y>r.y){if(t.y>e.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(t.ys.y)if(i.y>r.y){if(t.y>i.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(s.y{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},ci=(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 di(t){return t*Math.PI/180}function fi(t){return 180*t/Math.PI}function gi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function yi(t){return u(Math.cos(t),Math.sin(t))}function pi(t){let e=-1;const i=Math.cos(t),s=Math.sin(t);return i>0&&i<1&&s>0&&s<1?e=1:i<0&&i>-1&&s>0&&s<1?e=2:i<0&&i>-1&&s<0&&s>-1?e=3:i>0&&i<1&&s<0&&s>-1&&(e=4),e}const mi=(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)},Si=(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 xi{constructor(){this.kt=!0}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.U)}Z(t,e){return this.U=t,this.$=e,this}Y(){return this.kt=!1,this}X(){return this.kt=!0,this}}class bi extends xi{constructor(t,e,i,s){if(super(),this.Ct=!0,this.Tt=!0,this.Ft=[0,0],this.It=!0,this.Pt=t,this.Dt=e,this.Bt=i,this.Ot=t,this.Lt=e,s){const t=s.R(this.Rt.bind(this));this.Rt(s.M()),this.Et=()=>s.N(t)}}q(t){return this.j=t,this.Tt=!0,this}zt(t){return this.Ft=t.map(Math.abs),this.It=!0,this}Vt(){return this.Pt/this.Bt*this.j+this.Ft[0]}Nt(){return(this.Pt+this.Dt)/this.Bt*this.j-this.Ft[1]}Gt(){return this.getCellSize()-this.Wt()}Ht(){return this.j}getCellSize(){return this.Ut(this.j)}Wt(){return this.Ft[0]+this.Ft[1]}$t(){return this.Ft}Rt(t){this.Bt=t.reduce(Oe,0),this.Pt=t.reduce(((t,e,i)=>i>=this.Ot?t:t+e),0),this.Dt=t.reduce(((t,e,i)=>i>=this.Ot&&iTi;return!n&&!o||!!r&&(e>t?{start:n?wi:t,end:o?Ti:e}:{start:o?Ti:t,end:n?wi:e})}ut(t){const e=this.Vt(),i=this.Nt(),s=Math.max(t,wi);return e+(this.Yt.function(s)-this.Xt.scaleStartLog)/this.Xt.scaleIntervalLog*(i-e)}ot(t){const e=this.Vt(),i=(t-e)/(this.Nt()-e),s=this.Xt.scaleStartLog+i*this.Xt.scaleIntervalLog;return this.Yt.number**s}jt(){this.Yt&&this.Zt()}Z(t,e){return super.Z(t,e),this.Yt&&this.Zt(),this}zt(t){return super.zt(t),this.Yt&&this.Zt(),this}q(t){return super.q(t),this.Yt&&this.Zt(),this}Kt(t){return this.Yt={internal:t,function:Mi(t),number:Ai(t)},this}qt(){return this.Yt.internal}Jt(t,e){const i=this.ut(t)+e;return this.ot(i)}Qt(){return this.Tt||this.kt||this.It||this.Ct}Zt(){const t=this.Yt.function(this.U),e=this.Yt.function(this.$)-t,i=2*this.Vt()/this.j-1,s=2*this.Nt()/this.j-1-i;return this.Xt={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.Xt}ti(){return this.Xt}}const Mi=t=>"e"===t?re:se(t),Ai=t=>"e"===t?Math.E:t,wi=.9*1e-9,Ti=1.1*10**32,Ei=[{prefix:"T",unit:10**12},{prefix:"B",unit:10**9},{prefix:"M",unit:1e6},{prefix:"K",unit:1e3}],Ii=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-_e(s,10),0);return t.toFixed(r)},Ci={Numeric:(t,e)=>Ii(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 Ei){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=_e(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-_e(i,10)):"")}return r+=n,r}},Pi=(t,e)=>{const i=Mi(e);return"e"===e?t?(t,e)=>`${Math.floor(i(t))}e`:()=>"":(t,e)=>{const s=t.toString();if(t>1)return s;const r=Math.floor(i(t));return t.toFixed(Math.abs(r))}};class ki extends bi{constructor(t,e,i,s){super(t,e,i,s),this.ii=!1,this.si=!1,this.ei=0,this.j=1e3,this.Z(0,10),this.K()}Qt(){return this.si}rt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.ii){const i=((t,e,i)=>{const s=((t,e)=>{if(eke&&tke){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}}jt(){this.K()}ut(t){return this.Vt()+(t-this.U)/(this.$-this.U)*(this.Nt()-this.Vt())}ot(t){return this.U+(t-this.Vt())/(this.Nt()-this.Vt())*(this.$-this.U)}Z(t,e){return super.Z(t,e),this.K(),this}zt(t){return super.zt(t),this.K(),this}q(t){return super.q(t),this.hi=Fi(this.$-this.U,this.Ft,this.j,this.Dt,this.Bt),this.K(),this}ri(){return this.ii=!0,this}ni(){return this.ii}oi(){return Math.abs(this.ai)}li(){return this.oi()/this.hi}ui(){return this.ci}di(){return this.fi}getPixelSize(){return this.hi}ti(){return this.Xt}X(){return super.X(),this.si=!0,this}Y(){return super.Y(),this.si=!1,this}gi(t,e=Ci.Numeric){return e(t,this)}pi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}mi(t){return Fi(t,this.Ft,this.j,this.Dt,this.Bt)}K(){let t=this.U,e=this.$,i=0;this.ii&&(t=0,e=this.$-this.U,i=this.U);const s=e-t,r=Fi(s,this.Ft,this.j,this.Dt,this.Bt);this.fi=t-this.Ft[0]*r,this.ci=e+this.Ft[1]*r;const n=this.ci-this.fi,o=n-this.ai,h=Math.abs(o/r),a=s-this.ei,l=Math.abs(a/r);(!this.Xt||h>=.4||l>=.4)&&(this.ei=s,this.ai=n,this.hi=r,this.si=!0);const u=this.ai*this.Bt/(2*this.Dt),c=-(this.fi-this.ai*this.Pt/this.Dt)-u,d=2*this.Vt()/this.j-1,f=2*this.Nt()/this.j-1-d;this.Xt={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}Jt(t,e){return t+this.hi*e}}const Fi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Bi{yi(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}Y(){return this.x.Y(),this.y.Y(),this}X(){return this.x.X(),this.y.X(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}Ht(){return u(this.x.Ht(),this.y.Ht())}Si(t){return this.x.zt(t),this}xi(t){return this.y.zt(t),this}Wt(){return u(this.x.Wt(),this.y.Wt())}bi(t,e){return this.x.Z(t,e),this}vi(t,e){return this.y.Z(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Wt(),y:e-this.y.Wt()}}Mi(){return this.x.Qt()||this.y.Qt()}}class _i extends Bi{constructor(){super(...arguments),this._i="LinearScaleXY"}nt(t,e,i,s){return this.x=new ki(t.x,e.x,i.x,s?s.x:void 0),this.y=new ki(t.y,e.y,i.y,s?s.y:void 0),this}ni(){return this.x.ni()||this.y.ni()}Ai(){return u(this.x.getPixelSize(),this.y.getPixelSize())}ti(){return{x:this.x.ti(),y:this.y.ti()}}Jt(t,e){const i=this.Ai();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}wi(t,e,i,s){const r=this.Ai(),n=ei(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 Li extends Bi{constructor(){super(...arguments),this._i="MixedScaleXY"}ni(){return!1}Jt(t,e){const i=this.x.ut(t.x),s=this.y.ut(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ot(r.x),y:this.y.ot(r.y)}}wi(t,e,i,s){const r={x:this.x.ut(t.x),y:this.y.ut(t.y)},n={x:this.x.ut(e.x),y:this.y.ut(e.y)},o=ti(ni(n,r)),h=ei(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.ot(a.x),y:this.y.ot(a.y)}}ti(){const t=this.x.ti(),e=this.y.ti();return{uScaleStart:[this.x.U,this.y.U],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 Di=(t,e)=>t instanceof vi||e instanceof vi?(new Li).yi(t,e):(new _i).yi(t,e),zi=t=>"client"===t,Oi=t=>!!(t&&"object"==typeof t&&"clientX"in t&&"number"==typeof t.clientX&&"clientY"in t&&"number"==typeof t.clientY),Ri=t=>"relative"===t,Vi=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y);var Ni;e.HighlightModes=void 0,(Ni=e.HighlightModes||(e.HighlightModes={}))[Ni.noHighlighting=0]="noHighlighting",Ni[Ni.onHover=1]="onHover";class Gi{constructor(t,i,s,n){this.ki=!0,this.Ci=e.HighlightModes.onHover,this.Ti=!1,this.Fi=!0,this.Ii=!1,this.P=new r.Eventer,this.Pi=[],this.Di=[],this.Bi=(t,e)=>{this.setVisible(e)},this.Oi=()=>this.setHighlight(1),this.Li=()=>this.setHighlight(0),this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.Ri=(t,i,s)=>{this.P.emit("mouseEnter",this,i),this.Ii=!0,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Ei=(t,i,s)=>{this.P.emit("mouseLeave",this,i),this.Ii=!1,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!1)},this.zi=(t,e,i)=>{this.P.emit("mouseMove",this,e)},this.Vi=(t,e,i)=>this.P.emit("mouseClick",this,e),this.Ni=(t,e,i)=>this.P.emit("mouseDoubleClick",this,e),this.Gi=(t,e,i)=>this.P.emit("mouseDown",this,e),this.Wi=(t,e,i)=>this.P.emit("mouseUp",this,e),this.Hi=(t,e,i,s)=>{this.P.emit("mouseDragStart",this,e,i)},this.Ui=(t,e,i,s,r,n)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.$i=(t,e,i,s,r)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.ji=(t,e,i)=>{this.P.emit("mouseWheel",this,e)},this.Yi=(t,i,s)=>{this.P.emit("touchStart",this,i),this.Ii=!0,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!0)},this.Xi=(t,e,i)=>{this.P.emit("touchMove",this,e)},this.Zi=(t,i,s)=>{this.P.emit("touchEnd",this,i),this.Ii=!1,this.Ci===e.HighlightModes.onHover&&this.setHighlight(!1)},this.Ki=t,this.qi=i,this.Ji=s,this.Qi=new Map,this.ts=n,this.ss=this.ts.es(this,{hs:{themeEffectEnabled:this.Ji.effectsText},rs:{}}),this.Ki.ls.os.ns(this,(t=>{this.Qi.forEach(((e,i)=>i.us(t))),this.Di.forEach((e=>e.setHighlight(t))),this.Pi.forEach((e=>e.us(t)))}),{animationEnabled:this.Ki.getAnimationsEnabled()})}cs(t,e){const i=void 0===(null==e?void 0:e.setEventHandlers)||e.setEventHandlers,s=void 0!==(null==e?void 0:e.isText)&&e.isText;this.Qi.set(t,{isText:s});const r=Array.from(this.Qi);this.ss.hs.ds(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.ss.rs.ds(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.ki).setVisible(this.Fi).us(this.Ki.ls.os.fs(this,!0)),i&&t.setMouseEnterEventHandler(this.Ri).setMouseLeaveEventHandler(this.Ei).setMouseClickEventHandler(this.Vi).setMouseDoubleClickEventHandler(this.Ni).setMouseDownEventHandler(this.Gi).setMouseUpEventHandler(this.Wi).setMouseMoveEventHandler(this.zi).setMouseDragStartEventHandler(this.Hi).setMouseDragEventHandler(this.Ui).setMouseDragStopEventHandler(this.$i).setMouseWheelEventHandler(this.ji).setTouchStartEventHandler(this.Yi).setTouchMoveEventHandler(this.Xi).setTouchEndEventHandler(this.Zi);const n=t.onDispose((()=>{t.offDispose(n),this.Qi.delete(t)}))}gs(t){this.Pi=t;const e=this.Ki.ls.os.fs(this,!0);t.forEach((t=>{t.us(e).ps(this.Fi)}))}setEffect(t){return this.ss.hs.ys(t&&this.Ji.effectsText),this.ss.rs.ys(t),this.Ki.ls.Ss(),this}getEffect(){return this.ss.hs.xs()||this.ss.rs.xs()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setName(t){return this.bs=t,this.Di.forEach((t=>t.setText(this.bs))),this}getName(){return this.bs}dispose(){return this.Ti||(this.Ti=!0,this.Qi.forEach(((t,e)=>e.dispose())),this.qi(this),this.Di.forEach((t=>{t.dispose()})),this.Di.length=0,this.P.emit("dispose",this),this.Ki.ls.Ss()),this}setVisible(t){return t===this.Fi||(this.Fi=t,this.Qi.forEach(((e,i)=>i.setVisible(t))),this.Pi.forEach((e=>e.ps(t))),this.Di.forEach((e=>e.setOn(t))),this.P.emit("visibleStateChanged",this,this.Fi),this.Ki.ls.Ss()),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setHighlight(t){return this.Ki.ls.os.vs(this,t),this.P.emit("highlight",t),this}getHighlight(){return this.Ki.ls.os.fs(this)}setAnimationHighlight(t){return this.Ki.ls.os.Ms(this,t),this}getAnimationHighlight(){return this.Ki.ls.os._s(this)}setMouseInteractions(t){return this.ki=t,this.Qi.forEach(((e,i)=>i.setMouseInteractions(t))),this.Ki.ls.Ss(),this}getMouseInteractions(){return this.ki}getIsUnderMouse(){return this.Ii}setHighlightOnHover(t){return this.Ci=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Ci!==e.HighlightModes.noHighlighting}attach(t,e=!0){t.setText(this.bs),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1));const i=t.getLocked();return t.setLocked(!1).setOn(this.getVisible()).setLocked(i),e&&t.onSwitch(this.Bi),t.setLocked(!e),t.onMouseEnter(this.Oi),t.onMouseLeave(this.Li),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.Di.push(t),this}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}onDispose(t){return this.P.on("dispose",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}offDispose(t){return this.P.off(t,"dispose")}}class Hi extends Gi{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.As=t,this.axis=s,this.ct=r,this.ws=n,this.ks()}}const Ui=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.Ps?(this.Is.splice(t,1),t-=1):this.Is[t].state&&(s=!0);return this.Fs?0===e.interactions.length&&(this.Is.push({state:!1,time:i}),this.Fs=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Is.push({state:!0,time:i}),s=!0,this.Fs=!0),s}Ts(t,e,i){if(i){const i=this.Is.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Ds(t,e),this.Is.length=0)}}},Yi=class{constructor(t,e,i,s=1,r=100){this.Bs=t,this.Os=e,this.Ls=i,this.Rs=s,this.Es=r}Cs(t,e){const i=e.interactions.length;if(i===this.Rs){if(void 0!==this.zs)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Ui(t);let s=0;for(let r=0;r!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType);class Zi{constructor(t,e){this.Hs=t,this.Us=e,this.$s=e.rows*Is,this.js=e.columns*Cs}}var Ki,Qi;e.OnScreenMenuButtonType=void 0,(Ki=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Ki.ZoomIn=0]="ZoomIn",Ki[Ki.ZoomInX=1]="ZoomInX",Ki[Ki.ZoomInY=2]="ZoomInY",Ki[Ki.ZoomOut=3]="ZoomOut",Ki[Ki.ZoomOutX=4]="ZoomOutX",Ki[Ki.ZoomOutY=5]="ZoomOutY",Ki[Ki.ZoomToFit=6]="ZoomToFit",Ki[Ki.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qi=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qi.Circle=0]="Circle",Qi[Qi.Rectangle=1]="Rectangle",Qi[Qi.RoundedRectangle=2]="RoundedRectangle";const ts={x:-43,y:0},es={x:-65,y:0},is={x:-86,y:0},ss={x:-107,y:-1},rs={x:-128,y:-3},ns={x:-150,y:0},os={x:-171,y:0},hs={x:-276,y:0},as={x:-298,y:0},ls={x:0,y:0},us={x:-21,y:0};class cs extends Zi{constructor(t,e,i,s){super(t,i),this.Ys=xt.document.createElement("button"),this.Xs=xt.document.createElement("div"),this.Zs=xt.document.createElement("label"),this.Us=i,this.Ks=e,this.Ki=s}qs(t,e,i,s){this.Js(t,s),this.Qs(),this.te(e),this.ie(),this.Zs.textContent=i||"";const r=xt.document.createElement("div");this.se(r),this.Ys.onclick=this.onClick.bind(this),r.appendChild(this.Xs),r.appendChild(this.Zs),this.Ys.appendChild(r)}ie(){this.Ys.style.cursor="pointer"}se(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}te(t){"string"==typeof t?(this.Xs.style.backgroundImage=`url(${t})`,this.Xs.style.backgroundSize="100%",this.Xs.style.backgroundRepeat="no-repeat",this.Xs.style.backgroundPosition="center",this.Xs.style.width="20px",this.Xs.style.height="20px"):this.applyStyleForSprite(t),this.Xs.style.margin="auto"}Qs(){switch(this.Ks){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Ys.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Ys.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Ys.style.borderRadius="31px"}}Js(t,e){this.Ys.style.width=`${this.js.toString()}px`,this.Ys.style.height=`${this.$s.toString()}px`,this.Ys.style.backgroundColor=t,this.Ys.style.opacity=e||Ps,this.Ys.style.alignItems="center",this.Ys.style.border="2px solid #707070",this.Ys.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.Xs.style.backgroundImage=`url(${this.Hs}/${ks})`,this.Xs.style.backgroundPositionX=`${t.x}px`,this.Xs.style.backgroundPositionY=`${t.y}px`,this.Xs.style.backgroundSize="1600%",this.Xs.style.backgroundRepeat="no-repeat",this.Xs.style.width="20px",this.Xs.style.height="20px"}ee(t){return t.appendChild(this.Ys),t}he(){return this.Ys}}class ds extends cs{constructor(t,e,i,s){super(t,e,i,s),this.re="",this.ne="",this.oe=!1,this.Ki=s}ae(){this.le(),this.onToggledStateAction()}ue(){this.ce(),this.onInitialStateAction()}ce(){this.de(this.re)}le(){this.de(this.ne)}de(t){"string"==typeof t?this.Xs.style.background=t:(this.Xs.style.backgroundImage=`url(${this.Hs}/${ks})`,this.Xs.style.backgroundPositionX=`${t.x}px`,this.Xs.style.backgroundPositionY=`${t.y}px`)}onClick(){this.oe?this.ue():this.ae(),this.oe=!this.oe}}class fs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),ts)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:-1,y:-1})}}class gs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),ss)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:-1,y:0})}}class ys extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),ns)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:0,y:-1})}}class ps extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),es)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:1,y:1})}}class ms extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),rs)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:1,y:0})}}class Ss extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),os)}onClick(){const t=this.Ki.fe();t&&this.Ki.zoom(t,{x:0,y:1})}}class xs extends ds{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.re=hs,this.ne=as,this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),this.re)}onToggledStateAction(){this.Ki.setAnimationsEnabled(!1)}onInitialStateAction(){this.Ki.setAnimationsEnabled(!0)}}class bs extends cs{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.Ki=e;const s=this.Ki.getTheme();this.qs(s.onScreenMenuBackgroundColor.toRGBAString(),is)}onClick(){this.Ki.forEachAxis((t=>{t.fit(!0)}))}}class vs extends cs{constructor(t,e,i){super(t,e.shape||Fs,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.qs(r,n,o,h),this.ge=e.action}onClick(){this.ge(this.Ki)}}class Ms extends ds{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.Ki=i,this.pe=s,this.re=us,this.ne=ls,this.qs(Bs,this.re)}ce(){this.de(this.re),this.Ys.style.backgroundColor=Bs,this.Ys.style.border="2px solid #707070",this.Ys.style.margin="0px"}le(){this.de(this.ne),this.Ys.style.background="#FECC00 0% 0% no-repeat padding-box",this.Ys.style.border="10px solid #BCBCBC12",this.Ys.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.pe)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.pe)||void 0===t||t.style.setProperty("display","none")}}var As;e.MouseStyles=void 0,(As=e.MouseStyles||(e.MouseStyles={})).Move="move",As.ResizeColumn="col-resize",As.ResizeRow="row-resize",As.Horizontal="ew-resize",As.Vertical="ns-resize",As.NorthWest="nw-resize",As.NorthEast="ne-resize",As.Copy="copy",As.CrossHair="crosshair",As.Default="default",As.Help="help",As.Restricted="not-allowed",As.None="none",As.Point="pointer",As.Text="text",As.Wait="wait",As.ZoomIn="zoom-in",As.ZoomOut="zoom-out";const ws={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)},Ts=new V({color:w(255,255,255,0)}),Es=new $i({thickness:1,fillStyle:Ts}),Is=60,Cs=60,Ps="1.0",ks="osm/osm-sprite-transparent.png",Fs=e.OnScreenMenuButtonShape.Circle,Bs="#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 Ls extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.bs="Band",this.me=0,this.ye=0,this.Se=this.Ji.bandFillStyle,this.xe=this.Ji.bandStrokeStyle,this.be=this.As._e(this.ct).Me(this.Se).ve(this.xe).us(this.getHighlight()),this.cs(this.be)}setValueStart(t){return this.me=t,this.P.emit("valueChange",this,this.me,this.ye),this.As.Ss(),this}getValueStart(){return this.me}setValueEnd(t){return this.ye=t,this.P.emit("valueChange",this,this.me,this.ye),this.As.Ss(),this}getValueEnd(){return this.ye}setFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;return this.be.Me(e),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){this.xe="function"==typeof t?t(this.xe):t;const e=this.xe;return this.be.ve(e),this.As.Ss(),this}getStrokeStyle(){return this.xe}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}Ae(){return this.be.we(this.ws.toVec2(this.me,this.ws.getHeight(this.ct).getInnerStart())).q(this.ws.toVec2(this.ye-this.me,this.ws.getHeight(this.ct).getInnerInterval())),this}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}ke(t,e){t.us(e),this.As.Ss()}ks(){let t,i;const s=(e,s)=>{const r=at(this.As.ls.Ce(s.x,s.y),this.As.ls.ct,this.ct),n=this.ws.getWidth(r),o=this.axis.ct.ut(this.me),h=this.axis.ct.ut(this.ye),a=(this.axis.ct.ut(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{const h=this.ws.getWidth(n);t?(this.me=this.axis.ct.Jt(this.me,h),this.ye=this.axis.ct.Jt(this.ye,h)):i?this.me=this.axis.ct.Jt(this.me,h):this.ye=this.axis.ct.Jt(this.ye,h),Kt(o),this.P.emit("valueChange",this,this.me,this.ye),this.As.Ss()};this.onMouseMove(((i,r)=>{s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.ws.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Te=this.Ki.engine.setMouseStyle(n,this.Te)})),this.onMouseLeave((()=>{this.Ki.engine.restoreMouseStyle(this.Te),this.Te=void 0})),this.onMouseDrag(((t,e,i,s,n)=>{0===i&&r(0,0,0,n,e)}));const n=Wi(new Yi(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Ds extends Hi{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.bs="Constant Line",this.u=0,this.xe=this.Ji.constantLineStrokeStyle,this.Fe=!0,this.Ie=this.As.De(this.ct).Pe(this.xe).us(this.getHighlight()),this.cs(this.Ie)}setValue(t){return this.u=t,this.P.emit("valueChange",this,this.u),this.As.Ss(),this}getValue(){return this.u}setStrokeStyle(t){this.xe="function"==typeof t?t(this.xe):t;const e=this.xe;return this.Ie.Pe(e),this.As.Ss(),this}getStrokeStyle(){return this.xe}setInteractionMoveByDragging(t){return this.Fe=t,this}getInteractionMoveByDragging(){return this.Fe}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}Ae(){return this.Ie.Oe(this.ws.toVec2(this.u,this.ws.getHeight(this.ct).getInnerStart())).Be(this.ws.toVec2(this.u,this.ws.getHeight(this.ct).getInnerEnd())),this}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{stroke:this.xe}),this}ke(t,e){t.us(e),this.As.Ss()}ks(){const t=(t,e)=>{this.Fe&&(this.u=this.axis.ct.Jt(this.u,this.ws.getWidth(e)),this.P.emit("valueChange",this,this.u),this.As.Ss(),Kt(t))};this.onMouseMove((()=>{if(this.Fe){const t=this.ws.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.Te=this.Ki.engine.setMouseStyle(t,this.Te)}})),this.onMouseLeave((()=>{this.Fe&&(this.Ki.engine.restoreMouseStyle(this.Te),this.Te=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.Fe&&0===s&&t(i,n)}));const i=Wi(new Yi(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},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)},regressive:{start:(t,e,i,s)=>e>t?ie>t?zs.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Le,Vs=t=>void 0!==t.Re,Ns={Ee:Ci.Numeric},Gs=(t,e)=>[t,e],Hs=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{It(t,0)&&(t=0),It(e,0)&&(e=0);const n=[];let o=void 0!==s?((t,e,i)=>t-(t-i)%e)(t,i,s):t;if(i<=0)throw new Error(`_getRegularGreatKeyValues unit less than or equal to 0, unit: ${i}`);for(;o{const r=[];let n=i(t),o=0;for(;n1e3)throw new Error("Infinite loop in Axis tick key values logic.");return r.push(n),r},Xs=(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)}},Ys=(...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))}},js=(t,e)=>{if(e.has(t))return e.get(t);const i=Xe(t.Ve.ze());return e.set(t,i),i},Js=t=>{const e=new Map;if(t!==Ns){for(const i of t.Ne)e.set(i,new Map);for(const i of t.Ge)e.set(i,new Map)}return e};class $s{constructor(t,e,i,s,n,o,h){this.P=new r.Eventer,this.We=Ns,this.He=Os.Empty,this.Ue=new Map,this.$e=new Map,this.je=zs.fitting,this.Ye=!0,this.Xe=j((()=>this.chart.ls.Ss()))(300,X.linear),this.Ze=!0,this.Fi=!0,this.Ke=!1,this.qe=ke,this.Je=!1,this.Qe=!1,this.th=ke,this.ih=ke,this.sh=ke,this.eh={},this.hh=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ue.get(e),l=(t?t.get(a):void 0)||this.rh(a,e);l.oh=!1;const u=this.ah(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.lh=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.dh!==i||!!t.find((t=>t===e)))).map((t=>Le(e,js(t,a))?t:void 0)),y=m.some((t=>void 0!==t))}else y=!1;if(y){let t=!0;const e=m.filter((t=>void 0!==t));if(t&&i.fh&&e.every((t=>Rs(t.dh)))&&(t=!1),t&&i.fh&&i.fh.gh&&!1===i.fh.gh(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.We.Ee(t,this.ct),this.ph=([t,e])=>{this.mh(t,e)},this.chart=t,this.yh=e,this.Ji=s,this.Sh=o,this.ct=i,this.xh=h,"logarithmic"===h.type&&this.setAnimationZoom(X.logarithmic(Ai(h.base))),this.bh=o.numeric,this.Mh("Numeric"),this._h=i.getInnerStart(),this.Ah=i.getInnerEnd(),n&&this.setAnimationsEnabled(!1)}getTitle(){return this.kh.wh()}setTitle(t){return this.kh.Ch(t),this.chart.ls.Ss(),this}getTitleFillStyle(){return this.kh.Th()}setTitleFillStyle(t){return this.kh.Me(t),this.chart.ls.Ss(),this}getTitleFont(){return this.kh.Fh()}setTitleFont(t){return this.kh.Ih(t),this.chart.ls.Ss(),this}setTitleRotation(t){return this.kh.Ph(t),this.chart.ls.Ss(),this}getTitleRotation(){return this.kh.Dh()}setTitleEffect(t){return this.Bh.ys(t),this.chart.ls.Ss(),this}getTitleEffect(){return this.Bh.xs()}Mh(t,e){if(this.Ue.size>0&&this.Oh(),"Empty"===t)this.We=Ns,this.He=t;else if("Numeric"===t){"Numeric"!==this.He&&(this.bh=this.Sh.numeric);const i=e||(t=>t);this.bh=i(this.bh),this.We=this.bh.Lh(this.xh),this.He=t}else if("DateTime"===t){"DateTime"!==this.He&&(this.bh=this.Sh.datetime);const i=e||(t=>t);this.bh=i(this.bh),this.We=this.bh.Lh(this.xh),this.He=t}else if("Time"===t){"Time"!==this.He&&(this.bh=this.Sh.time);const i=e||(t=>t);this.bh=i(this.bh),this.We=this.bh.Lh(this.xh),this.He=t}return this.$e.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.$e=Js(this.We),this.chart.ls.Ss(),this}Rh(){return this.We}Eh(t){this.We=t,this.$e.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.$e=Js(this.We),this.chart.ls.Ss()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.dt(void 0!==e?e:this._h,void 0!==i?i:this.Ah,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}dt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=Math.abs(e-t);if(Math.abs(this.Ah-this._h),void 0!==this.We.zh&&this.We.zh>o){const i=(e+t)/2,s=this.We.zh/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.We.Vh&&this.We.Vhe?-1:1);n={start:i-s,end:i+s}}const h=this.ct.rt(n.start,n.end,this._h,this.Ah,!0);if(!1===h)return this;let a;switch(!0===h||(n=h),r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":a=!0;break;case"zoomBandChart":case"synchronizedAxis":a=!1;break;default:return Me(0,""),this}if(this.Nh&&this.Nh.finishAll(!1),this.Xe&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Nh||this.Nh.isOver()?this.Xe:this.Nh.NextAnimation.bind(this);this.Nh=e([[this._h,n.start],[this.Ah,n.end]],this.ph,t),this.Nh.onAnimationEnd((()=>{this.Nh=void 0,a&&(this.sh=xt.performance.now())})),this.Nh.onAnimationEnd((()=>this.setStopped(s)))}else this.mh(n.start,n.end),s&&this.setStopped(!0),a&&(this.sh=xt.performance.now());return this}getInterval(){return{start:this._h,end:this.Ah}}setStopped(t){return t===this.Ke||(t&&(this.Nh&&this.Nh.finishAll(!1),this.Nh=void 0),this.Ke=t,this.P.emit("stoppedStateChanged",this,this.Ke),this.qe=xt.performance.now(),this.chart.ls.Ss()),this}getStopped(){return this.Ke}onStoppedStateChanged(t){return this.P.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.P.off(t,"stoppedStateChanged")}fit(t,e=!1){const i=this.Gh();if(i){const s=this.Ah>=this._h,r=s?i.min:i.max,n=s?i.max:i.min;this.dt(r,n,t,e,"userFit")}return this}setScrollStrategy(t){return this.je=t,this.chart.ls.Ss(),this}getScrollStrategy(){return this.je}setAnimationScroll(t){return this.Ye=Boolean(t),this.chart.ls.Ss(),this}setAnimationZoom(t,e=300){return this.Nh&&(this.Nh.finishAll(!1),this.Nh=void 0),this.Xe=t?j((()=>this.chart.ls.Ss()))(e,t):void 0,this}setAnimationsEnabled(t){return this.Ze=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(X.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.Ze}setVisible(t){const e=this.Fi!==t;return this.Fi=t,this.kh.setVisible(t),this.Wh((e=>{e.Ve.setVisible(t)})),e&&this.P.emit("visibleStateChanged",this,this.Fi),this}getVisible(){return this.Fi}onIntervalChange(t){return this.P.on("scaleChange",t)}offIntervalChange(t){return this.P.off(t,"scaleChange")}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}Hh(t,e){const i=new Map;if(this.We===Ns||!this.Fi)return this.Oh(),i;e=e||new Map;const s=this.Uh(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.eh.physicalAxisSize=h;const a=Zs(this.We,r,n,this._h,this.Ah,h),l=[];if(this.$h(),l.push(...this.jh(this.We,r,n,a,e,t,i)),this.Yh(this.We,r,n,a,e,t,l,i),this.Xh(),a)for(const[t,e]of this.$e){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.eh.min=r,this.eh.max=n,this.eh.scaleInterval=o,this.eh.physicalAxisSize=h,i}Zh(t){const e=t.dh.Kh;t.Ve.Ch(e(t.u,this.ct)).Ts()}qh(t,e){const i=e.Jh;t.Ve.Me(i.getLabelFillStyle()).Ih(i.getLabelFont()).Ph(i.getLabelRotation())}rh(t,e){const i=this.$e.get(e);let s=i.get(t);s?(i.delete(t),s.dh=e,s.ps(!0)):s=this.Qh(t,e);const r=this.Ue.get(e)||new Map;return r.set(t,s),this.Ue.set(e,r),this.qh(s,e),s}ah(t,e){const i=this.tr(t,e);return this.Zh(t),i}jh(t,e,i,s,r,n,o){const h=[];for(const a of t.Ne){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ue.get(a),l=(t?t.get(s):void 0)||this.rh(s,a),u=this.ah(l,n),c=js(l,r);h.find((t=>Le(c,js(t,r))))&&l.Ve.setVisible(!1),l.oh=!1,o.set(l,u),h.push(l)}}return h}Yh(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Ge){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.fh){m=!1;break}const t=u.fh.ir;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const p=this.lh(y.filter((t=>a.some((e=>It(t.u,e))))),g,u,d,n,h,e,i,r,o,l);!0!==p?t=t.concat(p):(d+=1,f=-1,t=[])}p=t,y.forEach((e=>{t.find((t=>t===e))||this.sr(e)}))}if(l=p,!m)break}}sr(t){const e=this.Ue.get(t.dh);null==e||e.delete(t.u);const i=this.$e.get(t.dh);i&&i.has(t.u)?t.dispose():i&&(t.ps(!1),i.set(t.u,t))}Wh(t){for(const e of this.Ue.values())for(const i of e.values())t(i)}er(t,e){for(const i of this.Ue.values())for(const s of i.values())e=t(e,s);return e}Oh(){this.Ue.forEach(((t,e)=>{t.forEach((t=>this.sr(t)))})),this.Ue.clear()}$h(){for(const t of this.Ue.values())for(const e of t.values())e.oh=!0}Xh(){for(const t of this.Ue.values())for(const[e,i]of t.entries())i.oh&&(i.dispose(),t.delete(e))}Uh(){const t=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart();return y(t,e)}uh(t,e){return!(t.oh||0===t.Ve.wh().length||Rs(e)&&!0!==e.hr)}rr(t,e){return this.We===Ns||(this.We.Ne.forEach((i=>{e=t(e,i.Jh)})),this.We.Ge.forEach((i=>{(t=>void 0!==t.Kh)(i)&&(e=t(e,i.Jh))}))),e}Gh(){let t=this.yh.nr();const e=this.yh.ar();let i;if(void 0!==t&&vt(t)&&void 0!==e&&vt(e)&&("logarithmic"===this.xh.type&&(0===t&&(t=Math.min(1,e)),Math.sign(t)!==Math.sign(e)&&(t=Math.min(1,e-.1))),i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,e)):i=y(t,e)),i&&vt(i.min)&&vt(i.max))return It(i.min,i.max)?{min:i.min-1,max:i.max+1}:i}lr(){let t=0;const e=this.yh.ur();return e&&(t=Math.max(t,e)),t}cr(){const t=this.Je;let e=!1;if(this.je&&!this.Ke){const t=this.Gh();if(t){const i=this._h,s=this.Ah;let r=this.je.start(i,s,t.min,t.max),n=this.je.end(i,s,t.min,t.max);const o=!1===It(i,r),h=!1===It(s,n);if(r=o?r:i,n=h?n:s,o||h){let t=!1;if(this.Ye)if(this.Ye){t=!0;const a=o?this.dr(i,r):i,l=h?this.dr(s,n):s;if(!0===this.mh(a,l,{allowClamping:!1})&&(o&&!1===It(a,r)||h&&!1===It(l,n))){this.chart.ls.Ss(!0),e=!0;let t=Math.abs(n-r)/Math.abs(a-l);t<1&&(t=1/t),this.Qe=t>=1.4}}else t=!1;t||this.mh(r,n)}}}e?(this.Je!==e&&(this.Je=e,this.th=xt.performance.now()),this.gr&&(clearTimeout(this.gr),this.gr=void 0)):!0===t&&void 0===this.gr&&(this.Qe=!1,this.gr=setTimeout((()=>{!1!==this.Je&&(this.Je=!1,this.th=xt.performance.now()),this.gr=void 0,this.chart.ls.Ss()}),200))}mh(t,e,i){const s=!i||!("allowClamping"in i)||void 0===i.allowClamping||i.allowClamping;let r={start:t,end:e},n=!0;const o=Math.abs(e-t),h=Math.abs(this.Ah-this._h);if(void 0!==this.We.zh&&this.We.zh>o){const i=(e+t)/2,o=(s?this.We.zh/2:h/2)*(t>e?-1:1);r={start:i-o,end:i+o},n=!1}if(void 0!==this.We.Vh&&this.We.Vhe?-1:1);r={start:i-o,end:i+o},n=!1}let a=this.ct.rt(r.start,r.end,this._h,this.Ah,s);if(!1===a)return!1;!0!==a&&(r=a);const l=this.lr(),u=this.pr(Math.min(r.start,r.end),Math.max(r.start,r.end),l);return a=this.ct.rt(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min,this._h,this.Ah,!1),!!a&&(!0===a?this.ct.Z(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min):this.ct.Z(r.start,r.end),this._h=r.start,this.Ah=r.end,this.P.emit("scaleChange",this,r.start,r.end),this.ih=xt.performance.now(),this.chart.ls.Ss(),n)}mr(){return this.Je}yr(){return void 0!==this.Nh}}class qs{constructor(t,e,i,s,r=i.Sr(s).setMouseInteractions(!1)){this.oh=!1,this.Ti=!1,this.Qi=[],this.dh=t,this.u=e,this.br=i,this.vr=s,this.Ve=r,this.Qi.push(r)}ps(t){this.Qi.forEach((e=>e.setVisible(t)))}dispose(){return this.Ti||(this.Ti=!0,this.Qi.forEach((t=>t.dispose()))),this}}const Zs=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Ne){let t=n.Mr(e,i,s,r);t=Ks(t),o.set(n,t)}let h;for(const s of t.Ge){let t;if(void 0===h)t=s.Mr(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._r&&s._r>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Qs=s.Record({type:"font",size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class tr extends Qs{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 er=t=>!(!t||"object"!=typeof t||!("type"in t)||"font"!==t.type),ir=new tr,sr=new class{},rr=s.Record({type:"triangulated-points-3d",shape:"sphere",size:10,fillStyle:new V,wireframeStyle:st});class nr extends rr{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 or=t=>!(!t||"object"!=typeof t||!("type"in t)||"triangulated-points-3d"!==t.type),hr=s.Record({type:"pixelated-points-3d",size:5,fillStyle:new V});class ar extends hr{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 lr=t=>!(!t||"object"!=typeof t||!("type"in t)||"pixelated-points-3d"!==t.type),ur={Triangulated:nr,Pixelated:ar};class cr{constructor(t){this.Ar=new Map,this.ls=t}ns(t,e,i){const s=i.animationEnabled;this.Ar.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.Ar.delete(t),t.offDispose(r)}))}wr(t,e){const i=e.animationEnabled,s=[],r=t.onDispose((()=>{s.forEach((t=>{this.Ar.delete(t)})),t.offDispose(r)}));return{kr:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.Ar.set(t,r)}}}vs(t,e){const i=this.Ar.get(t);i&&(i.curUnanimatedHighlightValue=ve(e),this.ls.Ss())}fs(t,e=!1){const i=this.Ar.get(t);return i?e?i.curAnimatedHighlightValue:i.curUnanimatedHighlightValue:0}Ms(t,e){const i=this.Ar.get(t);i&&(i.animationEnabled=e)}_s(t){const e=this.Ar.get(t);return!!e&&e.animationEnabled}Ts(t){let e=!1;this.Ar.forEach(((i,s)=>{let r;if(i.animationEnabled){const s=1e3;if(i.curUnanimatedHighlightValue>0){const n=i.curAnimationPositionMillis/s;r=i.curUnanimatedHighlightValue*Math.abs(Math.sin(n*Math.PI/2+.5));const o=0===i.curAnimatedHighlightValue?1:t;i.curAnimationPositionMillis+=o,e=!0}else i.curAnimatedHighlightValue>0&&0===i.curUnanimatedHighlightValue?(r=Math.max(i.curAnimatedHighlightValue-t/s,0),e=e||r>0):r=0,i.curAnimationPositionMillis=0}else r=i.curUnanimatedHighlightValue;r!==i.curAnimatedHighlightValue&&(i.applyHighlight(r),i.curAnimatedHighlightValue=r)})),e&&this.ls.Ss(!0)}}const dr=new Map,fr=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),r=t.getStyle(),n=t.getVariant(),o=`${r} ${n?"small-caps":"normal"} ${s} ${e}px ${i}`;let h=dr.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{type:"font",size:e,family:i,style:r,variant:n,weight:s}),dr.set(o,h)),h};var gr,yr;!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"}(gr||(gr={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(yr||(yr={}));const pr=t=>({container:t.Cr,scale:t.ct,setMouseStyle:(e,i)=>t.Tr(e,i),restoreMouseStyle:e=>t.Fr(e),clientLocation2Engine:(e,i)=>t.Ce(e,i),engineLocation2Client:(e,i)=>t.Ir(e,i),captureFrame:(e,i)=>t.Pr(e,i),renderFrame:(e,i,s=!1)=>t.Dr(e,i,s),layout:()=>{t.Br(),t.Or()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.Lr(e,i)}),mr=[];let Sr;const xr=()=>{if(void 0!==Sr){const t=xt.getComputedStyle(xt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));Sr.style.height=xt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Ss()),60),this.zr=u(0,0),this.Vr=void 0,this.Nr=Et,this.Gr=()=>{},this.Wr=[],this.Hr=-1,this.Ur=[],this.$r=!0,this.Ti=!1,this.Or=()=>{const{bottom:t,left:e}=this.jr().getBoundingClientRect();return this.zr=u(Math.floor(e),Math.floor(t)),this},this.Br=()=>{this.Yr&&this.Yr()},this.Tr=(t,e)=>{if(!e){this.Cr.style.cursor=t;const e=this.Hr;return this.Hr+=1,this.Ur.push([e,t]),e}return this.Fr(e),this.Tr(t)},this.Fr=t=>{const e=t?this.Ur.findIndex((e=>e[0]===t)):-1;e>=0?(this.Ur.splice(e,1),this.Ur.length>0?this.Cr.style.cursor=this.Ur[this.Ur.length-1][1]:this.Cr.style.cursor="default"):(this.Ur.push([0,"default"]),this.Cr.style.cursor="default")},this.Xr=t=>(this.Zr.S(t),this),this.Kr=()=>this.Zr.M(),this.qr=()=>{this.Nr&&this.Nr(1e3/60),this.Jr(),this.Qr(),this.Gr&&this.Gr()},this.tn=t=>(this.Rr.set(t.sn(),t),this.Rr=new Map([...this.Rr.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.en=t=>(this.Rr.delete(t),this),this.Y=()=>(this.Zr.o=!1,this),this.X=()=>(this.Zr.o=!0,this),this.hn=t=>{if(!this.$r)return;const e=this.rn,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.Ce(t.clientX,t.clientY),r=this.nn(t,{x:t.clientX,y:t.clientY});if(this.an&&((null==r?void 0:r.entity)!==this.an.entity||r.collectionMember!==this.an.collectionMember)&&!this.ln){this.an.entity.Ii=!1;const e=this.an.entity.un;e&&e(this.an.entity,t,this.an.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.ln)if(r.entity.Ii){if(!i){const e=r.entity.cn;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Ii=!0;const e=r.entity.dn;e&&e(r.entity,t,r.collectionMember)}if(this.ln){const i=this.ln.entity.fn,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.ln.entity,t,this.ln.button,this.ln.startLocation,s,this.ln.collectionMember)}this.gn=t,this.rn=t,this.pn=s,this.an=r},this.mn=t=>{if(this.$r=!1,this.pn=void 0,this.gn=t,this.rn=void 0,this.ln){const e=this.ln.entity.yn;e&&e(this.ln.entity,t,this.ln.button,this.ln.startLocation,this.ln.collectionMember),this.ln.entity.Ii=!1;const i=this.ln.entity.un;i&&i(this.ln.entity,t,this.ln.collectionMember),this.ln=void 0}if(this.Sn){const e=this.Sn.entity.xn;e&&e(this.Sn.entity,t,this.Sn.collectionMember),this.Sn=void 0}if(this.an){this.an.entity.Ii=!1;const e=this.an.entity.un;e&&e(this.an.entity,t,this.an.collectionMember),this.an=void 0}},this.bn=t=>{this.$r=!0,this.gn=t},this.vn=()=>this.pn,this.Ji=t.theme,this.Mn=e.Mn,this._n={An:e.An,wn:e.wn,kn:e.kn,Cn:e.Cn,Tn:e.Tn,Fn:e.Fn,In:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,Hs:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:`${xt.location.origin}/resources`,Pn:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings,Dn:(()=>{const e=null==t?void 0:t.pickingPrecision;if("string"==typeof e){const t=e.toLowerCase();if("best"===t)return 1;if("high"===t)return.5;if("low"===t)return 1/8}return 1/4})(),Bn:void 0===(null==t?void 0:t.interactable)||t.interactable,On:void 0===t.textPixelSnappingEnabled||t.textPixelSnappingEnabled};const i=t?t.container:void 0;if(i){if("string"==typeof i){const t=xt.document.getElementById(i);if(!t)throw new Error(`Container "${i}" doesn't exist.`);this.Cr=t}else this.Cr=i;xt.addEventListener("resize",this.Br),this.Wr.push((()=>{xt.removeEventListener("resize",this.Br)}))}else{if(void 0===Sr){const t=xt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",xt.document.body.appendChild(t),Sr=t,xt.addEventListener("resize",xr)}let t=1;for(;null!==xt.document.getElementById(`chart-${t}`);)t+=1;this.Cr=xt.document.createElement("div"),this.Cr.id=`chart-${t}`,this.Cr.style.flex="1",Sr.appendChild(this.Cr),xr(),mr.push(this.Br),this.Wr.push((()=>{Sr&&Sr.removeChild(this.Cr),mr.includes(this.Br)&&mr.splice(mr.indexOf(this.Br),1),0===mr.length&&Sr&&(xt.document.body.removeChild(Sr),Sr=void 0,xt.removeEventListener("resize",xr))}))}if(xt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Cr&&this.Br()};this.Ln=new xt.ResizeObserver(t.bind(this)),this.Ln.observe(this.Cr)}""===this.Cr.style.position&&(this.Cr.style.position="relative"),this.Cr.style.boxSizing="content-box",this.Cr.addEventListener("fullscreenchange",this.Br),this.Cr.addEventListener("webkitfullscreenchange",this.Br);const s=t?t.maxFps:void 0;this.Rn=s?-1===s?-1:0!==s?1e3/s:0:0;const n=new Map;let o=!1;const h=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":n.set(i.pointerId,s);break;default:n.delete(i.pointerId),o=!1}switch(i.interactions=Array.from(n.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(o=!0)};if(this.Cr.onwheel=this.En(gr.wheel),this.Cr.oncontextmenu=this.En(gr.contextmenu),this.Cr.onclick=this.En(gr.click),this.Cr.ondblclick=this.En(gr.dbclick),this.Cr.onlostpointercapture=()=>{o=!1},this.Cr.ontouchmove=t=>{o&&t.preventDefault()},this.Cr.onpointerover=h(),this.Cr.onpointerenter=h(this.bn),this.Cr.onpointerdown=h(this.En(gr.mouseDown),this.zn(yr.touchStart)),this.Cr.onpointermove=h(this.hn,this.zn(yr.touchMove)),this.Cr.onpointerup=h(this.En(gr.mouseUp),this.zn(yr.touchEnd)),this.Cr.onpointercancel=h(),this.Cr.onpointerout=h(),this.Cr.onpointerleave=h(this.mn,this.zn(yr.touchEnd)),!xt.requestAnimationFrame||!xt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");xt.addEventListener("scroll",this.Or),this.Zr=m(new M({r:0,g:0,b:0,a:0})),this.os=new cr(this)}Vn(){return this.Nn}Gn(){return this.Wn}setBackgroundFillStyle(t){return this.Hn.Me(t),this}getBackgroundFillStyle(){return this.Hn.Th()}setBackgroundStrokeStyle(t){return this.Hn.ve(t),this}getBackgroundStrokeStyle(){return this.Hn.Un()}$n(t){return this.Gr=t,this}jn(t){return this.Nr=t,this}Yn(t){return this.Rr.get(t)}Xn(){return Array.from(this.Rr.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}En(t){return e=>this.Zn(t,e)}Zn(t,e){if(!this.$r)return;t===gr.contextmenu&&Kt(e);const i=this.Ce(e.clientX,e.clientY),s=this.nn(e,{x:e.clientX,y:e.clientY});if(t===gr.mouseUp){if(this.ln){const t=this.ln.entity.yn;if(t&&t(this.ln.entity,e,this.ln.button,this.ln.startLocation,this.ln.collectionMember),(null==s?void 0:s.entity)!==this.ln.entity||s.collectionMember!==this.ln.collectionMember){this.ln.entity.Ii=!1;const t=this.ln.entity.un;t&&t(this.ln.entity,e,this.ln.collectionMember)}this.ln=void 0}if(this.Sn){const t=this.Sn.entity.getMouseInteractions()&&this.Sn.entity.xn;t&&t(this.Sn.entity,e,this.Sn.collectionMember),this.Sn=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===gr.click?s.entity.Kn:t===gr.dbclick?s.entity.qn:t===gr.mouseDown?s.entity.Jn:t===gr.wheel?s.entity.Qn:t===gr.contextmenu?s.entity.io:void 0;if(i&&i(s.entity,e,s.collectionMember),t===gr.mouseDown){this.Sn={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Sn.event.button,i=s.entity.so;i&&i(s.entity,e,t,s.collectionMember),this.ln={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this.gn=e,this.pn=i,this.an=s}zn(t){return e=>this.eo(t,e)}eo(t,e){const i=e.interactions.length;if(this.ho=e,this.ro){const s=t===yr.touchMove?this.ro.entity.no:t===yr.touchEnd?this.ro.entity.oo:t===yr.touchStart?this.ro.entity.ao:void 0;s&&s(this.ro.entity,e,this.ro.collectionMember),t===yr.touchEnd&&0===i&&(this.ro.entity.Ii=!1,this.ro=void 0)}else if(t===yr.touchStart){for(let t=0;t{t()})),this.Wr.length=0,this.Vr&&xt.cancelAnimationFrame(this.Vr)}Ce(t,e){return u(t-this.zr.x,this.zr.y-e)}Ir(t,e){return u(t+this.zr.x,this.zr.y-e)}do(t){const e=this.Ce(t.clientX,t.clientY);return{engineX:e.x,engineY:e.y}}fo(t){const e=this.Ir(t.engineX,t.engineY);return{clientX:e.x,clientY:e.y}}}const Ar=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=si(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=si(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=si(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=si(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?Cr.Nearest:"nearest-x"===t?Cr.NearestX:"nearest-y"===t?Cr.NearestY:void 0;return void 0!==e?e:Cr.NearestX},kr=(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===Cr.Nearest)return Fr(t,e,n,o,c,d);if(i===Cr.NearestX||i===Cr.NearestY){if("boolean"==typeof l&&("x"===a&&i===Cr.NearestX||"y"===a&&i===Cr.NearestY))return Lr(t,at(e,o,n),a,l,c,d);if(i===Cr.NearestX)return Br(t,at(e,o,n),h,c,d);if(i===Cr.NearestY)return _r(t,at(e,o,n),h,c,d)}},Fr=(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=at(r,i,s),n=(t.x-e.x)**2+(t.y-e.y)**2;n{if(e.xi.max.x)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.x>e.x?s.x-e.x:e.x-s.x;r{if(e.yi.max.y)return;let n,o=Number.MAX_VALUE;for(let i=s;i<=r;i+=1){const s=t[i],r=s.y>e.y?s.y-e.y:e.y-s.y;r{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,y=Math.floor((r+n)/2),p=n,m=-1;for(;;){const e=h-(o?t[y].x:t[y].y);if(e*(s?-1:1)>0)g=Math.min(y+1,p),m=Math.floor((g+p)/2);else{if(0===Math.abs(e))return y;p=Math.max(y-1,g),m=Math.floor((g+p)/2)}if(m===y){const i=y>r?Math.abs(h-(o?t[y-1].x:t[y-1].y)):Pe,s=y{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,y=Math.floor((r+n)/2),p=n,m=-1;for(;;){const i=h-(o?t[y].x:t[y].y);if(i*(s?-1:1)>0)g=Math.min(y+1,p),m=Math.floor((g+p)/2);else{if(0===Math.abs(i))return{a:y,b:y,lerpAmount:0};p=Math.max(y-1,g),m=Math.floor((g+p)/2)}if(m===y){if(i*(s?-1:1)<0&&y>r){const i=t[y-1],s=t[y];return{a:y-1,b:y,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(ythis.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.ls=t,this.bo=e,this.vo=i,this.Mo=zr,zr+=1,this._o=t.Ji.highlightColorOffset}Ao(t){return void 0!==this.vo.find((e=>e.type===t))}wo(t,e){var i;return!!this.Ao(t)&&!0===e(null===(i=this.vo.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.Ti||(this.Ii&&this.un&&this.un(this,void 0,void 0),this.Ti=!0,this.bo(this),this.P.emit("dispose",this)),this}setVisible(t){const e=this.Fi;return this.Fi=t,!t&&e&&(this.Ii&&this.un&&this.un(this,void 0,void 0),this.Ii=!1),this}getVisible(){return this.Fi}setMouseInteractions(t){const e=this.po.M();return this.po.S(t),t||(e&&this.Ii&&this.un&&this.un(this,void 0,void 0),this.Ii=!1),this}getMouseInteractions(){return this.po.M()}getIsUnderMouse(){return this.Ii}getIsGrabbed(){return this.yo}setMouseMoveEventHandler(t){return this.cn=t,this}setMouseEnterEventHandler(t){return this.dn=t,this}setMouseLeaveEventHandler(t){return this.un=t,this}setMouseClickEventHandler(t){return this.Kn=t,this}setMouseDoubleClickEventHandler(t){return this.qn=t,this}setMouseDownEventHandler(t){return this.Jn=t,this}setMouseUpEventHandler(t){return this.xn=t,this}setMouseWheelEventHandler(t){return this.Qn=t,this}setMouseContextMenuEventHandler(t){return this.io=t,this}setMouseDragEventHandler(t){return this.fn=t,this}setMouseDragStartEventHandler(t){return this.so=t,this}setMouseDragStopEventHandler(t){return this.yn=t,this}setTouchStartEventHandler(t){return this.ao=t,this}setTouchMoveEventHandler(t){return this.no=t,this}setTouchEndEventHandler(t){return this.oo=t,this}ko(t){return this.So=t,this}Co(){return this.So?this.So:Rr}us(t){return this.xo=t,this}To(){return this.xo}Fo(t){return this._o=t,this}Io(){return this._o}}const Rr=y(u(0,0),u(0,0));class Vr extends Or{constructor(t,e,i,s){super(t,i,s),this.Po=0,this.As=e,this.As.Do=!0}Bo(t){return this.Po===t||(this.Po=t,this.As.Do=!0),this}Oo(){return this.Po}}class Nr extends Vr{constructor(t,e,i,s,r){super(t,e,s,r),this.Lo=!0,this.ct=i}}const Gr=(t,e,i)=>{if(i instanceof _i){const s=i.Ai(),r=oi(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return y(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return y(i.Jt(u(t.min.x,t.min.y),si(e,-1)),i.Jt(u(t.max.x,t.max.y),e))},Hr=(t,e)=>"function"==typeof e?e(t):e,Ur=(t,e)=>!t||t!==e,Wr=(t,e)=>t===z&&e!==z,Xr=t=>t!==z;class Yr extends Nr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Se=vr.fillStyle,this.ls=t}Me(t){return this.Se=Hr(this.Se,t),this}Th(){return this.Se}Ro(){return Ur(this.Eo,this.Se)}zo(){return Wr(this.Eo,this.Se)}Vo(){return Xr(this.Se)}No(t){this.Eo=t}}class jr extends Yr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xe=vr.lineStyle,this.ls=t}ve(t){return this.xe="function"==typeof t?t(this.xe):t,this}Un(){return this.xe}Go(){return!this.Wo||this.Wo!==this.xe}Ho(t){return!this.Wo||this.Wo.getThickness()!==t}Vo(){return this.xe!==st||super.Vo()}zo(){return(this.xe!==st||this.Se!==z)&&this.Wo===st&&this.Eo===z}Uo(t){this.Wo=t}}class Jr extends Yr{constructor(t,e,i,s,r,n=m(5)){super(t,e,i,s,r),this.size=m(5),this.size=n}q(t){return this.size.S(t),this}}class $r extends Yr{constructor(t,e,i,s,r,n=m(vr.font)){super(t,e,i,s,r),this.$o=m(""),this.jo=m(u(0,0)),this.Yo=m(0),this.Xo=m(0),this.Zo=m(u(0,0)),this.Ko=m(0),this.qo=m(ir),this.Jo=u(0,0),this.Ft=m(S(1,1,1,1)),this.Qo=m(x(4,4,4,4)),this.font=m(vr.font),this.ta=!1,this.font=n}Vo(){return Xr(this.Se)&&this.$o.M().length>0}zo(){return!1===this.ta&&this.Vo()}Ch(t){return this.$o.S(t),this}wh(){return this.$o.M()}Ih(t){return er(t)?this.qo.S(t):this.qo.S(t(this.qo.M())),this}Fh(){return this.qo.M()}ia(t){return this.qo.S(this.qo.M().setFamily(t)),this}sa(){return this.qo.M().getFamily()}ea(t){return this.qo.S(this.qo.M().setSize(t)),this}ha(){return this.qo.M().getSize()}ra(t){return this.qo.S(this.qo.M().setWeight(t)),this}na(){return this.qo.M().getWeight()}oa(t){return this.qo.S(this.qo.M().setStyle(t)),this}aa(){return this.qo.M().getStyle()}la(t){return this.qo.S(this.qo.M().setVariant(t)),this}ua(){return this.qo.M().getVariant()}we(t){return this.jo.S(t),this}ca(){return this.jo.M()}Ph(t){return this.Ko.S(t),this}Dh(){return this.Ko.M()}da(t,e){return this.Zo.S(u(t,e)),this}fa(){return this.Zo.M()}ga(t){return this.Xo.S(t),this}pa(){return this.Xo.M()}ma(t){return this.Yo.S(t),this}ya(){return this.Yo.M()}Sa(t){return this.Xo.S(t.x),this.Yo.S(t.y),this}xa(t){return this.Ft.S(t),this}ba(){return this.Ft.M()}va(t){return this.Qo.S(t),this}Ma(){return this.Qo.M()}}class qr extends Jr{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,m(o)),this._a=[],this.Aa=m(e.PointShape.Square),this.Ko=m(0),this.wa=m(!1),this.ka=m(!1),this.Ca=m(!1),this.Ta=Fe,this.Fa=0,this.Ia=[],this.Pa=0,this.Da=Fe,this.Ba=Cr.Nearest,this.Oa=!1}La(t){return this.Ba=t,this}Ra(){return this.Ia}Ea(){return this._a}za(t){return this.Aa.S(t),this}Ph(t){return this.Ko.S(t),this}Va(t){return this.wa.S(t),this}Na(t){return this.ka.S(t),this}Ga(t){return this.Ca.S(t),this}Wa(t,e){return Array.isArray(t)||(t=[t]),this.Pa+=t.length,this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Da&&(this.Da=e?je(this.Da,e):void 0),this}Ha(){return this.Oa=!0,this._a.length=0,this.Fa=0,this.Ta=Fe,this.Ia=[],this.Pa=0,this}Ua(){return this.Fa}$a(){return this.Pa}}class Zr extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jo=m(u(0,0)),this.j=m(u(100,100)),this.Ko=m(0),this.Jo=m(u(0,0)),this.ja=!1}Ts(){return this.Ya(),this}we(t){const e=this.jo.M();return t.x===e.x&&t.y===e.y||(this.jo.S(t),this.Ya()),this}ca(){return this.jo.M()}Xa(t){const e=this.jo.M();return t!==e.x&&(this.jo.S(u(t,e.y)),this.Ya()),this}Za(t){const e=this.jo.M();return t!==e.y&&(this.jo.S(u(e.x,t)),this.Ya()),this}q(t){const e=this.j.M();return t.x===e.x&&t.y===e.y||(this.j.S(u(t.x,t.y)),this.Ya()),this}Ht(){return this.j.M()}Ka(t){const e=this.j.M();return t!==e.x&&(this.j.S(u(t,e.y)),this.Ya()),this}qa(t){const e=this.j.M();return t!==e.x&&(this.j.S(u(e.x,t)),this.Ya()),this}Ph(t){return this.Ko.S(t),this}Dh(){return this.Ko.M()}Ja(t){const e=this.Jo.M();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.ja=!1,this.Ya()):(this.ja=!0,this.Jo.S(t))),this}Ya(){if(!this.ja){const t=this.jo.M(),e=this.j.M(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.Jo.M();i.x===s.x&&i.y===s.y||this.Jo.S(i)}}}class Kr extends jr{constructor(){super(...arguments),this._a=[],this.jo=m(u(0,0)),this.Ta=Fe,this.Qa=!1}tl(t){return t=ie(t),this._a=t,this.Qa=!0,this}il(){return this._a}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}}class Qr extends Kr{}class tn extends Yr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.hl=new Array,this.rl=new Array,this.nl=m({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Ta=Fe,this.ol=0,this.al=!1,this.Ia=[Array(),Array()],this.ll=!1,this.ul=(new V).setColor(w(42,171,240)),this.Oa=!1,this.cl=!1,this.dl=!1}Wa(t,e){const i=this.ol-1,s=i>0&&!this.ll;let[r,n]=s?[[this.hl[i]],[this.rl[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=he(r,e,{canReturnB:!0}),n=he(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.ll?(this.Ia[0]=he(this.Ia[0],r,{canReturnB:!0}),this.Ia[1]=he(this.Ia[1],n,{canReturnB:!0})):(this.Ia=[r,n],this.ll=!0),this.Ta=je(this.Ta,e||je(Xe(r),Xe(n))),this}Ha(){return this.Oa=!0,this.hl.length=0,this.rl.length=0,this.ol=0,this.Ta=Fe,this}Ea(){return[this.hl,this.rl]}Ra(){return[this.Ia[0],this.Ia[1]]}fl(t){return this.nl.S(t),this}pl(){return this.nl.M()}ml(t){return this.ul="function"==typeof t?t(this.ul):t,this}yl(){return this.ul}Ua(){return this.ol-(Number(this.cl)+Number(this.dl))}$a(){return this.Ia.length}Sl(t){return this.cl=t,this}xl(){return this.cl}bl(t){return this.dl=t,this}vl(){return this.dl}zo(){return this.Eo===z&&this.Ml===z&&(this.Se!==z||this.ul!==z)}_l(t){this.Ml=t}Vo(){return this.ul!==z||super.Vo()}Ro(){return super.Ro()||!this.Ml||this.Ml!==this.ul}}class en extends jr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jo=m(u(0,0)),this.Al=m(0),this.ci=m(360),this.wl=m(100),this.kl=m(100),this.Cl=m(0),this.Tl=m(void 0),this.Fl=u(0,0),this.Il=u(0,0),this.Pl=u(0,0)}Dl(){return this.wl.M()}Bl(){return this.kl.M()}ca(){return this.jo.M()}Ol(){return this.Al.M()}ui(){return this.ci.M()}Ll(){return this.Cl.M()}Rl(){return this.Tl.M()}El(){return this.Fl}zl(){return this.Il}Vl(){return this.Pl}we(t){return this.jo.S(t),this}Nl(t){return this.Al.S(t),this}Be(t){return this.ci.S(t),this}Gl(t){return this.kl.S(t),this.wl.S(t),this}Wl(t){return this.wl.S(t),this}Hl(t){return this.kl.S(t),this}Ul(t){return this.Cl.S(t<0?0:t),this}$l(t){return this.Tl.S(void 0!==t&&t<=0?void 0:t),this}}var sn;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(sn||(sn={}));class rn extends Nr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jl=vr.lineStyle,this.engine=t}Pe(t){return this.jl=((t,e)=>"function"==typeof e?e(t):e)(this.jl,t),this}Yl(){return this.jl}Go(){return((t,e)=>!t||t!==e)(this.Xl,this.jl)}Zl(t){return((t,e)=>!t||t.getThickness()!==e)(this.Xl,t)}zo(){return((t,e)=>t===st&&e!==st)(this.Xl,this.jl)}Vo(){return(t=>t!==st&&t.getFillStyle()!==z)(this.jl)}Kl(t){this.Xl=t}}class nn extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fi=u(0,0),this.ci=u(0,0),this.ql=!1}S({min:t,max:e}){return t.x===this.fi.x&&t.y===this.fi.y&&e.x===this.ci.x&&e.y===this.ci.y||(this.ql=!0,this.fi=t,this.ci=e),this}di(){return this.fi}ui(){return this.ci}Oe(t){return t.x===this.fi.x&&t.y===this.fi.y||(this.ql=!0,this.fi=t),this}Be(t){return t.x===this.ci.x&&t.y===this.ci.y||(this.ql=!0,this.ci=t),this}}class on extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r)}}class hn extends rn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Jl=[],this.Ta=Fe,this.Ia=new Array,this.Fa=0,this.Ba=Cr.NearestX,this.Oa=!1,this.Ql=m(void 0),this.cl=!1,this.dl=!1}tu(t){return this.Ql.S(t),this}iu(){return this.Ql.M()}Ra(){return this.Ia}Ea(){return this.Jl}La(t){return this.Ba=t,this}Ha(){return this.Oa=!0,this.Jl.length=0,this.Fa=0,this.Ia=[],this.Ta=Fe,this}Ua(){return this.Fa-(Number(this.cl)+Number(this.dl))}$a(){return this.Ia.length}Sl(t){return this.cl=t,this}xl(){return this.cl}bl(t){return this.dl=t,this}vl(){return this.dl}}class an extends Yr{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ol=0,this.su=0,this.j=m({x:0,y:0}),this.eu=m({x:0,y:0}),this.hu=m({x:0,y:0}),this.fi={x:0,y:0},this.ci={x:0,y:0},this.ru=!0,this.nu=!0,this.ou=!0,this.Ta=Fe,this.au=!0,this.lu=z}uu(t){return this.lu=Hr(this.lu,t),this}cu(){return this.lu}S(t){return ln.S(this,t,((t,e)=>({x:t,y:e}))),this}du(){return ln.du(this)}fu(){return ln.fu(this)}ca(){return ln.ca(this)}$a(){return ln.$a(this)}gu(t,e,i){return ln.gu(this,t,e,i),this}pu(t,e,i){return ln.pu(this,t,e,i),this}mu(t,e){return ln.mu(this,t,e),this}yu(t,e){return ln.yu(this,t,e),this}Su(t,e){return ln.Su(this,t,e),this}Ha(){return ln.Ha(this,((t,e)=>({x:t,y:e}))),this}xu(){return ln.xu(this)}bu(){return ln.bu(this)}vu(){return ln.vu(this)}Ua(){return ln.Ua(this)}zo(){return ln.zo(this)}Vo(){return ln.Vo(this)}Mu(){return this._u}Au(){return this.wu}}const ln={S(t,e,i){t.ru=!0,t.nu=!0,t.ou=!0;const{start:s}=e,{end:r}=e,{rows:n}=e,{columns:o}=e;t.au=e.pixelate;const h={x:e.pixelate&&o>=1||!e.pixelate&&o>1?o:0,y:e.pixelate&&n>=1||!e.pixelate&&n>1?n:0};t.eu.S(h),t.fi={...s},t.ci={...r},t.j.S(ni(r,s)),ln.ku(t,i)},ku(t,e){const i=t.eu.M();if(i.x>0&&i.y>0){t._u?t._u.length=0:t._u=[];const s=t.au?ri(i,{x:1,y:1}):{x:i.x,y:i.y};t.hu.S(s),t._u=Array.from(Array(s.y)).map((()=>Array(s.x))),t.wu=Array.from(Array(i.y)).map((()=>Array(i.x))),ln.Cu(t,i,s,e),t.ol=s.x*s.y,t.su=i.x*i.y}else t._u=void 0,t.hu.S({x:0,y:0})},Cu(t,e,i,s){const r=t.fi,n=t.ci,o=t._u,h=t.wu;if(o){const e=i.x,h=i.y,{x:a,y:l}=t.j.M(),u={x:a/(e-1),y:l/(h-1)};for(let t=0;tt.eu.o||t.hu.o,fu(t){const e=t.eu.M();return{columns:e.x,rows:e.y}},ca(t){const e=t.fi,i=t.ci;return{start:{x:e.x,y:e.y},end:{x:i.x,y:i.y}}},$a(t){throw new Error("Method not implemented.")},gu(t,e,i,s){const r="geometry"===i||"y"===i?t._u:t.wu;if(r){const n=t.hu.M();if("y"===i){const t=_t(r);for(let i=0;iBt(t,e)));const o=r===t._u?t.hu.M():t.eu.M(),h={column:{start:o.x-e,end:o.x},row:{start:0,end:o.y}},a=(t=>{const e=t.length,i=e>0?t[0].length:0,s=Array.from(Array(i)).map((()=>Array(e)));for(let r=0;r0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;at.ol,Ua:t=>t.su,zo:t=>Wr(t.Eo,t.Se)||Wr(t.Iu,t.lu),Vo:t=>Xr(t.Se)||Xr(t.lu)},un=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 cn{constructor(){this.Fi=!0,this.P=new r.Eventer,this.Pu=0,this.Du=(t,e)=>{0===this.Pu&&this.P.emit("mouseEnter",this,e),this.Pu+=1},this.Bu=(t,e)=>{this.Pu-=1,this.Pu<1&&(this.P.emit("mouseLeave",this,e),this.Pu=0)},this.Ou=(t,e)=>{this.P.emit("mouseClick",this,e)},this.Lu=(t,e)=>{this.P.emit("mouseDoubleClick",this,e)},this.Ru=(t,e)=>{this.P.emit("mouseDown",this,e)},this.Eu=(t,e)=>{this.P.emit("mouseUp",this,e)},this.zu=(t,e)=>{this.P.emit("mouseMove",this,e)},this.Vu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.Nu=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Gu=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Wu=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.Hu=(t,e)=>{this.Pu+=1,this.P.emit("touchStart",this,e)},this.Uu=(t,e)=>{this.P.emit("touchMove",this,e)},this.$u=(t,e)=>{this.Pu-=1,this.P.emit("touchEnd",this,e)},this.ju=t=>(t instanceof Nr?t.setMouseEnterEventHandler(this.Du).setMouseLeaveEventHandler(this.Bu).setMouseClickEventHandler(this.Ou).setMouseDoubleClickEventHandler(this.Lu).setMouseDownEventHandler(this.Ru).setMouseUpEventHandler(this.Eu).setMouseMoveEventHandler(this.zu).setMouseDragEventHandler(this.Nu).setMouseDragStartEventHandler(this.Vu).setMouseDragStopEventHandler(this.Gu).setMouseWheelEventHandler(this.Wu).setTouchStartEventHandler(this.Hu).setTouchMoveEventHandler(this.Uu).setTouchEndEventHandler(this.$u):(t.onMouseEnter(this.Du),t.onMouseLeave(this.Bu),t.onMouseClick(this.Ou),t.onMouseDoubleClick(this.Lu),t.onMouseDown(this.Ru),t.onMouseUp(this.Eu),t.onMouseMove(this.zu),t.onMouseDrag(this.Nu),t.onMouseDragStart(this.Vu),t.onMouseDragStop(this.Gu),t.onMouseWheel(this.Wu),t.onTouchStart(this.Hu),t.onTouchMove(this.Uu),t.onTouchEnd(this.$u)),t)}onMouseEnter(t){return this.P.on("mouseEnter",t)}onMouseLeave(t){return this.P.on("mouseLeave",t)}onMouseClick(t){return this.P.on("mouseClick",t)}onMouseDoubleClick(t){return this.P.on("mouseDoubleClick",t)}onMouseDown(t){return this.P.on("mouseDown",t)}onMouseUp(t){return this.P.on("mouseUp",t)}onMouseMove(t){return this.P.on("mouseMove",t)}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offMouseEnter(t){return this.P.off(t,"mouseEnter")}offMouseLeave(t){return this.P.off(t,"mouseLeave")}offMouseClick(t){return this.P.off(t,"mouseClick")}offMouseDoubleClick(t){return this.P.off(t,"mouseDoubleClick")}offMouseDown(t){return this.P.off(t,"mouseDown")}offMouseUp(t){return this.P.off(t,"mouseUp")}offMouseMove(t){return this.P.off(t,"mouseMove")}offMouseDragStart(t){return this.P.off(t,"mouseDragStart")}offMouseDrag(t){return this.P.off(t,"mouseDrag")}offMouseDragStop(t){return this.P.off(t,"mouseDragStop")}offMouseWheel(t){return this.P.off(t,"mouseWheel")}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}getIsUnderMouse(){return this.Pu>0}setVisible(t){const e=this.Fi!==t;return this.Fi=t,e&&this.P.emit("visibleStateChanged",this,this.Fi),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const dn=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.Jt(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.Jt({x:o.x.getInnerStart(),y:o.y.getInnerStart()},oi({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.Jt({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},oi({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),Kt(s)}},fn=(t,e,i,s,r)=>{dn(t,r,e)},gn=(t,e,i,s,r)=>{dn(t,s,r)};class yn extends cn{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.Ti=!1,this.Yu=void 0,this.Xu=void 0,this.Zu=un,this.Ku=void 0,this.qu=()=>{const t="function"==typeof this.Zu?this.Zu(this):this.Zu;t&&(this.Xu=this.As.ls.Tr(t))},this.Ju=()=>{this.As.ls.Fr(this.Xu)},this.Ft=S(0,0,0,0),this.As=t,this.renderingScale=e,this.scale=i,this.bo=s,this.Ji=r,this.As.Ss(),this.onMouseEnter(this.qu),this.onMouseLeave(this.Ju),this.onMouseDrag(fn);const n=Wi(new Yi(Et,gn,Et));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.Ji=r}setEffect(t){return this.ss=this.ss||this.As.ls.ss.es(this,{Qu:{shapes:this.tc()}}),this.ss.Qu.ys(t),this}getEffect(){return!!this.ss&&this.ss.Qu.xs()}setAutoDispose(t){return this.Ku=t,this.As.Ss(),this}getAutoDispose(){return this.Ku}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Ft.left+this.Ft.right),this.size.y+(this.Ft.bottom+this.Ft.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Ft="object"==typeof t?b(this.Ft,t):{left:t,top:t,right:t,bottom:t},this.As.Ss(),this}getMargin(){return this.Ft}Ae(){if(this.Ku){const t=this.size,e=this.renderingScale.Ht(),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}Ts(){return this}dispose(){return this.Ti||(this.As.Ss(),this.Ti=!0,this.bo(this),this.P.emit("dispose",this)),this}setVisible(t){return super.setVisible(t),this.As.Ss(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setPosition(t){return this.position=t,this.As.Ss(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.Jt(this.position,oi({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.Jt(r,oi({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.Jt(r,{x:this.Ft.left,y:this.Ft.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.Jt(n,oi({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.As.Ss(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Yu=t,this.As.Ss(),this}getDraggingMode(){return void 0!==this.Yu?this.Yu:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.Zu=t,this}getMouseStyle(){return this.Zu}}class pn extends yn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Qo=S(),this.ic=0,this.As=t,this.sc=s,this.backgroundElement=new this.sc(this.As,this.renderingScale,this.scale,Et,n),this.ju(this.backgroundElement)}tc(){return this.backgroundElement.tc()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}Ae(){return super.Ae(),this.Ti||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).Ae(),this}Ts(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.hc(t).Ts(),super.Ts()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.Qo="object"==typeof t?b(this.Qo,t):{left:t,top:t,right:t,bottom:t},this.As.Ss(),this}getPadding(){return this.Qo}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.Qo.left+this.Qo.right,i.y+this.Qo.bottom+this.Qo.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.rc()+this.backgroundElement.nc(),i.y+this.backgroundElement.oc()+this.backgroundElement.ac())),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.Jt(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.Jt(n,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.Jt(n,{x:this.backgroundElement.rc(),y:this.backgroundElement.oc()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.Jt(o,oi({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.Jt(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.Jt(a,oi({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return this.backgroundElement.setMouseInteractions(t),this}getMouseInteractions(){return this.backgroundElement.getMouseInteractions()}getHighlight(){return this.ic}setHighlight(t){return this.ic=ve(t),this.backgroundElement.setHighlight(t),this.P.emit("highlight",t),this}}const mn=t=>"setBackground"in t;class Sn extends cn{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.u=0,this.lc=1,this.uc=!0,this.cc=new tr,this.dc=!0,this.Ti=!1,this.axisScale=s,this.renderingScale=r,this.fc=o,this.gc=h,this.mc=a,this.bo=l,this.yc=e,this.Sc=i,this.xc=this.ju(this.yc.De(this.renderingScale)),this.Ji=u,this.bc=this.ju(this.mc.vc(this.Sc,this.renderingScale,n,Et,this.Ji,!1).setOrigin(qt(this.gc)).setDirection(this.gc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.bc.Mc?this.xc.Pe(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.bc.Mc?this.xc.Pe(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.bc.Mc&&this.xc.Pe(u.cursorGridStrokeStyleX)}setValue(t){return this.u=t,this.Sc.Ss(),this.P.emit("valueChange",this.u),this}getValue(){return this.u}setTextFormatter(t){return this._c=t,this.Sc.Ss(),this}setTickLength(t){return this.bc.setPointerLength(t),this.yc.Ss(),this}getTickLength(){return this.bc.getPointerLength()}setTickLabelPadding(t){return this.bc.setTickLabelPadding(t),this.yc.Ss(),this}setTickLabelRotation(t){return this.bc.setTextRotation(t),this.yc.Ss(),this}getTickLabelRotation(){return this.bc.getTextRotation()}getTickLabelPadding(){return this.bc.getTickLabelPadding()}setGridStrokeLength(t){return this.lc=t,this.yc.Ss(),this}getGridStrokeLength(){return this.lc}setGridStrokeStyle(t){return this.xc.Pe(t),this.yc.Ss(),this}getGridStrokeStyle(){return this.xc.Yl()}dispose(){return this.Ti||(this.Ti=!0,this.xc.dispose(),this.bc.dispose(),this.bo(this),this.yc.ls.Ss(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setMarkerVisible(t){return this.uc=t,this.Sc.Ss(),this}getMarkerVisible(){return this.uc}setMarker(t){return t(this.bc),this.Sc.Ss(),this}getMarker(){return this.bc}setMouseInteractions(t){return this.bc.setMouseInteractions(t),this.xc.setMouseInteractions(t),this}getMouseInteractions(){return this.xc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.dc=t,this.Sc.Ss(),this}getAllocatesAxisSpace(){return this.dc}isInScale(){return Ve(this.u,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}}class xn extends Sn{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.Ac=!1,this.bo=a,this.yc=e,this.Sc=i}dispose(){return this.Ac=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.Ac=!1;const r=ht(this.u,this.axisScale,this.fc.getWidth(this.renderingScale));this.xc.setVisible(!0).Oe(this.fc.toPoint(r,t)).Be(this.fc.toPoint(r,t-(i+e*this.lc))),this.uc?(this._c&&this.bc.setText(this._c(this.u,this)),this.bc.setVisible(!0).setPosition(this.fc.toPoint(r,s))):this.bc.setVisible(!1)}else this.xc.setVisible(!1),this.bc.setVisible(!1);return this.bc.Ts().Ae(),this}wc(){const t=this.bc.Ts().getSize();return this.fc.getHeight(t)}}const bn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),vn=(t,e)=>(ce(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),Mn=(t,e,i)=>{i&&mn(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},An={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}},wn={background:void 0,setBackground(t){return{...this,background:t}}},Tn={vc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return Mn(o,r,n),o}},En={vc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return Mn(o,r,n),o}};class In extends yn{constructor(){super(...arguments),this.kc=!0}Ae(){return super.Ae(),this}setMouseInteractions(t){return this.kc=t,this}getMouseInteractions(){return this.kc}tc(){return[]}}class Cn extends In{onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}hc(t){return this.size=t,this}rc(){return 0}nc(){return 0}ac(){return 0}oc(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return z}setStrokeStyle(){return this}getStrokeStyle(){return st}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class Pn extends Cn{constructor(){super(...arguments),this.setSize=this.hc.bind(this)}}class kn extends yn{constructor(){super(...arguments),this.Se=z,this.P=new r.Eventer,this.ic=0}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}tc(){return[this.Aa]}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Aa.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}getHighlight(){return this.ic}setHighlight(t){return this.ic=t,this.Aa.us(t),this.P.emit("highlight",t),this.As.Ss(),this}setMouseInteractions(t){return this.Aa.setMouseInteractions(t),this}getMouseInteractions(){return this.Aa.getMouseInteractions()}dispose(){return super.dispose(),this.Aa.dispose(),this}setVisible(t){return super.setVisible(t),this.Aa.setVisible(t),this}}class Fn extends kn{constructor(){super(...arguments),this.xe=st}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.Aa.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}}class Bn extends Fn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.As=t,this.Aa=this.As.Cc(this.renderingScale,sn.Simple).ve(this.getStrokeStyle()).Me(this.getFillStyle()).setVisible(!1),this.ju(this.Aa)}Tc(){const t=this.Fc();if(t.length>2){const e=Xe(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=ri(t,si(e.min,-1));return this.scale.Jt(this.position,ri(s,oi(si(ri(this.origin,u(1,1)),-.5),i)))})).map((t=>at(t,this.scale,this.renderingScale)));this.Aa.tl(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Aa&&this.Aa.setVisible(!1),this.setContentSize(u(0,0))}Ae(){return super.Ae(),this.Ti||this.Tc(),this}Ts(){return this.Tc(),super.Ts()}setVisible(t){return super.setVisible(t),this.Aa.setVisible(t),this}}class _n extends kn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.$o="label",this.Aa=this.As.Sr(this.renderingScale).Me(this.Se).Ch(this.$o),this.ju(this.Aa)}Ae(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=at(t,this.scale,this.renderingScale);return this.Aa.we(i),this}Ts(){this.Aa.Ts();const t=0===this.$o.length?u(0,0):this.Aa.Ic();return this.setContentSize(t),super.Ts()}setText(t){return this.$o=t,this.Aa.Ch(this.$o),this.As.Ss(),this}getText(){return this.$o}setFont(t){return this.Aa.Ih(t),this.As.Ss(),this}getFont(){return this.Aa.Fh()}setTextRotation(t){return this.Aa.Ph(t),this.As.Ss(),this}getTextRotation(){return this.Aa.Dh()}}const Ln={...An,...Tn,uiElement:_n};class Dn extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.hc.bind(this),this.setSize=this.fitTo,this.Aa=this.As._e(e).Me(this.Se).ve(this.getStrokeStyle()),this.ju(this.Aa)}Ae(){const t=Xe([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>at(t,this.scale,this.renderingScale)))),i={x:t.max.x-t.min.x,y:t.max.y-t.min.y};return this.Aa.q(i).we(at(this.getPosition(u(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)),this}hc(t){return this.setContentSize(t),this.As.Ss(),this}rc(){return 0}nc(){return 0}ac(){return 0}oc(){return 0}}class zn extends Fn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Pc=u(0,0),this.setSize=this.fitTo.bind(this),this.Aa=t.Dc(e).Nl(0).Be(360).Me(this.Se).ve(this.getStrokeStyle()),this.ju(this.Aa)}Ae(){const t=this.getSize(e.UISpace.Content).x/2;return this.Aa.Wl(t*this.renderingScale.Ai().x).Hl(t*this.renderingScale.Ai().y).we(at(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).$l(255).Ts(),this}hc(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Pc=t,this.As.Ss(),this}rc(){return(this.getSize(e.UISpace.Content).x-this.Pc.x)/2}nc(){return(this.getSize(e.UISpace.Content).x-this.Pc.x)/2}ac(){return(this.getSize(e.UISpace.Content).y-this.Pc.y)/2}oc(){return(this.getSize(e.UISpace.Content).y-this.Pc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Pc=t,this}}class On extends Bn{constructor(t,e,i,s,r){super(t,e,i,sn.Simple,s,r),this.Bc=m(u(0,0)),this.Oc=!1,this.setSize=this.fitTo.bind(this),this.As=t,this.Tc()}Fc(){const t=this.Bc.M();if(this.Oc){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.Bc.M().x*this.Bc.M().x/4+this.Bc.M().y*this.Bc.M().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=ri(r,ri(i,s)),o=ri(n,ri(s,si(i,-1)));return[r,n,o,ni(o,ri(i,s))]}hc(t){return this.Bc.S(t),this.Oc=!1,this.As.Ss(),this}rc(){return this.Oc?0:(this.getSize(e.UISpace.Content).x-this.Bc.M().x)/2}nc(){return this.Oc?0:(this.getSize(e.UISpace.Content).x-this.Bc.M().x)/2}ac(){return this.Oc?0:(this.getSize(e.UISpace.Content).y-this.Bc.M().y)/2}oc(){return this.Oc?0:(this.getSize(e.UISpace.Content).y-this.Bc.M().y)/2}fitTo(t){return this.Bc.S(t),this.Oc=!0,this.As.Ss(),this}}class Rn extends Bn{constructor(t,i,s,r,n){super(t,i,s,sn.Simple,r,n),this.Lc=m(u(0,0)),this.Rc=m(10),this.Ec=m(void 0),this.gc=m(e.UIDirections.Right),this.Tc()}setDirection(t){return this.gc.S(t),this.As.Ss(),this}getDirection(){return this.gc.M()}setPointerLength(t){return this.Rc.S(t),this.As.Ss(),this}getPointerLength(){return this.Rc.M()}setPointerAngle(t){return this.Ec.S(t),this.As.Ss(),this}getPointerAngle(){let t=this.Ec.M();if(void 0===t){const e=this.zc();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)}hc(t){return this.Lc.S(t),this.As.Ss(),this}Vc(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Nc(){return Zt(this.gc.M())?this.Lc.M().x:this.Lc.M().y}zc(){return Zt(this.gc.M())?this.Lc.M().y:this.Lc.M().x}rc(){switch(this.gc.M()){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.Vc()-this.zc());default:return 0}}nc(){switch(this.gc.M()){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.Vc()-this.zc());default:return 0}}ac(){switch(this.gc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Vc()-this.zc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}oc(){switch(this.gc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Vc()-this.zc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}Fc(){const t=qt(this.gc.M()),e=ei(u(0,0),t),i=this.getPointerLength(),s=this.Vc(),r=this.Nc(),n=this.zc();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=ri(ri(o,si(t,-i)),si(e,s/2)),a=ri(h,si(e,(n-s)/2)),l=ri(a,si(t,-r)),c=ri(ri(o,si(t,-i)),si(e,-s/2)),d=ri(c,si(e,-(n-s)/2)),f=ri(d,si(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:It(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class Vn extends In{setSize(t){return this.setContentSize(t),this.As.Ss(),this}}class Nn extends pn{constructor(){super(...arguments),this.Gc=[],this.Wc=0,this.Hc=t=>{const e=this.Gc.indexOf(t);e>=0&&this.Gc.splice(e,1)}}getMembers(){return this.Gc}getMemberCount(){return this.Gc.length}setMinimumSize(t){return this.Uc=t,this.As.Ss(),this}getMinimumSize(){return this.Uc}addElement(t,e=-1){const i=t.vc(this.As,this.renderingScale,this.scale,this.Hc,this.Ji,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Gc.splice(e,0,i):this.Gc.push(i),i.setVisible(this.getVisible()),this.ju(i),this.Ti&&(me(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Gc.slice().forEach(Tt),this}setVisible(t){return super.setVisible(t),this.Gc.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof Vn)),0),s=i>0?(this.size.x-this.Wc)/i:0;return this.Gc.reduce(((e,i)=>i instanceof Vn?this.scale.Jt({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).Ae().getPosition(u(1,0)).x),t.x),this}Ts(){for(let t=0;tt+ +(e instanceof Vn)),0),s=i>0?(this.size.y-this.Wc)/i:0;return this.Gc.reduce(((e,i)=>i instanceof Vn?this.scale.Jt({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).Ae().getPosition(u(0,-1)).y),t.y),this}Ts(){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},qn=$n("Text",[]),Zn={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.P.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.P.on("switch",(e=>t(this,e)))},offSwitch(t){return this.P.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOffStrokeStyle(t){return this.button.setOffStrokeStyle(t),this},getButtonOffStrokeStyle(){return this.button.getOffStrokeStyle()},setButtonOffSize(t){return this.button.setOffSize(t),this},getButtonOffSize(){return this.button.getOffSize()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonOnStrokeStyle(t){return this.button.setOnStrokeStyle(t),this},getButtonOnStrokeStyle(){return this.button.getOnStrokeStyle()},setButtonOnSize(t){return this.button.setOnSize(t),this},getButtonOnSize(){return this.button.getOnSize()}},Kn={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()}},Qn={...An,...wn,background:Dn,vc(t,e,i,s,r,n){const o=new Gn(t,e,i,this.background,s,r),h=o.addElement(Ln,void 0),a=Object.assign(o,Jn,{setTextLabel:h},qn,{stylableTexts:[h]});return Mn(a,r,n),this.applyStylers(a,r)}}.addStyler(bn),to={...An,...wn,background:Rn,vc(t,i,s,r,n,o){const h=new Gn(t,i,s,this.background,r,n),a=h.addElement(Ln,void 0),l=h.getBackground(),u=Object.assign(h,Jn,{setTextLabel:a},qn,{stylableTexts:[a]},Kn,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Mc="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))),Mn(u,n,o),this.applyStylers(u,n)}};class eo extends yn{constructor(t,e,i,s,n,o,h){super(t,e,i,o,h),this.Fs=!1,this.P=new r.Eventer,this.getOn=()=>this.Fs,this.jc=this.ju(new s(this.As,this.renderingScale,this.scale,Et,h)),this.Yc=this.ju(new n(this.As,this.renderingScale,this.scale,Et,h))}tc(){return[...this.jc.tc(),...this.Yc.tc()]}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setOn(t){return this.Fs=t,this.As.Ss(),this}setOffFillStyle(t){return this.jc.setFillStyle(t),this}getOffFillStyle(){return this.jc.getFillStyle()}setOffStrokeStyle(t){return this.jc.setStrokeStyle(t),this}getOffStrokeStyle(){return this.jc.getStrokeStyle()}setOffSize(t){return this.jc.fitTo("number"==typeof t?u(t,t):t),this}getOffSize(){return this.jc.getSize()}setOnFillStyle(t){return this.Yc.setFillStyle(t),this}getOnFillStyle(){return this.Yc.getFillStyle()}setOnStrokeStyle(t){return this.Yc.setStrokeStyle(t),this}getOnStrokeStyle(){return this.Yc.getStrokeStyle()}setOnSize(t){return this.Yc.fitTo("number"==typeof t?u(t,t):t),this}getOnSize(){return this.Yc.getSize()}Ae(){return super.Ae(),this.Fs?(this.jc.setVisible(!1),this.Yc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Ae()):(this.jc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).Ae(),this.Yc.setVisible(!1)),this}Ts(){const t=this.jc.Ts().getSize(),e=this.Yc.Ts().getSize();return this.setContentSize(u(Math.max(t.x,e.x),Math.max(t.y,e.y))),super.Ts()}dispose(){return super.dispose(),this.jc.dispose(),this.Yc.dispose(),this}setMouseInteractions(t){return this.Yc.setMouseInteractions(t),this.jc.setMouseInteractions(t),this}getMouseInteractions(){return this.Yc.getMouseInteractions()}setHighlight(t){const e=ve(t);return this.Yc.setHighlight(e),this.jc.setHighlight(e),this.P.emit("highlight",t),this.As.Ss(),this}getHighlight(){return this.Yc.getHighlight()}}const io={...An,uiElement:eo,pictureOff:zn,pictureOn:zn,setPictureOff(t){return{...this,pictureOff:t}},setPictureOn(t){return{...this,pictureOn:t}},vc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.pictureOff,this.pictureOn,s,r),r);return Mn(o,r,n),o}},so={...An,...wn,background:Dn,buttonBuilder:io,setPictureOff(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOff(t)}},setPictureOn(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOn(t)}},vc(t,i,s,r,n,o){const h=new Gn(t,i,s,this.background,r,n),a=h.addElement(Yn);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Yn);u.addGap();const c=u.addElement(Ln);u.addGap(),h.addGap();const d=Object.assign(h,Jn,{setTextLabel:c},qn,{stylableTexts:[c]},Zn,{button:l});return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setPadding({left:6}),Mn(d,n,o),this.applyStylers(d,n)}}.addStyler(bn).addStyler(vn);class ro extends yn{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Xc=[],this.Zc=2,this.Kc="",this.qc=(t,e)=>void 0!==t.label?t.label:Ii(t.value,e.min,e.max),this.Jc=0,this.Qc=0,this.td=!1,this.As=t,this.sd=n,this.ed=this.ju(t._e(e).ve(st)),this.hd=this.ju(t.Sr(e).Me(r.uiTextFillStyle).Ih(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.rd=140,this.nd=25):(this.rd=160,this.nd=15)}tc(){return[this.ed,this.hd]}od(t){this.ad=t;const e=ho(t,"vertical"===this.sd?0:90,this.td);return this.ed.Me(e),this.As.Ss(),this}ld(){return this.ad}ud(t){return this.rd=t,this.As.Ss(),this}dd(){return this.rd}fd(t){return this.nd=t,this.As.Ss(),this}gd(){return this.nd}pd(t){return this.Kc=t,this.As.Ss(),this}md(){return this.Kc}yd(t){return this.qc=t,this.As.Ss(),this}setLUTDisplayProportionalSteps(t){if(this.td=t,this.ad){const t=ho(this.ad,"vertical"===this.sd?0:90,this.td);this.ed.Me(t)}return this.As.Ss(),this}getLUTDisplayProportionalSteps(){return this.td}setFillStyle(t){return this.hd.Me(t),this.As.Ss(),this}getFillStyle(){return this.hd.Th()}setFont(t){return this.hd.Ih(t),this.As.Ss(),this}getFont(){return this.hd.Fh()}setTextRotation(t){return this.Qc=t,this.hd.Ph(t),this.As.Ss(),this}getTextRotation(){return this.hd.Dh()}Ae(){var t,i,s,r;if(super.Ae(),this.Ti)return this;const n=this.ad;if(n){const o=this.renderingScale.Ai(),h=n.min,a=n.max;if("vertical"===this.sd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=ri(s,{x:this.ed.Ht().x+this.Zc*o.x,y:0}),l={x:r.x,y:r.y+(this.Kc.length>0?this.Jc*o.y+this.hd.Ht().y:0)+.5*((null===(t=this.Xc[0])||void 0===t?void 0:t.Ht().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Xc[this.Xc.length-1])||void 0===i?void 0:i.Ht().y)||0)};this.ed.we({x:s.x,y:l.y}),this.hd.Sa({x:-1,y:-1}).we(r),n.getSteps().forEach(((t,e)=>{const i=Ue(l,u,this.td?!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.Xc[e].Sa({x:-1,y:0}).we(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.Xc.reduce(((t,e)=>Math.max(t,e.Ht().y)),0),u=ri(t,{x:.5*((null===(s=this.Xc[0])||void 0===s?void 0:s.Ht().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Xc[this.Xc.length-1])||void 0===r?void 0:r.Ht().x)||0)+(this.Kc.length>0?this.Jc*o.x+this.hd.Ht().x:0)),y:u.y},f={x:u.x,y:u.y+this.Zc*o.y};this.ed.we(f),this.hd.Sa({x:1,y:1}).we(c),n.getSteps().forEach(((t,e)=>{const i=Ue(u,d,this.td?!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.Xc[e].Sa({x:0,y:1}).we(i)}))}}return this}Ts(){if(this.ad&&this.getVisible()){const t=this.ad.getSteps();for(let e=this.Xc.length;eMath.max(t,e.Ts().Ic().x)),0),this.hd.Ts().Ic().x),s=(this.Kc.length>0?this.Jc+this.hd.Ts().Ic().y:0)+e+.5*this.Xc[0].Ts().Ic().y+.5*this.Xc[this.Xc.length-1].Ts().Ic().y;this.setContentSize({x:i,y:s})}else{const t=this.rd,e=this.nd;this.ed.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Kc.length>0?this.Jc+this.hd.Ts().Ic().x:0,.5*this.Xc[this.Xc.length-1].Ts().Ic().x),s=t+.5*this.Xc[0].Ts().Ic().x+i,r=e+this.Zc+this.Xc.reduce(((t,e)=>Math.max(t,e.Ts().Ic().y)),0);this.setContentSize({x:s,y:r})}}else this.Xc.forEach((t=>t.dispose())),this.Xc.length=0,this.hd.setVisible(!1),this.ed.setVisible(!1),this.setContentSize({x:0,y:0});return super.Ts()}dispose(){return super.dispose(),this.ed.dispose(),this.Xc.forEach(Tt),this.hd.dispose(),this}setMouseInteractions(t){return this.ed.setMouseInteractions(t),this}getMouseInteractions(){return this.ed.getMouseInteractions()}}const no={lutElement:{},setLUT(t){return this.lutElement.od(t),this},getLUT(){return this.lutElement.ld()},setLUTLength(t){return this.lutElement.ud(t),this},getLUTLength(){return this.lutElement.dd()},setLUTThickness(t){return this.lutElement.fd(t),this},getLUTThickness(){return this.lutElement.gd()},setLookUpUnit(t){return this.lutElement.pd(t),this},getLookUpUnit(){return this.lutElement.md()},setLUTStepValueFormatter(t){return this.lutElement.yd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},oo={...An,...wn,background:Dn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},vc(t,e,i,s,r,n){const o=new Hn(t,e,i,this.background,s,r),h=o.addElement({vc:()=>new ro(t,e,i,Et,r,this.alignment)}),a=Object.assign(o,qn,{stylableTexts:[h]},no,{lutElement:h});return Mn(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 tt({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 ro(t,i,s,Et,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Jn,{setTextLabel:c},qn,{stylableTexts:[c,d]},$n("LUTText",[d]),Zn,{button:l},no,{lutElement:d});return f.onMouseClick((()=>{f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setPadding({left:6}),this.applyStylers(f,n)}}.addStyler(bn).addStyler(vn),lo={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=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof Vh?this.addChart(t,i,s):"attach"in t?this.addAttachable(t,i,s):t&&this.addDashboard(t,i,s)),this},addAttachable(t,e,i){const s=t.ld&&t.ld();let r=i;r||(r=s?ao.setAlignment(this.alignment):so);const n=this.addElement(r);if(s&&"setLUT"in n){n.setLUT(s.lut);const t=s.lut.getUnits(),e=s.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";n.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(n))),this.entries.push({entry:n,component:t}),t.attach(n,e),this},addChart(t,e,i){return t.Sd().forEach((t=>this.addAttachable(t,e,i))),this},addDashboard(t,e,i){return t.getCells().filter((t=>t.panel instanceof Vh)).forEach((t=>this.addChart(t.panel,e,i))),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}},uo={alignment:"vertical",layoutBuilder:Yn,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?jn:Yn}},getAlignment(){return this.alignment},titleBuilder:Qn,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},co={...An,...wn,...uo,background:Dn,vc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).vc(t,e,i,s,r,!1);let h=Object.assign(o,lo,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.Ti});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Yn:jn),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}),Mn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class fo extends yn{constructor(t,i,s,r,n){super(t,i,s,r,n),this.xd=10,this.bd=e.UIDirections.Up,this.vd=0,this.Mc="major",this.$o=this.ju(t.Sr(this.renderingScale)),this.Ie=this.ju(t.De(this.renderingScale))}tc(){return[this.$o]}Ae(){if(super.Ae(),this.Ti)return this;const t=at(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.Jt(t,{x:this.bd===e.UIDirections.Right?-this.xd:this.bd===e.UIDirections.Left?this.xd:0,y:this.bd===e.UIDirections.Up?-this.xd:this.bd===e.UIDirections.Down?this.xd:0}),s=this.renderingScale.Jt(i,{x:this.bd===e.UIDirections.Right?-this.vd:this.bd===e.UIDirections.Left?this.vd:0,y:this.bd===e.UIDirections.Up?-this.vd:this.bd===e.UIDirections.Down?this.vd:0});return this.Ie.Oe(t).Be(i),this.$o.we(s).Sa(this.bd===e.UIDirections.Up?{x:0,y:1}:this.bd===e.UIDirections.Down?{x:0,y:-1}:this.bd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Ts(){const t=this.Ie.Yl().getThickness();return this.size=this.bd===e.UIDirections.Left||this.bd===e.UIDirections.Right?{x:this.xd+this.vd+this.$o.Ts().Ic().x,y:t}:{y:this.xd+this.vd+this.$o.Ts().Ic().y,x:t},super.Ts()}dispose(){return super.dispose(),this.$o.dispose(),this.Ie.dispose(),this}setVisible(t){return super.setVisible(t),this.$o.setVisible(t),this.Ie.setVisible(t),this}setMouseInteractions(t){return this.$o.setMouseInteractions(t),this.Ie.setMouseInteractions(t),this}getMouseInteractions(){return this.$o.getMouseInteractions()}getText(){return this.$o.wh()}setTextFillStyle(t){return this.$o.Me(t),this.As.Ss(),this}getTextFillStyle(){return this.$o.Th()}setTextFont(t){return this.$o.Ih(t),this}setTextRotation(t){return this.$o.Ph(t),this}getTextRotation(){return this.$o.Dh()}getTextFont(){return this.$o.Fh()}setText(t){return this.$o.Ch(t),this.As.Ss(),this}setDirection(t){return this.bd=t,this.As.Ss(),this}getDirection(){return this.bd}setPointerLength(t){return this.xd=t,this.As.Ss(),this}getPointerLength(){return this.xd}setTickLabelPadding(t){return this.vd=t,this.As.Ss(),this}getTickLabelPadding(){return this.vd}setTickStyle(t){return this.Ie.Pe(t),this.As.Ss(),this}getTickStyle(){return this.Ie.Yl()}}const go={...An,vc(t,e,i,s,r,n){const o=new fo(t,e,i,s,r);return Mn(o,r,n),this.applyStylers(o,r)}}.addStyler(bn),yo=go.addStyler(((t,e)=>(t.Mc="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)))),po=go.addStyler(((t,e)=>(t.Mc="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)))),mo=so.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),So=co.setAlignment("horizontal"),xo=co.setAlignment("vertical"),bo={TextBox:Qn,CheckBox:so,ButtonBox:mo,PointableTextBox:to,AxisTickMajor:yo,AxisTickMinor:po,LUTRange:oo},vo={HorizontalLegendBox:So,VerticalLegendBox:xo},Mo=(t,e,i)=>t*(1-i)+e*i,Ao=(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=Mo(i.value,r.value,n),c=Mo(e.value,s.value,h);return Mo(c,u,l)},wo={warm:t=>e=>E(60/(t-1)*e,.8,.8),cold:t=>e=>E(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>E(360/t*e,.8,.8),reverseSpectrum:t=>e=>E(360/t*(t-e),.8,.8),flatUI:t=>e=>E(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return E(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return E(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return E(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return E(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return E(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>E(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return E(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return E(e%2?i[0]:i[1],.7,.5+.5/(t-1)*e)},crayons:t=>e=>{let i=180+230/(t-1)*e;return i>360&&(i-=360),E(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return E(0,0,s);const 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=>E(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>To([{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=>To([{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=>To([{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=>To([{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=>To([{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=>To([{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)},To=(t,e,i)=>{const s=Io(e,i),[r,n]=Co(s,t),o=Eo(t[r]),h=Eo(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:Mo(o.h,h.h,a),s:Mo(o.s,h.s,a),v:Mo(o.v,h.v,a)};return E(l.h,l.s,l.v)},Eo=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},Co=(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),Ro={Dotted:[1,3],DottedDense:[1,1],Dashed:[3,1],DashedEqual:[2,2],DashedLoose:[2,4],DashDotted:[3,2,1,2]},Vo=s.Record({type:"linestyle",lineType:"dashed",pattern:Ro.DashedEqual,fillStyle:new V({color:w(255,255,255)}),thickness:1,patternScale:3}),No=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),Go=s.Record({type:"icon",width:void 0,height:void 0,Md:void 0,_d:Et,Ad:Et});class Ho extends Go{constructor(t,e,i,s){super({...s,Md:t,_d:e,Ad:i})}dispose(){return this.Ad(this),this}setWidth(t){const e=this.set("width",t);return this._d(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this._d(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this._d(i),i}Ht(){if(!this.Md)return{x:0,y:0};const t=this.Md.width,e=this.Md.height,i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}const Uo=t=>!(!t||"object"!=typeof t||!("type"in t)||"icon"!==t.type),Wo=s.Record({type:"glow",color:w(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class Xo extends Wo{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")}}const Yo=(t,e)=>{if(Oi(t)){const i=e.do(t);return{x:i.engineX,y:i.engineY}}return t},jo=t=>{let e=!1,i={type:"linear"};if(t&&(void 0!==t.opposite&&(e=t.opposite),t.type&&"linear-highPrecision"===t.type&&(i={type:"linear-highPrecision"}),t.type&&"logarithmic"===t.type)){let s=10;if(t.base)if("E"===t.base||"e"===t.base||"natural"===t.base)s="e";else if("number"==typeof t.base)s=t.base;else if("string"==typeof t.base)try{s=Number(t.base)}catch(e){console.warn(`Unidentified logarithmic base "${t.base}"`)}i={base:s,type:"logarithmic"}}return{opposite:e,type:i}},Jo=(t,e,i,s=1)=>Ct(t+.1*s*(e-t)+.5*s*i.getPixelSize()*Math.sign(e-t),t,e),$o=(t,e,i,s=1)=>{const r=i.ut(t),n=i.ut(e);return Ct(i.ot(r+.1*s*(n-r)+.5*s*Math.sign(n-r)),t,e)};class qo extends qs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.wd=r,this.kd=n}}class Zo extends $s{constructor(t,i,s,n,o,h,a,l,c,d,f,g,y,p,m,S,x){var b;super(f,d,l,m,S,{numeric:d.getWidth({x:m.xAxisNumericTicks,y:m.yAxisNumericTicks}),datetime:d.getWidth({x:m.xAxisDateTimeTicks,y:m.yAxisDateTimeTicks}),time:d.getWidth({x:m.xAxisTimeTicks,y:m.yAxisTimeTicks})},x),this.Cd=new Map,this.Td=void 0,this.Fd=0,this.Id=[],this.Pd=[],this.je=zs.fitting,this.Dd=!0,this.Bd=0,this.Od=8,this.Ld=void 0,this.Rd=void 0,this.Ed=20,this.zd=1,this.Vd=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Hd=!0,this.Ud=!0,this.$d=!0,this.jd=!0,this.Yd=!0,this.Xd=!0,this.Zd=this.yh.defaultDragMouseStyle,this.Kd=this.yh.defaultDragMouseStyle,this.qd=this.yh.defaultDragMouseStyle,this.Jd=this.yh.defaultDragMouseStyle,this.Qd=this.yh.defaultDragMouseStyle,this.P=new r.Eventer,this.tf=[],this.if=t=>{const e=this.Pd.indexOf(t);e>=0&&this.Pd.splice(e,1)},this.sf=t=>(this.Pd.indexOf(t)<0&&this.Pd.push(t),this.if),this.Yi=(t,e)=>this.P.emit("axisAreaTouch",this,e),this.ef=ee(this.tf),this.onAxisInteractionAreaMouseClick=t=>this.P.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.P.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.P.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.P.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.P.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.P.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.P.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.P.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.P.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.P.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.P.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.P.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.P.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.P.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.P.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.P.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.P.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.P.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.P.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.P.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.P.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.P.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.P.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.P.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.P.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.P.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.P.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.P.off(t,"axisAreaTouchEnd"),this.hf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().wc()):t,this.rf=t=>{const e=this.Id.indexOf(t);-1!==e&&this.Id.splice(e,1)},this.nf=(t,e)=>{this.P.emit("axisAreaDoubleClick",this,e),this.Wd&&(this.setStopped(!1),Kt(e))},this.af=t=>{this.P.emit("axisAreaMouseEnter",this),(this.Nd||this.Vd||this.Gd||this.Wd)&&this.lf(t)},this.uf=t=>{this.cf(t),this.P.emit("axisAreaMouseLeave",this)},this.df=(t,e,i)=>{var s,r;this.P.emit("axisAreaMouseDragStart",this,e,i);const n=Lt(null===(s=this.chart.ff.In)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Lt(null===(r=this.chart.ff.In)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Nd?(this.gf(t),Kt(e)):i===n&&this.Vd&&(this.pf(t,h),Kt(e))},this.mf=(t,e,i,s,r)=>{var n,o;this.P.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Lt(null===(n=this.chart.ff.In)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Lt(null===(o=this.chart.ff.In)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Nd?(this.yf(t,r),Kt(e)):i===h&&this.Vd&&(this.Sf(t,s,l,r),Kt(e))},this.xf=(t,e,i,s)=>{var r,n;this.P.emit("axisAreaMouseDragStop",this,e,i,s);const o=Lt(null===(r=this.chart.ff.In)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Lt(null===(n=this.chart.ff.In)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Nd?(this.bf(t),Kt(e)):i===o&&this.Vd&&(this.vf(t,s,a),Kt(e)),t.getIsUnderMouse()&&(this.Nd||this.Vd||this.Gd||this.Wd)&&this.lf(t)},this.Mf=(t,e)=>{if(this.P.emit("axisAreaMouseWheel",this,e),this.Gd){this.setStopped(!0);const t=this.yh.getWidth(this._f.ls.Ce(e.clientX,e.clientY)),i=this.ct.ot(t);this.zoom(i,pe(e)),Kt(e)}},this.Af=(t,e)=>this.P.emit("axisAreaMouseClick",this,e),this.wf=(t,e)=>this.P.emit("axisAreaMouseDown",this,e),this.kf=(t,e)=>this.P.emit("axisAreaMouseUp",this,e),this.Cf=(t,e)=>this.P.emit("axisAreaMouseMove",this,e),this.Tf=(t,e,i)=>{this.P.emit("axisAreaTouchStart",this,i),this.Vd&&(this.lf(t),this.pf(t,e),Kt(i))},this.Ff=(t,e,i,s,r)=>{this.P.emit("axisAreaTouch",this,r),this.Vd&&(this.Sf(t,e,i,s),Kt(r))},this.If=(t,e,i,s)=>{this.P.emit("axisAreaTouchEnd",this,s),this.Vd&&(this.vf(t,e,i),this.cf(t),Kt(s))},this.Pf=(t,e,i,s)=>{(this.Nd||this.Gd)&&(this.lf(t),this.gf(t),Kt(s))},this.Df=(t,e,i,s,r,n)=>{if(this.Nd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.yf(t,e),Kt(n)}if(this.Gd){const t=this._f.ls.Ce(e.x,e.y),o=this._f.ls.Ce(i.x,i.y),h=Math.abs(this.yh.getWidth(ni(t,s))-this.yh.getWidth(ni(o,r)))-Math.abs(this.yh.getWidth(t)-this.yh.getWidth(o)),a=this.ct.Jt(this._h,-h),l=this.ct.Jt(this.Ah,h);this.mh(a,l),Kt(n)}},this.Bf=(t,e,i,s)=>{(this.Nd||this.Gd)&&(this.bf(t),this.cf(t),Kt(s))},this.Of=(t,e)=>{(this.Hd||this.Ud)&&this.Lf(t)},this.Rf=(t,e)=>{this.Ef(t)},this.zf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Hd&&this.Vf(t,s)},this.Nf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Hd&&this.Gf(t,n,s,r)},this.Wf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Hd&&this.Hf(t,n,s,r)},this.Uf=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Hd||this.Ud)&&this.$f(t,r,s),(this.Hd||this.Ud)&&this.Lf(t)},this.jf=(t,e)=>{this.Ud&&(this.setStopped(!0),this.zoom(this._h,pe(e)),Kt(e))},this.Yf=(t,e)=>{this.Ud&&(this.setStopped(!0),this.zoom(this.Ah,pe(e)),Kt(e))},this.Xf=(t,e,i)=>{this.Hd&&(this.Lf(t),this.Vf(t,e),Kt(i))},this.Zf=(t,e,i,s,r)=>{this.Hd&&(this.Gf(t,e,i,s),Kt(r))},this.Kf=(t,e,i,s,r)=>{this.Hd&&(this.Hf(t,e,i,s),Kt(r))},this.qf=(t,e,i,s)=>{this.Hd&&(this.$f(t,e,i),this.Ef(t),Kt(s))},this.wd=t,this.Jf=i,this._f=s,this.Qf=o,this.tg=h,this.chart=f,this.ig=y,this.sg=n,this.ts=a,p(this,this.sf),l.eg=this,this.hg=g,this.rg=this.hg>50?1:-1,this.ng=(b=this.yh.toPoint(0,-this.rg),Math.abs(b.x)>=Math.abs(b.y)?b.x>=0?e.UIDirections.Right:e.UIDirections.Left:b.y>=0?e.UIDirections.Up:e.UIDirections.Down),this.og=c,this.ag=this.ct instanceof ki?(new _i).yi(this.yh.toVec2(this.ct,this.og)):(new Li).yi(this.yh.toVec2(this.ct,this.og)),this.lg=this.chart.pixelScale,this.ug=(new _i).yi(this.yh.toVec2(this.yh.getWidth(this.lg),this.og)),this.cg=this._f.De(this.ag).setMouseInteractions(!1),this.dg=this._f.De(this.ag).setMouseInteractions(!1),this.gg=this._f.De(this.ag).setMouseInteractions(!1),this.pg=this.sg._e(this.lg).Me(d.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).ve(st).Fo(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.mg=this.sg._e(this.lg).Me(d.getWidth({x:m.xAxisZoomingBandFillStyle,y:m.yAxisZoomingBandFillStyle})).ve(d.getWidth({x:m.xAxisZoomingBandStrokeStyle,y:m.yAxisZoomingBandStrokeStyle})),this.yg=this.sg._e(this.lg).Me(d.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).ve(st).Fo(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.Sg=this.sg._e(this.lg).Me(d.getWidth({x:m.xAxisOverlayStyle,y:m.yAxisOverlayStyle})).ve(st).Fo(m.highlightColorOffsetAxisOverlay||m.highlightColorOffset),this.kh=this.sg.Sr(this.ag).setMouseInteractions(!1).Ph(this.yh.getTitleTextRotation(this.rg)),this.chart.ls.os.ns(this.pg,(t=>this.pg.us(t)),{animationEnabled:this.Ze}),this.chart.ls.os.ns(this.yg,(t=>this.yg.us(t)),{animationEnabled:this.Ze}),this.chart.ls.os.ns(this.Sg,(t=>this.Sg.us(t)),{animationEnabled:this.Ze});const v=Wi(new Yi(this.Tf,this.Ff,this.If,1),new ji(this.Pf,this.Df,this.Bf),new Xi(this.nf)),M=Wi(new Yi(this.Xf,this.Zf,this.qf)),A=Wi(new Yi(this.Xf,this.Kf,this.qf));this.pg.setMouseEnterEventHandler(this.af).setMouseLeaveEventHandler(this.uf).setMouseDragStartEventHandler(this.df).setMouseDragEventHandler(this.mf).setMouseDragStopEventHandler(this.xf).setMouseWheelEventHandler(this.Mf).setMouseDoubleClickEventHandler(this.nf).setMouseClickEventHandler(this.Af).setMouseDownEventHandler(this.wf).setMouseUpEventHandler(this.kf).setMouseMoveEventHandler(this.Cf).setTouchStartEventHandler(v.onTouchStart).setTouchMoveEventHandler(v.onTouchMove).setTouchEndEventHandler(v.onTouchEnd),this.yg.setMouseEnterEventHandler(this.Of).setMouseLeaveEventHandler(this.Rf).setMouseDragStartEventHandler(this.zf).setMouseDragEventHandler(this.Nf).setMouseDragStopEventHandler(this.Uf).setMouseWheelEventHandler(this.jf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.Sg.setMouseEnterEventHandler(this.Of).setMouseLeaveEventHandler(this.Rf).setMouseDragStartEventHandler(this.zf).setMouseDragEventHandler(this.Wf).setMouseDragStopEventHandler(this.Uf).setMouseWheelEventHandler(this.Yf).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),this.cg.Pe(d.getWidth({x:m.xAxisStrokeStyle,y:m.yAxisStrokeStyle})),this.dg.Pe(d.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.gg.Pe(d.getWidth({x:m.xAxisNibStyle,y:m.yAxisNibStyle})),this.kh.Me(d.getWidth({x:m.xAxisTitleFillStyle,y:m.yAxisTitleFillStyle})).Ih(d.getWidth({x:m.xAxisTitleFont,y:m.yAxisTitleFont})),this.ss=a.es(this,{}),this.Bh=this.ss.xg([this.kh]).ys(m.effectsText)}mr(){return this.Je}yr(){return void 0!==this.Nh}setTickStrategy(t,e){return super.Mh(t,e)}getTickStrategy(){return this.He}addBand(t=!0){const e=t?this.tg:this.Qf,i=new Ls(e,this.chart,this.ef,this,this.ag,this.yh,this.Ji,this.ts);return this.tf.push(i),i}addConstantLine(t=!0){const e=t?this.tg:this.Qf,i=new Ds(e,this.chart,this.ef,this,this.ag,this.yh,this.Ji,this.ts);return this.tf.push(i),i}bg(t){this.tf.forEach(t)}vg(t){return this.tf.map(t)}getHighlighters(){return this.tf}setThickness(t){return"number"==typeof t?(this.Mg=t,this._g=t):"object"==typeof t&&(this.Mg=t.min,this._g=t.max),this.wd.Ss(),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)}Ag(){return this.Pd}Qh(t,e){return new qo(e,t,this._f,this.ag,this.wd,this.ag)}Oh(){if(this.Cd){for(const t of this.Cd)t[1].grid.dispose(),t[1].tick.dispose();this.Cd.clear()}super.Oh()}tr(t,e){const{tickStart:i}=e,s=t.dh.Jh,r=i+s.getTickLength()*this.rg+s.getTickPadding()*this.rg;t.Ve.we(this.yh.toPoint(t.u,r)).Sa(this.yh.toPoint(s.getLabelAlignment(),-this.rg)).Ph(s.labelRotation).setVisible(this.getVisible())}wg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.dh.Jh,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.rg;return{gridStroke:{start:this.yh.toPoint(t.u,r),end:this.yh.toPoint(t.u,h)},tickStroke:{start:this.yh.toPoint(t.u,n),end:this.yh.toPoint(t.u,a)}}}kg(t,e,i,s){return this.wd.De(this.ag).Pe(new $i({fillStyle:new V({color:E(360*(1-s))}),thickness:5})).Oe(this.yh.toVec2(t,0)).Be(this.yh.toVec2(t,this.rg*(50*s)))}dr(t,e){return"linear"===this.xh.type?Jo(t,e,this.ct):$o(t,e,this.ct)}Cg(t,e){return e instanceof ki?Jo:$o}pr(t,e,i){if("logarithmic"!==this.xh.type){const s=this.ct.mi(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ct;return{min:s.Jt(t,-i),max:s.Jt(e,i)}}Ae(t,e,i){const s=this.cg.Yl(),r=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart(),o=this.ct.Gt(),h=this.og.getInnerInterval(),a=s.getThickness()*this.rg/2,l=this.hg/100*h,u=l+t,c=u+a,d=h*this.rg,f=c+a,g=this.Id.reduce(this.hf,0);let y,p=0;if(this.Fi||this.Oh(),this.We!==Ns&&this.Fi){const t=this.ct.Gt();this.Hh({physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});for(const[e,i]of this.Ue){let s=this.Cd.get(e);if(!s)if(e.Le)s={grid:this.wd.Tg(this.ag).setMouseInteractions(!1),tick:this.wd.Tg(this.ag).setMouseInteractions(!1)};else if("Fg"in e){const t=Array.from(this.Ue.keys()).filter((t=>"Fg"in t)).reverse().indexOf(e),i=this.Jf[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.Tg(this.ag).setMouseInteractions(!1),tick:i.Tg(this.ag).setMouseInteractions(!1)}}if(s){s.grid.Ha(),s.tick.Ha();for(const[e,r]of i){const e=this.wg(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});s.grid.kr().Ig(e.gridStroke.start,e.gridStroke.end),s.tick.kr().Ig(e.tickStroke.start,e.tickStroke.end)}s.grid.Pe(e.Jh.getGridStrokeStyle()),s.tick.Pe(e.Jh.getTickStyle()),this.Cd.set(e,s)}}for(const t of this.Ue.values()){let e=ke;for(const i of t.values()){const t=i.dh.Jh,s=this.yh.getHeight(i.Ve.Ht()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}p=Math.max(p,e)}y=f+Math.max(p,g)*this.rg}else p=0,y=f+g*this.rg;this.cg.Oe(this.yh.toPoint(r,c)).Be(this.yh.toPoint(n,c)),this.dg.Oe(this.yh.toPoint(this.ct.Jt(this.ct.getInnerStart(),this.Od),c)).Be(this.yh.toPoint(this.ct.getInnerStart(),c)),this.gg.Oe(this.yh.toPoint(this.ct.Jt(this.ct.getInnerEnd(),-this.Od),c)).Be(this.yh.toPoint(this.ct.getInnerEnd(),c));const m=this.kh&&this.kh.wh().length>0?this.yh.getHeight(this.kh.Ts().Ht()):0,S=y+.5*m*this.rg;this.kh.we(this.yh.toPoint(this.ct.Jt(this.ct.getInnerStart(),o/2),S));const x=f,b=x+this.rg*this.Fd,v=this.Hd||this.Ud?Math.min(this.Ed,.25*o):0,M={start:this.yh.toVec2(this.ct.Jt(this.ct.getInnerStart(),v),x),end:this.yh.toVec2(this.ct.Jt(this.ct.getInnerEnd(),-v),b)};if(this.Td){const e=this.hg/100*h+t,i=-this.rg*h-t,s={start:this.yh.toVec2(this.Td.min,f+this.rg*this.Fd),end:this.yh.toVec2(this.Td.max,e+i)},r=at(s.start,this.ag,this.lg),n=at(s.end,this.ag,this.lg);this.mg.we(r).q(ni(n,r)).setVisible(!0)}else this.mg.setVisible(!1);const A=at(this.yh.toVec2(this.ct.getInnerStart(),b),this.ag,this.lg),w=at(M.start,this.ag,this.lg),T=at(M.end,this.ag,this.lg),E=at(this.yh.toVec2(this.ct.getInnerEnd(),x),this.ag,this.lg);this.pg.we(w).q(ni(T,w)),this.yg.we(A).q(ni(w,A)),this.Sg.we(T).q(ni(E,T));for(const e of this.Id)e.update().plot(u,d,t,f);for(const t of this.tf)t.Ae();const I=s.getThickness()+Math.max(p,g)+(this.kh&&this.kh.wh().length>0?m+this.Bd:0);return this.Fd=Ct(I,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Pe),this}Pg(t){const e=this.cg.Yl().getThickness()*this.rg/2,i=this.og.getInnerInterval(),s=this.hg/100*i+t,r=s+e,n=i*this.rg,o=r+e;for(const e of this.Id)e.update().plot(s,n,t,o);for(const t of this.tf)t.Ae()}Dg(){return this.Fd}Bg(t,e){e=e||bo.AxisTickMajor;const i=new xn(this,t?this.wd:this.sg,this.sg,this.ct,this.ug,this.ug,this.yh,this.ng,this.rf,this.Ji,e).setTextFormatter(this.formatValue);return this.Id.push(i),i}lf(t){this.chart.ls.os.vs(t,1),this.Ld=t.ls.Tr(this.Zd,this.Ld)}cf(t){this.chart.ls.os.vs(t,0),t.ls.Fr(this.Ld)}gf(t){this.setStopped(!0),t.ls.Fr(this.Ld)}yf(t,e){const i=-this.yh.getWidth(e);this.pan(i),this.Ld=t.ls.Tr(this.Kd,this.Ld)}pan(t){const e=this._h,i=this.Ah,s=this.ct.Jt(e,t),r=this.ct.Jt(i,t);this.mh(s,r,{allowClamping:!1})}zoom(t,e){const i=this.ct.ut(this._h),s=this.ct.ut(this.Ah),r=this.ct.ut(t),n=Ct((r-i)/(s-i),0,1),o=.2*this.ct.Gt(),h=n*this.zd*o*-e,a=(1-n)*this.zd*o*e,l=this.ct.Jt(this._h,h),u=this.ct.Jt(this.Ah,a);this.mh(l,u)}bf(t){this.Td=void 0,t.ls.Fr(this.Ld)}pf(t,e){this.setStopped(!0),t.ls.Fr(this.Ld),this.chart.ls.os.vs(this.pg,0)}Sf(t,e,i,s){const r=at(this._f.ls.Ce(i.x,i.y),this._f.ls.ct,this.ag),n=Ct(this.yh.getWidth(r),this._h,this.Ah),o=this.yh.getWidth(at(this._f.ls.Ce(e.x,e.y),this._f.ls.ct,this.ag)),h=Ve(this.yh.getHeight(r),this.yh.getHeight(at(this.pg.ca(),this.lg,this.ag)),this.yh.getHeight(at(ri(this.pg.ca(),this.pg.Ht()),this.lg,this.ag)));Math.abs(this.ct.ut(n)-this.ct.ut(o))>10&&h?(this.Td=y(Math.min(n,o),Math.max(n,o)),this.Ld=t.ls.Tr(this.qd,this.Ld)):(this.Td=void 0,this.Ld=t.ls.Tr(this.Zd,this.Ld)),this._f.Ss()}vf(t,e,i){if(this.Td){const t=this.Td.min,e=this.Td.max,i=this.Ah{e.ps(t)}));for(const e of this.Cd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.wd.Ss(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.Ze),this}}const Ko={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Qo={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},th=t=>!!(t&&"object"==typeof t&&"x"in t&&t.x instanceof Zo&&"y"in t&&t.y instanceof Zo),eh=s.Record({type:"visible-ticks",gridStrokeLength:1,gridStrokeStyle:new $i,tickLength:7,tickStyle:new $i,tickPadding:0,labelFont:new tr,labelFillStyle:new V,labelPadding:0,labelAlignment:0,labelRotation:0});class ih extends eh{}class sh extends ih{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 rh=t=>!(!t||"object"!=typeof t||!("type"in t)||"visible-ticks"!==t.type),nh=Object.assign(Object.create(new class extends ih{}({type:"empty-ticks"})),{}),oh=(t,e,i,s,r)=>n=>o=>{const h=new Date(o+n),a={year:h.getFullYear(),monthIndex:h.getMonth(),day:h.getDate(),hours:h.getHours(),minutes:h.getMinutes(),seconds:h.getSeconds(),millis:h.getMilliseconds()},l=s?s(a):void 0;if(0===t&&!0===l)return o;const u=a[e];r.includes("year")&&(a.year=Math.floor(a.year/i)*i),r.includes("monthIndex")&&(a.monthIndex=0),r.includes("day")&&(a.day=1),r.includes("hours")&&(a.hours=0),r.includes("minutes")&&(a.minutes=0),r.includes("seconds")&&(a.seconds=0),r.includes("millis")&&(a.millis=0);let c=(0===t?1:t)*i;return-1===t&&!1===l&&(c=0),0!==c&&(a[e]=i*(c>0?Math.floor((u+c)/i):Math.ceil((u+c)/i))),new Date(a.year,a.monthIndex,a.day,a.hours,a.minutes,a.seconds,a.millis).getTime()-n},hh=(t,e,i,...s)=>oh(-1,t,e,i,s),ah=(t,e,i,...s)=>oh(-1,t,e,i,s),lh=(t,e,i,...s)=>oh(0,t,e,i,s),uh=(t,e,...i)=>oh(1,t,e,void 0,i),ch=t=>e=>i=>{const s=new Date(i+e),r=s.getDay(),n=1===r&&0===s.getHours()&&0===s.getMinutes()&&0===s.getSeconds()&&0===s.getMilliseconds();if(0===t&&!0===n)return i;let o=s.getDate();return-1===t&&1===r&&!1===n||(-1===t?o-=r>=2?r-1:r+6:o+=r>0?8-r:1),new Date(s.getFullYear(),s.getMonth(),o,0,0,0,0).getTime()-e},dh=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Xs({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Xs(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:hh("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Ys(5,10,15,30)},minorTicks:{amount:4,fitFunction:Xs(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:hh("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Ys(5,10,15,30)},minorTicks:{amount:12,fitFunction:Xs(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:hh("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Ys(3,6,12)},minorTicks:{amount:8,fitFunction:Xs(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:hh("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Xs({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Xs({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:ch(-1),getNextKeyValueIncludingRef:ch(0),getNextKeyValue:ch(1),greatTicks:!0,majorTicks:{fitFunction:Xs(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:ah("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:lh("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:uh("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Xs(void 0,2,3)},minorTicks:{fitFunction:Xs(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:ah("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:lh("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:uh("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Xs({ignore:"first"},2,5)},minorTicks:{fitFunction:Xs(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:ah("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:lh("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:uh("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Xs(void 0,2,4)},minorTicks:{fitFunction:Xs(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:ah("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:lh("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:uh("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:ah("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:lh("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:uh("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],fh=(t,e,i)=>{let s=((t,e,i,s,r)=>{const n=e-t;let o;for(let t=0;t(i,s,r,n)=>{const o=fh("great",i,s);if(void 0===o)return[];if("Decade"===o.label||"Century"===o.label||"Millennium"===o.label)return[];const h=n>r?i:s,a=(i+s)/2,l=n>r?s:i;if(dh.indexOf(o)<=dh.findIndex((t=>"Hour"===t.label)))return"left"===e?[h]:[];let u;if(!0===o.irregular)u=Ws(i,s,o.getPrevKeyValue(t),o.getNextKeyValue(t));else{const e=o.greatTicks.getReferenceKeyValue(t)(i);u=Us(i,s,o.unit,e,1)}const c=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(i,s,u);return"left"===e?void 0===c||Ve(c,a,l)?[h]:[c]:void 0!==c&&Ve(c,a,l)?[c]:[l]},yh=(t,e)=>(i,s,r,n)=>{const o=fh(t,r,n);let h;if(void 0===o)return[];if("great"===t&&void 0!==o.greatTicks)if(!0===o.irregular)h=Ws(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e));else{const t=o.greatTicks.getReferenceKeyValue(e)(i);h=Us(i,s,o.unit,t,1)}else if("major"===t&&void 0!==o.majorTicks)h=!0===o.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})(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e)):((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})(i,s,o.unit);else{if("minor"!==t||void 0===o.minorTicks)return[];if(!0===o.irregular)h=((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})(i,s,o.getNextKeyValueIncludingRef(e),o.getNextKeyValue(e));else{const t=(t=>{if(void 0!==t)return dh[dh.indexOf(t)+1]})(o);if(void 0===t)return[];h=Hs(i,s,t.unit/o.minorTicks.amount,1)}}return h},ph=t=>(e,i,s,r,n,o)=>{const h=fh(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},mh=s.Record({type:"date-time-ticks",locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new sh,majorTickStyle:new sh,minorTickStyle:new sh,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 Sh extends mh{Lh(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>dh.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]},`;xt.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=fh(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){const t=It(n,"left"===i?a:l);let s;if(s=!1===t?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e)(n):c.greatTicks.getReferenceKeyValue(e)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e)(n):c.getNextKeyValue(e)(n),h=s+e,"right"===i&&!0===t)return""}const d=s.get(t);if(void 0===d)return r(h);const f=d[dh.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Ve:"Great ticks (directive)",Fg:0,Re:!0,Mr:yh("great",e),_r:void 0},{Ve:"Major ticks",Fg:1,Jh:this.majorTickStyle,Kh:n("major"),Mr:yh("major",e),fh:{ir:ph("major")},_r:void 0}];this.greatTickStyle!==nh&&(o.push({Ve:"Great ticks (left)",Jh:this.greatTickStyle.setLabelAlignment(-1),Kh:n("great","left"),Mr:gh(e,"left"),Le:!0,hr:!1}),o.push({Ve:"Great ticks (right)",Jh:this.greatTickStyle.setLabelAlignment(1),Kh:n("great","right"),Mr:gh(e,"right"),Le:!0,hr:!1})),this.minorTickStyle!==nh&&h.push({Ve:"Minor ticks",Fg:2,Jh:this.minorTickStyle,Kh:n("minor"),Mr:yh("minor",e),fh:{ir:ph("minor"),gh:(t,e,i,s,r,n)=>{const o=fh("minor",r,n);return!o||"Week"!==o.label}},_r:void 0});const a=this.cursorFormatter;return{Ne:o,Ge:h,Ee: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)} `},zh:1e3,Vh:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return e!==nh?this.set("greatTickStyle",t(e)):this}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 e!==nh?this.set("minorTickStyle",t(e)):this}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}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 xh=(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 Us(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)},bh=(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,vh=Xs(void 0,2,5),Mh=(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,Ah=(t,e)=>{const i=Mi(t),s=Ai(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&&si(e+t,s,r),Mr:Gs,Le:!0,hr:!0}),o.push({Ve:"Major ticks",Fg:0,Jh:this.majorTickStyle,Kh:void 0===e?s:(t,i,r)=>s(e+t,i,r),Mr:"logarithmic"===t.type?Ah(t.base,!0):xh(0,!0),fh:"logarithmic"===t.type?void 0:{ir:bh},_r:void 0}),this.minorTickStyle!==nh&&o.push({Ve:"Minor ticks",Fg:1,Jh:this.minorTickStyle,Kh:void 0===e?r:(t,i,s)=>r(e+t,i,s),Mr:"logarithmic"===t.type?Ah(t.base,!1):xh(1,!1),fh:"logarithmic"===t.type?{ir:Mh}:{ir:vh},_r:50});const h=this.cursorFormatter?this.cursorFormatter:Ci.Numeric;return{Ne:n,Ge:o,Ee:void 0===e?h:(t,i,s)=>h(e+t,i,s),zh:1e-9,Vh: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 e!==nh?this.set("extremeTickStyle",t(e)):this}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return e!==nh?this.set("minorTickStyle",t(e)):this}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 Eh=s.Record({type:"time-ticks",cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new sh,minorTickStyle:new sh,majorFormattingFunction:void 0,minorFormattingFunction:void 0}),Ih=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Ch={hhmmss:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}`},hhmmssmmm:t=>{let e=Math.abs(t);const i=t>=0?"":"-",s=Math.floor(e/36e5);e%=36e5;const r=Math.floor(e/6e4);e%=6e4;const n=Math.floor(e/1e3);e%=1e3;const o=Math.floor(e/1);return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}`},hhmmssmmmuuu:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:3,maximumFractionDigits:3}).split(".")[1];return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`},hhmmssmmmuuunnn:t=>{const e=Math.abs(t),i=t>=0?"":"-",s=Math.floor(e/36e5),r=Math.floor(e/6e4)%60,n=Math.floor(e/1e3)%60,o=Math.floor(e/1)%1e3,h=t.toLocaleString("en-US",{minimumFractionDigits:6,maximumFractionDigits:6}).split(".")[1];return`${i}${ge(s,2)}:${ge(r,2)}:${ge(n,2)}.${ge(o,3)}${h}`}},Ph={MajorHours12:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Us(t,e,r,void 0,1e6)},fitKeyValues:Xs({ignore:"first"},2,4)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,36e5,1e6),fitKeyValues:Xs({},2,3,4,6)},defaultValueFormatter:Ch.hhmmss},MajorHours:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Us(t,e,r,void 0,1e6)},fitKeyValues:Xs({ignore:"first"},2,6,12)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,3e5,1e6),fitKeyValues:Xs({},2,4,6)},defaultValueFormatter:Ch.hhmmss},MajorMinutes15:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Us(t,e,9e5,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,6e4,1e6),fitKeyValues:Xs({},3,5)},defaultValueFormatter:Ch.hhmmss},MajorMinutes:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Us(t,e,6e4,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,5e3,1e6),fitKeyValues:Xs({},2,3,4,6)},defaultValueFormatter:Ch.hhmmss},MajorSeconds15:{major:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Us(t,e,15e3,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,4)},minor:{format:Ch.hhmmss,getKeyValues:(t,e,i,s)=>Hs(t,e,1e3,1e6),fitKeyValues:Xs({},3,5)},defaultValueFormatter:Ch.hhmmss},MajorSeconds:{major:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Us(t,e,1e3,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,100,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmm},MajorMilliseconds100:{major:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Us(t,e,100,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,10,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmm},MajorMilliseconds10:{major:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Us(t,e,10,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmm,getKeyValues:(t,e,i,s)=>Hs(t,e,1,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmm},MajorMilliseconds:{major:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Us(t,e,1,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.1,1e6),fitKeyValues:Xs({},2)},defaultValueFormatter:Ch.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Us(t,e,.1,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.01,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Us(t,e,.01,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Hs(t,e,.001,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Us(t,e,.001,void 0,1e6)),fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,100*1e-6,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Us(t,e,r,void 0,1e6)},fitKeyValues:Xs({ignore:"first"},2,5)},minor:{format:Ch.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Hs(t,e,10*1e-6,1e6),fitKeyValues:Xs({},2,3,5)},defaultValueFormatter:Ch.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 kh extends Eh{Lh(t){const e=this.timeOrigin||0,i=[{Ve:"Major ticks",Fg:0,Jh:this.majorTickStyle,Kh:this.majorFormattingFunction?this.majorFormattingFunction:(t,i,s)=>{const r=Ih(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Ph[r].major.format)(t+e,i,s)},Mr:(t,e,i,s)=>{const r=Ih(i,s);return(0,Ph[r].major.getKeyValues)(t,e,i,s)},fh:{ir:(t,e,i,s,r,n)=>{const o=Ih(r,n),h=Ph[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},_r:void 0}];return rh(this.minorTickStyle)&&i.push({Ve:"Minor ticks",Fg:1,Jh:this.minorTickStyle,Kh:this.minorFormattingFunction?this.minorFormattingFunction:(t,i,s)=>{const r=Ih(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Ph[r].minor.format)(t+e,i,s)},Mr:(t,e,i,s)=>{const r=Ih(i,s);return(0,Ph[r].minor.getKeyValues)(t,e,i,s)},fh:{ir:(t,e,i,s,r,n)=>{const o=Ih(r,n),h=Ph[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},_r:void 0}),{Ne:[],Ge:i,Ee:this.cursorFormatter||((t,i,s)=>{const r=Ih(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Ph[r].defaultValueFormatter(t+e,i,s)}),zh:1e-4,Vh:864e6}}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return e!==nh?this.set("minorTickStyle",t(e)):this}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 Fh=(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(xt.navigator.msSaveBlob)xt.navigator.msSaveBlob(r,e);else{const t=xt.document.createElement("a");xt.document.body.appendChild(t);const i=xt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{xt.URL.revokeObjectURL(i),xt.document.body.removeChild(t)}),0)}},Bh=(t,i,s,r,n,o)=>{const h=t.vc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},_h=(t,e)=>{if("relative"===t)return e;if(t instanceof Bi)return t;const i=t.x instanceof $s?t.x.ct:t.x.x,s=t.y instanceof $s?t.y.ct:t.y.y;return Di(i,s)},Lh=(t,e,i,s,r)=>{if(i){const n=t,o=e,h=th(o)?o:Ri(o)?s:void 0;if(h&&zi(i)){const t=at(n,h,r.ct);return r.fo({engineX:t.x,engineY:t.y})}if(h&&Ri(i))return at(n,h,s);if(h&&th(i))return at(n,h,i)}else{const i=t;if(Ri(e)){const t=r.do(i);return at({x:t.engineX,y:t.engineY},r.ct,s)}if(th(e)){const t=e,s=r.do(i);return at({x:s.engineX,y:s.engineY},r.ct,t)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")};class Dh{constructor(t,e,i,s,n,o,h,a){this.coordsRelative="relative",this.coordsClient="client",this.Og=[],this.Lg=[],this.P=new r.Eventer,this.Rg=void 0,this.Eg=void 0,this.zg=void 0,this.Ft=S(0,0,0,0),this.Ti=!1,this.Vg=()=>{this.Ng=!0,this.Gg.Ss()},this.Wg=t=>e=>{const i=this.Og.indexOf(e);-1!==i&&this.Og.splice(i,1),this.ls.Ss(),t.G()},this.Hg=t=>{const e=this.Lg.indexOf(t);-1!==e&&this.Lg.splice(e,1),this.ls.Ss()},this.Ng=!0,this.ff=t,this.Ug=i,this.Gg=s,this.removePanel=n,this.Ji=e.ls.Ji;const l=e.ls.Ht();if(this.uiScale=i.d2({scaleXYConstructor:_i}).bi(0,100).vi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:_i}).bi(0,this.uiScale.x.getCellSize()).vi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.ls.$g,this.ls=e.ls.jg,this.ss=this.ls.ss.es(this,{}),this.Yg=()=>e.Xg("unidentified ui"),this.Zg=e.Kg(),this.qg=this.Gg._e(this.uiScale).we(u(0,0)).q(u(100,100)).Me(o).ve(h).setMouseMoveEventHandler(((t,e)=>this.P.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.P.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.P.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.P.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.P.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.P.emit("touchEndPanelBackground",this,e))),a){const t=a.on(this.Vg);this.Jg=()=>a.off(t)}else{const t=e.ls.lo(this.Vg);this.Qg=e.ls.uo.bind(e.ls,t)}this.Rg=n}getTheme(){return this.Ji}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}setBackgroundFillStyle(t){return this.qg.Me(t),this.Gg.Ss(),this}getBackgroundFillStyle(){return this.qg.Th()}setBackgroundStrokeStyle(t){return this.qg.ve(t),this.Gg.Ss(),this}getBackgroundStrokeStyle(){return this.qg.Un()}translateCoordinate(t,e,i){return Lh(t,e,i,this.pixelScale,this.ls)}tp(t){return this.Og.push(t),this.ls.Ss(),t}ip(t){return this.Lg.push(t),this.ls.Ss(),t}addUIElement(t=Qn,e=this.uiScale){e=_h(e,this.pixelScale);const i=this.Yg();return this.tp(Bh(t,i,this.uiScale,e,this.Wg(i),this.Ji))}addLegendBox(t=co,i=this.uiScale){i=_h(i,this.pixelScale);const s=this.ip(Bh(t,this.Zg,this.uiScale,i,this.Hg,this.Ji));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(ws.RightCenter).setPosition({x:100,y:50}):s.setOrigin(ws.CenterBottom).setPosition(this.uiScale.Jt({x:50,y:0},{x:0,y:3}))),s}dispose(){return this.Ti||(this.Ti=!0,this.Qg&&this.Qg(),this.Jg&&this.Jg(),zh(this.uiScale),zh(this.pixelScale),this.Eg&&this.Eg(),this.Gg.G(),this.Zg.G(),this.Og.slice().forEach((t=>{t.dispose()})),this.Lg.slice().forEach((t=>{t.dispose()})),this.ls.Ss(),this.Rg&&this.Rg(this),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return Fh(this.engine,t,e,i),this}xa(t){this.Ft=t,this.Vg()}Y(){return this.pixelScale.Y(),this.uiScale.Y(),this}X(){return this.pixelScale.X(),this.uiScale.X(),this}Ae(t){if(this.Ng){const t=this.Gg.ls.Ht(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Ft.left,this.Ft.right],r=[this.Ft.bottom,this.Ft.top];this.uiScale.Si(s),this.uiScale.xi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.bi(0,n.x).Si(s).vi(0,n.y).xi(r),this.P.emit("resize",this,n.x,n.y,e,i)}this.Ng=!1}sp(){for(let t=0;t{t.Et&&t.Et()};class Oh extends Dh{constructor(t,e,i,s,r,n){super(t,e,i,e.hp("uipanel bg",0),s,e.ls.Ji.uiPanelBackgroundFillStyle,e.ls.Ji.uiPanelBackgroundStrokeStyle,n),this.ep(r,this.pixelScale)}setMinimumSize(t){return this.Uc=t,this.ls.Ss(),this}getMinimumSize(){return this.Uc}Ae(t){super.Ae(t),super.sp()}}const Rh=S(10,10,10,10);class Vh extends Dh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.rp={},this.Qo=Rh,this.Ze=!0,this.np=e.op("chart internal ui",0),this.ap=this.np.Sr(this.uiScale).Ch("Chart").we(u(50,100)).Sa(u(0,1)).Ih(h).Me(a).setMouseInteractions(!1),this.lp=this.ss.xg([this.ap]).ys(this.Ji.effectsText)}setAnimationsEnabled(t){return this.Ze=t,this}getAnimationsEnabled(){return this.Ze}setTitle(t){return this.ap.Ch(t),this.ls.Ss(),this}getTitle(){return this.ap.wh()}getTitleSize(){return this.ap.Ts().Ic()}setTitleFillStyle(t){return this.ap.Me(t),this.Vg(),this}getTitleFillStyle(){return this.ap.Th()}setTitleFont(t){return this.ap.Ih(t),this.Vg(),this}getTitleFont(){return this.ap.Fh()}setTitleRotation(t){return this.ap.Ph(t),this.ls.Ss(),this}getTitleRotation(){return this.ap.Dh()}setTitleEffect(t){return this.lp.ys(t),this.ls.Ss(),this}getTitleEffect(){return this.lp.xs()}setTitleMargin(t){var e,i;return this.rp="object"==typeof t?this.rp?(e=this.rp,{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.Vg(),this}getTitleMargin(){return this.rp}setPadding(t){return this.Qo="object"==typeof t?b(this.Qo,t):{left:t,top:t,right:t,bottom:t},this.Vg(),this}getPadding(){return this.Qo}up(t){const e=t.cp(),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.np.G(),this}}const Nh={dp:(t,e)=>t.Th()!==z&&0!==t.wh().length&&t.getVisible()?t.Ts().Ic().y:0,fp(t,e){t.we(u(50,100)).xa({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var Gh;e.SliceLabelIndices=void 0,(Gh=e.SliceLabelIndices||(e.SliceLabelIndices={}))[Gh.LabelsInsideSlices=0]="LabelsInsideSlices",Gh[Gh.LabelsOnSides=1]="LabelsOnSides";const Hh={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},Uh={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Wh extends Gi{constructor(){super(...arguments),this.bs="Slice",this.u=0}}const Xh=(t,e)=>{Kt(e),t.setExploded(!t.getExploded())};class Yh extends Wh{}class jh extends Yh{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.gp=!1,this.pp=z,this.mp=z,this.yp=this.u,this.Sp=this.gp?1:0,this.xp=this.getVisible(),this.bp=j((()=>this.Ki.ls.Ss())),this.vp=j((()=>this.Ki.ls.Ss())),this.Mp=()=>{this._p=void 0},this.Ap=()=>{this.wp=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.kp=e.Dc(r).us(this.getHighlight()),this.cs(this.kp),this.Ve=i.Sr(r).us(this.getHighlight()),this.cs(this.Ve,{isText:!0}),this.onMouseClick(Xh),this.onTouchEnd(Xh)}setValue(t){return this.Ki.getAnimationsEnabled()?this.xp&&this.Cp(this.yp,t):this.yp=t,this.u=t,this.Ki.ls.Ss(),this}getValue(){return this.u}setExploded(t){if(t&&!1===this.Ki.getMultipleSliceExplosion()){const t=this.Ki.getSlices();for(let e=0;e{this.Sp=t,this.Ki.ls.Ss()})),this.wp.onEveryAnimationEnd(this.Ap),this.gp=!this.gp):!1!==this.Ki.getMultipleSliceExplosion()||t?(this.Sp=this.gp?0:1,this.gp=!this.gp):(this.Sp=0,this.gp=!this.gp),this.Ki.ls.Ss(),this}getExploded(){return this.gp}setVisible(t){return this.xp=t,!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?(this._p&&(this._p.finish(!1),this._p=void 0),this.Cp(this.yp,0,(()=>super.setVisible(!1)))):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this._p&&(this._p.finish(!1),this._p=void 0),super.setVisible(!0),this.Cp(this.yp,this.u)):(this.yp=this.u,super.setVisible(!0)),this}Cp(t,e,i){this._p=this.bp(300,X.ease)([[t,e]],(([t])=>{this.yp=t,this.Ki.ls.Ss()})),this._p.onEveryAnimationEnd(this.Mp),i&&this._p.onAnimationEnd(i)}setStyle(t,e,i,s){this.pp=t,this.mp=i,this.kp.Me(this.pp).ve(e),this.Ve.Me(this.mp).Ih(s);for(let t=0;tri(e,si(yi(.5*(t.Ol()+t.ui())*Math.PI/180),i)),$h=(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.Tp.indexOf(t);e>=0&&(this.Tp.splice(e,1),this.Gp())},this.ff.wn||this.ff.An||this.ls.Mn(7),this.Wp=e.Hp("pieChart bottom",0),this.$p=e.Hp("pieChart top",1),this.ap.Ch("Pie Chart"),this.ep(r,this.pixelScale),this.onBackgroundMouseDoubleClick(qh);const h=Wi(new Xi(qh));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new jh(this.Lp,this.Wp,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);this.Lp+=1,i.setName(t);const s=this.Ze;return this.Ze=!1,i.setValue(e),this.Ze=s,i.setEffect(this.zp),this.jp(i),this.Tp.push(i),this.Gp(),i.setHighlightOnHover(this.Dp),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.ys(t))),this.ls.Ss(),this}getSliceEffect(){return this.zp}setSliceSorter(t){return this.Fp=t,this.Tp=this.Tp.sort(this.Fp),this.ls.Ss(),this}getSliceSorter(){return this.Fp}setLabelFillStyle(t){this.Op="function"==typeof t?t(this.Op):t;for(let t=0;te.ss.hs.ys(t))),this.ls.Ss(),this}getLabelEffect(){return this.Vp}setLabelFormatter(t){return this.Yp=t,this.ls.Ss(),this}getLabelFormatter(){return this.Yp}setSliceHighlightOnHover(t){return this.Dp=t,this.Tp.forEach((e=>e.setHighlightOnHover(t))),this}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+e)),s=u(this.Qo.left+i.x/2,this.Qo.bottom+i.y/2);if(this.ad){const t=this.ad;this.Tp.forEach((e=>{this.jp(e,new V({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Tp[t].kp.setVisible(e),this.Tp[t].Ve.setVisible(e)}this.Tp=this.Tp.sort(this.Fp);const r=this.Tp.filter((t=>t.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tt.dispose())),this}}const Kh={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Qh=(...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};var ta;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(ta||(ta={}));const ea=(t,e,i,s,r,n,o,h,a)=>{if(0===t.length)return;const l=s.x+e*r.x*.5,c=1===i?Math.max:Math.min;let d;for(let r=0;r{const o=r*t.getAnimatedExplosion(),h=t.kp,a=t.Ve,l=Jh(h,i,s+n+o),c=ci(a.ca().y,l,i),d=u(a.ca().x-e*(n+a.Ht().x),c.y);return-1===e&&c.xd.x?[l,d]:[l,c,d]},sa=(...t)=>e=>{const i=(t=>{let e=.5*(t.kp.Ol()+t.kp.ui());for(e%=360;e<0;)e+=360;return e<=90?ta.TopRight:e<180?ta.TopLeft:e<270?ta.BottomLeft:ta.BottomRight})(e);return t.includes(i)},ra=sa(ta.BottomLeft,ta.TopLeft),na=sa(ta.BottomRight,ta.TopRight),oa=sa(ta.TopLeft,ta.TopRight),ha=sa(ta.BottomLeft,ta.BottomRight);class aa extends Zh{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Yp=Uh.NamePlusValue,this.Zp=5,this.Kp=5,this.qp=[],this.Jp=this.Ji.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Jp=t;for(let t=0;t{if(qi(t)){const e=t.getThickness(),i=t.getFillStyle();if(N(i))return 1===e?sr:new nr({size:e,fillStyle:i,shape:"sphere"})}return sr};class da{constructor(t,e,i,s){this.sm=[],this.hm=t,this.rm=e,this.nm=i,this.om=s}am(){this.sm.forEach((t=>t.Ha())),this.nm&&this.nm();const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];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 i=this.sm.slice();e.forEach((t=>{let e=i.pop();e||(e=this.hm(),this.sm.push(e)),this.rm(e,t.instances,t.sharedProperties)})),i.forEach((t=>{t.dispose();const e=this.sm.indexOf(t);e<0?me(0,(()=>{})):this.sm.splice(e,1)})),this.om&&this.om(this.sm)}}}lm(){this.sm.forEach((t=>{t.dispose()})),this.sm.length=0}}class fa{constructor(t){this.um=[],this.dm=t}am(){return this.fm(),{add:()=>this.gm(),finishPlot:()=>{this.pm()}}}gm(){let t=this.um.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.dm()},this.um.push(t)),t.isFree=!1,t.shape}fm(){this.um.forEach((t=>{t.isFree=!0}))}pm(){this.um.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.um.splice(this.um.indexOf(t),1)}))}lm(){this.um.forEach((t=>t.shape.dispose())),this.um.length=0}}class ga{constructor(t,e,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.u=0,this.Fi=!0,this.Ti=!1,this.Ss=t,this.ym=e,this.Sm=i,this.xm=s,this.bm=n,this.vm=o,this.Qc=h,this.Mm=a,this._m=l,this._c=u}setValue(t){return t===this.u||(this.u=t,this.Ss(),this.P.emit("valueChange",this.u)),this}getValue(){return this.u}setTickStyle(t){return this.Sm="function"==typeof t?t(this.Sm):t,this.Ss(),this}getTickStyle(){return this.Sm}setTickLength(t){return this.xm=t,this.Ss(),this}getTickLength(){return this.xm}setGridStrokeStyle(t){return this.bm="function"==typeof t?t(this.bm):t,this.Ss(),this}getGridStrokeStyle(){return this.bm}setTextPadding(t){return this.vm=t,this.Ss(),this}getTextPadding(){return this.vm}setTextRotation(t){return this.Qc=t,this.Ss(),this}getTextRotation(){return this.Qc}setTextFillStyle(t){return this.Mm="function"==typeof t?t(this.Mm):t,this.Ss(),this}getTextFillStyle(){return this.Mm}setTextFont(t){return this._m="function"==typeof t?t(this._m):t,this.Ss(),this}getTextFont(){return this._m}setTextFormatter(t){return this._c=t,this.Ss(),this}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}dispose(){return this.Ti||(this.Ti=!0,this.ym(),this.Ss(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Fi!==t;return this.Fi=t,e&&(this.P.emit("visibleStateChanged",this,this.Fi),this.Ss()),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}class ya extends $s{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Am({x:t.ls.Ji.xAxis3DNumericTicks,y:t.ls.Ji.yAxis3DNumericTicks,z:t.ls.Ji.zAxis3DNumericTicks}),datetime:e.Am({x:t.ls.Ji.xAxis3DDateTimeTicks,y:t.ls.Ji.yAxis3DDateTimeTicks,z:t.ls.Ji.zAxis3DDateTimeTicks}),time:e.Am({x:t.ls.Ji.xAxis3DTimeTicks,y:t.ls.Ji.yAxis3DTimeTicks,z:t.ls.Ji.zAxis3DTimeTicks})},{type:"linear"}),this.Id=[],this.wm=()=>{},this.km=()=>{},this.Cm=()=>{},this.Tm=()=>{},this.chart=t,this.Fm=r,this.Im=n,this.Pm=o,this.Dm=this.Fm.ct;const l=this.yh.Am({x:this.Ji.xAxis3DStrokeStyle,y:this.Ji.yAxis3DStrokeStyle,z:this.Ji.zAxis3DStrokeStyle});this.Bm=this.Fm.tm([Kh.InternalUI]).Pe(l).Om(ca(l)).setMouseInteractions(!1),this.kh=this.Im.Sr(this.Pm).setMouseInteractions(!1).Me(e.Am({x:t.ls.Ji.xAxis3DTitleFillStyle,y:t.ls.Ji.yAxis3DTitleFillStyle,z:t.ls.Ji.zAxis3DTitleFillStyle})).Ih(e.Am({x:t.ls.Ji.xAxis3DTitleFont,y:t.ls.Ji.yAxis3DTitleFont,z:t.ls.Ji.zAxis3DTitleFont})),this.Lm=new fa((()=>this.Im.Sr(this.Pm))),this.Rm=new da((()=>this.Fm.Tg().setMouseInteractions(!1)),((t,e,i)=>{t.Ha().Pe(i.lineStyle),e.forEach((({positions:e})=>t.Wa(e)))})),this.ss=a,this.Bh=this.ss.xg([this.kh]).ys(s.effectsText),this.Bm.setMouseEnterEventHandler(this.wm).setMouseLeaveEventHandler(this.km).setMouseDragEventHandler(this.Cm).setMouseDragStopEventHandler(this.Tm),i.eg=this}setTickStrategy(t,e){return super.Mh(t,e)}getTickStrategy(){return this.He}addCustomTick(){const t=new ga((()=>this.chart.ls.Ss()),(()=>{const e=this.Id.indexOf(t);e>=0&&this.Id.splice(e,1)}),this.Ji.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.Ji.xAxis3DNumericTicks.majorTickStyle.tickLength,this.Ji.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.Ji.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.Ji.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.Ji.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.Ji.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Id.push(t),this.chart.ls.Ss(),t}setStrokeStyle(t){return this.Bm.Pe(t).Om(ca(this.Bm.Yl())),this.chart.ls.Ss(),this}getStrokeStyle(){return this.Bm.Yl()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Bm.setVisible(t),!1===t&&(this.Rm.lm(),this.Lm.lm()),this.Im.Ss(),this}Ag(){return this.chart.getSeries()}Em(t){return Math.abs(this.ct.J(t)*this.Fm.zm(1))}pr(t,e,i){const s=Math.abs(this.ct.J(e-t)*this.Fm.zm(1));return{min:t-i*s,max:e+i*s}}Qh(t,e){return new pa(e,t,this.Im,this.Pm,this.Fm)}tr(t,e){const i=this.Vm(e,t.u,t.dh.Jh.tickLength,t.dh.Jh.tickPadding);return t.Ve.we(i.labelPosition).Sa(i.labelAlignment),i}Vm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ct.getInnerStart())/(this.ct.getInnerEnd()-this.ct.getInnerStart()),c=Ce.addVec(We(n,o,l),Ce.multiplyVec(Ce.multiply(h,this.Fm.zm(.5*this.Bm.Yl().getThickness())),r)),d=Ce.addVec(c,Ce.multiplyVec(Ce.multiply(h,this.Fm.zm(i)),r)),f=this.Fm.Nm(d)||u(0,0);return{labelPosition:ri(at(f,this.chart.engine.scale,this.Pm),si(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}kg(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ct.getInnerStart())/(this.ct.getInnerEnd()-this.ct.getInnerStart()),a=Ce.addVec(We(r,n,h),Ce.multiplyVec(Ce.multiply(o,this.Fm.zm(.5*this.Bm.Yl().getThickness())),s)),l=Ce.addVec(a,Ce.multiplyVec(Ce.multiply(o,this.Fm.zm(10)),s)),c=this.Fm.Nm(a)||u(0,0),d=this.Fm.Nm(l)||u(0,0);return this.Im.De(this.Pm).Oe(c).Be(d).Pe(new $i({fillStyle:new V({color:E(120*i)}),thickness:1}))}dr(t,e){return ma(t,e,this.ct)}Ae(t){if(!this.Fi)return;const e=Math.min(this._h,this.Ah),i=Math.max(this._h,this.Ah),s=this.Dm,r=f(s.x.st(),s.y.st(),s.z.st());let n,o;this.Gm()?(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.yh.Wm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.yh.bd,a=this.Fm.Nm(n)||u(0,0),l=this.Fm.Nm(o)||u(0,0),c=We(n,o,.5),d=Ce.addVec(c,Ce.multiplyVec(Ce.multiply(h,-1),r)),g=this.Fm.Nm(c)||u(0,0),y=this.Fm.Nm(d)||u(0,0),p=ti(ni(at(g,this.chart.engine.scale,this.Pm),at(y,this.chart.engine.scale,this.Pm)));this.Bm.Ha().Wa([n,o]);const{gridlinePositionA:m,gridlinePositionB:S,gridlinePositionC:x}=this.yh.Hm(t),b=t=>({x:-1===t.x?this.Dm.x.getInnerStart():1===t.x?this.Dm.x.getInnerEnd():0,y:-1===t.y?this.Dm.y.getInnerStart():1===t.y?this.Dm.y.getInnerEnd():0,z:-1===t.z?this.Dm.z.getInnerStart():1===t.z?this.Dm.z.getInnerEnd():0}),v=b(m),M=b(S),A=b(x),w={physicalAxisSize:ii(ni(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:p,gridlinePositionA:v,gridlinePositionB:M,gridlinePositionC:A},T=this.Hh(w),E=this.Rm.am();for(const[t,e]of this.Ue)for(const[,i]of e){const e=T.get(i);if(!e)continue;const s=this.Um(w,e);E.add({positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.Jh.tickStyle}),s.gridStroke&&E.add({positions:s.gridStroke},{lineStyle:t.Jh.gridStrokeStyle})}const I=this.Lm.am(),C={x:0,y:0};this.Id.forEach((t=>{if(!t.Fi||t.ui)return;const s=this.Vm(w,t.u,t.xm,t.vm),r=this.Um(w,s),n=I.add().we(s.labelPosition).Sa(s.labelAlignment).Me(t.Mm).Ih(t._m).Ch(t._c(t.u)).Ph(t.Qc).Ts().Ht();C.x=Math.max(C.x,n.x),C.y=Math.max(C.y,n.y),E.add({positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.Sm}),r.gridStroke&&E.add({positions:r.gridStroke},{lineStyle:t.bm})})),I.finishPlot(),E.finishPlot();const P=this.er(((t,e)=>{const i=e.Ve.Ht();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:C.x,y:C.y}),k=Math.atan((l.y-a.y)/(l.x-a.x));this.kh.Sa({x:0,y:0}).Ph(180*-k/Math.PI);const F=Ce.addVec(c,Ce.multiplyVec(Ce.multiply(h,this.Fm.zm(.5*this.Bm.Yl().getThickness()+this.rr(((t,e)=>Math.max(t,e.tickLength)),0))),r)),B=this.Fm.Nm(F)||u(0,0),_=ri(at(B,this.chart.engine.scale,this.Pm),ri(ri(oi(P,p),si(p,this.rr(((t,e)=>Math.max(t,e.labelPadding)),0))),oi(si(this.kh.Ts().Ht(),.5),p)));this.kh.we(_),this.Bm.$m={overrideFollowing:!1,skipMousePicking:!1}}Um(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return It(h,0)||It(h,1)||(a=[this.jm()?{...i,x:n.x}:this.Ym()?{...i,y:n.y}:this.Gm()?{...i,z:n.z}:{x:0,y:0,z:0},this.jm()?{...s,x:n.x}:this.Ym()?{...s,y:n.y}:this.Gm()?{...s,z:n.z}:{x:0,y:0,z:0},this.jm()?{...r,x:n.x}:this.Ym()?{...r,y:n.y}:this.Gm()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Oh(){super.Oh(),this.Rm.lm(),this.Lm.lm()}jm(){return this.yh.jm()}Ym(){return this.yh.Ym()}Gm(){return this.yh.Gm()}}class pa extends qs{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.wd=r}}const ma=(t,e,i)=>Ct(t+.1*(e-t)+Math.abs(i.st())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e)),Sa=(t,e,i,s)=>({nr:()=>{const i=t();let s;for(const t of i){if(!t.Xm())continue;const i=e(t);s=void 0===i?s:void 0!==s?Math.min(s,i):i}return s},ar:()=>{const e=t();let s;for(const t of e){if(!t.Xm())continue;const e=i(t);s=void 0===e?s:void 0!==s?Math.max(s,e):e}return s},ur:()=>{const e=t();let i;for(const t of e){if(!t.Xm())continue;const e=s(t);i=void 0===e?i:void 0!==i?Math.max(i,e):e}return i}}),xa=t=>({...Sa(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.ur().y)),Am:t=>t.y,Wm:(t,e)=>({x:e.x,y:t.y,z:e.z}),bd:f(-1,0,0),Hm: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)}},jm:()=>!1,Ym:()=>!0,Gm:()=>!1}),ba=t=>({...Sa(t,(t=>t.getZMin()),(t=>t.getZMax()),(t=>t.ur().z)),Am:t=>t.z,Wm:(t,e)=>({x:e.x,y:e.y,z:t.z}),bd:f(1,0,0),Hm: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)}},jm:()=>!1,Ym:()=>!1,Gm:()=>!0});class va extends Gi{constructor(t,e,i,s,r){super(t,e,s,r),this.Zm=Bo,this.Km=!0,this.qm=!0,this.Ki=t,this.Fm=i,this.Qi=new Map,this.onMouseWheel(this.Ki.Jm),this.onMouseDrag(this.Ki.Qm),this.onTouchStart(this.Ki.ty.onTouchStart),this.onTouchMove(this.Ki.ty.onTouchMove),this.onTouchEnd(this.Ki.ty.onTouchEnd)}setAutoScrollingEnabled(t){return this.Km=t,this.Ki.ls.Ss(),this}getAutoScrollingEnabled(){return this.Km}setColorShadingStyle(t){return this.Zm=t,this.Qi.forEach(((e,i)=>i.iy(t))),this.Fm.Ss(),this}getColorShadingStyle(){return this.Zm}setDepthTestEnabled(t){return this.qm=t,this.Qi.forEach(((e,i)=>i.sy(t))),this.Fm.Ss(),this}getDepthTestEnabled(){return this.qm}ey(){}Ae(){}om(){}getXMax(){const t=this.Aa;return t?t._t():void 0}getXMin(){const t=this.Aa;return t?t.Mt():void 0}getYMax(){const t=this.Aa;return t?t.wt():void 0}getYMin(){const t=this.Aa;return t?t.At():void 0}getZMax(){const t=this.Aa;return t?t.hy():void 0}getZMin(){const t=this.Aa;return t?t.ny():void 0}ur(){const t=this.Aa;return t?f(t.sl(),t.el(),t.oy()):f(0,0,0)}}class Ma extends va{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.bs="Box Series 3D",this.ly=.25,this.ld=()=>de(this.Se),this.Se=ye(this.Ji.boxSeries3DFillStyle,r),this.Aa=this.Fm.gy().sy(this.qm).Me(this.Se).uy(this.ly).us(this.getHighlight()),this.cs(this.Aa)}invalidateData(t){const e=t.length;if(0===e)return this;const i=t[0];if(!i)return this;let s;if("xMin"in i||"yMin"in i||"zMin"in i||"xMax"in i||"yMax"in i||"zMax"in i){s=[];for(let i=0;ide(this.jl.getFillStyle())}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;return this.Aa.Pe(e),this.Fm.Ss(),this}getStrokeStyle(){return this.jl}add(t){return(t=Array.isArray(t)?t:[t])?(this.Aa.Wa(t.slice()),this.Fm.Ss(),this):this}clear(){return this.Aa.Ha(),this}getPointAmount(){const t=this.Aa;return t.Ua()+t.$a()}Xm(){return this.Km&&this.getPointAmount()>0&&this.getVisible()}ke(t,e){t.us(e),this.Fm.Ss()}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{stroke:this.jl}),this}}class wa extends Aa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.bs="Line Series 3D",this.jl=ye(s.lineSeries3DStrokeStyle,r),this.my=vr.pointStyle3D,this.yy(this.jl),this.Aa=this.Fm.tm([Kh.UserSeries]).sy(this.qm).Pe(this.jl).Om(this.my).us(this.getHighlight()),this.cs(this.Aa)}setStrokeStyle(t){super.setStrokeStyle(t),this.yy(this.jl);const e=this.my;return this.Aa.Om(e),this}yy(t){const e=new ur.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.my=e}}class Ta extends Aa{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.bs="Point Line Series 3D",this.ld=()=>de(this.jl.getFillStyle())||de(this.my.getFillStyle()),this.my=ye(s.pointLineSeries3DPointStyle,r),this.jl=ye(s.lineSeries3DStrokeStyle,r),this.Sy(),this.Aa=this.Fm.tm([Kh.UserSeries]).sy(this.qm).Pe(this.jl).Om(this.my).us(this.getHighlight()),this.cs(this.Aa)}setPointStyle(t){return this.my="function"==typeof t?t(this.my):t,this.Sy(),this.Aa.Om(this.my),this.Fm.Ss(),this}getPointStyle(){return this.my}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.jl,i=Math.abs(e.getThickness()),s=this.my;i>s.getSize()&&(this.my=s.setSize(i)),this.Sy();const r=this.my;return this.Aa.Om(r),this.Fm.Ss(),this}Sy(){const t=this.my,e=t.getSize();this.my=t.setSize(e)}ke(t,e){t.us(e),this.Fm.Ss()}}class Ea extends va{constructor(t,e,i,s,r,n){super(t,e,i,s,r)}add(t){return(t=Array.isArray(t)?t:[t])?(this.Aa.Wa(t.slice()),this.Fm.Ss(),this):this}clear(){return this.Aa.Ha(),this}getPointAmount(){const t=this.Aa;return t.Ua()+t.$a()}Xm(){return this.Km&&this.getPointAmount()>0&&this.getVisible()}ke(t,e){t.us(e),this.Fm.Ss()}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{point3D:this.xy}),this}}class Ia extends Ea{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.bs="Point Series 3D",this.ld=()=>de(this.xy.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.Ki.getSeries().length;this.xy=ye(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Aa=this.Fm.vy(h).sy(this.qm).by(this.xy).us(this.getHighlight()),this.cs(this.Aa)}setPointStyle(t){this.xy="function"==typeof t?t(this.xy):t;const e=this.xy;return this.Aa.by(e),this.Fm.Ss(),this}getPointStyle(){return this.xy}}class Ca extends Ea{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.bs="Point Cloud Series 3D",this.ld=()=>de(this.xy.getFillStyle());const o=this.Ki.getSeries().length;this.xy=ye(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Aa=this.Fm.vy(h).by(this.xy).us(this.getHighlight()),this.cs(this.Aa)}setPointStyle(t){this.xy="function"==typeof t?t(this.xy):t;const e=this.xy;return this.Aa.by(e),this.Fm.Ss(),this}getPointStyle(){return this.xy}}const Pa={Triangulated:Ia,Pixelated:Ca};class ka extends Vh{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.My=[],this._y=0,this.Ay=t=>{const e=this.My.indexOf(t);e>=0&&(this.My.splice(e,1),this.P.emit("seriesDispose",this,t))},this.wy=()=>{this._y+=1},this.ky=()=>{this._y-=1},this.onSeriesBackgroundMouseEnter=t=>this.P.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.P.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.P.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.P.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.P.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.P.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.P.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.P.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.P.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.P.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.P.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.P.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.P.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.P.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.P.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.P.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.P.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.P.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.P.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.P.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.P.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.P.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.P.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.P.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.P.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.P.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.P.off(t,"touchEndSeriesBackground"),this.Cy=this.ss.xg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.My.forEach((e=>e.setAnimationHighlight(t))),this}Ty(t,e){this.Cy.ds([e]),t.setMouseMoveEventHandler(((t,e)=>{this.P.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.P.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.P.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.P.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.P.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.P.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.Fy.Me(t),this.ls.Ss(),this}getSeriesBackgroundFillStyle(){return this.Fy.Th()}setSeriesBackgroundStrokeStyle(t){return this.Iy.ve(t),this.ls.Ss(),this}getSeriesBackgroundStrokeStyle(){return this.Iy.Un()}setSeriesBackgroundEffect(t){return this.Cy.ys(t),this.ls.Ss(),this}getSeriesBackgroundEffect(){return this.Cy.xs()}Py(t){this.My.push(t),t.onMouseEnter(this.wy),t.onMouseLeave(this.ky),void 0!==this.Dy&&t.setHighlightOnHover(this.Dy),this.P.emit("seriesAdded",this,t)}Sd(){return this.My}By(){return this._y}setSeriesHighlightOnHover(t){return this.Dy=t,this.My.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.My.slice().forEach(Tt),super.dispose()}}const Fa=Ce.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class Ba{constructor(t,e,i,s){this.Oy=!0,this.Ly=!0,this.Ry=2*-Math.PI/2160,this.Ey=2*Math.PI/2160,this.zy=.1,this.Vy=1*Math.PI/180,this.Ny=t,this.Gy=e,this.Wy=i,this.Nm=s}getDefaultCameraConfiguration(t){const e={direction:Fa,location:Ce.multiply(Fa,-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.Hy(i,t):"wheel-zoom"===t.type?i=this.Uy(i,t):"rotate+zoom"===t.type?i=this.$y(i,t):"fixed-rotate"===t.type?i=this.jy(i,t):"move"===t.type&&(i=this.Yy(i,t))})),this.Oy?i=this.Xy(t.boundingBox,i):this.Ly&&(i=this.Zy(t.boundingBox,i)),i}Hy(t,e){const{rotation:i}=e,s=t.location,r=Ce.multiply(Ce.normalize(t.location),-1),{Right:n,Up:o}=this.Ky(r);let h=s;const a=this.qy(r),l=i.x*this.Ry*a;h=Ce.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Ey,a-this.Vy);return 0!==u&&(h=Ce.rotateAroundAxis(h,n,u)),{location:h,direction:Ce.multiply(Ce.normalize(h),-1)}}Uy(t,e){const{deltaY:i}=e;this.Oy&&this.Jy(!1);const s=t.location,r=Ce.multiply(Ce.normalize(s),-1),n=i*this.zy,o=Ce.length(s)*-n;return{direction:r,location:Ce.addVec(s,Ce.multiply(r,o))}}$y(t,e){const{rotation:i,cameraDistance:s}=e;this.Oy&&this.Jy(!1);let r=this.Hy(t,{type:"rotate",rotation:i});const n=r.location,o=Ce.multiply(Ce.normalize(n),-1),h=Ce.multiply(o,-s);return r={direction:Ce.multiply(Ce.normalize(h),-1),location:h},r}jy(t,e){this.Oy&&this.Jy(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.Ky(r),h=i.x*this.Ry;let a=Ce.normalize(Ce.rotateAroundAxis(r,o,h));const l=i.y*this.Ey;return a=Ce.normalize(Ce.rotateAroundAxis(a,n,l)),{location:s,direction:a}}Yy(t,e){this.Oy&&this.Jy(!1),this.Ly=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.Ky(n);return{location:Ce.addVec(r,Ce.multiply(n,.01*s),Ce.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ce.multiply(Ce.normalize(t.cameraLocation),-1)};return this.Oy?this.Xy(t.boundingBox,e):this.Zy(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ce.multiply(Ce.normalize(t.cameraLocation),-1)};return this.Oy?this.Xy(t.boundingBox,e):this.Zy(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ce.multiply(Ce.normalize(t.cameraLocation),-1)};if(this.Oy)return this.Xy(t.boundingBox,e)}Xy(t,e,i){let s=e;i=void 0!==i?i:0,s=this.Qy(t,s,100,20,1,i,5);const r=this.qy(s.direction);return s=this.tS(s,this.iS(t,s,100,1),r),s}Qy(t,e,i,s,r,n,o){return _a(n,o,(t=>({direction:e.direction,location:Ce.multiply(e.direction,-t)})),(e=>this.sS(t,e)),i,r,"linear",s)}iS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.Ky(e.direction),a=this.eS(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:Ce.normalize(Ce.lerp(l.direction,h,t))})),(e=>this.hS(t,e)),0,u,!0,i):La(0,c,(t=>({location:l.location,direction:Ce.normalize(Ce.lerp(l.direction,o,t))})),(e=>this.hS(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ce.normalize(Ce.lerp(l.direction,n,t))})),(e=>this.rS(t,e)),0,u,!0,i):La(0,c,(t=>({location:l.location,direction:Ce.normalize(Ce.lerp(l.direction,r,t))})),(e=>this.rS(t,e)),0,u,!0,i)),l}sS(t,e){const i=this.eS(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}rS(t,e){const i=this.eS(t,!1,e);return Math.abs(i.left-i.right)}hS(t,e){const i=this.eS(t,!1,e);return Math.abs(i.top-i.bottom)}eS(t,e,i){const s=Xe(this.nS(t,e,i).map((t=>at(t,this.Ny,this.Gy))));return{left:s.min.x,right:this.Gy.x.getInnerEnd()-s.max.x,top:this.Gy.y.getInnerEnd()-s.max.y,bottom:s.min.y}}nS(t,e,i){const s=this.Wy,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.Nm(t,i))).filter((t=>void 0!==t))}Zy(t,e){const i=Ce.length(e.location),s=this.oS(t);return i{let a,l=0,u=(e+t)/2;do{const h=i(u);if(a={value:u,result:h,score:s(h)},Math.abs(a.score-r)<=n)break;const c=a.score>r;c&&"linear"===o||!c&&"reversed"===o?(u=(a.value+t)/2,e=a.value):(u=(a.value+e)/2,t=a.value),l+=1}while(l{let a,l=0,u=t;do{const c=i(u),d=s(c);if(void 0===a||Math.abs(d-r)de(this.Se),this.Zm=ko;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.Se=ye(this.Ji.surfaceGridSeries3DFillStyle,o),this.lu=ye(this.Ji.surfaceGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.end?{x:(s.end.x-h.x)/s.columns,z:(s.end.z-h.z)/s.rows}:s.step||{x:1,z:1},l={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this._n=l,this.Aa=this.Fm.lS(l).Me(this.Se).uu(this.lu).iy(this.Zm).us(this.getHighlight()),this.cs(this.Aa)}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Aa.Me(this.Se),this.Fm.Ss(),this}getFillStyle(){return this.Se}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.Aa.uu(this.lu),this.Fm.Ss(),this}getWireframeStyle(){return this.Aa.cu()}setIntensityInterpolation(t){return t=t||"disabled",this.Aa.uS(t),this.Fm.Ss(),this}getIntensityInterpolation(){return this.Aa.cS()}invalidateIntensityValues(t){if(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._n.dataOrder?t.length:t[0].length,rows:"rows"===this._n.dataOrder?t.length:t[0].length},i="columns"===this._n.dataOrder?this._n.columns:this._n.rows,s="columns"===this._n.dataOrder?this._n.rows:this._n.columns;if(e.x>i||e.y>s){if(!0===this.Ki.ff.Pn){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this._n.columns}x${this._n.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.ff.Pn){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this._n.columns}x${this._n.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.`;xt.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.ff.Pn){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this._n.columns}x${this._n.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.ff.Pn){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this._n.columns}x${this._n.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.`;xt.console.warn(i)}const a=Math.max(-i,0),l=Math.max(-r,0),u=Math.max(s-o,0),c=Math.max(n-h,0),d=e.primary-(a+u),f=[];if(0===l&&0===c)for(let e=0;ede(this.Se),this.Zm=ko;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.Ki.getSeries().length;this.Se=ye(this.Ji.surfaceScrollingGridSeries3DFillStyle,o),this.lu=ye(this.Ji.surfaceScrollingGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.step||{x:1,z:1},l={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this._n=l,this.Aa=this.Fm.mS(l).Me(this.Se).uu(this.lu).iy(this.Zm).us(this.getHighlight()),this.cs(this.Aa)}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Aa.Me(this.Se),this.Fm.Ss(),this}getFillStyle(){return this.Se}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.Aa.uu(this.lu),this.Fm.Ss(),this}getWireframeStyle(){return this.Aa.cu()}setIntensityInterpolation(t){return t=t||"disabled",this.Aa.uS(t),this.Fm.Ss(),this}getIntensityInterpolation(){return this.Aa.cS()}clear(){return this.Aa.Ha(),this.Fm.Ss(),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._n.scrollDimension?this._n.rows:this._n.columns;if(i>s-1){if(!0===this.Ki.ff.Pn){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this._n.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.Ki.ff.Pn){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this._n.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.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.Aa.yS({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Fm.Ss(),this}setCullMode(t){return this.Aa.gS("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Aa.pS()}ey(){}Ae(){}om(){}Xm(){return this.Km&&this.getVisible()}ke(t,e){t.us(e),this.Fm.Ss()}}const Oa=t=>!!(t&&"object"==typeof t&&"id"in t&&"chart"in t&&t.chart instanceof Va),Ra=t=>!!(t&&"object"==typeof t&&"x"in t&&"number"==typeof t.x&&"y"in t&&"number"==typeof t.y&&"z"in t&&"number"==typeof t.z);class Va extends ka{constructor(t,e,i,s,r,n,o){var h;let a;super(t,e,i,e.hp("chart3D bg",0),s,e.ls.Ji.chart3DBackgroundFillStyle,e.ls.Ji.chart3DBackgroundStrokeStyle,e.ls.Ji.chart3DTitleFont,e.ls.Ji.chart3DTitleFillStyle,n),this.SS=1,this.xS=[],this.bS=2,this.vS=!0,this.MS=!0,this._S=!0,this.AS=0,this.coordsAxis={id:"axes",chart:this},this.coordsWorld={id:"world",chart:this},this.axes={id:"axes",chart:this},this.world={id:"world",chart:this},this.Wr=[],this.Yr=()=>{const t=this.Fm.wS();this.CS.kS(t),this.TS.kS(t);const e=this.FS.viewportChanged(this.IS());e&&this.PS(e),this.ls.Ss()},this.Qm=(t,e,i,s,r)=>{if(this._S){const t=r;this.xS.push({type:"rotate",rotation:t}),this.ls.Ss(),Kt(e)}},this.Jm=(t,e)=>{if(this.MS){if(this.vS)Math.sign(this.AS)!==Math.sign(e.deltaY)?this.AS=pe(e):this.AS+=pe(e);else{const t=pe(e);this.xS.push({type:"wheel-zoom",deltaY:t})}this.ls.Ss(),Kt(e)}},this.ff.wn||this.ff.An||this.ls.Mn(1),this.ap.Ch("Chart3D"),this.DS=i.d3(),this.DS.x.Z(-1,1),this.DS.y.Z(-1,1),this.DS.z.Z(-1,1),this.Fm=e.BS("chart3D layer3D",0,this.DS),this.CS=e.OS("chart3D series bg",0),this.TS=e.Hp("chart3D axis ui",1),this.LS={x:new ya(this,(h=()=>this.My,{...Sa(h,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.ur().x)),Am:t=>t.x,Wm:(t,e)=>({x:t.x,y:e.y,z:e.z}),bd:f(0,-1,0),Hm: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)}},jm:()=>!0,Ym:()=>!1,Gm:()=>!1}),this.DS.x,this.Ji,this.Fm,this.TS,this.pixelScale,!1,this.ss),y:new ya(this,xa((()=>this.My)),this.DS.y,this.Ji,this.Fm,this.TS,this.pixelScale,!1,this.ss),z:new ya(this,ba((()=>this.My)),this.DS.z,this.Ji,this.Fm,this.TS,this.pixelScale,!1,this.ss)},this.RS=this.Fm.tm([Kh.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.Ji.chart3DBoundingBoxStrokeStyle),this.Fy=this.CS.Cc(this.engine.scale,sn.Simple).Me(this.Ji.chart3DSeriesBackgroundFillStyle).ve(st).setMouseInteractions(!0),this.Iy=this.CS.Cc(this.engine.scale,sn.Simple).Me(z).ve(this.Ji.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ty(this.Fy,this.Iy),this.ES({x:1,y:1,z:1},!0),this.FS=new Ba(this.engine.scale,this.pixelScale,this.DS,((t,e)=>(e&&this.PS(e),this.Fm.Nm(t)))),this.zS=this.FS.getDefaultCameraConfiguration(this.VS(this.NS)),this.PS(this.zS),this.ty=Wi(new ji(((t,e,i)=>{a={locationOne:e,locationTwo:i,cameraLocation:this.Fm.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this._S&&!this.MS)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=Ce.length(a.cameraLocation),c=o/h*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.xS.push({type:"rotate+zoom",rotation:this._S?d:{x:0,y:0},cameraDistance:this.MS?c:l}),this.ls.Ss(),Kt(n)}),(t=>{})),new Yi((t=>{}),((t,e,i,s,r)=>{if(this._S){const t=s;this.xS.push({type:"rotate",rotation:t}),this.ls.Ss(),Kt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.ty.onTouchStart),this.onBackgroundTouchMove(this.ty.onTouchMove),this.onBackgroundTouchEnd(this.ty.onTouchEnd),this.onSeriesBackgroundTouchStart(this.ty.onTouchStart),this.onSeriesBackgroundTouchMove(this.ty.onTouchMove),this.onSeriesBackgroundTouchEnd(this.ty.onTouchEnd),this.onBackgroundMouseDrag(this.Qm),this.onBackgroundMouseWheel(this.Jm),this.onBackgroundMouseDown(((t,e)=>{Kt(e)})),this.onSeriesBackgroundMouseDrag(this.Qm),this.onSeriesBackgroundMouseWheel(this.Jm),this.onSeriesBackgroundMouseDown(((t,e)=>{Kt(e)})),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.onResize(this.Yr),this.Yr(),this.ep(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||Ia)(this,this.Ay,this.Fm,this.Ji,this.ls.ss,t);return this.Py(e),e}addLineSeries(t){const e=new wa(this,this.Ay,this.Fm,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPointLineSeries(t){const e=new Ta(this,this.Ay,this.Fm,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addSurfaceGridSeries(t){const e=new Da(this,this.Ay,this.Fm,t,this.Ji,this.ls.ss);return this.Py(e),e}addSurfaceScrollingGridSeries(t){const e=new za(this,this.Ay,this.Fm,t,this.Ji,this.ls.ss);return this.Py(e),e}addBoxSeries(t){const e=new Ma(this,this.Ay,this.Fm,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}translateCoordinate(t,e,i){if(Oa(e)||Oa(i)||Ra(t)){if(Oa(e)&&Oa(i)&&Ra(t)){if("axes"===e.id&&"world"===i.id)return this.Fm.GS(t);if("world"===e.id&&"axes"===i.id)return this.Fm.WS(t);if(e.id===i.id)return t}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}return Lh(t,e,i,this.pixelScale,this.ls)}getDefaultAxisX(){return this.LS.x}getDefaultAxisY(){return this.LS.y}getDefaultAxisZ(){return this.LS.z}getDefaultAxes(){return[this.LS.x,this.LS.y,this.LS.z]}setCameraLocation(t){let e={location:t,direction:Ce.normalize(Ce.multiply(t,-1))};const i=this.FS.cameraLocationChanged(this.IS(e));return i&&(e=i),this.PS(e),this.ls.Ss(),this}getCameraLocation(){return this.Fm.getCameraLocation()}getCameraDirection(){return this.Fm.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.FS.Jy(t);const e=this.FS.cameraLocationChanged(this.IS());return e&&this.PS(e),this}getCameraAutomaticFittingEnabled(){return this.FS.aS()}onCameraChange(t){return this.P.on("cameraChange",t)}offCameraChange(t){return this.P.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.RS.Pe(t).Om(ca(this.RS.Yl())),this.Fm.Ss(),this}getBoundingBoxStrokeStyle(){return this.RS.Yl()}setBoundingBox(t){return this.ES(t,!1),this}ES(t,e){this.NS=t;const i=this.VS(t);if(this.DS.x.q(i.x),this.DS.y.q(i.y),this.DS.z.q(-i.z),!e){const t=this.FS.boundingBoxChanged(this.IS());t&&this.PS(t)}this.ls.Ss()}getBoundingBox(){return this.NS}Ae(t){if(Nh.fp(this.ap,this.rp),0!==this.AS){const e=this.AS*t*.006;this.xS.push({type:"wheel-zoom",deltaY:e}),this.AS=Math.sign(this.AS)*Math.max(Math.abs(this.AS)-.01*t,0),0!==this.AS&&this.ls.Ss(!0)}const e=this.getCameraDirection();if(this.xS.length>0){const t=this.FS.applyCameraInteractions(this.IS(),this.xS);t&&this.PS(t),this.xS.length=0}this.HS&&Ce.equals(this.HS.location,this.zS.location)&&Ce.equals(this.HS.direction,this.zS.direction)||this.P.emit("cameraChange",this,this.getCameraLocation()),this.HS=this.zS,super.Ae(t);for(let t=0;tthis.Fm.Nm(t))),o=this.Fm.Nm(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=oe(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.Wr.length=0,this.DS.G(),this.Fm.G(),this.TS.G(),this.CS.G(),super.dispose()}Y(){return this.DS.x.Y(),this.DS.y.Y(),this.DS.z.Y(),super.Y()}X(){return super.X()}PS(t){this.Fm.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ce.addVec(t.location,Ce.multiply(t.direction,-this.bS))),this.zS=t,this.ls.Ss()}VS(t){return Ce.divide(t,Ce.length(t)/this.SS)}IS(t=this.zS){return{boundingBox:this.VS(this.NS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.MS=t,this}getMouseInteractionZoom(){return this.MS}setMouseInteractionRotate(t){return this._S=t,this}getMouseInteractionRotate(){return this._S}forEachAxis(t){return t(this.LS.x),t(this.LS.y),t(this.LS.z),this}getSeries(){return this.My}getMinimumSize(){}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.vS=!!t,this}getAnimationZoom(){return this.vS}}const Na={Column:Yn,Row:jn};class Ga extends Oh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.US=new Map,this.$S=this.addUIElement(Na.Row).setPosition({x:0,y:100}).setOrigin(ws.LeftTop).setBackground((t=>t.setFillStyle(z).setStrokeStyle(st)))}add(t,e){return(t instanceof Vh?[t]:t instanceof Vf?t.getCells().filter((t=>t.panel instanceof Vh)).map((t=>t.panel)):[]).forEach((t=>{const i=this.$S.addElement(vo.VerticalLegendBox).setBackground((t=>t.setFillStyle(z).setStrokeStyle(st))).add(t,e).setTitle(t.getTitle());this.US.set(t,i)})),this.ls.Ss(),this}setLegendBoxes(t){return this.US.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.$S.getSize()}}class Ha{constructor(t,e){this.jS=t,this.YS=e}alter(t){this.XS=void 0!==this.XS?this.XS:this.YS(),this.ZS=t,this.jS(t)}resetValue(){void 0!==this.ZS&&(void 0!==this.XS&&this.isAltered()&&this.jS(this.XS),this.XS=void 0,this.ZS=void 0)}getNormalValue(){return void 0!==this.XS?this.XS:this.YS()}isAltered(){return void 0!==this.ZS&&this.YS()===this.ZS}}class Ua{constructor(t,e){this.KS=[],this.qS=t,this.ct=e}update(){return this.qS.getVisible()?!(this.JS()&&(!this.QS()||(this.resetTable(),this.qS.Ts(),this.JS()))&&(this.tx(),this.qS.Ts(),this.JS()&&(this.resetTable(),this.qS.Ts(),1))):(this.QS()&&this.resetTable(),!0)}QS(){for(let t=0;t{const s=at(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=at(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.qS,this.ct)}ix(){return((t,i)=>{const s=at(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=at(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.qS,this.ct)}sx(){return((t,i)=>{const s=at(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=at(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.qS,this.ct)}hx(t){return this.KS.push(t),t}}class Wa extends Ua{constructor(){super(...arguments),this.Jo=this.hx(new Ha((t=>this.qS.setOrigin(t)),(()=>this.qS.getOrigin())))}tx(){const t=this.Jo.getNormalValue(),e=u(this.ix()?-t.x:t.x,this.sx()?-t.y:t.y);this.Jo.alter(e)}}class Xa extends Ua{constructor(t,e,i,s){super(t,e),this.nx=this.hx(new Ha((t=>this.qS.setTextFont((e=>e.setSize(t)))),(()=>this.qS.getTextFont().getSize()))),this.ox=i,this.lx=s}tx(){const t=this.nx.getNormalValue(),e=this.ox;if(enew Wa(t,e),FontSize:(t=5,e=5)=>(i,s)=>new Xa(i,s,t,e)};class ja{constructor(){this.ux=[]}addRow(...t){return this.ux.push(t),this}}class Ja extends ja{vc(){const t=this.ux;return this.ux=[],t}gx(){return this.ux.length=0,this}}class $a extends Wn{constructor(){super(...arguments),this.cc=this.Ji.cursorResultTableTextFont,this.Qc=0,this.Mm=this.Ji.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!==o&&o.length>0){for(let t=h.length;t=h.length)t=r.addElement(Ln,void 0);else{const e=h[n];e instanceof Vn?(r.getMembers()[n].dispose(),t=r.addElement(Ln,n)):t=e}t.setFont(this.cc).setFillStyle(this.Mm).setText(o).setTextRotation(this.Qc)}else{for(let t=h.length;t=h.length?r.addGap(void 0,void 0):h[n]instanceof _n&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.As.Ss(),this}setTextFillStyle(t){this.Mm="function"==typeof t?t(this.Mm):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this._x=Ya.Flip(this.qS,this.scale)}dispose(){return this.Mx.dispose(),this.qS.dispose(),this}pointAt(t){return this.jo=t.scale===this.scale?t.location:at(t.location,t.scale,this.scale),this.Mx.setPosition(this.jo),this.qS.setPosition(this.jo).setContent(t.resultTableContent),this.As.Ss(),this}getPosition(){return this.jo}setVisible(t){return this.Fi=t,this.As.Ss(),this}getVisible(){return this.Fi}setPointMarkerVisible(t){return this.yx=t,this.As.Ss(),this}getPointMarkerVisible(){return this.yx}setPointMarker(t){return t(this.Mx),this.As.Ss(),this}getPointMarker(){return this.Mx}setResultTableVisible(t){return this.Sx=t,this.As.Ss(),this}getResultTableVisible(){return this.Sx}setResultTable(t){return t(this.qS),this.As.Ss(),this}getResultTable(){return this.qS}setAutoFitStrategy(t){return this._x&&this._x.resetTable(),this._x=t?t(this.qS,this.As.ls.ct):void 0,this.As.Ss(),this}getAutoFitStrategy(){return void 0!==this._x}Ae(){return this._x&&this._x.update(),this.qS.setVisible(this.xx&&this.Fi&&this.Sx),this.Mx.setVisible(this.xx&&this.Fi&&this.yx),this.Mx.Ae(),this.qS.Ae(),this}Ts(){return this.Mx.Ts(),this.qS.Ts(),this.xx=((t,e,i=e)=>{const s=e!==i?at(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.jo,this.scale),this}}class Za extends qa{constructor(){super(...arguments),this.Ax=!1}pointAt(t){return this.wx(t.fillStyle),super.pointAt(t)}wx(t){t&&this.Ax&&this.qS.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.Ax=t,this.As.Ss(),this}getResultTableAutoTextStyle(){return this.Ax}}class Ka extends qa{setPosition(t){return this.jo=t,this.Mx.setPosition(t),this.qS.setPosition(t),this.As.Ss(),this}}class Qa{constructor(t,e,i=[]){this.kx=[],this.Cx=(t,e)=>(this.kx.forEach((i=>i(t,e))),t),this.bx=t,this.vx=e,this.kx=i}}class tl extends Qa{constructor(){super(...arguments),this.Tx=(t,e,i,s)=>this.Cx(new Za(t,e,i,this.bx,this.vx,s),s),this.addStyler=t=>new tl(this.bx,this.vx,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new tl(t,this.vx,this.kx.map((t=>t))),this.setResultTableBackground=t=>new tl(this.bx,t,this.kx.map((t=>t)))}}class el extends Qa{constructor(){super(...arguments),this.Fx=(t,e,i,s)=>this.Cx(new Ka(t,e,i,this.bx,this.vx,s),s),this.addStyler=t=>new el(this.bx,this.vx,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new el(t,this.vx,this.kx.map((t=>t))),this.setResultTableBackground=t=>new el(this.bx,t,this.kx.map((t=>t)))}}const il=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),sl=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setStrokeStyle(e.chartMarkerPointMarkerStrokeStyle).setSize(u(20,20)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10))),rl=new tl(Dn,Dn,[il]),nl=new tl(Dn,Rn,[il,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Rn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),ol=rl,hl=nl;new el(On,Dn,[sl,t=>t.setResultTableVisible(!1)]);const al=new el(Pn,Dn,[sl,t=>t.setResultTable((t=>t.setOrigin(ws.LeftBottom)))]),ll=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),ul={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},cl=(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(),dl=(t,e)=>{let i=e.geometry;return i=fl(t,e,i),i=gl(t,e,i),i},fl=(t,e,i)=>{if(t===ul.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===ul.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=Xe(Pt(i)),h=[];for(let e=0;e{this.My.includes(t)||(this.My.push(t),this.P.emit("seriesAdded",this,t))},this.Dx=i.Bx();const c=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},d=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},f=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},g=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},y=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()},p=()=>{this.Ix!==e.AutoCursorModes.disabled&&this.ls.Ss()};this.onSeriesBackgroundMouseEnter(c),this.onSeriesBackgroundMouseMove(d),this.onSeriesBackgroundMouseLeave(f),this.onSeriesBackgroundTouchStart(g),this.onSeriesBackgroundTouchMove(y),this.onSeriesBackgroundTouchEnd(p),this.Ox(((t,e)=>{const i=e.onMouseEnter(c),s=e.onMouseMove(d),r=e.onMouseLeave(f),n=e.onTouchStart(g),o=e.onTouchMove(y),h=e.onTouchEnd(p),a=this.Lx(((t,l)=>{l===e&&(e.offMouseEnter(i),e.offMouseMove(s),e.offMouseLeave(r),e.offTouchStart(n),e.offTouchMove(o),e.offTouchEnd(h)),this.Rx(a)}))}))}setAutoCursor(t){return this.Ex&&t(this.Ex),this.ls.Ss(),this}getAutoCursor(){return this.Ex}setAutoCursorMode(t){return this.Ix=t,this.ls.Ss(),this}getAutoCursorMode(){return this.Ix}zx(t){if(t.xthis.uiScale.x.Nt()||t.ythis.uiScale.y.Nt())return;let e,i=Number.MAX_VALUE;for(const s of this.My)if(s.getCursorEnabled()&&s.getVisible()){const r=s.zx(t,!1);if(r){const s=at(r.location,r.scale,this.engine.scale),n=Ne(t,s);Number.isNaN(n)||e&&!(nt.getIsUnderMouse())),r=this.Fy.getIsUnderMouse();this.Ix===e.AutoCursorModes.snapToClosest?(r||void 0!==s)&&(i=t&&this.zx(t)):this.Ix===e.AutoCursorModes.onHover&&void 0!==s&&s.getCursorEnabled()&&(i=t&&s.zx(t,!0))}i?this.Ex.pointAt(i).setVisible(!0):this.Ex.setVisible(!1),this.Ex.Ts().Ae()}Ox(t){return this.P.on("seriesAdded",t)}Nx(t){return this.P.off(t)}Lx(t){return this.P.on("seriesDispose",t)}Rx(t){return this.P.off(t)}dispose(){return this.Dx.G(),this.Ex.dispose(),super.dispose()}}class xl extends Vh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("mapChart bg",0),r,i.ls.Ji.mapChartBackgroundFillStyle,i.ls.Ji.mapChartBackgroundStrokeStyle,i.ls.Ji.mapChartTitleFont,i.ls.Ji.mapChartTitleFillStyle,h),this.Gx=[],this.ct=this.Ug.d2({scaleXYConstructor:_i}),this.ki=!0,this.Wx=this.Ji.mapChartSeparateRegionFillStyle,this.Hx=this.Ji.mapChartSeparateRegionStrokeStyle,this.Ux=e.AutoCursorModes.onHover,this.$x=bl,this.Ze=!0,this.jx=0,this.Yx=!0,this.Xx=new Map,this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.P.on("mapDataReady",t);return this.Zx&&xt.setTimeout((()=>t())),e},this.onViewChange=t=>this.P.on("viewChange",t),this.Kx=(t,e,i,s,r)=>{this.ct.x.q(s).zt([this.Ft.left+this.Qo.left,this.Ft.right+this.Qo.right]),this.ct.y.q(r).zt([this.Ft.bottom+this.Qo.bottom,this.Ft.top+this.Qo.top+Nh.dp(this.ap,this.rp)]),this.qx&&this.Jx(this.Qx,this.ct,this.qx)},this.Ri=(t,i)=>{const s=i;if(!s||!this.Zx)return;const{iRegion:r,region:n}=this.tb(this.Zx,s);this.Ux!==e.AutoCursorModes.disabled&&(this.ib(n,r),Kt(t)),this.Yx&&this.ls.os.vs(n,!0),this.P.emit("mouseEnter",this,t)},this.Ei=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.sb(r,s),this.Yx&&this.ls.os.vs(r,!1),this.P.emit("mouseLeave",this,t),t&&Kt(t)},this.zi=(t,i)=>{const s=i;if(!s||!this.Zx)return;const{iRegion:r,region:n}=this.tb(this.Zx,s);this.Ux!==e.AutoCursorModes.disabled&&(this.ib(n,r),Kt(t)),this.P.emit("mouseMove",this,t)},this.Vi=(t,e)=>this.P.emit("mouseClick",this,t),this.Ni=(t,e)=>this.P.emit("mouseDoubleClick",this,t),this.Gi=(t,e)=>this.P.emit("mouseDown",this,t),this.Wi=(t,e)=>this.P.emit("mouseUp",this,t),this.Hi=(t,e,i)=>{this.P.emit("mouseDragStart",this,t,e)},this.Ui=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,t,e,i,s)},this.$i=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,t,e,i)},this.ji=(t,e)=>{this.P.emit("mouseWheel",this,t)},this.Yi=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.eb=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.ib(r,s),this.Yx&&this.ls.os.vs(r,!0),this.P.emit("touchStart",this,t),Kt(t)},this.Xi=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.eb=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.ib(r,s),this.P.emit("touchMove",this,t),Kt(t)},this.Zi=(t,e)=>{const i=e;if(!i||!this.Zx)return;const{iRegion:s,region:r}=this.tb(this.Zx,i);this.eb=void 0,this.sb(r,s),this.Yx&&this.ls.os.vs(r,!1),this.P.emit("touchEnd",this,t),Kt(t)},this.ff.wn||this.ff.An||this.ls.Mn(3),(null==o?void 0:o.disableAnimations)&&(this.Ze=!1),this.hb=i.Hp("mapChart plotting",0),this.onResize(this.Kx),this.ap.Ch("Map Chart");const a=Lt(o?o.autoCursorBuilder:void 0,al);this.rb=a.Fx(i.Bx(),this.ct,this.ct,this.Ji).setVisible(!1),this.nb=this.ss.xg(),this.ep(n,this.uiScale),this.ob=this.hb.ab(this.ct).setMouseInteractions(this.ki).setMouseEnterEventHandler(((t,e,i)=>this.Ri(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Ei(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Vi(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.Ni(e,i))).setMouseDownEventHandler(((t,e,i)=>this.Gi(e,i))).setMouseUpEventHandler(((t,e,i)=>this.Wi(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.zi(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.Hi(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.Ui(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.$i(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.ji(e,i))).setTouchStartEventHandler(((t,e,i)=>this.Yi(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.Xi(e,i))).setTouchEndEventHandler(((t,e,i)=>this.Zi(e,i))).Me(this.Ji.mapChartFillStyle).ve(this.Ji.mapChartStrokeStyle),this.lb=this.hb.ab(this.ct).setMouseInteractions(this.ki).Me(this.Ji.mapChartOutlierRegionFillStyle).ve(this.Ji.mapChartOutlierRegionStrokeStyle);const l=Lt(o&&o.type,ul.World);this.Qx=l,this.ub(l).then((()=>{this.P.emit("mapDataReady")}))}setFillStyle(t){return this.ob.Me(t),this.ls.Ss(),this}getFillStyle(){return this.ob.Th()}setStrokeStyle(t){return this.ob.ve(t),this.ls.Ss(),this}getStrokeStyle(){return this.ob.Un()}setEffect(t){return this.nb.ys(t),this.ls.Ss(),this}getEffect(){return this.nb.xs()}setOutlierRegionFillStyle(t){return this.lb.Me(t),this.ls.Ss(),this}getOutlierRegionFillStyle(){return this.lb.Th()}setOutlierRegionStrokeStyle(t){return this.lb.ve(t),this.ls.Ss(),this}getOutlierRegionStrokeStyle(){return this.lb.Un()}setSeparateRegionFillStyle(t){return this.Wx="function"==typeof t?t(this.Wx):t,this.Gx.forEach((t=>t.Me(this.Wx))),this.ls.Ss(),this}getSeparateRegionFillStyle(){return this.Wx}setSeparateRegionStrokeStyle(t){return this.Hx="function"==typeof t?t(this.Hx):t,this.Gx.forEach((t=>t.ve(this.Hx))),this.ls.Ss(),this}getSeparateRegionStrokeStyle(){return this.Hx}invalidateRegionValues(t){if(!this.Zx||!this.cb)return this.fb=this.fb||[],this.fb.push(t),this;if("function"==typeof t)for(let e=0;e{t.gb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.gb(e.value)}))}}return this.ls.Ss(),this}setAutoCursor(t){return this.rb&&t(this.rb),this.ls.Ss(),this}getAutoCursor(){return this.rb}setAutoCursorMode(t){return this.Ux=t,this.ls.Ss(),this}getAutoCursorMode(){return this.Ux}setCursorResultTableFormatter(t){return this.$x=t,this.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}setMouseInteractions(t){return this.ki=t,this.ob.setMouseInteractions(t),this}getMouseInteractions(){return this.ki}setHighlight(t){var e;return t=ve(t),this.jx=t,null===(e=this.Zx)||void 0===e||e.regions.forEach((e=>{this.ls.os.vs(e,t)})),this.P.emit("highlight",t),this}getHighlight(){return this.jx}setAnimationHighlight(t){var e;return null===(e=this.Zx)||void 0===e||e.regions.forEach((e=>{this.ls.os.Ms(e,t)})),this}getAnimationHighlight(){var t;return this.ls.os._s(null===(t=this.Zx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.Yx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Yx}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}offMapDataReady(t){return this.P.off(t,"mapDataReady")}offViewChange(t){return this.P.off(t,"viewChange")}async ub(t){const e=await((t,e)=>{let i;if(t===ul.World)i="countries_world.json";else if(t===ul.NorthAmerica)i="countries_northAmerica.json";else if(t===ul.SouthAmerica)i="countries_southAmerica.json";else if(t===ul.Africa)i="countries_africa.json";else if(t===ul.Europe)i="countries_europe.json";else if(t===ul.Asia)i="countries_asia.json";else if(t===ul.USA)i="states_usa.json";else if(t===ul.Canada)i="territoriesProvinces_canada.json";else{if(t!==ul.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw xt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return xt.fetch(s).then((t=>t.json())).catch((t=>{Ee(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.ff.Hs);this.cb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=yl[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.lb.kr().tl(e);if(t===ul.USA){const t=25.8,e=29.7;this.Gx.push(this.hb._e(this.ct).setMouseInteractions(!1).Me(this.Wx).ve(this.Hx).we({x:-126,y:t}).q({x:10,y:e-t}),this.hb._e(this.ct).setMouseInteractions(!1).Me(this.Wx).ve(this.Hx).we({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.ls.os.wr(this.ob,{animationEnabled:this.Ze});for(let i=0;i{o.forEach((e=>e.us(t)))}))}if(this.nb.ds([this.ob]),this.qx=i,this.Jx(t,this.ct,i),this.Zx=e,this.fb){for(const t of this.fb)this.invalidateRegionValues(t);this.fb=void 0}this.ls.Ss()}Jx(t,e,i){const s=pl[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.Z(o.min.x,o.max.x),e.y.Z(o.min.y,o.max.y);const h=this.ct.x.$t(),a=this.ct.y.$t();this.P.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]}})}ib(t,e){this.pb={region:t,iRegion:e},this.ls.Ss()}sb(t,e){this.pb&&t===this.pb.region&&(this.pb=void 0,this.ls.Ss())}tb(t,e){const i=Array.from(this.Xx.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.Ze=!t,this}getAnimationsEnabled(){return this.Ze}getMinimumSize(){}Sd(){return[this]}Ae(t){super.Ae(t),super.sp(),Nh.fp(this.ap,this.rp);const e=p(this.ct.x.Vt(),this.ct.y.Vt(),this.ct.x.Gt(),this.ct.y.Gt());this.hb.kS(e);const i=this.ls.vn()||this.eb;if(this.pb&&i){const t=this.cb&&this.cb[this.pb.iRegion];let e=at(i,this.engine.scale,this.ct);e={x:Ct(e.x,this.ct.x.getInnerStart(),this.ct.x.getInnerEnd()),y:Ct(e.y,this.ct.y.getInnerStart(),this.ct.y.getInnerEnd())};let s=e.x,r=e.y;const n=this.pb.region.transform;this.pb.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.rb.setPosition(e).setVisible(!0).getResultTable().setContent(this.$x(new Ja,this.pb.region,t,s,r,this).vc())}else this.rb.setVisible(!1);return this.rb.Ts().Ae(),this}dispose(){return this.hb.G(),this.rb.dispose(),zh(this.ct),super.dispose()}Y(){return super.Y(),this.ct.Y(),this}X(){return super.X(),this.ct.X(),this}ld(){return de(this.getFillStyle())}attach(t,e){return t.setText(this.getTitle()),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1)),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))),ce(t,this.Ji,{fill:this.getFillStyle()}),this}}const bl=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(vl(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),vl=(t,e)=>{const i=t>0,s=e>0;return`${[ge(Math.abs(0|t),2),"° ",ge(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ge(Math.abs(0|e),2),"° ",ge(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class Ml extends $s{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.mb(i),s,r,{numeric:e.yb({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.yb({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.yb({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Sb=n,this.xb=o,this.bb=h,this.ss=a,this.vb=i,this.Mb=e.yb({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.kh=h.Sr(i).setMouseInteractions(!1).Ih(e.yb({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).Me(e.yb({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Bh=this.ss.xg([this.kh]).ys(s.effectsText)}setTickStrategy(t,e){return super.Mh(t,e)}setStrokeStyle(t){return this.Mb="function"==typeof t?t(this.Mb):t,this.xb.Ss(),this}getStrokeStyle(){return this.Mb}Qh(t,e){return new Al(e,t,this.vb,this.bb,this.bb,this._b(this.Sb,this.vb),this.bb.De(this.vb).setMouseInteractions(!1))}tr(t,e){const i=this.Ab(this.vb,t);this.wb&&!1===this.wb(t)?t.Ve.setVisible(!1):t.Ve.setVisible(!0).we(ri(this.kb(this.vb,t.u),i.padding)).Sa(i.alignment).Ph(i.rotation).da(i.offset.x,i.offset.y),this.Cb(this.vb,t.Tb,t.Fb,t)}setMouseInteractions(t){return this}Ae(){this.Hh({physicalAxisSize:0});const t=this.er(((t,e)=>{const i=e.dh.Jh,s=.5*this.Mb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Ve.Ts().Ht().y/this.vb.Ai().y)+i.labelPadding;return Math.max(t,s)}),0);return this.Ib(this.vb,this.Mb,t),this.Pb(this.vb,this.kh,t),t}}class Al extends qo{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.Tb=n,this.Fb=o,n.setMouseInteractions(!1),this.Qi.push(n,o)}}class wl extends Ml{constructor(t,e,i,s,r,n,o,h,a){super(t,Tl((()=>this.Ag())),e,i,s,r,n,o,h),this.Bm=this.xb.De(this.vb).setMouseInteractions(!1),this.Db=a,this.setScrollStrategy(zs.expansion),this.setTickStrategy(Os.Numeric),this.setTitle("Amplitude")}Ag(){return this.Db()}dr(t,e){return Jo(t,e,this.vb.y)}pr(t,e,i){const s=2*(e-t),r=this.vb.x.mi(s);return{min:t-i*r,max:e+i*r}}kb(t,e){return{x:t.Bb()?e-t.Ob().start:t.Ob().start-e,y:0}}_b(t,e){return t.Dc(e)}Cb(t,e,i,s){const r=s.dh.Jh,n=t.Bb()?s.u-t.Ob().start:t.Ob().start-s.u;It(s.u,t.Ob().start)||It(s.u,t.Ob().end)?e.setVisible(!1):e.setVisible(!0).Nl(0).Be(360).$l(void 0).Ul(0).Gl(n).$l(60).Me(z).ve(r.gridStrokeStyle);const o=.5*this.Mb.getThickness();i.Oe({x:n,y:-o*t.Ai().y}).Be({x:n,y:-(o+r.tickLength)*t.Ai().y}).Pe(r.tickStyle)}Ab(t,e){const i=e.dh.Jh;return{alignment:{x:0,y:1},padding:{x:0,y:t.Ai().y*-(.5*this.Mb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}Ib(t,e,i){const s=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;this.Bm.Oe({x:0,y:0}).Be({x:s,y:0}).Pe(e)}Pb(t,e,i){const s=t.Bb()?(t.Ob().start+t.Ob().end)/2-t.Ob().start:t.Ob().start-(t.Ob().start+t.Ob().end)/2;e.Sa({x:0,y:1}).we({x:s,y:-i*t.Ai().y})}}const Tl=t=>({...Sa(t,(t=>t.getAmplitudeMin()),(t=>t.getAmplitudeMax()),(t=>{})),mb:t=>({getInnerStart:()=>t.Ob().start,getInnerEnd:()=>t.Ob().end,Z:(e,i)=>t.Lb(e,i),rt:(e,i,s,r,n)=>t.y.rt(e,i,s,r,n)}),yb:t=>t.amplitude});class El extends Ml{constructor(t,e,i,s,r,n,o,h){super(t,Cl,e,i,s,r,n,o,h),this.Rb=90,this.Eb=12,this.zb=Il,this.Bm=this.xb.Dc(this.vb).setMouseInteractions(!1),this.wb=t=>{let e=180*(t.u-this.vb.Vb())/Math.PI%360;for(;e<0;)e+=360;for(;e>360;)e-=360;if(e>=0&&e<=20||e>=340&&e<=360)return!1},this.je=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Rb)}setTickStyle(t){return this.Nb="function"==typeof t?t(this.Nb):t,this.Gb(),this.xb.Ss(),this}getTickStyle(){return this.Nb}setTickFormattingFunction(t){return this.zb=t,this.Gb(),this.xb.Ss(),this}getTickFormattingFunction(){return this.zb}setClockwise(t){this.vb.Wb(t);const e=this.Rb*Math.PI/180;return t?this.vb.Hb(e+Math.PI/2):this.vb.Hb(e-Math.PI/2),this.xb.Ss(),this}getClockwise(){return!this.vb.Ub()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Rb=t;const e=t*Math.PI/180;return this.getClockwise()?this.vb.Hb(e+Math.PI/2):this.vb.Hb(e-Math.PI/2),this.xb.Ss(),this}getNorth(){return 180*this.vb.Vb()/Math.PI}setDivision(t){return this.Eb=t,this.Gb(),this.xb.Ss(),this}getDivision(){return this.Eb}Ag(){return[]}dr(t,e){return e}pr(t,e,i){return{min:t,max:e}}kb(t,e){const i=t.Ub()?1:-1,s=t.Vb(),r=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}_b(t,e){return t.De(e)}Cb(t,e,i,s){const r=this.Nb,n=t.Ub()?1:-1,o=t.Vb(),h=(s.u-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end,c={x:a*u,y:l*u};e.Oe({x:0,y:0}).Be(c);const d={x:c.x+a*r.tickLength*t.Ai().x,y:c.y+l*r.tickLength*t.Ai().y};i.Oe(c).Be(d),e.Pe(r.gridStrokeStyle),i.Pe(r.tickStyle)}Ab(t,e){const i=this.Nb,s=t.Ub()?1:-1,r=t.Vb();let n,o=(e.u-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.Ai().x,l=Math.sin(o)*h*t.Ai().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}Ib(t,e,i){const s=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;this.Bm.Nl(0).Be(360).Ul(0).Gl(s+.5*e.getThickness()*t.Ai().x).$l(360).Me(z).ve(e)}Pb(t,e,i){const s=t.Vb(),r=this.Ab(t,{u:0+s}),n=t.Bb()?t.Ob().end-t.Ob().start:t.Ob().start-t.Ob().end;e.Sa(r.alignment).Ph(r.rotation).da(r.offset.x,r.offset.y).we(ri({x:n,y:0},r.padding))}Gb(){this.Eh({Ne:[],Ge:[{Ve:"Radial ticks",Fg:0,Jh:this.Nb,Kh:this.zb,Mr:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Eb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},fh:{ir:()=>{},gh:()=>!1},_r:void 0}],Ee:Il,zh:void 0,Vh:void 0})}}const Il=(t,e,i)=>(180*t/Math.PI).toFixed(0),Cl={nr:()=>{},ar:()=>{},ur:()=>{},mb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,Z:(t,e)=>{},rt:(e,i,s,r,n)=>t.x.rt(e,i,s,r,n)}),yb:t=>t.radial},Pl=t=>!!(t&&"object"==typeof t&&"axisAmplitude"in t&&"axisRadial"in t),kl=t=>!!(t&&"object"==typeof t&&"angle"in t&&"number"==typeof t.angle&&"amplitude"in t&&"number"==typeof t.amplitude);class Fl extends Gi{constructor(t,e,i,s,r,n){super(e,i,r,n),this.bs="Sector",this.$b=0,this.jb=1*Math.PI/2,this.Yb=void 0,this.Xb=void 0,this.As=t,this.vb=s,this.kp=this.As.Dc(this.vb).us(this.getHighlight()),this.cs(this.kp),this.Se=r.polarSectorFillStyle,this.xe=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.$b=Ct(t,0,360),this.As.Ss(),this}getAngleStart(){return this.$b}setAngleEnd(t){return this.jb=Ct(t,0,360),this.As.Ss(),this}getAngleEnd(){return this.jb}setAmplitudeStart(t){return this.Yb=t,this.As.Ss(),this}getAmplitudeStart(){return this.Yb}setAmplitudeEnd(t){return this.Xb=t,this.As.Ss(),this}getAmplitudeEnd(){return this.Xb}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.As.Ss(),this}getStrokeStyle(){return this.xe}Ae(){const t=this.vb.Ob(),e=180*this.vb.Vb()/Math.PI,i=void 0!==this.Yb?Ct(this.Yb,t.start,t.end):t.start,s=void 0!==this.Xb?Ct(this.Xb,t.start,t.end):t.end,r=this.vb.Bb()?i-t.start:t.start-i,n=this.vb.Bb()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.vb.Ub()?1:-1,l=Math.abs(this.jb-this.$b);this.kp.Nl((this.$b-e)*a).Be((this.jb-e)*a).Ul(100*o/h).Gl(h).Me(this.Se).ve(this.xe).$l(Math.ceil(l/2))}ke(t,e){t.us(e),this.As.Ss()}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}}class Bl extends Gi{constructor(){super(...arguments),this.Km=!0,this.Zb=!0}setAutoScrollingEnabled(t){return this.Km=t,this.Ki.ls.Ss(),this}getAutoScrollingEnabled(){return this.Km}ey(){}Ae(){}om(){}setCursorEnabled(t){return this.Zb=t,this}getCursorEnabled(){return this.Zb}}class _l extends Bl{constructor(t,e,i,s,r,n){super(e,i,r,n),this.As=t,this.Ki=e,this.scale=s}getAmplitudeMin(){return this.Kb?this.Kb.min:void 0}getAmplitudeMax(){return this.Kb?this.Kb.max:void 0}}const Ll=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),Dl=(t,e)=>{const i=[],s=e.Ob().start,r=e.Ob().end,n=e.Bb(),o=e.Ub()?1:-1,h=e.Vb(),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=Ct(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},zl=t=>{const e={min:Pe,max:ke};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},Ol=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),Rl=(t,e)=>{let i=gi(t);for(e.Ub()||(i*=-1),i+=180*e.Vb()/Math.PI;i<0;)i+=360;i%=360;const s=ii(t),r=e.Ob(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:Mo(r.start,r.end,s/n)}};class Vl extends _l{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n),this.bs="Heatmap Series",this.qb=!0,this.$x=Nl,this.ld=()=>de(this.Se);const h=this.Ki.getSeries().length;this.Se=ye(this.Ji.polarHeatmapSeriesFillStyle||this.Ji.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._n=u,this.Jb=t.Qb(s,[],u).Me(this.Se).us(this.getHighlight()),this.cs(this.Jb);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.Kb={min:c,max:d},this.setHighlightOnHover(!1)}invalidateIntensityValues(t){if(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._n.dataOrder?t[0].length:t.length,annuli:"annuli"===this._n.dataOrder?t.length:t[0].length},i="annuli"===this._n.dataOrder?this._n.annuli:this._n.sectors,s="annuli"===this._n.dataOrder?this._n.sectors:this._n.annuli;if(e.x>i||e.y>s){if(!0===this.Ki.ff.Pn){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.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.Ki.ff.Pn){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.`;xt.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.Jb.dS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.As.Ss(),this}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Jb.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}clear(){return this.Jb.Ha(),this.As.Ss(),this}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.Jb.uS(t),this.As.Ss(),this}getIntensityInterpolation(){return this.Jb.cS()}Xm(){return this.Km&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){const i=at(t,this.Ki.engine.scale,this.scale),s=Rl(i,this.scale),r=this.qb?this.Jb.tv(s):this.Jb.zx(s);if(r)return ll(Dl([r],this.scale)[0],this.scale,this.$x(new Ja,this,{angleDeg:r.angle,amplitude:r.amplitude,intensity:r.cellValue,iAnnulus:r.iAnnulus,iSector:r.iSector},this.Ki.getAmplitudeAxis().formatValue).vc(),this,this.Se)}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}Ae(){}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}}const Nl=(t,e,i,s)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i.angleDeg).toString()).addRow("Amplitude","",s(i.amplitude)).addRow("Intensity","",i.intensity.toFixed(1));class Gl extends _l{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.bs="Line Series",this.sv=[],this.ev=!1,this.hv=!1,this.$x=Ll,this.jl=ye(this.Ji.polarLineSeriesStrokeStyle,n),this.rv=t.tm(s,void 0,[Kh.UserSeries]).Pe(this.jl).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.rv)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){return this.sv=Ol(t),this.ev=!0,this.Kb=zl(this.sv),this.As.Ss(),this}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;return this.rv.Pe(e),this.As.Ss(),this}getStrokeStyle(){return this.jl}setConnectDataAutomaticallyEnabled(t){return this.hv=t,this.As.Ss(),this}getConnectDataAutomaticallyEnabled(){return this.hv}Xm(){return this.Km&&this.sv.length>0&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){return this.nv(t,this.rv)}solveNearestFromScreen(t){return this.nv(Yo(t,this.Ki.ls),this.rv)}nv(t,e){const i=e.ov(t);if(!i)return;const{angle:s,amplitude:r}=Rl(i,this.scale);return ll(i,this.scale,this.$x(new Ja,this,s,r,this.Ki.getAmplitudeAxis().formatValue).vc(),this,this.jl.getFillStyle())}Ae(){if(this.ev||this.scale.av()){const t=Dl(this.sv,this.scale),e=Xe(t);this.hv?(t.push({...t[0]}),this.rv.bl(!0)):this.rv.bl(!1),this.rv.Ha().Wa(t).ko(e),this.ev=!1,this.rv.Ts()}}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{stroke:this.jl}),this}}class Hl extends _l{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.bs="Point Line Series",this.sv=[],this.ev=!1,this.hv=!1,this.lv=3,this.Ko=0,this.uv=e.PointShape.Circle,this.$x=Ll,this.Se=ye(this.Ji.polarPointLineSeriesFillStyle,o),this.jl=ye(this.Ji.polarPointLineSeriesStrokeStyle,o),this.rv=t.tm(r,void 0,[Kh.UserSeries]).Pe(this.jl).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.rv),this.cv=t.vy(r).Me(this.Se).za(this.uv).q(this.lv).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.cv)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){return this.sv=Ol(t),this.ev=!0,this.Kb=zl(this.sv),this.As.Ss(),this}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;return this.rv.Pe(e),this.As.Ss(),this}getStrokeStyle(){return this.jl}setPointFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;return this.cv.Me(e),this.As.Ss(),this}getPointFillStyle(){return this.Se}setPointSize(t){return this.lv=t,this.cv.q(t),this.As.Ss(),this}getPointSize(){return this.lv}setPointShape(t){return this.uv=t,this.cv.za(this.uv),this}getPointShape(){return this.uv}setPointRotation(t){return this.Ko=t,this.cv.Ph(t),this.As.Ss(),this}getPointRotation(){return this.Ko}setConnectDataAutomaticallyEnabled(t){return this.hv=t,this.As.Ss(),this}getConnectDataAutomaticallyEnabled(){return this.hv}Xm(){return this.Km&&this.sv.length>0&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){return this.nv(t,this.rv)}solveNearestFromScreen(t){return this.nv(Yo(t,this.Ki.ls),this.rv)}nv(t,e){const i=e instanceof qr?e.zx(t):e.ov(t);if(!i)return;const{angle:s,amplitude:r}=Rl(i,this.scale);return ll(i,this.scale,this.$x(new Ja,this,s,r,this.Ki.getAmplitudeAxis().formatValue).vc(),this,"color"in i&&H(this.Se)?new V({color:i.color}):this.Se)}Ae(){if(this.ev||this.scale.av()){const t=Dl(this.sv,this.scale),e=Xe(t);this.hv?(t.push({...t[0]}),this.rv.bl(!0)):this.rv.bl(!1),this.rv.Ha().Wa(t).ko(e),this.cv.Ha().Wa(t).ko(e),this.ev=!1,this.rv.Ts(),this.cv.Ts()}}}class Ul extends _l{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.bs="Point Series",this.sv=[],this.ev=!1,this.lv=3,this.Ko=0,this.uv=e.PointShape.Circle,this.$x=Ll,this.Se=ye(this.Ji.polarPointSeriesFillStyle,o),this.cv=t.vy(r).Me(this.Se).za(this.uv).q(this.lv).us(this.getHighlight()).La(Cr.Nearest),this.cs(this.cv)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){return this.sv=Ol(t),this.ev=!0,this.Kb=zl(this.sv),this.As.Ss(),this}setPointFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;return this.cv.Me(e),this.As.Ss(),this}getPointFillStyle(){return this.Se}setPointSize(t){return this.lv=t,this.cv.q(t),this.As.Ss(),this}getPointSize(){return this.lv}setPointShape(t){return this.uv=t,this.cv.za(this.uv),this}getPointShape(){return this.uv}setPointRotation(t){return this.Ko=t,this.cv.Ph(t),this.As.Ss(),this}getPointRotation(){return this.Ko}Xm(){return this.Km&&this.sv.length>0&&this.getVisible()}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){const i=this.cv.zx(t);if(!i)return;const{angle:s,amplitude:r}=Rl(i,this.scale);return ll(i,this.scale,this.$x(new Ja,this,s,r,this.Ki.getAmplitudeAxis().formatValue).vc(),this,"color"in i&&H(this.Se)?new V({color:i.color}):this.Se)}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}Ae(){if(this.ev||this.scale.av()){const t=Dl(this.sv,this.scale),e=Xe(t);this.cv.Ha().Wa(t).ko(e),this.ev=!1,this.cv.Ts()}}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}}class Wl{constructor(t,e,i,s){this.P=new r.Eventer,this.dv=!1,this.Ki=t,this.fv=e,this.My=i,this.Aa=s}setGeometry(t){return this.gv=t,this.dv=!0,this.Ki.ls.Ss(),this}getGeometry(){return this.gv}setMouseInteractions(t){return this.Aa.setMouseInteractions(t),this}dispose(){return this.Aa.dispose(),this.fv(this),this.P.emit("dispose",this),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Aa.getVisible()!==t;return this.Aa.setVisible(t),e&&this.P.emit("visibleStateChanged",this,t),this.Ki.ls.Ss(),this}getVisible(){return this.Aa.getVisible()}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Xl=(t,e,i)=>{const s=e.ct,r=i.ct;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.rg&&(n=1-n),1===e.rg&&(o=1-o),u(o,n)};class Yl extends Ka{constructor(t,e,i,s,r,n,o,h,a){super(t,e,Di(i.ct,s.ct),r,n,a),this.pv=!1,this.mv=!1,this.yv=!0,this.Sv=!0,this.xv=!1,this.bv=!1,this.setGridStrokeYStyle=t=>(this.vv.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.vv.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Mv=o,this._v=h,this.Av=this.axisX.Bg(!1,this.Mv).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.vv=this.axisY.Bg(!1,this._v).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Av.dispose(),this.vv.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(at(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Av.setValue(t.x),this.vv.setValue(t.y);const e=Xl(u(this.Av.getValue(),this.vv.getValue()),this.axisX,this.axisY);return this.Av.setGridStrokeLength(this.xv?e.x:1),this.vv.setGridStrokeLength(this.bv?e.y:1),this}Ae(){this.Av.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.pv),this.vv.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.mv);const t=Xl(u(this.Av.getValue(),this.vv.getValue()),this.axisX,this.axisY);return this.Av.setGridStrokeLength(this.xv?t.x:1),this.vv.setGridStrokeLength(this.bv?t.y:1),super.Ae()}setGridStrokeXCut(t){return this.xv=t,this.As.Ss(),this}getGridStrokeXCut(){return this.xv}setGridStrokeYCut(t){return this.bv=t,this.As.Ss(),this}getGridStrokeYCut(){return this.bv}setGridStrokeXStyle(t){return this.Av.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Av.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.pv=t,this.As.Ss(),this}getTickMarkerXVisible(){return this.pv}setTickMarkerYVisible(t){return this.mv=t,this.As.Ss(),this}getTickMarkerYVisible(){return this.mv}setTickMarkerX(t){return this.Av.setMarker(t),this}setTickMarkerY(t){return this.vv.setMarker(t),this}getTickMarkerX(){return this.Av.getMarker()}getTickMarkerY(){return this.vv.getMarker()}}class jl extends Za{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.xv=!1,this.bv=!1,this.wv=!1,this.kv=!1,this.Cv=new Map,this.Tv=new Map,this.pv=!0,this.mv=!0,this.bx=s,this.vx=r,this.Mv=n,this._v=o,this.Fv=h.cursorGridStrokeStyleX,this.Iv=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.Cv.forEach((t=>t.dispose())),this.Tv.forEach((t=>t.dispose())),this.Pv=void 0,this.Dv=void 0,this}Ae(){return this.Pv&&this.Pv.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.pv),this.Dv&&this.Dv.setVisible(this.Fi&&this.xx).setMarkerVisible(this.Fi&&this.xx&&this.mv),super.Ae()}pointAt(t){const{location:e}=t,{series:i}=t,{axisX:s}=i,{axisY:r}=i,n=this.rh(s,!0),o=this.rh(r,!1);n!==this.Pv&&this.Pv&&this.Pv.setVisible(!1),o!==this.Dv&&this.Dv&&this.Dv.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=Xl(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.xv?h.x:1),o.setGridStrokeLength(this.bv?h.y:1),this.Pv=n,this.Dv=o,super.pointAt(t)}wx(t){if(super.wx(t),t){const e=e=>e.setTextFillStyle(t);this.Pv&&this.wv&&this.Pv.setMarker(e),this.Dv&&this.kv&&this.Dv.setMarker(e)}}rh(t,e){let i=(e?this.Cv:this.Tv).get(t);return i||(e?(i=t.Bg(!1,this.Mv),this.Cv.set(t,i)):(i=t.Bg(!1,this._v),this.Tv.set(t,i)),this.qh(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}qh(t,e){const i=e?this.Fv:this.Iv;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.pv:this.mv)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.xv=t,this.As.Ss(),this}getGridStrokeXCut(){return this.xv}setGridStrokeYCut(t){return this.bv=t,this.As.Ss(),this}getGridStrokeYCut(){return this.bv}setGridStrokeXStyle(t){return this.Fv=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.Cv.forEach((t=>t.setGridStrokeStyle(this.Fv))),this}getGridStrokeXStyle(){return this.Fv}setGridStrokeYStyle(t){return this.Iv=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.Tv.forEach((t=>t.setGridStrokeStyle(this.Iv))),this}getGridStrokeYStyle(){return this.Iv}setTickMarkerXVisible(t){return this.pv=t,this.As.Ss(),this}getTickMarkerXVisible(){return this.pv}setTickMarkerYVisible(t){return this.mv=t,this.As.Ss(),this}getTickMarkerYVisible(){return this.mv}setTickMarkerX(t){return this.Cv.forEach((e=>e.setMarker(t))),this.Mv=this.Mv.addStyler(t),this.As.Ss(),this}setTickMarkerY(t){return this.Tv.forEach((e=>e.setMarker(t))),this._v=this._v.addStyler(t),this.As.Ss(),this}setTickMarkerXAutoTextStyle(t){return this.wv=t,this.As.Ss(),this}getTickMarkerXAutoTextStyle(){return this.wv}setTickMarkerYAutoTextStyle(t){return this.kv=t,this.As.Ss(),this}getTickMarkerYAutoTextStyle(){return this.kv}}class Jl extends Qa{constructor(t,e,i,s,r){super(t,e,r),this.bx=t,this.vx=e,this.Mv=i,this._v=s,this.kx=r}}class $l extends Jl{constructor(){super(...arguments),this.Tx=(t,e,i,s)=>this.Cx(new jl(t,e,i,this.bx,this.vx,this.Mv,this._v,s),s),this.addStyler=t=>new $l(this.bx,this.vx,this.Mv,this._v,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new $l(t,this.vx,this.Mv,this._v,this.kx.map((t=>t))),this.setResultTableBackground=t=>new $l(this.bx,t,this.Mv,this._v,this.kx.map((t=>t)))}}class ql extends Jl{constructor(){super(...arguments),this.Fx=(t,e,i,s,r)=>this.Cx(new Yl(t,e,i,s,this.bx,this.vx,this.Mv,this._v,r),r),this.addStyler=t=>new ql(this.bx,this.vx,this.Mv,this._v,this.kx.map((t=>t)).concat(t)),this.setPointMarker=t=>new ql(t,this.vx,this.Mv,this._v,this.kx.map((t=>t))),this.setResultTableBackground=t=>new ql(this.bx,t,this.Mv,this._v,this.kx.map((t=>t)))}}const Zl=new $l(Dn,Dn,bo.PointableTextBox,bo.PointableTextBox,[(t,e)=>{il(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Kl=new ql(On,Dn,bo.PointableTextBox,bo.PointableTextBox,[(t,e)=>{sl(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),mn(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ql=(t,i,s)=>{switch(t){case e.UIVisibilityModes.always:return!0;case e.UIVisibilityModes.never:return!1;case e.UIVisibilityModes.whenDragged:return s;case e.UIVisibilityModes.whenHovered:return i&&!s;case e.UIVisibilityModes.whenHoveredOrDragged:return s||i;case e.UIVisibilityModes.whenNotDragged:return!s;default:return!1}},tu=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class eu{constructor(t,i,s,n,o,h){this.Bv=e.UIVisibilityModes.always,this.Ov=e.UIVisibilityModes.always,this.po=!0,this.Ti=!1,this.Lv=!1,this.Rv=!1,this.jo=u(0,0),this.Yu=e.UIDraggingModes.draggable,this.Xu=void 0,this.P=new r.Eventer,this.Fi=!0,this.Ev=(t,i,s)=>{this.Lv=!0,this.As.Ss();const r=this.Yu===e.UIDraggingModes.notDraggable?this.Yu:s||this.Yu;this.Xu=this.As.ls.Tr(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.zv=()=>{this.Lv=!1,this.As.Ss(),this.As.ls.Fr(this.Xu)},this.Vv=(t,e)=>{this.Rv=!0,Kt(e),this.As.Ss()},this.Nv=(t,i)=>{if(this.Yu!==e.UIDraggingModes.notDraggable){const s=i||this.Yu,r=at(this.As.ls.Ce(t.x,t.y),this.As.ls.ct,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?tu(r.x,this.scale.x):this.jo.x,s!==e.UIDraggingModes.onlyHorizontal?tu(r.y,this.scale.y):this.jo.y);return this.setPosition(n),!0}return!1},this.Gv=(t,e)=>{this.Rv=!1,Kt(e),this.As.Ss()},this.onDispose=t=>this.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.As=t,this.renderingScale=i,this.scale=s,this.rb=n,this.Wv=o,this.Ji=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.Ev(t,e))),a.onMouseLeave(this.zv),a.onMouseDragStart(this.Vv),a.onMouseDrag(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Kt(e))),a.onMouseDragStop(this.Gv),a.onTouchStart(this.Vv),a.onTouchMove(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Kt(e))),a.onTouchEnd(this.Gv),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.jo)}setPosition(t){return this.jo=t,this.rb.setPosition(t),this.P.emit("positionChange",this,this.jo),this}getPosition(){return this.jo}onPositionChange(t){return this.P.on("positionChange",t)}offPositionChange(t){return this.P.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Bv=t,this.As.Ss(),this}getPointMarkerVisibility(){return this.Bv}setResultTableVisibility(t){return this.Ov=t,this.As.Ss(),this}getResultTableVisibility(){return this.Ov}setMouseInteractions(t){return this.po=t,this.rb.getPointMarker().setMouseInteractions(t),this.rb.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.po}setAutoFitStrategy(t){return this.rb.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.rb.getAutoFitStrategy()}isAttached(){return!0}Ae(){const t=this.isAttached();return Ql(this.Bv,this.Lv,this.Rv)?this.rb.setPointMarkerVisible(!0):this.rb.setPointMarkerVisible(!1),t&&Ql(this.Ov,this.Lv,this.Rv)?this.rb.setResultTableVisible(!0):this.rb.setResultTableVisible(!1),this.rb.Ae(),this}Ts(){return this.rb.Ts(),this}pointAt(t){return this.rb.pointAt(t),this}dispose(){return this.Ti||(this.Ti=!0,this.Wv(this),this.rb.dispose(),this.P.emit("dispose")),this}setVisible(t){const e=this.Fi!==t;return this.Fi=t,this.rb.setVisible(t),e&&this.P.emit("visibleStateChanged",this,this.Fi),this}getVisible(){return this.Fi}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setPointMarker(t){return this.rb.setPointMarker(t),this}getPointMarker(){return this.rb.getPointMarker()}setResultTable(t){return this.rb.setResultTable(t),this}getResultTable(){return this.rb.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Yu=t,this.As.Ss(),this}getDraggingMode(){return this.Yu}}class iu extends eu{constructor(t,i,s,r,n,o,h){super(t,i,Di(s.ct,r.ct),n.Fx(t,i,s,r,h),o,h),this.Hv=e.UIVisibilityModes.always,this.Uv=e.UIVisibilityModes.always,this.$v=e.UIVisibilityModes.always,this.jv=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.rb.getGridStrokeXStyle(),this.gridStrokeStyleY=this.rb.getGridStrokeYStyle(),this.As=t,this.axisX=s,this.axisY=r,this.Wv=o;const a=this.rb.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.Ev(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.zv),a.onMouseDragStart(this.Vv),a.onMouseDrag(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Kt(i))),a.onMouseDragStop(this.Gv),a.onTouchStart(this.Vv),a.onTouchMove(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Kt(i)));const l=this.rb.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.Ev(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.zv),l.onMouseDragStart(this.Vv),l.onMouseDrag(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Kt(i))),l.onMouseDragStop(this.Gv),l.onTouchStart(this.Vv),l.onTouchMove(((t,i)=>this.Nv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Kt(i)))}Ae(){const t=this.isAttached();return this.Fi&&t&&Ql(this.$v,this.Lv,this.Rv)?this.rb.setTickMarkerXVisible(!0):this.rb.setTickMarkerXVisible(!1),this.Fi&&t&&Ql(this.jv,this.Lv,this.Rv)?this.rb.setTickMarkerYVisible(!0):this.rb.setTickMarkerYVisible(!1),this.rb.setGridStrokeXStyle(this.Fi&&t&&Ql(this.Hv,this.Lv,this.Rv)?this.gridStrokeStyleX:st),this.rb.setGridStrokeYStyle(this.Fi&&t&&Ql(this.Uv,this.Lv,this.Rv)?this.gridStrokeStyleY:st),super.Ae()}setGridStrokeXVisibility(t){return this.Hv=t,this.As.Ss(),this}getGridStrokeXVisibility(){return this.Hv}setGridStrokeYVisibility(t){return this.Uv=t,this.As.Ss(),this}getGridStrokeYVisibility(){return this.Uv}setTickMarkerXVisibility(t){return this.$v=t,this.As.Ss(),this}getTickMarkerXVisibility(){return this.$v}setTickMarkerYVisibility(t){return this.jv=t,this.As.Ss(),this}getTickMarkerYVisibility(){return this.jv}setGridStrokeXCut(t){return this.rb.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.rb.getGridStrokeXCut()}setGridStrokeYCut(t){return this.rb.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.rb.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.rb.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.rb.getGridStrokeYStyle()}setTickMarkerX(t){return this.rb.setTickMarkerX(t),this}getTickMarkerX(){return this.rb.getTickMarkerX()}setTickMarkerY(t){return this.rb.setTickMarkerY(t),this}getTickMarkerY(){return this.rb.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.rb.getTickMarkerX().setMouseInteractions(t),this.rb.getTickMarkerY().setMouseInteractions(t),this}}class su extends iu{}class ru extends su{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.Yv=!1,this.As=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.Yv=!1,this.As.Ss(),this}Ts(){if(!this.Yv){const t=this.owningSeries.solveNearestFromScreen(at(this.jo,this.scale,this.As.ls.ct));t?(this.jo=at(t.location,this.owningSeries.scale,this.scale),this.rb.pointAt(t),this.Yv=!0):this.rb.setPosition(this.jo)}return super.Ts()}isAttached(){return this.Yv}}class nu extends Bl{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Xv=[],this.addMarker=(t=Kl)=>{const e=new ru(this.Zv(),this.Ki.uiScale,this,t,this.removeMarker,this.Ji);return this.Xv.push(e),e},this.removeMarker=t=>{const e=this.Xv.indexOf(t);-1!==e&&this.Xv.splice(e,1)},this.Qi=new Map,this.chart=t,this.As=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.Zv=h,this.scale=Di(s.ct,r.ct),this.Kv=t.qv,t.qv+=1,this.Jv(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.Qv),this.onMouseLeave(this.chart.tM),this.onMouseWheel(this.chart.Jm),this.onMouseDragStart(this.chart.iM),this.onMouseDrag(this.chart.Qm),this.onMouseDragStop(this.chart.sM),this.onTouchStart(this.chart.ty.onTouchStart),this.onTouchMove(this.chart.ty.onTouchMove),this.onTouchEnd(this.chart.ty.onTouchEnd)}attacheAxis(){this.eM=this.axisXAttachHandler(this),this.hM=this.axisYAttachHandler(this)}Ae(){super.Ae();for(let t=0;t{e.Bo(this.Kv)})),this.Ki.ls.Ss(),this}dispose(){return super.dispose(),this.Xv.slice().forEach((t=>t.dispose())),this.eM(this),this.hM(this),this}rM(){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;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class uu extends nu{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.nM=[],this.Jl=[],this.oM=0,this.Ii=!1,this.Ci=e.HighlightModes.onHover,this.$x=lu,this.aM=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.oM=void 0!==e&&e>0?e:0,this.As.Ss(),this}add(t){if(Array.isArray(t)?this.lM(t):this.lM([t]),this.Jl.length>0){const t=this.Jl[this.Jl.length-1];this.uM={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.uM?this.uM.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.Ua()+e.$a()),this.Jl.length)}clear(){this.cM=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.aM.getXMax(this.nM,this.cM)||0}getXMin(){return this.aM.getXMin(this.nM,this.cM)||0}getYMax(){return this.aM.getYMax(this.nM,this.cM)||0}getYMin(){return this.aM.getYMin(this.nM,this.cM)||0}ur(){const t=u(0,0);for(const e of this.nM)t.x=Math.max(t.x,e.sl()),t.y=Math.max(t.y,e.el());return t}dM(t,e,i,s){this.aM.dM(t,e,i,s,this.scale,(t=>{}))}ey(){super.ey();const t=this.nM.length;this.fM&&this.dM(this.nM,this.getPointAmount(),this.fM,this.oM),t!==this.nM.length&&this.rM()}Ae(){super.Ae();const t=this.getBoundaries();this.Jl.length>0&&(this.gM(this.Jl),this.Jl=[]);for(const e of this.nM)e.ko(t);return super.Ae()}om(){super.om(),this.cM=void 0,this.Jl.length=0}lM(t){0!==t.length&&(this.cM?this.cM=je(this.cM,Xe(t)):this.cM=Xe(t),this.P.emit("dataAdd",this,t,this.cM),this.Jl=he(this.Jl,t,{canReturnB:!1}),this.As.Ss())}pM(){return hu(this.nM)}mM(t){return this.P.on("dataAdd",t)}yM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}xM(t){return this.P.off(t)}}const cu=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.vM.indexOf(t);e>=0&&this.vM.splice(e,1);const i=this.bM.findIndex((e=>e===t.Aa));i>=0&&this.bM.splice(i,1),this.As.Ss()},this.Se=ye(this.Ji.polarPolygonSeriesFillStyle,n),this.xe=ye(this.Ji.polarPolygonSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}addPolygon(){const t=new Wl(this.Ki,this.MM,this,this._M());return this.vM.push(t),t}setFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;for(const t of this.bM)t.Me(e);return this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){this.xe="function"==typeof t?t(this.xe):t;const e=this.xe;for(const t of this.bM)t.ve(e);return this.As.Ss(),this}getStrokeStyle(){return this.xe}Xm(){return this.Km&&void 0!==this.vM.find((t=>void 0!==t.AM))&&this.getVisible()}Ae(){this.vM.forEach((t=>{(t.dv||this.scale.av())&&t.wM&&(t.Aa.tl(Dl(t.wM,this.scale)),t.dv=!1,t.Aa.Ts())}))}ey(){super.ey();const t=y(Pe,ke);this.vM.forEach((e=>{if(!e.gv)return;const i=!e.dv&&e.wM?e.wM:Ol(e.gv);e.wM=i;const s=!e.dv&&e.AM?e.AM:zl(i);e.AM=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Kb=t}ke(t,e){t.us(e),this.As.Ss()}zx(t,e){const i=cu(t,this.bM,((t,e)=>{const i=t.zx(e);if(i)return at(i,this.scale,t.ls.ct)}),Ne);if(!i)return;const s=at(i[0],i[1].ls.ct,this.scale),r=this.kM(i[1]);if(!r)return;const{angle:n,amplitude:o}=Rl(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.$x(new Ja,this,n,o,this.Ki.getAmplitudeAxis().formatValue).vc(),series:this,fillStyle:this.Se,polarPolygon:r}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}_M(){const t=this.As.Cc(this.scale,sn.Simple).Me(this.Se).ve(this.xe).us(this.getHighlight());return this.bM.push(t),this.cs(t),t}kM(t){return this.vM.find((e=>e.Aa===t))}}class fu extends _l{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.bs="Area Series",this.sv=[],this.ev=!1,this.hv=!1,this.CM=!1,this.$x=Ll,this.Se=ye(this.Ji.polarAreaSeriesFillStyle,n),this.xe=ye(this.Ji.polarAreaSeriesStrokeStyle,n)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setData(t){const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se,stroke:this.xe}),this}}class gu extends fu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.TM=this.As.Cc(this.scale,sn.Simple).us(this.getHighlight()),this.cs(this.TM)}Ae(){if(this.ev||this.scale.av()){const t=this.sv,e=!0===this.hv?Dl(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(It(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;!It(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.FM.start}Wb(t){this.IM=t,this.LM=!0}Ub(){return!1===this.IM}Hb(t){this.PM=t,this.LM=!0}Vb(){return this.PM}Qt(){return this.si}ni(){return!1}nt(t,e,i,s){return this.x=new ki(t.x,e.x,i.x,s?s.x:void 0),this.y=new ki(t.y,e.y,i.y,s?s.y:void 0),this}ti(){return this.Xt}av(){return this.OM}zM(){return this.LM}Ai(){return this.RM}Y(){return this.o=!1,this.si=!1,this.OM=!1,this.LM=!1,this}X(){return this.o=!0,this.si=!0,this.OM=!0,this.LM=!0,this}q(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.EM(),this}Si(t){return this.DM=t,this.EM(),this}xi(t){return this.BM=t,this.EM(),this}Wt(){return u(this.DM[0]+this.DM[1],this.BM[0]+this.BM[1])}Ht(){return this.j}EM(){const t=this.FM,e=u(this.x.Ut(this.j.x),this.y.Ut(this.j.y)),i=this.DM[0]+this.DM[1],s=this.BM[0]+this.BM[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.DM[0]+Math.max((r-2*o)/2,0),this.DM[1]+Math.max((r-2*o)/2,0)],a=[this.BM[0]+Math.max((n-2*o)/2,0),this.BM[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.j.x).zt(h).Z(-l,l),this.y.q(this.j.y).zt(a).Z(-l,l),this.RM={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Xt={x:this.x.ti(),y:this.y.ti()},this.X()}Jt(t,e){const i=this.Ai();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}wi(t,e,i,s){const r=this.Ai(),n=ei(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 pu extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("polarChart bg",0),r,i.ls.Ji.polarChartBackgroundFillStyle,i.ls.Ji.polarChartBackgroundStrokeStyle,i.ls.Ji.polarChartTitleFont,i.ls.Ji.polarChartTitleFillStyle,h),this.coordsClient="client",this.Ix=e.AutoCursorModes.snapToClosest,this.tf=[],this.po=!0,this.VM=(t,e,i,s,r)=>{this.vb.q(s,r)},this.ef=ee(this.tf),this.NM=t=>{this.tf.push(t)},this.GM=()=>this.My,this.ff.wn||this.ff.An||this.ls.Mn(4),this.WM=i.OS("polarChart series bg",0),this.HM=i.Hp("polarChart axis gridlines",0),this.UM=i.Hp("polarChart series",1),this.$M=i.Hp("polarChart axis lines",2),this.jM=i.Hp("polarChart axis ticks",3),this.vb=s.d2({scaleXYConstructor:yu}),this.onResize(this.VM),this.ap.Ch("Polar Chart");const a=Lt(o?o.autoCursorBuilder:void 0,hl);this.Ex=a.Tx(this.Dx,this.uiScale,this.uiScale,this.Ji),this.Fy=this.WM.Dc(this.vb).Me(this.Ji.polarChartSeriesBackgroundFillStyle).ve(st).Nl(0).Be(360).Ul(0),this.Iy=this.WM.Dc(this.vb).Me(z).ve(this.Ji.polarChartSeriesBackgroundStrokeStyle).Nl(0).Be(360).Ul(0),super.Ty(this.Fy,this.Iy),this.ep(n,this.pixelScale),this.YM=new wl(this,this.vb,this.Ji,!(!o||!0!==o.disableAnimations),this.HM,this.$M,this.jM,this.ss,this.GM),this.XM=new El(this,this.vb,this.Ji,!(!o||!0!==o.disableAnimations),this.HM,this.$M,this.jM,this.ss),this.coordsAxis={axisAmplitude:this.YM,axisRadial:this.XM},o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1)}getSeries(){return this.My}translateCoordinate(t,e,i){if(i){const e=t,s=this.pixelScale,r=i;if(zi(r)){const t=at(e,s,this.engine.scale);return this.ls.fo({engineX:t.x,engineY:t.y})}if(Ri(r))return e;if(Pl(r)){const t=at(e,s,this.vb);return Rl(t,this.vb)}}else{const i=t,s=e;if(Oi(i)){if(Pl(s)){const t=this.ls.do(i),e=at({x:t.engineX,y:t.engineY},this.engine.scale,this.vb);return Rl(e,this.vb)}if(zi(s))return i;if(Ri(s)){const t=this.ls.do(i);return at({x:t.engineX,y:t.engineY},this.ls.ct,this.pixelScale)}}else if(kl(i)){if(Pl(s))return i;const t=Dl([i],this.vb)[0];if(zi(s)){const e=at(t,this.vb,this.engine.scale),i={engineX:e.x,engineY:e.y};return this.ls.fo(i)}if(Ri(s))return at(t,this.vb,this.pixelScale)}}throw new Error("translateCoordinate unexpected error. Input or target coordinate system not recognized.")}addLineSeries(t){const e=new Gl(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPointSeries(t){const e=new Ul(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPointLineSeries(t){const e=new Hl(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addAreaSeries(t){const e=new gu(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addPolygonSeries(t){const e=new du(this.UM,this,this.Ay,this.vb,this.Ji,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length,this.ls.ss);return this.Py(e),e}addHeatmapSeries(t){const e=new Vl(this.UM,this,this.Ay,this.vb,this.Ji,this.ls.ss,t);return this.Py(e),e}addSector(){const t=new Fl(this.UM,this,this.ef,this.vb,this.Ji,this.ls.ss);return this.NM(t),t}getAmplitudeAxis(){return this.YM}getRadialAxis(){return this.XM}Ae(t){var e,i;super.Ae(t),Nh.fp(this.ap,this.rp);for(const t of this.My)t.ey();this.YM.cr(),this.XM.cr();for(const t of this.My)t.Ae();for(let t=1;t<=2;t+=1){const e=this.YM.Ae(),i=this.XM.Ae(),s=Nh.dp(this.ap,this.rp),r=[this.Qo.left+i,this.Qo.right+i],n=[this.Qo.bottom+i,this.Qo.top+i+s];this.vb.Si(r).xi(n);const o=4;if(!(!this.ZM||Math.abs(this.ZM.amplitude-e)>=o||Math.abs(this.ZM.radial-i)>=o)||1!==t){this.ZM={amplitude:e,radial:i};break}}const s=this.vb.Ob().start,r=this.vb.Ob().end,n=this.vb.Bb()?((null===(e=this.ZM)||void 0===e?void 0:e.radial)||0)*this.vb.x.getPixelSize()+r-s:((null===(i=this.ZM)||void 0===i?void 0:i.radial)||0)*this.vb.x.getPixelSize()+s-r;this.Fy.Gl(n).$l(360),this.Iy.Gl(n).$l(360);for(const t of this.tf)t.Ae();this.Vx(!1);for(const t of this.My)t.om();return super.sp(),this.KM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.YM.setAnimationsEnabled(t),this.XM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.po=t,this}getMouseInteractions(){return this.po}getMinimumSize(){return u(mu,mu)}KM(){}forEachAxis(t){return t(this.YM),t(this.XM),this}dispose(){return this.WM.G(),this.HM.G(),this.UM.G(),this.$M.G(),this.jM.G(),this.tf.slice().forEach((t=>t.dispose())),super.dispose()}Sd(){return[...this.My,...this.tf]}}const mu=300;class Su extends Wh{}class xu extends Su{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.bs="Slice",this.u=0,this.gp=!1,this.qM=z,this.mp=z,this.yp=this.u,this.bp=j((()=>this.Ki.ls.Ss())),this.Mp=()=>{this._p=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.TM=e.Cc(r,sn.Simple).us(this.getHighlight()),this.cs(this.TM),this.Ve=i.Sr(r).us(this.getHighlight()),this.cs(this.Ve,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.Cp(this.yp,t):this.yp=t,this.u=t,this.Ki.ls.Ss(),this}getValue(){return this.u}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?(this._p&&(this._p.finish(!1),this._p=void 0),this.Cp(this.yp,0,(()=>super.setVisible(!1)))):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this._p&&(this._p.finish(!1),this._p=void 0),super.setVisible(!0),this.Cp(this.yp,this.u)):(this.yp=this.u,super.setVisible(!0)),this}Cp(t,e,i){this._p=this.bp(300,X.ease)([[t,e]],(([t])=>{this.yp=t,this.Ki.ls.Ss()})),this._p.onEveryAnimationEnd(this.Mp),i&&this._p.onAnimationEnd(i)}setStyle(t,e,i,s){this.qM=t,this.mp=i,this.TM.Me(this.qM).ve(e),this.Ve.Me(this.mp).Ih(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Mu=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=vu(i,r.x),s=vu(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},y={x:0,y:n.bottom},p=0,m=0;if(o)for(let i=0;i0&&(d={x:g.x+S*o,y:g.y-o},f={x:y.x-S*o,y:y.y-o}),b=(i+c/u*(s-i))/2,g={x:a-b,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+b,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>g.x&&m.TM.tl([g,d,f,y])}};class Au extends Vh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("funnelChart bg",0),r,i.ls.Ji.funnelChartBackgroundFillStyle,i.ls.Ji.funnelChartBackgroundStrokeStyle,i.ls.Ji.funnelChartTitleFont,i.ls.Ji.funnelChartTitleFillStyle,o),this.Tp=[],this.Fp=Hh.None,this.Dp=!0,this.Lp=0,this.JM=80,this.QM=20,this.t_=0,this.i_=e.FunnelSliceModes.VariableHeight,this.zp=!0,this.Np=t=>{const e=this.Tp.indexOf(t);e>=0&&(this.Tp.splice(e,1),this.Gp())},this.ff.wn||this.ff.An||this.ls.Mn(5),this.Vp=this.Ji.effectsText,this.Wp=i.Hp("funnelChart bottom",0),this.$p=i.Hp("funnelChart top",1),this.ap.Ch("Funnel Chart"),this.Ip=this.Ji.funnelChartSliceFillStylePalette,this.Pp=this.Ji.funnelChartSliceStrokeStyle,this.Bp=this.Ji.funnelChartSliceLabelFont,this.Op=this.Ji.funnelChartSliceLabelFillStyle,h&&this.setAnimationsEnabled(!1),this.ep(n,this.pixelScale)}addSlice(t,e){const i=new xu(this.Lp,this.Wp,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);return this.Lp+=1,i.setName(t),i.setValue(e),i.ss.hs.ys(this.Vp),i.ss.rs.ys(this.zp),this.Tp.push(i),this.ls.Ss(),i.setHighlightOnHover(this.Dp),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.ys(t))),this.ls.Ss(),this}getSliceEffect(){return this.zp}setSliceSorter(t){return this.Fp=t,this.Tp=this.Tp.sort(this.Fp),this.ls.Ss(),this}getSliceSorter(){return this.Fp}setLabelFillStyle(t){return this.Op="function"==typeof t?t(this.Op):t,this.ls.Ss(),this}getLabelFillStyle(){return this.Op}setLabelFont(t){return this.Bp="function"==typeof t?t(this.Bp):t,this.ls.Ss(),this}getLabelFont(){return this.Bp}setLabelEffect(t){return this.Vp=t,this.Tp.forEach((e=>e.ss.hs.ys(t))),this.ls.Ss(),this}getLabelEffect(){return this.Vp}setLabelFormatter(t){return this.Yp=t,this.ls.Ss(),this}getLabelFormatter(){return this.Yp}setSliceHighlightOnHover(t){return this.Dp=t,this.Tp.forEach((e=>e.setHighlightOnHover(t))),this}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+e)),s=u(this.Qo.left+i.x/2,this.Qo.bottom+i.y/2);this.Tp=this.Tp.sort(this.Fp);for(let t=0,{length:e}=this.Tp;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tt.dispose())),super.dispose()}}const wu=(t,i,s)=>{const r=t.il();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}}},Tu=t=>{const e=t.il();if(e.length>0)return{x:(e[2].x-e[1].x)/2+e[1].x,y:(e[1].y-e[0].y)/2+e[0].y}};class Eu extends Au{constructor(){super(...arguments),this.Yp=Uh.NamePlusValue,this.Zp=10,this.s_=e.FunnelLabelSide.Left,this.e_=e.SliceLabelIndices.LabelsOnSides,this.qp=[],this.Jp=this.Ji.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Jp=t;for(let t=0;t{const e=this.Tp.indexOf(t);e>=0&&this.Tp.splice(e,1)},this.ff.wn||this.ff.An||this.ls.Mn(6),this.As=e.Hp("gaugeChart layer",0),this.$p=e.Hp("gaugeChart top layer",1),this.ap.Ch("Gauge Chart"),this.ep(r,this.pixelScale);const h=Wi();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}dispose(){return this.As.G(),this.$p.G(),this.Tp.slice().forEach((t=>t.dispose())),super.dispose()}}class Bu extends Fu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Il=90,this.Pl=-270,this.n_={min:this.Il,max:this.Pl},this.o_=j((()=>this.As.Ss())),this.a_=()=>{this.l_=void 0},this.u_=e.Hp("radialGaugeChart bg arc",2),this.c_=this.As.Dc(this.pixelScale).Me(this.Ji.gaugeChartEmptyGaugeFillStyle).ve(this.Ji.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.Il,s=this.Pl,r=this.n_;return this.getAnimationsEnabled()?this.d_(r,{min:t,max:e}):(r.min=t,r.max=e,this.Il=t,this.Pl=e),this.P.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.ls.Ss(),this}getAngleInterval(){return{min:this.Il,max:this.Pl}}setGaugeFillStyle(t){return this.c_.Me(t),this.ls.Ss(),this}setGaugeStrokeStyle(t){return this.c_.ve(t),this.ls.Ss(),this}d_(t,e,i){this.l_=this.o_(1e3,X.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.n_={min:t,max:e},this.Il=t,this.Pl=e,this.As.Ss()})),this.l_.onEveryAnimationEnd(this.a_),i&&this.l_.onAnimationEnd(i)}onAngleIntervalChange(t){return this.P.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.P.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.u_.G(),this}}class _u extends Wh{f_(t){return this.P.on("valueChange",t)}g_(t){return this.P.on("valueIntervalChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}offIntervalChange(t){return this.P.off(t,"valueIntervalChange")}attach(t,e=!0){return super.attach(t,e),this.styleAttachedEntry(t),this}styleAttachedEntry(t){ce(t,this.Ji,{fill:this.p_})}}class Lu extends _u{onValueChange(t){return this.f_(t)}onIntervalChange(t){return this.g_(t)}}class Du extends Lu{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.Il=0,this.Pl=0,this.m_=0,this.y_=0,this.S_=0,this.x_=100,this.b_=!0,this.yp=this.u,this.xp=this.getVisible(),this.bp=Ae(),this.v_=t=>{this.yp=t,this.Ki.ls.Ss()},this.M_=t,this.br=e,this.Ki=i,this.scale=s,this.p_=this.Ji.gaugeChartGaugeFillStyle,this.kp=t.Dc(s).Me(this.p_).ve(st).us(this.getHighlight()),this.cs(this.kp),this.__=e.Sr(s).us(this.getHighlight()),this.cs(this.__,{isText:!0}),this.A_=e.Sr(s).us(this.getHighlight()),this.cs(this.A_,{isText:!0}),this.Ve=e.Sr(s).us(this.getHighlight()),this.cs(this.Ve,{isText:!0}),this.__.Me(n.gaugeChartIntervalLabelsFillStyle).Ih(n.gaugeChartIntervalLabelsFont),this.A_.Me(n.gaugeChartIntervalLabelsFillStyle).Ih(n.gaugeChartIntervalLabelsFont),this.Ve.Me(n.gaugeChartValueLabelFillStyle).Ih(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}Ae(){const t=this.Ki.getDataLabelFormatter(),e=this.Il/90r&&(i=r);const n=this.Pl-e*this.y_,o=this.Il+e*this.m_,h=this.x_-this.S_,a=(0!==h?(n-o)/h:1/0)*(i-this.S_);this.kp.Nl(o).Be(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Ve.Ch(l)}w_(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.S_,{getInnerStart:()=>this.S_,getInnerEnd:()=>this.x_}):t.format(this.S_);return this.__.Ch(e).Ts(),this.__.Ht()}k_(){const t=this.Ki.getIntervalLabelFormatter(),e="function"==typeof t?t(this.x_,{getInnerStart:()=>this.S_,getInnerEnd:()=>this.x_}):t.format(this.x_);return this.A_.Ch(e).Ts(),this.A_.Ht()}setName(t){return super.setName(t),this.Ki.ls.Ss(),this}setValue(t){const e=this.u;return this.Ki.getAnimationsEnabled()?this.xp&&this.bp(e,t,this.v_):this.yp=t,this.u=t,this.P.emit("valueChange",this,e,t),this.Ki.ls.Ss(),this}getValue(){return this.u}setVisible(t){return this.xp=t,!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?this.bp(this.yp,0,this.v_,{onCompleted:()=>super.setVisible(!1)}):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(super.setVisible(!0),this.bp(this.yp,this.u,this.v_)):(this.yp=this.u,super.setVisible(!0)),this}setInterval(t,e){const i=this.S_,s=this.x_;return this.P.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.S_=t,this.x_=e,this.Ki.ls.Ss(),this}setIntervalLabelsFont(t){return this.__.Ih(t),this.A_.Ih(t),this.Ki.ls.Ss(),this}getIntervalLabelsFont(){return this.__.Fh()}setIntervalLabelsFillStyle(t){return this.__.Me(t),this.A_.Me(t),this.Ki.ls.Ss(),this}getIntervalLabelsFillStyle(){return this.__.Th()}setIntervalLabelsVisible(t){return t?(this.__.setVisible(!0),this.A_.setVisible(!0)):(this.__.setVisible(!1),this.A_.setVisible(!1)),this.b_=t,this}getIntervalLabelsVisible(){return this.b_}setAngleInterval(t,e){return this.Il=t,this.Pl=e,this.Ki.ls.Ss(),this}setMinAngle(t){return this.Il=t,this.Ki.ls.Ss(),this}setMaxAngle(t){return this.Pl=t,this.Ki.ls.Ss(),this}setMarginInDegrees(t=this.m_,e=this.y_){return t!==this.m_&&(this.m_=t),e!==this.y_&&(this.y_=e),this.Ki.ls.Ss(),this}setFillStyle(t){this.p_="function"==typeof t?t(this.p_):t;const e=this.p_;this.kp.Me(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 Ou extends Bu{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.nd=20,this.F_=new Intl.NumberFormat,this.I_=new Intl.NumberFormat,this.P_=!1,this.D_=5;const h=new Du(this.As,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);this.B_=h,this.Tp.push(h),this.setPadding(10)}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=Xe([this.B_.w_(),this.B_.k_()]),s=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right+2*i.max.x),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+1*i.max.y+e)),r=Math.max(.5*Math.min(s.x,s.y),0),n=u(this.Qo.left+i.max.x+.5*s.x,this.Qo.bottom+i.max.y+.5*s.y),o=this.P_?this.O_(n,r):n,h=this.c_.xe.getThickness(),a=r-.5*h,l=r-this.nd;let c=l/r*100;c=c>100||c<0?99:c;const d=100*(1-(this.nd-h)/r);this.L_(o,l)&&(this.c_.Gl(r).Ul(c),this.B_.kp.Gl(a).Ul(d));const f=.5*(g=r,(y=this.Pl-this.Il)/(2*Math.PI*g*(y/360))*h);var g,y;this.c_.Nl(this.Il).Be(this.Pl).we(o),this.B_.kp.we(o),this.B_.Ve.we(o),this.ad&&this.B_.setFillStyle(new V({color:this.ad.getColors(this.B_.getAnimatedValue())})),this.B_.setMinAngle(this.Il).setMaxAngle(this.Pl).setMarginInDegrees(f,f).Ae();const p=this.c_.Dl();if(this.B_.getIntervalLabelsVisible()){this.R_(this.Il,this.Pl,o,p+this.D_);const t=this.B_.__.Ts().ze(),e=this.B_.A_.Ts().ze();De(t,e)&&this.E_(t,e,o,p+this.D_)}}L_(t,e){const i=si(this.B_.Ve.Ts().Ht(),.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]}O_(t,e){const[i]=zu(t,this.Il,this.Pl,e,e),s=Xe(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return ri(ni(t,u(s.min.x+r,s.min.y+n)),t)}R_(t,e,i,s){const r=di(t),n=di(e);this.B_.__.we(Ke(u(i.x+s,i.y),i,-r)),this.B_.A_.we(Ke(u(i.x+s,i.y),i,-n)),this.B_.__.Sa(u(-Math.cos(r),-Math.sin(r))),this.B_.A_.Sa(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.B_}setAutoScaling(t){return this.P_=t,this.ls.Ss(),this}getAutoScaling(){return this.P_}setDataLabelFormatter(t){return this.I_=t,this.ls.Ss(),this}getDataLabelFormatter(){return this.I_}setIntervalLabelFormatter(t){return this.F_=t,this.ls.Ss(),this}getIntervalLabelFormatter(){return this.F_}setIntervalLabelPadding(t){return this.D_=t,this.ls.Ss(),this}getIntervalLabelPadding(){return this.D_}setThickness(t){return this.nd=t,this}setLUT(t){return this.ad=t,this.ls.Ss(),this}setDataLabelFont(t){return this.B_.Ve.Ih(t),this.ls.Ss(),this}getDataLabelFont(){return this.B_.Ve.Fh()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.B_.C_(t),this.ls.Ss(),this}getDataLabelFillStyle(){return this.B_.T_()}Sd(){return this.Tp}dispose(){return this.B_.dispose(),super.dispose()}}class Ru extends Wh{}class Vu extends Ru{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.bs="Slice",this.u=0,this.gp=!1,this.qM=z,this.mp=z,this.yp=this.u,this.bp=j((()=>this.Ki.ls.Ss())),this.Mp=()=>{this._p=void 0},this.index=t,this.Ki=s,this.scale=r,this.qi=n,this.TM=e.Cc(r,sn.Simple).us(this.getHighlight()),this.cs(this.TM),this.Ve=i.Sr(r).us(this.getHighlight()),this.cs(this.Ve,{isText:!0})}setValue(t){return this.Ki.getAnimationsEnabled()?this.getVisible()&&this.Cp(this.yp,t):this.yp=t,this.u=t,this.Ki.ls.Ss(),this}getValue(){return this.u}setVisible(t){return!1===t?this.Ki.getAnimationsEnabled()&&this.yp>0?(this._p&&(this._p.finish(!1),this._p=void 0),this.Cp(this.yp,0,(()=>super.setVisible(!1)))):(this.yp=0,super.setVisible(!1)):this.Ki.getAnimationsEnabled()?(this._p&&(this._p.finish(!1),this._p=void 0),super.setVisible(!0),this.Cp(this.yp,this.u)):(this.yp=this.u,super.setVisible(!0)),this}Cp(t,e,i){this._p=this.bp(300,X.ease)([[t,e]],(([t])=>{this.yp=t,this.Ki.ls.Ss()})),this._p.onEveryAnimationEnd(this.Mp),i&&this._p.onAnimationEnd(i)}setStyle(t,e,i,s){this.qM=t,this.mp=i,this.TM.Me(this.qM).ve(e),this.Ve.Me(this.mp).Ih(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Gu=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=Nu(i,r.x),s=Nu(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},y={x:0,y:n.bottom},p=0,m=0;if(o)for(let i=0;i0&&(d={x:g.x+S*o,y:g.y-o},f={x:y.x-S*o,y:y.y-o}),b=(i+c/u*(s-i))/2,g={x:a-b,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-x:x}`,10)},y={x:a+b,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-x:x}`,10)},f.x>=d.x&&y.x>=g.x&&m.TM.tl([g,d,f,y])}};class Hu extends Vh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("pyramidChart bg",0),r,i.ls.Ji.pyramidChartBackgroundFillStyle,i.ls.Ji.pyramidChartBackgroundStrokeStyle,i.ls.Ji.pyramidChartTitleFont,i.ls.Ji.pyramidChartTitleFillStyle,o),this.Tp=[],this.Fp=Hh.None,this.Ip=this.Ji.pyramidChartSliceFillStylePalette,this.Pp=this.Ji.pyramidChartSliceStrokeStyle,this.Dp=!0,this.Bp=this.Ji.pyramidChartSliceLabelFont,this.Op=this.Ji.pyramidChartSliceLabelFillStyle,this.Lp=0,this.JM=0,this.QM=80,this.t_=0,this.i_=e.PyramidSliceModes.VariableHeight,this.zp=!0,this.Np=t=>{const e=this.Tp.indexOf(t);e>=0&&(this.Tp.splice(e,1),this.Gp())},this.ff.wn||this.ff.An||this.ls.Mn(8),this.Vp=this.Ji.effectsText,this.Wp=i.Hp("pyramidChart bottom",0),this.$p=i.Hp("pyramidChart top",1),this.ap.Ch("Pyramid Chart"),h&&this.setAnimationsEnabled(!1),this.ep(n,this.pixelScale)}addSlice(t,e){const i=new Vu(this.Lp,this.Wp,this.$p,this,this.pixelScale,this.Np,this.Ji,this.ls.ss);return this.Lp+=1,i.setName(t),i.setValue(e),i.ss.hs.ys(this.Vp),i.ss.rs.ys(this.zp),this.Tp.push(i),this.ls.Ss(),i}addSlices(t){const e=[];for(let i=0;ie.ss.rs.ys(t))),this.ls.Ss(),this}getSliceEffect(){return this.zp}setSliceSorter(t){return this.Fp=t,this.Tp=this.Tp.sort(this.Fp),this.ls.Ss(),this}getSliceSorter(){return this.Fp}setLabelFillStyle(t){return this.Op="function"==typeof t?t(this.Op):t,this.ls.Ss(),this}getLabelFillStyle(){return this.Op}setLabelFont(t){return this.Bp="function"==typeof t?t(this.Bp):t,this.ls.Ss(),this}getLabelFont(){return this.Bp}setLabelEffect(t){return this.Vp=t,this.Tp.forEach((e=>e.ss.hs.ys(t))),this.ls.Ss(),this}getLabelEffect(){return this.Vp}setLabelFormatter(t){return this.Yp=t,this.ls.Ss(),this}getLabelFormatter(){return this.Yp}setSliceHighlightOnHover(t){return this.Dp=t,this.Tp.forEach((e=>e.setHighlightOnHover(t))),this}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp),super.sp();const e=Nh.dp(this.ap,this.rp),i=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.top+e)),s=u(this.Qo.left+i.x/2,this.Qo.bottom+i.y/2);this.Tp=this.Tp.sort(this.Fp);for(let t=0,{length:e}=this.Tp;tt.getAnimatedValue()>0));let n=0;for(let t=0;t0?h/n:0);var h;for(let t=0;tt.dispose())),super.dispose()}}const Uu=(t,i,s)=>{const r=t.il();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}}},Wu=t=>{const e=t.il();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 Xu extends Hu{constructor(){super(...arguments),this.Yp=Uh.NamePlusValue,this.Zp=10,this.s_=e.PyramidLabelSide.Left,this.e_=e.SliceLabelIndices.LabelsOnSides,this.qp=[],this.Jp=this.Ji.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Jp=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),qu=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Zu;e.SpiderWebMode=void 0,(Zu=e.SpiderWebMode||(e.SpiderWebMode={}))[Zu.Normal=0]="Normal",Zu[Zu.Circle=1]="Circle";class Ku{constructor(t,e,i,s,n,o,h,a){this.P=new r.Eventer,this.V_=t,this.br=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.N_=h,this.G_=a,this.W_=this.V_.De(this.scale).setMouseInteractions(!1),this.H_=this.br.Sr(this.scale).Ch(this.tag).setMouseInteractions(!1),this.U_=this.N_(this,this.br.tm(this.scale,void 0,[Kh.InternalUI])).Pe(this.chart.getNibStyle()),this.G_.ds([this.H_])}Xp(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.H_.setVisible(!0).we(ri(c,u(h.paddingX,h.paddingY))).ga(h.alignmentX).ma(h.alignmentY):this.H_.setVisible(!1)}getLabelSize(){return this.H_.Ih(this.chart.getAxisLabelFont()).Me(this.chart.getAxisLabelStyle()).Ts().Ht()}dispose(){this.W_&&this.W_.dispose(),this.H_&&this.H_.dispose(),this.U_&&this.U_.dispose()}}const Qu=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class tc extends Bl{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.bs="Spider Series",this.Jl=new Map,this.Ci=e.HighlightModes.onHover,this.$x=Qu,this.lv=8,this.Ko=0,this.j_=Ae(),this.Y_={},this.X_={},this.xp=this.getVisible(),this.Z_=1,this.K_=((t,e)=>{const i=j((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||X.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.Z_=t,this.As.ls.Ss()}),(t=>{super.setVisible(t)})),this.Ki=t,this.As=i,this.uv=r,this.q_=n,this.LS=o,this.J_=h,this.Q_=a,this.scale=s,this.tA=ye(u.spiderSeriesFillStyle,c),this.iA=ye(u.spiderSeriesStrokeStyle,c),this.sA=ye(u.spiderSeriesPointFillStyle,c)}Xm(){return this.Km&&this.Jl.size>0&&this.getVisible()}addPoints(...t){t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.j_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.Jl.set(s,r+t*(e-r)),this.As.ls.Ss()}))}),{easing:this.Y_.easing,durationMs:this.Y_.durationMs,onStart:()=>{i=new Map(this.Jl)}})}else for(let e=0;e=3&&(this.TM||(this.TM=this.As.Cc(this.scale,sn.Simple).ve(this.iA).Me(this.tA).us(this.getHighlight()),this.cs(this.TM)),this.TM.tl(t),this.cv||(this.cv=this.As.vy(this.scale).q(this.lv).za(this.uv).Ph(this.Ko).Me(this.sA).us(this.getHighlight()),this.cs(this.cv)),this.cv.Ha().Wa(t))}}attach(t,e=!0){return super.attach(t,e),ce(t,this.Ji,{fill:this.tA,stroke:this.iA}),this}eA(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},ic=t=>Xe(t.H_.ze()),sc=t=>Xe(t.ze()),rc=(t,i,s,r)=>t.Ul(0).we(s).Nl(90).Be(-270).$l(i===e.SpiderWebMode.Circle?void 0:r.length),nc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},oc={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},hc=()=>{oc.alignmentX=0,oc.alignmentY=0,oc.paddingX=0,oc.paddingY=0};class ac extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("spiderChart bg",0),r,i.ls.Ji.spiderChartBackgroundFillStyle,i.ls.Ji.spiderChartBackgroundStrokeStyle,i.ls.Ji.spiderChartTitleFont,i.ls.Ji.spiderChartTitleFillStyle,h),this.Ix=e.AutoCursorModes.onHover,this.Qo=S(20,20,20,20),this.axisScale=ot.d1({scale1DConstructor:ki,dimension:"x"}).Z(0,1),this.LS=[],this.hA=[],this.rA=[],this.nA=zs.expansion,this.oA=!0,this.aA=qu,this.lA=$u,this.po=!0,this.uA=e.SpiderWebMode.Normal,this.cA=4,this.dA=this.Ji.spiderChartWebStyle,this.fA=this.Ji.spiderChartScaleLabelFillStyle,this.gA=this.Ji.spiderChartScaleLabelFont,this.pA=5,this.mA=this.Ji.spiderChartAxisLabelFillStyle,this.yA=this.Ji.spiderChartAxisLabelFont,this.SA=5,this.xA=this.Ji.spiderChartAxisStrokeStyle,this.bA=this.Ji.spiderChartAxisNibStrokeStyle,this.Od=10,this.vA=S(),this.hasAxis=t=>this.LS.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.gi(t,Ci.Numeric),this.MA=()=>(t=>{const e=t.length;for(let i=0;ithis.AA.Dc(this.pixelScale).setMouseInteractions(!1),this.wA=t=>t.dispose(),this.kA=()=>this._f.Sr(this.pixelScale).setMouseInteractions(!1),this.CA=t=>t.dispose(),this.TA=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.FA=(t,e)=>{let i,s;const r=()=>{void 0!==this.IA&&this.IA.finish(),i=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.nA,this.nA=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.LS.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=ec(a,this.LS.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=ii(ni(t.W_.di(),t.W_.ui())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.Z(i.min,l),Kt(o),this.ls.Ss()}},o=()=>{if(i=void 0,void 0!==s)if(this.Ze){const t=y(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.PA(),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.IA=this.Gg.ls.Er(300,X.ease)([[0,1]],(([e])=>{this.axisScale.Z(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.IA.onAnimationEnd((()=>{this.IA=void 0,this.nA=i}))}else this.nA=s}else this.nA=s;s=void 0};e.setMouseEnterEventHandler(this.DA).setMouseLeaveEventHandler(this.BA).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Wi(new Yi(((t,e,i)=>{this.DA(t),r(),Kt(i)}),n,((t,e,i,s)=>{this.BA(t),o(),Kt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.OA=t=>{this.oA&&!this.hasAxis(t)&&this.addAxis(t)},this.J_=(t,e)=>{for(const i of this.LS)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Ue(i.W_.di(),i.W_.ui(),t)}},this.Q_=t=>{if(0===this.LS.length)return;const e=ni(at(t,this.engine.scale,this.pixelScale),this.LS[0].W_.di()),i=Math.atan2(e.y,e.x);let s,r=Pe;for(const t of this.LS){const e=ni(t.W_.ui(),t.W_.di()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.po&&(t.Pe(this.bA),this.ls.Ss())},this.BA=t=>{t.Pe(this.bA),this.ls.Ss()},this.ff.wn||this.ff.An||this.ls.Mn(9),this.WM=i.OS("spiderChart series bg",0),this.AA=i.Hp("spiderChart web shapes",0),this.LA=i.Hp("spiderChart axis bg",1),this.hb=i.Hp("spiderChart plotting",2),this._f=i.Hp("spiderChart fg",3),this.G_=this.ss.xg().ys(this.Ji.effectsText),this.ap.Ch("Spider Chart");const a=Lt(o?o.autoCursorBuilder:void 0,nl);this.Ex=a.Tx(this.Dx,this.uiScale,this.uiScale,this.Ji),this.Fy=this.WM.Dc(this.pixelScale).Me(this.Ji.spiderChartSeriesBackgroundFillStyle).ve(st).Nl(90).Be(-270).Ul(0),this.Iy=this.WM.Dc(this.pixelScale).Me(z).ve(this.Ji.spiderChartSeriesBackgroundStrokeStyle).Nl(90).Be(-270).Ul(0),super.Ty(this.Fy,this.Iy),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.ep(n,this.pixelScale)}getSeries(){return this.My}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Ku(this.LA,this._f,this.pixelScale,this,t,this.axisScale,this.FA,this.G_);this.LS.push(e)}}else t&&this.LS.push(t);return this.G_.ds(this.LS.map((t=>t.H_))),this.ls.Ss(),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.My.length,r=new tc(this,this.hb,this.pixelScale,i,this.OA,this.LS,this.J_,this.Q_,this.Ay,this.Ji,s,this.ls.ss);return this.Py(r),r}getSeriesCount(){return this.My.length}setWebMode(t){return this.uA=t,this.ls.Ss(),this}getWebMode(){return this.uA}setWebCount(t){return this.cA=t,this.ls.Ss(),this}getWebCount(){return this.cA}setWebStyle(t){return this.dA="function"==typeof t?t(this.dA):t,this.ls.Ss(),this}getWebStyle(){return this.dA}setScaleLabelStyle(t){return this.fA="function"==typeof t?t(this.fA):t,this.ls.Ss(),this}getScaleLabelStyle(){return this.fA}setScaleLabelFont(t){return this.gA="function"==typeof t?t(this.gA):t,this.ls.Ss(),this}getScaleLabelFont(){return this.gA}setScaleLabelPadding(t){return this.pA=t,this.ls.Ss(),this}getScaleLabelPadding(){return this.pA}setScaleLabelStrategy(t){return this.aA=t,this.ls.Ss(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.ls.Ss(),this}setAxisLabelStyle(t){return this.mA="function"==typeof t?t(this.mA):t,this.ls.Ss(),this}getAxisLabelStyle(){return this.mA}setAxisLabelFont(t){return this.yA="function"==typeof t?t(this.yA):t,this.ls.Ss(),this}getAxisLabelFont(){return this.yA}setAxisLabelEffect(t){return this.G_.ys(t),this.ls.Ss(),this}getAxisLabelEffect(){return this.G_.xs()}setAxisLabelPadding(t){return this.SA=t,this.ls.Ss(),this}getAxisLabelPadding(){return this.SA}setAxisLabelStrategy(t){return this.lA=t,this.ls.Ss(),this}setAxisStyle(t){return this.xA="function"==typeof t?t(this.xA):t,this.ls.Ss(),this}getAxisStyle(){return this.xA}setNibStyle(t){return this.bA="function"==typeof t?t(this.bA):t,this.ls.Ss(),this}getNibStyle(){return this.bA}setNibLength(t){return this.Od=t,this.ls.Ss(),this}getNibLength(){return this.Od}setAutoAxis(t){return this.oA=t,this}getAutoAxis(){return this.oA}setMouseInteractions(t){return this.po=t,this}getMouseInteractions(){return this.po}setAxisScrollStrategy(t){return this.nA=t,this.ls.Ss(),this}getAxisScrollStrategy(){return this.nA}setAxisInterval(t,e=0){return this.axisScale.Z(e,t),this.ls.Ss(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp);const e=this.LS.length,i=Nh.dp(this.ap,this.rp),s=u(this.pixelScale.x.getInnerInterval()-(this.Qo.left+this.Qo.right),this.pixelScale.y.getInnerInterval()-(this.Qo.bottom+this.Qo.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.lA){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.nA){const t=this.PA();if(void 0!==t){const e=this.nA.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.nA.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.Z(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.vA=S(this.Ft.left+this.Qo.left+r.left,this.Ft.top+this.Qo.top+i+r.top,this.Ft.right+this.Qo.right+r.right,this.Ft.bottom+this.Qo.bottom+r.bottom),this.Xp(n,o);for(const t of this.My)t.ey();for(const t of this.My)t.Ae();super.sp(),this.Vx(!1);for(const t of this.My)t.om()}dispose(){return this.WM.G(),this.AA.G(),this.LA.G(),this.hb.G(),this._f.G(),super.dispose()}getMinimumSize(){return u(this.vA.left+this.vA.right+100,this.vA.bottom+this.vA.top+100)}Xp(t,e){const i=this.LS.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];rc(h,i,s,n);const u=r*((l+1)/e);h.Gl(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=Ue(n,o[a],s);e.we(ri(c,u(p.paddingX,p.paddingY))).ga(p.alignmentX).ma(p.alignmentY).Ch(l(s))}}}for(let e=f;e1;for(const s of this.LS)for(const r of this.My){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 y(t,e)}}const lc=t=>({defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,...Sa(t,(t=>t.getXMin()),(t=>t.getXMax()),(t=>t.ur().x))}),uc=t=>({defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,...Sa(t,(t=>t.getYMin()),(t=>t.getYMax()),(t=>t.ur().y))});class cc extends cn{constructor(t,e,i,s){super(),this.Qi=[],this.ic=0,this.kc=!0,this.P=new r.Eventer,this.RA=t=>(this.Qi.push(t),this.ju(t),t.setMouseInteractions(this.kc),t),this.getHighlight=()=>this.ic,this.As=t,this.scale=e,this.EA=i,this.Ji=s}zA(){return this.Qi}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}dispose(){return this.Qi.forEach(Tt),this.EA&&this.EA(this),this.As.ls.Ss(),this.P.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this.Qi.forEach((e=>e.setVisible(t))),this.As.ls.Ss(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setHighlight(t){return this.ic=ve(t),this.As.Ss(),this}setMouseInteractions(t){this.kc=t;for(let t=0;t{const e=this.VA.findIndex((e=>e===t));e>=0&&this.VA.splice(e,1),this.As.Ss()}}clear(){return this.VA.slice().forEach(Tt),this.VA.length=0,this.As.Ss(),this}NA(t,e){void 0!==e?this.VA.splice(e,0,t):this.VA.push(t),t.zA().forEach((t=>this.cs(t,{setEventHandlers:!1}))),t.onMouseEnter(((t,e)=>this.Ri(t,e))),t.onMouseLeave(((t,e)=>this.Ei(t,e))),t.onMouseClick(((t,e)=>this.Vi(t,e))),t.onMouseDoubleClick(((t,e)=>this.Ni(t,e))),t.onMouseDown(((t,e)=>this.Gi(t,e))),t.onMouseUp(((t,e)=>this.Wi(t,e))),t.onMouseMove(((t,e)=>this.zi(t,e))),t.onMouseDragStart(((t,e,i)=>this.Hi(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.Ui(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.$i(t,e,i,s))),t.onMouseWheel(((t,e)=>this.ji(t,e))),t.onTouchStart(((t,e)=>this.Yi(t,e))),t.onTouchMove(((t,e)=>this.Xi(t,e))),t.onTouchEnd(((t,e)=>this.Zi(t,e))),this.As.Ss()}ke(t,e){t.setHighlight(e)}GA(t){return this.VA.find((e=>e.zA().includes(t)))}setCursorEnabled(t){return super.setCursorEnabled(t)}}class fc extends cc{}class gc extends dc{constructor(){super(...arguments),this.WA=void 0,this.HA=()=>{this.WA=void 0}}Xm(){return this.Km&&this.VA.length>0&&this.getVisible()}setDefaultStyle(t){this.UA=t,this.VA.forEach(t),t(this.$A);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.VA.filter((t=>t.getVisible())),this.YA,Ne);if(void 0!==i)return{location:at(i[0],this.As.ls.ct,this.scale),scale:this.scale,resultTableContent:this.$x(new Ja,this,i[1]).vc(),series:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}NA(t){super.NA(t),this.UA&&this.UA(t)}clear(){return this.WA=void 0,super.clear()}getXMax(){return this.WA||(this.WA=this.XA()),this.WA.max.x}getXMin(){return this.WA||(this.WA=this.XA()),this.WA.min.x}getYMax(){return this.WA||(this.WA=this.XA()),this.WA.max.y}getYMin(){return this.WA||(this.WA=this.XA()),this.WA.min.y}ur(){return u(0,0)}XA(){const t=y(c(Pe,Pe),c(ke,ke));for(let e=0;e{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)},wc=(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=ti(ni(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]=ri(si(r,l),f[1]),f[2]=ni(f[2],si(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.nM.length>0){const e=this.nM[this.nM.length-1];if(t.length>0){const i=e.Ea(),s=e.Ra(),r=i.length+s.length-+e.xl();if(r>=this.fM){const n=s.length>0?s[s.length-1]:i[e.xl()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.Wa(o,y(u(o.x,o.y),u(o.x,o.y))).bl(!0),this.kw([o].concat(t)).Sl(!0)}else e.Wa(t,this.cM)}}else t.length>0&&this.kw(t)},this.Cw=t=>{if(this.Aw.length>0){const e=this.Aw[this.Aw.length-1];t.length>0&&((e.Ea().length+e.Ra().length)*this._w>=this.fM?this.Tw(t):e.Wa(t))}else t.length>0&&this.Tw(t)},this.Fw=(t,e)=>{const i=t.zx(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.Iw=(t,e)=>{const i=t.Pw(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.uv=l,this.Dw=f,this.Bw=ye(c.pointLineSeriesFillStyle,g),this.jl=ye(this.Ji.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}pM(){return hu(this.Aw)}setStrokeStyle(t){this.jl="function"==typeof t?t(this.jl):t;const e=this.jl;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorSolveBasis(t){return this.Mw=t,this.nM.forEach((e=>e.La(Pr(t)))),this.Aw.forEach((e=>e.La(Pr(t)))),this.As.Ss(),this}getCursorSolveBasis(){return this.Mw}ld(){return de(this.Bw)||de(this.jl.getFillStyle())}Jv(t){}ke(t,e){t.us(e),this.As.Ss()}gM(t){const e=this.nM.length>0?this.nM[this.nM.length-1].Ea().length+this.nM[this.nM.length-1].Ra().length-+this.nM[this.nM.length-1].xl():void 0;ou(t,e,this.fM,this.ww),ou(t,e,this.fM,this.Cw)}Tw(t,e){const i=this.As.vy(this.scale).Wa(t,e).setMouseInteractions(this.ki).Me(this.Bw).za(this.uv).q(this.lv).Ph(this.Ko).Va(this.wa).Na(this.ka).Ga(this.Ca).La(Pr(this.Mw)).us(this.getHighlight());return this.cs(i),this.Aw.push(i),i}kw(t,e){const i=this.As.tm(this.scale,void 0,[Kh.UserSeries,...this.Dw]).Wa(t,e).setMouseInteractions(this.ki).Pe(this.jl).La(Pr(this.Mw)).us(this.getHighlight());return this.cs(i),this.nM.push(i),i}attach(t,e=!0){return ce(t,this.Ji,{stroke:this.jl,fill:this.Bw}),super.attach(t,e)}getPointAmount(){return this.Aw.reduce(((t,e)=>t+e.Ua()+e.$a()),this.Jl.length)}clear(){super.clear();for(let t=0;t{}))}zx(t,e,i=this.qb){const s=i?cu(t,e?this.nM.filter((t=>t.getIsUnderMouse())):this.nM,this.Iw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):cu(t,e?this.Aw.filter((t=>t.getIsUnderMouse())):this.Aw,this.Fw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(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=at(s[0],this.As.ls.ct,this.scale),e=s[1]instanceof hn?s[1].Yl():s[1].Th(),i=s[1]instanceof qr?s[1].Th():void 0,r=s[1]instanceof hn?s[1].Yl().getFillStyle():void 0,n=H(e)?s[0].color?new V({color:s[0].color}):new V({color:e.getFallbackColor()}):void 0;return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,r||n||i)}}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}}const Ec=(t,e)=>t.Ra().length>=e?t.Ra().slice(-e):Array.prototype.concat(t.Ea(),t.Ra()).slice(-e),Ic=(t,e,i)=>{const s=Array.prototype.concat(t.Ea(),t.Ra()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.Ha().Wa(s).Ts()};class Cc extends Tc{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,c,d,f),this.bs="Spline Series",this._w=32,this.fM=8e3,this.Ow=t=>{if(0===t.length)return;const e=this.Aw.length;if(e>0){const i=e>1,s=this.Aw[e-1];if(i){const i=Array.prototype.concat(s.Ea(),s.Ra()),r=i.length;if(32*r>=this.fM){const i=Ec(s,3),r=Array.prototype.concat(i,t),n=wc(r,32);Ic(this.nM[e-1],n,32),this.kw(n.slice(66))}else if(r<5){const s=this.Aw[e-2],r=Ec(s,3),n=Array.prototype.concat(r,i,t),o=wc(n,32),h=this.nM[e-1],a=o.slice(66);h.Ha().Wa(a).Ts()}else{const i=this.nM[e-1],r=Array.prototype.concat(i.Ea(),i.Ra()),n=Ec(s,4),o=Array.prototype.concat(n,t),h=wc(o,32),a=r.slice(0,-66).concat(h.slice(33));i.Ha().Wa(a).Ts()}}else{const i=Array.prototype.concat(s.Ea(),s.Ra()),r=i.length,n=this.nM[e-1];if(32*r>=this.fM){const e=Ec(s,3),i=Array.prototype.concat(e,t),r=wc(i,32);Ic(this.nM[0],r,32),this.kw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=wc(e,32);n.Ha().Wa(s).Ts()}else n.Wa(t)}}else{const e=t.length>0?wc(t,32):t,i=Xe(e);this.kw(e,i)}this.Cw(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}gM(t){const e=this.Aw.length,i=this.Aw.length>0?this.Aw[e-1].Ea().length+this.Aw[e-1].Ra().length:void 0;ou(t,i,Math.ceil(this.fM/this._w),this.Ow)}solveNearestFromScreen(t,e=this.qb){if(e)return super.solveNearestFromScreen(Yo(t,this.Ki.ls),e);const i=cu(Yo(t,this.Ki.ls),this.Aw,this.Fw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(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=at(i[0],this.As.ls.ct,this.scale);return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,i[1].Th())}}}class Pc{constructor(){this._i="FreeformPattern",this.nl={type:"disabled",packager:(t,e,i)=>t.slice()}}dM(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}},Fc=s.Record({nl:{type:"disabled",packager:(t,e,i)=>t.slice()}});class Bc extends Fc{dM(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.Rw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.At();return t?Math.min(i,t):i},Lc=(t,e)=>{const i=e.wt();return t?Math.max(i,t):i};class Dc extends Bc{Lw(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(Lc,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(_c,e?e.min.y:void 0)}}const zc=(t,e)=>{const i=e.Mt();return t?Math.min(i,t):i},Oc=(t,e)=>{const i=e._t();return t?Math.max(i,t):i};class Rc extends Bc{Lw(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(Oc,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(zc,e?e.min.x:void 0)}}const Vc={horizontalProgressive:new class extends Dc{constructor(){super({nl:Ar()}),this._i="HorizontalProgressivePattern"}Rw(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]._t():void 0}getXMin(t=[],e){return t.length>0&&t[0].Ua()>0?t[0].Mt():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",Ar(kc(t)))}},horizontalRegressive:new class extends Dc{constructor(){super({nl:wr()}),this._i="HorizontalRegressivePattern"}Rw(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].Ua()>0?t[0]._t():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].Mt():void 0}setPrecision(t){return this.set("_columnPackaging",wr(kc(t)))}},verticalProgressive:new class extends Rc{constructor(){super({nl:Tr()}),this._i="VerticalProgressivePattern"}Rw(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].wt():void 0}getYMin(t=[],e){return t.length>0&&t[0].Ua()>0?t[0].At():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",Tr(kc(t)))}},verticalRegressive:new class extends Rc{constructor(){super({nl:Er()}),this._i="VerticalRegressivePattern"}Rw(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].Ua()>0?t[0].wt():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].At():void 0}setPrecision(t){return this.set("_columnPackaging",Er(kc(t)))}},freeform:new Pc};class Nc extends Tc{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g){super(t,e,i,s,r,n,o,h,Vc.horizontalProgressive,a,c,d,f,g),this.bs="Step Series",this.ww=t=>{const e=this.nM.length>0?this.nM[this.nM.length-1].Ea().length+this.nM[this.nM.length-1].Ra().length:void 0;ou(t,e,this.fM,this.Ew)},this.Ew=t=>{const e=t.length;if(this.nM.length>0){const i=this.nM[this.nM.length-1];if(e>0){const e=i.Ea(),s=i.Ra(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Mc([r].concat(t),this.zw);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.fM?(i.Wa(o,y(u(o.x,o.y),u(o.x,o.y))).bl(!0),this.kw(h).Sl(!0),this.Tw(t)):i.Wa(h)}}else e>0&&this.kw(Mc(t,this.zw));this.Cw(t)},this.zw=l,void 0===this.Dw.find((t=>"DataPattern"===t.type))&&this.Dw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class Gc extends uu{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d,f){super(t,e,i,s,r,n,o,h,a,l,u),this.nM=[],this.bs="Line Series",this.qb=!0,this.fM=void 0,this.Mw="nearest-x",this.Ql=void 0,this.ld=()=>de(this.jl.getFillStyle()),this.Vw=(t,e)=>{const i=t.ov(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.Iw=(t,e)=>{const i=t.Pw(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.Dw=c,this._n=f,this.jl=ye(this.Ji.lineSeriesStrokeStyle,d),this.Nw={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.jl="function"==typeof t?t(this.jl):t;const e=this.jl;for(let t=0;tt.tu(this.Ql))),this.As.Ss(),this}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorSolveBasis(t){return this.Mw=t,this.nM.forEach((e=>e.La(Pr(t)))),this.As.Ss(),this}getCursorSolveBasis(){return this.Mw}Jv(t){}gM(t){let e=this.nM[0];e||(e=this.kw(),this.nM.push(e),this.cs(e)),e.Wa(t)}kw(){return this.As.tm(this.scale,this.Nw,[Kh.UserSeries,...this.Dw]).Pe(this.jl).tu(this.Ql).La(Pr(this.Mw)).us(this.getHighlight())}attach(t,e=!0){return ce(t,this.Ji,{stroke:this.jl}),super.attach(t,e)}ke(t,e){t.us(e),this.As.Ss()}dM(t,e,i,s){}zx(t,e,i=this.qb){const s=cu(t,e?this.nM.filter((t=>t.getIsUnderMouse())):this.nM,i?this.Iw:this.Vw,"nearest-x"===this.Mw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.Mw?(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=at(s[0],this.As.ls.ct,this.scale),e=s[1].Yl();return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,e.getFillStyle())}}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}}class Hc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.Gw={x:0,y:0,width:0,height:0},this.Ww={x1:0,y1:0,x2:0,y2:0},this.Ta=y(u(0,0),u(0,0)),this.Se=ye(r.rectangleSeriesFillStyle,n),this.As=t,this.HA=s,this.scale=e,this.xe=ye(r.rectangleSeriesStrokeStyle,n),this.be=this.RA(this.As._e(this.scale)).Me(this.Se).ve(this.xe)}getBoundaries(){return this.Ta}setDimensions(t){return"x"in t?(this.Gw=t,this.Ww={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.Ww=t,this.Gw={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.be.we(u(this.Gw.x,this.Gw.y)).q(u(this.Gw.width,this.Gw.height)),this.Ta=Xe([this.Gw,u(this.Gw.x+this.Gw.width,this.Gw.y+this.Gw.height)]),this.HA(),this.As.Ss(),this}getDimensionsPositionAndSize(){return this.Gw}getDimensionsTwoPoints(){return this.Ww}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.be.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.be.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}getDominantStyle(){return this.be.Th()}}class Uc extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Rectangle Series",this.$x=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.bs).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.YA=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Hc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){}add(t){const e=new Hc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}class Wc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.Uw=[],this.Ta=Fe,this.As=t,this.scale=e,this.HA=s,this.Se=ye(r.polygonSeriesFillStyle,n),this.xe=ye(r.polygonSeriesStrokeStyle,n),this.TM=this.RA(this.As.Cc(this.scale,sn.Simple)).ve(this.xe).Me(this.Se)}getBoundaries(){return this.Ta}setDimensions(t){return this.Uw=t,this.TM.tl(this.Uw),this.Ta=Xe(this.Uw),this.HA(),this.As.Ss(),this}getDimensions(){return this.Uw}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.TM.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.TM.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}getDominantStyle(){return this.TM.Th()}}class Xc extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Polygon Series",this.$x=(t,e,i)=>t.addRow(e.getName()),this.YA=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Wc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){if(!(t instanceof _i))throw new Error("PolygonSeries can only be attached to a pair of Linear Axes.")}add(t){const e=new Wc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}class Yc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Ta=y(u(0,0),u(0,0)),this.Ie=this.RA(this.As.De(this.scale)),this.Ji=r,this.As=t,this.scale=e,this.HA=s,this.Se=ye(r.segmentSeriesStrokeStyle,n),this.Ie.Pe(this.Se)}getBoundaries(){return this.Ta}setDimensions(t){return this.dimensions=t,this.Ie.Oe(u(t.startX,t.startY)).Be(u(t.endX,t.endY)),this.Ta=y(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.HA(),this.As.Ss(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Ie.Pe(this.Se),this.As.Ss(),this}getStrokeStyle(){return this.Se}getDominantStyle(){const t=this.Ie.Yl();return t!==st?t.getFillStyle():z}}class jc extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Segment Series",this.$x=(t,e,i)=>t.addRow(e.bs).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.YA=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Yc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){}add(t){const e=new Yc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}class Jc extends fc{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Ta=y(u(0,0),u(0,0)),this.$w=this.RA(this.As.Dc(this.scale)).$l(50),this.As=t,this.scale=e,this.HA=s,this.Se=ye(r.ellipseSeriesFillStyle,n),this.xe=ye(r.ellipseSeriesStrokeStyle,n),this.$w.Me(this.Se).ve(this.xe)}getBoundaries(){return this.Ta}setDimensions(t){return this.dimensions=t,this.$w.we(u(t.x,t.y)).Wl(t.radiusX).Hl(t.radiusY),this.Ta=y(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.HA(),this.As.Ss(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.$w.Me(this.Se),this.As.Ss(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.$w.ve(this.xe),this.As.Ss(),this}getStrokeStyle(){return this.xe}getDominantStyle(){return this.$w.Th()}}class $c extends gc{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.bs="Ellipse Series",this.$x=(t,e,i)=>t.addRow(e.bs).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.YA=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return at(i,this.scale,this.As.ls.ct)},this.Hw=c,this.$A=new Jc(this.As,this.scale,Et,Et,this.Ji,this.Hw).dispose()}Jv(t){if(!(t instanceof _i||t instanceof Li))throw new Error("EllipseSeries only supports Linear Axes")}add(t){const e=new Jc(this.As,this.scale,this.EA,this.HA,this.Ji,this.Hw).setDimensions(t);return this.NA(e),e}}function qc(t,e){return t===e?0:tthis.Wa(t))):this.Wa(t))}qw(t){return!!this.root&&(this.Jw(t),this.contentEquals(t,this.root.value))}Qw(t,e){return this.jw(((i,s)=>i&&t.call(e,s)),!0)}tk(t,e){return this.jw(((i,s)=>{t.call(e,s)}),void 0)}M(t){if(this.root&&(this.Jw(t),this.contentEquals(t,this.root.value)))return this.root}Wa(t){const e=new Kc(t);if(!this.root)return this.root=e,this.length+=1,e;if(this.Jw(t),!this.contentEquals(t,this.root.value)){const i=this.contentCompare(t,this.root.value);if(0===i)throw new Error(`SortedSet cannot contain incomparable but inequal values: ${t} and ${this.root.value}`);return i<0?(e.right=this.root,e.left=this.root.left,this.root.left=null,this.root.Xw()):(e.left=this.root,e.right=this.root.right,this.root.right=null,this.root.Xw()),e.Xw(),this.root=e,this.length+=1,e}}ik(t){if(this.root&&(this.Jw(t),this.contentEquals(t,this.root.value))){if(this.root.left){const{right:e}=this.root;this.root=this.root.left,this.Jw(t),this.root.right=e}else this.root=this.root.right;return this.length-=1,this.root&&this.root.Xw(),!0}return!1}sk(){if(this.root){let t=this.root;for(;t.right;)t=t.right;return t}}ek(){if(this.root){let t=this.root;for(;t.left;)t=t.left;return t}}hk(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)>0?this.root.Kw():this.root}rk(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)>=0?this.root.Kw():this.root}nk(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)>=0?this.root:this.root.Zw()}ak(t){if(this.root)return this.Jw(t),this.contentCompare(this.root.value,t)<=0?this.root.Zw():this.root}lk(t){t instanceof Array?t.forEach((t=>this.Wa(t))):this.Wa(t)}Jw(t){let e,i,s,r,n,o;if(this.root){for(e=new Kc,i=e,s=e,o=new Kc,n=this.root;;){const e=this.contentCompare(t,n.value);if(e<0){if(!n.left)break;if(this.contentCompare(t,n.left.value)<0&&(r=n.left,n.left=r.right,n.Xw(),r.right=n,r.Xw(),n=r,!n.left))break;r=new Kc,r.right=n,r.left=o.left,o.left=r,s.left=n,s.Xw(),s=n,n=n.left}else{if(!(e>0))break;if(!n.right)break;if(this.contentCompare(t,n.right.value)>0&&(r=n.right,n.right=r.left,n.Xw(),r.left=n,r.Xw(),n=r,!n.right))break;r=new Kc,r.left=n,r.right=o.right,o.right=r,i.right=n,i.Xw(),i=n,n=n.right}}for(i.right=n.left,i.Xw(),s.left=n.right,s.Xw(),n.left=e.right,n.right=e.left;o.left;)o.left.right.Xw(),o.left=o.left.left;for(;o.right;)o.right.left.Xw(),o.right=o.right.right;n.Xw(),this.root=n}}jw(t,e,i){return this.root&&(e=this.root.jw(t,e,0,i,this)),e}Yw(t,e,i){return this.root&&(e=this.root.Yw(t,e,this.length-1,i,this)),e}Ha(){this.root=null,this.length=0}uk(t,e){let i,s=this.ek();for(;s;){const r=this.ak(s.value);t.call(e,i?i.value:void 0,s.value,r?r.value:void 0),i=s,s=r}}ck(t,e,i){let s,r=this.ek(),n=0;for(;r;){const o=this.ak(r.value);e=t.call(i,e,s?s.value:void 0,r.value,o?o.value:void 0,n++,this),s=r,r=o}return e}}class td{constructor(t,e){this.key=t,this.value=e}equals(t){return Zc(this.key,t.key)&&Zc(this.value,t.value)}compare(t){return qc(this.key,t.key)}}class ed{constructor(t,e=Zc,i=qc){this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new Qc(void 0,((t,i)=>e(t.key,i.key)),((t,e)=>i(t.key,e.key))),t&&(Array.isArray(t)?t.forEach((t=>this.Wa(t.key,t.value))):this.Wa(t.key,t.value))}M(t){const e=this.store.M(new td(t,void 0));return e?e.value.value:void 0}S(t,e){const i=new td(t,e),s=this.store.M(i);if(s)return s.value.value=e,s;const r=this.store.Wa(i);return this.length+=1,r}Wa(t,e){return this.S(t,e)}qw(t){return this.store.qw(new td(t,void 0))}Ha(){this.store.Ha(),this.length=0}jw(t,e,i){return this.store.jw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}Yw(t,e,i){return this.store.Yw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}ik(t){const e=new td(t,void 0);return!!this.store.qw(e)&&(this.store.ik(e),this.length--,!0)}tk(t,e){return this.jw(((i,s,r)=>{t.call(e,s,r)}),void 0)}dk(t){return this.store.M(new td(t,void 0))||void 0}uk(t,e){let i,s=this.store.ek();for(;s;){const r=this.store.ak(s.value);t.call(e,i?i.value.value:void 0,s.value.value,r?r.value.value:void 0),i=s,s=r}}ck(t,e,i){let s,r=this.store.ek(),n=0;for(;r;){const o=this.store.ak(r.value);e=t.call(i,e,s?s.value.value:void 0,r.value.value,o?o.value.value:void 0,n++,this),s=r,r=o}return e}sk(){return this.store.sk()}ek(){return this.store.ek()}hk(t){return this.store.hk(new td(t,void 0))}rk(t){return this.store.rk(new td(t,void 0))}nk(t){return this.store.nk(new td(t,void 0))}ak(t){return this.store.ak(new td(t,void 0))}}const id={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},sd=(t,e)=>Math.min(t,e[3]),rd=(t,e)=>Math.max(t,e[2]),nd=(t,e)=>{const i=t.length;if(!(i<2))return[e,t[0].y,t.reduce(At,ke),t.reduce(Mt,Pe),t[i-1].y]},od=(t,e)=>{let i=[];const s=t.getDataIndices(),r=e.getDataIndices();return Array.isArray(s)?i=i.concat(s):i.push(s),Array.isArray(r)?i=i.concat(r):i.push(r),i},hd=(t,e)=>{if(t.length>0)return e>0?t[t.length-1]:t[0]},ad=(t,e,i)=>t.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i.getPosition())).addRow("Open","",i.getOpen().toFixed(2)).addRow("High","",i.getHigh().toFixed(2)).addRow("Low","",i.getLow().toFixed(2)).addRow("Close","",i.getClose().toFixed(2));class ld extends dc{constructor(t,i,s,r,n,o,h,a,l,u,d,f,g){super(t,i,s,r,n,o,h,a,d,f),this.bs="OHLC Series",this.fk=new ed,this.WA=y(c(Pe,Pe),c(ke,ke)),this.gk=0,this.pk=5,this.mk=id,this.Ql=void 0,this.yk=void 0,this.Sk=void 0,this.xk=!0,this.Ci=e.HighlightModes.onHover,this.$x=ad,this.bk=l,this.vk=u,this.Mk=new this.bk(this.As,this.scale,Et,!0,this.Ji).dispose(),this._k=new this.vk(this.As,this.scale,Et,!1,this.Ji).dispose()}Jv(t){if(!(t.x instanceof ki))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Ak=t.x}setStyle(t){return this.wk=t,this.kk(),this.As.Ss(),this}setPositiveStyle(t){return this.Ck=t,this.kk(),this.As.Ss(),this}setNegativeStyle(t){return this.Tk=t,this.kk(),this.As.Ss(),this}setFigureWidth(t){return this.pk=t,this.As.Ss(),this}getFigureWidth(){return this.pk}setFigureAutoFitting(t){return this.mk=t?id:void 0,this.As.Ss(),this}getFigureAutoFitting(){return void 0!==this.mk}Fk(t,e){return t-e/2<=this.scale.x.getInnerEnd()+.1*this.scale.x.getInnerInterval()&&this.scale.x.getInnerStart()-.1*this.scale.x.getInnerInterval()<=t+e/2}Ik(t,e,i,s){const r=(t=>t[4]>=t[1])(t),n=new(r?this.bk:this.vk)(this.As,this.scale,this.EA,r,this.Ji);return this.NA(n,s),this.Pk(n),this.ke(n,this.getHighlight()),n.dw(t[0],t[1],t[2],t[3],t[4],e).Ka(i),n}Dk(t){const e=this.gk;return this.gk+=1,this.fk.S(e,t),this.xk=!0,this.P.emit("dataAdd",this,[t],void 0),e}kk(){this.VA.forEach((t=>{this.wk&&this.wk(t),t.positive&&this.Ck?this.Ck(t):!t.positive&&this.Tk&&this.Tk(t)}))}Pk(t){this.wk&&this.wk(t),t.positive&&this.Ck?this.Ck(t):!t.positive&&this.Tk&&this.Tk(t)}Bk(t){return t*this.Ak.getPixelSize()}Ok(t){return t/this.Ak.getPixelSize()}Lk(t){if(!Array.isArray(t))return this.fk.M(t);if(this.fk.M(t[0])&&this.fk.M(t[t.length-1])){let e=0;const i=this.fk.M(t[0])[1];let s=ke,r=Pe;const n=this.fk.M(t[t.length-1])[4];for(let i=0;i1){const e=t>0?this.VA.length-1:0;this.VA[e].dispose()}let s;do{s=!1;const r=hd(this.VA,t);if(r){const n=r.getPosition(),o=r.getDataIndices();let h,a=("number"==typeof o?o:o[t>0?o.length-1:0])+t;const l=[],u=[];for(;;){const s=this.fk.M(a);if(!s)break;if(!this.Fk(s[0],e))break;if(h){if(Math.abs(n-s[0])>=1.5*i)break;t>0?h[4]=s[4]:h[1]=s[1],h[2]=Math.max(h[2],s[2]),h[3]=Math.min(h[3],s[3])}else h=s.slice();l.push(s[0]),t>0?u.push(a):u.splice(0,0,a),a+=t}if(h){const i=t>0?void 0:0;this.Ik(h,u,e,i),s=!0}}}while(s)}dM(t){var e;if(t&&"maxDataPointCount"in t){const e=t.maxDataPointCount;if(e&&this.fk.length>e){const t=this.gk-1,i=this.fk.store.ek();if(i){for(let s=t-e;s>=i.value.key;s-=1)this.fk.ik(s);let s=!0;this.WA.min.y=Pe,this.WA.max.y=ke;for(let i=1+t-e;i<=t;i+=1){const t=this.fk.M(i);t&&(this.WA.min.y=Math.min(this.WA.min.y,t[3]),this.WA.max.y=Math.max(this.WA.max.y,t[2]),s&&(this.WA.min.x=t[0],s=!1))}}}}else if(t&&"minDataPointCount"in t&&t.minDataPointCount){const i=t.minDataPointCount,s=this.scale.x.getInnerStart(),r=this.gk-1;let n=this.fk.store.ek();if(n){const t=n.value.key;let o;for(let t=n.value.key;t<=r&&!((null===(e=this.fk.M(t))||void 0===e?void 0:e[0])>=s);t+=1)o=t;if(void 0!==o&&o-t>=1e3&&this.fk.length-(o-t)>=i){for(let e=o;e>=t;e-=1)this.fk.ik(e);n=this.fk.store.ek();let e=!0;if(this.WA.min.y=Pe,this.WA.max.y=ke,n)for(let t=n.value.key;t<=r;t+=1){const i=this.fk.M(t);i&&(this.WA.min.y=Math.min(this.WA.min.y,i[3]),this.WA.max.y=Math.max(this.WA.max.y,i[2]),e&&(this.WA.min.x=i[0],e=!1))}}}}return this}setDataCleaning(t){return this.Ql=t,this.As.Ss(),this}om(){super.om(),this.dM(this.Ql);const t=this.Ak.getPixelSize(),e=this.yk,i=y(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),s=this.Sk,r=this.Bk(this.pk),n=!s||i.max-i.min!=s.max-s.min,o=this.VA.length;if(!s||i.min>s.min)for(let t=0;t=0;t-=1){const e=this.VA[t];if(this.Fk(e.getPosition(),r))break;e.dispose()}if(0===this.VA.length&&this.fk.length>0)for(let t=0;t0){const o=this.mk?r*this.mk.minGapNew:0;if((n||!s||i.mins.max)&&(this.Rk(1,r,o),this.xk=!0),this.mk){const i=r*this.mk.maxGapFuse,s=r*this.mk.minGapSplit;if(void 0===e||t!==e||this.xk){let t,e;do{t=!1;for(let e=0;e1){const o=i.getPosition(),h=e>0?this.VA[e-1]:void 0,a=e=1.5*s)&&(!a||a.getPosition()-o>=1.5*s)){t=!0,i.dispose();const s=n.length,o=Math.round(s/2),h=n.splice(o,s-o),a=this.Lk(n),l=this.Lk(h);void 0!==a&&this.Ik(a,n,r,e),void 0!==l&&this.Ik(l,h,r,e+1),e+=1}}}}while(t);do{e=!1;for(let t=0;tt.getIsUnderMouse()));return t&&{location:u(t.getPosition(),t.getClose()),scale:this.scale,resultTableContent:this.$x(new Ja,this,t).vc(),series:this,fillStyle:t.getDominantStyle(),ohlcSegment:t}}if(i>0){const e=((t,e,i)=>{if(tthis.VA[t].getPosition()));if(void 0===e)return;const s=this.VA[e];return{location:u(s.getPosition(),s.getClose()),scale:this.scale,resultTableContent:this.$x(new Ja,this,s).vc(),series:this,fillStyle:s.getDominantStyle(),ohlcSegment:s}}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}setCursorEnabled(t){return super.setCursorEnabled(t)}clear(){return this.fk.Ha(),this.xk=!0,this.WA.min.x=Pe,this.WA.min.y=Pe,this.WA.max.x=ke,this.WA.max.y=ke,this.P.emit("dataClear",this),super.clear()}getXMax(){return this.WA.max.x}getXMin(){return this.WA.min.x}getYMax(){return this.WA.max.y}getYMin(){return this.WA.min.y}ur(){return u(this.pk/2,0)}pM(){const t=[];return this.fk.tk((e=>{t.push(e)})),t}mM(t){return this.P.on("dataAdd",t)}yM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}xM(t){return this.P.off(t)}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Mk.getDominantStyle(),fill2:this._k.getDominantStyle(),behavior:{colorStep:!0}}),this}}class ud extends ld{add(t){if(t.length>0){if(Array.isArray(t[0])){const e=t;for(let t=0;t0&&this.getVisible()}}class cd extends ld{constructor(){super(...arguments),this.Jl=[]}Xm(){return this.Km&&(this.fk.length>0||this.Jl.length>0)&&this.getVisible()}add(t){Array.isArray(t)?this.addPoints(t):this.addPoint(t);const e=this.Jl[this.Jl.length-1];return this.uM=e?{x:e.x,y:e.y}:void 0,this}addPoint(t){return this.Jl.push(t),this.As.Ss(),this.WA.min.x=Math.min(this.WA.min.x,t.x),this.WA.max.x=Math.max(this.WA.max.x,t.x),this.WA.min.y=Math.min(this.WA.min.y,t.y),this.WA.max.y=Math.max(this.WA.max.y,t.y),this}addPoints(t){return t.length>0&&(this.Jl=this.Jl.concat(t),this.As.Ss(),this.WA.min.x=Math.min(this.WA.min.x,t[0].x),this.WA.max.x=Math.max(this.WA.max.x,t[t.length-1].x),this.WA.min.y=t.reduce(Mt,this.WA.min.y),this.WA.max.y=t.reduce(At,this.WA.max.y)),this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.uM?this.uM.x+e:0),this.add(au(t,e,s)),this}om(){if(this.dM(this.Ql),this.Jl.length>0){let t;if(void 0!==this.Ek)t=this.Ek;else{const e=this.mk?this.mk.minGapNew:1;t=this.Bk(this.pk*e)}const e=void 0!==this.zk?this.zk:this.Jl[0].x,i=((t,e,i)=>{const s=[],r=[];let n=!1;for(;t.length>0;){for(let o=0;o=i+e,n){const n=nd(r,i+e/2);void 0!==n&&(s.push(n),t.splice(0,r.length-1)),i+=e;break}}if(r.length=0,!n)break}return s})(this.Jl,t,e);if(i.length>0){for(let t=0;tt.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 gd extends gc{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,u,c),this.bs="Box Series",this.$x=fd,this.YA=t=>at(this.ws.toPoint((t.start+t.end)/2,t.median),this.scale,this.As.ls.ct),this.Vk=a,this.ws=l,this.$A=new this.Vk(this.As,this.scale,this.EA,this.ws,0,0,0,0,0,0,0,this.Ji).dispose()}Jv(t){if(!(t instanceof _i||t instanceof Li))throw new Error("BoxSeries only supports Linear Axes")}add(t){const e=new this.Vk(this.As,this.scale,this.EA,this.ws,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.Ji),i=e.boundaries;return this.WA=this.WA?je(this.WA,i):i,this.As.Ss(),this.NA(e),e}}class yd extends nu{constructor(){super(...arguments),this.nM=[],this.Jl=[],this.Nk=[],this.Gk=[],this.fM=1e3,this.oM=0,this.Ci=e.HighlightModes.onHover,this.nl={type:"disabled",packager:(t,e,i)=>t.slice()},this.qb=!0,this.Wk=[],this.Hk=[],this.Uk=!1,this.ld=()=>de(this.$k)||de(this.jk),this.Yk=t=>{const e=t.length;if(this.nM.length>0){const i=this.nM.length-1,s=this.nM[i];if(e>0){const[e,i]=s.Ea(),[r,n]=s.Ra();if((r?e.length+r.length:e.length)>=this.fM){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=ui(a,o,u(t[0].position,t[0].high)).y,c=ui(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.Wa(f,y(u(a,c),u(a,l))).bl(!0),this.Xk([f].concat(t)).Sl(!0)}else s.Wa(t)}}else e>0&&this.Xk(t)},this.Zk=t=>{const e=this.Wk,i=t.length;if(this.Wk.length>0){if(i>0){const i=e[e.length-1],s=i.Ea(),r=i.Ra();if(s.length+r.length>=this.fM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ui(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Wa(a,y(u(o,h),u(o,h))).bl(!0),e.push(this.Kk([a].concat(t),this.cM).Sl(!0))}else i.Wa(t)}}else i>0&&e.push(this.Kk(t))},this.qk=t=>{const e=this.Hk,i=t.length;if(this.Hk.length>0){if(i>0){const i=e[e.length-1],s=i.Ea(),r=i.Ra();if(s.length+r.length>=this.fM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ui(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Wa(a,y(u(o,h),u(o,h))).bl(!0),e.push(this.Jk([a].concat(t)).Sl(!0))}else i.Wa(t)}}else i>0&&e.push(this.Jk(t))},this.Qk=(t,e)=>{const i=t.ov(e);if(i)return[at(i[0],this.scale,this.As.ls.ct),at(i[1],this.scale,this.As.ls.ct)]},this.tC=(t,e)=>{const i=t.Pw(e);if(i)return[at(i[0],this.scale,this.As.ls.ct),at(i[1],this.scale,this.As.ls.ct)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.oM=void 0!==e&&e>0?e:0,this.As.Ss(),this}clear(){for(let t=0;tt+e.Ua()+e.$a()),this.Jl.length)}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.$x}getXMax(){return Ut(this.nM,zt,Math.max,Nt,this.cM)}getXMin(){return Ut(this.nM,Dt,Math.min,Vt,this.cM)}getYMax(){return Ut(this.nM,Rt,Math.max,Ht,this.cM)}getYMin(){return Ut(this.nM,Ot,Math.min,Gt,this.cM)}ur(){const t=u(0,0);for(const e of this.nM)t.x=Math.max(t.x,e.sl()),t.y=Math.max(t.y,e.el());return t}Xm(){return this.Km&&this.getPointAmount()>0&&this.getVisible()}Jv(t){}lM(t,e,i){this.Jl=he(this.Jl,t,{canReturnB:!1}),this.Nk=he(this.Nk,e,{canReturnB:!1}),this.Gk=he(this.Gk,i,{canReturnB:!1}),this.As.Ss()}iC(t,e,i,s){this.sC(e,i,s),this.lM(Array.isArray(t)?t:[t],e,i)}sC(t,e,i){const s=je(Xe(t),Xe(e));this.cM?this.cM=je(this.cM,s):this.cM=s,i&&(this.cM=je(this.cM,i))}Rw(){const t=this.nM.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.nM[this.nM.length-1]:void 0,i=e?e.Ea()[0].length+(e.Ra()[0]?e.Ra()[0].length:0):void 0;ou(t,i,this.fM,this.Yk)}hC(t){const e=this.Wk.length>0?this.Wk[this.Wk.length-1].Ea().length+this.Wk[this.Wk.length-1].Ra().length:void 0;ou(t,e,this.fM,this.Zk)}rC(t,e){const i=this.Wk.length>0?this.Wk[this.Wk.length-1].Ea().length+this.Wk[this.Wk.length-1].Ra().length:void 0;ou(t,i,this.fM,this.Zk),ou(e,i,this.fM,this.qk)}Xk(t,e){const i=this.As.nC(this.scale).Wa(t,e).Me(this.$k).ml(this.jk).fl(this.nl).us(this.getHighlight());return this.nM.push(i),this.cs(i),i}oC(t,e,i){const s=this.As.tm(this.scale,void 0,[Kh.UserSeries]).Wa(t,i).setMouseInteractions(!1).Pe(e).us(this.getHighlight());return this.cs(s),s}Kk(t,e){return this.oC(t,this.aC,e)}Jk(t,e){return this.oC(t,this.lC,e)}uC(t){this.$k="function"==typeof t?t(this.$k):t;const e=this.$k;for(let t=0;t0){const t=this.nM.length,e=this.Rw();this.dM(this.nM,this.fM,this.oM,e);const i=this.nM.length;this.Wk.length>0&&this.dM(this.Wk,this.fM,this.oM,e),this.Hk.length>0&&this.dM(this.Hk,this.fM,this.oM,e),t!==i&&this.rM(),this.Uk=!0}}Ae(){if(super.Ae(),this.Jl.length>0&&(this.eC(this.Jl),this.SC(this.Nk,this.Gk),this.Uk=!0),this.Uk){const t=this.getBoundaries();for(const e of this.nM)e.ko(t);for(const e of this.Wk)e.ko(t);for(const e of this.Hk)e.ko(t)}}om(){this.cM=void 0,this.Jl.length=0,this.Nk.length=0,this.Gk.length=0}zx(t,e,i=this.qb){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.nM,i?this.tC:this.Qk);if(void 0!==s&&void 0!==s[0]){const t=at(s[0][0],this.As.ls.ct,this.scale),e=at(s[0][1],this.As.ls.ct,this.scale);return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,e.y).vc(),this,s[1].Th())}}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}}const pd=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r));class md extends yd{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.bs="Area Series",this.$x=pd,this.xC=a}add(t){const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.bC(e),[i,s]=this.vC(t);this.iC(t,i,s,y(u(Pe,this.xC),u(ke,this.xC)));const r=this.Jl[this.Jl.length-1];this.uM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this.cM)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.uM?this.uM.position+e:0),this.add(au(t,e,s)),this}mM(t){return this.P.on("dataAdd",t)}yM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}xM(t){return this.P.off(t)}}class Sd extends md{constructor(){super(...arguments),this.lC=st}SC(t){return this.hC(t)}vC(t){const e=t.length,i=Array(e);for(let s=0;s=n){const t=d(r.x,r.y,n);if(0!==i&&Wt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=mi(u(ke,n),u(Pe,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}pM(){return hu(this.nM,(t=>t[0]||[]))}setFillStyle(t){return this.uC(t),this}getFillStyle(){return this.dC()}attach(t,e=!0){return ce(t,this.Ji,{fill:this.$k,stroke:this.aC}),super.attach(t,e)}}class bd extends Sd{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.$k=z,this.jk=ye(this.Ji.areaSeriesNegativeFillStyle,c),this.aC=ye(this.Ji.areaSeriesNegativeStrokeStyle,c)}bC(t){return this.wC(t)}wC(t){const e=[];return 1===t.length?this._C(t[0],e):this.AC(t,e),e}_C(t,e,i=0){const s=this.xC;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}AC(t,e,i=0){let s=0;const r=t.length-1,n=this.xC;for(;sn){const t=mi(u(ke,n),u(Pe,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&&Wt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=mi(u(ke,n),u(Pe,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}pM(){return hu(this.nM,(t=>t[1]))}setFillStyle(t){return this.cC(t),this}getFillStyle(){return this.yl()}attach(t,e=!0){return ce(t,this.Ji,{fill:this.jk,stroke:this.aC}),super.attach(t,e)}}class vd extends md{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.$k=ye(this.Ji.areaSeriesBipolarHighFillStyle,c),this.aC=ye(this.Ji.areaSeriesBipolarHighStrokeStyle,c),this.jk=ye(this.Ji.areaSeriesBipolarLowFillStyle,c),this.lC=ye(this.Ji.areaSeriesBipolarLowStrokeStyle,c)}bC(t){return this.kC(t)}SC(t,e){return this.rC(t,e)}kC(t){let e=0;const i=[],s=t.length,r=this.xC;return s>0&&(this.CC&&(this.CC.y<=r&&r<=t[0].y||this.CC.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.CC.x+t[0].x),r,r),e+=1),this.CC=t[s-1],1===s?this._C(t[0],i,e):this.AC(t,i)),i}_C(t,e,i=0){return e[i]=d(t.x,t.y,this.xC),i+1}AC(t,e){let i=0,s=0;const r=t.length-1,n=this.xC;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:Mo(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}vC(t){const e=t.length,i=Array(e),s=Array(e),r=this.xC;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.uC(t),this}setNegativeFillStyle(t){return this.cC(t),this}setPositiveStrokeStyle(t){return this.fC(t),this}setNegativeStrokeStyle(t){return this.gC(t),this}getPositiveFillStyle(){return this.dC()}getNegativeFillStyle(){return this.yl()}getPositiveStrokeStyle(){return this.pC()}getNegativeStrokeStyle(){return this.mC()}attach(t,e=!0){return ce(t,this.Ji,{fill:this.$k,fill2:this.jk,behavior:{colorStep:!0}}),super.attach(t,e)}}const Md={Positive:xd,Negative:bd,Bipolar:vd},Ad=(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 wd extends yd{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.bs="Area Range Series",this.$x=Ad;const c=u;this.$k=ye(this.Ji.areaRangeSeriesFillStyle,c),this.aC=ye(this.Ji.areaRangeSeriesStrokeStyle,c),this.jk=ye(this.Ji.areaRangeSeriesFillStyleInverted,c),this.lC=ye(this.Ji.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.iC(t,i,s);const r=this.Jl[this.Jl.length-1];return this.uM=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this.cM),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.uM?this.uM.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=t.zx(e);if(i)return at(i,this.scale,this.As.ls.ct)},this.uv=a,this.Se=ye(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ld(){return de(this.Se)}Jv(t){}attach(t,e=!0){return ce(t,this.Ji,{fill:this.Se}),super.attach(t,e)}ke(t,e){t.us(e),this.As.Ss()}setPointFillStyle(t){this.Se="function"==typeof t?t(this.Se):t;const e=this.Se;for(let t=0;tt.getIsUnderMouse())):this.nM,this.Fw,Ne);if(void 0!==i){const t=at(i[0],this.As.ls.ct,this.scale),e=i[1].Th(),s=H(e)?i[0].color?new V({color:i[0].color}):new V({color:e.getFallbackColor()}):e;return ll(t,this.scale,this.$x(new Ja,this,t.x,t.y,t).vc(),this,s)}}solveNearestFromScreen(t){return this.zx(Yo(t,this.Ki.ls),!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class Ed{constructor(t,e,i,s){this.TC=!1,this.P=new r.Eventer,this.chart=i,this.FC=s,this.Hs=t.Hs,this.Ks=s||Fs,this.IC=xt.document.createElement("div"),this.IC.style.position="absolute",this.IC.style.pointerEvents="none",xt.document.body.append(this.IC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.IC.style.left=`${t.left}px`,this.IC.style.top=`${t.top}px`,this.IC.style.width=`${t.width}px`,this.IC.style.height=`${t.height}px`};n(),i.onResize(n),this.PC(this.IC),this.DC(),this.BC(),this.OC(),this.LC(e),this.chart.RC().push(this)}PC(t){this.EC=xt.document.createElement("div"),this.EC.style.pointerEvents="all",t.append(this.EC),this.zC=xt.document.createElement("div"),this.VC=new Ms(this.Hs,this.Ks,this.chart,this.zC),this.NC=xt.document.createElement("table"),this.NC.style.borderSpacing="0",this.EC.appendChild(this.VC.he()),this.EC.appendChild(this.zC),this.zC.appendChild(this.NC)}BC(){let t=0,e=0,i=0,s=0,r=!1;this.TC=!1,this.EC.onmousedown=n=>{n=n||xt.event,i=n.clientX,s=n.clientY,r=!0,xt.document.onmouseup=t=>{this.TC?this.EC.addEventListener("click",Kt,!0):this.EC.removeEventListener("click",Kt,!0),r=!1,this.TC=!1,xt.document.onmouseup=null,xt.document.onmousemove=null},xt.document.onmousemove=n=>{n=n||xt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.TC=!0,this.EC.style.top=this.EC.offsetTop-e+"px",this.EC.style.left=this.EC.offsetLeft-t+"px",this.EC.style.removeProperty("right"),this.EC.style.removeProperty("bottom"))}}}OC(){let t=0,e=0,i=0,s=0,r=!1;this.EC.ontouchstart=n=>{n=n||xt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.EC.ontouchend=()=>{r=!1,xt.document.ontouchend=null,xt.document.ontouchmove=null},this.EC.ontouchmove=n=>{r&&(Kt(n),n=n||xt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.EC.style.top=this.EC.offsetTop-e+"px",this.EC.style.left=this.EC.offsetLeft-t+"px",this.EC.style.removeProperty("right"),this.EC.style.removeProperty("bottom"))}}}DC(){this.EC.style.setProperty("top","10px"),this.EC.style.setProperty("left","10px"),this.EC.style.position="absolute",this.EC.style.display="flex",this.EC.style.alignItems="flex-start",this.zC.style.setProperty("display","none")}removePositionProperty(){this.EC.style.removeProperty("top"),this.EC.style.removeProperty("left"),this.EC.style.removeProperty("bottom"),this.EC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.EC.style.setProperty("bottom","10px"),this.EC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.EC.style.setProperty("top","10px"),this.EC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.EC.style.setProperty("bottom","10px"),this.EC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.EC.style.setProperty("top","10px"),this.EC.style.setProperty("right","10px")}}LC(t){for(let e=0;et.addRow(e.getName()).addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1));class Cd extends nu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.bs="Heatmap Grid Series",this.$x=Id,this.qb=!1,this.HC=a,this.Ji=l;const d=c;this.Se=ye(l.heatmapGridSeriesFillStyle,d),this.lu=ye(this.Ji.heatmapGridSeriesWireframeStyle,d);const f=a.start||{x:0,y:0},g=a.end?{x:(a.end.x-f.x)/a.columns,y:(a.end.y-f.y)/a.rows}:a.step||{x:1,y:1},y={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows,start:f,step:g};this._n=y,this.UC=this.As.$C(this.scale,[],y).Me(this.Se).uu(this.lu).us(this.getHighlight()),this.cs(this.UC),this.setHighlightOnHover(!1)}clear(){return this.UC.Ha(),this.As.Ss(),this.P.emit("dataClear",this),this}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.UC.uu(this.lu),this.As.Ss(),this.P.emit("styleChange",this),this}getWireframeStyle(){return this.lu}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.UC.uS(t),this.As.Ss(),this.P.emit("styleChange",this),this}getIntensityInterpolation(){return this.UC.cS()}Xm(){return this.Km&&this.getVisible()}ld(){return de(this.Se)}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}jC(t){this.UC.jC().forEach((e=>{t.UC.dS(e)}))}xM(t){return this.P.off(t)}SM(t){return this.P.on("dataClear",t)}YC(t){return this.P.on("styleChange",t)}XC(t){return this.P.off(t)}zx(t,e,i=this.qb){const s=at(t,this.As.ls.ct,this.scale),r=e?this.UC.getIsUnderMouse()?this.UC:void 0:this.UC;if(!r)return;const n=i?r.tv(s):r.zx(s);return n?ll(n,this.scale,this.$x(new Ja,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).vc(),this):void 0}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}getXMax(){const t=this.UC;return t?t._t():void 0}getXMin(){const t=this.UC;return t?t.Mt():void 0}getYMax(){const t=this.UC;return t?t.wt():void 0}getYMin(){const t=this.UC;return t?t.At():void 0}ur(){const t=u(0,0);return t.x=Math.max(t.x,this.UC.sl()),t.y=Math.max(t.y,this.UC.el()),t}Jv(t){if(!(t instanceof _i))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.ni())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}ke(t,e){t.us(e),this.As.Ss()}Ae(){return super.Ae(),this.UC.ko(this.getBoundaries()),this}}class Pd extends Cd{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.$x=Id}invalidateIntensityValues(t){if(Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this._n.dataOrder?t.length:t[0].length,rows:"rows"===this._n.dataOrder?t.length:t[0].length},i="columns"===this._n.dataOrder?this._n.columns:this._n.rows,s="columns"===this._n.dataOrder?this._n.rows:this._n.columns;if(e.x>i||e.y>s){if(!0===this.chart.ff.Pn){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this._n.columns}x${this._n.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.ff.Pn){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this._n.columns}x${this._n.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.`;xt.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.UC.dS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.P.emit("invalidateIntensity",this,t),this.As.Ss(),this}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.UC.Me(this.Se),this.P.emit("styleChange",this),this.As.Ss(),this}getFillStyle(){return this.Se}setCursorResultTableFormatter(t){return this.$x=t,this.Ki.ls.Ss(),this}getCursorResultTableFormatter(){return this.$x}ZC(t){return this.P.on("invalidateIntensity",t)}KC(t){return this.P.off(t)}}class kd extends nu{constructor(t,e,i,s,r,n,o,h,a,l,u,c){super(t,e,i,s,r,n,o,h,l,u),this.bs="Scrolling Heatmap Grid Series",this.$x=Id,this.qb=!1;const d=c;this.Se=ye(l.heatmapScrollingGridSeriesFillStyle,d),this.lu=ye(this.Ji.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",start:{x:0,y:0},step:{x:1,y:1},...a};this._n=f;const g=[{type:"DataPattern",args:{pattern:"columns"===f.scrollDimension?f.step.x>0?"ProgressiveX":"RegressiveX":f.step.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}];this.qC=this.As.JC(this.scale,g,f).Me(this.Se).uu(this.lu).us(this.getHighlight()),this.cs(this.qC),this.setHighlightOnHover(!1)}clear(){return this.qC.Ha(),this.As.Ss(),this}setWireframeStyle(t){return this.lu="function"==typeof t?t(this.lu):t,this.qC.uu(this.lu),this.As.Ss(),this}getWireframeStyle(){return this.lu}setPixelInterpolationMode(t){return t=t||"disabled",this.qC.uS(t),this.As.Ss(),this}getPixelInterpolationMode(){return this.qC.cS()}setCursorInterpolationEnabled(t){return this.qb=t,this.As.ls.Ss(),this}getCursorInterpolationEnabled(){return this.qb}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.qC.tu(t),this.As.Ss(),this}Xm(){return this.Km&&this.getVisible()}ld(){return de(this.Se)}attach(t,e){return super.attach(t,e),ce(t,this.Ji,{fill:this.Se}),this}Me(t){return this.Se="function"==typeof t?t(this.Se):t,this.qC.Me(this.Se),this.As.Ss(),this}zx(t,e,i=this.qb){const s=at(t,this.As.ls.ct,this.scale),r=e?this.qC.getIsUnderMouse()?this.qC:void 0:this.qC;if(!r)return;const n=i?r.tv(s):r.zx(s);return n?ll(n,this.scale,this.$x(new Ja,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).vc(),this):void 0}solveNearestFromScreen(t,e=this.qb){return this.zx(Yo(t,this.Ki.ls),!1,e)}Jv(t){if(!(t instanceof _i))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof _i&&t.ni())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.qC._t()||0}getXMin(){return this.qC.Mt()||0}getYMax(){return this.qC.wt()||0}getYMin(){return this.qC.At()||0}ur(){const t=u(0,0);return t.x=Math.max(t.x,this.qC.sl()),t.y=Math.max(t.y,this.qC.el()),t}ke(t,e){t.us(e),this.As.Ss()}}class Fd extends kd{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.$x=Id}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this._n.scrollDimension?t.length:t[0].length,"rows"===this._n.scrollDimension?t.length:t[0].length,0+i-1),r=this._n.resolution-1;if(s>r){if(!0===this.chart.ff.Pn){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this._n.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;xt.console.warn(t)}const s=[];for(let i=0;i(e,i)=>t.forEach((t=>t.forEach((t=>{t.ct.q(e),t.og.q(i)})))),_d=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},Ld=u(10,10);var Dd;e.AxisPosition=void 0,(Dd=e.AxisPosition||(e.AxisPosition={}))[Dd.Top=0]="Top",Dd[Dd.Bottom=1]="Bottom",Dd[Dd.Left=2]="Left",Dd[Dd.Right=3]="Right";const zd=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Od=t=>t.cr(),Rd=t=>t.setStopped(!0),Vd=t=>t.getChartInteractionFitByDrag()?t.fit(!0).setStopped(!1):void 0,Nd=(t,e)=>{const i="linear-highPrecision"===t.xh.type||"linear-highPrecision"===e.xh.type,s="logarithmic"===t.xh.type||"logarithmic"===e.xh.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.xh.type}, y: ${e.xh.type})`;throw new Error(i)}};var Gd,Hd,Ud;!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"}(Gd||(Gd={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Hd||(Hd={}));class Wd extends Sl{constructor(t,i,s,r,n,o,h){super(t,i,s,i.hp("chartXY bg",0),r,i.ls.Ji.chartXYBackgroundFillStyle,i.ls.Ji.chartXYBackgroundStrokeStyle,i.ls.Ji.chartXYTitleFont,i.ls.Ji.chartXYTitleFillStyle,h),this.QC=this.Ug.d2({scaleXYConstructor:_i}),this.tT=[],this.iT=[],this.sT=[],this.eT=[],this.hT=new Map,this.rT=!0,this.nT=!0,this.oT=!0,this.zd=2,this.aT=!0,this.lT=!0,this.uT=[],this.cT=this.np._e(this.QC).Me(z).ve(st).setMouseInteractions(!1),this.dT=this.np.De(this.QC).Pe(st).setMouseInteractions(!1),this.fT=this.np.De(this.QC).Pe(st).setMouseInteractions(!1),this.gT=this.Ji.chartXYZoomingRectangleFillStyle,this.pT=this.Ji.chartXYZoomingRectangleStrokeStyle,this.mT=this.Ji.chartXYFittingRectangleFillStyle,this.yT=this.Ji.chartXYFittingRectangleStrokeStyle,this.ST=e.MouseStyles.Default,this.xT=e.MouseStyles.Move,this.bT=e.MouseStyles.ZoomIn,this.vT=e.MouseStyles.Default,this.MT=void 0,this._T=Xd,this.qv=0,this.AT=Bd(this.iT,this.tT),this.wT=Bd(this.sT,this.eT),this.kT=(t,e,i,s,r)=>{this.AT(s,r),this.wT(r,s),this.QC.q(s,r);const n=this.iT.map((t=>t.Dg())),o=this.tT.map((t=>t.Dg())),h=this.sT.map((t=>t.Dg())),a=this.eT.map((t=>t.Dg())),l=n.reduce(Oe,0),c=o.reduce(Oe,0),d=h.reduce(Oe,0),f=a.reduce(Oe,0),g=this.CT(d,f,c,l),y=this.QC.x.getCellSize()-(g.left+g.right),p=this.QC.y.getCellSize()-(g.bottom+g.top),m=[g.left,g.right],S=[g.bottom,g.top];this.QC.x.Z(0,y),this.QC.y.Z(0,p),this.QC.Si(m),this.QC.xi(S),this.Fy.q(u(y,p));for(let t=0;t{this.hT.set(t,e)},this.ig=t=>{this.iT.includes(t)?_d(this.iT,t):this.tT.includes(t)?_d(this.tT,t):this.sT.includes(t)?_d(this.sT,t):this.eT.includes(t)&&_d(this.eT,t),this.hT.delete(t),this.ls.Ss()},this.FT=(t=!1)=>{const e=t=>(e,i,s,r)=>(i.Ae(e,s,r.length),e+i.Dg()*t),i=this.iT.reduce(e(-1),0),s=this.tT.reduce(e(1),0),r=this.sT.reduce(e(-1),0),n=this.eT.reduce(e(1),0),o=this.CT(r,n,s,i),h=this.QC.x.getCellSize()-(o.left+o.right),a=this.QC.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.QC.x.Z(0,h),this.QC.y.Z(0,a),this.QC.x.zt(l),this.QC.y.zt(c);for(const t of this.iT)t.ct.zt(l);for(const t of this.tT)t.ct.zt(l);for(const t of this.sT)t.ct.zt(c);for(const t of this.eT)t.ct.zt(c);if((!this.ZM||Math.abs(this.ZM.bottom-i)>=4||Math.abs(this.ZM.left-r)>=4||Math.abs(this.ZM.right-n)>=4||Math.abs(this.ZM.top-s)>=4)&&!t)return void this.FT(!0);this.ZM={bottom:i,left:r,top:s,right:n},this.Fy.we(u(0,0)).q(u(h,a)),this.Iy.we(u(0,0)).q(u(h,a));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=p(d.ct.Vt(),f.ct.Vt(),d.ct.Gt(),f.ct.Gt());this.hb.kS(g),this.Qf.kS(g),this.tg.kS(g),this.zg&&this.zg();const y=t=>(e,i,s,r)=>(i.Pg(e),e+i.Dg()*t);return this.iT.reduce(y(-1),0),this.tT.reduce(y(1),0),this.sT.reduce(y(-1),0),this.eT.reduce(y(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Nd(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Md.Positive)(this,this.Ay,this.hb,e,i,this.IT(e),this.IT(i),this.Yg,s,this.Ji,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length);return this.Py(r),r},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Nd(e,i);const s=new wd(this,this.Ay,this.hb,e,i,this.IT(e),this.IT(i),this.Yg,this.Ji,this.ls.ss,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.My.length);return this.Py(s),s},this.PT=!1,this.DT=!1,this.Qv=()=>{(this.rT||this.nT)&&(this.MT=this.engine.setMouseStyle(this.ST))},this.tM=()=>{this.PT=!1,this.engine.restoreMouseStyle(this.MT)},this.iM=(t,e,i)=>{var s,r;const n=Lt(null===(s=this.ff.In)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Lt(null===(r=this.ff.In)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.MT);const h=this.np.ls.Ce(e.clientX,e.clientY);i===n&&(this.rT||this.nT)?(this.BT(t,h),Kt(e)):i===o&&this.aT&&(this.MT=this.engine.setMouseStyle(this.xT),this.DT=!0,Kt(e))},this.Qm=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Lt(null===(n=this.ff.In)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Lt(null===(o=this.ff.In)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.rT||this.nT)?(this.OT(t,s,h),Kt(e)):i===l&&this.aT&&(this.LT(si(r,-1)),Kt(e)),this.ls.Ss()},this.sM=(t,e,i,s)=>{var r,n;const o=Lt(null===(r=this.ff.In)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Lt(null===(n=this.ff.In)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.rT||this.nT)){const i=u(e.clientX,e.clientY);this.RT(t,s,i),Kt(e)}else i===h&&this.aT&&Kt(e);this.engine.restoreMouseStyle(this.MT),this.Fy.getIsUnderMouse()&&(this.MT=this.engine.setMouseStyle(this.ST)),this.PT=!1,this.DT=!1},this.Jm=(t,e)=>{if(this.oT){const t=this.np.ls.Ce(e.clientX,e.clientY);this.ET(t,u(pe(e),pe(e))),Kt(e)}},this.zT=(t,e,i,s)=>{},this.VT=(t,e,i,s,r,n)=>{if(this.aT){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.LT(t),Kt(n),this.DT=!0}if(this.oT){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=ni(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.dt(t.ct.Jt(t.getInterval().start,-h.x),t.ct.Jt(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.dt(t.ct.Jt(t.getInterval().start,-h.y),t.ct.Jt(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Kt(n),this.PT=!0}},this.NT=(t,e,i,s)=>{this.DT=!1,this.PT=!1},this.GT=(t,e,i)=>{(this.nT||this.rT)&&(this.BT(t,e),Kt(i))},this.WT=(t,e,i,s,r)=>{(this.nT||this.rT)&&(this.OT(t,e,i),Kt(r))},this.HT=(t,e,i,s)=>{(this.nT||this.rT)&&(this.RT(t,e,i),Kt(s))},this.ff.wn||this.ff.An||this.ls.Mn(0),this.setPadding({right:24}),this.WM=i.OS("chartXY series bg",Gd.seriesBackground),this.UT=[Gd.gridLine0,Gd.gridLine1,Gd.gridLine2].map((t=>i.OS(`chartXY gridline #${t}`,t))),this.Qf=i.OS("chartXY highlighters below",Gd.highlightersBelow),this.hb=i.Hp("chartXY plotting",Hd.plotting),this.tg=i.Hp("chartXY highlighters above",Hd.highlightersAbove),this._f=i.Hp("chartXY fg",Hd.fg),this.QC.x.Z(0,this.uiScale.x.getCellSize()-(this.Ft.left+this.Ft.right+this.Qo.left+this.Qo.right)),this.QC.y.Z(0,this.uiScale.y.getCellSize()-(this.Ft.bottom+this.Ft.top+this.Qo.bottom+this.Qo.top)),this.QC.q(this.uiScale.Ht().x,this.uiScale.Ht().y),this.Fy=this.WM._e(this.QC).Me(this.Ji.chartXYSeriesBackgroundFillStyle).ve(st),this.Iy=this.tg._e(this.QC).Me(z).ve(this.Ji.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Ty(this.Fy,this.Iy),this.setSeriesBackgroundEffect(!1);const a=Lt(o?o.autoCursorBuilder:void 0,Zl);this.Ex=a.Tx(this.Dx,this.QC,this.QC,this.Ji),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.kT),this.ap.Ch("ChartXY"),this.ty=Wi(new Yi(this.GT,this.WT,this.HT,1),new ji(this.zT,this.VT,this.NT)),this.onSeriesBackgroundMouseEnter(this.Qv),this.onSeriesBackgroundMouseLeave(this.tM),this.onSeriesBackgroundMouseWheel(this.Jm),this.onSeriesBackgroundMouseDragStart(this.iM),this.onSeriesBackgroundMouseDrag(this.Qm),this.onSeriesBackgroundMouseDragStop(this.sM),this.onSeriesBackgroundTouchStart(this.ty.onTouchStart),this.onSeriesBackgroundTouchMove(this.ty.onTouchMove),this.onSeriesBackgroundTouchEnd(this.ty.onTouchEnd),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.ep(n,this.QC)}get coordsAxis(){return{x:this.getDefaultAxisX(),y:this.getDefaultAxisY()}}getSeries(){return this.My}getMinimumSize(){const t={x:0,y:0};t.x+=this.Ft.left+this.Ft.right+this.Qo.left+this.Qo.right,t.y+=this.Ft.top+this.Ft.bottom+this.Qo.top+this.Qo.bottom;const e=this.ap.Ts().Ic(),i=b(Yd(this._T||Xd),this.rp);t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom;const s={x:0,y:0};return this.forEachAxisX((t=>{s.x=Math.max(s.x,t.Dg())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.Dg())})),t.x+=s.x,t.y+=s.y,t.x+=Ld.x,t.y+=Ld.y,t}addChartMarkerXY(t=Kl,e,i){const s=this.Yg(),r=new su(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.Wg(s),this.Ji);return this.tp(r),r}addAxisX(t){const{opposite:e,type:i}=jo(t);let s;s="linear"===i.type?this.Ug.d1({dimension:"x",scale1DConstructor:ki}):"linear-highPrecision"===i.type?this.Ug.d1({dimension:"x",scale1DConstructor:ki}).ri():this.Ug.d1({dimension:"x",scale1DConstructor:vi}).Kt(i.base),s.q(this.QC.x.Ht());const r=e?this.tT:this.iT,n=new Zo(this.Qf,this.UT,this._f,this.np,this.Qf,this.tg,this.ls.ss,s,this.QC.y,(o=()=>n.Ag(),{...Ko,...lc(o)}),this,e?100:0,this.ig,this.TT,this.Ji,!this.Ze,i);var o;return r.push(n),this.ls.Ss(),n}addAxisY(t){const{opposite:e,type:i}=jo(t);let s;s="linear"===i.type?this.Ug.d1({dimension:"y",scale1DConstructor:ki}):"linear-highPrecision"===i.type?this.Ug.d1({dimension:"y",scale1DConstructor:ki}).ri():this.Ug.d1({dimension:"y",scale1DConstructor:vi}).Kt(i.base),s.q(this.QC.y.Ht());const r=e?this.eT:this.sT,n=new Zo(this.Qf,this.UT,this._f,this.np,this.Qf,this.tg,this.ls.ss,s,this.QC.x,(o=()=>n.Ag(),{...Qo,...uc(o)}),this,e?100:0,this.ig,this.TT,this.Ji,!this.Ze,i);var o;return r.push(n),this.ls.Ss(),n}dispose(){return this.WM.G(),this.hb.G(),this._f.G(),this.UT.forEach((t=>t.G())),this.tg.G(),this.Qf.G(),this.RC().forEach((t=>t.dispose())),zh(this.QC),this.forEachAxis((t=>{t.dispose()})),this.My.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return this.iT[0]?this.iT[0]:this.tT[0]}getDefaultAxisY(){return this.sT[0]?this.sT[0]:this.eT[0]}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):zd;return Pt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.tT;case e.AxisPosition.Bottom:return this.iT;case e.AxisPosition.Left:return this.sT;case e.AxisPosition.Right:return this.eT}})))}$T(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.iT.slice().forEach(t),this.tT.slice().forEach(t)}forEachAxisY(t){this.sT.slice().forEach(t),this.eT.slice().forEach(t)}setTitlePosition(t){return this._T=t,this.ls.Ss(),this}getTitlePosition(){return this._T}CT(t,e,i,s){const r=this._T||Xd;let n,o=b(Yd(r),this.rp);this.getTitleFillStyle()===z||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.ap.Ts().Ic();const h=Math.abs(s)+this.Qo.bottom+this.Ft.bottom,a=Math.abs(i)+this.Qo.top+this.Ft.top,l={left:Math.abs(t)+this.Qo.left+this.Ft.left,right:Math.abs(e)+this.Qo.right+this.Ft.right,top:a,bottom:h},u=this.uiScale.Ai(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=jd(r,u,l,n,o,this.Qo);return this.ap.we(f).ga(c).ma(d),g}Ae(t){super.Ae(t);for(const t of this.My)t.ey();for(const t of this.My)t.Ae();this.forEachAxis(Od);let e=!1;this.forEachAxis((t=>{(t.mr()||t.yr())&&(e=!0)}));const i=this.PT||this.DT||!this.lT&&e;this.Vx(i),this.FT(),super.sp();for(const t of this.My)t.om()}Y(){for(let t=0;t=10;n&&a&&o.x===s.x&&this.rT?(this.PT=!0,this.cT.Me(this.gT).ve(this.pT),this.dT.Pe(st),this.fT.Pe(st),this.MT=this.engine.setMouseStyle(this.bT,this.MT)):n&&a&&h.x===s.x&&this.nT?(this.PT=!0,this.cT.Me(this.mT).ve(this.yT),this.dT.Pe(this.yT).Oe(s).Be(r),this.fT.Pe(this.yT).Oe(u(s.x,r.y)).Be(u(r.x,s.y)),this.MT=this.engine.setMouseStyle(this.vT,this.MT)):(this.PT=!1,this.cT.ve(st).Me(z),this.dT.Pe(st),this.fT.Pe(st),this.engine.restoreMouseStyle(this.MT)),this.ls.Ss()}RT(t,e,i){if(this.PT){const t=at(this.engine.clientLocation2Engine(i.x,i.y),this.np.ls.ct,this.QC),s=Ve(t.x,this.QC.x.getInnerStart(),this.QC.x.getInnerEnd())&&Ve(t.y,this.QC.y.getInnerStart(),this.QC.y.getInnerEnd()),r=i.x>=e.x?"zoom":"fit",n=this.cT.ca(),o=ri(n,this.cT.Ht()),h=Math.min(this.cT.Ht().x,this.cT.Ht().y)>=10;s&&h&&"zoom"===r&&this.rT?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=at(n,this.QC,t.ag).x,i=at(o,this.QC,t.ag).x;t.dt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=at(n,this.QC,t.ag).y,i=at(o,this.QC,t.ag).y;t.dt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.nT&&this.forEachAxis(Vd)}this.cT.ve(st).Me(z),this.dT.Pe(st),this.fT.Pe(st),this.ls.Ss()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}LT(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(Rd),this.forEachAxisX((i=>{i.zoom(i.ct.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ct.ot(t.y),e.y)}))}ET(t,e){this.forEachAxis(Rd),this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&i.zoom(i.ct.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&i.zoom(i.ct.ot(t.y),e.y)}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}Sd(){const t=[];return this.forEachAxis((e=>e.bg((e=>t.push(e))))),super.Sd().concat(t)}RC(){return this.uT}fe(){return this.up(this.hb)}setAutoCursorEnabledDuringAxisAnimation(t){return this.lT=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.lT}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}translateCoordinate(t,e,i){if(i){const s=t,r=e,n=th(r)?r:Ri(r)?this.pixelScale:void 0;if(n&&zi(i)){const t=at(s,n,this.engine.scale);return this.ls.fo({engineX:t.x,engineY:t.y})}if(n&&Ri(i))return at(s,n,this.pixelScale);if(n&&th(i))return at(s,n,i)}else{const i=t;if(Ri(e)){const t=this.ls.do(i);return at({x:t.engineX,y:t.engineY},this.engine.scale,this.pixelScale)}if(th(e)){const t=e,s=this.ls.do(i);return at({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,(Ud=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Ud.RightTop="right-top",Ud.LeftTop="left-top",Ud.CenterBottom="center-bottom",Ud.RightBottom="right-bottom",Ud.LeftBottom="left-bottom",Ud.SeriesCenterTop="series-center-top",Ud.SeriesRightTop="series-right-top",Ud.SeriesLeftTop="series-left-top",Ud.SeriesCenterBottom="series-center-bottom",Ud.SeriesRightBottom="series-right-bottom",Ud.SeriesLeftBottom="series-left-bottom";const Xd=e.ChartXYTitlePositionOptions.CenterTop,Yd=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 Me(0,`Unexpected ChartXY title position selection ${t}`)},jd=(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 Me(0,`Unexpected ChartXY title position selection ${t}`)},Jd=t=>t instanceof uu||t instanceof md||t instanceof wd||t instanceof Pd||t instanceof ld||t instanceof Nc;class $d{constructor(t,i,s,n,o,h,a,l,u){this.coordsRelative="relative",this.coordsClient="client",this.P=new r.Eventer,this.jT=new Map,this.My=new Map,this.YT=({series:t},e)=>{this.XT&&(e instanceof wd||e instanceof Nc||e instanceof Pd||e instanceof uu||e instanceof md||e instanceof ld)&&this.XT(t,e)},this.ZT=t=>{const e=t.map((t=>t.xh.type));if(1!==[...new Set(e)].length)throw new Error("All ZoomBandChart axes must be of the same type")},this.KT=(t,e,i)=>{0!==this.My.size&&void 0!==[...this.My.values()].find((({series:t})=>!0===t.getVisible()))||this.qT.dt(e,i,!1,!1,"zoomBandChart")},this.ff=t,this.JT=n,this.attachedAxes=Array.isArray(o)?o:[o],this.ZT(this.attachedAxes);const c=this.attachedAxes[0].chart.$T(this.attachedAxes[0])||"x";this.QT=c,this.fc="x"===c?Ko:Qo;const d=this.attachedAxes[0].onIntervalChange(this.KT);this.tF=()=>this.attachedAxes[0].offIntervalChange(d);const f=this.fc.toVec2("linear"===(g=this.attachedAxes[0].xh).type||"linear-highPrecision"===g.type?g:{type:"logarithmic",base:"number"==typeof g.base?g.base:"e"===g.base?"e":(()=>{throw new Error(`Unhandled logarithmic base: ${g.base}`)})()},void 0);var g;const y=f.x,p=f.y;this.iF=new Wd(t,i,s,Et,a,{...l,defaultAxisX:y,defaultAxisY:p},u).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.iF.engine;const m=this.iF.getDefaultAxisX().setMouseInteractions(!1),S=this.iF.getDefaultAxisY().setMouseInteractions(!1);this.qT=this.fc.getWidth({x:m,y:S}).setScrollStrategy(zs.fitting).setAnimationScroll(!1),this.sF(this.fc.getHeight({x:m,y:S})),this.qT.Eh(this.attachedAxes[0].Rh()),this.band=this.qT.addBand(h),this.eF(this.band,this.attachedAxes);for(let t=0;t{t.chart.Ox(((t,e)=>{("x"===c?e.axisX:e.axisY)===this.attachedAxes[0]&&Jd(e)&&this.sf(e)})),t.chart.Lx(((t,e)=>{var i;if(this.My.has(e)){const t=null===(i=this.My.get(e))||void 0===i?void 0:i.series;t&&t.dispose()}}))}))}disposeSeries(t){const e=this.My.get(t);if(e){const{clearReferences:i}=e;i(),this.My.delete(t),e.series.dispose();const s=this.fc.getHeight({x:t.axisX,y:t.axisY}),r=this.jT.get(s);r&&0===r.Ag().length&&r!==this.fc.getHeight({x:this.iF.getDefaultAxisX(),y:this.iF.getDefaultAxisY()})&&(this.jT.delete(s),r.dispose())}return this}setSeriesStyle(t){return this.XT=t,this.My.forEach(this.YT),this}getDefaultAxisX(){return this.iF.getDefaultAxisX()}getDefaultAxisY(){return this.iF.getDefaultAxisY()}sF(t){t.setTickStrategy(Os.Empty).setMouseInteractions(!1).setNibStyle(st).setStrokeStyle(st)}eF(t,e){t.setValueStart(e[0].getInterval().start).setValueEnd(e[0].getInterval().end);let i,s,r=!1,n=!1;e.length>1&<(...e),e[0].onIntervalChange(((e,i,o)=>{if(r)return;n=!0;const h=xt.performance.now();s=h,t.setValueStart(i).setValueEnd(o),requestAnimationFrame((()=>requestAnimationFrame((()=>{s!==h||(n=!1)}))))})),t.onValueChange(((t,s,o)=>{if(n)return;r=!0;const h=xt.performance.now();i=h,e[0].dt(s,o,!1,!0,"zoomBandChart"),requestAnimationFrame((()=>requestAnimationFrame((()=>{i!==h||(r=!1)}))))}))}sf(t){var e;const i=this.fc.getHeight({x:t.axisX,y:t.axisY});let s=this.jT.get(i);s||(0===this.jT.size?s=this.fc.getHeight({x:this.iF.getDefaultAxisX(),y:this.iF.getDefaultAxisY()}):(s=this.fc.getHeight({x:this.iF.addAxisX.bind(this.iF),y:this.iF.addAxisY.bind(this.iF)})(),this.sF(s))),this.jT.set(i,s);const r=this.fc.getWidth({x:this.qT,y:s}),n=this.fc.getHeight({x:this.qT,y:s});let o,h;if(t instanceof wd){o=this.iF.addAreaRangeSeries({xAxis:r,yAxis:n});const e=o;e.add(t.pM());const i=t.mM(((t,i,s)=>e.add(i))),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(i),t.offVisibleStateChanged(s)}}else if(t instanceof Nc){const e=t.zw;o=this.iF.addStepSeries({mode:e,xAxis:r,yAxis:n});const i=o;i.add(t.pM());const s=t.mM(((t,e,s)=>i.add(e))),a=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(s),t.offVisibleStateChanged(a)}}else if(t instanceof Pd){const e={...t.HC,xAxis:void 0,yAxis:void 0},i=this.iF.addHeatmapGridSeries(e);o=i;const s=()=>{i.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};s();const r=t.YC(s);t.jC(i);const n=t.ZC(((t,e)=>{i.invalidateIntensityValues(e)})),a=t.onVisibleStateChanged(((t,e)=>{i.setVisible(e)}));h=()=>{t.XC(r),t.KC(n),t.offVisibleStateChanged(a)}}else{const i={};t instanceof Gc&&(i.dataPattern=null===(e=t._n)||void 0===e?void 0:e.dataPattern);const r=this.iF.addLineSeries({...i,xAxis:this.fc.getWidth({x:this.qT,y:s}),yAxis:this.fc.getHeight({x:this.qT,y:s})});if(o=r,t instanceof ld){const e=t=>{const e=[],i=t.length;for(let s=0;s{r.add(e(i))})),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(i),t.offVisibleStateChanged(s)}}else{r.add(t.pM());const e=t.mM(((t,e)=>r.add(e))),i=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.yM(e),t.offVisibleStateChanged(i)}}}t.onHighlight(((t=!0)=>{o.setHighlight(t)})),o.setMouseInteractions(!1),this.YT({series:o},t);const a=t.SM((()=>{o.clear()})),l=h;h=()=>{t.xM(a),l()},this.My.set(t,{series:o,clearReferences:h})}getSizePixels(){return this.iF.getSizePixels()}onResize(t){return this.iF.onResize(((e,i,s,r,n)=>t(this,i,s,r,n)))}offResize(t){return this.iF.offResize(t)}xa(t){this.iF.xa(t)}getMinimumSize(){return this.iF.getMinimumSize()}Y(){return this.iF.Y()}X(){return this.iF.X()}Ae(t){const e=Array.from(new Set(this.attachedAxes.map((t=>t.chart))).values());if("x"===this.QT){const t=e.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.hg?t.Dg():0})),Math.max(t,i)}),0),i=e.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.hg?t.Dg():0})),Math.max(t,i)}),0),s=e.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=e.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.getDefaultAxisY().setThickness(t),this.iF.setPadding({left:s,right:r+i})}else{const t=e.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.hg?t.Dg():0})),Math.max(t,i)}),0),i=e.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.hg?t.Dg():0})),Math.max(t,i)}),0),s=e.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),r=e.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.getDefaultAxisX().setThickness(t),this.iF.setPadding({bottom:s,top:r+i})}return this.iF.Ae(t)}getTheme(){return this.iF.getTheme()}setTitle(t){return this.iF.setTitle(t),this}getTitle(){return this.iF.getTitle()}setTitleFillStyle(t){return this.iF.setTitleFillStyle(t),this}getTitleFillStyle(){return this.iF.getTitleFillStyle()}setTitleFont(t){return this.iF.setTitleFont(t),this}getTitleFont(){return this.iF.getTitleFont()}setTitleMargin(t){return this.iF.setTitleMargin(t),this}getTitleMargin(){return this.iF.getTitleMargin()}setPadding(t){return this.iF.setPadding(t),this}getPadding(){return this.iF.getPadding()}setBackgroundFillStyle(t){return this.iF.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.iF.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.iF.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.iF.getBackgroundStrokeStyle()}translateCoordinate(t,e,i){return Lh(t,e,i,this.iF.pixelScale,this.iF.ls)}addUIElement(t,e){return this.iF.addUIElement(t,e)}addLegendBox(t,e){return this.iF.addLegendBox(t,e)}saveToFile(t,e,i){return this.iF.saveToFile(t,e,i),this}dispose(){return this.iF.dispose(),this.band.dispose(),this.jT.clear(),this.My.clear(),this.JT(this),this}onDispose(t){return this.iF.onDispose((()=>t(this)))}offDispose(t){return this.iF.offDispose(t)}}const qd=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99999/(e+1)),o=Math.floor(89999/(e+1)),h=410001+e*o;let a=0;return{hF:()=>{const e=t.rF("dashboard ui",h+a);return a+=1,e},nF:()=>t.rF("dashboard legend",41e4),oF:e=>{const h=1+e*i,a=100001+e*s,l=200002+e*r,u=300001+e*n,c=410001+e*o;let d=0;return{ls:t,hp:(e,i)=>{const s=h+i;return t.rF(e,s)},OS:(e,i)=>{const s=a+i;return t.rF(e,s)},Hp:(e,i)=>{const s=l+i;return t.rF(e,s)},BS:(e,i,s)=>{const r=l+i;return t.aF(e,r,s)},op:(e,i)=>{const s=u+i;return t.rF(e,s)},Xg:e=>{const i=c+d,s=t.rF(e,i);return d+=1,s},Kg:()=>t.rF("panel legend",400002+e),Bx:()=>t.rF("panel cursor",500001+e)}}}};class Zd{constructor(t){this.P=new r.Eventer,this.u=t}S(t){return this.u=t,this.P.emit("set",t),this}M(){return this.u}R(t){return this.P.on("set",t)}N(t){return this.P.off(t,"set")}}const Kd={Ke:!1,qe:0,Je:!1,th:0,Qe:!1,ih:0,sh:0,je:zs.fitting},Qd=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))},tf=(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&&uf(t,e,u,n,o,h),"spark-bar"===a&&cf({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&cf({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&df(t,e,u,n,o,h),"spark-pie"===a&&ff(t,e,u,n,o,h)},ef=(t,e,i,s)=>({x:rf(t.x,e.x,i.x,s),y:nf(t.y,e.y,i.y,s)}),sf=(t,e,i,s)=>({position:rf(t.position,e.x,i.x,s),high:nf(t.high,e.y,i.y,s),low:nf(t.low,e.y,i.y,s)}),rf=(t,e,i,s)=>{const r=Ct(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},nf=(t,e,i,s)=>{const r=Ct(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},of=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&hf(a,e,i,r,n,o,h),"axis-band"===a.type&&af(a,i,r,n,o,h),"constant-line"===a.type&&lf(a,i,s,r,n,o,h)},hf=(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=ef(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().Ha().za(void 0!==u?u:e.PointShape.Circle).Ph(d||0).q(c||5).Me(l||h.sparkPointChartFillStyle).Wa(f)},af=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(ke,Pe),f=u(ke,Pe);"x"===o&&(d=ef({x:h,y:ke},e,i,s),f=ef({x:a,y:Pe},e,i,s)),"y"===o&&(d=ef({x:ke,y:h},e,i,s),f=ef({x:Pe,y:a},e,i,s));const g=s[0],y=s[1],p=Ct(d.x,g.x,g.x+y.x),m=Ct(d.y,g.y,g.y+y.y),S=Ct(f.x,g.x,g.x+y.x),x=Ct(f.y,g.y,g.y+y.y);r.rect.add().Xa(p).Za(m).q(u(S-p,x-m)).Me(l||n.sparkChartBandFillStyle).ve(c||n.sparkChartBandStrokeStyle).ve(st)},lf=(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,y=i.x,p=[];if("y"===h&&d<=c&&c<=f){const t=ef(u(g,c),{x:g,y:d},s,r),e=ef(u(y,c),{x:g,y:d},s,r);p.push([t,e])}if("x"===h&&g<=c&&c<=y){const t=ef(u(c,d),{x:g,y:d},s,r),e=ef(u(c,f),{x:g,y:d},s,r);p.push([t,e])}p.length>0&&n.line.add().Pe(l||o.sparkChartConstantLineStrokeStyle).Oe(p[0][0]).Be(p[0][1])},uf=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Pn&&xt.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=Pe,c=ke,d=Pe,f=ke;for(let t=0;tef(t,{x:u,y:d},g,i)));e.lineSet.add().us(n).Pe(o||s.sparkLineChartStrokeStyle).Ha().Wa(y),a&&of(a,y,{x:u,y:d},{x:c,y:f},g,i,e,s)},cf=(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,y=l||0,p=f/d*1;let m=Pe,S=ke;if(g)m=-1,S=1;else for(const t of o)m=Math.min(m,t),S=Math.max(S,t);const x={x:0,y:g?-1:Math.min(0,m)},b={x:1*o.length+(o.length-1)*p,y:g?2:Math.max(S,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*p,y:g?t>=y?1:0:t},r=ef({x:1*e+e*p,y:g?t>=y?0:-1:0},x,b,i),n=ef(s,x,b,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().us(n).we(t.position).qa(t.height).Ka(t.width).Me((i=t.value,g?(i>=y?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).ve(a||s.sparkBarChartStrokeStyle)}))},df=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Pn&&xt.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=Pe,f=ke,g=Pe,y=ke;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=ef(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 y=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().us(n).we(d).Gl(g).Ul(0).Nl(y).Be(y+r).Me(l[i]||ye(s.sparkPieChartFillStyle,i)).ve(h||s.sparkPieChartStrokeStyle),y+=r}))};var gf,yf,pf;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(gf||(gf={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(yf||(yf={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(pf||(pf={}));class mf extends cn{constructor(t,e,i,s,r){super(),this.Fs=!1,this.Gw={x:0,y:0,height:20,width:20},this.lF={x:10,y:10},this.As=t,this.uF=r,this.cF=new Dn(t,e,i,Et,s).setMouseInteractions(!0),this.dF=t.Cc(e,sn.Simple).Me(s.dataGridScrollBarButtonArrowFillStyle).ve(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.ju(this),this.cF.onMouseEnter((t=>t.setHighlight(1))),this.cF.onMouseLeave((t=>t.setHighlight(0)))}fF(){switch(this.uF){case pf.Up:this.dF.tl([{x:this.Gw.x,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y-this.lF.y/2},{x:this.Gw.x-this.lF.x/2,y:this.Gw.y-this.lF.y/2}]);break;case pf.Down:this.dF.tl([{x:this.Gw.x-this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x,y:this.Gw.y-this.lF.y/2}]);break;case pf.Left:this.dF.tl([{x:this.Gw.x-this.lF.x/2,y:this.Gw.y},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y-this.lF.y/2}]);break;case pf.Right:this.dF.tl([{x:this.Gw.x-this.lF.x/2,y:this.Gw.y+this.lF.y/2},{x:this.Gw.x+this.lF.x/2,y:this.Gw.y},{x:this.Gw.x-this.lF.x/2,y:this.Gw.y-this.lF.y/2}])}}we(t){return this.Gw.x=t.x,this.Gw.y=t.y,this}ca(){return u(this.Gw.x,this.Gw.y)}q(t){return this.Gw.height=t.x,this.Gw.width=t.y,this}Ht(){return{x:this.Gw.height,y:this.Gw.width}}onMouseDown(t){return this.cF.onMouseDown(t)}onMouseUp(t){return this.cF.onMouseUp(t)}setFillStyle(t){return this.cF.setFillStyle(t),this}getFillStyle(){return this.cF.getFillStyle()}setStrokeStyle(t){return this.cF.setStrokeStyle(t),this}getStrokeStyle(){return this.cF.getStrokeStyle()}Ae(){return this.cF.Ae(),this.fF(),this}Ts(){return this.cF.setSize(u(this.Gw.height,this.Gw.width)).setPosition(u(this.Gw.x,this.Gw.y)),this}setVisible(t){return this.cF.setVisible(t),this.dF.setVisible(t),this}dispose(){return this.cF.dispose(),this.dF.dispose(),this}setMouseInteractions(t){return this.cF.setMouseInteractions(t),this}getMouseInteractions(){return this.cF.getMouseInteractions()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}getHighlight(){return this.cF.getHighlight()}setHighlight(t){return this.cF.setHighlight(ve(t)),this.P.emit("highlight",Boolean(t)),this.As.Ss(),this}}const Sf=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class xf{constructor(t,i,s,n,o,h,a){this.Bc={x:0,y:0},this.Gw={x:0,y:0,height:0,width:0},this.P=new r.Eventer,this.gF={min:u(0,0),max:u(0,0)},this.Lv=!1,this.Rv=!1,this.pF={x:0,y:0},this.Xu=void 0,this.mF=u(0,0),this.yF={x:0,y:0},this.SF=0,this.xF=15,this.Ev=(t,i)=>{this.Lv=!0,this._f.Ss();const s=this.bF.getDraggingMode();this.Xu=this._f.ls.Tr(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.vF&&clearInterval(this.vF)},this.zv=()=>{this.Lv=!1,this._f.Ss(),this._f.ls.Fr(this.Xu)},this.Vv=t=>(this.Rv=!0,this.pF=at(this._f.ls.Ce(t.x,t.y),this._f.ls.ct,this.scale),!0),this.MF=(t,e)=>(this._F(e),this.vF=setInterval((()=>this._F(e)),300),!0),this.AF=()=>(clearInterval(this.vF),!0),this.Nv=(t,i)=>{const s=this.bF.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=at(this._f.ls.Ce(t.x,t.y),this._f.ls.ct,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?Sf(n.x,this.scale.x):this.Gw.x,r!==e.UIDraggingModes.onlyHorizontal?Sf(n.y,this.scale.y):this.Gw.y),h=u(o.x-this.pF.x,o.y-this.pF.y),a=u(this.bF.getPosition().x+h.x,this.bF.getPosition().y+h.y),l=this.wF(a),c={x:Math.abs(this.mF.x-l.x),y:Math.abs(this.mF.y-l.y)};return this.kF(c),this.yF.y>h.y&&(this.pF=n),this.Ae(),!0}return!1},this.Gv=(t,e)=>{this.Rv=!1,Kt(e),this._f.Ss()},this._f=t,this.Gg=i,this.scale=n,this.contentScale=o,this.CF=a,this.TF=new mf(t,s,n,h,a===gf.UpToDown?pf.Up:pf.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.FF=new mf(t,s,n,h,a===gf.UpToDown?pf.Down:pf.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.bF=new Dn(t,s,n,Et,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===gf.UpToDown?e.UIDraggingModes.onlyVertical:a===gf.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.IF=new Dn(i,s,n,Et,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.bF.onMouseEnter(this.Ev),this.bF.onMouseLeave(this.zv),this.bF.onMouseDragStart(((t,e)=>this.Vv(u(e.clientX,e.clientY))&&Kt(e))),this.bF.onMouseDrag(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Kt(e))),this.bF.onMouseDragStop(this.Gv),this.bF.onTouchStart(((t,e)=>this.Vv(u(e.clientX,e.clientY))&&Kt(e))),this.bF.onTouchMove(((t,e)=>this.Nv(u(e.clientX,e.clientY))&&Kt(e))),this.bF.onTouchEnd(this.Gv),this.TF.onMouseDown(((t,e)=>this.MF(t,e)&&Kt(e))),this.FF.onMouseDown(((t,e)=>this.MF(t,e)&&Kt(e))),this.TF.onMouseUp(((t,e)=>this.AF()&&Kt(e))),this.FF.onMouseUp(((t,e)=>this.AF()&&Kt(e))),this.IF.onMouseWheel(((t,e)=>this.PF(e))),this.bF.onMouseWheel(((t,e)=>this.PF(e))),this.IF.onMouseDown(((t,e)=>this.MF(t,e)&&Kt(e))),this.IF.onMouseUp(((t,e)=>this.AF()&&Kt(e)))}DF(t){return this.Gw=t,this}Ka(t){return this.Gw.width=t,this}gw(){return this.Gw.width}BF(t){return this.mF=t,this}OF(t){return this.Bc=t,this}LF(){return this.Bc}RF(t){return this.xF=t,this}EF(){return this.CF}zF(t){let e;switch(this.CF){case gf.UpToDown:return e=t>0?Math.min(this.mF.y-this.gF.max.y,this.yF.y+t):Math.max(0,this.yF.y+t),e!==this.yF.y&&(this.kF({x:0,y:e}),this.Ae(),!0);case gf.LeftToRight:return e=Math.min(this.gF.max.x-this.mF.x,this.yF.x+t),e!==this.yF.x&&(this.kF({y:0,x:e}),this.Ae(),!0);default:return!1}}VF(t){let e;switch(this.CF){case gf.UpToDown:return e=Math.max(0,this.yF.y-t),e!==this.yF.y&&(this.kF({x:0,y:e}),this.Ae(),!0);case gf.LeftToRight:return e=t>0?Math.max(0,this.yF.x-t):Math.min(this.gF.max.x-this.mF.x,this.yF.x-t),e!==this.yF.x&&(this.kF({x:e,y:0}),this.Ae(),!0);default:return!0}}NF(t){switch(this.CF){case gf.UpToDown:return this.P.on("scrollY",t);case gf.LeftToRight:return this.P.on("scrollX",t)}return this.P.on("scrollY",t)}wF(t){switch(this.CF){case gf.UpToDown:if(t.y>this.gF.min.y)return u(t.x,this.gF.min.y);if(t.ythis.gF.max.x)return u(this.gF.max.x,t.y)}return t}PF(t){t.deltaY>0&&this.GF()&&Kt(t),t.deltaY<0&&this.WF()&&Kt(t)}_F(t){const e=at(this._f.ls.Ce(t.clientX,t.clientY),this._f.ls.ct,this.scale);let i;const s=this.bF.getPosition(),r=this.bF.getSize();this.HF(e,s,r)?clearInterval(this.vF):(i=this.CF===gf.UpToDown?u(0,e.y-s.y>0?this.xF:-this.xF):u(s.x-e.x>0?this.xF:-this.xF,0),(i.x>0||i.y>0)&&this.UF(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.$F(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}HF(t,e,i){return this.CF===gf.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.Gw.height?Math.min(this.mF.y-this.gF.max.y,this.yF.y+t):0,e!==this.yF.y&&(this.kF({x:0,y:e}),this.Ae(),!0)}case gf.LeftToRight:{const e=Math.min(this.gF.max.x-this.mF.x,this.yF.x+t);return e!==this.yF.x&&(this.kF({y:0,x:e}),this.Ae(),!0)}default:return!1}}WF(){return this.UF(this.xF)}GF(){return this.$F(this.xF)}kF(t){if(t.x===this.yF.x&&t.y===this.yF.y)return;let e;switch(this.yF=t,this.CF){case gf.UpToDown:e=this.yF.y*this.SF*this.contentScale.Ai().y,this.P.emit("scrollY",yf.Vertical,e),this._f.ls.Ss();break;case gf.LeftToRight:e=this.yF.x*this.SF*this.contentScale.Ai().x,this.P.emit("scrollX",yf.Horizontal,e)}}setVisible(t){return this.TF.setVisible(t),this.FF.setVisible(t),this.IF.setVisible(t),this.bF.setVisible(t),this}dispose(){return this.TF.dispose(),this.FF.dispose(),this.IF.dispose(),this.bF.dispose(),this.vF&&clearInterval(this.vF),this}Ts(){switch(this.YF(),this.XF(),this.CF){case gf.UpToDown:this.TF.we({x:this.Gw.x,y:this.Gw.y+this.Gw.height-this.TF.Ht().x/2}).q(u(this.Gw.width,this.Gw.width)).Ts(),this.FF.we({x:this.Gw.x,y:this.Gw.y+10}).q(u(this.Gw.width,this.Gw.width)).Ts(),this.IF.setSize({x:this.Gw.width,y:this.Gw.height-2*this.TF.Ht().x}).setPosition({x:this.Gw.x,y:this.Gw.y+this.FF.Ht().y+this.IF.getSize().y/2}),this.bF.setSize(u(this.Gw.width,this.ZF())),this.mF={x:this.Gw.x,y:this.TF.ca().y-this.TF.Ht().y/2-this.bF.getSize().y/2},this.jF({min:{x:this.Gw.x,y:this.TF.ca().y-this.TF.Ht().y/2-this.bF.getSize().y/2},max:{x:this.Gw.x,y:this.FF.ca().y+this.FF.Ht().x/2+this.bF.getSize().y/2}});break;case gf.LeftToRight:this.TF.we({x:this.Gw.x,y:this.Gw.y}).q(u(this.Gw.height,this.Gw.height)).Ts(),this.FF.we({x:this.Gw.x+this.Gw.width-this.FF.Ht().x,y:this.Gw.y}).q(u(this.Gw.height,this.Gw.height)).Ts(),this.IF.setSize({y:this.Gw.height,x:this.Gw.width-2*this.TF.Ht().y}).setPosition({x:this.Gw.x+this.TF.Ht().x/2+this.IF.getSize().x/2,y:this.Gw.y}),this.bF.setSize(u(this.ZF(),this.Gw.height)),this.mF={x:this.TF.ca().x+this.TF.Ht().x/2+this.bF.getSize().x/2,y:this.Gw.y},this.jF({min:{x:this.TF.ca().x+this.TF.Ht().x/2+this.bF.getSize().x/2,y:this.Gw.y},max:{x:this.FF.ca().x-this.FF.Ht().x/2-this.bF.getSize().x/2,y:this.Gw.y}})}return this.KF(),this}YF(){switch(this.CF){case gf.UpToDown:this.qF()||this.setVisible(!1),this.qF()&&this.setVisible(!0);break;case gf.LeftToRight:this.JF()||this.setVisible(!1),this.JF()&&this.setVisible(!0)}}XF(){switch(this.CF){case gf.UpToDown:this.qF()||this.kF({x:0,y:0});break;case gf.LeftToRight:this.JF()||this.kF({x:0,y:0})}}qF(){return this.Bc.x>this.Gw.height}JF(){return this.Bc.y>this.Gw.width}ZF(){switch(this.CF){case gf.UpToDown:return this.Gw.height*(this.Gw.height-2*this.TF.Ht().x)/this.Bc.x;case gf.LeftToRight:return this.Gw.width*(this.Gw.width-2*this.TF.Ht().y)/this.Bc.y;default:return 0}}KF(){switch(this.CF){case gf.UpToDown:this.SF=(this.Bc.x-this.Gw.height)/(this.gF.min.y-this.gF.max.y);break;case gf.LeftToRight:this.SF=(this.Bc.y-this.Gw.width)/(this.gF.max.x-this.gF.min.x)}}Ae(){switch(this.TF.Ae(),this.FF.Ae(),this.IF.Ae(),this.CF){case gf.UpToDown:this.bF.setPosition({x:this.Gw.x,y:this.TF.ca().y-this.TF.Ht().y/2-this.bF.getSize().y/2-this.yF.y}).Ae();break;case gf.LeftToRight:this.bF.setPosition({y:this.Gw.y,x:this.TF.ca().x+this.TF.Ht().x/2+this.bF.getSize().x/2+this.yF.x}).Ae()}return this}}class bf{constructor(t,e,i,s,r,n,o){switch(this._f=t,this.Gg=e,this.scale=s,this.contentScale=r,o){case yf.Vertical:this.QF=this.tI(i,n,gf.UpToDown);break;case yf.Horizontal:this.iI=this.tI(i,n,gf.LeftToRight);break;case yf.Both:this.QF=this.tI(i,n,gf.UpToDown),this.iI=this.tI(i,n,gf.LeftToRight)}this.sI=Wi(new Yi(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.iI)||void 0===n?void 0:n.VF(s.x))&&Kt(r),0!==s.y&&(null===(o=this.QF)||void 0===o?void 0:o.zF(s.y))&&Kt(r)})))}tI(t,e,i){return new xf(this._f,this.Gg,t,this.scale,this.contentScale,e,i)}gw(){return 20}OF(t){var e,i;return null===(e=this.QF)||void 0===e||e.OF(t),null===(i=this.iI)||void 0===i||i.OF(t),this}eI(t){var e;return null===(e=this.iI)||void 0===e||e.RF(t),this}hI(t){var e;return null===(e=this.QF)||void 0===e||e.RF(t),this}rI(t){const e=this.QF;return e&&e.PF(t),this}nI(t){return this.sI.onTouchStart(this,t),this}oI(t){return this.sI.onTouchMove(this,t),this}aI(t){return this.sI.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.iI)||void 0===e||e.NF(t),null===(i=this.QF)||void 0===i||i.NF(t),this}dispose(){var t,e;return null===(t=this.QF)||void 0===t||t.dispose(),null===(e=this.iI)||void 0===e||e.dispose(),this}Ae(){var t,e;return null===(t=this.QF)||void 0===t||t.Ae(),null===(e=this.iI)||void 0===e||e.Ae(),this}Ts(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.QF)||void 0===t||t.DF({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.iI)||void 0===e||e.DF({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.QF)||void 0===i||i.Ts(),null===(s=this.iI)||void 0===s||s.Ts(),this}}class vf extends Vh{constructor(t,e,i,s,r,n){super(t,e,i,e.hp("dataGrid bg",0),s,e.ls.Ji.dataGridBackgroundFillStyle,e.ls.Ji.dataGridBackgroundStrokeStyle,e.ls.Ji.dataGridTitleFont,e.ls.Ji.dataGridTitleFillStyle,n),this.lI=[],this.uI=[],this.cI=[],this.dI=new Map,this.fI=!0,this.gI=!0,this.pI=!0,this.mI=!0,this.yI=!0,this.SI=!0,this.xI=!0,this.bI=!0,this.vI=!0,this.MI=!0,this._I=!0,this.AI=!0,this.wI=!0,this.kI=!0,this.CI=!0,this.TI=!0,this.FI=new Set,this.II=new Set,this.DI=!0,this.BI=!0,this.OI=(t,e)=>{t.borders=void 0===e?Ef:{...t.borders,...e},this.LI(t),this.AI=!0,this.ls.Ss()},this.LI=t=>{t.borders&&(!1===t.borders.top&&this.RI(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.EI,bottom:!1}})),!1===t.borders.bottom&&this.RI(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.EI,top:!1}})),!1===t.borders.left&&this.RI(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.EI,right:!1}})),!1===t.borders.right&&this.RI(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.EI,left:!1}})),!0===t.borders.top&&this.RI(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.EI,bottom:!0}})),!0===t.borders.bottom&&this.RI(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.EI,top:!0}})),!0===t.borders.left&&this.RI(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.EI,right:!0}})),!0===t.borders.right&&this.RI(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.EI,left:!0}})))},this.zI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseEnter,i,e)},this.VI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseLeave,i,e)},this.NI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseClick,i,e)},this.GI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDoubleClick,i,e)},this.WI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDown,i,e)},this.HI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseUp,i,e)},this.UI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseMove,i,e)},this.$I=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDrag,i,e)},this.jI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDragStart,i,e)},this.YI=(t,e)=>{const i=this.dI.get(t);i&&this.P.emit(Mf.cellMouseDragStop,i,e)},this.XI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellMouseWheel,i,e),!e.defaultPrevented&&this.DI&&this.ZI.rI(e))},this.KI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellTouchStart,i,e),!e.defaultPrevented&&this.BI&&this.ZI.nI(e))},this.qI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellTouchMove,i,e),!e.defaultPrevented&&this.BI&&this.ZI.oI(e))},this.JI=(t,e)=>{const i=this.dI.get(t);i&&(this.P.emit(Mf.cellTouchEnd,i,e),!e.defaultPrevented&&this.BI&&this.ZI.aI(e))},this.ff.An||this.ff.kn||this.ls.Mn(2),this.ap.Ch("Data Grid"),this.QI=i.d2({scaleXYConstructor:_i}),this.QI.x.eg=Kd,this.tP=i.d2({scaleXYConstructor:_i}),this.iP={x:0,y:0},this.sP=this.Ji.dataGridTextFont,this.eP=this.Ji.dataGridTextFillStyle,this.EI={top:!0,bottom:!0,left:!0,right:!0},this.hP=this.Ji.dataGridCellBackgroundFillStyle,this.rP=this.Ji.dataGridBorderStrokeStyle,this.nP="left-center",this.oP={left:5,right:5,bottom:5,top:5},this.aP=e.OS("dataGrid grid bg",0),this.lP=e.OS("dataGrid cell bg",1),this.uP=e.Hp("dataGrid cell content",0),this.cP=e.Hp("dataGrid scrollbar bg",1),this.dP=e.Hp("dataGrid scrollbar fg",2),this.ZI=this.fP(),this.onBackgroundMouseWheel(((t,e)=>{this.DI&&this.ZI.rI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.BI&&this.ZI.nI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.BI&&this.ZI.oI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.BI&&this.ZI.aI(e)})),this.gP=this.aP._e(this.QI).Me(this.Ji.dataGridBackgroundFillStyle).ve(st).setMouseInteractions(!1),this.pP=this.uP.Tg(this.QI).setMouseInteractions(!1),this.mP=new fa((()=>this.lP._e(this.QI).setMouseInteractions(!0).setMouseEnterEventHandler(this.zI).setMouseLeaveEventHandler(this.VI).setMouseClickEventHandler(this.NI).setMouseDoubleClickEventHandler(this.GI).setMouseDownEventHandler(this.WI).setMouseUpEventHandler(this.HI).setMouseMoveEventHandler(this.UI).setMouseDragEventHandler(this.$I).setMouseDragStartEventHandler(this.jI).setMouseDragStopEventHandler(this.YI).setMouseWheelEventHandler(this.XI).setTouchStartEventHandler(this.KI).setTouchMoveEventHandler(this.qI).setTouchEndEventHandler(this.JI))),this.yP=new fa((()=>this.uP._e(this.QI).setMouseInteractions(!1))),this.SP=new fa((()=>this.uP.Sr(this.QI).setMouseInteractions(!1))),this.xP=new fa((()=>this.uP.tm(this.QI,{},[Kh.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.bP=new fa((()=>this.uP.De(this.QI).setMouseInteractions(!1))),this.vP=new fa((()=>this.uP.vy(this.QI).setMouseInteractions(!1))),this.MP=new fa((()=>this.uP._e(this.QI).setMouseInteractions(!1))),this._P=new fa((()=>this.uP.nC(this.QI).setMouseInteractions(!1))),this.AP=new fa((()=>this.uP.Dc(this.QI).setMouseInteractions(!1))),this.ep(r,this.uiScale),this.onResize((()=>{this.fI=!0,this.ls.Ss(),this.QI.q(this.pixelScale.Ht()),this.tP.q(this.pixelScale.Ht())})),this.wP=this.ss.xg([this.gP])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}Sd(){return[]}dispose(){return super.dispose(),this.aP.G(),this.lP.G(),this.uP.G(),this.cP.G(),this.dP.G(),zh(this.QI),zh(this.tP),this.ZI.dispose(),this.SP.lm(),this.mP.lm(),this.yP.lm(),this.xP.lm(),this.bP.lm(),this.vP.lm(),this.MP.lm(),this._P.lm(),this.AP.lm(),this}Y(){return super.Y(),this.QI.Y(),this.tP.Y(),this}X(){return super.X(),this.QI.X(),this.tP.X(),this}setBackgroundEffect(t){return this.wP.ys(t),this.ls.Ss(),this}getBackgroundEffect(){return this.wP.xs()}setInteractionScrollOnWheel(t){return this.DI=t,this}getInteractionScrollOnWheel(){return this.DI}setInteractionPanOnTouch(t){return this.BI=t,this}getInteractionPanOnTouch(){return this.BI}onCellMouseEnter(t){return this.P.on(Mf.cellMouseEnter,t)}offCellMouseEnter(t){return this.P.off(t)}onCellMouseLeave(t){return this.P.on(Mf.cellMouseLeave,t)}offCellMouseLeave(t){return this.P.off(t)}onCellMouseClick(t){return this.P.on(Mf.cellMouseClick,t)}offCellMouseClick(t){return this.P.off(t)}onCellMouseDoubleClick(t){return this.P.on(Mf.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.P.off(t)}onCellMouseDown(t){return this.P.on(Mf.cellMouseDown,t)}offCellMouseDown(t){return this.P.off(t)}onCellMouseUp(t){return this.P.on(Mf.cellMouseUp,t)}offCellMouseUp(t){return this.P.off(t)}onCellMouseMove(t){return this.P.on(Mf.cellMouseMove,t)}offCellMouseMove(t){return this.P.off(t)}onCellMouseDrag(t){return this.P.on(Mf.cellMouseDrag,t)}offCellMouseDrag(t){return this.P.off(t)}onCellMouseDragStart(t){return this.P.on(Mf.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.P.off(t)}onCellMouseDragStop(t){return this.P.on(Mf.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.P.off(t)}onCellMouseWheel(t){return this.P.on(Mf.cellMouseWheel,t)}offCellMouseWheel(t){return this.P.off(t)}onCellTouchStart(t){return this.P.on(Mf.cellTouchStart,t)}offCellTouchStart(t){return this.P.off(t)}onCellTouchMove(t){return this.P.on(Mf.cellTouchMove,t)}offCellTouchMove(t){return this.P.off(t)}onCellTouchEnd(t){return this.P.on(Mf.cellTouchEnd,t)}offCellTouchEnd(t){return this.P.off(t)}setGridBackgroundFillStyle(t){return this.gP.Me(t),this.ls.Ss(),this}getGridBackgroundFillStyle(){return this.gP.Th()}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.uI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.uI.splice(this.uI.indexOf(i),1):(i.min=e,i.max=e),this.SI=!0,this.ls.Ss(),this}setRowHeight(t,e){let i=this.cI.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.cI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.cI.splice(this.cI.indexOf(i),1):(i.min=e,i.max=e),this.SI=!0,this.ls.Ss(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.CP(t,(t=>this.TP(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=x(e,e,e,e)),this.FP(t,(t=>this.TP(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=x(i,i,i,i)),this.RI(t,e,(t=>this.TP(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=x(t,t,t,t)),this.oP={...this.oP,...t},this.IP((t=>this.TP(t,this.oP))),this}setCellBorders(t,e,i){return this.RI(t,e,(t=>this.OI(t,i))),this}setRowBorders(t,e){return this.FP(t,(t=>this.OI(t,e))),this}setColumnBorders(t,e){return this.CP(t,(t=>this.OI(t,e))),this}setCellsBorders(t){return this.EI=void 0===t?Ef:t,this.IP((t=>this.OI(t,this.EI))),this}setCellsBorderStrokeStyle(t){return this.rP="function"==typeof t?t(this.rP):t,this.kI=!0,this.ls.Ss(),this}setColumnTextFillStyle(t,e){return this.CP(t,(t=>this.PP(t,e))),this}setRowTextFillStyle(t,e){return this.FP(t,(t=>this.PP(t,e))),this}setCellTextFillStyle(t,e,i){return this.RI(t,e,(t=>this.PP(t,i))),this}setCellsTextFillStyle(t){return this.eP="function"==typeof t?t(this.eP):t,this.IP((t=>this.PP(t,this.eP))),this}setColumnTextFont(t,e){return this.CP(t,(t=>this.DP(t,e))),this}setRowTextFont(t,e){return this.FP(t,(t=>this.DP(t,e))),this}setCellTextFont(t,e,i){return this.RI(t,e,(t=>this.DP(t,i))),this}setCellsTextFont(t){return this.sP="function"==typeof t?t(this.sP):t,this.IP((t=>this.DP(t,this.sP))),this}setColumnContentAlignment(t,e){return this.CP(t,(t=>this.BP(t,e))),this}setRowContentAlignment(t,e){return this.FP(t,(t=>this.BP(t,e))),this}setCellContentAlignment(t,e,i){return this.RI(t,e,(t=>this.BP(t,i))),this}setCellsContentAlignment(t){return this.nP=t,this.IP((t=>this.BP(t,this.nP))),this}setCellBackgroundFillStyle(t,e,i){return this.RI(t,e,(t=>this.OP(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.CP(t,(t=>this.OP(t,e))),this}setRowBackgroundFillStyle(t,e){return this.FP(t,(t=>this.OP(t,e))),this}setCellsBackgroundFillStyle(t){return this.hP="function"==typeof t?t(this.hP):t,this.IP((t=>this.OP(t,this.hP))),this}setCellHighlight(t,e,i){return this.RI(t,e,(t=>{t.highlight=ve(i)})),this.wI=!0,this.ls.Ss(),this}setColumnHighlight(t,e){const i=ve(e);return this.CP(t,(t=>{t.highlight=i})),this.wI=!0,this.ls.Ss(),this}setRowHighlight(t,e){const i=ve(e);return this.FP(t,(t=>{t.highlight=i})),this.wI=!0,this.ls.Ss(),this}removeCell(t,e){return this.RI(t,e,(t=>this.lI.splice(this.lI.indexOf(t),1))),this.yI=!0,this.ls.Ss(),this}removeRow(t){return this.FP(t,(t=>this.lI.splice(this.lI.indexOf(t),1))),this.lI.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.yI=!0,this.ls.Ss(),this}removeColumn(t){return this.CP(t,(t=>this.lI.splice(this.lI.indexOf(t),1))),this.lI.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.yI=!0,this.ls.Ss(),this}removeCells(){return this.lI.splice(0),this.yI=!0,this.ls.Ss(),this}getColumnMax(){return 0===this.lI.length?0:this.lI.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.lI.length?0:this.lI.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}Ae(t){super.Ae(t),Nh.fp(this.ap,this.rp);const e=Math.round(this.rP.L()),i=e/2;let s=this.gI||this.pI||this.mI||this.yI||this.SI||this.xI||this._I||this.AI||this.kI||this.TI;if(s){this.lI.forEach((t=>{this.II.add(t.column)})),this.lI.forEach((t=>{this.FI.add(t.row)}));const t=this.SP.am(),r=this.LP(i,t);t.finishPlot();const n=this.RP(this.II.size,r),o=this.EP(this.FI.size,r),h=n.reduce(Oe,0)+e,a=o.reduce(Oe,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.zP.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(s=!1)}this.zP={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const r=s||this.pI||this.mI||this.yI||this.bI||this.vI||this.MI||this.AI||this.wI||this.kI||this.fI||this.TI;if((r||this.CI)&&this.zP){const t=this.pixelScale.getInnerIntervalPixels(),s=Nh.dp(this.ap,this.rp),n=[this.Qo.left+i,this.Qo.right+i],o=[this.Qo.bottom+i,this.Qo.top+s+i],h={x:t.x-n[0]-n[1],y:t.y-o[0]-o[1]},a=[this.Qo.left,this.Qo.right],l=[this.Qo.bottom,this.Qo.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.tP.Si(n).xi(o).bi(0,h.x).vi(0,h.y),this.ZI.OF({x:this.zP.dataGridHeight,y:this.zP.dataGridWidth}).Ts().Ae();const d={x:Math.round(this.iP.x),y:Math.round(Math.min(0,this.iP.y))};this.QI.Si(a).xi(l).bi(d.x,u.x+d.x).vi(d.y,u.y+d.y),this.gP.we({x:c.x,y:c.y});const f={x:this.QI.x.Vt(),y:this.QI.y.Vt()+this.ZI.gw(),width:this.QI.x.Gt()+e-this.ZI.gw(),height:this.QI.y.Gt()+e};this.uP.kS(f),this.lP.kS(f),this.aP.kS(f),r&&this.VP(c,this.zP,e)}this.fI=!1,this.gI=!1,this.pI=!1,this.mI=!1,this.yI=!1,this.SI=!1,this.xI=!1,this.bI=!1,this.vI=!1,this.MI=!1,this._I=!1,this.AI=!1,this.wI=!1,this.kI=!1,this.CI=!1,this.TI=!1}LP(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.lI){const{content:r}=t,n={...this.oP,...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.Ch(i).Ih(t.textFont||this.sP).Ts().Ic()}if(Qd(r)&&(h=r,l={x:200,y:50}),Uo(r)){const t=this.ls.NP(r);t.GP()?(a=r,l=a.Ht()):t.WP((()=>{this.TI=!0,this.ls.Ss()}))}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}VP(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.gP.q(c),this.pP.Pe(this.rP),this.dI.clear();const d={cellBackground:this.mP.am(),cellIconRect:this.yP.am(),lineSet:this.xP.am(),line:this.bP.am(),pointSet:this.vP.am(),rect:this.MP.am(),junction:this._P.am(),arc:this.AP.am()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:y}=i,p={column:r.column,row:r.row},m={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},S={x:m.x+y.left,y:m.y+y.bottom},x={x:S.x+g.left,y:S.y+g.bottom},b={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:b.x-y.left-y.right,y:b.y-y.top-y.bottom},M={x:v.x-g.left-g.right,y:v.y-g.top-g.bottom};if(n){const t=Tf(x,M,r.contentAlignment||this.nP);n.we(t[0]).Sa({x:t[1],y:t[2]}).Me(this.HP(r.textFillStyle||this.eP,r.content,this.eP)).us(r.highlight)}const A=this.HP(r.backgroundFillStyle||this.hP,r.content);if(A!==z){const t=d.cellBackground.add();t.we(m).q(b).Me(A).ve(st).us(r.highlight),this.dI.set(t,p)}const w=r.borders||this.EI;if(w&&wf(m,b,w,s,f),o){const t=x,e=M;tf(o,d,this.QI,t,e,this.Ji,this.ff,r.highlight)}if(c){const t=c.Ht(),i=Tf(x,M,r.contentAlignment||this.nP);d.cellIconRect.add().we({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).Me(new zo({source:c.Md,fitMode:e.ImageFitMode.Stretch})).ve(st).us(r.highlight)}}this.pP.Ha();for(const t of f)this.pP.kr().Ig(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()}RP(t,e){const i=new Array(t).fill(0);for(const t of this.II.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.uI.find((e=>e.column===t)),n=r?Ct(s,void 0!==r.min?r.min:ke,void 0!==r.max?r.max:Pe):s;i[t]=n}return i}EP(t,e){const i=new Array(t).fill(0);for(const t of this.FI.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.cI.find((e=>e.row===t)),n=r?Ct(s,void 0!==r.min?r.min:ke,void 0!==r.max?r.max:Pe):s;i[t]=n}return i}HP(t,e,i){if(W(t)){try{const i=Number(e);return new V({color:t.getPalette().getColors(i)})}catch(t){}return i||z}return t}PP(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.eP):e,this.MI=!0,this.ls.Ss()}DP(t,e){t.textFont="function"==typeof e?e(t.textFont||this.sP):e,this._I=!0,this.ls.Ss()}OP(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.hP):e,this.vI=!0,this.ls.Ss()}BP(t,e){t.contentAlignment=e,this.bI=!0,this.ls.Ss()}TP(t,e){t.padding={...t.padding,...e},this.xI=!0,this.ls.Ss()}kP(t,e,i){let s=this.RI(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.lI.push(s),this.mI=!0),"string"==typeof s.content||"number"==typeof s.content?this.gI=!0:this.pI=!0,this.ls.Ss()}IP(t){this.lI.forEach((e=>t(e)))}RI(t,e,i){const s=this.lI.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}CP(t,e){const i=this.lI.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}FP(t,e){const i=this.lI.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}fP(){return new bf(this.dP,this.cP,this.tP,this.tP,this.QI,this.Ji,yf.Both).onScroll(((t,e)=>{this.zP&&(t===yf.Vertical&&(this.iP.y=-e),t===yf.Horizontal&&(this.iP.x=e),this.CI=!0,this.ls.Ss())})).eI(50).hI(12)}}const Mf={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 Af;e.DataGridCellContentAlignmentOptions=void 0,(Af=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",Af.RightCenter="right-center",Af.LeftCenter="left-center",Af.RightTop="right-top",Af.LeftTop="left-top",Af.RightBottom="right-bottom",Af.LeftBottom="left-bottom",Af.CenterTop="center-top",Af.CenterBottom="center-bottom";const wf=(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])},Tf=(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 Me(0,`Unidentified DataGrid cell content alignment option: ${i}`)},Ef={top:!1,bottom:!1,left:!1,right:!1};class If extends $s{constructor(t,e,i,s,r,n){super(t,{ar(){},nr(){},ur(){}},s,e,i,{numeric:e.xAxisNumericTicks,datetime:e.xAxisDateTimeTicks,time:e.xAxisTimeTicks},{type:"linear"}),this.chart=t,this.ss=n,this.As=r,this.kh=r.Sr(t.UP).Ih(this.Ji.barChartCategoryAxisTitleFont||this.Ji.xAxisTitleFont).Me(this.Ji.barChartCategoryAxisTitleFillStyle||this.Ji.xAxisTitleFillStyle),this.setTitleRotation(this.chart.ws.getWidth({x:0,y:-90})),this.Bh=this.ss.xg([this.kh]).ys(e.effectsText),this.$P=r.De(t.UP).Pe(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.ls.Ss(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.$P.Pe(t),this.chart.ls.Ss(),this}getStrokeStyle(){return this.$P.Yl()}Ts(){if(!this.Fi)return{jP:0,YP:0,nd:Ct(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Pe)};const t=this.$P.Yl().L()/2,e=this.chart.ws.getHeight(this.kh.Ts().Ic());return{jP:t,YP:e,nd:t+e}}Ae(t,e,i,s){const r=this.getInterval(),n=this.chart.valueAxis.getInterval();this.$P.Oe(this.chart.ws.toPoint(r.start,n.start)).Be(this.chart.ws.toPoint(r.end,n.start)).setVisible(this.Fi),this.kh.we(this.chart.ws.toPoint(.5*(r.start+r.end),this.chart.valueAxis.ct.Jt(0,-(t.jP+s.labelMarginBeforeCategoryAxisPixels)))).Sa(this.chart.ws.toPoint(0,1)).setVisible(this.Fi)}setMouseInteractions(t){return this}Qh(t,e){return new qs(e,t,this.As,this.chart.UP)}tr(t,e){return{}}dr(t,e){return e}pr(t,e,i){return{min:t,max:e}}}class Cf extends $s{constructor(t,e,i,s,r,n,o){super(t,{ar:()=>{var e;if(t.XP){if("positive"===t.ZP||"bipolar"===t.ZP){if("after-bar"===(null===(e=t.KP)||void 0===e?void 0:e.position)){const e=this.ct.Gt();return this.ct.Jt(t.XP.max,Math.min(this.chart.ws.getHeight(this.chart.qP())+t.KP.labelMargin,.3*e))}return t.XP.max}return t.JP?Ct(-1,-1e-6,t.XP.max):0}},nr:()=>{var e;if(t.XP){if("negative"===t.ZP||"bipolar"===t.ZP){if("after-bar"===(null===(e=t.KP)||void 0===e?void 0:e.position)){const e=this.ct.Gt();return console.log("asd",t.XP.min,this.ct.Jt(t.XP.min,-10),this.getInterval()),this.ct.Jt(t.XP.min,-Math.min(this.chart.ws.getHeight(this.chart.qP())+t.KP.labelMargin,.3*e))}return t.XP.min}return t.JP?Ct(1,1e-6,t.XP.min):0}},ur:()=>{}},s,e,i,{numeric:e.barChartValueAxisTicks||e.yAxisNumericTicks,datetime:e.yAxisDateTimeTicks,time:e.yAxisTimeTicks},o),this.chart=t,this.ss=n,this.As=r,this.kh=r.Sr(t.UP).Ih(this.Ji.barChartValueAxisTitleFont||this.Ji.yAxisTitleFont).Me(this.Ji.barChartValueAxisTitleFillStyle||this.Ji.yAxisTitleFillStyle),this.setTitleRotation(this.chart.ws.getHeight({x:0,y:-90})),this.Bh=this.ss.xg([this.kh]).ys(e.effectsText),this.$P=r.De(t.UP).Pe(e.barChartValueAxisStrokeStyle||this.Ji.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.ls.Ss(),this}getThickness(){return{min:this.Mg,max:this._g}}setStrokeStyle(t){return this.$P.Pe(t),this.chart.ls.Ss(),this}getStrokeStyle(){return this.$P.Yl()}setTickStrategy(t,e){return super.Mh(t,e)}Ts(t){if(!this.Fi)return this.Oh(),{jP:0,YP:0,nd:Ct(0,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Pe)};const e=this.chart.ws.getWidth(this.chart.UP).Gt(),i=this.ct.Gt();this.Hh({physicalAxisSize:i,oppositeAxisSize:e,plotLines:t});let s=0;for(const t of this.Ue.values())for(const e of t.values()){const t=e.dh.Jh,i=this.chart.ws.getWidth(e.Ve.Ic()),r=t.getTickLength()+t.getTickPadding()+i+t.getLabelPadding();s=Math.max(s,r)}const r=s+this.$P.Yl().L()/2,n=this.chart.ws.getWidth(this.kh.Ts().Ic());return{jP:r,YP:n,nd:Ct(r+n,void 0!==this.Mg?this.Mg:0,void 0!==this._g?this._g:Pe)}}Ae(t){const e=this.getInterval();this.$P.Oe(this.chart.ws.toPoint(-.5,this._h)).Be(this.chart.ws.toPoint(-.5,this.Ah)).setVisible(this.Fi),this.kh.we(this.chart.ws.toPoint(this.chart.categoryAxis.ct.Jt(-.5,t.jP*this.chart.ws.QP),.5*(e.start+e.end))).Sa(this.chart.ws.toPoint(this.chart.ws.tD,0)).setVisible(this.Fi)}setMouseInteractions(t){return this}Qh(t,e){return new qs(e,t,this.As,this.chart.UP)}tr(t,e){const i=t.dh.Jh,s=this.chart.ws.toPoint(-.5,t.u),r=this.chart.UP.Jt(s,this.chart.ws.toPoint(i.getTickLength()*this.chart.ws.QP,0)),n=this.chart.UP.Jt(s,this.chart.ws.toPoint(i.gridStrokeLength*e.oppositeAxisSize,0)),o=this.chart.UP.Jt(r,this.chart.ws.toPoint(i.getTickPadding()*this.chart.ws.QP,0));t.Ve.we(o).Sa(this.chart.ws.toPoint(this.chart.ws.tD,i.getLabelAlignment())).Ph(i.getLabelRotation()),i.tickStyle!==st&&0!==i.tickLength&&e.plotLines.add({positions:[s,r]},{lineStyle:i.tickStyle}),i.gridStrokeStyle!==st&&i.gridStrokeLength>0&&e.plotLines.add({positions:[s,n]},{lineStyle:i.gridStrokeStyle})}dr(t,e){return"linear"===this.xh.type?Jo(t,e,this.ct):$o(t,e,this.ct)}pr(t,e,i){return{min:t,max:e}}}class Pf extends Bl{constructor(t,e,i,s,r,n){super(t,e,i,s),this.u=0,this.chart=t,this.Ki=t,this.category=r,this.bs=r,this.Se=ye(i.barChartBarFillStyle||i.rectangleSeriesFillStyle,n),this.xe=ye(i.barChartBarStrokeStyle||i.rectangleSeriesStrokeStyle,n),this.onVisibleStateChanged((()=>{this.Ki.iD()})),this.onDispose((()=>{this.Ki.iD(),this.Ki.sD.delete(this),this.Ki.eD.delete(this)}))}setValue(t){return this.u=t,this.Ki.iD(),this.Ki.ls.Ss(),this.Ki.sD.delete(this),this.Ki.eD.delete(this),this}getValue(){return this.u}get value(){return this.u}setFillStyle(t){return this.Se="function"==typeof t?t(this.Se):t,this.Ki.iD(),this}getFillStyle(){return this.Se}setStrokeStyle(t){return this.xe="function"==typeof t?t(this.xe):t,this.Ki.iD(),this}getStrokeStyle(){return this.xe}Xm(){return this.Km}zx(t,e){return ll(t,this.Ki.engine.scale,this.Ki.$x(new Ja,this.category,this.u,this).vc(),this,void 0)}solveNearestFromScreen(t){}setEffect(t){return this.Ki.setBarsEffect(t),this}}const kf=t=>!!(t&&"object"==typeof t&&"iCategory"in t&&"number"==typeof t.iCategory&&"value"in t&&"number"==typeof t.value),Ff=(t,e,i)=>{const s=t.Xc.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 Bf extends Sl{constructor(t,i,s,r,n,o,h){var a;let l;super(t,i,s,i.hp("barChart bg",0),r,i.ls.Ji.barChartBackgroundFillStyle||i.ls.Ji.chartXYBackgroundFillStyle,i.ls.Ji.barChartBackgroundStrokeStyle||i.ls.Ji.chartXYBackgroundStrokeStyle,i.ls.Ji.barChartTitleFont||i.ls.Ji.chartXYTitleFont,i.ls.Ji.barChartTitleFillStyle||i.ls.Ji.chartXYTitleFillStyle,o),this.coordsBars="barChart",this.hD=_f.Descending,this.rD=this.Ji.barChartCategoryLabels,this.KP=this.Ji.barChartValueLabelsAfterBars,this.$x=(t,e,i,s)=>(this.categoryAxis.getTitle().length>0&&t.addRow(this.categoryAxis.getTitle()),t.addRow(e),this.valueAxis.getTitle().length>0&&t.addRow(this.valueAxis.getTitle()),t.addRow(this.valueAxis.formatValue(i)),t),this.nD=!1,this.oD=(()=>{const t=new Map;return{aD:e=>(e.setMouseEnterEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ri(e,i,s)})),e.setMouseLeaveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ei(e,i,s)})),e.setMouseClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Vi(e,i,s)})),e.setMouseDoubleClickEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Ni(e,i,s)})),e.setMouseDownEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Gi(e,i,s)})),e.setMouseUpEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Wi(e,i,s)})),e.setMouseMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.zi(e,i,s)})),e.setMouseDragEventHandler(((e,i,s,r,n,o)=>{const h=o&&t.get(o);h&&h.Ui(e,i,s,r,n,o)})),e.setMouseDragStartEventHandler(((e,i,s,r)=>{const n=r&&t.get(r);n&&n.Hi(e,i,s,r)})),e.setMouseDragStopEventHandler(((e,i,s,r,n)=>{const o=n&&t.get(n);o&&o.$i(e,i,s,r,n)})),e.setMouseWheelEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.ji(e,i,s)})),e.setTouchStartEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Yi(e,i,s)})),e.setTouchMoveEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Xi(e,i,s)})),e.setTouchEndEventHandler(((e,i,s)=>{const r=s&&t.get(s);r&&r.Zi(e,i,s)})),e),lD:(e,i)=>{t.set(e,i)},Ha:()=>{t.clear()}}})(),this.sD=new Map,this.eD=new Map,this.ZP="positive",this.uD=!0,this.cD=new Map,this.dD={speed:1},this._p={speed:1},this.fD=.08,this.Yr=(t,e,i,s,r)=>{this.UP.q(s,r)},this.ws="horizontal"===(null==h?void 0:h.type)?Df:Lf,this.ap.Ch("Bar Chart"),this.gD=i.Hp("barChart plotting 1",0),this.pD=i.Hp("barChart plotting 2",1),this.JP="logarithmic"===(null===(a=null==h?void 0:h.valueAxis)||void 0===a?void 0:a.type),this.JP?"horizontal"===this.ws.mD?(l=s.d1({scale1DConstructor:ki,dimension:"y"}),this.UP=(new Li).yi(s.d1({scale1DConstructor:vi,dimension:"x"}),l)):(l=s.d1({scale1DConstructor:ki,dimension:"x"}),this.UP=(new Li).yi(l,s.d1({scale1DConstructor:vi,dimension:"y"}))):(this.UP=s.d2({scaleXYConstructor:_i}),l=this.ws.getWidth(this.UP)),this.yD=this.ss.xg(),this.SD=new da((()=>this.oD.aD(this.gD.ab(this.UP).Bo(0))),((t,e,i)=>{t.Me(i.fillStyle).ve(i.strokeStyle),e.forEach((e=>{const i=t.kr().tl(e.vertices);this.oD.lD(i,e.bar),e.bar.gs([i])}))}),(()=>{this.oD.Ha()}),(t=>{this.yD.ds(t)})),this.Fy=this.Gg._e(this.UP).Me(this.Ji.barChartSeriesBackgroundFillStyle||z).ve(st),this.Iy=this.Gg._e(this.UP).Me(z).ve(this.Ji.barChartSeriesBackgroundStrokeStyle||st).setMouseInteractions(!1),super.Ty(this.Fy,this.Iy),this.categoryAxis=new If(this,this.Ji,!(!h||void 0===h.disableAnimations)&&h.disableAnimations,l,this.pD,this.ss);const u=jo(null==h?void 0:h.valueAxis);this.valueAxis=new Cf(this,this.Ji,!(!h||void 0===h.disableAnimations)&&h.disableAnimations,this.ws.getHeight(this.UP),this.pD,this.ss,u.type),this.xD=new fa((()=>this.pD.Sr(this.UP).va(Ie).xa(Ie).Bo(1))),this.bD=new da((()=>this.Gg.Tg(this.UP).setMouseInteractions(!1)),((t,e,i)=>{t.Ha().Pe(i.lineStyle),e.forEach((({positions:e})=>t.kr().Ig(e[0],e[1])))}));const c=Lt(h?h.autoCursorBuilder:void 0,ol);this.Ex=c.Tx(this.Dx,this.uiScale,this.uiScale,this.Ji),this.onResize(this.Yr),this.ep(n,this.UP),this.setAutoCursorMode(e.AutoCursorModes.onHover),(null==h?void 0:h.disableAnimations)&&this.setAnimationsEnabled(!1)}getSeries(){return this.My}setBarsMargin(t){return this.fD=Ct(t,0,.49),this.nD=!0,this.ls.Ss(),this}getBarsMargin(){return this.fD}setBarsEffect(t){return this.yD.ys(t),this.ls.Ss(),this}getBarsEffect(){return this.yD.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})}}if(this.hD&&e.sort(this.hD),e.forEach(((t,e)=>{let i=this.My.find((e=>e.category===t.category));i||(i=new Pf(this,this.Ay,this.Ji,this.ls.ss,t.category,e),this.Py(i),this.cD.set(i,{category:e,value:void 0!==t.value?t.value:0})),void 0!==t.value&&i.setValue(t.value)})),this.My.slice().forEach((t=>{void 0===e.find((e=>e.category===t.category))&&(t.dispose(),this.cD.delete(t))})),this.categoryAxis.setInterval(this.ws.getWidth({x:{start:-.5,end:this.My.length-.5},y:{start:this.My.length-.5,end:-.5}})),this.XP=0===this.My.length?void 0:this.My.reduce(((t,e)=>({min:Math.min(t.min,e.getValue()),max:Math.max(t.max,e.getValue())})),{min:Pe,max:ke}),this.XP&&(this.ZP=this.XP.min>=0?"positive":this.XP.max<=0?"negative":"bipolar",("bipolar"===this.ZP||"negative"===this.ZP)&&this.JP))throw new Error("LightningChart JS BarChart bipolar/negative data + logarithmic value axis combination not supported.");return this.hD&&this.My.sort(this.hD),this.sD.clear(),this.eD.clear(),this.nD=!0,this.ls.Ss(),this}setCategoryLabels(t){const e="function"==typeof t?this.rD?t(this.rD):this.rD:t;return this.rD=e?{...this.Ji.barChartCategoryLabels,...e}:void 0,this.sD.clear(),this.ls.Ss(),this}getCategoryLabels(){return this.rD}setValueLabels(t){var e;const i="function"==typeof t?this.KP?t(this.KP):this.KP:t,s=(null==i?void 0:i.position)||(null===(e=this.KP)||void 0===e?void 0:e.position);return i&&s?"after-bar"===s?this.KP={...this.Ji.barChartValueLabelsAfterBars,...i}:"inside-bar"!==s&&"inside-bar-start"!==s&&"inside-bar-centered"!==s&&"inside-bar-end"!==s||(this.KP={...this.Ji.barChartValueLabelsInsideBars,...i}):this.KP=void 0,this.eD.clear(),this.ls.Ss(),this}getValueLabels(){return this.KP}setLabelFittingEnabled(t){return this.uD=t,this.ls.Ss(),this}getLabelFittingEnabled(){return this.uD}getBar(t){const e=this.My.find((e=>e.category===t));if(!e)throw new Error(`BarChart.getBar() no such bar: "${t}"`);return e}getBars(){return this.My}setSorting(t){return this.hD=t,t&&this.My.sort(t),this.ls.Ss(),this}getSorting(){return this.hD}setCursorResultTableFormatter(t){return this.$x=t,this.ls.Ss(),this}setAnimationCategoryPosition(t,e=1){return this.dD=t?{speed:e}:void 0,this.ls.Ss(),this}setAnimationValues(t,e=1){return this._p=t?{speed:e}:void 0,this.ls.Ss(),this}translateCoordinate(t,e,i){if(i&&Vi(t)&&Ri(e))return super.translateCoordinate(t,e,i);const s=e;let r;if(Oi(t))r=this.ls.do(t);else if(Vi(t)){const e=at(t,this.pixelScale,this.ls.ct);r={engineX:e.x,engineY:e.y}}else{if(!kf(t))throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Input coordinate system not recognized.");{const e=at(this.ws.toPoint(t.iCategory,t.value),this.UP,this.ls.ct);r={engineX:e.x,engineY:e.y}}}if(zi(s))return this.ls.fo(r);if("barChart"===s){const t=at({x:r.engineX,y:r.engineY},this.ls.ct,this.UP);return{iCategory:this.ws.getWidth(t),value:this.ws.getHeight(t)}}if(Ri(s))return at({x:r.engineX,y:r.engineY},this.ls.ct,this.pixelScale);throw new Error("LightningChart JS BarChart.translateCoordinate unexpected error. Target coordinate system not recognized.")}Ae(t){var e,i;super.Ae(t);const s=this.xD.am(),r=this.bD.am(),n=this.My.filter((t=>t.getVisible())),o=5e-4*t*((null===(e=this.dD)||void 0===e?void 0:e.speed)||0),h=.003*t*((null===(i=this.dD)||void 0===i?void 0:i.speed)||0),a=this.valueAxis.ct,l=a instanceof ki?(t,e)=>{var i;return Jo(t,e,a,(null===(i=this._p)||void 0===i?void 0:i.speed)||0)}:(t,e)=>{var i;return $o(t,e,a,(null===(i=this._p)||void 0===i?void 0:i.speed)||0)};n.forEach(((t,e)=>{const i={category:e,value:t.value};let s,r,n=this.cD.get(t);if(void 0===n&&(n=i),this.dD&&n.category!==i.category){const t=Math.sign(i.category-n.category);s=n.category+o*t+h*(i.category-n.category),t!==Math.sign(i.category-s)&&(s=i.category)}else s=i.category;if(this._p&&n.value!==i.value){const t=Math.sign(i.value-n.value);r=l(n.value,i.value),t!==Math.sign(i.value-r)&&(r=i.value)}else r=i.value;this.cD.set(t,{category:s,value:r}),s===i.category&&r===i.value||this.ls.Ss(!0),s===n.category&&r===n.value||(this.nD=!0)})),Nh.fp(this.ap,this.rp),this.categoryAxis.cr(),this.valueAxis.cr();const u=this.categoryAxis.Ts(),c=this.valueAxis.Ts(r),{labelMarginBeforeCategoryAxisPixels:d}=this.vD(n,s,r);this.categoryAxis.Ae(u,s,r,{labelMarginBeforeCategoryAxisPixels:d}),this.valueAxis.Ae(c);const f=this.categoryAxis.getThickness(),g=Ct(u.nd+d,void 0!==f.min?f.min:0,void 0!==f.max?f.max:Pe),y={x:Math.min(this.UP.x.getInnerStart(),this.UP.x.getInnerEnd()),y:Math.min(this.UP.y.getInnerStart(),this.UP.y.getInnerEnd())},p=Math.max(this.UP.x.getInnerStart(),this.UP.x.getInnerEnd()),m=Math.max(this.UP.y.getInnerStart(),this.UP.y.getInnerEnd()),S={x:p-y.x,y:m-y.y};this.Fy.we(y),this.Fy.q(S),this.Iy.we(y),this.Iy.q(S),super.sp(),this.Vx(!1);const x=Nh.dp(this.ap,this.rp);if(this.UP.xi([this.Ft.bottom+this.Qo.bottom+("vertical"===this.ws.mD?g:0),this.Ft.top+this.Qo.top+x+("horizontal"===this.ws.mD?c.nd:0)]),this.UP.Si([this.Ft.left+this.Qo.left+this.ws.getHeight({x:g,y:c.nd}),this.Ft.right+this.Qo.right]),this.gD.kS({x:this.UP.x.Vt(),y:this.UP.y.Vt(),width:this.UP.x.Gt(),height:this.UP.y.Gt()}),this.zg&&this.zg(),this.nD){const t=this.SD.am(),e=1-2*this.fD;n.forEach(((i,s)=>{const r=this.cD.get(i);if(void 0===r)return;const n=r.category-.5*e,o=r.category+.5*e,h=this.JP?1e-6:0,a=[this.ws.toPoint(n,h),this.ws.toPoint(n,r.value),this.ws.toPoint(o,r.value),this.ws.toPoint(o,h)];t.add({vertices:a,bar:i},{fillStyle:i.Se,strokeStyle:i.xe})})),t.finishPlot()}s.finishPlot(),r.finishPlot(),this.nD=!1}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationCategoryPosition(!1),this.setAnimationValues(!1),this.valueAxis.setAnimationsEnabled(!1),this.categoryAxis.setAnimationsEnabled(!1),this}solveNearest(t){}dispose(){return this.pD.G(),this.gD.G(),super.dispose()}vD(t,e,i){let s=0;const r=this.rD,n=this.KP,o=this.valueAxis.getInterval(),h=this.ws.getWidth({x:this.UP.x.Gt(),y:this.UP.y.Gt()});if(r&&r.labelFillStyle!==z){const n=r.tickLength+r.labelMargin,a=this.ws.toPoint(0,1),l={Xc:t.map(((t,e)=>{const i=r.formatter(t,t.category,t.value);if(!i)return;const s=this.cD.get(t);return void 0!==s?{text:i,position:this.ws.toPoint(s.category,this.valueAxis.ct.Jt(o.start,-n)),alignment:a,rotation:r.labelRotation,sizePixels:this.MD(t)}:void 0})),cc:r.labelFont,ct:this.UP},u=l?this.uD?Ff(l,h,this.ws.getWidth):l.Xc:[];u.forEach((t=>{t&&e.add().Ch(t.text).we(t.position).Sa(t.alignment).Ph(t.rotation).Me(r.labelFillStyle).Ih(r.labelFont)})),r.tickStyle!==st&&0!==r.tickLength&&u.forEach((t=>{if(!t)return;const e=this.ws.getWidth(t.position);i.add({positions:[this.ws.toPoint(e,this.valueAxis.ct.getInnerStart()),this.ws.toPoint(e,this.valueAxis.ct.Jt(o.start,-r.tickLength))]},{lineStyle:r.tickStyle})})),s=u.reduce(((t,e)=>e?Math.max(t,this.ws.getHeight(e.sizePixels)):t),0)+r.tickLength+r.labelMargin}if(n&&n.labelFillStyle!==z){let i;"after-bar"===n.position?i={Xc:t.map(((t,e)=>{const i=n.formatter(t,t.category,t.value);if(!i)return;const s=this.cD.get(t);return void 0!==s?{text:i,position:this.ws.toPoint(s.category,this.valueAxis.ct.Jt(s.value,n.labelMargin*Math.sign(s.value))),alignment:this.ws.toPoint(0,-1*Math.sign(s.value)),rotation:n.labelRotation,sizePixels:this._D(t)}:void 0})),cc:n.labelFont,ct:this.UP}:"inside-bar"!==n.position&&"inside-bar-start"!==n.position&&"inside-bar-centered"!==n.position&&"inside-bar-end"!==n.position||(i={Xc:t.map(((t,e)=>{const i=n.formatter(t,t.category,t.value);if(!i)return;const s=this.cD.get(t);if(void 0===s)return;const r=this.JP?1e-6:0,o="bipolar"===this.ZP?Math.sign(s.value):"negative"===this.ZP?-1:1,h=this.ws.toPoint(0,"inside-bar"===n.position||"inside-bar-end"===n.position?1*o:"inside-bar-centered"===n.position?0:-1*o);return{text:i,position:this.ws.toPoint(s.category,"inside-bar"===n.position||"inside-bar-end"===n.position?this.valueAxis.ct.Jt(s.value,-n.labelMargin*o):"inside-bar-centered"===n.position?(r+s.value)/2:this.valueAxis.ct.Jt(r,n.labelMargin*o)),alignment:h,rotation:n.labelRotation,sizePixels:this._D(t)}})),cc:n.labelFont,ct:this.UP}),i&&(i?this.uD?Ff(i,h,this.ws.getWidth):i.Xc:[]).forEach((t=>{t&&e.add().Ch(t.text).we(t.position).Sa(t.alignment).Ph(t.rotation).Me(n.labelFillStyle).Ih(n.labelFont)}))}return{labelMarginBeforeCategoryAxisPixels:s}}MD(t){if(!this.rD||this.rD.labelFillStyle===z)return{x:0,y:0};const e=this.sD.get(t);if(e)return e;const i=this.rD.formatter(t,t.category,t.value),s=this.ls.wD.AD(i,this.rD.labelFont,this.rD.labelRotation);return s.isEstimate?this.ls.Ss(!0):this.sD.set(t,s),s}_D(t){if(!this.KP||this.KP.labelFillStyle===z)return{x:0,y:0};const e=this.eD.get(t);if(e)return e;const i=this.ls.wD.AD(this.KP.formatter(t,t.category,t.value),this.KP.labelFont,this.KP.labelRotation);return i.isEstimate?this.ls.Ss(!0):this.eD.set(t,i),i}qP(){return this.My.reduce(((t,e)=>{const i=this._D(e);return{x:Math.max(t.x,i.x),y:Math.max(t.y,i.y)}}),{x:0,y:0})}iD(){this.nD=!0,this.ls.Ss()}getMinimumSize(){return{x:200,y:200}}}const _f={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)},Lf={...Ko,mD:"vertical",QP:-1,tD:1},Df={...Qo,mD:"horizontal",QP:1,tD:-1},zf=(t,e)=>e?t.x:t.y,Of=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),Rf=(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(zf(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&&eOf(t,h,n,e))).reduce(((t,e)=>Math.max(t,zf(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>zf(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))/zf(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class Vf{constructor(t,e,i,s,n){this.coordsRelative="relative",this.coordsClient="client",this.Ti=!1,this.lI=new Array,this.P=new r.Eventer,this.kD=[],this.Lg=[],this.CD=void 0,this.TD=!0,this.FD=!0,this.ID=!0,this.PD=!0,this.DD=()=>{this.PD=!0,this.ls.Ss()},this.BD=[],this.OD=t=>{for(let e=0;e{const e=this.kD.indexOf(t);e>=0&&this.kD.splice(e,1)},this.Hg=t=>{const e=this.Lg.indexOf(t);e>=0&&this.Lg.splice(e,1)},this.RD=(t,e,i,s,r)=>{if(this.ED(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.lI.push(n),this.zD(n),this.TD=!0,t}throw new dt("Out of dashboard range.")},this.VD=e.numberOfRows,this.ND=e.numberOfColumns,this.ff=t,this.GD=e,this.WD=s;const o=this.ND*this.VD;this.HD={x:new Zd(new Array(this.ND).fill(1)),y:new Zd(new Array(this.VD).fill(1))},this.Ji=i.Ji,this.UD=this.Ji.dashboardSplitterStyle,this.Ze=void 0===e.disableAnimations||!e.disableAnimations,this.$D=qd(i,o),this.jD=i.rF("dashboard splitters",400001),this.Zv=()=>this.$D.hF(),this.Zg=this.$D.nF(),this.ss=i.ss.es(this,{YD:{}}),this.ss.YD.ys(this.Ji.effectsDashboardSplitters);const h=i.Ht();this.uiScale=ot.d2({scaleXYConstructor:_i}).bi(0,100).vi(0,100).q(h),this.pixelScale=ot.d2({scaleXYConstructor:_i}).bi(0,this.uiScale.x.getCellSize()).vi(0,this.uiScale.y.getCellSize()).q(h),this.XD=i.ZD.bind(i),this.KD=i.qD.bind(i),this.JD=i.QD.bind(i),this.tB=i.iB.bind(i),this.Vn=i.Vn.bind(i),this.Gn=i.Gn.bind(i),this.engine=i.$g,this.ls=i.jg,i.lo((()=>this.DD())),i.Ss(),this.sB(),this.setAnimationsEnabled(this.Ze);const a=((t,e)=>({on:t.on.bind(t,"resize"),off:t.off.bind(t)}))(this.P);this.createChartXY=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new Wd(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new ac(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new pu(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=Nf(t,this.GD,this.Ze),i=e&&e.type?e.type:aa;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=Nf(t,this.GD,this.Ze),i=e&&e.type?e.type:Ou;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=Nf(t,this.GD,this.Ze),i=e&&e.type?e.type:Eu;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=Nf(t,this.GD,this.Ze),i=t&&t.type?t.type:Xu;return this.RD(new i(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new Oh(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new Ga(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=Nf(t,this.GD,this.Ze),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return this.RD(new $d(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,e.axis,i,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=Nf(t,this.GD,this.Ze);return this.RD(new xl(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=Nf(t,this.GD,this.Ze),i=new Va(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e);return this.RD(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=Nf(t,this.GD,this.Ze),i=new vf(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a);return this.RD(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createBarChart=t=>{const e=Nf(t,this.GD,this.Ze),i=new Bf(this.ff,this.$D.oF(this.eB(t.columnIndex,t.rowIndex)),this.hB(e,this.HD),this.OD,n,a,e);return this.RD(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}eB(t,e){return t+e*this.ND}hB(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.ND:this.VD,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).nt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ND,y:this.VD},e),d3:()=>new rt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ND,y:this.VD},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.XD(t[0]),this.KD(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.JD(t[0]),this.tB(t[1]),this}getWidth(){return this.Vn()}getHeight(){return this.Gn()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.jD.Ss(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.jD.Ss(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.Ji}setSplitterStyle(t){const e=this.UD;return this.UD="function"==typeof t?t(this.UD):t,this.rB(e),this}getSplitterStyle(){return this.UD}setSplitterEffect(t){return this.ss.YD.ys(t),this.ls.Ss(),this}getSplitterEffect(){return this.ss.YD.xs()}setAnimationHighlight(t){return this.ID=t,this.BD.forEach((e=>this.ls.os.Ms(e.line,t))),this}getAnimationHighlight(){return this.ID}rB(t){for(const t of this.BD)t.line.Pe(this.UD);this.sB()}setColumnWidth(t,e){const i=this.HD.x.M();return t>=0&&t=e.length)throw new dt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.HD.y.M();return t>=0&&t=e.length)throw new dt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}getSizePixels(){return this.pixelScale.getInnerIntervalPixels()}onResize(t){return this.P.on("resize",t)}offResize(t){return this.P.off(t,"resize")}nB(t,e,i){if(i&&Math.abs(t.x)>0)this.oB(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.aB(e,t.y)}for(const t of this.lI)t.panel.X();this.DD()}aB(t,e){const i=Rf(this.lI,this.HD.y.M(),t,e,this.pixelScale.Ht(),!1);this.HD.y.S(i),this.DD()}oB(t,e){const i=Rf(this.lI,this.HD.x.M(),t,e,this.pixelScale.Ht(),!0);this.HD.x.S(i),this.DD()}lB(){this.BD.forEach((t=>t.line.dispose())),this.BD.length=0;for(let t=1;t<=this.ND-1;t+=1)for(let e=0;e<=this.VD-1;e+=1)if(void 0!==this.lI.find((i=>Ve(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Wi(new Yi((()=>{this.uB(t)}),((e,i,s,r,n)=>{this.nB(r,t,!0),Kt(n)}),(()=>{this.cB(t)}))),s=this.jD.De(this.pixelScale).Pe(this.UD).setMouseEnterEventHandler((()=>{this.uB(t)})).setMouseLeaveEventHandler((()=>{this.cB(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.nB(n,t,!0),Kt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.ID}),this.BD.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.VD-1;t+=1)for(let e=0;e<=this.ND-1;e+=1)if(void 0!==this.lI.find((i=>Ve(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Wi(new Yi((()=>{this.dB(t)}),((e,i,s,r,n)=>{this.nB(r,t,!1),Kt(n)}),(()=>{this.fB(t)}))),s=this.jD.De(this.pixelScale).Pe(this.UD).setMouseEnterEventHandler((()=>{this.dB(t)})).setMouseLeaveEventHandler((()=>{this.fB(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.nB(n,t,!1),Kt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.ls.os.ns(s,(t=>s.us(t)),{animationEnabled:this.ID}),this.BD.push({row:t,column:e,line:s,alignment:"horizontal"})}this.ss.YD.ds(this.BD.map((t=>t.line)))}gB(){const t=this.pixelScale.Ht(),e=this.HD.x.M(),i=e.reduce(((t,e)=>t+e)),s=this.HD.y.M(),r=s.reduce(((t,e)=>t+e));this.BD.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).Be(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).Be(h)}}))}uB(t){this.BD.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.ls.os.vs(e.line,1),this.jD.pB(e.line))})),this.CD=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.ls.Ss()}dB(t){this.BD.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.ls.os.vs(e.line,1),this.jD.pB(e.line))})),this.CD=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.ls.Ss()}cB(t){this.BD.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.ls.os.vs(e.line,0)})),this.engine.restoreMouseStyle(this.CD),this.ls.Ss()}fB(t){this.BD.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.ls.os.vs(e.line,0)})),this.engine.restoreMouseStyle(this.CD),this.ls.Ss()}setAnimationsEnabled(t){return this.Ze=t,this.getCells().filter((t=>t.panel instanceof Vh)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.Ze),this}getAnimationsEnabled(){return this.Ze}getCells(){return this.lI.slice()}dispose(){return this.Ti||(this.lI.slice().forEach((t=>t.panel.dispose())),this.kD.slice().forEach((t=>t.dispose())),this.Lg.slice().forEach((t=>t.dispose())),this.Ti=!0,this.WD(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return Fh(this.engine,t,e,i),this}mB(t){if(this.PD){const t=this.ls.ct.Ht(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=this.uiScale.getInnerIntervalPixels();this.pixelScale.bi(0,s.x).vi(0,s.y),this.P.emit("resize",this,s.x,s.y,e,i),this.FD=!0}this.TD&&(this.lB(),this.TD=!1,this.FD=!0),this.FD&&(this.gB(),this.FD=!1);for(const e of this.lI)e.panel.Ae(t);return this.kD.forEach((t=>t.Ts())),this.kD.forEach((t=>t.Ae())),this.Lg.forEach((t=>t.Ts())),this.Lg.forEach((t=>t.Ae())),this.PD=!1,this}Y(){for(const t of this.lI)t.panel.Y();return this.pixelScale.x.Y(),this.pixelScale.y.Y(),this.uiScale.x.Y(),this.uiScale.y.Y(),this}X(){for(const t of this.lI)t.panel.X();return this.pixelScale.x.X(),this.pixelScale.y.X(),this.uiScale.x.X(),this.uiScale.y.X(),this}translateCoordinate(t,e,i){return Lh(t,e,i,this.pixelScale,this.ls)}addUIElement(t=Qn,e=this.uiScale){e=_h(e,this.pixelScale);const i=Bh(t,this.Zv(),this.uiScale,e,this.LD,this.Ji);return this.kD.push(i),i}addLegendBox(t=co,i=this.uiScale){i=_h(i,this.pixelScale);const s=Bh(t,this.Zg,this.uiScale,i,this.Hg,this.Ji);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Lg.push(s),s}ED(t,e,i,s){return e>=0&&t>=0&&e+s<=this.VD&&t+i<=this.ND}zD(t){const e=this.UD,i=e===st?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.xa(s)}sB(){this.uiScale.x.zt([0,0]),this.uiScale.y.zt([0,0]),this.pixelScale.x.zt([0,0]),this.pixelScale.y.zt([0,0]);for(const t of this.lI)this.zD(t);this.ls.Ss()}}const Nf=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,disableAnimations:void 0!==t.disableAnimations?t.disableAnimations:!i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Gf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAACXBIWXMAACxLAAAsSwGlPZapAAAE7mlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4yLWMwMDAgNzkuMWI2NWE3OSwgMjAyMi8wNi8xMy0xNzo0NjoxNCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIzLjUgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMi0wNy0yMFQxMjowODo1OCswMzowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjItMDktMDdUMTU6MDc6MjErMDM6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjItMDktMDdUMTU6MDc6MjErMDM6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjIwMGQwMzM2LWEyOTktZjU0YS05MmYzLTg0NzlmNWM5MzEyMiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDBkMDMzNi1hMjk5LWY1NGEtOTJmMy04NDc5ZjVjOTMxMjIiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyMDBkMDMzNi1hMjk5LWY1NGEtOTJmMy04NDc5ZjVjOTMxMjIiPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJjcmVhdGVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjIwMGQwMzM2LWEyOTktZjU0YS05MmYzLTg0NzlmNWM5MzEyMiIgc3RFdnQ6d2hlbj0iMjAyMi0wNy0yMFQxMjowODo1OCswMzowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIzLjUgKFdpbmRvd3MpIi8+IDwvcmRmOlNlcT4gPC94bXBNTTpIaXN0b3J5PiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ptd9sFgAABOuSURBVHic7Zx7dFXVncc/55x77r1JIBBCSIhAkiYoQkArUhCrtrRVBHWm1WpptdbxMV1o26mOnXb6sEttq7aOVjtabWdq2/FZ2ooMY2tFK1YlgLwfCYQYkEdISEJCEu6957Hnj98+9557c8NjtY6sWfzWOuuce84++/nd399v/377XEMpBcAll1zCEFIEXGkYxidM0ywxDAPDMLISBHn4vo9SCqVU+tr3/fSR+9v3fTzPw/f9d5VSi5VSS3v6DL70qX185fN7YWCoKg0hBvx59zfZ0z+DiJk4zpffcxkNXIf0pwJeBt54X2sE44D/BD4PtOl7FcAvgWuA9uPJ7KqrrkpfR46S9gzTNH9pmuYZpmlimuYgUAFpMJmmmQaMYRj4vg9AAMbgdz7xff9GpdQS4Dql6Aw9GgZYQM9RW2aAr47WpPdN5gB3AY8DhcAS4Ebgt8g4VCGD2w+MAlJAn363DDiAALIUSOh01frcodOV6PdGAHv1vQ8AXcDBUF3G6XSTgTqddyD1+l4MOAXYg0yGglC6QmBkqIxBkh4Fy7Jyn401DGOJZVnjLctKgyofW4WPgIWUUscEqCAPANfj0oGk9RQwF+noawEDeCTvi2bo2oDGzktpP1xPxEwesbz3SWYBvwO+rH+PBc4DmhHWiABR4B912krgnxCWuxeoBTzgBeDbwBeA04A48BDwH8Bv9HsbgO8C9yOgjOp3lgI/A2YDvQh4VgBuqJ6nA+XAkwgAnwD+AvwQOBsB9+/08fhQjU0DyzTNrAeGYXwjANVQwMoFVC6YgrRyMvSRLb6ClGuQchSjhif46FkHLvzkBZ1vkWIa8LTu3EPZlRNmaj14Pnv7P4hpeHgqyu6+GRiG0m0/4eQMoFGfJwEfQgD1K0T1PA7cgoDhXgR0ceCrCGOMBq5CQHOJzuNfgGnA3cBLwFTgDgQMv0c64nbgIgRodcC5CHv6Oq/ncuo5C/gTcD0wAXgFAd9IhC0vBoYjQB5S0sCKRLJUSJFpmpdZlkUkEiGsBvMBK2wzBWnC6XzfwPMVGCoLwEqBaSjOPrWXOdPb+ci0TsrHpcBjJoovE+XhrLmEdFVP/ym82XYbnYm69E0DpZnqhARVFBmksQiguoCbgK0Iw/ybTtcC2MAmxAT4HjKwqxDmmgt8CgHNIeAfEBb7bwRohxBG8hHArQFu0GleAeYjTBSosH26rEAMBPi36zom9bs7EWa9BrgaAZ13pAan0WTbdvj+KNM0RwXAsixrEGDysVQ+UBmGQV8iwsVnrqeo0OapV2spiCZRymAgGeHSD7XwrRt2ilqzoKstwt2/ql5dEPUerq/rZ2pVP7atQIGvfOx4BVsPf4Oe5Fhs83it+/dNJiFGcT1iswTTZRRiI92PgOzbiB3WBExEwFGDgOpB/Xw3wnxjgOd1useAzyJg8BCAbEXUXZDmfuA24IvAu8A5Ov+1oXqW67p+Ved/DcJWTcBbyAT4JrDuaA0eCljKNE0ViUQGMRYMVoFiV/kYhpcFLMMwSLkRRtjbuGH+dgwjxrJ14+g+ZGFaJl7qAJfN2i3d4MO2HUX86+N1bGwpwDIVv10OhTEfwwCFwnUcPn3lAiZPHott9pNPtZ6gEgd+gcz8sHQBlwJfQwzxWxFjHoRZtiPgeAP4L8SWAlGZX0NWc1v1vX5EtYLQ9jXA13WaVQhr/ghZCH1S5/1DhLUCGQE8gADvcgRUd+ln3Qij3n8sDTYCw/n6668P3x9nmuZm27aLw4wVSLZdBYeTYKgU4OF5XuBCwFcGTduaue/6Vcw5zwUFz71UxyNL60kM9FI9aiPPfK8DTNi6Yzi3/HgKnT0mMdtZrRQzpCwpM5VyqKmp5uqrr8b3vbTBf1Lec/k7hOWqERX45lAJw+6GtMFj2/YxHQGL2bZNxC6gqyfF+RP/zDmnbcfxY5imiWVZ2LbNxs3vMO+DG5hzvguHgRRcOruV2opuWlr38pk5PTKPDFj02il09MQpjPtARqWaZnDArFkzsSzzJKj+b2UjYuBfwRFAlStDGe9pcORjLNM02d/Rx+6d6/n8R1dy1fwetu6YwBtNkzENWUW+va6REnszX79uQExAAB8KRrjMnriBFauiXDTbARcOdtmsbBzFsLiHYZh6ZZcRx3Goqamhrq4Ox3GOu2dOyl8lLfo4LhnSjxUAy7bt9DPLskgkkqxe24zT08CdN7RwzgwgCTVlbZSPPER3/wgaGzfzbutWXnygj8JiJWwVSALmn9NDaXGMgiIFJry1ZTT7DxYQt1N4nthmYVYyDIOZM2diWRaed8TFyEk5QeSIwApUXjQaxfM8du3aw8o1Wzmrags/uHU/ZeWkwy7xohT143fz0+c7Wb1qI9//4gBnTXcyvmMDMSk9qCjz+fuPHRbfbwSWravANBlk+AO4rsuECROora0Ns1UR8A1Ekf4AMSzD8jnEH/ME8PZR+qAcMYTfAX4yRJpPI36lx8leng8lBvDPiOf6Po7goT5O+SCymhuNuBQMJCLxKGL/1AHfRxYFf0tZCJwK3EMm9APSvuHIqjFLzQzpIA3bSr29PWxpfIe9e3Zzw9xmFl6+X5oUZiITqkaspqFhGBfNcrnlswOZWJ+BrEU8XbyvDxve3VPEhndKiNl+umphxvJ9n8LCwly2qkOWvYcQ52Cu3I74Y54/Soeh090KLGJoYH0FcSz+8hjyA3Ek3ou0/N5jfOdIUgD8O+J2yJXNiJP1AaSHv/03KC8sFnAn0qa7QveDCMF+neYeyITihgysGYaB4zh0dHTQ+m4ncfMA9y9s4sNnd4jNlBulcWByVQ+zptjcs7CPSFRJRAsgBo8+PYyPn51gYo2b8eJY8Nqmcg4NRCmIJhlKy0UikVyDfbI+v40sx8NiIt7nOLJcDqQAiXEpMvzZhYQwQIzUEn0dMGAE8efUIMv5XmRJ3od4ooNKGfpZQKkOstzvRmb4MOmFdNkpcqMJIiN0mUE6R+f7IAKq3QhTbyMTyjiAMEccMa7jup0HyTgxLZ13IAYy7cPUMFKnAxndbkQj1Ot+CZh6GBJemqnTDUPY/grEnwaEVoVB6EYfllLK6unppaPLYVp1Fw/d3MCHp3dIVfKF/jwYORx+dcdBJtemMqCKw7pNcW5/uJglbxRI9+qS3cMGyzdUYEcGZxhWi5WVlbmMeqY+b85Tk8AZeC0ChmJEVbQgzsmdupP+gHRwAKzvIAPXBLxIJoTShHjHi5AQyCPAdJ1Hi36nFViPOClBQiZ3AucjIPk94tTcjfiIGoGf6zzR+b2k67YH8XJvRlR0DeI9d4HPIP6slUADMnGayUy02bqMFsTrPlff/5i+Hxy7dP1v088rgNUIYIP+uRsJA72O4KRe1/123TcNul9ORQLqY8KDkB4t04qnD9u2I4qInXKjXDy9ke9e8yqnlPdlwDKEGEDVeDczT0xwEhZPvX4ew4tH8tzLNskeU0qNwNbWkTTvK84LrKPINH3OZ+9MQWaUq6u0CPHD7Edm1ItIR6aQQZ9KJrD6W/3eXIRxNur3QTr+h8CvgbN0Hi3AU8hAn46wCcAMZFfBQWQqzUZY5DfAYgTs1yNquAoB1ScQxnkMAWo5MsiXIj22mqG32UzR59eAZxCn6TQyarENAcp39PGkrt99iPe/WvdZC+JErUScqOsRAIFMxB/p/msELgD+iMRzb0FYKy1pYJUUdlNS1M3weC9Jx3Ys0+Wa85dx3YWvE4u4GZIPS4zsHQaQnc6G59+oZ3vbOD50Vh3Ne4t4eaUtZG3AK+srSTkmxlHiezkLizgSdgDYkid50MmvAxciA/YKMthfIRM8Xa1rPwkxrq9EvNQ/DYpFGCro2KeRQfkDEuUH+BbCJjfq34FqCRhkFTJghcCrCIsu0PUBMSq+iQzubcA8XccgzNKIqBw48t6tYKLdjgD2i6H80e14EgnLrACeRbbaBBH7oD+fRmy1TsTMeJbM5P2xbv8KhFWfQQBZp39nBbPTNtZXL3wUDEi5Ud7trBwbtxNWdeVuAUq+cS+EJS8VUjvOYfJEZzDwbGjeOZrnG+qxrQSWXUht7USe/OMh5s9J0t9rs6JxDNGI0Fuu0zPw7kejUSoqKsKG+wRgPGIjbMtTs3p93gxcpq+fIFPD2fq8FrFNRgHLQu+fps8b9XmWPjeG0gTAadXniaEyg+cKAf55+l4wCUydPthTdTECyPDCYDpicOxEGA1EDeUTE2FLBxlgyABlPWIn/R4Bba5sR2ypM/XvnYj9OFnXDWRChtsayAsI0xaSZxWa8bxHXGzLpSg+cNGk8c2Lqst3W2llkSsFsPiPMRbcMZJX345J1XNydVIWv1g2k0TKwjR8XNdlXGUpze21tO6ATe+UsvdAIZbpp0GVe8691jKJjJE5Ok/tApupiRy9ryVgtA2h62BWGvqe0u+DqErIAGM4Yld0ILZKOM1aRM1VI6q3DXERhMuoQNRQM5nFgE9mLAoQltuDMGl4gHP1A4jKrEFU0X59L2CwBkSlzUPU1hRk4gQM26zPZ+jzdsSQadflluj0XeSfxAmGcG1kVoUyfhaKB/EZly8xADFYv30Sd/66iFRyF29sjHGz05edxobFf5nK1l1jiNmH8X0dtPY9ho0Yz5KGNvrdMag0Ew8GVcBYsViMWCwWBlighgL18hpiL3nIkvwDyIDtQtTdFUhUfhZC8R/WHdJMZhYH7DQa6ch9yMCaZMB7D2KHbUaW3m+R8dKdqc/r9Ps2MkgKsccgw3jB7swWXU6TbtP/ICpyOLLSegux9xYhKv1zCGB2IRPARFTXRp1fIxnrNgDzZv0eCDN/UqeZHmq3gUyMPjITJZARZFbKDyL21Yscg+S6G8oQwy2/xGBN00SeeO0ipk4boKPjAKu3DNCx36KszJNuiMIOrQKjdnLQ/veiuOKVTfW4niJuu2nQwWB28jyP4cOHM2LEiPAu1BJkJispjQt15+xDBsFH7AMH2Q1wGmJn3Rh6Zxuy3A9AGLDJOKQVq8iozp8g20jmI53fqc+B7QWiUrsRVpurnweujgqEuYKwSOC6WKXrc6Ou5xn6CNg4YMifI+C+FlGhAaMaCLDG6fxW6vQ2Mo7tyArwGWRj4DSE9ZRuY69+ZxRiizWQvX0ZRP0+ijiIv4So7GMCVnp3A28bIF7d/IHGGLzdWMvPXr4QX5nEYyatra38eXkDT9/Vy/yPJSAJjmfx3Sfn0rinlKiZxMv+aALf93BchfJ9lArthMhK469WSs0I9notWLCACRMmBJ73AsSAz9WRDgKqUt3R3Tpt4IsqQlZYd+vOXoAMWBRRIZ7OdzQCjHAnlyAD2Y8MfCmiAgI1VUEG3MXITA+eVyIDGXyYEDzvROxEU5c7Rj+7D9nxeSWyigwkioDA1G03dZ4xXb8DyMCbOi+lnyudplTnE4ASRJ37utwkQ3++Uqbz6DpCmiN+THFq3jdisGpLDY+9NAdf+UQsh0TCoLKyknHja3h55Sbmf1ya/vyyejbvKqMgmsDzsr/IkUNh4ON6Dq7r4nkeiYT4MaLRaNZeL4BkMklDQwMTJkwIanOYbMderuzWZwPxr1xAxrVQhHT293WaAznvJkLvhyU3ZJTbueEwRy/ZTtvccE74eS2yeo0iE6MIUYV/QnaFhiWVU04gDhmVDAKU3HTJPPUIS277cqXjKM8HSS6w6geliEHDpmoe+cMFKOUTsVzc0HbhqVNOZfOudvz+d9jZMZrfrZhCNJIcBKgwYFzXpby8PB3knjRpEu3t7SxfvjwrLch2nm3btrFz506qqqqOZ3eDiQzQBjIzfA9iJx13tP49Eg9Zpgfsq5D6PsuRJ88JL7nAOj3rVxzWbqnkxy/Mxscnarm4KnvDXzwWIVY8mTVN7SxddxaHEwbRiJNWgfmOZDJJTU0NY8eOpbS0lPXr1zNv3jzWrVtHZ2dnVqwwCC2tWLGCqqoqjkM8/jZxuvdSWpGPRf7fSSTnui79Kw5rtpRz36JzSHk+MTuJ68lqN7xF2fM8ioYV87NlF9DVNwzbSuJ5+T9OzWWtRCLB4cOHaWtr44UXXsDVVBhmLKXUX8NaJ+V9krBfpBK0m8GG1RvHcNeTM+gbUBgqheO4OI7YRcE5ODzXof1gEb7nprcmZ21Rzvny2XGc9AeuixYt4tprr2XNmjV0d3cHn46Zud8rplIp3nzzzbwfzJ6UE0/CwKoGirDgQFfs9e89Pe1A34CBaaSygOR53iBweZ4HyskLptxVn2VZlJSU4Ps+lmXR3t7O0qVLWbhwIUDwsWsiF1i2bdPY2MiOHTuIRnM9siflRJMwsCQMYLP0zU1l89o67bWWmcJ1sxnIcZxBrDTUkctWjuNQVlbG5ZdfTl9fH0opbrrpJlauXIlSitLS0gBYr+dTo77vs3jxYnp7ewftHzspJ5aER+c8YDmKK9c2j+xTvvtwWN3lMlYYQOHfYXbKBZdSip6eHqqrq7nsssvYt28fruty8803U1xcTH9/P0qpXqXUY/kqG4lE2L9/P2vXrj3JWie4hI33Ncj/CgwoFAq1xPO8O5VS3wlWafm2DgeSG4oZ6vP7zs5OHnroIYqKimhpaSEajVJZWUlnZyf9/f0JwzC+QM4WjKwKRyI0NTVx7rnnDtobf1JOHAkD64HgIoCMUuoO13W3GIZxq2maUw3DKMj3xyBhyQesXHC1tbXheR6madLf38+WLVt6gb+YpnkX2bs+B4lhGCSTyaz/hjgpJ578LzXVOI5QBFhrAAAAAElFTkSuQmCC",Hf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5goDBwssgK9G3QAAEq5JREFUeNrtnHtsFNe9xz8zsw9717s2Zv0Ib0LBJEAOIQkl0Eua3Ju2N6LcNmracG9VqWpVqWrzb1QpUh9qm6pKpVaR2ihR1fSPKgVKm5oktzeBAMmlkIILHGxMCGAMfuHX4rV3vd7HzNw//Ju9441NTJq2AXGk0T7mzJkz5/c939/vfH9n12AW5aGHHlpqmuYi0zQjxmRxAQzDwHVdAFzXnXI4jvOu1xkOw3Ec13GctOM4nceOHeviBi1a6zrgDsABTKBVKTXwT+7TfGAt8CellCPffQRYqpTa837bDbxXhS1bttxrWdYK0zQLlmXlAFfAVQKU9+oHkWmaOI5TAp9hGFMOrwhIDaAWWLpmzZq21tbWY975tra2EFANJFevXm1f59haA8wF2uWZPqG1blZKjWmt5wEx4LxSqqi1rgXGlFIFrXUIqFBKjYrh5yqlhrXWVcBCoMd3LgpEAVMpdVlrXQPcAnQppdI+QDUBw0ACwAOVlFogqLVeDEwopfrlXqbvPjEgrJQaumZgbd26VVmWtdKyrGHLshzTNEuAmomtbNt+F5gcx5m2fcMwsG0by7IAcplMxrp8+bJatmzZ2PPPP9+1cOHCNZlMJgK8Dbg3AGnFgf1KqUExzmKgRmu9FFgGZIEmrfVeQAFdwDngE8Jwu+WalVrrd4BbgXFgqdb6mFLqMvAQEASOa60rgI8AGanzFjAKfBrIAY3AAuB4WT8rgBpgKdCgtT4MhICVwMtaawv4d+AIcG3A+sxnPlNlWdaKQCAwYlmWa5qmYZpmCSzloPLYygOSx1Z+EE1MTGBZFpZl4boupmlimiYDAwOk02mjsbHR/uxnP5vcunXrbbfeeus9uVwuHQwG32hqakrdAG6wQsZ7kdZ6DrAE6BF2aQKalVJ5rfWnxIBJwNBaVwN1QKfW2pS6F6VOVsDXKGBLC6heEhb8L6BT6iwAbgcmgLTn5rTW/wn4mcwUUB1VSp3VWi8A7gIOiWcBuAcYUkp1XrMrDAQCtwQCgVAgEJgIBAL4QeUv5THUdO4uEAiQTqeprKwsMZppmgCMjIywfPlyHnzwQdatW2c0NTXZhmHE2tvbL23atOngDRRi1Yhh4uJqssCfgbuBlFIqL/WCwkJXgNXAYuB1YI4w1xDQIXFRh9Q/JyBdCgwKqBrlfpelTrtcuxFoERCF5F7+iVsNVCqlzsrnSmHLJJDSWn9M6rz2vmKsUCgUDAQCBAIBLMsqsYtXPKbyx1KmaZaA4xXTNEmnJyfEt771LV544QWOHTvGnDlzyOfz2LbN448/zqpVq5iYmCCXyxlPP/201dzcfOEGi92XAwWl1P4yJusClmmt7xX2soB3gLC4w6NKqUsSUN8OPCPMNgrUAyMSIyWlDQ8kKTlXJyAuSqx0CdgkrnQ54Cil/MCqF/f8McCWOgeVUrbW+oqAe7tSqnC1hzVnOhEMBp1gMOgGg0FCoRChUIhgMDjl8IAXDAZL7s4DogfGSCRCR0cHn/zkJ1m/fj33338/tm0TDAbp7e1l5cqVLFmyhKGhIVKpFN/5znf49a9/7RSLxegNBqxLwNHyL5VSfcAeiWFGgZclkC4A/+OxC3AGeFEplZXPeyVOmiPXIax0StrNSrseC43J938FTgpw24D/LetSCnhZmK4C2KuU6pBzc2Ul2/NeD2vMdOIrX/nKymAwuC4QCIz5XaF/Beg4DuFwmOHhYYrFYsnV2bZNsVikurqa/fv3s2zZMp599lnGxsYIh8P8+Mc/5vjx45w9e5annnqKLVu2MD4+zo9+9CNefPFFFi1aFDMM4+iRI0fOcrN8GOLDlSKTjAL7fG77fTFWiY3KGcqyLKqqqqitraW9vZ3Kykq+/OUvE4/HyeVyGIZBIpHg5MmTDA4O8t3vfpdisUg2m8WyLD7/+c9z+vRp5s+fz/33308ul6Ojo4NDhw6xYMECAoFAaXFws3woSo8w557ZgOq9gnc8NxgIBEorQcuyqKmp4cKFC+zbt4+NGzfy2GOPUV9fT0tLC52dnTQ0NHD+/HkOHjzIs88+y5IlS+ju7sayLEZHR1mxYgX19fVs2rSpBMa//OUvZDIZbrnllnfFaTfLP7copcY8V/o3C6SWZZXA5b2PRqMUi0VeffVVWltb+epXv8rXv/51stlsaXXX0dFBX18fzc3NbNu2jc997nP09vaWAn/btslmszz99NNUVFQwMjJCoVCgpaWFaDQ6RZ64Wa7fclVgeYCqrq7Gsiw6Ozt55ZVXcF2XZ555hs2bN3P58mUKhQKhUIimpiZ2797Njh07WLRoEU8++SQjIyPYtl1yofl8nnQ6TVNTE4VCAcuyOHnyJOfPn6e6unrWoNJaN8hS/ZxS6kzZuSCwCSgCh8pU5enamgesA/4qwfR0dT4q43X4vdqT+lXAx2T5/9cPKNYJiuCZEAnBASLAWdGcNotaf/wDjrEMYIN8fEsp5frOzZeVbK9SqviewDIMA8uyqKioIJ1O09rayltvvcWGDRv4wQ9+QHV1NV1dXSWZoVgsUl9fT19fH47j8POf/5xoNEpvb28JqJ4rdV2XTCYDQDQa5ciRI+RyOaqrq7Fte7bgmidaznRAqJRUR/9sQCBa0UrRlaYbWFOAd3GW7SHSwaJrdSFXMW4t8ICIocMidHq62GkRYO8G3vo7EdBdAmBX+lMJrBJQ5WTFeHw2KR3XdV0GBwdpa2tjcHCQxx57jC9+8Yvkcjn6+/un6FqeWHrPPfdQV1fHhg0b6OubtHltbS0HDhxg586d/PSnPy1pYKFQiKGhIU6cOEEsFrvWh40Cg0D/NOfs8nSDgKNWFiyODEhWcl+VQC8Q0VoHRPO5ItfFBKRZEQgbRR+ypT1bDGwAw0opL5+ZA94Eun3AsHyr8azELuXqvDcQjtgnKcy7WTSpN4G3RcsyAEMp5Witb5XUTVZrnZDnLPVHax0Wkdbf3zFPvpA0zRy5zgRySqkrWuuIpI4ywKjv+efI8xTkc2hWrjAcDgdyuZxx7tw54vE43/jGN1i/fj2pVIpcLvcuUAEMDw/zyCOPEA6HGRwcxHGckv71y1/+kjfffJNvfvObrFq1iuHhYaqqqjh8+DDd3d0kEokZc4ozUHO1pCLSMzDQfaLjDEtaYqPM7qIYPSKz+5QMigv8q4xJUWv9tuhOd4pIOADMZzKR/KJc/28ysF4Z0VoflMTscmHUnQLqB0UXMrxZrrVuVUppeabbhRVCYvys3OMPMokWAO1KqZO+oNrl/3OocVHRbxdhtbw/q4B/ERAYAp6s1vqIUuq8uNdPyfi4gKm1PiKT5zaZpIuk7d9L/7IyEUJl6v3MwHIcx0wmkzQ1NfGFL3yBhoYGhoaGSmq7Pxbz3Jdt24RCIRzHIZ/PYxgGsViMffv2kcvlANi+fTs/+clPME2zFLS/j2C9SgZyptVKjbz2yYx7SDSYN2TwF4rRBwSkCXGpZ0Q4XC0GOgNoGehlwGExzKAANS/gHBfQ3c3kToIhmdF5ue8cmQjtwAUByjpxv1prvUhAeo7JhPuEANiS9yuFwS5eZUziUueITByvP4ulP6fl3h6jeq51NXBeQFwF/EkmyzZR4dsEOEuZzBeOSXtV8qxvSz9X+b3HjDrWxMREbt26debXvvY1amtrSSaTUwBg2zbRaJSKioop6Z1isUixOBnDVVVV0dPTw44dO1i6dCl33nknL730EhcuXKCuro6uri7a2tqoqakptTHLUi0Plpoh5omLC5kQYc8EXldKnRXVuCAzMylt1TC59aRbZu+YGCAn6Q6PGc4ppby4rV7uf0Yp1cVkohcf0OPAFWGVWjFOh1KqRyn1jhg/JQH5XWKUV5VSHUqpXpn0KR8IRr30zQwxYC2TyeWzSqlLPhBmfUp8WPpdJ+yZFRfnjaktz9Erk+q8UspjOEfavqyUcsWNt8gkqQRaZ8VYDz/8cH1DQ0Petm3Gx8ensJRt2zQ0NHD06FG2b9/OE088UYqxPGU+GAximia/+93vSgnoO+64g87OTv74xz/yxBNP0NLSwvDwMA0NDSXWm2WJy8AkpxnkChmkYVk5LQAueVtVfPmwlOS/5spMz/hWXrVAUik1IfUbgQFfvBITYF8sa7MADEqcFhcG8oCRFaAje6SqmUwiR+XaFl/7UbnmrLRZKUYfv0q8GZ+hPz0yJv8h7aTleQ0ZnyFfH8eAoFJqHGj2jUeDhALl+tawjPN7K+9tbW2h06dP39fY2LjQtu1MPp+fAirHcairq6Ojo4MvfelLbN++nZGRESKRyFTLx+O88cYbnDhxgkQiUVLeV61axfHjxxkYGODUqVOEw+EpbFX+ehVgTQB1EpSWn6uS2Z0Tmq6UVYw3u+cwuXvAy39N+Jgm5rGN1J8j342X3SNSFlfMATJKqYy0WeG7h2e0tO8eETmf933nB0qVMJAj7FoJ3CqgRWttyLN49SNljFYj16fErTcwuRdsl1LqD+Li475r5gAjAirKnivmY7b3rWM12ra9zLbtwUnPZ0wBVSwWI5VK8atf/YrR0VEcx6GlpYVt27YxNjaG67rEYjF6enpobm4uiZ6u65LL5UgkEmSzWZ5//nkGBgaIx+PXBCoZzHkyg5cA9VrrjBhCC5gSTO4kcGX3wF3Ap7XWw+LSLN9MXSzGTfuAVudL/noDsEhrvQU4KEb2YjxvVi/wgc/bDeox6kLgsi8dUi/ni0qpca11L3Cb1jou/Qj4gmMvAd0A3MvkvitbSKFCa/2iAMtbzCDgW+i7PiostUI0O0fas2VxE5SY7OR06oA3TtK/E+KqrzlXGBXjvEtKiMVijI+P84tf/IJQKMTDDz8MwOHDh0tbZ0KhEIZhsGvXLsbGxohEIti2PWWHqWVZHDhwgPHx8ZKu5e3r8h8zpTF9gfZpeT8urJOX4x0JsFFKHZLVYZ+4hgqJNTyGugKc8Yl7jrigfrk+KfpWv1xryj3e9rmBkAD1HflclEDdM1q/BMheyctq1GOB/5ZFQMrHTrYHFBGA90j7Y3JdRoBbkD6f9k2WsLz37nlSJp0nKSRkvNokVopIbHVpGnc3KJNpUOrNapVlTOMK18sKKF0Oqmw2y3PPPUdvby+JRIJ4PM6uXbsYHx9nz549BAIBYrEYe/bs4Te/+Q1z584t7YKwbXvKa6FQKLXt/16OmG3bR48ePfo3724QF1gQQAaBj8oKZ5eA5u+9M8DwK9XTnLcEmEXpX4VIEy7wB7+a/c/q4weV0on6lqQ4jkM8Hi8xVU9PD4lEglwux9jYGA888AC//e1vOXToENu2baO9vZ3m5uZSzFX+qxyPjQKBAMlkEsdxyGazJcabO3duSZr4gNTqrWKkvBjOAt74R4DKpzVdrSwTqSElzFMhHmP/PwJUs+zj3wYs+UVMVGYPjuNQU1NDJpPhZz/7GT09PTQ0NJTYJp1OE4/HWb58Oe3t7ViWxY4dO0ilUtTV1VEsFt8FKM/tZbNZNm/eTDKZZN26ddTX17N//35ef/11qqurP6htM1nggG+iGBKgjn6I8rX9TG7oy/sU8X6lVI7ruASmER4rgIIHqnQ6zVNPPUV3dzeNjY3k81O34ySTSRYvXgzACy+8QGtrK7W1tVNANd2RyWRYu3YtiUSC7u5uent7efTRR9m1axexWOwDAZZoN50fZgPIqu26/7HIbIAVdBwnV1NTY2QyGfeHP/whly5dYv78+SU1vXylWFlZSX9/P+fOnSMajZaCdD9blQPLMIyS8r5y5Up2797N3r17mTdvnlf/5r6Z67iUrwpjrusSiUTCyWQy/L3vfc85e/YsdXV15PP5kqpeKBRK723bplAokM1mS9uXve+nYyrLsrhy5Qqjo6MkEgn27t3LwYMHefzxxzl8+LC3e9Rwb24hvaGAFQVikUhkYOfOnWeOHz9eWV9fPwVIHmjK33s48INqOnClUinWrFnD4sWL6evrY+PGjezevZuLFy/y/e9/n66uLi8Wm7hpnhvHFd4SDodHe3t7//zkk0/aGzZsuK1YLAYMwyjO9BP5KUpamQ413f84dHd38+1vf5tTp07R19fHxz/+cerq6njttdd49NFHXdu2KxzHGXddd+CmeW4cxgqGw+E/3X333TZAMBh8u1Ao1Ni2bRSLRdf/Cxzv/XSHn6HKP0ciEfbv38/atWuZN28ezz33HLW1tTzyyCPuwYMHrUAgEHNdt/3kyZO5m+a5fotRJjckVq9ePeW3+Pfdd9+9pmmuME2zYJpmzvsTj+lYqzznNx1rGYbBlStXqK+vZ2Jigu7ubrexsdGorKys6O7utiKRSJvW+thN09xAwJqpbN68ealhGItM04yKKywF1v7/cbgauDxgeXHYxMRkCBUKhYxsNusWCoV0MBjsbGtr67ppluu//B9N0zw2U/fnYwAAAABJRU5ErkJggg==",Uf={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)=>Uf.multiply(t,Uf.translation(e,i,s)),xRotate:(t,e)=>Uf.multiply(t,Uf.xRotation(e)),yRotate:(t,e)=>Uf.multiply(t,Uf.yRotation(e)),zRotate:(t,e)=>Uf.multiply(t,Uf.zRotation(e)),scale:(t,e,i,s)=>Uf.multiply(t,Uf.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],y=e[13],p=e[14],m=e[15],S=t[0],x=t[1],b=t[2],v=t[3],M=t[4],A=t[5],w=t[6],T=t[7],E=t[8],I=t[9],C=t[10],P=t[11],k=t[12],F=t[13],B=t[14],_=t[15],L=[];return L[0]=i*S+s*M+r*E+n*k,L[1]=i*x+s*A+r*I+n*F,L[2]=i*b+s*w+r*C+n*B,L[3]=i*v+s*T+r*P+n*_,L[4]=o*S+h*M+a*E+l*k,L[5]=o*x+h*A+a*I+l*F,L[6]=o*b+h*w+a*C+l*B,L[7]=o*v+h*T+a*P+l*_,L[8]=u*S+c*M+d*E+f*k,L[9]=u*x+c*A+d*I+f*F,L[10]=u*b+c*w+d*C+f*B,L[11]=u*v+c*T+d*P+f*_,L[12]=g*S+y*M+p*E+m*k,L[13]=g*x+y*A+p*I+m*F,L[14]=g*b+y*w+p*C+m*B,L[15]=g*v+y*T+p*P+m*_,L},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],y=t[13],p=t[14],m=t[15],S=d*m,x=p*f,b=a*m,v=p*l,M=a*f,A=d*l,w=r*m,T=p*n,E=r*f,I=d*n,C=r*l,P=a*n,k=u*y,F=g*c,B=o*y,_=g*h,L=o*c,D=u*h,z=i*y,O=g*s,R=i*c,V=u*s,N=i*h,G=o*s,H=S*h+v*c+M*y-(x*h+b*c+A*y),U=x*s+w*c+I*y-(S*s+T*c+E*y),W=b*s+T*h+C*y-(v*s+w*h+P*y),X=A*s+E*h+P*c-(M*s+I*h+C*c),Y=1/(i*H+o*U+u*W+g*X);return e[0]=Y*H,e[1]=Y*U,e[2]=Y*W,e[3]=Y*X,e[4]=Y*(x*o+b*u+A*g-(S*o+v*u+M*g)),e[5]=Y*(S*i+T*u+E*g-(x*i+w*u+I*g)),e[6]=Y*(v*i+w*o+P*g-(b*i+T*o+C*g)),e[7]=Y*(M*i+I*o+C*u-(A*i+E*o+P*u)),e[8]=Y*(k*l+_*f+L*m-(F*l+B*f+D*m)),e[9]=Y*(F*n+z*f+V*m-(k*n+O*f+R*m)),e[10]=Y*(B*n+O*l+N*m-(_*n+z*l+G*m)),e[11]=Y*(D*n+R*l+G*f-(L*n+V*l+N*f)),e[12]=Y*(B*d+D*p+F*a-(L*p+k*a+_*d)),e[13]=Y*(R*p+k*r+O*d-(z*d+V*p+F*r)),e[14]=Y*(z*a+G*p+_*r-(N*p+B*r+O*a)),e[15]=Y*(N*d+L*r+V*a-(R*a+G*d+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 Wf{constructor(t){this.yB=t}}class Xf{constructor(){this.SB=new Array,this.xB=t=>(this.SB.push(t),t),this.bB=this.xB(new Map),this.vB=this.xB(new Map),this.MB=this.xB(new Map),this._B=this.xB(new Map),this.AB=this.xB(new Map)}wB(){this.SB.forEach((t=>{t.forEach((t=>t.wB())),t.clear()}))}}class Yf{constructor(t,e){this.Jo=t,this.j=e,this.kB=!0,this.CB=null,this.TB=null}}class jf{constructor(t){this.FB=!1,this.IB=1,this.PB=t,this.DB={Jo:u(0,0),j:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),kB:!0,CB:null,TB:null},this.BB=u(64,64),this.OB=new Uint8ClampedArray(this.BB.x*this.BB.y*this.IB)}LB(t,e){if(!t.kB)return null;if(t.CB&&t.TB){const i=this.LB(t.CB,e);return null!==i?i:this.LB(t.TB,e)}const i=c(t.j.x,t.j.y);if(t.Jo.x+t.j.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.BB.x-t.Jo.x-1),t.Jo.y+t.j.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.BB.y-t.Jo.y-1),t.j.x===e.x&&t.j.y===e.y)return t.kB=!1,t;if(i.xt.j.y)),h?(s=new Yf(ri(t.Jo,{x:0,y:1}),u(t.j.x,e.y)),r=new Yf(ri(t.Jo,{x:0,y:e.y+1}),u(t.j.x,t.j.y-1-e.y))):(s=new Yf(ri(t.Jo,{x:1,y:0}),u(e.x,t.j.y)),r=new Yf(ri(t.Jo,{x:e.x+1,y:0}),u(t.j.x-1-e.x,t.j.y))),t.CB=s,t.TB=r,this.LB(t.CB,e)}RB(t,e){const i={EB:!1,Jo:null};let s=this.LB(this.DB,e);if(null===s)for(;null===s&&this.BB.xthis.PB||t.y>this.PB)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.IB);for(let i=0;i{this.yB.YB(t)})),this.HB.clear(),this}XB(t,e){const i=this.WB.get(e);if(i)return i.get(t)}ZB(t,e,i){let s=this.WB.get(e);if(s||(s=new Map,this.WB.set(e,s)),s.has(t.glyph))return $f.Success;const r=this.UB.RB(i,t.size);if(!r||!r.Jo)return $f.Fail;r.EB&&this.KB();const n=this.UB.NB(r.GB);if(!n)return $f.Fail;let o=this.HB.get(r.GB);if(!o){const t=this.yB.gl.createTexture();if(!t)throw new ft("Failed to create texture for font!");o=t,this.HB.set(r.GB,t)}const h=r.Jo,a=n.BB.x,l=n.BB.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,y=(h.y+t.size.y)/l,p=(h.x+t.size.x)/a,m=h.y/l,S=[g,y,p,y,g,m,g,m,p,y,p,m],x=[u,c,d,c,u,f,u,f,d,c,d,f],b={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:x,texCoords:S,packerId:r.GB,texture:o};s.set(t.glyph,b);const v=this.yB.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.BB.x,n.BB.y,0,v.LUMINANCE,v.UNSIGNED_BYTE,this.yB.qB?n.OB:new Uint8Array(n.OB)),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.EB?$f.Resize:$f.Success}KB(){this.WB.forEach((t=>{t.forEach(((e,i)=>{const s=this.UB.NB(e.packerId);if(!s)return;const r=e.origin,n=s.BB.x,o=s.BB.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 Kf=t=>{if(t instanceof _i||t instanceof yu)return t.ni()?"linear-highPrecision":"linear";if(t instanceof Li){const e={};return t.x instanceof vi&&(e.x={base:t.x.qt()}),t.y instanceof vi&&(e.y={base:t.y.qt()}),["logarithmic",e]}return"linear"},Qf=t=>(e,i)=>i%2?e:e+t;class tg{constructor(t){this.JB=new Map,this.QB=fe("font"),this.tO=new Map,this.iO=new Set,this.yB=t}jB(){return this.JB.forEach((t=>t.jB())),this.iO.clear(),this}sO(t){this.iO.add(t)}eO(t){this.iO.delete(t)}hO(t,e,i){const s=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let r=this.tO.get(s);r||(r=this.QB(),this.JB.set(r,new Zf(this.yB)),this.tO.set(s,r));const n=this.JB.get(r);if(!n)throw new ft("Failed to get font texture!");let o=0,h=0,a=0;const l=t.split(""),u=e.size,c=.7*e.size,d=Math.round(1*e.size);let f=!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)}})(a,h-o+1,i);return{x:g.x,y:g.y,isEstimate:f}}rO(t,e){const i=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let s=this.tO.get(i);s||(s=this.QB(),this.JB.set(s,new Zf(this.yB)),this.tO.set(i,s));const r=this.JB.get(s);if(!r)throw new ft("Failed to get font texture!");let n=0,o=0,h=0;const a=t.split(""),l=new Map;let c=0;const d=e.size;for(let t=0;t{t.$o.o=!0})),t=-1,c=0,o=0,n=0,l.clear();continue}if(a===$f.Fail)throw new ft("Failed to create glyph");if(h=r.XB(i,d),!h)throw new ft("Failed to get glyph after creation")}if(""!==i.trim()){let t=l.get(h.texture);t||(t={vertices:[],texCoords:[]},l.set(h.texture,t)),t.vertices.push(...h.vertices.map(Qf(s))),t.texCoords.push(...h.texCoords),o=Math.max(o,h.baseline),n=Math.min(n,h.baseline-(h.size.y-1))}c+=h.advanceX}h=c;const f=y(u(0,n),u(h,o)),g=[];return l.forEach(((t,e)=>{g.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[g,f]}}class eg 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 ig=(...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},sg={roundUnsigned:{aO:"roundUnsigned",lO:"float roundUnsigned(float number) {\n return floor(number + 0.5);\n}"},linearStep:{aO:"linearStep",lO:"float linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}"},decodeUbyteRGBAEncodedFloat:{aO:"decodeUbyteRGBAEncodedFloat",lO:"\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:{aO:"texelFetchWithFallback",lO:"vec4 texelFetchWithFallback(sampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{aO:"texelFetchWithFallback",lO:"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:{aO:"texelFetchUnsignedWithFallback",lO:"uvec4 texelFetchUnsignedWithFallback(usampler2D textureSampler, ivec2 iTexel, vec2 textureSize) {\n return texelFetch(textureSampler, iTexel, 0);\n}"},webgl1:{aO:"texelFetchUnsignedWithFallback",lO:"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:{aO:"modulus",lO:"int modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}"},computeScreenSpaceWireframe:{aO:"computeScreenSpaceWireframe",lO:"#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}"}},rg={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},ng={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 og{constructor(t){this.modifiers=[],this.modifiers=t}build(t){const e=this.modifiers.filter((t=>hg(t)));for(const i of e)t=i(t);return`${be(this.modifiers.filter((t=>ag(t)))).map((t=>t.lO)).join("\n")}\n${t}`}}const hg=t=>"function"==typeof t,ag=t=>t&&"object"==typeof t&&"aO"in t,lg=(...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},ug=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),cg=(...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},fg=(t,...e)=>i=>{const s=e.filter((t=>!1!==t));for(let t=0;t{if(!l.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${l}")`)})),l},gg=(...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},yg=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=lg(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=lg(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return gg(`\t${r} = ${s};`)(i)},pg=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e};class mg{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new gt(`Could not find ${this.uO()} ${this.cO()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}uO(){return this.id.toString()}cO(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Sg extends mg{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class xg extends mg{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class bg{constructor(t,e,i,s){this.dO=new Map,this.fO=new Map,this.ft=i,this.gO=i.createProgram(),this.pO=`${t.uO()} vertex`,this.mO=`${e.uO()} fragment`,i.attachShader(this.gO,t.shader),i.attachShader(this.gO,e.shader),i.bindAttribLocation(this.gO,0,"aPos"),i.linkProgram(this.gO),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""}yO(t){return me(0,(()=>Se()))}SO(t){const e=this.xO(t);if(void 0===e)throw this.yO(`Could not get ${t} uniform from ${this.pO} and ${this.mO} shaders.`);return e}xO(t){const e=this.dO.get(t);if(e)return e;const i=this.ft.getUniformLocation(this.gO,t);return i?(this.dO.set(t,i),i):void 0}bO(t){const e=this.vO(t);if(void 0===e)throw this.yO(`Could not get ${t} attribute from ${this.pO} and ${this.mO} shaders.`);return e}vO(t){const e=this.fO.get(t);if(e||0===e)return e;const i=this.ft.getAttribLocation(this.gO,t);return i>=0?(this.fO.set(t,i),i):void 0}G(){this.ft.deleteProgram(this.gO)}}const vg=(t,e,i)=>()=>{t.MO=e,i&&i()};class Mg{constructor(t,e){if(this._O=0,this.AO=0,this.wO=!1,this.MO=!1,this.kO=!1,this.CO=!1,this.TO=!1,this.FO=new Set,this.IO=new Set,this.Md=e,this.ft=t,this.PO=null,this.wO=e instanceof xt.HTMLVideoElement,this.Md instanceof xt.HTMLImageElement)this.Md.addEventListener("load",(()=>{this.CO=!0,this.DO()})),this.Md.addEventListener("error",(()=>{this.TO=!0})),this.Md.complete&&(this.CO=!0,this.DO());else if(this.Md instanceof xt.HTMLVideoElement){const t=this;this.Md.addEventListener("canplay",(function(){t.AO=this.videoHeight,t._O=this.videoWidth,t.CO=!0,t.DO()}),!0),this.Md.addEventListener("play",vg(this,!0,(()=>this.DO()))),this.Md.addEventListener("playing",vg(this,!0,(()=>this.DO()))),this.Md.addEventListener("pause",vg(this,!1)),this.Md.addEventListener("ended",vg(this,!1)),this.Md.readyState>=1&&(this._O=this.Md.videoWidth,this.AO=this.Md.videoHeight,this.MO=!this.Md.paused,this.CO=!0,this.DO())}else this.CO=!0,this.DO()}sO(t){0===this.IO.size&&this.CO&&this.DO(),this.IO.add(t)}eO(t){this.IO.delete(t),0===this.IO.size&&this.unbindResources()}BO(t){this.FO.add(t),this.kO&&(t(),this.OO(t))}OO(t){this.FO.delete(t)}DO(){if(this.TO||this.kO||!this.CO)return;const t=this.ft.gl;if(!this.PO&&this.Md&&t){this.PO=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.PO),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.Md,o=this._O>0?this._O:n.width,h=this.AO>0?this.AO: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._O=o,this.AO=h,t.bindTexture(t.TEXTURE_2D,null)}this.kO=!0,this.FO&&this.FO.forEach((t=>{t(),this.OO(t)}))}Ts(){const t=this.ft.gl;if(!this.TO&&this.kO&&this.PO){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.Md;n&&(t.bindTexture(t.TEXTURE_2D,this.PO),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}LO(){return this.PO}unbindResources(){return this.kO&&(this.PO&&(this.ft.YB(this.PO),this.PO=null),this.kO=!1),this}}class Ag extends Or{constructor(t,e,i){super(t.ls,e,i),this.qm=!0,this.$m={},this.Zm=m(ko),this.As=t,this.ct=t.ct}RO(){var t;return this.Zm.o&&this.Zm.M().type!==(null===(t=this.EO)||void 0===t?void 0:t.type)}sy(t){return this.qm=t,this}zO(t){return this.$m=t,this}}const wg=(t,e)=>[lg("uniform float uLookupMin","uniform float uLookupMax","uniform sampler2D uLookupTexture","uniform float uLookupTextureHeightPx","uniform vec4 uFallbackColor"),sg.texelFetchWithFallback[e],dg("colorFragment","vec4 colorFragment = vec4(0.0)",`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorFragment = uFallbackColor;\n } else {\n int texCoordY = int(clamp((${t} - uLookupMin) / (uLookupMax - uLookupMin), 0.0, 1.0) * (uLookupTextureHeightPx - 1.0));\n colorFragment = texelFetchWithFallback(uLookupTexture, ivec2(0, texCoordY), vec2(1.0, uLookupTextureHeightPx));\n }`)],Tg=[lg("uniform sampler2D uMaskTexture"),lg("varying vec2 vMaskTextureCoord"),fg("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],Eg=[lg("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;"),fg("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)")],Ig=t=>void 0!==t.find((t=>{var e;return null===(e=t.VO)||void 0===e?void 0:e.NO})),Cg=t=>void 0!==t.find((t=>{var e;return null===(e=t.VO)||void 0===e?void 0:e.GO})),Pg=t=>void 0!==t.find((t=>{var e;return null===(e=t.VO)||void 0===e?void 0:e.WO})),kg=(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(lg("attribute vec3 aNormal"),cg("vec3 normal = aNormal")),"linear-highPrecision"!==n)i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&(!0!==c?s.push(cg(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(cg(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))}));else{if(!0===c)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.forEach((t=>{s.push(cg(`${r} ${t.variableNameAxisCoord}_highpart = ${t.attributeNameAxisCoord}_highpart`),cg(`${r} ${t.variableNameAxisCoord}_lowpart = ${t.attributeNameAxisCoord}_lowpart`))}))}if(a&&a.rotation){const t=a.rotation.dataType,e=("uniform"===t?"u":"a")+"Rot";s.push(lg(`${t} vec2 ${e}`));const i="aInstanceGeo";s.push(cg(`vec2 rotatedGeo = vec2(${i}.x * ${e}.y + ${i}.y * ${e}.x, ${i}.y * ${e}.y - ${i}.x * ${e}.x)`))}if(a&&s.push(lg(`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(lg(`${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(lg(`${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(lg(`${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(lg(`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(lg(`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(lg("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("logarithmic"===n[0]){s.push(lg(`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(${Ai(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(lg(...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(lg("uniform vec2 uRatioPxClip"));const t=("attribute"===a.dataType?"a":"u")+"OffsetPixels",e=!0===a.symmetric?"float":r;s.push(lg(`${a.dataType} ${e} ${t}`));const n=a.halved?" * 0.5":"",o=`${t} * ${a.rotation?"rotatedGeo":"aInstanceGeo"}${n}`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${o} * uRatioPxClip`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(lg(`${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(lg("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(lg(`${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(lg("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(dg("gl_Position =",...f)),s},Fg=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(fg(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(fg(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===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(fg(i,...t))}}return r},Bg={"2D":{idFeature:"2D",apply:t=>({idVertex:"2D",idFragment:"2D",defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"3D":{idFeature:"3D",VO:{NO:!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:${ig(t)}`,idFragment:void 0,vertexShaderModifiers:[lg(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),gg(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture;return{idFeature:"Color",VO:{GO:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,WO:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(r,n)=>{let o,h=`Color:${ig(t)}`;const a=[],l=[];if("uniform"===i)l.push(lg("uniform vec4 uColor"),cg("vec4 colorFragment = uColor"),...s?Tg:[]);else if("attribute"===i)o="colorAttribute",a.push(yg("attribute vec4 aColor","varying vec4 vColor")),l.push(lg("varying vec4 vColor"),cg("vec4 colorFragment = vColor"));else if("texture"===i)o="colorTexCoord",a.push(yg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),l.push(lg("varying vec2 vTextureCoord"),lg("uniform sampler2D uColorTexture"),lg("uniform vec4 uColor"),cg("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)&&"image"===i[0])o="colorTexCoord",a.push(yg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?l.push(lg("uniform sampler2D uColorTexture"),lg("varying vec2 vTextureCoord"),cg("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):l.push(lg("uniform sampler2D uColorTexture"),lg("varying vec2 vTextureCoord"),lg("uniform vec4 uColor"),cg("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)o="lookup:value",a.push(yg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;o=`lookup:${t}`,a.push(yg(e,"varying float vLookupValue"))}l.push(lg("varying float vLookupValue"),...wg("vLookupValue",n))}else if(Array.isArray(i)&&"gradient"===i[0]){h=`Color:${ig(t)}`;const e=i[1],r=e.getColorStops();K(e)?l.push(lg("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),lg(...Pt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),sg.linearStep,cg("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?Tg:[]):et(e)&&l.push(lg("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),lg(...Pt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),sg.linearStep,cg("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?Tg:[])}if(!0===s){const t="maskTexture";o=o?`${o} ${t}`:`Color:${t}`,a.push(yg("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return{vertexShaderModifiers:a,fragmentShader:"FragmentShader",fragmentShaderModifiers:l,idVertex:o,idFragment:h}}}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${ig(t)}`;return{idFeature:"ColorShaded3D",VO:{GO:!(!Array.isArray(t.dataType)||"value"===t.dataType[1])||void 0,WO:!(!Array.isArray(t.dataType)||"value"!==t.dataType[1])||void 0},apply:(t,o)=>{const h=[],a=[];if(h.push("phong"===i&&yg("normal","varying vec3 vNormal"),yg("posWorld","varying vec3 vPosWorld")),"uniform"===e)a.push(lg("uniform vec4 uColorDiffuse"),cg("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",h.push(yg("attribute vec4 aColor","varying vec4 vColor")),a.push(lg("varying vec4 vColor"),cg("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",h.push(yg("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,h.push(yg(e,"varying float vLookupValue"))}a.push(lg("varying float vLookupValue"),...wg("vLookupValue",o))}if(s){const t="wireframe";r=r?`${r},${t}`:t,h.push(yg("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),a.push(lg("varying vec3 vTriangleBary"),lg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),sg.computeScreenSpaceWireframe,fg("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&a.push(...Eg),{idVertex:r,idFragment:n,vertexShaderModifiers:h,fragmentShader:"FragmentShader",fragmentShaderModifiers:a}}}},VertexLocation:t=>({idFeature:"VertexLocation",apply:e=>{const i=[],s=Ig(e),r=s?"vec3":"vec2";if("linear-highPrecision"!==t.axisWorldTranslation)!0!==t.splitPosAttribute?i.push(lg(`attribute ${r} aPos`)):i.push(lg("attribute float aPosX"),lg("attribute float aPosY"),s&&lg("attribute float aPosZ"));else{if(!0===t.splitPosAttribute)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.push(lg(`attribute ${r} aPos_highpart`),lg(`attribute ${r} aPos_lowpart`))}return i.push(...kg(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),{idVertex:`VertexLocation:${ig(t)}`,idFragment:void 0,vertexShaderModifiers:i}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",apply:e=>({idVertex:`LineInstanced2D:${ig(t)}`,idFragment:void 0,vertexShaderModifiers:[lg("uniform float uThicknessPixels"),lg("uniform vec2 uRatioPxClip"),"linear-highPrecision"!==t.axisWorldTranslation&&lg("attribute vec2 aLocationA"),"linear-highPrecision"!==t.axisWorldTranslation&&lg("attribute vec2 aLocationB"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationA_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationB_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationA_lowpart"),"linear-highPrecision"===t.axisWorldTranslation&&lg("attribute vec2 aLocationB_lowpart"),lg("attribute vec2 aSegmentPosition"),lg("attribute float aSegmentSide"),...kg(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),fg("worldB = ","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"),...Pg(e)?[ug("attribute float aLookupValue"),ug("vLookupValue = aLookupValue"),lg("attribute float aLookupValueA"),lg("attribute float aLookupValueB"),gg("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],...Cg(e)?Fg(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",apply:e=>({idVertex:`LineInstanced3D:${ig(t)}`,idFragment:void 0,defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[lg("uniform float uOffsetWU"),lg("attribute vec3 aLocationA"),lg("attribute vec3 aLocationB"),lg("attribute float aSegmentPosition"),lg("attribute float aPerpendHorizontal"),lg("attribute float aPerpendVertical"),...kg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},Ig(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),fg("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"),...Cg(e)?Fg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",apply:t=>({idVertex:"RoundedEdges3D",idFragment:void 0,vertexShaderModifiers:[lg("attribute vec3 aEdge"),lg("uniform float uEdgeRoundness"),fg("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:${ig(t)}`,fragmentShader:"FragmentShader",fragmentShaderModifiers:[lg("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues"),"ubyte"===i&&sg.decodeUbyteRGBAEncodedFloat,"bilinear"===t.interpolation?cg("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"})`):cg("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})`)),...wg("intensityP",n)]})}},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(lg("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&&sg.roundUnsigned,sg.modulus,sg.texelFetchWithFallback[h],"ubyte"===r&&sg.decodeUbyteRGBAEncodedFloat,cg(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(lg("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),cg("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{idVertex:`DrawToNormalTexture:${ig(t)}`,idFragment:`DrawToNormalTexture:${ig(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(lg("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&&sg.roundUnsigned,sg.modulus,sg.texelFetchWithFallback[d],"ubyte"===a&&sg.decodeUbyteRGBAEncodedFloat,cg(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(...kg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&f.push(yg("posWorld","varying vec3 vPosWorld"),..."uint"===h?[sg.texelFetchUnsignedWithFallback[d],gg("vec4 normalAxisRGB = vec4(texelFetchUnsignedWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[gg("vec4 normalAxisRGB = texelFetchWithFallback(uNormalmapTexture, ivec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],gg("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),lg("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),g.push(lg("varying vec3 vTriangleBary")),"uniform"===e?g.push(lg("uniform vec4 uColorDiffuse"),cg("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(f.push(yg("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),g.push(lg("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp"),"ubyte"===l&&sg.decodeUbyteRGBAEncodedFloat,"bilinear"===i?cg("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"})`):cg("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"),...wg("intensityP",d))):(f.push(yg(`posAxis.${e[1]}`,"varying float vLookupValue")),g.push(lg("varying float vLookupValue"),...wg("vLookupValue",d))):void 0===e&&g.push(cg("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&g.push(...Eg),n&&(f.push(lg("attribute vec3 aTriangleBary"),yg("aTriangleBary","varying vec3 vTriangleBary")),g.push(lg("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),sg.computeScreenSpaceWireframe,fg("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:${ig(t)}`,idFragment:`SurfaceGrid:${ig(t)}`,vertexShaderModifiers:f,fragmentShader:"FragmentShader",fragmentShaderModifiers:g}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",apply:(e,i)=>({idVertex:`DebugSurfaceGridNormals:${ig(t)}`,idFragment:`DebugSurfaceGridNormals:${ig(t)}`,vertexShaderModifiers:[lg("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"]),sg.roundUnsigned,sg.modulus,sg.texelFetchWithFallback[i],"ubyte"===t.heightmapTextureType&&sg.decodeUbyteRGBAEncodedFloat,cg(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?[sg.texelFetchUnsignedWithFallback[i]]:[],...kg({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),fg("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:[gg("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",apply:t=>({idVertex:"OffsetTowardsCamera",idFragment:void 0,vertexShaderModifiers:[lg("uniform vec3 uCameraLoc"),fg("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",apply:t=>({idVertex:"AliasedEdge",idFragment:"AliasedEdge",vertexShaderModifiers:[lg("attribute float aSegmentInside"),lg("varying float vSegmentInside"),lg("varying float vSegmentSide"),fg("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[pg("#extension GL_OES_standard_derivatives : enable"),lg("uniform float uAALimit"),lg("varying float vSegmentInside"),lg("varying float vSegmentSide"),fg("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:${ig(t)}`,idFragment:`Glow1D:${ig(t)}`,vertexShaderModifiers:[yg("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[lg("uniform sampler2D uTexture"),lg("varying vec2 vTextureCoord"),lg("uniform vec2 uTextureSize"),r&&lg("uniform vec2 uOffsetPx"),!r&&lg("uniform sampler2D uTextureFirstGlowPass"),!r&&lg("uniform vec4 uGlowColor"),fg("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:[lg("uniform vec4 uColor"),cg("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:[yg("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[lg("varying vec4 vColor"),cg("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:[yg("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:[lg("attribute vec2 aLengthSoFar"),lg("varying float vLengthSoFar"),lg("uniform vec2 uStippleCount"),gg("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[lg("uniform sampler2D uStippleTexture"),lg("uniform float uStippleScale"),lg("varying float vLengthSoFar"),"webgl1"===e&&lg("uniform float uStippleTextureWidthLimiter"),fg("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:[lg("attribute vec2 aLengthSoFarA"),lg("attribute vec2 aLengthSoFarB"),lg("varying float vLengthSoFar"),lg("uniform vec2 uStippleCount"),gg("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[lg("uniform sampler2D uStippleTexture"),lg("uniform float uStippleScale"),lg("varying float vLengthSoFar"),"webgl1"===e&&lg("uniform float uStippleTextureWidthLimiter"),fg("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:${ig(t)}`,vertexShaderModifiers:[],fragmentShaderModifiers:[lg("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"),sg.texelFetchWithFallback[i],"ubyte"===o&&sg.decodeUbyteRGBAEncodedFloat,cg("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&&cg("vec4 colorFragment = uColor"),r&&fg("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?wg("intensityP",i):[]]}}})};class _g{constructor(t){this.gL=[],this.yB=t}pL(t,e){((t,e,i,s)=>{const r=t.oO(),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.HO(),l=t.UO(),u=t.$O(),c=t.jO(),d=t.YO();t.XO("disabled"),t.sy(!1),t.ZO(!1);const f=e.KO();((t,e,i)=>{const s=t.gl,r=t.oO();s.bindFramebuffer(s.FRAMEBUFFER,i.frameBuffer),s.bindRenderbuffer(s.RENDERBUFFER,i.depthBuffer),s.bindTexture(s.TEXTURE_2D,i.texture),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT);const n=i.sizeDpr;t.qO(0,0,n.x,n.y),e.forEach((e=>{let i;e instanceof Vr?i=e.As.cp():e instanceof Ag&&(i=e.As.wS()),i?t.JO(i.x*r,i.y*r,i.width*r,i.height*r):t.ZO(!1),e.mB(2)})),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindTexture(s.TEXTURE_2D,null),t.ZO(!1)})(t,s,f);let g=f;const y=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iLe(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 Vr||t instanceof Ag?t.As.QO(t):Fe;if(xe(e))return Fe;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?Fe:r})).filter((t=>!xe(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=hi(t.min,s),i=hi(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.tL(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.iL()),m=e.KO(f,g),S=t.sL(Bg["2D"],Bg.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl;o.bindFramebuffer(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.clear(o.DEPTH_BUFFER_BIT),t.qO(0,0,i.sizeDpr.x,i.sizeDpr.y),t.eL(s,((h,a,l,u)=>(t.sO(s),n&&n(h),t.oL(h("uIsHighlighted"),0).aL(h("uHighlightColorOffset"),C).oL(h("uRenderEffectMask"),0).nL(h("uTexture"),e.texture,0).rL(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).rL(h("uScale"),i.uniforms.lL()).rL(h("uDisp"),i.uniforms.uL()).rL(h("uScaling"),[i.size.x,i.size.y]).rL(h("uTranslationAxis"),[0,0]).hL(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Xp(o.TRIANGLES,r.vertexCount,0),!0))),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,g,m,S,p,((e,i,s,r)=>(t.rL(e("uOffsetPx"),[h.x,h.y]),!0))),g=m,t.ZO(l),t.cL(d);const x=t.sL(Bg["2D"],Bg.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),Bg.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.ls.Ht().x,y:t.ls.Ht().y};t.qO(0,0,o.x*t.oO(),o.y*t.oO());const h=ot.d2({scaleXYConstructor:_i}).q(o).bi(0,o.x).vi(0,o.y),a=new zg;a.dL(h),t.eL(i,((h,l,u,c)=>(t.sO(i),r&&r(h),t.oL(h("uIsHighlighted"),0).aL(h("uHighlightColorOffset"),C).oL(h("uRenderEffectMask"),0).nL(h("uTexture"),e.texture,0).rL(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).rL(h("uScale"),a.lL()).rL(h("uDisp"),a.uL()).rL(h("uScaling"),[o.x,o.y]).rL(h("uTranslationAxis"),[0,0]).hL(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Xp(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,x,p,((e,s,r,n)=>(t.nL(e("uTextureFirstGlowPass"),m.texture,1).aL(e("uGlowColor"),i.color),!0))),t.qO(a.x,a.y,a.width,a.height),t.XO(u),t.sy(c),t.fL(p.vertexBuffer)})(this.yB,this,e,t)}iL(){const t=this.yB.ls.Ht();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}KO(...t){const e=this.gL,i=this.iL(),s={x:Math.ceil(i.x*this.yB.oO()),y:Math.ceil(i.y*this.yB.oO())},r=this.yB.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.q(i).bi(0,i.x).vi(0,i.y),n.uniforms.dL(n.scale)),n;const o=r.createTexture(),h=this.yB.mL(),a=this.yB.yL();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),r.bindFramebuffer(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),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindRenderbuffer(r.RENDERBUFFER,null);const l=ot.d2({scaleXYConstructor:_i}).q(i).bi(0,i.x).vi(0,i.y),u=new zg;u.dL(l);const c={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:l,uniforms:u};return e.push(c),c}G(){[this.gL].forEach((t=>{t.forEach((t=>{this.yB.SL(t.depthBuffer),this.yB.xL(t.frameBuffer),this.yB.YB(t.texture)})),t.length=0}))}}class Lg{constructor(t,i,s,r,n=!0){this.bL=new Xf,this.vL=new Map,this.ML=new Map,this._L=new Map,this.AL=[],this.wL=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(xt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.qm=!1,this.rL=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.kL=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.CL=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.TL=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.FL=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.IL=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.aL=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.oL=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.PL=(t,e)=>(this.gl.uniform1i(t,e),this),this.nL=(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 ft("Could not bind a texture.")},this.DL=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.tL=(t,e=!1,i)=>{const s=t.length,r=this.BL(s,i);if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,r),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),r)return r;throw new ft("Could not create vertex buffer")},this.OL=(t,e,i)=>{const s=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof Float32Array?e:new Float32Array(e)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new ft("Could not create vertex buffer")},this.LL=(t,e,i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*Float32Array.BYTES_PER_ELEMENT,i instanceof Float32Array?i:new Float32Array(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.RL=(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.EL=(t,e)=>{const i=t.length,s=this.BL(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 ft("Could not create index buffer")},this.zL=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 ft("Could not create float buffer")},this.VL=(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.NL=(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.hL=(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.GL(s,e)}return this},this.WL=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.HL=(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.UL=(t,e)=>(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)),this),this.$L=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.Xp=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.jL=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.YL=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.XL.ANGLE_instanced_arrays)return xt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.XL.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.ZL=(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.XL.ANGLE_instanced_arrays)return xt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.XL.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.GL=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.XL.ANGLE_instanced_arrays)return xt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.XL.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.KL=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r),this.gl.bindFramebuffer(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 n=this.UO();n&&this.ZO(!1),t(),n&&this.ZO(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)},this.qL=(t,e,i)=>{const s=xt.document.createElement("canvas").getContext("2d").createImageData(i.x,i.y),r=s.data;return this.gl.readPixels(t,e,i.x,i.y,this.gl.RGBA,this.gl.UNSIGNED_BYTE,r),s},this.Ha=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.clear(this.gl.DEPTH_BUFFER_BIT),this),this.JL=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.sO=t=>(this.gl.useProgram(t.gO),this),this.QL=!1,this.tR=[],this.ls=t,this.ff=i,this.ls=t,this.gl=s.ctx,this.iR=s.antialias,this.sR=s.lineAntialias,this.eR=new Map,n&&(this.cL(!0),this.hR());const o=[];if(this.XL={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.XL).forEach((t=>{null===this.XL[t]&&o.push(t)})),"webgl2"===s.type)this.gl2={ctx:s.ctx},this.rR=!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.sR=!1),Object.keys(t).forEach((e=>{null===t[e]&&o.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.rR=!!e.OES_texture_float,this.gl1={ctx:s.ctx,XL:t,optional:e}}this.AL=o,this.$B=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.qB=this.nR(),this.sL=(t=>{const e=t.gl,i=new Map,s=new Map,r=new Map,n={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},o=(e,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(e.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(e.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(e.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(t.gl1){const t=e.match(/#extension.*/g);t&&n.push(...t),e=e.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(e=(e=(e=e.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)e=e.replace(/varying/g,"out");else{e=e.replace(/varying/g,"in");const t=s.find((t=>"fragOutput"===t.type));e=(e=t?`out ${t.fragOutput} fragOutput;\n${e}`:`out vec4 fragOutput;\n${e}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:e=`${r.join("\n")}\n${e}`,info:o}};return(...h)=>{const a=t.gl2?"webgl2":"webgl1";let l,u,c,d,f,g,y,p,m;try{const t=xt.performance.now();l=h.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 eg(`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 eg(`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 eg("No vertex shader template defined",n);if(!u)throw new eg("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 S=r.get(u.id);if(c="new",S)return c="existing",g=S.vertexShaderSrc,y=S.fragmentShaderSrc,S;const x=u.vertexShader.id;let b=i.get(x);if(b)g=b.src,d="existing";else{d="new";const t=new og(u.vertexShader.modifiers).build(rg[u.vertexShader.template]),{source:s,info:r}=o(t,"vertex");g=s,p=r,b=new Sg(x,s,e,r),i.set(x,b),n.vertexShaders+=1}const v=u.fragmentShader;let M;const A=v.id;if(M=s.get(A),M)y=M.src,f="existing";else{f="new";const t=ng[v.template],i=new og([...v.modifiers]).build(t),{source:r,info:h}=o(i,"fragment",u.hints);y=r,m=h,M=new xg(A,r,e,h),s.set(A,M),n.fragmentShaders+=1}const w=new bg(b,M,e,u);return r.set(u.id,w),n.programs+=1,n.totalMs+=xt.performance.now()-t,w}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 xt.alert(t),new Error(t)}))}}})(this),this.oR=ct(this.gl),this.aR=new Rg(this),this.nO=(t=>{const e=xt.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new ft("Failed to get Text canvas rendering context");return i.fillStyle="#fff",(s,r,n)=>{const o=`${r.style} ${r.weight} ${r.size*n}px ${r.family}`;i.font=o,i.textBaseline="alphabetic",i.textAlign="left";const h=i.measureText(s);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(r.size*n),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;e.width=a>0?a:l,e.height=2*c,i.font=o,i.textBaseline="alphabetic",i.textAlign="left",t?(i.clearRect(0,0,e.width,e.height),i.fillStyle="#fff"):(i.fillStyle="rgba(255,255,255,0)",i.fillRect(0,0,e.width,e.height),i.fillStyle="#000"),i.fillText(s,d,c);const f=i.getImageData(0,0,e.width,e.height);let g=0,y=0;const p=f.width;for(let t=0;t=0;t-=1){for(let e=0;e=t&&s.size-t<1e6?i=e:this.fL(e)}return i||(i=this.gl.createBuffer(),this.eR.set(i,{size:t})),i}pR(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 ft("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}YB(t){this.gl.deleteTexture(t)}mL(){const t=this.gl.createFramebuffer();if(!t)throw new ft("Couldn't reserve Framebuffer.");return t}xL(t){this.gl.deleteFramebuffer(t)}yL(){const t=this.gl.createRenderbuffer();if(!t)throw new ft("Couldn't reserve Render buffer.");return t}SL(t){this.gl.deleteRenderbuffer(t)}qO(t,e,i,s){return this.mR&&t===this.mR.x&&e===this.mR.y&&i===this.mR.width&&s===this.mR.height||(this.gl.viewport(t,e,i,s),this.mR={x:t,y:e,width:i,height:s}),this}HO(){return this.mR||{x:0,y:0,width:0,height:0}}JO(t,e,i,s){return this.ZO(!0),this.gl.scissor(Math.max(t,0),Math.max(e,0),Math.max(i,0),Math.max(s,0)),this}ZO(t){return t===this.yR||(t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this.yR=t),this}cL(t){return t!==this.QL&&(this.QL=t,t&&this.gl.enable(this.gl.BLEND),t||this.gl.disable(this.gl.BLEND)),this}YO(){return this.QL}hR(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)}UO(){return void 0!==this.yR&&this.yR}eL(t,e){const i=new Vg(this,t),s=e(i.uniform,i.attribute,i,i.uniformOptional);i.finish(s)}fL(t){this.gl.deleteBuffer(t),this.eR.delete(t)}SR(t,e,i){this.rL(t.uniform("uCenter"),e.center).rL(t.uniform("uDistance"),e.distance).CL(t.uniform("uBounds"),e.bounds).oL(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.wR.buffer;this.wR&&(this.fL(this.wR.buffer),this.wR=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.tR.splice(this.tR.indexOf(l),1)}))}PR(t,e,i,s,r,n,o,h){const a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),a.bindFramebuffer(a.FRAMEBUFFER,null)}DR(t){const e=this._L.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new ft("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{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 xt.setTimeout(o,r)};xt.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 zg{dL(t){if(t instanceof _i||t instanceof yu){const e=t.ti();this.RR=e.x.scaling,this.ER=-e.x.displacement,this.zR=e.y.scaling,this.VR=-e.y.displacement,this.NR=e.x.highPrecisionOffset,this.GR=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.WR=e.y.highPrecisionOffset,this.HR=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Li&&(this.MixedScaleXY=t.ti());return this}uL(){return[this.ER,this.VR]}lL(){return[this.RR,this.zR]}UR(){return[this.NR,this.WR]}$R(){return[this.GR,this.HR]}}class Og{constructor(){this.RR=0,this.zR=0,this.jR=0,this.ER=0,this.VR=0,this.YR=0}XR(t){return this.RR=t.st(),this.ER=t.getInnerStart()+.5*this.RR*t.et(),this}ZR(t){return this.zR=t.st(),this.VR=t.getInnerStart()+.5*this.zR*t.et(),this}KR(t){return this.jR=t.st(),this.YR=t.getInnerStart()+.5*this.jR*t.et(),this}lL(){return[this.RR,this.zR,this.jR]}uL(){return[this.ER,this.VR,this.YR]}qR(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=Uf.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class Rg{constructor(t){this.yB=t}mB(t,e,i,s,r,n=0){const o=this.yB,h=void 0===s;if(!(s=s||o.mL()))throw new ft("Could not bind a framebuffer.");const a=o.HO(),l=o.YO();o.cL(!1),o.KL((()=>{o.qO(0,0,i.x,i.y),t()}),s,e,n),h&&o.xL(s),this.yB.JL(r),this.yB.qO(a.x,a.y,a.width,a.height),o.cL(l)}}class Vg{constructor(t,e){this.JR=[],this.QR=[],this.uniform=t=>{const e=this.shader.SO(t);return this.QR.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.xO(t);return this.QR.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.bO(t);return this.JR.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.JR)this.glUtils.WL(t.location),this.glUtils.GL(t.location,0)}}class Ng extends Vr{constructor(t,e,i,s,r){super(t,e,i,s),this.tE=new Map,this.iE=t,this.sE=e,this.yB=t.eE(),this.hE=r,this.sE=e}rE(t){return!1}jB(){return this}mB(t){if(!this.hE||0!==t||0===this.tE.size)return this;const e=Array.from(this.tE.values()).map((t=>t.nE.filter((t=>t.oE)).map((t=>t.Qi)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.hE;return this.yB.lR.pL(e,i),this}Ts(){return this}_t(){return 0}Mt(){return 0}wt(){return 0}At(){return 0}sl(){return 0}el(){return 0}es(t,e){const i={nE:[]},s=(t,e)=>{const s={Qi:t||[],oE:void 0===e||e};i.nE.push(s);const r={ds:t=>(s.Qi=t,r),ys:t=>(s.oE=t,r),xs:()=>s.oE};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={xg:s,...r};this.tE.set(t,i);const o=t.onDispose((()=>{this.tE.delete(t),t.offDispose(o)}));return n}}function Gg(t,i,s,r,n,o){let h=i.x.ut(t.max.x),a=i.x.ut(t.min.x),l=i.y.ut(t.max.y),u=i.y.ut(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,y=d*s.y,p=c-g,m=d-y,S=g>p?[p,g]:[g,p],x=y>m?[m,y]:[y,m];let b,v,M=1,A=1;switch(r){default:case e.GradientExtent.closestSide:if(b=S[0]/c,v=x[0]/d,n===e.GradientShape.circle){const t=Math.min(b*f,v);M=t,A=t}else M=b*f,A=v;break;case e.GradientExtent.farthestSide:if(b=S[1]/c,v=x[1]/d,n===e.GradientShape.circle){const t=Math.max(b*f,v);M=t,A=t}else M=b*f,A=v;break;case e.GradientExtent.closestCorner:if(v=x[0]/d,n===e.GradientShape.circle){b=S[0]/c*f;const t=Math.sqrt(b*b+v*v);M=t,A=t}else{b=S[0]/c;const t=Math.sqrt(b*b+v*v);M=t*f,A=t}break;case e.GradientExtent.farthestCorner:if(v=x[1]/d,n===e.GradientShape.circle){b=S[1]/c*f;const t=Math.sqrt(b*b+v*v);M=t,A=t}else{b=S[1]/c;const t=Math.sqrt(b*b+v*v);M=t*f,A=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(M,1e-4),Math.max(A,1e-4)],aspectRatio:f}}function Hg(t,e,i,s){const r=e.x.ut(t.max.x),n=e.x.ut(t.min.x),o=e.y.ut(t.max.y),h=e.y.ut(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]}}const Ug=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=si(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),bt(h,d)&&(d=ri(h,ti(si(ni(a,h),-1)))),bt(h,a)&&(a=ri(h,ti(si(ni(d,h),-1))));const s=hi(d,e),g=hi(h,e),y=hi(a,e),p=ti(ni(g,s)),m=ti(ni(y,g)),S=ri(p,m),x=u(-S.y,S.x),b=u(-p.y,p.x),v=1/li(x,b),M=ii(x),A=ti(ni(p,m)),w=Math.sign(li(x,A))||1,T=oi(x,si(o,v)),E=oi(x,si(o,-v));if(M<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(-m.y,m.x),c=Math.sign(li(p,x))||w,g=oi(b,si(o,c)),y=oi(l,si(o,c));1===w?(t=g,e=E,i=y,s=E):(t=T,e=g,i=T,s=y);const S=4*Ne(d,h),M=4*Ne(h,a);(v>S||v>M)&&(1===w?(t=g,e=y,i=y,s=g):(t=y,e=g,i=g,s=y));const A=ri(h,t),I=ri(h,e),C=ri(h,i),P=ri(h,s);r[n]=A,n+=1,r[n]=I,n+=1,r[n]=C,n+=1,r[n]=P,n+=1,f=4}else{const t=ri(h,T),e=ri(h,E);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 Wg extends en{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.aE=Fe,this.lE=Fe,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE()}dE(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?zu(this.jo.M(),this.Al.M(),this.ci.M(),this.wl.M()*l/100,this.kl.M()*l/100,a)[0]:[this.jo.M()],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.Fl=u(t,e)}else{const t=Math.floor(d/2);this.Fl=u(h[t].x,h[t].y)}this.Il=h[1];const f=h.length-1;this.Pl=h[f],this.Cl.M()&&(h.shift(),c.shift());let g=!1;(this.jo.o||this.Al.o||this.ci.o||this.wl.o||this.kl.o||this.Cl.o||this.Tl.o||s)&&(this.lE=y(u(this.ca().x-n,this.ca().y-o),u(this.ca().x+n,this.ca().y+o)),g=!0,this.jo.o=!1,this.Al.o=!1,this.ci.o=!1,this.wl.o=!1,this.kl.o=!1,this.Cl.o=!1,this.Tl.o=!1);const p=this.Ro();(g||p)&&this.Se!==z&&(this.Cl.M()?(this.gE&&this.yB.fL(this.gE),[this.pE,this.gE,this.mE,this.yE]=this.dE(h,c)):(this.gE&&this.yB.fL(this.gE),[this.pE,this.gE,this.mE,this.yE]=this.dE(h,void 0)),K(this.Se)?this.SE=Gg(this.lE,this.ct,this.Se.getPosition(),this.Se.getExtent(),this.Se.getShape(),this.yB.oO()):et(this.Se)?this.xE=Hg(this.lE,this.ct,this.Se.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0));const m=N(this.Se)&&this.Se,S=et(this.Se)&&this.Se,x=K(this.Se)&&this.Se,b=m||S||x;p&&(this.bE=b?this.yB.sL(Bg["2D"],Bg.Color({dataType:K(this.Se)||et(this.Se)?["gradient",this.Se]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0,this.No(this.Se));const v=this.xe;if(qi(v)&&(g||this.Ho(v.getThickness())||s)){this.Cl.M()?360===i?(h.pop(),c.pop(),[this.vE,this.ME]=this.fE(h,void 0,v.getThickness(),r),this._E&&this.vE?this.yB.RL(this._E,this.vE,!0):!this._E&&this.vE?this._E=this.yB.tL(this.vE,!0):this._E&&!this.vE&&(this.yB.fL(this._E),this._E=void 0),[this.AE,this.wE]=this.fE(c,void 0,v.getThickness(),r),this.kE&&this.AE?this.yB.RL(this.kE,this.AE,!0):!this.kE&&this.AE?this.kE=this.yB.tL(this.AE,!0):this.kE&&!this.AE&&(this.yB.fL(this.kE),this.kE=void 0)):([this.vE,this.ME]=this.fE(h,c,v.getThickness(),r),this._E&&this.vE?this.yB.RL(this._E,this.vE,!0):!this._E&&this.vE?this._E=this.yB.tL(this.vE,!0):this._E&&!this.vE&&(this.yB.fL(this._E),this._E=void 0),this.AE&&(this.kE&&this.yB.fL(this.kE),this.kE=void 0,this.wE=0)):(360===i&&(h.shift(),h.pop()),[this.vE,this.ME]=this.fE(h,void 0,v.getThickness(),r),this._E&&this.vE?this.yB.RL(this._E,this.vE,!0):!this._E&&this.vE?this._E=this.yB.tL(this.vE,!0):this._E&&!this.vE&&(this.yB.fL(this._E),this._E=void 0));const t=v.getFillStyle();K(t)?this.CE=Gg(this.lE,this.ct,t.getPosition(),t.getExtent(),t.getShape(),this.yB.oO()):et(t)?this.TE=Hg(this.lE,this.ct,t.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),this.FE=t===z?void 0:this.yB.sL(Bg["2D"],Bg.Color({dataType:K(t)||et(t)?["gradient",t]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})),this.Uo(v)}if(g){let t=1,e=1;qi(v)&&(t=v.getThickness()*r.x,e=v.getThickness()*r.y),this.aE=y(u(this.lE.min.x-t,this.lE.min.y-e),u(this.lE.max.x+t,this.lE.max.y+e))}this.IE=e&&b?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0,this.PE=e&&this.xe!==st?this.PE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0}return this}mB(t){if(this.Vo()){const e=1===t?this.IE:this.bE,i=this.Se,s=this.gE;e&&s&&this.yB.sO(e).eL(e,((e,r,n,o)=>{if(this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(o("uScaleStart_highpart"),this.dO.UR()).rL(o("uScaleStart_lowpart"),this.dO.$R()).MR(n,s,this.ct.ni(),void 0).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1===t)this.yB.aL(e("uColor"),this.cE);else if(N(i))this.yB.aL(e("uColor"),i.getColor());else if(K(i)){if(!this.SE)return!1;this.yB.SR(n,this.SE,i)}else if(et(i)){if(!this.xE)return!1;this.yB.xR(n,this.xE,i)}return this.yB.Xp(this.yE,this.mE),!0}));const r=this.xe;qi(r)&&(void 0!==this._E&&this.DE(t,this._E,this.ME,r),void 0!==this.kE&&this.DE(t,this.kE,this.wE,r))}return this}DE(t,e,i,s){const r=1===t?this.PE:this.FE,n=s.getFillStyle();r&&this.yB.sO(r).eL(r,((r,o,h,a)=>{if(this.yB.rL(r("uScale"),this.dO.lL()).rL(r("uDisp"),this.dO.uL()).MR(h,e,this.ct.ni(),void 0).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),1===t)this.yB.aL(r("uColor"),this.cE);else if(N(n))this.yB.aL(r("uColor"),n.getColor());else if(K(n)){if(!this.CE)return!1;this.yB.SR(h,this.CE,n)}else if(et(n)){if(!this.TE)return!1;this.yB.xR(h,this.TE,n)}const l=s.getThickness(),u=-1===l||1===l;return this.yB.Xp(u?this.yB.gl.LINE_LOOP:this.yB.gl.TRIANGLE_STRIP,i),!0}))}rE(t){return this.uE===t&&{}}jB(){return this.BE&&(this.yB.fL(this.BE),this.BE=void 0),this.OE&&(this.yB.fL(this.OE),this.OE=void 0),this.gE&&(this.yB.fL(this.gE),this.gE=void 0),this._E&&(this.yB.fL(this._E),this._E=void 0),this.kE&&(this.yB.fL(this.kE),this.kE=void 0),this.bE=void 0,this.FE=void 0,this.IE=void 0,this.PE=void 0,this}_t(){return this.lE.max.x}Mt(){return this.lE.min.x}wt(){return this.lE.max.y}At(){return this.lE.min.y}sl(){return Te(this.xe)}el(){return Te(this.xe)}}class Xg{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}LE(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}RE(){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}EE(){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}zE(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.RE(),this}VE(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.EE(),this}NE(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Xg).LE(t))(),jg=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Yg.RE(),n.push(t,e),r.push(Yg.first,Yg.second,Yg.third),h=void 0,o=void 0,r.push(Yg.third,Yg.fourth,Yg.second),a=Yg.third,Yg.EE(),l&&n.push(i,s),[o,h,a]),Jg=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Yg.RE(),o.push(t,e),r.push(Yg.first,Yg.second,Yg.third);const c=mi(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Yg.third,Yg.fourth,Yg.fifth),l=Yg.fourth),Yg.EE(),u&&o.push(i,s),[h,a,l]},$g=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Yg.RE(),r.push(t,e),s.push(Yg.first,Yg.second,Yg.third),n=i,o=void 0,h=Yg.third,l?r.push(i):a=!0,[n,o,h,a]),qg=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Yg.RE(),Yg.RE()):a>0&&(Yg.RE(),u>0&&(u-=1)),n.push(t),r.push(Yg.first,Yg.second,Yg.third),a=Yg.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Zg=(t,e=0)=>{Yg.LE(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],y=s[c],p=!1,m=u>0?g.y!==y.y?2:1:0;if(r>1)for(;cy.y?d.y>f.y?[a,l,u]=jg(g,y,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Jg(g,y,d,f,o,n,h,a,l,u,t):[a,l,u,p]=$g(g,y,d,o,h,a,l,u,p,t):d.y===f.y?(a=g,p&&(h.push(g),p=!1,Yg.RE()),0===h.length&&u>0&&m>0&&(m-=1)):d.y>f.y?[a,l,u,m]=qg(g,0,d,f,n,h,a,l,u,t,m):[a,l,u,m]=qg(g,0,d,f,o,h,a,l,u,t,m)}return[h,new Uint16Array(n),new Uint16Array(o),u,m]};class Kg extends tn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.WE=0,this._a=Array(),this.HE=0,this.UE=new Uint16Array(0),this.$E=new Uint16Array(0),this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE()}Ts(){const t=this.zo(),e=this.po.M(),i=this.Oa;if(this.Vo()){this.dO.dL(this.ct);const s=this.ct instanceof Li==0,r=s?this.ct.Ai():void 0,n=this.pl(),o=this.ct.Mi()||t,h=i||this.nl.o||o&&"disabled"!==n.type;if(h){if(this.WE=0,this.UE=new Uint16Array(0),this.$E=new Uint16Array(0),this._a.length=0,this.HE=0,this.ol>1){const[t,e,i,o]=Zg([s?n.packager(this.hl,r,.5):this.hl,s?n.packager(this.rl,r,.5):this.rl]);this.WE=o,this.UE=e,this.$E=i,this._a=t,this.HE=t.length}this.nl.o=!1}if(this.ll&&this.Ia[0].length>1){const[t,e]=this.Ia,i=t.length,[o,h,a,l,u]=Zg([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.WE);this.WE=l;const c=o.length;for(let t=u;t0||this.ol>0?1:u;s{if(this.yB.MR(o,e,this.ct.ni(),void 0).$L(r).oL(s("uIsHighlighted"),1===t||2===t?0:this.xo).aL(s("uHighlightColorOffset"),this._o).oL(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(s("uScale"),this.dO.lL()).rL(s("uDisp"),this.dO.uL()).rL(h("uScaleStart_highpart"),this.dO.UR()).rL(h("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(h("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(h("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(h("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(h("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(s("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(s("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(s("uColor"),this.cE);else if(N(i))this.yB.aL(s("uColor"),i.getColor());else if(K(i)){if(!this.JE)return!1;this.yB.SR(o,this.JE,i)}else if(et(i)){if(!this.QE)return!1;this.yB.xR(o,this.QE,i)}else W(i)&&this.qE&&this.yB.LR(o,i.lut,this.qE,0);return this.yB.jL(this.hz),!0}))}const r=1===t?this.IE:this.jE;if(r&&this.tz&&this.iz){const i=this.tz,s=this.iz;this.yB.sO(r).eL(r,((r,n,o,h)=>{if(this.yB.MR(o,i,this.ct.ni(),void 0).$L(s).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(r("uScale"),this.dO.lL()).rL(r("uDisp"),this.dO.uL()).rL(h("uScaleStart_highpart"),this.dO.UR()).rL(h("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(h("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(h("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(h("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(h("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(r("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(r("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(r("uColor"),this.cE);else if(N(e))this.yB.aL(r("uColor"),e.getColor());else if(K(e)){if(!this.SE)return!1;this.yB.SR(o,this.SE,e)}else if(et(e)){if(!this.xE)return!1;this.yB.xR(o,this.xE,e)}else W(e)&&this.YE&&this.yB.LR(o,e.lut,this.YE,0);return this.yB.jL(this.sz),!0}))}return this}rE(t){return this.uE===t&&{}}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}ov(t){this.$a()>0&&this.Ts();const[e,i]=this.Ea(),s=e.length>2&&e[1].x0&&this.Ts();const[e,i]=this.Ea(),s=e.length;if(0===s)return;const r=this.cl?1:0,n=s-(this.dl?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.rz;s+=1){const r=i-s*Math.PI/this.rz;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.bL.vB.get(e);return i||(i=new Qg(t,e),t.bL.vB.set(e,i),i)})(t,e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2),ey={cz:(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.GL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.GL(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.GL(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.GL(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.GL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.GL(i,1),h.enableVertexAttribArray(i)}},dz:(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.GL(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.GL(r,1),h.enableVertexAttribArray(r)},fz:(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.GL(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.GL(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.GL(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.GL(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.GL(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.GL(i,1),h.enableVertexAttribArray(i)}},gz:(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.GL(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.GL(r,1),h.enableVertexAttribArray(r)},mB:(t,e,i,s,r,n,o)=>{const h=t.eE(),{uniform:a,uniformOptional:l}=i,u=1/t._n.Dn,c=(r?Math.max(n,u):Math.max(n,0))+1;h.oL(a("uThicknessPixels"),c).oL(l("uAALimit"),1-(c-1)/c).rL(a("uRatioPxClip"),[2/t.Ht().x,2/t.Ht().y]),e.sO(i,s).Xp(o)}},iy={cz:(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)}},dz:(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)},fz:(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)}},pz:(t,e)=>{const i=t.eE();i.Xp(i.gl.LINE_STRIP,e,0)},mz:(t,e)=>{const i=t.eE();i.Xp(i.gl.LINES,2*e,0)}};class sy extends nn{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.Ta=Fe,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.yz=this.yB.sR}Ts(){const t=this.Go(),e=this.jl,i=qi(e)&&e,s=No(e)&&e,r=i||s,n=r&&r.getFillStyle(),o=N(n)&&n,h=et(n)&&n,a=K(n)&&n,l=W(n)&&n,c=o||h||a||l&&["x","y"].includes(l.getLookUpProperty())&&l,d=this.di(),f=this.ui(),g=this.po.M(),p=this.po.o,m=e.L();if(s&&this.ct instanceof Li)return xt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.dO.dL(this.ct),this.ql&&(this.Sz=this.yB.tL(Qt([d,f],this.ct.ni()),!1,this.Sz),this.Ta=y(u(d.x,d.y),u(f.x,f.y))),t||p){const t=this.Vo()&&r&&c&&m>0,e=h?["gradient",h]:a?["gradient",a]:l?["lookup",l.getLookUpProperty()]:"uniform";this.xz=t?{type:"triangulated",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.LineInstanced2D({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),this.yz?Bg.AliasedEdge:void 0,s&&Bg.StippleTextureInstanced),mousePickingShader:g?this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.LineInstanced2D({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),s&&Bg.StippleTextureInstanced):void 0,geometry:ty(this.yB,m),thickness:m,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l}:void 0,l?this.bz=this.iE.XE(l.lut,this.bz):this.bz&&(this.iE.ZE(this.bz),this.bz=void 0)}if(K(n)?this.CE=Gg(Gr(this.Ta,{x:this.sl(),y:this.el()},this.ct),this.ct,n.getPosition(),n.getExtent(),n.getShape(),this.yB.oO()):et(n)?this.TE=Hg(Gr(this.Ta,{x:this.sl(),y:this.el()},this.ct),this.ct,n.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),s){if(t||this.ql){const t=[0,0,Math.abs(f.x-d.x),Math.abs(f.y-d.y)];this.vz=this.yB.tL(t,!1,this.vz)}this.Mz=this.yB.DR(s.getPattern())}else this.vz&&(this.yB.fL(this.vz),this.vz=void 0),this.Mz=void 0;return this.Kl(e),this.ql=!1,this.po.o=!1,this}mB(t){var e,i;const s=this.Sz;if(!s)return this;const r=this.xz;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.xz)||void 0===e?void 0:e.mousePickingShader:null===(i=this.xz)||void 0===i?void 0:i.shader;return c?(this.yB.sO(c).eL(c,((e,i,c,d)=>{if(this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(d("uScaleStart_highpart"),this.dO.UR()).rL(d("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(d("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(d("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(d("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(d("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(e("uColor"),this.cE);else if(n)this.yB.aL(e("uColor"),n.getColor());else if(h){if(!this.CE)return!1;this.yB.SR(c,this.CE,h)}else if(o){if(!this.TE)return!1;this.yB.xR(c,this.TE,o)}else if(a){if(!this.bz)return!1;this.yB.LR(c,a.lut,this.bz,0)}if(l){if(!this.vz||!this.Mz)return!1;ey.dz(this.yB,c,this.vz,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.yB.rL(e("uStippleCount"),[this.ls.Ht().x/this.Mz.uw,this.ls.Ht().y/this.Mz.uw]).oL(d("uStippleTextureWidthLimiter"),this.Mz.OR/this.Mz.uw).oL(e("uStippleScale"),l.getPatternScale()).nL(e("uStippleTexture"),this.Mz.BR,1)}return ey.cz(this.ct.ni(),this.yB,s,c,this.ct.ni()?4:2,0),ey.mB(this.iE,r.geometry,c,this.yz&&1!==t,1===t,u,1),!0})),this):this}rE(t){return this.uE===t&&{}}dispose(){return super.dispose(),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.xz=void 0,this.Sz&&(this.yB.fL(this.Sz),this.Sz=void 0),this.vz&&(this.yB.fL(this.vz),this.vz=void 0),this.Mz=void 0,this}jB(){return this}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return Te(this.jl)}el(){return Te(this.jl)}}class ry extends on{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this._z=[],this.Az=!1,this.wz=!1,this.kz=!1,this.Cz=!1,this.dO=new zg,this.Ta=Fe,this.iE=t,this.sE=e,this.Tz=n,this.yB=t.eE(),this.yz=this.yB.sR,this.Fz=t._n.On}kr(){const t=this.Tz(),e={ps:t=>this.Iz(e,t),us:t=>this.Pz(e,t),Ig:(t,i)=>this.Dz(e,t,i),aL:t=>this.Bz(e,t),fi:{x:0,y:0},ci:{x:0,y:0},xo:0,Oz:void 0,uE:t.id,cE:t.color};return this._z.push(e),e}Ha(){var t;return this._z.length=0,this.Az=!0,this.Ii&&this.un&&(null===(t=this.ls.an)||void 0===t?void 0:t.entity)===this&&this.un(this,void 0,this.ls.an.collectionMember),this}Iz(t,e){if(e&&!this._z.includes(t))this._z.push(t);else if(!e){const e=this._z.indexOf(t);this._z.splice(e,1)}return this.kz=!0,t}Pz(t,e){return t.xo=e,this.wz=!0,t}Dz(t,e,i){return t.fi=e,t.ci=i,this.Az=!0,t}Bz(t,e){return t.Oz=e,this.Cz=!0,t}Ts(){const t=this.po.M(),e=this.po.o,i=this.Go(),s=this.jl,r=this._z,n=this.wz,o=this.Az,h=this.kz,a=this.Cz,l=qi(s)&&s,u=No(s)&&s,c=l||u,d=c&&c.getFillStyle(),f=N(d)&&d,g=H(d)&&d,y=K(d)&&d,p=et(d)&&d,m=f||g||p||y,S=s.L(),x=u?"triangulated":s.getThickness()<0?"primitive":"triangulated";if(u&&this.ct instanceof Li)return xt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;this.dO.dL(this.ct);const b=o||h;if(b){const t=[];for(let e=0;e0&&c&&m&&S>0&&e;this.xz=i?"triangulated"===x?{type:"triangulated",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.LineInstanced2D({axisWorldTranslation:Kf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),this.yz?Bg.AliasedEdge:void 0,u&&Bg.StippleTextureInstanced,Bg.AttributeHighlight),mousePicking:t?{shader:this.yB.sL(Bg["2D"],Bg.MousePickingAttribute,Bg.LineInstanced2D({axisWorldTranslation:Kf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),u&&Bg.StippleTextureInstanced,Bg.AttributeHighlight)}:void 0,geometry:ty(this.yB,S),thickness:S,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:p,fillStyleRadialGradient:y}:{type:"primitive",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),Bg.AttributeHighlight),mousePicking:t?{shader:this.yB.sL(Bg["2D"],Bg.MousePickingAttribute,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0,snapToNearestPixel:this.Fz}),Bg.AttributeHighlight)}:void 0,lineStyleSolid:l,lineStyleDashed:u,fillStyleSolid:f,fillStyleIndividual:g,fillStyleLinearGradient:p,fillStyleRadialGradient:y}:void 0}if(u){if(i||b){const t=new Float32Array(4*r.length);let e=0;for(let i=0;i{t[e]=i.xo,e+=1})),this.Lz=this.yB.tL(t,!0,this.Lz)}else{const t=new Float32Array(2*r.length);let e=0;r.forEach((i=>{for(let s=e;s{const s=i.Oz||g.color;t[e]=s.r,t[e+1]=s.g,t[e+2]=s.b,t[e+3]=s.a,e+=4})),this.Rz=this.yB.tL(t,!1,this.Rz)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{const s=i.Oz||g.color;for(let i=e;i{t[e+0]=i.cE.r,t[e+1]=i.cE.g,t[e+2]=i.cE.b,t[e+3]=i.cE.a,e+=4})),this.Ez=this.yB.tL(t,!0,this.Ez)}else{const t=new Float32Array(8*r.length);let e=0;r.forEach((i=>{for(let s=e;s{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(g("uScaleStart_highpart"),this.dO.UR()).rL(g("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(g("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(g("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(g("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(g("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.Fz&&this.yB.rL(g("uViewportSizePx"),[this.ls.Ht().x*this.yB.oO(),this.ls.Ht().y*this.yB.oO()]),this.yB.aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1===t){if(!r)return!1;"triangulated"===o?this.yB.hL(r,1,{location:d("aColor"),size:4}):this.yB.HL(d("aColor"),r)}else if(h)this.yB.aL(e("uColor"),h.getColor());else if(a){if(!this.Rz)return!1;this.yB.hL(this.Rz,"triangulated"===o?1:void 0,{location:d("aColor"),size:4})}else if(u){if(!this.SE)return!1;this.yB.SR(f,this.SE,u)}else if(l){if(!this.xE)return!1;this.yB.xR(f,this.xE,l)}if(c){if(!this.vz||!this.Mz)return!1;ey.gz(this.yB,f,this.vz,d("aLengthSoFarA"),d("aLengthSoFarB"),2,0),this.yB.rL(e("uStippleCount"),[this.ls.Ht().x/this.Mz.uw,this.ls.Ht().y/this.Mz.uw]).oL(g("uStippleTextureWidthLimiter"),this.Mz.OR/this.Mz.uw).oL(e("uStippleScale"),c.getPatternScale()).nL(e("uStippleTexture"),this.Mz.BR,0)}if("triangulated"===o){const{geometry:e,thickness:r}=n;ey.fz(this.ct.ni(),this.yB,i,f,this.ct.ni()?4:2,0),this.yB.hL(1===t||2===t?this.yB.dR:s,1,{location:d("aIsHighlighted"),size:1}),ey.mB(this.iE,e,f,this.yz&&1!==t,1===t,r,this._z.length)}else iy.fz(this.ct.ni(),this.yB,i,f,this.ct.ni()?4:2,0),this.yB.UL(d("aIsHighlighted"),1===t||2===t?this.yB.dR:s),iy.mz(this.iE,this._z.length);return!0})),this):this}rE(t){const e=this._z.find((e=>e.uE===t));return!!e&&{collectionMember:e}}dispose(){return super.dispose(),this.xz=void 0,this.Sz&&(this.yB.fL(this.Sz),this.Sz=void 0),this.vz&&(this.yB.fL(this.vz),this.vz=void 0),this.Lz&&(this.yB.fL(this.Lz),this.Lz=void 0),this.Ez&&(this.yB.fL(this.Ez),this.Ez=void 0),this.Rz&&(this.yB.fL(this.Rz),this.Rz=void 0),this.Mz=void 0,this}jB(){return this}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return Te(this.jl)}el(){return Te(this.jl)}}class ny{constructor(t,e){this.zz=!1,this.Vz=!1,this.Nz=!1,this.ct=t,this.Gz=e,this.Gz.wo("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.zz="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.zz="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.Vz=!0),!0===t.regularProgressiveStep&&(this.Nz=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.zz?t[0].x:t[0].y,end:"x"===this.zz?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.zz?"x"===this.zz?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.Wz=!0)}))}Yz(t,e=!1){if(this.Wz||!this.zz||"linear"!==this.jz.type)return!1;!1===e&&this.Xz&&(clearTimeout(this.Xz),this.Xz=void 0);const i="x"===this.zz?this.jz.scale.x.eg:this.jz.scale.y.eg;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.zz?r.x:r.y,"x"===this.zz?n.x:n.y,s),h=this.jz.scale,a=Math.abs("x"===this.zz?h.Ai().x:h.Ai().y),l=a/o,u=Math.floor(l*oy),c=u*o,d=xt.performance.now(),f=!(d-i.sh<500)&&(i.Ke?d-i.ih<1e3:d-i.qe<2e3||i.Qe),g=s>2*this.Uz.totalDataPointsAtTime;if(f&&!g)return this.Xz=setTimeout((()=>this.Zz(t)),1e3),!1;const y=u>=10,p=this.Uz.enabled?this.Uz.columnWidthAxis/a<1.5:void 0,m=this.Uz.enabled&&u>this.Uz.dataPointsPerColumn?u/this.Uz.dataPointsPerColumn>=2:void 0;let S;!0===this.Uz.enabled?p?m&&(S={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):S=y?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:y&&(S={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const x=!1===e;return S?(x&&(this.Uz=S),!0):(x&&(this.Uz={...this.Uz,totalDataPointsAtTime:s}),!1)}gx(){this.Kz=void 0,this.$z.length=0,this.Xz&&(clearTimeout(this.Xz),this.Xz=void 0)}qz(t){if(0===t.length)return t;if(this.Wz||!this.zz||"linear"!==this.jz.type||!this.Uz.enabled)return t;let e;e=this.$z.length>0?he(this.$z,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.Kz,h=-1,a=-1,l=0,u=0;if("x"!==this.zz||this.Vz)if("x"===this.zz&&this.Vz){const t=this.Uz.columnWidthAxis;let c=this.Kz?this.Kz.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.Kz=s[c-1]),s}Jz(t){if(this.zz&&"linear"===this.jz.type){const e="x"===this.zz?this.jz.scale.x.eg:this.jz.scale.y.eg;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.je===zs.progressive||e.je===zs.regressive){const e=Math.abs("x"===this.zz?this.jz.scale.x.getInnerInterval():this.jz.scale.y.getInnerInterval());if(this.Uz.enabled)return 2*e/this.Uz.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.zz?s.x:s.y,"x"===this.zz?r.x:r.y,i)}}}Qz(t,e,i){if(!this.zz)return e;const s=i.length;let r=Lr(i,t.min,this.zz,this.Vz,0,s-1);void 0===r&&(r=this.Vz?s-1:0);let n=Lr(i,t.max,this.zz,this.Vz,0,s-1);return void 0===n&&(n=this.Vz?0:s-1),1+Math.abs(n-r)}tV(){this.Xz&&(clearTimeout(this.Xz),this.Xz=void 0)}Zz(t){this.Yz(t,!0)&&this.Ss()}}class ay extends ny{renderVisibleOnly(t,e){const i=this.ct.x.getInnerStart(),s=this.ct.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ct.y.getInnerStart(),h=this.ct.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 ly{constructor(t,e,i){this.iV=e,this.sV=i,this.eV=t,this.hV=[]}rV(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.eV[this.eV.length-1];do{const t=this.eV.length;let r;h||(h=this.nV(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.sV&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.eV[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.eV.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.oV()}aV(t){const e=t,i=this.eV.indexOf(e);i>=0&&this.eV.splice(i,1),e.droppedTimestamp=xt.performance.now(),this.hV.push(e)}lV(){this.eV.slice().forEach((t=>this.aV(t)))}uV(){this.eV.forEach((t=>this.iV(t))),this.hV.forEach((t=>this.iV(t))),this.eV.length=0,this.hV.length=0}nV(t,e){const i=2*t/3,s=4*t/3,r=this.hV.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.hV[r];return this.hV.splice(r,1),this.eV.push(t),t}}oV(){if(this.hV.length>5){const t=xt.performance.now();for(let e=0;e=1e4)&&(this.iV(i),this.hV.splice(e,1),e-=1)}}}}class uy extends ny{cV(t,e){if(!e||"object"!=typeof e)return 0;const i=this.ct.x.getInnerStart(),s=this.ct.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ct.y.getInnerStart(),h=this.ct.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.dV(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.fV(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.gV(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}dV(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}gV(t,e,i,s,r,n){if(void 0===e||!this.zz)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.zz?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.zz?a.boundaries.max.x2))break;o+=1}return o}fV(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.zz){if(this.Vz?"x"===this.zz?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.zz?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}pV(t,e){const i=t.reduce(((t,e)=>je(t,e.boundaries)),Fe);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.zz||this.Vz?"x"===this.zz&&this.Vz?i.max.x=Math.min(i.max.x,t):"y"!==this.zz||this.Vz?"y"===this.zz&&this.Vz&&(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 cy extends hn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.dO=new zg,this.nM=[],this.mV=new ay(this.ct,this),this.yV=new hy(this.ct,this,(()=>this.ls.Ss())),this.SV=new ly(this.nM,(t=>{t.coordsBuffer&&this.yB.fL(t.coordsBuffer),t.vz&&this.yB.fL(t.vz)}),!0),this.xV=new uy(this.ct,this),this.bV=0,this.vV=0,this.MV=!1,this.sE=e,this.uE=n,this.cE=o,this._n=h,this.xz={type:"none"},this.yB=t.eE(),this.iE=t,this.yz=this.yB.sR;const a=this.ct.ni(),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;sQt(e,t))(a,l);this._V={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.jl.getFillStyle())}}AV(t,e,i){const s=new Float32Array(2*e);let r=0,n=i||t[0];for(let i=0;i0,o=this.po.M(),h=this.po.o,a=qi(e)&&e,l=No(e)&&e,u=a||l,c=u&&u.getThickness(),d=u&&u.getFillStyle(),f=N(d)&&d,g=et(d)&&d,y=K(d)&&d,p=W(d)&&d,m=f||g||y||p,S=this._V.individualLookupValuesEnabled;if(l&&this.ct instanceof Li)return xt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.Jl=he(this.Jl,s,{canReturnB:!0}),this.Fa+=r);let x=this.Ql.o;const b=this.xV.cV(this.nM,this.Ql.M());if(b>0){let t=0;for(let e=0;e{t.vz&&(this.yB.fL(t.vz),t.vz=void 0)})),this.MV=!1),M&&(this.yV.gx(),this.nM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=Fe,t.lastDataPoint=void 0})),this.SV.lV(),v=this.Jl,this.bV=0,this.vV=0);const A=this.yV.qz(v),w=A.length;if(w>0){let t=this.yV.Jz(this.Jl)||(this.wo("ApplicationType",(t=>"InternalUI"===t.type))?this.Fa:1e5);w/t>10&&(t=w/10),this.SV.rV(A,t,((t,e,i,s)=>{const r=this.mV.calculateUserDataPointsBoundaries(e),n=this.yV.Qz(r,i,this.Jl)-s;return this.wV=e[i-1],{allocatedCoordinatesCount:t,existingDataPointsCount:n,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.yB.OL(t*this._V.attributesPerVertex,this._V.prepareRenderData(e,i)),lastDataPoint:e[i-1],vz:this.MV?this.yB.OL(2*t,this.AV(e,i,this.wV)):void 0}}),((t,e,i,s)=>{const r=je(t.boundaries,this.mV.calculateUserDataPointsBoundaries(e)),n=this.yV.Qz(r,t.existingCoordinatesCount+i,this.Jl)-(t.jointPointsCount+s);this.yB.LL(t.coordsBuffer,t.existingCoordinatesCount*this._V.attributesPerVertex,this._V.prepareRenderData(e,i)),this.MV&&t.vz&&this.yB.LL(t.vz,2*t.existingCoordinatesCount,this.AV(e,i,this.wV)),this.wV=e[i-1],t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(x&&(this.Ta=this.xV.pV(this.nM,this.Ql.M())),this.dO.dL(this.ct),y?this.CE=Gg(this.Co(),this.ct,y.getPosition(),y.getExtent(),y.getShape(),this.yB.oO()):g?this.TE=Hg(this.Co(),this.ct,g.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),i||h){if(p&&"value"===p.getLookUpProperty()&&!S){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw xt.alert(t),new Error(t)}if(m&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=g?["gradient",g]:y?["gradient",y]:p?["lookup",p.getLookUpProperty()]:"uniform";this.xz="primitive"===t?{type:t,shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),l&&Bg.StippleTexture),mousePickingShader:o?this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),l&&Bg.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:y,fillStylePaletted:p}:"triangulated"===t?{type:t,shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:e}),Bg.LineInstanced2D({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),this.yz?Bg.AliasedEdge:void 0,l&&Bg.StippleTextureInstanced),mousePickingShader:o?this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.LineInstanced2D({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),l&&Bg.StippleTextureInstanced):void 0,geometry:ty(this.yB,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:y,fillStylePaletted:p}:{type:"none"}}else this.xz={type:"none"};p?this.bz=this.iE.XE(p.lut,this.bz):this.bz&&(this.iE.ZE(this.bz),this.bz=void 0)}return this.Mz=l?this.yB.DR(l.getPattern()):void 0,this.Kl(e),this.Oa=!1,this.Ia=[],this.po.o=!1,this.Ql.o=!1,this}mB(t){const e=this.yB.gl,i=this.xz;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.yB.sO(s).eL(s,((s,l,u,c)=>{let d=!1;if(this.yB.oL(s("uIsHighlighted"),1===t||2===t?0:this.xo).aL(s("uHighlightColorOffset"),this._o).oL(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(s("uScale"),this.dO.lL()).rL(s("uDisp"),this.dO.uL()).rL(c("uScaleStart_highpart"),this.dO.UR()).rL(c("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(c("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(c("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(c("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(c("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(s("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(s("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(s("uColor"),this.cE);else if(n)this.yB.aL(s("uColor"),n.getColor());else if(h){if(!this.CE)return!1;this.yB.SR(u,this.CE,h)}else if(o){if(!this.TE)return!1;this.yB.xR(u,this.TE,o)}else if(a){if(!this.bz)return!1;this.yB.LR(u,a.lut,this.bz,0)}return this.mV.renderVisibleOnly(this.nM,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?ey.cz:iy.cz;if(this.ct.ni()||void 0===this._V.attributeOffsetCoordinateLowPrecision?this.ct.ni()&&void 0!==this._V.attributeOffsetCoordinateHighPrecision&&h(!0,this.yB,o,u,this._V.attributesPerVertex,this._V.attributeOffsetCoordinateHighPrecision):h(!1,this.yB,o,u,this._V.attributesPerVertex,this._V.attributeOffsetCoordinateLowPrecision),r){if(!n.vz||!this.Mz)return;"triangulated"===i.type?ey.dz(this.yB,u,n.vz,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):iy.dz(this.yB,u,n.vz,l("aLengthSoFar"),2,0),this.yB.rL(s("uStippleCount"),[this.ls.Ht().x/this.Mz.uw,this.ls.Ht().y/this.Mz.uw]).oL(c("uStippleTextureWidthLimiter"),this.Mz.OR/this.Mz.uw).oL(s("uStippleScale"),r.getPatternScale()).nL(s("uStippleTexture"),this.Mz.BR,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this._V.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this._V.attributeOffsetLookUpValue+this._V.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;ey.mB(this.iE,i.geometry,u,this.yz&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else iy.pz(this.iE,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}rE(t){return this.uE===t&&{}}Wa(t,e){return Array.isArray(t)||(t=[t]),this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Ta=je(this.Ta,e||this.mV.calculateUserDataPointsBoundaries(t)),this}Ha(){return super.Ha(),this.bV=0,this.vV=0,this.wV=void 0,this}dispose(){return super.dispose(),this.SV.uV(),this.yV.tV(),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.xz={type:"none"},this.Mz=void 0,this}jB(){return this}ov(t){this.$a()>0&&this.Ts();const e=this.Ea(),i=kr(e,t,this.Ba,this.cl,this.dl,this.ct,this.engine.ct,this.Ta,this.mV.zz,this.mV.Vz);return void 0!==i?e[i]:void 0}Pw(t){this.$a()>0&&this.Ts();const e=this.Ea(),i=e.length;if(0===i)return;const s=this.cl?1:0,r=i-(this.dl?2:1);if(this.Ba===Cr.Nearest){let s,r,n=Pe;for(let o=0;o{const e=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 dy(t,e)},gy=t=>{const e=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new dy(t,e)},yy=(t,e,i)=>{let s=e.bL.bB.get(t);return s||(s=i(e),e.bL.bB.set(t,s)),s};class py extends qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.aE=y(c(ke,ke),c(Pe,Pe)),this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE()}Ts(){const t=this.po.M(),i=this.po.o,s=this.Ia,r=s.length,n=r>0,o=this.Aa.M(),h=this.Se,a=this.size.M(),l=this.ct.Mi(),c=this.size.o||this.Aa.o,d=this.Oa||s&&s.length>0,f=l||c;if(n&&(this._a=he(this._a,s,{canReturnB:!0}),this.Fa+=r),n||this.Oa){this.Ta=this.Da?je(this.Ta,this.Da):je(this.Ta,Xe(this._a));const t=Qt(this._a,this.ct.ni());this.FV=this.Fa,this.IV=this.yB.tL(t,!1,this.IV)}if(this.dO.dL(this.ct),c||this.Ro()||i){const e=this.wa.M()?"attribute":"uniform",i=a<=1&&Bg.PointSize(e),s=Bg.VertexLocation({offset:a>1?{dataType:e,sizeUnit:"px",symmetric:!0,rotation:(this.ka.M()||this.Ko.M()%360!=0)&&{dataType:this.ka.M()?"attribute":"uniform"}}:void 0,axisWorldTranslation:Kf(this.ct),normalSource:void 0}),r=N(this.Se)&&this.Se,n=K(this.Se)&&this.Se,o=et(this.Se)&&this.Se,h=W(this.Se)&&this.Se,l=H(this.Se)&&this.Se,u=r||n||o||h||l;this.gO=u?this.yB.sL(Bg["2D"],i,s,r?Bg.Color({dataType:"uniform"}):l?Bg.Color({dataType:"attribute"}):h?Bg.Color({dataType:["lookup",h.getLookUpProperty()]}):n?Bg.Color({dataType:["gradient",n]}):o?Bg.Color({dataType:["gradient",o]}):void 0):void 0,this.IE=t&&u?this.yB.sL(Bg["2D"],i,s,Bg.MousePicking):void 0}if(h!==z?f&&(this.PV&&(this.PV=void 0),a>1||H(h)?a<=1?this.uz=this.yB.gl.POINTS:o===e.PointShape.Triangle?(this.PV=yy(e.PointShape.Triangle,this.yB,fy),this.uz=this.yB.gl.TRIANGLES):o===e.PointShape.Circle?(this.PV=yy(e.PointShape.Circle,this.yB,(t=>((t,e)=>{const i=function(t=25){return zu(u(0,0),0,360,.5,.5,t)[0]}(24);return new dy(t,i)})(t))),this.uz=this.yB.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.PV=yy(e.PointShape.Square,this.yB,gy),this.uz=this.yB.gl.TRIANGLES):this.uz=this.yB.gl.POINTS:this.uz=this.yB.gl.POINTS):this.PV&&(this.PV=void 0),d||this.Ro()){const t=this._a.length;if(H(h)&&this.FV&&this.FV>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=di(this.Ko.M()),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;i{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(o("uScaleStart_highpart"),this.dO.UR()).rL(o("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(o("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(o("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(o("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(o("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.yB.MR(n,i,this.ct.ni(),this.PV?1:void 0).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).oL(o("uDevicePixelRatio"),this.yB.oO()),this.PV){const t=r("aInstanceGeo");this.yB.VL(t,this.PV.OB).GL(t,0)}if(1===t)this.yB.aL(e("uColor"),this.cE);else if(N(this.Se))this.yB.aL(e("uColor"),this.Se.getColor());else if(H(this.Se)&&this.DV){const t=r("aColor");this.yB.HL(t,this.DV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}else if(W(this.Se)&&this.bz){if("value"===this.Se.getLookUpProperty()&&this.LV){const t=r("aLookupValue");this.yB.UL(t,this.LV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}this.yB.LR(n,this.Se.lut,this.bz,0)}else if(K(this.Se)){if(!this.SE)return!1;this.yB.SR(n,this.SE,this.Se)}else if(et(this.Se)){if(!this.xE)return!1;this.yB.xR(n,this.xE,this.Se)}if(this.BV&&this.uz!==this.yB.gl.POINTS){const t=r("aOffsetPixels");this.yB.UL(t,this.BV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}else if(this.uz!==this.yB.gl.POINTS){const t=e("uOffsetPixels");this.yB.oL(t,this.size.M())}if(this.OV&&this.uz!==this.yB.gl.POINTS){const t=r("aRot");this.yB.VL(t,this.OV),this.uz!==this.yB.gl.POINTS&&this.yB.GL(t,1)}else if(this.uz!==this.yB.gl.POINTS&&this.Ko.M()%360!=0){const t=di(this.Ko.M()),i=Math.sin(t),s=Math.cos(t);this.yB.rL(e("uRot"),[i,s])}if(this.uz===this.yB.gl.POINTS)this.yB.oL(e("uPointSize"),this.size.M());else{const t={x:2/this.ls.Ht().x,y:2/this.ls.Ht().y};this.yB.rL(e("uRatioPxClip"),[t.x,t.y])}let h=!1;return this.uz===this.yB.gl.POINTS?(this.yB.Xp(this.uz,s),h=!0):this.PV&&(this.yB.YL(this.uz,0,this.PV.TV,s),h=!0),h}))),this}rE(t){return this.uE===t&&{}}zx(t){this.$a()>0&&this.Ts();const e=this.Ea(),i=kr(e,t,this.Ba,!1,!1,this.ct,this.ls.ct,this.Ta,void 0,void 0);return void 0!==i?e[i]:void 0}Me(t){return super.Me(t)}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return.5*this.size.M()}el(){return.5*this.size.M()}jB(){return this.IV&&(this.yB.fL(this.IV),this.IV=void 0),this.PV&&(this.PV=void 0),this.DV&&(this.yB.fL(this.DV),this.DV=void 0),this.OV&&(this.yB.fL(this.OV),this.OV=void 0),this.LV&&(this.yB.fL(this.LV),this.LV=void 0),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}}class my extends jr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.xz={fill:void 0,border:void 0},this.dO=new zg,this.Ta=Fe,this.RV=!1,this.EV=!1,this.zV=!1,this.VV=!1,this.Gc=[],this.iE=t,this.sE=e,this.Tz=n,this.yB=t.eE(),this.yz=this.yB.sR}kr(){const t=this.Tz(),e={ps:t=>this.Iz(e,t),us:t=>this.Pz(e,t),tl:t=>this.NV(e,t),gb:t=>this.GV(e,t),_a:[],u:void 0,xo:0,WV:!0,uE:t.id,cE:t.color};return this.Gc.push(e),e}Ha(){var t;return this.Gc.length=0,this.RV=!0,this.Ii&&this.un&&(null===(t=this.ls.an)||void 0===t?void 0:t.entity)===this&&this.un(this,void 0,this.ls.an.collectionMember),this}Iz(t,e){var i;return t.WV=e,this.VV=!0,this.Ii&&this.un&&(null===(i=this.ls.an)||void 0===i?void 0:i.entity)===this&&this.ls.an.collectionMember===t&&this.un(this,void 0,this.ls.an.collectionMember),t}Pz(t,e){return t.xo=e,this.zV=!0,t}NV(t,e){return t._a=e,this.RV=!0,t}GV(t,e){return t.u=e,this.EV=!0,t}Ts(){const t=this.po.M(),e=this.po.o,i=this.Ro(),s=this.zV,r=this.RV,n=this.EV,o=this.VV,a=this.xe,l=this.Go(),u=this.Gc.filter((t=>t.WV));if(this.dO.dL(this.ct),(r||o)&&(this.Ta=je(...u.map((t=>Xe(t._a))))),r||o){const t=Qt(u.map((t=>[...t._a,t._a[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.ct.ni()),e=this.ct.ni()?4:2;this.Sz=this.yB.tL(t,!1,this.Sz);let i=[];u.reduce(((s,r)=>{const n=s,o=(r._a.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._a.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=t._a.length+2;for(let r=i;rt+e._a.length+2),0),e=new Float32Array(4*t);let i=0;u.forEach((t=>{const s=t._a.length+2;for(let r=i;rt+e._a.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=void 0!==t.u?t.u:-34028234663852886e22,r=t._a.length+2;for(let t=i;t{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(f("uScaleStart_highpart"),this.dO.UR()).rL(f("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(f("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(f("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(f("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(f("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.yB.MR(d,n,this.ct.ni(),void 0).$L(u).UL(s("aIsHighlighted"),1===t||2===t?this.yB.dR:o).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.yB.HL(s("aColor"),h)}else if(i)this.yB.aL(e("uColor"),i.getColor());else if(a){if(!this.SE)return!1;this.yB.SR(d,this.SE,a)}else if(r){if(!this.xE)return!1;this.yB.xR(d,this.xE,r)}else if(l){if(!this.bz)return!1;if(this.yB.LR(d,l.lut,this.bz,0),"value"===l.getLookUpProperty()){if(!this.XV)return!1;this.yB.UL(s("aLookupValue"),this.XV)}}return this.yB.jL(c),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.$V,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.yB.sO(u).eL(u,((i,r,u,c)=>{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).rL(c("uScaleStart_highpart"),this.dO.UR()).rL(c("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(c("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(c("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(c("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(c("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(i("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(i("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),this.yB.hL(1===t||2===t?this.yB.dR:o,1,{location:r("aIsHighlighted"),size:1}).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.yB.hL(h,1,{location:r("aColor"),size:4})}else s&&this.yB.aL(i("uColor"),s.getColor());return ey.cz(this.ct.ni(),this.yB,n,u,this.ct.ni()?4:2,0),ey.mB(this.iE,e,u,this.yz&&1!==t,1===t,a,l),!0}))}return this}rE(t){const e=this.Gc.find((e=>e.uE===t));return!!e&&{collectionMember:e}}jB(){return this.HV&&(this.yB.fL(this.HV),this.HV=void 0),this.Sz&&(this.yB.fL(this.Sz),this.Sz=void 0),this.jV&&(this.yB.fL(this.jV),this.jV=void 0),this.YV&&(this.yB.fL(this.YV),this.YV=void 0),this.XV&&(this.yB.fL(this.XV),this.XV=void 0),this.xz={fill:void 0,border:void 0},this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return Te(this.xe)}el(){return Te(this.xe)}}class Sy extends Zr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.ZV=Fe,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.sE=e}Ts(){super.Ts();const t=this.po.M(),e=this.Ro(),i=this.jo.o||this.j.o||this.Ko.o||this.Jo.o,s=this.xe,r=this.Go(),n=s.getThickness(),o=this.Ho(n),h=this.Ko.M();this.dO.dL(this.ct);const a=this.ct.Mi();if(i||a){const t=this.j.M();this._a=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]=Ke(n[0],r,t),n[1]=Ke(n[1],r,t),n[2]=Ke(n[2],r,t),n[3]=Ke(n[3],r,t)}return n}(this.jo.M(),t.x,t.y,h,this.Jo.M());const e=Qt(this._a,this.ct.ni());this.gE=this.yB.tL(e,!1,this.gE),this.mE=this._a.length}this.ZV=Xe(this._a);const l=N(this.Se)&&this.Se,c=K(this.Se)&&this.Se,d=et(this.Se)&&this.Se,f=Oo(this.Se)&&this.Se,g=l||c||d||f;if(e&&(this.bE=g?this.yB.sL(Bg["2D"],l&&Bg.Color({dataType:"uniform"}),d&&Bg.Color({dataType:["gradient",d]}),c&&Bg.Color({dataType:["gradient",c]}),f&&Bg.Color({dataType:["image",f.getFitMode()]}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0),c?this.SE=Gg(this.So||this.ZV,this.ct,c.getPosition(),c.getExtent(),c.getShape(),this.yB.oO()):d?this.xE=Hg(this.So||this.ZV,this.ct,d.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0),f){const t=f.getSource();if((!this.KV||e)&&t){this.KV&&(this.KV.texture.eO(this),this.yB.fL(this.KV.texCoordsBuffer));const e=this.yB.bR(t);e.sO(this),this.KV={texture:e,texCoordsBuffer:this.yB.tL([]),sourceMissingTexture:this.yB.pR(new Uint8Array(Object.values(f.getSourceMissingColor().toJS()).map((t=>255*t))),this.yB.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{this.KV&&f&&(this.qV(),this.ls.Ss())}},e.BO(this.KV.textureReadyCallback),this.qV()}this.KV&&this.KV.texture.kO&&this.KV.texture.wO&&this.KV.texture.MO&&(this.KV.texture.Ts(),this.ls.Ss()),(a||i)&&this.KV&&this.KV.texture.kO&&this.qV()}else this.KV&&(this.KV.texture.eO(this),this.yB.fL(this.KV.texCoordsBuffer),this.KV=void 0);if(i||o||a&&1!==n){if(1===n||-1===n)[this.vE,this.JV]=[this._a,void 0];else{const t=this.ct;[this.vE,this.JV]=t instanceof Li?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.wi(s,r,h,-h),i.wi(r,s,-h,-h),i.wi(o,n,-h,-h),i.wi(n,o,h,-h),i.wi(s,r,-h,h),i.wi(r,s,h,h),i.wi(o,n,h,h),i.wi(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._a,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=ti(Qe(r,s)),l=ti(Qe(o,s)),c=ai(a),d=ai(l);return[[ri(s,ri(si(c,h.x),si(d,h.y))),ri(r,ri(si(a,h.x),si(d,h.y))),ri(o,ri(si(c,h.x),si(l,h.y))),ri(n,ri(si(a,h.x),si(l,h.y))),ri(s,ri(si(a,h.x),si(l,h.y))),ri(r,ri(si(c,h.x),si(l,h.y))),ri(o,ri(si(a,h.x),si(d,h.y))),ri(n,ri(si(c,h.x),si(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._a,t.Ai(),n)}this._E=this.yB.tL(Qt(this.vE,this.ct.ni()),!1,this._E),this.JV?(this.az=this.yB.EL(new Uint16Array(this.JV),this.az),this.ME=this.JV.length):(this.az&&this.yB.fL(this.az),this.az=void 0,this.ME=this.vE.length)}const y=qi(s)&&s,p=y&&y.getFillStyle(),m=p&&N(p)&&p,S=p&&et(p)&&p,x=p&&K(p)&&p,b=y,v=m||S||x;return r&&(this.FE=b&&v?this.yB.sL(Bg["2D"],Bg.Color({dataType:x?["gradient",x]:S?["gradient",S]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0),x?this.CE=Gg(this.ZV,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.yB.oO()):S?this.TE=Hg(this.ZV,this.ct,S.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),this.IE=t&&g?this.IE||this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0,this.PE=t&&this.xe!==st?this.PE||this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0,this.No(this.Se),this.Uo(s),this.jo.o=!1,this.Ko.o=!1,this.j.o=!1,this.Jo.o=!1,this}rE(t){return this.uE===t&&{}}qV(){if(this.KV&&Oo(this.Se)){const t=at(this.ca(),this.ct,this.ls.ct),i=ni(at(ri(this.ca(),this.Ht()),this.ct,this.ls.ct),t);this.KV.texCoordsBuffer=this.yB.tL(((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,y=0,p=1;switch(n){case e.ImageFitMode.Fill:u{if(this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(h("uScaleStart_highpart"),this.dO.UR()).rL(h("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(h("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(h("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(h("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(h("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize),1===t)this.yB.aL(e("uColor"),this.cE);else if(N(r))this.yB.aL(e("uColor"),r.getColor());else if(K(r)){if(!this.SE)return!1;this.yB.SR(o,this.SE,r)}else if(et(r)){if(!this.xE)return!1;this.yB.xR(o,this.xE,r)}else if(Oo(r)){if(!this.KV)return!1;const t=this.KV&&this.KV.texture.LO();this.yB.aL(h("uColor"),r.getSurroundingColor()).nL(e("uColorTexture"),t||this.KV.sourceMissingTexture,0).hL(this.KV.texCoordsBuffer,void 0,{location:n("aTextureCoord"),size:2}).DL(r.fitMode)}return this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).MR(o,i,this.ct.ni(),void 0).Xp(this.yB.gl.TRIANGLE_FAN,s),!0})));const n=1===t?this.PE:this.FE,o=this.xe,h=this._E;return n&&h&&qi(o)&&(this.yB.sO(n),this.yB.eL(n,((e,i,s,r)=>{this.ct instanceof _i||this.ct instanceof yu?this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).rL(r("uScaleStart_highpart"),this.dO.UR()).rL(r("uScaleStart_lowpart"),this.dO.$R()):this.ct instanceof Li&&this.yB.rL(r("uScaleStart"),this.dO.MixedScaleXY.uScaleStart).rL(r("uScaleStartLog"),this.dO.MixedScaleXY.uScaleStartLog).rL(r("uScaleInterval"),this.dO.MixedScaleXY.uScaleInterval).rL(r("uScaleIntervalLog"),this.dO.MixedScaleXY.uScaleIntervalLog).rL(e("uViewportStart"),this.dO.MixedScaleXY.uViewportStart).rL(e("uViewportSize"),this.dO.MixedScaleXY.uViewportSize);const n=o.getFillStyle();if(1===t)this.yB.aL(e("uColor"),this.cE);else if(N(n))this.yB.aL(e("uColor"),n.getColor());else if(K(n)){if(!this.CE)return!1;this.yB.SR(s,this.CE,n)}else if(et(n)){if(!this.TE)return!1;this.yB.xR(s,this.TE,n)}return this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).MR(s,h,this.ct.ni(),void 0),this.az?this.yB.$L(this.az).jL(this.ME):this.yB.Xp(this.yB.gl.LINE_LOOP,this.ME),!0}))),this}jB(){return this.az&&(this.yB.fL(this.az),this.az=void 0),this.gE&&(this.yB.fL(this.gE),this.gE=void 0),this._E&&(this.yB.fL(this._E),this._E=void 0),this.KV&&(this.KV.texture.eO(this),this.KV.texture.OO(this.KV.textureReadyCallback),this.yB.YB(this.KV.sourceMissingTexture),this.yB.fL(this.KV.texCoordsBuffer),this.KV=void 0),this.bE=void 0,this.FE=void 0,this.IE=void 0,this.PE=void 0,this}_t(){return Math.max(this.jo.M().x,this.jo.M().x+this.j.M().x)}Mt(){return Math.min(this.jo.M().x,this.jo.M().x+this.j.M().x)}wt(){return Math.max(this.jo.M().y,this.jo.M().y+this.j.M().y)}At(){return Math.min(this.jo.M().y,this.jo.M().y+this.j.M().y)}sl(){return Te(this.xe)}el(){return Te(this.xe)}}class xy extends Qr{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.dO=new zg,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.sE=e}zx(t){let e,i=Number.MAX_VALUE;for(const s of this._a){const r=Ne(at(s,this.ct,this.ls.ct),t);r=3,r=this.xe,n=this.Go(),o=r.getThickness(),a=this.Ho(o);this.dO.dL(this.ct),this.RM=this.ct.Ai();const l=this.ct.Mi();if(i&&(this.Ta=Xe(this._a)),i&&s){const t=Qt(this._a,this.ct.ni());this.gE=this.yB.tL(t,!1,this.gE),this.QV=new Uint16Array(h.default(t)),this.tN=this.yB.EL(this.QV,this.tN),this.mE=this.QV.length}const u=N(this.Se)&&this.Se,c=W(this.Se)&&this.Se,d=K(this.Se)&&this.Se,f=et(this.Se)&&this.Se,g=u||c&&"value"!==c.getLookUpProperty()&&c||f||d;if(e&&(c?this.bz=this.iE.XE(c.lut,this.bz):this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.bE=g?this.yB.sL(Bg["2D"],u&&Bg.Color({dataType:"uniform"}),f&&Bg.Color({dataType:["gradient",f]}),d&&Bg.Color({dataType:["gradient",d]}),c&&Bg.Color({dataType:["lookup",c.getLookUpProperty()]}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0),d?this.SE=Gg(this.So||this.Ta,this.ct,d.getPosition(),d.getExtent(),d.getShape(),this.yB.oO()):f?this.xE=Hg(this.So||this.Ta,this.ct,f.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0),(i||a||l&&1!==o)&&s){const t=1===o||-1===o?this._a:Ug(this._a,this.RM,o);this.vE=Qt(t,this.ct.ni()),this._E=this.yB.tL(this.vE,!0,this._E),this.ME=t.length}const y=qi(r)&&r,p=y&&y.getFillStyle(),m=p&&N(p)&&p,S=p&&et(p)&&p,x=p&&K(p)&&p,b=y,v=m||S||x;return n&&(this.FE=b&&v?this.yB.sL(Bg["2D"],Bg.Color({dataType:x?["gradient",x]:S?["gradient",S]:"uniform"}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0),x?this.CE=Gg(this.So||this.Ta,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.yB.oO()):S?this.TE=Hg(this.So||this.Ta,this.ct,S.getAngle(!0),this.yB.oO()):(this.CE=void 0,this.TE=void 0),this.IE=t&&g?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0,this.PE=t&&this.xe!==st?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0,this.Qa=!1,this.No(this.Se),this.Uo(r),this}mB(t){const e=this.Se,i=1===t?this.IE:this.bE,s=this.gE,r=this.mE;i&&s&&r&&this.yB.sO(i).eL(i,((i,r,n,o)=>{if(this.yB.rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).rL(o("uScaleStart_highpart"),this.dO.UR()).rL(o("uScaleStart_lowpart"),this.dO.$R()).MR(n,s,this.ct.ni(),void 0).$L(this.tN).oL(i("uIsHighlighted"),1===t||2===t?0:this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),1===t)this.yB.aL(i("uColor"),this.cE);else if(N(e))this.yB.aL(i("uColor"),e.getColor());else if(K(e)){if(!this.SE)return!1;this.yB.SR(n,this.SE,e)}else if(et(e)){if(!this.xE)return!1;this.yB.xR(n,this.xE,e)}else W(e)&&this.bz&&this.yB.LR(n,e.lut,this.bz,0);return this.yB.jL(this.mE),!0}));const n=1===t?this.PE:this.FE,o=this.xe,h=this._E,a=this.ME;return n&&h&&a&&this.yB.sO(n).eL(n,((e,i,s,r)=>{this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).MR(s,h,this.ct.ni(),void 0);const n=o.getFillStyle();if(1===t)this.yB.aL(e("uColor"),this.cE);else if(N(n))this.yB.aL(e("uColor"),n.getColor());else if(K(n)){if(!this.CE)return!1;this.yB.SR(s,this.CE,n)}else if(et(n)){if(!this.TE)return!1;this.yB.xR(s,this.TE,n)}const a=o.getThickness(),l=-1===a||1===a;return this.yB.Xp(l?this.yB.gl.LINE_LOOP:this.yB.gl.TRIANGLE_STRIP,this.ME),!0})),this}rE(t){return this.uE===t&&{}}jB(){return this.tN&&(this.yB.fL(this.tN),this.tN=void 0),this.gE&&(this.yB.fL(this.gE),this.gE=void 0),this._E&&(this.yB.fL(this._E),this._E=void 0),this.bE=void 0,this.FE=void 0,this.IE=void 0,this.PE=void 0,this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}}const by=(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},My=(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(!De(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=ze(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.pR(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.pR(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.pR(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},Ty=(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 Ey extends Yr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.iN=m("bilinear"),this.lu=vr.lineStyle,this.engine=t,this.Ta=y({x:Math.min(n.start.x,n.start.x+n.columns*n.step.x),y:Math.min(n.start.y,n.start.y+n.rows*n.step.y)},{x:Math.max(n.start.x,n.start.x+n.columns*n.step.x),y:Math.max(n.start.y,n.start.y+n.rows*n.step.y)});const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this._n={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}uS(t){return this.iN.S(t),this}cS(){return this.iN.M()}uu(t){return this.lu="function"==typeof t?t(this.lu):t,this}cu(){return this.lu}}class Iy extends Ey{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.dO=new zg,this.xz={},this.sN=[],this.eN=!1,this.Oa=!1,this.hN=by,this.iE=t,this.sE=e,this.uE=o,this.cE=h,this.yB=t.eE(),this.sE=e;const a=Math.min(this.yB.$B,void 0!==n.rN?n.rN:2048),l={x:Math.min(a,this._n.primaryDimensionVectorsCount),y:Math.min(a,this._n.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._n,l,this.hN),c=u.gridTiles.map((t=>{const e="columns"===this._n.dataOrder?{x:this._n.start.x+this._n.step.x*t.iFirstVector.primary,y:this._n.start.y+this._n.step.y*t.iFirstVector.secondary}:{x:this._n.start.x+this._n.step.x*t.iFirstVector.secondary,y:this._n.start.y+this._n.step.y*t.iFirstVector.primary},i="columns"===this._n.dataOrder?{x:this._n.step.x*t.sizeHeatmapDataVectors.primary,y:this._n.step.y*t.sizeHeatmapDataVectors.secondary}:{x:this._n.step.x*t.sizeHeatmapDataVectors.secondary,y:this._n.step.y*t.sizeHeatmapDataVectors.primary},s="columns"===this._n.dataOrder?{x:this._n.start.x+this._n.step.x*t.iFirstUniqueVector.primary,y:this._n.start.y+this._n.step.y*t.iFirstUniqueVector.secondary}:{x:this._n.start.x+this._n.step.x*t.iFirstUniqueVector.secondary,y:this._n.start.y+this._n.step.y*t.iFirstUniqueVector.primary},r="columns"===this._n.dataOrder?{x:this._n.step.x*t.sizeUniqueHeatmapDataVectors.primary,y:this._n.step.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this._n.step.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this._n.step.y*t.sizeUniqueHeatmapDataVectors.primary},n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,startLocationAxis:e,startRenderLocationAxis:s,sizeAxis:i,renderSizeAxis:r,intensityData:n,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.nN={gridTiles:c,gridTileSizes:d}}Ts(){const t=this.sN,e=this.Se,i=this.Ro(),s=this.lu,r=s!==this.Iu,n=W(e)&&e,o=N(e)&&e,h=n&&n.getPalette(),a=this.iN.o,l=this.iN.M(),u=this.Oa,c=this.po.M();this.oN=this.oN||this.aN();const d=this.oN,f=My(t,d,u?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));f.size>0&&(Ty(this.yB,f,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.eN=!0),this.dO.dL(this.ct);const g=this.xz;if((i||a)&&(h?this.lN=this.iE.XE(h,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),g.tile=n&&this.lN?{renderMode:"paletted",fillStylePaletted:n,colorLookupTexture:this.lN,shader:this.yB.sL(Bg["2D"],Bg.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===l&&"bilinear",flipXY:"rows"===this._n.dataOrder,intensityTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN}),Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Kf(this.ct),flipXY:"rows"===this._n.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Kf(this.ct),flipXY:"rows"===this._n.dataOrder,normalSource:void 0}))}:void 0),r){const t=qi(s)&&s,e=t&&t.getFillStyle(),i=N(e)&&e;g.wireframe=t&&i?-1===t.getThickness()?{renderMode:"primitive",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this._n.dataOrder,axisWorldTranslation:Kf(this.ct),normalSource:void 0})),fillStyleSolid:i}:{renderMode:"triangulated",shader:this.yB.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this._n.dataOrder,axisWorldTranslation:Kf(this.ct),normalSource:void 0})),geometry:ty(this.yB,1),solidLine:t,fillStyleSolid:i}:void 0,g.wireframe?this.uN=this.uN||this.cN():this.uN&&(this.yB.fL(this.uN.wireframeCoordinatesBuffer),this.uN=void 0)}return g.mousePicking=c?this.xz.mousePicking||{shader:this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Kf(this.ct),flipXY:"rows"===this._n.dataOrder,normalSource:void 0}))}:void 0,this.xz=g,this.Oa=!1,this.sN.length=0,this.No(e),this.Iu=s,this.iN.o=!1,this}aN(){const t=this.nN.gridTiles.map((t=>{const e=wy(this.yB,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e}})),e=this.nN.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.yB.tL([0,0,1,0,0,1,1,1]),s=this.yB.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}cN(){const t=this._n.primaryDimensionVectorsCount+1+this._n.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{if(1===t)this.yB.aL(e("uColor"),this.cE);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.yB.aL(e("uColor"),t.getColor())}return this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).hL(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).rL(e("uScaling"),[this._n.step.x*this._n.columns,this._n.step.y*this._n.rows]).rL(e("uTranslationAxis"),[this._n.start.x,this._n.start.y]).Xp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{colorLookupTexture:r,fillStylePaletted:n}=i;this.yB.eL(e,((i,o,h)=>{let l=!1;var u,c;return this.yB.sO(e).rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).LR(h,n.lut,r,0).hL(s.rectangleLocationsBuffer,void 0,{location:o("aPos"),size:2}).oL(i("uIsHighlighted"),this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),u=t=>{this.yB.rL(i("uTileDimensions"),["columns"===this._n.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this._n.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},c=(t,e)=>{let r;const n=this.yB.oO();if("bilinear"===this.iN.M()){const e=(this.ct.x.ut(t.startLocationAxis.x)+a.x/2)*n,i=(this.ct.y.ut(t.startLocationAxis.y)+a.y/2)*n;r=[e,i,(this.ct.x.ut(t.startLocationAxis.x+t.sizeAxis.x)-a.x/2)*n-e,(this.ct.y.ut(t.startLocationAxis.y+t.sizeAxis.y)-a.y/2)*n-i]}else{const e=this.ct.x.ut(t.startLocationAxis.x)*n,i=this.ct.y.ut(t.startLocationAxis.y)*n;r=[e,i,this.ct.x.ut(t.startLocationAxis.x+t.sizeAxis.x)*n-e,this.ct.y.ut(t.startLocationAxis.y+t.sizeAxis.y)*n-i]}this.yB.CL(i("uTileBounds"),r).rL(i("uScaling"),[t.renderSizeAxis.x,t.renderSizeAxis.y]).rL(i("uTranslationAxis"),[t.startRenderLocationAxis.x,t.startRenderLocationAxis.y]).nL(i("uTileIntensityValues"),t.intensityDataTexture,1).Xp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),l=!0},s.gridTileSizes.forEach((t=>{u(t),t.tiles.forEach((t=>{c(t)}))})),l}))}}const n=this.uN,o=this.xz.wireframe,h=1===t||null==o?void 0:o.shader;if(n&&o&&h&&"primitive"===o.renderMode){const e=h,{fillStyleSolid:i}=o;this.yB.sO(e).eL(e,((e,s,r)=>((this.ct instanceof _i||this.ct instanceof yu)&&this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()),this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).aL(e("uColor"),i.getColor()).hL(n.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).rL(e("uScaling"),[this._n.step.x,this._n.step.y]).rL(e("uTranslationAxis"),[this._n.start.x,this._n.start.y]).Xp(this.yB.gl.LINES,2*n.wireframeSegmentsLength),!0)))}else if(n&&o&&"triangulated"===o.renderMode){const{shader:e,geometry:i,solidLine:s,fillStyleSolid:r}=o;this.yB.sO(e).eL(e,((e,o,h)=>((this.ct instanceof _i||this.ct instanceof yu)&&this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()),this.yB.oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).aL(e("uColor"),r.getColor()).oL(e("uThicknessPixels"),s.getThickness()).rL(e("uRatioPxClip"),[2/this.ls.Ht().x,2/this.ls.Ht().y]).hL(n.wireframeCoordinatesBuffer,1,{location:o("aLocationA"),size:2},{location:o("aLocationB"),size:2}).rL(e("uScaling"),[this._n.step.x,this._n.step.y]).rL(e("uTranslationAxis"),[this._n.start.x,this._n.start.y]),i.sO(h,!1).Xp(n.wireframeSegmentsLength),!0)))}return this}dS(t){return this.sN.push(t),Ay(this.nN.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this}Ha(){return this.eN&&(this.nN.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Oa=!0,this.eN=!1),this}dispose(){super.dispose(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0);const t=this.oN;t&&(t.gridTiles.forEach((t=>{this.yB.YB(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.yB.fL(t.rectangleLocationsBuffer)),this.oN=void 0;const e=this.uN;return e&&this.yB.fL(e.wireframeCoordinatesBuffer),this.uN=void 0,this.xz={},this}jB(){return this.dispose(),this}rE(t){return this.uE===t&&{}}zx(t){const e=t,i="columns"===this._n.dataOrder?e.x:e.y,s="columns"===this._n.dataOrder?e.y:e.x,r="columns"===this._n.dataOrder?this._n.start.x:this._n.start.y,n="columns"===this._n.dataOrder?this._n.start.y:this._n.start.x;let o=(i-r)/("columns"===this._n.dataOrder?this._n.step.x:this._n.step.y),h=(s-n)/("columns"===this._n.dataOrder?this._n.step.y:this._n.step.x);o=Math.floor(Ct(o,0,this._n.primaryDimensionVectorsCount-1)),h=Math.floor(Ct(h,0,this._n.secondaryDimensionVectorsCount-1));const a=this.dN(o,h),l="columns"===this._n.dataOrder?{x:this._n.start.x+(o+.5)*this._n.step.x,y:this._n.start.y+(h+.5)*this._n.step.y}:{x:this._n.start.x+(h+.5)*this._n.step.x,y:this._n.start.y+(o+.5)*this._n.step.y},u="columns"===this._n.dataOrder?o:h,c="columns"===this._n.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}tv(t){if(t.xthis.Ta.max.x||t.ythis.Ta.max.y)return;const e=t,i="columns"===this._n.dataOrder?e.x:e.y,s="columns"===this._n.dataOrder?e.y:e.x,r="columns"===this._n.dataOrder?this._n.start.x:this._n.start.y,n="columns"===this._n.dataOrder?this._n.start.y:this._n.start.x,o="columns"===this._n.dataOrder?this._n.step.x:this._n.step.y,h="columns"===this._n.dataOrder?this._n.step.y:this._n.step.x,a=Ct((i-r)/o-.5,0,this._n.primaryDimensionVectorsCount-1),l=Ct((s-n)/h-.5,0,this._n.secondaryDimensionVectorsCount-1),u=Ct(Math.ceil(a)-1,0,this._n.primaryDimensionVectorsCount-1),c=Ct(Math.ceil(l)-1,0,this._n.secondaryDimensionVectorsCount-1),d={point:{x:u,y:c},value:this.dN(u,c)},f={point:{x:u,y:c+1},value:this.dN(u,c+1)},g={point:{x:u+1,y:c},value:this.dN(u+1,c)},y={point:{x:u+1,y:c+1},value:this.dN(u+1,c+1)},p=Ao({x:a,y:l},d,f,g,y);if(void 0===p)return;const m=Ct(Math.floor(a+.5),0,this._n.primaryDimensionVectorsCount-1),S=Ct(Math.floor(l+.5),0,this._n.secondaryDimensionVectorsCount-1),x="columns"===this._n.dataOrder?m:S,b="columns"===this._n.dataOrder?S:m,v=t;return{x:v.x,y:v.y,column:x,row:b,cellValue:p}}dN(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}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}jC(){const t=[];return this.nN.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){for(let e=0;e0?this.nM[0].boundaries.min.x:Pe:this.Ta.min.y=this.nM.length>0?this.nM[0].boundaries.min.y:Pe}return this.nM.forEach((t=>t.shape.Ts())),this.Ql.o=!1,this}mB(t){return this.nM.forEach((e=>e.shape.mB(t))),this}yS(t){if(0===t.length)return this;let e=0;const i=this.gN.dataPerSegment,s=t.length;do{let r=this.nM[this.nM.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this._n.scrollDimension?i:this._n.resolution,rows:"rows"===this._n.scrollDimension?i:this._n.resolution,heatmapDataType:this._n.heatmapDataType,dataOrder:this._n.scrollDimension,step:this._n.step,start:"columns"===this._n.scrollDimension?{x:this._n.start.x+this._n.step.x*this.fN,y:this._n.start.y}:{x:this._n.start.x,y:this._n.start.y+this._n.step.y*this.fN}};this.nM.length>0&&(t.start="columns"===this._n.scrollDimension?{x:t.start.x-1*this._n.step.x,y:t.start.y}:{x:t.start.x,y:t.start.y-1*this._n.step.y},o=!0);const e=new Iy(this.iE,this.sE,this.ct,Et,[],t,this.uE,this.cE).uS(this.iN.M()).Me(this.Se).uu(this.lu);r={shape:e,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.fN,hasJoint:!1,boundaries:e.Ta},this.nM.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._n.resolution};o&&(u.values.unshift(this.pN),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.dS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),r.boundaries=r.shape.Ta,this.pN=l[l.length-1],this.fN+=a,e+=a}while(e{t.shape.dispose().jB()})),this.nM.length=0,this.Ta=this._n.initialBoundaries,this.fN=0,this.pN=void 0,this}Me(t){return super.Me(t),this.nM.forEach((t=>t.shape.Me(this.Se))),this}uu(t){return super.uu(t),this.nM.forEach((t=>t.shape.uu(this.lu))),this}uS(t){return super.uS(t),this.nM.forEach((e=>e.shape.uS(t))),this}dispose(){return super.dispose(),this.nM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.nM.forEach((e=>e.shape.setVisible(t))),this}jB(){return this.nM.forEach((t=>t.shape.jB())),this}rE(t){return this.uE===t&&{}}zx(t){const e=at(t,this.ct,this.engine.ct),i=this.nM.reduce(((i,s)=>{const r=s.shape.zx(t);if(r){const t=Ge(at(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.fN||"rows"===this._n.scrollDimension&&e>=this.fN)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}tv(t){const e=at(t,this.ct,this.engine.ct),i=this.nM.reduce(((i,s)=>{const r=s.shape.tv(t);if(r){const t=Ge(at(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.fN||"rows"===this._n.scrollDimension&&e>=this.fN)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}sl(){return 0}el(){return 0}us(t){return super.us(t),this.nM.forEach((e=>e.shape.us(t))),this}}class ky extends Yr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.iN=m("bilinear"),this.lu=vr.lineStyle,this._n=n}uS(t){return this.iN.S(t),this}cS(){return this.iN.M()}uu(t){return this.lu="function"==typeof t?t(this.lu):t,this}cu(){return this.lu}}class Fy extends ky{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.dO=new zg,this.xz={},this.iE=t,this.sE=e,this.uE=o,this.cE=h,this.yB=t.eE(),this.sE=e,this.UC=new Iy(this.iE,t.mN,t.ct,Et,[],{start:{x:0,y:0},step:{x:1,y:1},columns:n.sectors,rows:n.annuli,heatmapDataType:"intensity",dataOrder:"annuli"===n.dataOrder?"rows":"columns",rN:this.yB.$B},-1,C).uu(st);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.yN={vertexBuffer:this.yB.tL(l),drawMode:this.yB.gl.TRIANGLE_FAN,drawLength:362}}Ts(){const t=this.Se,e=N(t)&&t,i=W(t)&&t,s=e||i,r=this.Ro(),n=i&&i.getPalette(),o=this.iN.M(),h=this.iN.o,a=this.po.M(),l=this.po.o;return this.dO.dL(this.ct),this.UC.Ts(),this.UC.oN?((r||h)&&(this.xz.fill=s?{shader:this.yB.sL(Bg["2D"],Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Kf(this.ct),normalSource:void 0}),i&&Bg.PolarHeatmap({interpolation:"bilinear"===o&&"bilinear",intensityTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN,flipXY:"sectors"===this._n.dataOrder}),e&&Bg.PolarHeatmap({dataType:"uniform"})),fillStylePaletted:i,fillStyleSolid:e}:void 0,n?this.lN=this.iE.XE(n,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0)),l&&(this.xz.mousePicking=a?{shader:this.yB.sL(Bg["2D"],Bg.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Kf(this.ct),normalSource:void 0}),Bg.Color({dataType:"uniform"}))}:void 0),this.No(t),this.iN.o=!1,this.po.o=!1,this):this}mB(t){var e;const{vertexBuffer:i,drawLength:s,drawMode:r}=this.yN,n=this.UC.oN,o=this.lN;if(!this.xz.fill||!n)return this;const{fillStylePaletted:h,fillStyleSolid:a}=this.xz.fill,l=1===t?null===(e=this.xz.mousePicking)||void 0===e?void 0:e.shader:this.xz.fill.shader;if(!l)return this;const u=this.ct.Ob(),c=Math.min(u.start,u.end),d=Math.max(u.start,u.end),f=Math.min(this._n.amplitudeStart,this._n.amplitudeStart+(this._n.annuli-1)*this._n.amplitudeStep),g=Math.max(this._n.amplitudeStart,this._n.amplitudeStart+(this._n.annuli-1)*this._n.amplitudeStep);let y;return y=u.end>u.start?Math.min(g,d)-u.start:Math.max(f,c)-u.start,this.yB.sO(l).eL(l,((e,l,u,c)=>{if(this.yB.rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0).rL(c("uViewportSize"),[this.iE.Ht().x*this.yB.oO(),this.iE.Ht().y*this.yB.oO()]).rL(e("uScaling"),[y,y]).rL(e("uTranslationAxis"),[0,0]).hL(i,void 0,{location:l("aPos"),size:2}).oL(c("uAngleOffset"),this.ct.Vb()%(2*Math.PI)).oL(c("uAngleDirection"),this.ct.Ub()?1:-1).oL(c("uSectors"),this._n.sectors).oL(c("uAnnuli"),this._n.annuli),1===t)this.yB.aL(e("uColor"),this.cE);else{if(this.yB.oL(e("uAmplitudeStart"),this._n.amplitudeStart).oL(e("uAmplitudeStep"),this._n.amplitudeStep).oL(e("uAmplitudeAxisStart"),this.ct.Ob().start).oL(e("uAmplitudeAxisEnd"),this.ct.Ob().end),h){if(!o)return!1;this.yB.LR(u,h.lut,o,1).nL(e("uTileIntensityValues"),n.gridTiles[0].intensityDataTexture,0)}a&&this.yB.aL(e("uColor"),a.getColor())}return this.yB.Xp(r,s),!0})),this}dS(t){return this.UC.dS(t),this}Ha(){return this.UC.Ha(),this}dispose(){return super.dispose(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),this.UC.dispose(),this.xz={},this.yB.fL(this.yN.vertexBuffer),this}jB(){return this.dispose(),this}rE(t){return this.uE===t&&{}}zx(t){const e=this._n.amplitudeStart,i=this._n.amplitudeStart+(this._n.annuli-1)*this._n.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._n.sectors);n>=this._n.sectors&&(n=0);const o=Math.round((t.amplitude-e)/(i-e)*(this._n.annuli-1));return{iAnnulus:o,iSector:n,cellValue:this.dN(o,n),angle:n*(360/this._n.sectors),amplitude:e+o*(i-e)/(this._n.annuli-1)}}tv(t){const e=this._n.amplitudeStart,i=this._n.amplitudeStart+(this._n.annuli-1)*this._n.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._n.sectors,o=(t.amplitude-e)/(i-e)*(this._n.annuli-1),h=Math.floor(n),a=Math.floor(o),l={point:{x:a,y:h},value:this.dN(a,h)},u={point:{x:a,y:h+1},value:this.dN(a,h+1)},c={point:{x:a+1,y:h},value:this.dN(a+1,h)},d={point:{x:a+1,y:h+1},value:this.dN(a+1,h+1)},f=Ao({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}dN(t,e){const i="annuli"===this._n.dataOrder?t:e,s="annuli"===this._n.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}_t(){return 0}Mt(){return 0}wt(){return 0}At(){return 0}sl(){return 0}el(){return 0}}const By={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)=>By.multiply(t,By.translation(e,i)),rotate:(t,e)=>By.multiply(t,By.rotation(e)),scale:(t,e,i)=>By.multiply(t,By.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],y=e[4],p=e[5],m=e[6],S=e[7],x=e[8];return[c*i+d*n+f*a,c*s+d*o+f*l,c*r+d*h+f*u,g*i+y*n+p*a,g*s+y*o+p*l,g*r+y*h+p*u,m*i+S*n+x*a,m*s+S*o+x*l,m*r+S*h+x*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class _y extends $r{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.SN=[],this.dO=new zg,this.xN=[u(0,0),u(0,0),u(0,0),u(0,0)],this.bN=y(u(0,0),u(0,0)),this.vN=y(u(0,0),u(0,0)),this.MN=u(0,0),this._N=u(0,0),this.RM=u(0,0),this.AN=u(0,0),this.wN=0,this.iE=t,this.sE=e,this.uE=n,this.cE=o,this.yB=t.eE(),this.sE=e,this.Fz=t._n.On}Ts(){const t=this.Vo(),e=this.zo(),i=this.po.M();if(t){const t=this.yB,s=this.yB.oO();if(this.dO.dL(this.ct),this.qo.o){this.kN&&this.kN.eO(this),this.font.S(fr(this.qo.M()));const t=this.font.M();this.kN=this.yB.Fh(t.properties.family),this.kN.sO(this)}const r=this.font.o,n=r||this.$o.o;if(n&&this.kN){const e=this.font.M();[this.CN,this.vN]=this.kN.rO(this.$o.M(),e.properties),this.SN.forEach((e=>{e.texCoordBuff&&t.fL(e.texCoordBuff),e.vertexBuff&&t.fL(e.vertexBuff)})),this.SN=this.CN.map((e=>({texCoordBuff:t.tL(e.texCoords,!1),texture:e.texture,info:e}))),this.qo.o=!1,this.font.o=!1,this.$o.o=!1}const o=this.ct.Mi()||e,h=this.jo.o||this.Xo.o||this.Yo.o||this.Zo.o||this.Qo.o||this.Ft.o||n||o,a=this.Qo.M(),l=si(u(this.Xo.M()+1,this.Yo.M()+1),.5);if(h&&this.CN&&(this.MN=u(-(a.left*s+this.vN.max.x-this.vN.min.x+a.right*s)*l.x-this.vN.min.x+a.right*s,-(a.bottom*s+this.vN.max.y-this.vN.min.y+a.top*s)*l.y-this.vN.min.y+a.top*s)),(h||o||this.Ko.o||this.Ro())&&this.Se!==z){if(this.CN){const e=ri(this.jo.M(),this.Zo.M()),i=at(e,this.ct,this.ls.ct),r=si(i,s);this.AN=r;const o=di(this.Ko.M());this.wN=o,n&&this.SN.forEach((e=>{const i=e.info;i&&(e.vertexBuffLen=i.vertices.length/2,e.vertexBuff=t.tL(i.vertices,!0,e.vertexBuff))}));const h=this.Ft.M(),c=[ri(Ke(u((this.vN.min.x+(-h.left-a.left)*s+this.MN.x)/s,(this.vN.max.y+(h.top+a.top)*s+this.MN.y)/s),this.Jo,o),i),ri(Ke(u((this.vN.max.x+(h.right+a.right)*s+this.MN.x)/s,(this.vN.max.y+(h.top+a.top)*s+this.MN.y)/s),this.Jo,o),i),ri(Ke(u((this.vN.max.x+(h.right+a.right)*s+this.MN.x)/s,(this.vN.min.y+(-h.bottom-a.bottom)*s+this.MN.y)/s),this.Jo,o),i),ri(Ke(u((this.vN.min.x+(-h.left-a.left)*s+this.MN.x)/s,(this.vN.min.y+(-h.bottom-a.bottom)*s+this.MN.y)/s),this.Jo,o),i)];this.xN=[at(c[0],this.ls.ct,this.ct),at(c[1],this.ls.ct,this.ct),at(c[2],this.ls.ct,this.ct),at(c[3],this.ls.ct,this.ct)];const d=Xe(c);this._N=u(-(d.max.x-d.min.x)*s*l.x-d.min.x*s+this.AN.x,-(d.max.y-d.min.y)*s*l.y-d.min.y*s+this.AN.y),this.AD=ni(d.max,d.min);const f=Xe(this.xN),g=this.ct.Jt(f.min,this._N),y=this.ct.Jt(f.max,this._N);this.bN=Xe([g,y])}K(this.Se)?this.SE=Gg(this.bN,this.ct,this.Se.getPosition(),this.Se.getExtent(),this.Se.getShape(),this.yB.oO()):et(this.Se)?this.xE=Hg(this.bN,this.ct,this.Se.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0)}const c=N(this.Se)&&this.Se,d=K(this.Se)&&this.Se,f=et(this.Se)&&this.Se,g=c||d||f;(this.Ro()||r)&&(this.gO=g?this.yB.sL(Bg["2D"],Bg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.Fz}),Bg.Color({dataType:d?["gradient",d]:f?["gradient",f]:"uniform",maskTexture:!0})):void 0),this.TN=i&&g?this.TN||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.Fz})):void 0,this.jo.o=!1,this.Xo.o=!1,this.Yo.o=!1,this.Zo.o=!1,this.Ko.o=!1,this.No(this.Se)}return this.ta=t,this}mB(t){if(this.Vo()){const e=1===t?this.TN:this.gO;if(!e||0===this.SN.length)return this;const i=this.yB.gl.drawingBufferWidth,s=this.yB.gl.drawingBufferHeight;let r=By.projection(i,s,-1);const n=By.translation(this.MN.x,this.MN.y),o=By.translation(this._N.x,this._N.y);r=By.translate(r,this.AN.x,this.AN.y),r=By.multiply(r,o),r=By.rotate(r,this.wN),r=By.multiply(r,n),1===t&&(r=By.scale(r,this.vN.max.x,this.vN.max.y)),this.yB.sO(e).eL(e,((e,i,s,n)=>{if(this.yB.FL(e("uMatrix"),r).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),this.Fz&&this.yB.rL(n("uViewportSizePx"),[this.ls.Ht().x*this.yB.oO(),this.ls.Ht().y*this.yB.oO()]),1===t)this.yB.aL(e("uColor"),this.cE);else if(N(this.Se))this.yB.aL(e("uColor"),this.Se.getColor());else if(K(this.Se)&&this.SE){this.yB.rL(e("uCenter"),this.SE.center).rL(e("uDistance"),this.SE.distance).CL(e("uBounds"),this.SE.bounds).oL(e("uAspect"),this.SE.aspectRatio);const t=this.Se.getColorStops();for(let i=0;i{this.yB.VL(i("aPos"),t.vertexBuff).VL(i("aMaskTextureCoord"),t.texCoordBuff).nL(e("uMaskTexture"),t.texture,0).Xp(this.yB.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}rE(t){return this.uE===t&&{}}ze(){return this.Vo()?this.xN:[]}Ic(){return this.Vo()&&this.AD?this.AD:u(0,0)}Ht(){if(this.Vo()&&this.bN){const t=this.bN;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}jB(){return this.SN.forEach((t=>{t.texCoordBuff&&this.yB.fL(t.texCoordBuff),t.vertexBuff&&this.yB.fL(t.vertexBuff)})),this.SN=[],this.kN&&this.kN.eO(this),this}_t(){return this.bN.max.x}Mt(){return this.bN.min.x}wt(){return this.bN.max.y}At(){return this.bN.min.y}sl(){return 0}el(){return 0}}class Ly{constructor(t,e,i){this.FN=new Set,this.IN=t=>(this.FN.add(t),t),this.PN=t=>(this.FN.delete(t),t.jB(),this),this.ls=t,this.Po=e,this.DN=i}pB(t){this.FN.delete(t)&&this.FN.add(t)}G(){for(const t of this.FN)t.jB().dispose();this.ls.en(this.Po)}Ss(){return this.ls.Ss(),this}sn(){return this.Po}}class Dy extends Ly{constructor(){super(...arguments),this.ON=m(void 0),this.Do=!1}kS(t){return this.ON.S(t),this}cp(){return this.ON.M()}}class zy extends Dy{constructor(t,e,i){super(t,e,i),this.iE=t,this.gl=t.eE(),this.LN=this.FN}QO(t){const e=t instanceof Nr&&t;if(!e)return Fe;const i=e.Mt(),s=e._t(),r=e.At(),n=e.wt();if(i===Pe||s===ke||r===Pe||n===ke)return Fe;const o=e.sl(),h=e.el(),a=Gr({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ct),l={min:at(a.min,e.ct,t.ls.ct),max:at(a.max,e.ct,t.ls.ct)},u=this.ON.M();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.iE.EN();return{id:t,color:this.iE.zN(t)}})))}tm(t,e,i){const s=this.iE.EN();return this.IN(new cy(this.iE,this,t,this.PN,i,s,this.iE.zN(s),e))}Sr(t){const e=this.iE.EN();return this.IN(new _y(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}vy(t){const e=this.iE.EN();return this.IN(new py(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}Cc(t,e=sn.Simple){const i=this.iE.EN();if(e===sn.Simple)return this.IN(new xy(this.iE,this,t,this.PN,[],i,this.iE.zN(i)));throw new Error("GlEngine.addPolygon | No such polygon type!")}ab(t){return this.IN(new my(this.iE,this,t,this.PN,[],(()=>{const t=this.iE.EN();return{id:t,color:this.iE.zN(t)}})))}_e(t){const e=this.iE.EN();return this.IN(new Sy(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}nC(t){const e=this.iE.EN();return this.IN(new Kg(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}Dc(t){const e=this.iE.EN();return this.IN(new Wg(this.iE,this,t,this.PN,[],e,this.iE.zN(e)))}JC(t,e,i){if("intensity"===i.heatmapDataType){const s=this.iE.EN();return this.IN(new Py(this.iE,this,t,this.PN,e,s,this.iE.zN(s),i))}throw new ft("Unimplemented Heatmap Grid Static type")}$C(t,e,i){const s=this.iE.EN();return this.IN(new Iy(this.iE,this,t,this.PN,e,i,s,this.iE.zN(s)))}Qb(t,e,i){const s=this.iE.EN();return this.IN(new Fy(this.iE,this,t,this.PN,e,i,s,this.iE.zN(s)))}VN(t){return this.IN(new Ng(this.iE,this,this.PN,[],t))}Ts(){if(this.Do){this.Do=!1;const t=Array.from(this.FN).sort(((t,e)=>t.Oo()-e.Oo()));this.FN.clear();for(const e of t)this.FN.add(e)}for(const t of this.FN)t.Ts();return this}mB(t,e){const i=this.ON.M();if(i&&this.gl.JO(i.x*this.gl.oO()*e,i.y*this.gl.oO()*e,i.width*this.gl.oO()*e,i.height*this.gl.oO()*e),1!==t)for(const e of this.FN)e.getVisible()&&e.mB(t);else for(const e of this.FN)e.getMouseInteractions()&&e.getVisible()&&e.mB(t);return this.gl.ZO(!1),this}}class Oy extends Wf{constructor(t){super(t)}}class Ry extends Oy{constructor(t){super(t),this.NN="attribute";const{vertices:e,drawSize:i,drawMode:s}=Vy(t.gl);this.OB=t.tL(e),this.lz=i,this.uz=s}Xp(t,e,i,s){return this.yB.hL(this.OB,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}).YL(this.uz,0,this.lz,e),this}wB(){this.yB.fL(this.OB)}}const Vy=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 Ny extends Oy{constructor(t,e){super(t),this.NN="attribute",this.GN=e;const{vertices:i,indices:s}=Gy();this.OB=t.tL(i),this.az=t.EL(s),this.lz=s.length,this.uz=t.gl.TRIANGLES}Xp(t,e,i,s){return this.yB.hL(this.OB,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).$L(this.az).oL(t.uniform("uEdgeRoundness"),this.GN/2).ZL(this.uz,this.lz,0,e),this}wB(){this.yB.fL(this.OB),this.yB.fL(this.az)}WN(t){return this.GN=t,this}HN(){return this.GN}}const Gy=()=>{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=Ce.multiply(o,-1),l=Ce.multiply(h,-1),u=i;e[i]={thicknessDirection:Ce.addVec(t,o,h),edge:Ce.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ce.addVec(t,a,h),edge:Ce.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ce.addVec(t,a,l),edge:Ce.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ce.addVec(t,o,l),edge:Ce.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=Ce.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=Ce.normalize(Ce.lerp(t,n.direction,o)),a=Math.PI/2-Ce.angle(h,t),l=Ce.addVec(Ce.multiply(Ce.multiply(n.direction,-1),1-Math.cos(a)),Ce.multiply(Ce.multiply(t,-1),1-Math.sin(a)),Ce.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.bL.AB.get(e);return i||(i=void 0!==e&&e>0?new Ny(t,Ct(e,0,1)):new Ry(t),t.bL.AB.set(e,i),i)};class Uy extends Ag{iy(t){return this.EO=this.Zm.M(),this.Zm.S(t),this}gS(t){return this.UN=t,this}pS(){return this.UN}}class Wy extends Uy{constructor(t,e,i,s,r){super(t,e,i),this.$N=t,this.uE=s,this.cE=r,this.iE=t.iE,this.yB=this.iE.eE()}rE(t){return t===this.uE&&{}}}class Xy extends Wy{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UN="cull-back",this.Ta=Be,this.jN={},this.YN=[],this.Se=vr.fillStyle,this.Zm.S(Bo)}Ts(t){const e=this.YN,i=this.Se,s=i!==z,r=this.XN,n=this.Ro()||this.ZN!==r,o=this.RO(),h=this.po.M(),a=this.po.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.KN||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.jN[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.CV&&i.set(this.CV),this.CV=i,this.qN=e,this.JN=s*t}const d=H(i)?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.jN[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=y({x:Pe,y:Pe,z:Pe},{x:ke,y:ke,z:ke});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.Ta=e}this.KN=r,this.YN.length=0}return this.No(i),this.ZN=r,this.Zm.o=!1,this.po.o=!1,this}mB(t){const e=1===t?this.TN:this.gO,i=this.QN,s=this.oz,r=this.Se,n=this.KN,o=this.Zm.M();return e&&s&&void 0!==n&&this.yB.eL(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.yB.sO(e).TL(h("uScale"),this.$N.dO.lL()).TL(h("uDisp"),this.$N.dO.uL()).IL(h("uViewProjectionMatrix"),this.iG).oL(h("uIsHighlighted"),1===t||2===t?0:this.xo).aL(h("uHighlightColorOffset"),this._o).oL(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},y={location:void 0,size:4},p={location:void 0,size:1};if(1!==t&&"phong"===o.type&&this.yB.TL(h("uCameraLoc"),this.sG).TL(h("uLightLoc"),this.eG).oL(h("uAmbientReflection"),o.ambientReflection).oL(h("uSpecularReflection"),o.specularReflection).oL(h("uDiffuseReflection"),o.diffuseReflection).oL(h("uShininess"),o.shininess).aL(h("uLightColor"),o.specularColor).aL(h("uAmbientColor"),o.ambientColor),1===t)this.yB.aL(h("uColor"),this.cE);else if(N(r))this.yB.aL(h("uColorDiffuse"),r.getColor());else if(H(r)){const t=a("aColor");y.location=t}else if(W(r)){const t=r.getLookUpProperty(),e=r.getPalette();"value"===t&&(p.location=a("aLookupValue")),this.yB.LR(l,e,this.bz,0)}return s&&(this.yB.hL(s,1,f,g,y,p),i.Xp(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}dispose(){return super.dispose(),this.oz&&(this.yB.fL(this.oz),this.oz=void 0),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.gO=void 0,this}jB(){return this.dispose(),this}py(t){this.YN=he(this.YN,t,{canReturnB:!0})}Me(t){return this.Se=Hr(this.Se,t),this}Th(){return this.Se}uy(t){return this.XN=void 0!==t&&t>0?Ct(t,0,1):void 0,this}tG(){return this.XN}_t(){return this.Ta.max.x}Mt(){return this.Ta.min.x}wt(){return this.Ta.max.y}At(){return this.Ta.min.y}hy(){return this.Ta.max.z}ny(){return this.Ta.min.z}sl(){return 0}el(){return 0}oy(){return 0}Ro(){return Ur(this.Eo,this.Se)}No(t){this.Eo=t}}class Yy extends Wf{constructor(t,e){super(t),this.NN="custom",this.rz=e;const{vertices:i,drawSize:s}=this.nz();this.oz=t.tL(i),this.lz=s}sO(t){return this.yB.hL(this.oz,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Xp(t){return this.yB.YL(this.yB.gl.TRIANGLE_STRIP,0,this.lz,t),this}nz(){const t=this.rz,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}}wB(){this.yB.fL(this.oz)}}const jy=(t,e=16)=>{let i=t.bL.MB.get(e);return i||(i=new Yy(t,e),t.bL.MB.set(e,i),i)};class Jy extends Wy{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UN="cull-back",this.hG=Be,this.rG=[],this.nG=!1,this.jl=vr.lineStyle,this.Zm.S(ko)}Ts(t){const e=this.nG,i=this.jl,s=this.Xl!==i,r=this.RO(),n=e;if(e){const t=te(this.rG);this.oG=this.yB.tL(t,!1,this.oG)}if(n&&(this.hG=Ye(this.rG)),s||r){const t=8,e=qi(i)&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.xz=void 0,N(e)&&("primitive"===s?this.xz={type:s,shader:this.yB.sL(Bg["3D"],Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0}),Bg.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.xz={type:s,shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:"uniform",shadingStyle:this.Zm.M().type}),Bg.LineInstanced3D({axisWorldTranslation:Kf(this.ct)})),geometry:jy(this.yB,t),fillStyle:e}))}return this.nG=!1,this.Xl=i,this.Zm.o=!1,this}mB(t){if(1===t)return this;const e=this.yB.gl,i=this.xz,s=this.oG,r=this.jl,n=this.Zm.M();if(i&&s&&qi(r))switch(i.type){case"instanced":{const o=.5*this.As.zm(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.yB.eL(a,((i,r,u)=>{this.yB.sO(a).TL(i("uScale"),this.$N.dO.lL()).TL(i("uDisp"),this.$N.dO.uL()).IL(i("uViewProjectionMatrix"),this.iG).aL(i("uColorDiffuse"),h).oL(i("uOffsetWU"),o).oL(i("uIsHighlighted"),this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.yB.TL(i("uCameraLoc"),this.sG).TL(i("uLightLoc"),this.eG).oL(i("uAmbientReflection"),n.ambientReflection).oL(i("uSpecularReflection"),n.specularReflection).oL(i("uDiffuseReflection"),n.diffuseReflection).oL(i("uShininess"),n.shininess).aL(i("uLightColor"),n.specularColor).aL(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.yB.GL(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(d,1),e.enableVertexAttribArray(d),l.sO(u).Xp(this.rG.length/2),!0}));break}case"primitive":{const n=qi(r)?r.getFillStyle():void 0,o=n&&N(n)?n.getColor():void 0;if(o){const r=i.shader;this.yB.eL(r,((i,n)=>(this.yB.sO(r).TL(i("uScale"),this.$N.dO.lL()).TL(i("uDisp"),this.$N.dO.uL()).IL(i("uViewProjectionMatrix"),this.iG).aL(i("uColor"),o).oL(i("uIsHighlighted"),this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0).hL(s,void 0,{location:n("aPos"),size:3}).Xp(e.LINES,this.rG.length),!0)))}break}}return this}Wa(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.yB.ff.Pn&&s>i.length&&xt.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}}wB(){this.yB.fL(this.oz)}}const qy=(t,e)=>{const i=Math.round(e);i<3&&me(0,Et);const s=i;let r=t.bL._B.get(Array.from(t.bL._B.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new $y(t,i,s),t.bL._B.set({sectors:i,stacks:s},r),r)};class Zy extends Wy{constructor(t,e,i,s,r){super(t,e,i,s,r),this.UN="cull-back",this.nM=[],this.xz={},this.SV=new ly(this.nM,(t=>t.vertexBuffer&&this.yB.fL(t.vertexBuffer)),!0),this.Jl=[],this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=Be,this.Oa=!1,this.jl=vr.lineStyle,this.my=vr.pointStyle3D,this.Zm.S(Bo),this._V={attributesPerVertex:3,prepareRenderData:(t,e)=>te(t)}}Ts(t){const e=this.Oa,i=this.Ia,s=this.Pa,r=s>0,n=this.jl,o=n!==this.Xl,h=this.my,a=h!==this.uG,l=this.RO(),u=this.po.o,c=this.po.M();this.Da&&(this.Ta=Je(this.Ta,this.Da),this.Da=void 0),r&&(this.Jl=he(this.Jl,i,{canReturnB:!0}),this.Fa+=s);let d=i,f=s;if(e&&(this.nM.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Be})),this.SV.lV(),d=this.Jl,f=this.Fa),f>0){const t=1e5,e=Math.floor(this.iE.cG/(this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.wo("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=Ct(i,t,e);this.SV.rV(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Be,vertexBuffer:this.yB.OL(t*this._V.attributesPerVertex,this._V.prepareRenderData(e,i))})),((t,e,i,s)=>{this.yB.LL(t.vertexBuffer,t.existingCoordinatesCount*this._V.attributesPerVertex,this._V.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=qi(n)&&n,i=e&&e.getFillStyle(),s=N(i)&&i,r=W(i)&&i,o=s||r,a=or(h)&&h.getSize(),l=or(h)&&h.getFillStyle(),u=N(l)&&l,d=W(l)&&l,f=u||d,g=or(h)&&h.getWireframeStyle(),y=g&&qi(g)&&g,p=y&&y.getFillStyle(),m=p&&N(p)&&p,S=n.getThickness()<0||1===n.getThickness()&&this.wo("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",x=r?["lookup",r.getLookUpProperty()]:"uniform";if("primitive"===S&&o?t.lines={type:"primitive",fillStyleSolid:s,fillStylePaletted:r,shader:this.yB.sL(Bg["3D"],Bg.Color({dataType:x}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})),mousePicking:c?{shader:this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0}))}:void 0}:"instanced"===S&&e&&o&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:s,fillStylePaletted:r,shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:x,shadingStyle:this.Zm.M().type}),Bg.LineInstanced3D({axisWorldTranslation:Kf(this.ct)})),geometry:Ky(this.yB,e.getThickness()),mousePicking:c?{shader:this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.LineInstanced3D({axisWorldTranslation:Kf(this.ct)}))}:void 0}),t.markers=void 0,f){const e=ne(h.getShape(),{cube:()=>Hy(this.yB),sphere:()=>Qy(this.yB,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof a&&a,pointSizeAxis:"object"==typeof a&&a,fillStyleSolid:u,fillStylePaletted:d,shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty()]:"uniform",shadingStyle:this.Zm.M().type,wireframe:!1!==m}),Bg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:Kf(this.ct),normalSource:e.NN})),mousePicking:c?{shader:this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:Kf(this.ct),normalSource:void 0}))}:void 0,wireframe:y&&m&&{thickness:y.getThickness(),fillStyleSolid:m}}}this.xz=t,r?this.dG=this.iE.XE(r.lut,this.dG):this.dG&&(this.iE.ZE(this.dG),this.dG=void 0),d?this.fG=this.iE.XE(d.lut,this.fG):this.fG&&(this.iE.ZE(this.fG),this.fG=void 0)}return this.Oa=!1,this.Ia=[],this.Pa=0,this.Xl=n,this.uG=h,this.Zm.o=!1,this.po.o=!1,this}mB(t){var e,i;const s=this.yB.gl,{lines:r,markers:n}=this.xz,o=this.Zm.M(),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.yB.eL(e,((r,h,u)=>{let c=!1;return this.yB.sO(e).TL(r("uScale"),this.$N.dO.lL()).TL(r("uDisp"),this.$N.dO.uL()).IL(r("uViewProjectionMatrix"),this.iG).oL(r("uOffsetWU"),this.As.zm(n.getThickness())).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.yB.TL(r("uCameraLoc"),this.sG).TL(r("uLightLoc"),this.eG).oL(r("uAmbientReflection"),o.ambientReflection).oL(r("uSpecularReflection"),o.specularReflection).oL(r("uDiffuseReflection"),o.diffuseReflection).oL(r("uShininess"),o.shininess).aL(r("uLightColor"),o.specularColor).aL(r("uAmbientColor"),o.ambientColor),1===t?this.yB.aL(r("uColor"),this.cE):a?this.yB.aL(r("uColorDiffuse"),a.getColor()):l&&this.dG&&this.yB.LR(u,l.lut,this.dG,0),this.nM.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.yB.GL(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.yB.GL(r,1),s.enableVertexAttribArray(r),i.sO(u).Xp(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.yB.eL(e,((r,o,h)=>{let a=!1;return this.yB.sO(e).TL(r("uScale"),this.$N.dO.lL()).TL(r("uDisp"),this.$N.dO.uL()).IL(r("uViewProjectionMatrix"),this.iG).oL(r("uIsHighlighted"),1===t||2===t?0:this.xo).aL(r("uHighlightColorOffset"),this._o).oL(r("uRenderEffectMask"),2===t?1:0),1===t?this.yB.aL(r("uColor"),this.cE):i?this.yB.aL(r("uColor"),i.getColor()):n&&this.dG&&this.yB.LR(h,n.lut,this.dG,0),this.nM.forEach((t=>{this.yB.hL(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Xp(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.yB.eL(e,((n,a,c,d)=>{let f=!1;return this.yB.sO(e).TL(n("uScale"),this.$N.dO.lL()).TL(n("uDisp"),this.$N.dO.uL()).IL(n("uViewProjectionMatrix"),this.iG).oL(d("uRatioNwuWu"),this.$N.gG()).oL(n("uIsHighlighted"),1===t||2===t?0:this.xo).aL(n("uHighlightColorOffset"),this._o).oL(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.yB.TL(n("uCameraLoc"),this.sG).TL(n("uLightLoc"),this.eG).oL(n("uAmbientReflection"),o.ambientReflection).oL(n("uSpecularReflection"),o.specularReflection).oL(n("uDiffuseReflection"),o.diffuseReflection).oL(n("uShininess"),o.shininess).aL(n("uLightColor"),o.specularColor).aL(n("uAmbientColor"),o.ambientColor),1===t?this.yB.aL(n("uColor"),this.cE):s?this.yB.aL(n("uColorDiffuse"),s.getColor()):r&&this.fG&&this.yB.LR(c,r.lut,this.fG,0),u&&1!==t&&this.yB.oL(n("uWireframeThickness"),u.thickness).aL(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.yB.TL(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.yB.oL(n("uOffsetNWU"),l),this.nM.forEach((e=>{this.yB.hL(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Xp(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}Wa(t,e){Array.isArray(t)||(t=[t]),this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Pa+=t.length;const i=e||Ye(t);return this.Da=this.Da?Je(this.Da,i):i,this}Pe(t){return this.jl="function"==typeof t?t(this.jl):t,this}Yl(){return this.jl}Om(t){return this.my="function"==typeof t?t(this.my):t,this}pG(){return this.my}_t(){return this.Da?Math.max(this.Da.max.x,this.Ta.max.x):this.Ta.max.x}Mt(){return this.Da?Math.min(this.Da.min.x,this.Ta.min.x):this.Ta.min.x}wt(){return this.Da?Math.max(this.Da.max.y,this.Ta.max.y):this.Ta.max.y}At(){return this.Da?Math.min(this.Da.min.y,this.Ta.min.y):this.Ta.min.y}hy(){return this.Da?Math.max(this.Da.max.z,this.Ta.max.z):this.Ta.max.z}ny(){return this.Da?Math.min(this.Da.min.z,this.Ta.min.z):this.Ta.min.z}sl(){return Te(this.jl)}el(){return Te(this.jl)}oy(){return Te(this.jl)}Ea(){return this.Jl}Ra(){return this.Ia}Ua(){return this.Fa}$a(){return this.Pa}Ha(){return this.Oa=!0,this.Jl.length=0,this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=void 0,this}dispose(){return super.dispose(),this.SV.uV(),this.xz={},this.dG&&(this.iE.ZE(this.dG),this.dG=void 0),this.fG&&(this.iE.ZE(this.fG),this.fG=void 0),this}jB(){return this.dispose(),this}}const Ky=(t,e)=>jy(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Qy=(t,e)=>{const i=e.getSize();return qy(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class tp extends Wy{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.UN="cull-back",this.nM=[],this.SV=new ly(this.nM,(t=>t.vertexBuffer&&this.yB.fL(t.vertexBuffer)),!1),this.Jl=[],this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=Be,this.Oa=!1,this._n=n,this.xy=vr.pointStyle3D,this.Zm.S(Bo);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 y=((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&&H(e)&&e.getFallbackColor()||C,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;ete(t))(o,h,a,l);this._V={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>y(t,this.xy,this.xy.fillStyle)}}Ts(t){const e=this.Oa,i=this.Ia,s=this.Pa,r=s>0,n=this.xy,o=this.xy!==this.mG,h=this.po.M(),a=this.po.o,l=this.RO();this.Da&&(this.Ta=Je(this.Ta,this.Da),this.Da=void 0),r&&(this.Jl=he(this.Jl,i,{canReturnB:!0}),this.Fa+=s);let u=i,c=s;if(e&&(this.nM.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Be})),this.SV.lV(),u=this.Jl,c=this.Fa),c>0){const t=Math.floor(this.iE.cG/(this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=Ct(c,1e5,t);this.SV.rV(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Be,vertexBuffer:this.yB.OL(t*this._V.attributesPerVertex,this._V.prepareRenderData(e,i))})),((t,e,i)=>{this.yB.LL(t.vertexBuffer,t.existingCoordinatesCount*this._V.attributesPerVertex,this._V.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}if(o||l||a){let t;const e=n.getSize(),i=n.getFillStyle(),s=this._V.individualPointColorEnabled,r=this._V.individualPointSizeEnabled,o=this._V.individualPointSizeAxisEnabled,a=this._V.individualLookupValuesEnabled,l=N(i)&&i,u=H(i)&&i,c=W(i)&&i,d=i===z&&z;if(u&&!s){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw xt.alert(t),new Error(t)}if(c&&"value"===c.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw xt.alert(t),new Error(t)}const f=or(n)&&n,g=f&&f.getWireframeStyle(),y=g&&qi(g)&&g,p=y&&y.getFillStyle(),m=p&&N(p)&&p;if(l||u||c||m){const i=u?"attribute":c?["lookup",c.getLookUpProperty()]:"uniform",s=r&&"number"==typeof e,a=o&&"object"==typeof e,f=s||a?"attribute":"uniform";if(or(n)){const o=ne(n.getShape(),{cube:()=>Hy(this.yB),sphere:()=>ep(this.yB,n,r)});t={type:"instanced",shader:this.yB.sL(Bg["3D"],Bg.ColorShaded3D({dataType:i,shadingStyle:this.Zm.M().type,wireframe:!1!==m}),Bg.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Kf(this.ct),normalSource:o.NN})),pointStyle:n,useIndividualPointSize:s,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,fillStyleEmpty:d,mousePickingShader:h&&this.yB.sL(Bg["3D"],Bg.MousePicking,Bg.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Kf(this.ct),normalSource:void 0})),geometry:o,wireframe:y&&m&&{thickness:y.getThickness()<0?1:y.getThickness(),fillStyleSolid:m}}}else lr(n)&&"number"==typeof e&&(t={type:"primitive",shader:this.yB.sL(Bg["3D"],Bg.PointSize(f),Bg.Color({dataType:i}),Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:s,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,mousePickingShader:h&&this.yB.sL(Bg["3D"],Bg.PointSize(f),Bg.MousePicking,Bg.VertexLocation({axisWorldTranslation:Kf(this.ct),normalSource:void 0}))})}this.xz=t,W(i)?this.lN=this.iE.XE(i.lut,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0)}return this.Oa=!1,this.Ia=[],this.Pa=0,this.mG=n,this.Zm.o=!1,this}mB(t){const e=this.yB.gl,i=this.xz;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.Zm.M(),{fillStyleSolid:n,fillStylePalette:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.yB.eL(s,((u,c,d,f)=>{let g=!1;if(this.yB.sO(s).TL(u("uScale"),this.$N.dO.lL()).TL(u("uDisp"),this.$N.dO.uL()).IL(u("uViewProjectionMatrix"),this.iG).oL(u("uIsHighlighted"),1===t||2===t?0:this.xo).aL(u("uHighlightColorOffset"),this._o).oL(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.yB.TL(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.yB.oL(u("uOffsetNWU"),e).oL(f("uRatioNwuWu"),this.$N.gG())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.yB.oL(u("uPointSize"),t).oL(u("uDevicePixelRatio"),this.yB.oO())}return 1===t?this.yB.aL(u("uColor"),this.cE):("instanced"===i.type?("phong"===r.type&&this.yB.TL(u("uCameraLoc"),this.sG).TL(u("uLightLoc"),this.eG).oL(u("uAmbientReflection"),r.ambientReflection).oL(u("uSpecularReflection"),r.specularReflection).oL(u("uDiffuseReflection"),r.diffuseReflection).oL(u("uShininess"),r.shininess).aL(u("uLightColor"),r.specularColor).aL(u("uAmbientColor"),r.ambientColor),l&&this.yB.oL(u("uWireframeThickness"),l.thickness).aL(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.yB.aL(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.yB.aL(u("uColorDiffuse"),P)):"primitive"===i.type&&n&&this.yB.aL(u("uColor"),n.getColor()),o&&this.lN&&this.yB.LR(d,o.lut,this.lN,0)),this.nM.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this._V.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this._V.attributeOffsetSize){"instanced"===i.type?this.yB.oL(f("uRatioNwuWu"),this.$N.gG()):"primitive"===i.type&&this.yB.oL(u("uDevicePixelRatio"),this.yB.oO());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this._V.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePalette&&"value"===i.fillStylePalette.getLookUpProperty()&&void 0!==this._V.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this._V.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this._V.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.yB.GL(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Xp(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.yB.Xp(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}Wa(t,e){Array.isArray(t)||(t=[t]),this.Ia=he(this.Ia,t,{canReturnB:!0}),this.Pa+=t.length;const i=e||Ye(t);return this.Da=this.Da?Je(this.Da,i):i,this}by(t){return this.xy="function"==typeof t?t(this.xy):t,this}yG(){return this.xy}_t(){return this.Da?Math.max(this.Da.max.x,this.Ta.max.x):this.Ta.max.x}Mt(){return this.Da?Math.min(this.Da.min.x,this.Ta.min.x):this.Ta.min.x}wt(){return this.Da?Math.max(this.Da.max.y,this.Ta.max.y):this.Ta.max.y}At(){return this.Da?Math.min(this.Da.min.y,this.Ta.min.y):this.Ta.min.y}hy(){return this.Da?Math.max(this.Da.max.z,this.Ta.max.z):this.Ta.max.z}ny(){return this.Da?Math.min(this.Da.min.z,this.Ta.min.z):this.Ta.min.z}sl(){const t=this.xy,e=t.getSize();return"number"==typeof e?or(t)?e/2:lr(t)?5:0:0}el(){return this.sl()}oy(){return this.sl()}Ea(){return this.Jl}Ra(){return this.Ia}Ua(){return this.Fa}$a(){return this.Pa}Ha(){return this.Oa=!0,this.Jl.length=0,this.Fa=0,this.Ia=[],this.Pa=0,this.Ta=Be,this.Da=void 0,this}dispose(){return super.dispose(),this.SV.uV(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),this.xz=void 0,this}jB(){return this.dispose(),this}}const ep=(t,e,i)=>{const s=e.getSize();return qy(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class ip extends Wy{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.UN="disabled",this.Se=vr.fillStyle,this.lu=vr.lineStyle,this.iN=m("bilinear"),this.SG=[],this.xG=Be,this.bG=void 0,this.xz={},this.vG=!1,this.Zm.S(ko);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this._n={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.xG={min:{x:Math.min(s.start.x,s.start.x+(s.columns-1)*s.step.x),z:Math.min(s.start.z,s.start.z+(s.rows-1)*s.step.z)},max:{x:Math.max(s.start.x,s.start.x+(s.columns-1)*s.step.x),z:Math.max(s.start.z,s.start.z+(s.rows-1)*s.step.z)}},this.MG=new Array(this._n.primaryDimensionVectorsCount).fill(void 0),this.UC=new Iy(this.iE,t.iE.mN,t.ls.ct,Et,[],{...this._n,start:{x:0,y:0},step:{x:1,y:1}},-1,C).uu(st),this.UC.hN=vy;const a=this.UC.nN.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n="columns"===this._n.dataOrder?{x:this._n.step.x*(t.sizeHeatmapDataVectors.primary-1),z:this._n.step.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this._n.step.x*(t.sizeHeatmapDataVectors.secondary-1),z:this._n.step.z*(t.sizeHeatmapDataVectors.primary-1)},o="columns"===this._n.dataOrder?{x:this._n.start.x+this._n.step.x*t.iFirstVector.primary,z:this._n.start.z+this._n.step.z*t.iFirstVector.secondary}:{x:this._n.start.x+this._n.step.x*t.iFirstVector.secondary,z:this._n.start.z+this._n.step.z*t.iFirstVector.primary},h=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),a={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,startLocationAxis:o,sizeAxis:n,heightmapData:h,normalmapSize:a}})),l=this.UC.nN.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._G={gridTiles:a,gridTileSizes:l,largestGridTileSize:u}}AG(t){this.wG=t,this.bG=void 0}kG(t){"columns"===this._n.dataOrder?(this.xG.min.x=Math.min(this._n.start.x,this._n.start.x+(this._n.columns-1)*this._n.step.x)+t,this.xG.max.x=Math.max(this._n.start.x,this._n.start.x+(this._n.columns-1)*this._n.step.x)+t):(this.xG.min.z=Math.min(this._n.start.z,this._n.start.z+(this._n.rows-1)*this._n.step.z)+t,this.xG.max.z=Math.max(this._n.start.z,this._n.start.z+(this._n.rows-1)*this._n.step.z)+t),this.CG=t}Ts(t){const e=this.SG,i=this.Se,s=N(i)&&i,r=W(i)&&i,n=Ur(this.Eo,i),o=r&&r.getPalette(),h=this.lu,a=qi(h)&&h,l=a&&a.getFillStyle(),u=l&&N(l)&&l,c=!1!==u,d=h!==this.Iu,f=this.iN.o,g=this.iN.M(),y=this.Zm.M(),p=this.RO(),m=this.po.M();this.UC.Ts();const S=this.UC.oN;if(!S)return this;this.TG=this.TG||this.FG(S);const x=this.TG;this.IG(x);const b=My(e,x,void 0,(t=>t.sizeGeometryDataVectors));if(b.size>0&&(Ty(this.yB,b,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.vG=!0),"phong"===y.type&&(b.size>0||p)){const t=this.yB.gl,e=this.yB.sL(Bg["2D"],Bg.DrawToNormalTexture({flipXZ:"rows"===this._n.dataOrder,vertexIdSource:this.yB.kR(),normalTextureType:this.yB.gl2?"uint":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN}));x.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{const r=s.normalmapTexture;if(!r)return;const n={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},o=n.x*n.y;this.yB.aR.mB((()=>{this.yB.eL(e,((r,n,h,a)=>(this.yB.sO(e).CR(h,o).rL(r("uTileDimensionsXZ"),["columns"===this._n.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this._n.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).kL(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).rL(r("uTileStartLocationAxisXZ"),[s.startLocationAxis.x+("columns"===this._n.dataOrder&&this.CG||0),s.startLocationAxis.z+("rows"===this._n.dataOrder&&this.CG||0)]).rL(r("uTileSizeAxisXZ"),[s.sizeAxis.x,s.sizeAxis.z]).nL(r("uHeightmapTexture"),s.heightmapDataTexture,1).Xp(t.POINTS,o),!0)))}),r,n,void 0,this.ls.Kr(),0)}))}))}const v=this.xz;if(n||d||f){o?this.lN=this.iE.XE(o,this.lN):this.lN&&(this.iE.ZE(this.lN),this.lN=void 0);const t=a&&u?{wireframeSolid:a,wireframeFillSolid:u}:void 0;s?v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Kf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:this.lN&&r&&"value"===r.getLookUpProperty()?v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Kf(this.ct),fillColor:["lookup","value"],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r,colorLookupTexture:this.lN},wireframe:t}:this.lN&&r?v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Kf(this.ct),fillColor:["lookup",r.getLookUpProperty()],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r,colorLookupTexture:this.lN},wireframe:t}:c&&(v.surface={shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Kf(this.ct),fillColor:void 0,interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:y.type,wireframe:c,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return v.mousePicking=m?this.xz.mousePicking||{shader:this.yB.sL(Bg["3D"],Bg.SurfaceGrid({axisWorldTranslation:Kf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this._n.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.yB.TR(),normalTextureType:this.yB.gl2?"uint":"ubyte",intensityTextureType:this.yB.rR?"float":"ubyte",heightmapTextureType:this.yB.rR?"float":"ubyte",littleEndian:this.yB.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.xz=v,this.SG.length=0,this.Eo=i,this.Iu=h,this.Zm.o=!1,this}FG(t){const e=this._G.gridTiles.map((e=>{const i=wy(this.yB,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}})),i=this._G.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.yB.tL([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.yB.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}IG(t){var e;if("phong"===this.Zm.M().type)for(let i=0;i{t.normalmapTexture&&(this.yB.YB(t.normalmapTexture),t.normalmapTexture=void 0)}))}mB(t){var e,i,s,r;const n=this.yB.gl,o=this.TG;if(!o)return this;const h=this.Zm.M(),a=this.xz,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.yB.eL(l,((e,i,s,r)=>{let a=!1;if(this.yB.sO(l).FR(s,this._G.largestGridTileSize.cells).TL(e("uScale"),this.$N.dO.lL()).TL(e("uDisp"),this.$N.dO.uL()).IL(e("uViewProjectionMatrix"),this.iG).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.yB.TL(e("uCameraLoc"),this.sG).TL(e("uLightLoc"),this.eG).oL(e("uAmbientReflection"),h.ambientReflection).oL(e("uSpecularReflection"),h.specularReflection).oL(e("uDiffuseReflection"),h.diffuseReflection).oL(e("uShininess"),h.shininess).aL(e("uLightColor"),h.specularColor).aL(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.yB.aL(e("uWireframeColor"),t.getColor()).oL(e("uWireframeThickness"),s)}return 1===t?this.yB.aL(e("uColorDiffuse"),this.cE):"solid"===(null==c?void 0:c.fillMode)&&this.yB.aL(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.yB.rL(e("uTileDimensionsXZ"),["columns"===this._n.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this._n.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).kL(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{let l=0,d=(h.sizeHeatmapDataVectors.primary-1)*(h.sizeHeatmapDataVectors.secondary-1);if(this.wG){const t=this.wG.fill.iFirstPrimary,e=this.wG.fill.iFirstPrimary+this.wG.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sy(Math.max(t,i),Math.min(e,s)))(t,e,i,s);l=(n.min-h.iFirstVector.primary)*(r.sizeGeometryData.secondary-1),d=(n.max-n.min)*(r.sizeGeometryData.secondary-1)}if(!(l<0||d<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.yB.LR(s,i.lut,t,1).nL(e("uTileIntensityValues"),h.intensityDataTexture,2).CL(e("uTileBoundsAxisXZ"),[h.startLocationAxis.x+("columns"===this._n.dataOrder&&this.CG||0),h.startLocationAxis.z+("rows"===this._n.dataOrder&&this.CG||0),h.sizeAxis.x,h.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:e}=c;this.yB.LR(s,e.lut,t,1)}1!==t&&"phong"===this.Zm.M().type&&h.normalmapTexture&&this.yB.nL(e("uNormalmapTexture"),h.normalmapTexture,3),this.yB.hL(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).PL(e("uBaseInstance"),l).rL(e("uTileStartLocationAxisXZ"),[h.startLocationAxis.x+("columns"===this._n.dataOrder&&this.CG||0),h.startLocationAxis.z+("rows"===this._n.dataOrder&&this.CG||0)]).rL(e("uTileSizeAxisXZ"),[h.sizeAxis.x,h.sizeAxis.z]).nL(e("uHeightmapTexture"),h.heightmapDataTexture,0).YL(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,d),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.UC.dispose(),this.lN&&(this.iE.ZE(this.lN),this.lN=void 0),this.TG&&(this.TG.gridTileSizes.forEach((t=>{})),this.TG.gridTiles.forEach((t=>{this.yB.YB(t.heightmapDataTexture),t.normalmapTexture&&this.yB.YB(t.normalmapTexture)})),this.yB.fL(this.TG.rectangleLocationsBuffer),this.TG=void 0),this.xz={},this}jB(){return this.dispose(),this.UC.jB(),this}dS(t){return this.UC.dS(t),this}fS(t){this.SG.push(t),Ay(this._G.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.MG[n];if(e)i=ie.max?s:e.max;else{e={min:Pe,max:ke},this.MG[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.bG={min:i,max:s},this.bG}}class sp extends Wy{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.UN="disabled",this.fN=0,this.pN={};const o={min:{x:s.start.x,z:s.start.z},max:{x:"rows"===s.scrollDimension?s.start.x+(s.columns-1)*s.step.x:s.start.x,z:"columns"===s.scrollDimension?s.start.z+(s.rows-1)*s.step.z:s.start.z}};this._n={...s,initialBoundaries:o,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.xG=o;const h=()=>({shape:new ip(this.$N,Et,this.vo,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),start:{x:0,z:0},step:s.step,dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.uE,this.cE).dispose(),hasData:!1});this.nM=[h(),h()]}Ts(t){return this.nM.forEach((e=>{e.shape.Ts(t)})),this}mB(t){return this.nM.forEach((e=>{e.hasData&&(e.shape.iG=this.iG,e.shape.sG=this.sG,e.shape.eG=this.eG,e.shape.mB(t))})),this}Ha(){return this.fN=0,this.pN={},this.xG=this._n.initialBoundaries,this.nM.forEach((t=>{t.shape.dispose(),t.shape.vG=!1,t.hasData=!1})),this}yS(t){var e;const i=this.nM[0],s=this.nM[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.fN/this._n.scrollDimensionSize)%this.nM.length,o=this.nM[e],h=this.fN%this._n.scrollDimensionSize,a=this._n.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,y=n+u,p=this.fN>=this._n.scrollDimensionSize&&c<=this._n.scrollDimensionSize-1,m=l;if(l){const t="columns"===this._n.scrollDimension?this._n.start.x+(this.fN-1)*this._n.step.x:this._n.start.z+(this.fN-1)*this._n.step.z;o.shape.kG(t)}const S=p?0:1,x=c+(p?1:0);o.shape.AG({fill:{iFirstPrimary:S,amountPrimary:x},wireframe:{iFirstPrimary:S,amountPrimary:x,connectNext:!1}});const b=o===i?s:i,v=c+1,M=1+this._n.scrollDimensionSize-v;b.shape.AG({fill:{iFirstPrimary:v,amountPrimary:M},wireframe:{iFirstPrimary:v,amountPrimary:M-1,connectNext:!0}});const A={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,y);let i=!1;m&&this.pN.yValues&&(i=!0,e.splice(0,0,this.pN.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this._n.staticDimensionSize,values:e,type:"y"};o.shape.fS(s),o.hasData=!0,A.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,y);let i=!1;m&&this.pN.intensityValues&&(i=!0,e.splice(0,0,this.pN.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this._n.staticDimensionSize,values:e,type:"intensity"};o.shape.dS(s),o.hasData=!0,A.intensityValues=e[u-1]}this.fN+=u,n+=u,this.pN=A}while(ne.shape.uS(t))),this}cS(){return this.nM[0].shape.cS()}Me(t){return this.nM.forEach((e=>e.shape.Me(t))),this}Th(){return this.nM[0].shape.Th()}uu(t){return this.nM.forEach((e=>e.shape.uu(t))),this}cu(){return this.nM[0].shape.cu()}jB(){return this.dispose(),this.nM.forEach((t=>t.shape.jB())),this}dispose(){return super.dispose(),this.nM.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.nM.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}iy(t){return super.iy(t),this.nM.forEach((e=>e.shape.iy(t))),this}_t(){return this.xG.max.x}Mt(){return this.xG.min.x}wt(){return Math.max(this.nM[0].shape.wt(),this.nM[1].shape.wt())}At(){return Math.min(this.nM[0].shape.At(),this.nM[1].shape.At())}hy(){return this.xG.max.z}ny(){return this.xG.min.z}sl(){return 0}el(){return 0}oy(){return 0}us(t){return super.us(t),this.nM.forEach((e=>e.shape.us(t))),this}}class rp extends Ly{constructor(t,e,i,s){super(t,e,i),this.DG=45,this.BG=.1,this.OG=100,this.sG=f(0,0,1),this.LG=f(0,0,-1),this.EG=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.Zm=new Po,this.ct=s}wS(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.ct,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.ls.Ht();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.sG=t,this}getCameraLocation(){return this.sG}setCameraDirection(t){return this.LG=Ce.normalize(t),this}getCameraDirection(){return this.LG}setLightLocation(t){return this.eG=t,this}getLightLocation(){return this.eG}zG(){return f(this.EG[0],this.EG[1],this.EG[2])}VG(){return f(this.EG[4],this.EG[5],this.EG[6])}}class np extends rp{constructor(t,e,i,s){super(t,e,i,s),this.dO=new Og,this.NG=!0,this.iE=t,this.gl=t.eE(),this.LN=this.FN,this.GG=this.ls.lo((()=>{this.NG=!0})),this.WG=s.W((()=>{this.NG=!0}))}QO(t){const e=t.Mt(),i=t.At(),s=t.ny(),r=t._t(),n=t.wt(),o=t.hy();if(e===Pe||r===ke||i===Pe||n===ke||s===Pe||o===ke)return Fe;const h=t.sl(),a=t.el(),l=t.oy(),u=Math.abs(t.As.zm(h)*t.ct.x.st()),c=Math.abs(t.As.zm(a)*t.ct.y.st()),d=Math.abs(t.As.zm(l)*t.ct.z.st()),f=e-u,g=r+u,y=i-c,p=n+c,m=s-d,S=o+d;let x;return[{x:f,y,z:m},{x:g,y,z:m},{x:f,y:p,z:m},{x:g,y:p,z:m},{x:f,y,z:S},{x:g,y,z:S},{x:f,y:p,z:S},{x:g,y:p,z:S}].map((e=>t.As.Nm(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};x=x?je(x,{min:t,max:t}):e})),x||Fe}RN(t){const e=Array.from(this.LN.values());for(let i=0;iSe()));const{viewProjectionMatrix:s}=this.HG();this.UG();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.FN.forEach((t=>{t.iG=s,t.sG=r,t.eG=n,t.Ts(i)})),this}HG(){if(!this.NG&&this.iG)return{viewProjectionMatrix:this.iG};const t=this.wS(),e=t.width/t.height;this.$G=Uf.projectionPerspective(this.DG,e,this.BG,this.OG);const i=this.sG;this.EG[12]=i.x,this.EG[13]=i.y,this.EG[14]=i.z;const s=this.LG,r=f(0,1,0),n=Ce.multiply(s,-1),o=Ce.normalize(Ce.cross(r,n)),h=Ce.normalize(Ce.cross(n,o));this.EG[0]=o.x,this.EG[1]=o.y,this.EG[2]=o.z,this.EG[4]=h.x,this.EG[5]=h.y,this.EG[6]=h.z,this.EG[8]=n.x,this.EG[9]=n.y,this.EG[10]=n.z,this.jG=Uf.inverse(this.EG);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.ct,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,y=(a.y+l.y/2)/u.y,p=Uf.multiply(Uf.translation(Mo(-1,1,g),Mo(-1,1,y),0),Uf.scaling(c,d,1));return this.iG=Uf.multiply(p,Uf.multiply(this.$G,this.jG)),this.YG=Uf.inverse(this.iG),this.NG=!1,{viewProjectionMatrix:this.iG}}UG(){this.dO.XR(this.ct.x),this.dO.ZR(this.ct.y),this.dO.KR(this.ct.z)}mB(t,e){const i=this.gl.oO(),s=this.wS(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.JO(r.x,r.y,r.width,r.height),this.FN.forEach((e=>{e.getVisible()&&(this.gl.XO(e.UN),1!==t&&this.gl.sy(e.qm),(1!==t||e.getMouseInteractions())&&e.mB(t))})),this.gl.XO("disabled"),this.gl.sy(!1),this.gl.ZO(!1),this}setCameraLocation(t){return this.sG.x===t.x&&this.sG.y===t.y&&this.sG.z===t.z||(this.NG=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.LG.x===t.x&&this.LG.y===t.y&&this.LG.z===t.z||(this.NG=!0),super.setCameraDirection(t),this}G(){super.G(),this.ls.uo(this.GG),this.ct.H(this.WG)}vy(t){const e=this.iE.EN();return this.IN(new tp(this,this.PN,[],e,this.iE.zN(e),t))}tm(t){const e=this.iE.EN();return this.IN(new Zy(this,this.PN,t,e,this.iE.zN(e)))}gy(){const t=this.iE.EN();return this.IN(new Xy(this,this.PN,[],t,this.iE.zN(t)))}Tg(){const t=this.iE.EN();return this.IN(new Jy(this,this.PN,[],t,this.iE.zN(t)))}lS(t){const e=this.iE.EN();return this.IN(new ip(this,this.PN,[],t,e,this.iE.zN(e)))}mS(t){const e=this.iE.EN();return this.IN(new sp(this,this.PN,[],t,e,this.iE.zN(e)))}}const op=(t,e,i,s,r)=>{const{range:n}=i,o={row:{...n.row},column:{...n.column}};if(o.row.end+=1,o.column.end+=1,e){o.row.end+=1,o.column.end+=1;const e=kt(t,o),[n,h,a,l,u]=s.pixelated(e.sliced,e.rows*e.columns,r);i.vbo=n,i.ibo=h,i.length=a,i.lengthWireframe=l,i.boundary=u}else{const e=kt(t,o),[n,h,a,l,u]=s.nonPixelated(e.sliced,e.rows*e.columns,r);i.vbo=n,i.ibo=h,i.length=a,i.lengthWireframe=l,i.boundary=u}},hp={pixelated:(t,e)=>{const i=t.length,s=e/i,r=i-1,n=s-1,o=r*n*6,h=Array(r*n*4*2),a=Array(o),l=y(c(Pe,Pe),c(ke,ke));let u=0,d=1,f=2,g=3,p=0,m=0;for(let e=0;e{const i=t.length,s=e/i,r=i-1,n=s-1,o=Array(2*e),h=Array(r*n*6),a=y(c(Pe,Pe),c(ke,ke));let l=0;for(let e=0;e{const{range:r}=i,n={row:{...r.row},column:{...r.column}};n.row.end+=1,n.column.end+=1;const o=kt(t,n);i.intensities=e?((t,e,i)=>{const s=t.length,r=e/s,n=new Float32Array(e*i);for(let e=0,o=0;e{const i=new Float32Array(e),s=t.length,r=e/s;for(let e=0,n=0;e{const{range:n}=s,o={row:{...n.row},column:{...n.column}};o.row.end+=1,o.column.end+=1;const h=kt(t,o);s.colors=i?((t,e,i,s)=>{const r=t.length,n=e/r,o=new Float32Array(4*e*s);for(let e=0,h=0;e{const s=new Float32Array(4*e),r=t.length,n=e/r;for(let e=0,o=0;e{const s=i-1;t<=1&&(t+=1),e<=1&&(e+=1);const r=Math.ceil((t-1)/s),n=Math.ceil((e-1)/s),o=Array.from(Array(r)).map((()=>Array(n)));for(let i=0,h=0,a=0,l=t-1;i{const s=Array(i*e);for(let r=0,n=0;r({vbo:void 0,ibo:void 0,colors:void 0,intensities:void 0,length:0}))),this.eu.o=!1,this.hu.o=!1}const t=this.qG,e=this.ZG,s=this._u;if(o){this.Ta=Fe;for(const e of t)op(s,this.au,e,hp,void 0);let r=0;for(const s of e){s.vbo&&i.fL(s.vbo),s.ibo&&i.fL(s.ibo);const e=t[r];r+=1,s.vbo=i.tL(e.vbo),s.ibo=i.EL(e.ibo),s.length=e.length,s.lengthWireframe=e.lengthWireframe,this.Ta=je(this.Ta,e.boundary)}this.ou=!1}}if(this.Ro()){!W(s)&&this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this.gO=s===z?void 0:i.sL(Bg["2D"],Bg.VertexLocation({translation:"grid"===this.XG?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Kf(this.ct),normalSource:void 0}),N(s)?Bg.Color({dataType:"uniform"}):H(s)?Bg.Color({dataType:"attribute"}):W(s)?Bg.Color({dataType:["lookup",s.getLookUpProperty()]}):K(s)||et(s)?Bg.Color({dataType:["gradient",s]}):void 0);const t=this.lu;N(t)?this.QG=i.sL(Bg["2D"],Bg.Color({dataType:"uniform"}),Bg.VertexLocation({translation:"grid"===this.XG?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Kf(this.ct),normalSource:void 0})):this.QG=void 0,this.No(s),this.Iu=this.lu}const h=this.qG,a=this.ZG,l=this.wu;if(W(s)&&s.lut.isValid){if(this.nu){for(const t of h)ap(l,this.au,t,hp);let t=0;for(const e of a){e&&e.intensities&&i.fL(e.intensities);const s=h[t];t+=1,e.intensities=i.zL(s.intensities)}this.nu=!1}const t=s.getPalette();this.bz=this.iE.XE(t,this.bz),this.tW=t}else if(H(s)&&(this.iW&&i.xL(this.iW),this.ru)){for(const t of h)lp(l,s.color,this.au,t,hp);let t=0;for(const e of a){e.colors&&i.fL(e.colors);const s=h[t];t+=1,e.colors=i.zL(s.colors)}this.ru=!1}K(s)?this.SE=Gg(this.Co(),this.ct,s.getPosition(),s.getExtent(),s.getShape(),this.yB.oO()):et(s)?this.xE=Hg(this.Co(),this.ct,s.getAngle(!0),this.yB.oO()):(this.SE=void 0,this.xE=void 0),this.IE=e?this.IE||this.yB.sL(Bg["2D"],Bg.MousePicking,Bg.VertexLocation({translation:"grid"===this.XG?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Kf(this.ct),normalSource:void 0})):void 0}return this}mB(t){const e=this.wu&&this._u;if(this.Vo()&&e){const e=1===t?this.IE:this.gO;if(e){const i=this.Se,s=N(i)&&i,r=W(i)&&i,n=H(i)&&i,o=K(i)&&i,h=et(i)&&i;this.yB.eL(e,((i,a,l)=>{let u=!1;this.yB.sO(e).rL(i("uScale"),this.dO.lL()).rL(i("uDisp"),this.dO.uL()).oL(i("uIsHighlighted"),1===t||2===t?0:this.xo).aL(i("uHighlightColorOffset"),this._o).oL(i("uRenderEffectMask"),2===t?1:0),"grid"===this.XG&&this.yB.rL(i("uTranslationAxis"),[this.fi.x,this.fi.y]),1===t?this.yB.aL(i("uColor"),this.cE):s?this.yB.aL(i("uColor"),s.getColor()):r&&r.lut.isValid&&this.bz?this.yB.LR(l,r.lut,this.bz,0):o?this.yB.SR(l,this.SE,o):h&&this.yB.xR(l,this.xE,h);for(const{vbo:e,ibo:i,colors:s,intensities:o,length:h}of this.ZG)this.yB.VL(a("aPos"),e).$L(i),1!==t&&(r&&"value"===r.getLookUpProperty()&&this.yB.UL(a("aLookupValue"),o),n&&this.yB.HL(a("aColor"),s)),this.yB.jL(h),u=!0;return u}))}const i=1===t?void 0:this.QG;if(i){const e=this.lu,s=N(e)&&e;this.yB.eL(i,((e,r,n)=>{let o=!1;this.yB.sO(i).rL(e("uScale"),this.dO.lL()).rL(e("uDisp"),this.dO.uL()).oL(e("uIsHighlighted"),1===t||2===t?0:this.xo).aL(e("uHighlightColorOffset"),this._o).oL(e("uRenderEffectMask"),2===t?1:0),"grid"===this.XG&&this.yB.rL(e("uTranslationAxis"),[this.fi.x,this.fi.y]),s&&this.yB.aL(e("uColor"),s.getColor());for(const{vbo:t,ibo:e,lengthWireframe:i}of this.ZG)this.yB.VL(r("aPos"),t).$L(e).jL(i,this.yB.gl.LINES),o=!0;return o}))}}return this}rE(t){return this.uE===t&&{}}sW(t,e){if(this.po.M()&&this.Ta&&this._u){const n="grid"===this.XG?this.fi:{x:0,y:0},o=ni(at({x:t,y:e},this.ls.ct,this.ct),n);if(i=o,s=this.Ta.min,r=this.Ta.max,!(i.x>r.x||i.y>r.y||i.x0){for(const e of this.ZG){const{vbo:i,ibo:s,colors:r,intensities:n}=e||{};i&&(t.fL(i),e.vbo=void 0),s&&(t.fL(s),e.ibo=void 0),r&&(t.fL(r),e.colors=void 0),n&&(t.fL(n),e.intensities=void 0)}this.ZG.length=0}}jB(){return this.JG(),this.iW&&(this.yB.xL(this.iW),this.iW=void 0),this.bz&&(this.iE.ZE(this.bz),this.bz=void 0),this}Su(t,e){return this.XG="mesh",super.Su(t,e)}_t(){return"grid"===this.XG?this.Ta.max.x+this.fi.x:this.Ta.max.x}Mt(){return"grid"===this.XG?this.Ta.min.x+this.fi.x:this.Ta.min.x}wt(){return"grid"===this.XG?this.Ta.max.y+this.fi.y:this.Ta.max.y}At(){return"grid"===this.XG?this.Ta.min.y+this.fi.y:this.Ta.min.y}sl(){return 0}el(){return 0}}class cp extends Mr{constructor(t,e,i=Lg){var s,r,n;super(t,e),this.j=c(1,1),this.eW=!1,this.hW=0,this.rW=!0,this.nW=0,this.cG=8388608,this.Ss=(t=!1)=>(this.Ti||this.oW()||(t&&(this.eW=!0),void 0===this.Vr&&(this.Vr=xt.requestAnimationFrame(this.aW))),this),this.aW=t=>{if(this.Ti)return;const e=t-this.hW;if(e>=this.Rn||-1===this.Rn){this.hW=t,this.eW=!1;const i=e>50?1e3/60:e;this.Nr&&this.Nr(i),this.Vr=void 0,-1!==this.Rn&&(this.Vr=this.eW?xt.requestAnimationFrame(this.aW):void 0),this.os.Ts(e),this.Jr(),this.Qr(),this.Gr&&this.Gr()}else this.Vr=xt.requestAnimationFrame(this.aW)},this.lW=new Map,this.eE=()=>this.yB,this.uW=()=>{var t,e,i;const s=this.vn(),r=this.rW,n=xt.performance.now(),o=null===(t=this.cW)||void 0===t?void 0:t.dW.reduce(((t,e)=>t?e.fW&&t.fW&&e.fW>t.fW?e:t:e),void 0),h=null==o?void 0:o.fW,a=null===(e=this.gn)||void 0===e?void 0:e.timeStamp,l=null===(i=this.ho)||void 0===i?void 0:i.timeStamp;return r?(this.Ss(!0),!1):void 0===o||(void 0===o||!o.gW)&&(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.pW=()=>{var t,e;this.mW=void 0;const i=null===(e=null===(t=this.cW)||void 0===t?void 0:t.yW)||void 0===e?void 0:e.SW;void 0===i||i>=this.nW||this.xW()},this.Qr=()=>{const t=this.yB.gl,e=xt.performance.now(),i=this.j,s=i.x>0&&i.y>0;if(this.Zr.o&&this.yB.JL(this.Zr.M()),this.yB.Ha(),t.resize&&s&&t.resize(i.x*this.yB.oO(),i.y*this.yB.oO()),this.yB.qO(0,0,i.x*this.yB.oO(),i.y*this.yB.oO()),this.bW.width=i.x*this.yB.oO(),this.bW.height=i.y*this.yB.oO(),s)for(const t of this.Rr.values())t.mB(0,1);return this._n.Bn&&s&&(this.mW&&(xt.clearTimeout(this.mW),this.mW=void 0),this.uW()?this.xW():this.mW=xt.setTimeout(this.pW,500)),this.Y(),this.Or(),this.rn&&this.hn(this.rn),this.rW=!1,this.nW=e,this},this.Jr=()=>{const t=this.j;if(0===t.x||0===t.y)return this;this.Hn.q(t);for(const t of this.Rr.values())t.Ts();return this.Y(),this},this.vW=0,this.MW=1,this.bW=xt.document.createElement("canvas");const o={preserveDrawingBuffer:!0,antialias:t?t.antialias:void 0,alpha:!0,lineAntialias:!t||(!0===t.lineAntiAlias||!1===t.lineAntiAlias?t.lineAntiAlias:!1!==t.antialias)};let h;if("webgl1"!==(null===(s=null==t?void 0:t.webgl)||void 0===s?void 0:s.version)){const t=this.bW.getContext("webgl2",o);t&&(h=new i(this,this._n,{type:"webgl2",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.Ji.isDark))}if(!h&&"webgl2"!==(null===(r=null==t?void 0:t.webgl)||void 0===r?void 0:r.version)){const t=this.bW.getContext("webgl",o)||this.bW.getContext("experimental-webgl",o);h=new i(this,this._n,{type:"webgl1",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.Ji.isDark)}if(!h)throw new ft("No WebGL context available."+((null===(n=null==t?void 0:t.webgl)||void 0===n?void 0:n.version)?`\nSelected explicit target: ${t.webgl.version}`:""));this.yB=h,this.oR=ct(this.yB.gl);const a=this.yB.AL;if(a.length>0){const t=xt.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=xt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),this.Cr.appendChild(t),t.appendChild(e),!1!==this._n.Pn&&xt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",a.join(", "))}let l=1;if(t&&t.devicePixelRatio)l=!0===t.devicePixelRatio?xt.devicePixelRatio||1:t.devicePixelRatio||1;else{const t=xt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(l=xt.devicePixelRatio||1)}this.yB.gR(l),this.bW.style.position="absolute",this.bW.style.top="0",this.bW.style.left="0",this.bW.style.right="0",this.bW.style.bottom="0",this.bW.style.width="100%",this.bW.style.height="100%",this.bW.style.boxSizing="content-box",this.Cr.appendChild(this.bW);const u=t?t.width:void 0,d=t?t.height:void 0;this.Nn=this._W(u),this.Wn=this._W(d),this.AW(this.Nn,this.Wn),this.mN=this.rF("engine offscreen",1e6),this.wW=this.rF("engine bg",0);const f="function"==typeof this.Ji.lcjsBackgroundFillStyle?this.Ji.lcjsBackgroundFillStyle(this._n.Hs):this.Ji.lcjsBackgroundFillStyle;this.Hn=this.wW._e(this.ct).Me(f).ve(this.Ji.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).we({x:0,y:0});const g=this.rF("engine effects",200001).VN(this.Ji.effect);this.ss=g,this.Yr(),this.Or(),this.$g=pr(this),this.jg={Ji:this.Ji,os:this.os,ct:this.ct,Ss:t=>this.Ss(t),vn:()=>this.vn(),NP:t=>this.NP(t),_n:this._n,Mn:t=>this.Mn(t),ss:this.ss,do:t=>this.do(t),fo:t=>this.fo(t),wD:{AD:(t,e,i)=>this.yB.Fh(e.family).hO(t,e,i)}};const y=()=>{this.G()};xt.addEventListener("unload",y),this.Wr.push((()=>{xt.removeEventListener("unload",y)}))}get kW(){return this.Rr}Lr(t,e){let i=this.lW.get(t);if(!i){const e=this.yB.bR(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.lW.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{GP:()=>e.kO,WP:t=>{e.kO?t():o.push(t)}}},this.lW.set(t,i),e.sO(this),e.BO((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new Ho(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}NP(t){const e=Array.from(this.lW.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}nn(t,e){var i;const s=null===(i=this.cW)||void 0===i?void 0:i.yW;if(!s)return;const r=this.Ce(e.x,e.y),n=Math.round(r.x*this.yB.oO()),o=Math.round(r.y*this.yB.oO());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.TW(s,n+t[0]/s.FW,o+t[1]/s.FW))).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)}TW(t,e,i){const s=Math.round(e*t.FW),r=Math.round(i*t.FW);if(s<0||s>=t.j.x||r<0||r>=t.j.y)return;const n=4*(s+r*t.j.x),o=t.IW[n+0],h=t.IW[n+1],a=t.IW[n+2],l=t.IW[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.PW(o,h,a,l):void 0}Pr(t,e){return(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=xt.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.tn(new zy(this,e,t))}aF(t,e,i){const s=this.Yn(e);if(s){if(me(0,(()=>{})),!(s instanceof np))throw new Error("Unexpected Engine Layer error");return s}return this.tn(new np(this,e,t,i))}Ht(){return this.j}_W(t){return t instanceof Array||(t=[t,t]),t}jr(){return this.bW}oW(){const t=this.yB.gl;return t&&"resize"in t}xW(){var t;const e=this.yB.gl,i=xt.performance.now(),s=this.vn(),r=this._n.Dn,n={x:Math.ceil(this.j.x*this.yB.oO()*r),y:Math.ceil(this.j.y*this.yB.oO()*r)};this.cW||(this.cW={FW:r,DW:n,dW:[],yW:void 0});let o=this.cW.dW.find((t=>!t.gW)),h=!1;o||(h=!0,o={gW:!1,j:n,BR:e.createTexture(),BW:this.yB.mL(),OW:this.yB.yL(),LW:new Uint8Array,fW:void 0},this.cW.dW.push(o));const a=o;(h||a.j.x!==n.x||a.j.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.BR),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),e.bindFramebuffer(e.FRAMEBUFFER,a.BW),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.BR,0),e.bindRenderbuffer(e.RENDERBUFFER,a.OW),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.OW),a.LW=new Uint8Array(n.x*n.y*4),a.j=n),a.gW=!0,a.fW=i,e.bindFramebuffer(e.FRAMEBUFFER,a.BW),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.clear(e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(n.x,n.y),this.yB.qO(0,0,n.x,n.y);for(const t of this.Rr.values())t.mB(1,r);e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.yB.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.cW){const t=this.cW.yW;if(t&&t.SW>i)return;this.cW.yW={SW:i,FW:r,j:n,IW:a.LW,RW:s}}};l?this.yB.IR(l,a.BW,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.LW).then((()=>{this.Ti||(a.gW=!1,u())})).catch((t=>{this.Ti||(a.gW=!1,xt.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.yB.PR(a.BW,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.LW),a.gW=!1,u())}Yr(t){const e=this.j.x,i=this.j.y,s=t||{x:this.Cr.offsetWidth,y:this.Cr.offsetHeight};0!==s.x&&0!==s.y&&(s.x===e&&s.y===i||(this.j=s,this.ct.x.Z(0,s.x).q(s.x),this.ct.y.Z(0,s.y).q(s.y),this.P.emit("resize",[this.j.x,this.j.y])))}G(){super.G(),this.mW&&(xt.clearTimeout(this.mW),this.mW=void 0),this.bW.width=1,this.bW.height=1,this.bW&&(this.Cr.removeChild(this.bW),this.bW=void 0,this.Cr=void 0),this.oR.vt(),Array.from(this.yB.vL.values()).forEach((t=>{t.jB()})),Array.from(this.yB.ML.values()).forEach((t=>{t.unbindResources()})),this.yB.ML.clear(),this.yB.bL.wB(),this.yB.lR.G(),this.yB.fL(this.yB.uR),this.yB.fL(this.yB.cR),this.yB.fL(this.yB.dR),this.yB.eR.forEach(((t,e)=>{this.yB.gl.deleteBuffer(e)})),this.yB.eR.clear(),this.yB.wR&&(this.yB.fL(this.yB.wR.buffer),this.yB.wR=void 0),this.cW&&(this.cW.dW.forEach((t=>{this.yB.SL(t.OW),this.yB.xL(t.BW),this.yB.YB(t.BR)})),this.cW=void 0),this.yB.tR.forEach((t=>this.yB.fL(t))),this.lW.clear(),this.yB._R(),this.yB.gl=void 0}XE(t,e){if((null==e?void 0:e.lut)===t)return e;e&&this.oR.bt(e);const i=this.vW;this.vW+=1;const s=this.oR.St(t);if(s){const t={Mo:i,lut:s.lut,texture:s.texture,textureHeight:s.textureHeight};return this.oR.xt(t),t}const r={x:1,y:this.yB.$B},n=r.y,o=ot.d2({scaleXYConstructor:_i}).q(r);o.x.Z(0,1),o.y.Z(t.min,t.max);const h=new up(this,this.mN,o,(()=>{}),[],-1,C);h.Me(new G({color:t.color})),t.interpolate?h.S({columns:2,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!1}).Su(((e,i,s)=>({x:s.x,y:t.steps[e].value}))).mu((e=>t.steps[e].color)):h.S({columns:1,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!0}).Su(((e,i,s)=>({x:s.x,y:et.steps[e].color));const a=this.yB.pR(null,this.yB.gl.RGBA,!1,!t.interpolate,r,!1);this.yB.aR.mB((()=>{h.Ts(),h.mB(0)}),a,r,void 0,this.Zr.M()),h.dispose().jB();const l={Mo:i,texture:a,textureHeight:n,lut:t};return this.oR.xt(l),l}ZE(t){this.oR.bt(t)}EN(){const t=this.MW;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.MW=1),this.MW+=1,t}zN(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,w(i,s,r,e)}PW(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.kW.values()){const e=t.RN(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.sn()}}}}var dp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},fp={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.DO(t||0,e||10,i||"be"))}var n;"object"==typeof fp?fp.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.DO=function(t,e,s){if("number"==typeof t)return this.EW(t,e,s);if("object"==typeof t)return this.zW(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.VW(t,r):this.NW(t,e,r),"-"===t[0]&&(this.negative=1),this.GW(),"le"===s&&this.zW(this.toArray(),e,s)},r.prototype.EW=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.zW(this.toArray(),e,s)},r.prototype.zW=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.GW()},r.prototype.VW=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.GW()},r.prototype.NW=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.$W()},r.prototype.$W=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.GW()}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 y=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?y+s:u[l-y.length]+y+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.GW();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.jW=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.XW=function(t){return 32-Math.clz32(t)}:r.prototype.XW=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.ZW=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.XW(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.UW(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.GW()},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.UW(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.$W()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.$W();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,y=f>>>13,p=0|o[2],m=8191&p,S=p>>>13,x=0|o[3],b=8191&x,v=x>>>13,M=0|o[4],A=8191&M,w=M>>>13,T=0|o[5],E=8191&T,I=T>>>13,C=0|o[6],P=8191&C,k=C>>>13,F=0|o[7],B=8191&F,_=F>>>13,L=0|o[8],D=8191&L,z=L>>>13,O=0|o[9],R=8191&O,V=O>>>13,N=0|h[0],G=8191&N,H=N>>>13,U=0|h[1],W=8191&U,X=U>>>13,Y=0|h[2],j=8191&Y,J=Y>>>13,$=0|h[3],q=8191&$,Z=$>>>13,K=0|h[4],Q=8191&K,tt=K>>>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,yt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var pt=(l+(s=Math.imul(c,G))|0)+((8191&(r=(r=Math.imul(c,H))+Math.imul(d,G)|0))<<13)|0;l=((n=Math.imul(d,H))+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(g,G),r=(r=Math.imul(g,H))+Math.imul(y,G)|0,n=Math.imul(y,H);var mt=(l+(s=s+Math.imul(c,W)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,W)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(m,G),r=(r=Math.imul(m,H))+Math.imul(S,G)|0,n=Math.imul(S,H),s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(y,W)|0,n=n+Math.imul(y,X)|0;var St=(l+(s=s+Math.imul(c,j)|0)|0)+((8191&(r=(r=r+Math.imul(c,J)|0)+Math.imul(d,j)|0))<<13)|0;l=((n=n+Math.imul(d,J)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(b,G),r=(r=Math.imul(b,H))+Math.imul(v,G)|0,n=Math.imul(v,H),s=s+Math.imul(m,W)|0,r=(r=r+Math.imul(m,X)|0)+Math.imul(S,W)|0,n=n+Math.imul(S,X)|0,s=s+Math.imul(g,j)|0,r=(r=r+Math.imul(g,J)|0)+Math.imul(y,j)|0,n=n+Math.imul(y,J)|0;var xt=(l+(s=s+Math.imul(c,q)|0)|0)+((8191&(r=(r=r+Math.imul(c,Z)|0)+Math.imul(d,q)|0))<<13)|0;l=((n=n+Math.imul(d,Z)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(A,G),r=(r=Math.imul(A,H))+Math.imul(w,G)|0,n=Math.imul(w,H),s=s+Math.imul(b,W)|0,r=(r=r+Math.imul(b,X)|0)+Math.imul(v,W)|0,n=n+Math.imul(v,X)|0,s=s+Math.imul(m,j)|0,r=(r=r+Math.imul(m,J)|0)+Math.imul(S,j)|0,n=n+Math.imul(S,J)|0,s=s+Math.imul(g,q)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(y,q)|0,n=n+Math.imul(y,Z)|0;var bt=(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)+(bt>>>26)|0,bt&=67108863,s=Math.imul(E,G),r=(r=Math.imul(E,H))+Math.imul(I,G)|0,n=Math.imul(I,H),s=s+Math.imul(A,W)|0,r=(r=r+Math.imul(A,X)|0)+Math.imul(w,W)|0,n=n+Math.imul(w,X)|0,s=s+Math.imul(b,j)|0,r=(r=r+Math.imul(b,J)|0)+Math.imul(v,j)|0,n=n+Math.imul(v,J)|0,s=s+Math.imul(m,q)|0,r=(r=r+Math.imul(m,Z)|0)+Math.imul(S,q)|0,n=n+Math.imul(S,Z)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,n=n+Math.imul(y,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(P,G),r=(r=Math.imul(P,H))+Math.imul(k,G)|0,n=Math.imul(k,H),s=s+Math.imul(E,W)|0,r=(r=r+Math.imul(E,X)|0)+Math.imul(I,W)|0,n=n+Math.imul(I,X)|0,s=s+Math.imul(A,j)|0,r=(r=r+Math.imul(A,J)|0)+Math.imul(w,j)|0,n=n+Math.imul(w,J)|0,s=s+Math.imul(b,q)|0,r=(r=r+Math.imul(b,Z)|0)+Math.imul(v,q)|0,n=n+Math.imul(v,Z)|0,s=s+Math.imul(m,Q)|0,r=(r=r+Math.imul(m,tt)|0)+Math.imul(S,Q)|0,n=n+Math.imul(S,tt)|0,s=s+Math.imul(g,it)|0,r=(r=r+Math.imul(g,st)|0)+Math.imul(y,it)|0,n=n+Math.imul(y,st)|0;var Mt=(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)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(B,G),r=(r=Math.imul(B,H))+Math.imul(_,G)|0,n=Math.imul(_,H),s=s+Math.imul(P,W)|0,r=(r=r+Math.imul(P,X)|0)+Math.imul(k,W)|0,n=n+Math.imul(k,X)|0,s=s+Math.imul(E,j)|0,r=(r=r+Math.imul(E,J)|0)+Math.imul(I,j)|0,n=n+Math.imul(I,J)|0,s=s+Math.imul(A,q)|0,r=(r=r+Math.imul(A,Z)|0)+Math.imul(w,q)|0,n=n+Math.imul(w,Z)|0,s=s+Math.imul(b,Q)|0,r=(r=r+Math.imul(b,tt)|0)+Math.imul(v,Q)|0,n=n+Math.imul(v,tt)|0,s=s+Math.imul(m,it)|0,r=(r=r+Math.imul(m,st)|0)+Math.imul(S,it)|0,n=n+Math.imul(S,st)|0,s=s+Math.imul(g,nt)|0,r=(r=r+Math.imul(g,ot)|0)+Math.imul(y,nt)|0,n=n+Math.imul(y,ot)|0;var At=(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)+(At>>>26)|0,At&=67108863,s=Math.imul(D,G),r=(r=Math.imul(D,H))+Math.imul(z,G)|0,n=Math.imul(z,H),s=s+Math.imul(B,W)|0,r=(r=r+Math.imul(B,X)|0)+Math.imul(_,W)|0,n=n+Math.imul(_,X)|0,s=s+Math.imul(P,j)|0,r=(r=r+Math.imul(P,J)|0)+Math.imul(k,j)|0,n=n+Math.imul(k,J)|0,s=s+Math.imul(E,q)|0,r=(r=r+Math.imul(E,Z)|0)+Math.imul(I,q)|0,n=n+Math.imul(I,Z)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(w,Q)|0,n=n+Math.imul(w,tt)|0,s=s+Math.imul(b,it)|0,r=(r=r+Math.imul(b,st)|0)+Math.imul(v,it)|0,n=n+Math.imul(v,st)|0,s=s+Math.imul(m,nt)|0,r=(r=r+Math.imul(m,ot)|0)+Math.imul(S,nt)|0,n=n+Math.imul(S,ot)|0,s=s+Math.imul(g,at)|0,r=(r=r+Math.imul(g,lt)|0)+Math.imul(y,at)|0,n=n+Math.imul(y,lt)|0;var wt=(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)+(wt>>>26)|0,wt&=67108863,s=Math.imul(R,G),r=(r=Math.imul(R,H))+Math.imul(V,G)|0,n=Math.imul(V,H),s=s+Math.imul(D,W)|0,r=(r=r+Math.imul(D,X)|0)+Math.imul(z,W)|0,n=n+Math.imul(z,X)|0,s=s+Math.imul(B,j)|0,r=(r=r+Math.imul(B,J)|0)+Math.imul(_,j)|0,n=n+Math.imul(_,J)|0,s=s+Math.imul(P,q)|0,r=(r=r+Math.imul(P,Z)|0)+Math.imul(k,q)|0,n=n+Math.imul(k,Z)|0,s=s+Math.imul(E,Q)|0,r=(r=r+Math.imul(E,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(A,it)|0,r=(r=r+Math.imul(A,st)|0)+Math.imul(w,it)|0,n=n+Math.imul(w,st)|0,s=s+Math.imul(b,nt)|0,r=(r=r+Math.imul(b,ot)|0)+Math.imul(v,nt)|0,n=n+Math.imul(v,ot)|0,s=s+Math.imul(m,at)|0,r=(r=r+Math.imul(m,lt)|0)+Math.imul(S,at)|0,n=n+Math.imul(S,lt)|0,s=s+Math.imul(g,ct)|0,r=(r=r+Math.imul(g,dt)|0)+Math.imul(y,ct)|0,n=n+Math.imul(y,dt)|0;var Tt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,yt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,yt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(R,W),r=(r=Math.imul(R,X))+Math.imul(V,W)|0,n=Math.imul(V,X),s=s+Math.imul(D,j)|0,r=(r=r+Math.imul(D,J)|0)+Math.imul(z,j)|0,n=n+Math.imul(z,J)|0,s=s+Math.imul(B,q)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(_,q)|0,n=n+Math.imul(_,Z)|0,s=s+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,tt)|0,s=s+Math.imul(E,it)|0,r=(r=r+Math.imul(E,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(A,nt)|0,r=(r=r+Math.imul(A,ot)|0)+Math.imul(w,nt)|0,n=n+Math.imul(w,ot)|0,s=s+Math.imul(b,at)|0,r=(r=r+Math.imul(b,lt)|0)+Math.imul(v,at)|0,n=n+Math.imul(v,lt)|0,s=s+Math.imul(m,ct)|0,r=(r=r+Math.imul(m,dt)|0)+Math.imul(S,ct)|0,n=n+Math.imul(S,dt)|0;var Et=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,yt)|0)+Math.imul(y,gt)|0))<<13)|0;l=((n=n+Math.imul(y,yt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(R,j),r=(r=Math.imul(R,J))+Math.imul(V,j)|0,n=Math.imul(V,J),s=s+Math.imul(D,q)|0,r=(r=r+Math.imul(D,Z)|0)+Math.imul(z,q)|0,n=n+Math.imul(z,Z)|0,s=s+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,tt)|0)+Math.imul(_,Q)|0,n=n+Math.imul(_,tt)|0,s=s+Math.imul(P,it)|0,r=(r=r+Math.imul(P,st)|0)+Math.imul(k,it)|0,n=n+Math.imul(k,st)|0,s=s+Math.imul(E,nt)|0,r=(r=r+Math.imul(E,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(A,at)|0,r=(r=r+Math.imul(A,lt)|0)+Math.imul(w,at)|0,n=n+Math.imul(w,lt)|0,s=s+Math.imul(b,ct)|0,r=(r=r+Math.imul(b,dt)|0)+Math.imul(v,ct)|0,n=n+Math.imul(v,dt)|0;var It=(l+(s=s+Math.imul(m,gt)|0)|0)+((8191&(r=(r=r+Math.imul(m,yt)|0)+Math.imul(S,gt)|0))<<13)|0;l=((n=n+Math.imul(S,yt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(R,q),r=(r=Math.imul(R,Z))+Math.imul(V,q)|0,n=Math.imul(V,Z),s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,tt)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,s=s+Math.imul(B,it)|0,r=(r=r+Math.imul(B,st)|0)+Math.imul(_,it)|0,n=n+Math.imul(_,st)|0,s=s+Math.imul(P,nt)|0,r=(r=r+Math.imul(P,ot)|0)+Math.imul(k,nt)|0,n=n+Math.imul(k,ot)|0,s=s+Math.imul(E,at)|0,r=(r=r+Math.imul(E,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(A,ct)|0,r=(r=r+Math.imul(A,dt)|0)+Math.imul(w,ct)|0,n=n+Math.imul(w,dt)|0;var Ct=(l+(s=s+Math.imul(b,gt)|0)|0)+((8191&(r=(r=r+Math.imul(b,yt)|0)+Math.imul(v,gt)|0))<<13)|0;l=((n=n+Math.imul(v,yt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(R,Q),r=(r=Math.imul(R,tt))+Math.imul(V,Q)|0,n=Math.imul(V,tt),s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,st)|0)+Math.imul(z,it)|0,n=n+Math.imul(z,st)|0,s=s+Math.imul(B,nt)|0,r=(r=r+Math.imul(B,ot)|0)+Math.imul(_,nt)|0,n=n+Math.imul(_,ot)|0,s=s+Math.imul(P,at)|0,r=(r=r+Math.imul(P,lt)|0)+Math.imul(k,at)|0,n=n+Math.imul(k,lt)|0,s=s+Math.imul(E,ct)|0,r=(r=r+Math.imul(E,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var Pt=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,yt)|0)+Math.imul(w,gt)|0))<<13)|0;l=((n=n+Math.imul(w,yt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,s=Math.imul(R,it),r=(r=Math.imul(R,st))+Math.imul(V,it)|0,n=Math.imul(V,st),s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,ot)|0)+Math.imul(z,nt)|0,n=n+Math.imul(z,ot)|0,s=s+Math.imul(B,at)|0,r=(r=r+Math.imul(B,lt)|0)+Math.imul(_,at)|0,n=n+Math.imul(_,lt)|0,s=s+Math.imul(P,ct)|0,r=(r=r+Math.imul(P,dt)|0)+Math.imul(k,ct)|0,n=n+Math.imul(k,dt)|0;var kt=(l+(s=s+Math.imul(E,gt)|0)|0)+((8191&(r=(r=r+Math.imul(E,yt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,yt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(R,nt),r=(r=Math.imul(R,ot))+Math.imul(V,nt)|0,n=Math.imul(V,ot),s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,lt)|0)+Math.imul(z,at)|0,n=n+Math.imul(z,lt)|0,s=s+Math.imul(B,ct)|0,r=(r=r+Math.imul(B,dt)|0)+Math.imul(_,ct)|0,n=n+Math.imul(_,dt)|0;var Ft=(l+(s=s+Math.imul(P,gt)|0)|0)+((8191&(r=(r=r+Math.imul(P,yt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((n=n+Math.imul(k,yt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,s=Math.imul(R,at),r=(r=Math.imul(R,lt))+Math.imul(V,at)|0,n=Math.imul(V,lt),s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(z,ct)|0,n=n+Math.imul(z,dt)|0;var Bt=(l+(s=s+Math.imul(B,gt)|0)|0)+((8191&(r=(r=r+Math.imul(B,yt)|0)+Math.imul(_,gt)|0))<<13)|0;l=((n=n+Math.imul(_,yt)|0)+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(R,ct),r=(r=Math.imul(R,dt))+Math.imul(V,ct)|0,n=Math.imul(V,dt);var _t=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,yt)|0)+Math.imul(z,gt)|0))<<13)|0;l=((n=n+Math.imul(z,yt)|0)+(r>>>13)|0)+(_t>>>26)|0,_t&=67108863;var Lt=(l+(s=Math.imul(R,gt))|0)+((8191&(r=(r=Math.imul(R,yt))+Math.imul(V,gt)|0))<<13)|0;return l=((n=Math.imul(V,yt))+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=pt,a[1]=mt,a[2]=St,a[3]=xt,a[4]=bt,a[5]=vt,a[6]=Mt,a[7]=At,a[8]=wt,a[9]=Tt,a[10]=Et,a[11]=It,a[12]=Ct,a[13]=Pt,a[14]=kt,a[15]=Ft,a[16]=Bt,a[17]=_t,a[18]=Lt,0!==l&&(a[19]=l,i.length++),i};function y(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.GW()}function p(t,e,i){return y(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?y(this,t,e):p(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),p(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.GW()},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.GW();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.GW()},r.prototype.qW=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.XW(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.KW(n,d,c);0!==s.negative;)d--,s.negative=0,s.KW(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.GW(),s.GW(),"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}):0!=(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.qW(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.GW(),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;0==(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,y=1;0==(s.words[0]&y)&&g<26;++g,y<<=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.JW=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;0==(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;0==(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 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(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.GW(),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 A(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).QW(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.QW=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.QW(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.tH(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.tH(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.iH(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.iH(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.iH(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.iH(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.iH(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.iH(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function S(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.sH()}function x(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=r.eH(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 w(t){A.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.JW(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)}S.prototype.sH=function(){var t=new r(null);return t.words=new Array(Math.ceil(this.n/13)),t},S.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.GW(),i},S.prototype.split=function(t,e){t.iushrn(this.n,0,e)},S.prototype.imulK=function(t){return t.imul(this.k)},s(x,S),x.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},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,i=0;i>>=26,t.words[i]=r,e=s}return 0!==e&&(t.words[t.length++]=e),t},r.eH=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return m[t]=e,e},A.prototype.iH=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype.tH=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).QW(this):(a(t,t.umod(this.m).QW(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).QW(this)},A.prototype.add=function(t,e){this.tH(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.QW(this)},A.prototype.iadd=function(t,e){this.tH(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(t,e){this.tH(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.QW(this)},A.prototype.isub=function(t,e){this.tH(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},A.prototype.shl=function(t,e){return this.iH(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this.tH(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this.tH(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.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 y=f,p=0;0!==y.cmp(h);p++)y=y.redSqr();i(p=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},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new w(t)},s(w,A),w.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},w.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},w.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.QW(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).QW(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.QW(this)},w.prototype.invm=function(t){return this.imod(t.JW(this.m).mul(this.r2)).QW(this)}}(0,dp);var gp=fp.exports;function yp(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 pp=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},mp=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),0==(1&h))n=0;else{const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}if(i[0].push(n),0==(1&a))o=0;else{const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}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 Sp{constructor(t,e){this.type=t,this.p=new gp(e.p,16),this.red=e.prime?gp.red(e.prime):gp.mont(this.p),this.zero=new gp(0).toRed(this.red),this.one=new gp(1).toRed(this.red),this.two=new gp(2).toRed(this.red),this.n=e.n&&new gp(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.hH=new Array(4),this.rH=new Array(4),this.nH=new Array(4),this.oH=new Array(4),this.aH=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.lH=!0,this.redN=this.n.toRed(this.red))}uH(t,e){const i=t.cH(),s=pp(e,1,this.aH);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}gH(t,e,i,s,r){const n=this.hH,o=this.rH,h=this.nH;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]=pp(i[s],n[s],this.aH),h[r]=pp(i[r],n[r],this.aH),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=mp(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)}cH(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 gp(t.a,16),b:new gp(t.b,16)}))):this.MH(i),{beta:e,lambda:i,basis:s}}vH(t){const e=t===this.p?this.red:gp.mont(t),i=new gp(2).toRed(e).redInvm(),s=i.redNeg(),r=new gp(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}MH(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 gp(1),g=new gp(0),y=new gp(0),p=new gp(1),m=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=y.sub(t.mul(f));const o=p.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++m)break;a=l,d=c,c=l,y=f,f=u,p=g,g=o}o=l.neg(),h=u;const S=r.sqr().add(n.sqr());return o.sqr().add(h.sqr()).cmp(S)>=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}]}_H(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 vp(this,t,e,i)}pointFromX(t,e){(t=new gp(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)}AH(t,e,i){const s=this.xH,r=this.bH;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 gp(t,16),this.isInfinity()?this:this.yH(t)?this.curve.uH(this,t):this.curve.endo?this.curve.AH([this],[t]):this.curve.dH(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AH(s,r):this.curve.gH(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.AH(s,r,!0):this.curve.gH(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 Mp extends xp{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 gp(0)):(this.x=new gp(e,16),this.y=new gp(i,16),this.z=new gp(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 Mp(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 Ap{constructor(t){this.curve=new bp(t),this.g=this.curve.g,this.n=this.curve.n}}const wp={};var Tp;wp.PresetCurve=Ap,Tp={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(wp,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new Ap(Tp);return Object.defineProperty(wp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class Ep{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.TH(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof Ep?e:new Ep(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}TH(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 Ip(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 Cp{constructor(){this.place=0}}class Pp{constructor(t,e){if(t instanceof Pp)return t;this.FH(t,e)||(this.r=new gp(t.r,16),this.s=new gp(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}FH(t,e){t=yp(t,e);const i=new Cp;if(48!==t[i.place++])return!1;const s=Ip(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=Ip(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=Ip(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 gp(n),this.s=new gp(h),this.recoveryParam=null,!0}}class kp{constructor(t){if(!(this instanceof kp))return new kp(t);"string"==typeof t&&(t=wp[t]),t instanceof wp.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 Ep.fromPublic(this,t,e)}IH(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.IH(new gp(t,16)),i=this.keyFromPublic(i,s);const r=(e=new Pp(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.lH){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 Fp,Bp={exports:{}};Bp.exports=(Fp=Fp||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!==dp&&dp.crypto&&(i=dp.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.fk=new a.init,this.PH=0},DH:function(t){"string"==typeof t&&(t=d.parse(t)),this.fk.concat(t),this.PH+=t.sigBytes},BH:function(e){var i,s=this.fk,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.OH,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,p=l[f-2],m=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;l[f]=y+l[f-7]+m+l[f-16]}var S=s&r^s&n^r&n,x=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=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+b|0,o=n,n=r,r=s,s=b+(x+S)|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},EH:function(){var t=this.fk,i=t.words,s=8*this.PH,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.BH(),this.NH},clone:function(){var t=n.clone.call(this);return t.NH=this.NH.clone(),t}});i.SHA256=n.zH(u),i.HmacSHA256=n.VH(u)}(Math),t.SHA256}(Bp.exports),Op={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({RH:function(){this.NH=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},EH:function(){var t=r.EH.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.zH(n),e.HmacSHA224=r.VH(n),t.SHA224;var e,i,s,r,n}(Bp.exports),Rp={exports:{}}.exports=Bp.exports.enc.Hex,Vp={exports:{}}.exports=Bp.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.GH;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.GH,r=this.WH;if(!r){r=this.WH=[];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)},GH:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(Bp.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({RH:function(){this.NH=new r.init([1732584193,4023233417,2562383102,271733878])},LH: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.NH.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],y=t[e+4],p=t[e+5],m=t[e+6],S=t[e+7],x=t[e+8],b=t[e+9],v=t[e+10],M=t[e+11],A=t[e+12],w=t[e+13],T=t[e+14],E=t[e+15],I=n[0],C=n[1],P=n[2],k=n[3];I=l(I,C,P,k,o,7,h[0]),k=l(k,I,C,P,a,12,h[1]),P=l(P,k,I,C,f,17,h[2]),C=l(C,P,k,I,g,22,h[3]),I=l(I,C,P,k,y,7,h[4]),k=l(k,I,C,P,p,12,h[5]),P=l(P,k,I,C,m,17,h[6]),C=l(C,P,k,I,S,22,h[7]),I=l(I,C,P,k,x,7,h[8]),k=l(k,I,C,P,b,12,h[9]),P=l(P,k,I,C,v,17,h[10]),C=l(C,P,k,I,M,22,h[11]),I=l(I,C,P,k,A,7,h[12]),k=l(k,I,C,P,w,12,h[13]),P=l(P,k,I,C,T,17,h[14]),I=u(I,C=l(C,P,k,I,E,22,h[15]),P,k,a,5,h[16]),k=u(k,I,C,P,m,9,h[17]),P=u(P,k,I,C,M,14,h[18]),C=u(C,P,k,I,o,20,h[19]),I=u(I,C,P,k,p,5,h[20]),k=u(k,I,C,P,v,9,h[21]),P=u(P,k,I,C,E,14,h[22]),C=u(C,P,k,I,y,20,h[23]),I=u(I,C,P,k,b,5,h[24]),k=u(k,I,C,P,T,9,h[25]),P=u(P,k,I,C,g,14,h[26]),C=u(C,P,k,I,x,20,h[27]),I=u(I,C,P,k,w,5,h[28]),k=u(k,I,C,P,f,9,h[29]),P=u(P,k,I,C,S,14,h[30]),I=c(I,C=u(C,P,k,I,A,20,h[31]),P,k,p,4,h[32]),k=c(k,I,C,P,x,11,h[33]),P=c(P,k,I,C,M,16,h[34]),C=c(C,P,k,I,T,23,h[35]),I=c(I,C,P,k,a,4,h[36]),k=c(k,I,C,P,y,11,h[37]),P=c(P,k,I,C,S,16,h[38]),C=c(C,P,k,I,v,23,h[39]),I=c(I,C,P,k,w,4,h[40]),k=c(k,I,C,P,o,11,h[41]),P=c(P,k,I,C,g,16,h[42]),C=c(C,P,k,I,m,23,h[43]),I=c(I,C,P,k,b,4,h[44]),k=c(k,I,C,P,A,11,h[45]),P=c(P,k,I,C,E,16,h[46]),I=d(I,C=c(C,P,k,I,f,23,h[47]),P,k,o,6,h[48]),k=d(k,I,C,P,S,10,h[49]),P=d(P,k,I,C,T,15,h[50]),C=d(C,P,k,I,p,21,h[51]),I=d(I,C,P,k,A,6,h[52]),k=d(k,I,C,P,g,10,h[53]),P=d(P,k,I,C,v,15,h[54]),C=d(C,P,k,I,a,21,h[55]),I=d(I,C,P,k,x,6,h[56]),k=d(k,I,C,P,E,10,h[57]),P=d(P,k,I,C,m,15,h[58]),C=d(C,P,k,I,w,21,h[59]),I=d(I,C,P,k,y,6,h[60]),k=d(k,I,C,P,M,10,h[61]),P=d(P,k,I,C,f,15,h[62]),C=d(C,P,k,I,b,21,h[63]),n[0]=n[0]+I|0,n[1]=n[1]+C|0,n[2]=n[2]+P|0,n[3]=n[3]+k|0},EH:function(){var t=this.fk,i=t.words,s=8*this.PH,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.BH();for(var h=this.NH,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.NH=this.NH.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.zH(a),i.HmacMD5=n.VH(a)})(Math),t.MD5}(Bp.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({RH:function(){this.NH=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},LH:function(t,e){for(var i=this.NH.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},EH:function(){var t=this.fk,e=t.words,i=8*this.PH,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.BH(),this.NH},clone:function(){var t=r.clone.call(this);return t.NH=this.NH.clone(),t}}),e.SHA1=r.zH(h),e.HmacSHA1=r.VH(h),t.SHA1;var e,i,s,r,n,o,h}(Bp.exports),Lp=(_p=Bp.exports).lib.Base,Dp=_p.enc.Utf8,_p.algo.HMAC=Lp.extend({init:function(t,e){t=this.HH=new t.init,"string"==typeof e&&(e=Dp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.UH=e.clone(),n=this.$H=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.XH==this.jH?t=s.createEncryptor:(t=s.createDecryptor,this.OH=1),this.QH&&this.QH.tU==t?this.QH.init(this,i&&i.words):(this.QH=t.call(s,this,i&&i.words),this.QH.tU=t)},LH:function(t,e){this.QH.processBlock(t,e)},EH:function(){var t,e=this.cfg.padding;return this.XH==this.jH?(e.pad(this.fk,this.blockSize),t=this.BH(!0)):(t=this.BH(!0),e.unpad(t)),t},blockSize:4});var y=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),p=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,i=t.salt;return(i?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),y.create({ciphertext:i,salt:e})}},m=s.SerializableCipher=r.extend({cfg:r.extend({format:p}),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 y.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.iU(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},iU:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=(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,y.create({key:r,iv:o,salt:s})}},x=s.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:S}),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=m.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.iU(e,s.format);var r=s.kdf.execute(i,t.keySize,t.ivSize,e.salt);return s.iv=r.iv,m.decrypt.call(this,t,e,r.key,s)}})}()}(Bp.exports);var Np={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 y=t[i],p=t[y],m=t[p],S=257*t[g]^16843008*g;o[i]=S<<24|S>>>8,h[i]=S<<16|S>>>16,a[i]=S<<8|S>>>24,l[i]=S,S=16843009*m^65537*p^257*y^16843008*i,u[g]=S<<24|S>>>8,c[g]=S<<16|S>>>16,d[g]=S<<8|S>>>24,f[g]=S,i?(i=y^t[t[t[m^y]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],y=s.AES=i.extend({RH:function(){if(!this.sU||this.eU!==this.ZH){for(var t=this.eU=this.ZH,e=t.words,i=t.sigBytes/4,s=4*((this.sU=i+6)+1),n=this.hU=[],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.rU=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.nU(t,e,this.hU,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.nU(t,e,this.rU,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},nU:function(t,e,i,s,r,n,o,h){for(var a=this.sU,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++],p=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],m=s[c>>>24]^r[d>>>16&255]^n[l>>>8&255]^o[255&u]^i[f++],S=s[d>>>24]^r[l>>>16&255]^n[u>>>8&255]^o[255&c]^i[f++];l=y,u=p,c=m,d=S}y=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],p=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],m=(h[c>>>24]<<24|h[d>>>16&255]<<16|h[l>>>8&255]<<8|h[255&u])^i[f++],S=(h[d>>>24]<<24|h[l>>>16&255]<<16|h[u>>>8&255]<<8|h[255&c])^i[f++],t[e]=y,t[e+1]=p,t[e+2]=m,t[e+3]=S},keySize:8});e.AES=i.zH(y)}(),t.AES}(Bp.exports),Gp={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.KH,s=i.blockSize,r=this.qH,n=this.oU;r&&(n=this.oU=r.slice(0),this.qH=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}(Bp.exports),Up={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(Bp.exports);const Wp={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg=="],"-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=="]},Xp=xt,Yp=(...t)=>t.slice(1).reduce(((e,i)=>e+Xp.atob(Wp[t[0]][i].toString())),"");let jp,Jp,$p=!1,qp=new Uint8Array([34]);class Zp{set e(t){jp=t}get e(){Jp={An:!1,wn:!1,kn:!1,Cn:!1,Tn:!1,Fn:!1};const t=qp.length>=1?qp[0]:void 0;return void 0!==t&&(Jp.An=!!(1&t),Jp.wn=!!(2&t),Jp.kn=!!(4&t),Jp.Cn=!!(8&t),Jp.Tn=!!(16&t),Jp.Fn=!!(32&t)),Jp.Fn}}let Kp=!1;const Qp=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},tm=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")}`},em=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),im=t=>{const e={},i=t.split("-");if(3!==i.length)throw new Error(Yp(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 nm(d,f)?e:null},sm=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(Qp(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(-1^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(em(h)s[e]===t)))return;break}case"0002":if(!im(t))throw new Error(Yp(0,0,1,7,1,12,5));return;default:throw new Error(Yp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}throw new Error(Yp(0,0,1,2,1,7,1,12,5))},rm=t=>{if(!t)throw new Error(Yp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5));const e=(t[Yp(-1,9)]||t[Yp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Xp[Yp(-1,6)][Yp(-1,7)])>-1)return!0;const i=e.filter((t=>t.indexOf("*")>-1));if(um(Xp[Yp(-1,6)][Yp(-1,7)],i))return!0;const s=t[Yp(-1,8)]||t[Yp(-1,38)];if(""!==s&&null!=s){if(um(Xp[Yp(-1,6)][Yp(-1,7)],[s]))return!1;if(s===Xp[Yp(-1,6)][Yp(-1,7)])return!1}throw new Error(Yp(0,14,1,20,5))},nm=(t,e)=>{const i=new kp("secp256k1").keyFromPublic(Yp(-4,0),"hex"),s=Op(t).toString();return i.verify(s,e)},om=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(!nm(r,n))throw new Error(Yp(0,21,1,2,1,7,1,12,5));const o=Rp.parse(r);i=Np.decrypt({ciphertext:Rp.parse(s)},o,{mode:Gp,padding:Up,iv:Rp.parse("00000000000000000000000000000001")}).toString(Vp)}catch(t){throw new Error(Yp(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(Yp(0,21,1,2,1,7,1,12,5))}if(void 0===e[Yp(-1,5)]||null===e[Yp(-1,4)]||!e[Yp(-1,9)])throw new Error(Yp(0,21,1,2,1,7,1,12,5));const s=parseInt(Yp(-3,0),10)||Number(parseInt(Yp(-3,0),10));if(e[Yp(-1,5)]{const e=im(t);if(!e)throw new Error(Yp(0,0,1,7,1,12,5));let i,s="";try{const t=e.aU.slice(e.lU,e.lU+16),i=new DataView(t.buffer),r=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":((t,e)=>{if(!e)throw new Error(Yp(0,39,1,40,1,41,5));const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!nm(`${s}-${r}`,n))throw new Error(Yp(0,21,1,2,1,7,1,12,5));const o=Uint8Array.from(Qp(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Yp(-3,0),10)||Number(parseInt(Yp(-3,0),10))))throw new Error(Yp(0,21,1,2,1,3,1,4,5));const a=Int32Array.from(Qp(s,8)),l=zp(e[Yp(-1,31)]).toString(Rp),u=Int32Array.from(Qp(l,8)),c=zp(e[Yp(-1,32)]).toString(Rp),d=Int32Array.from(Qp(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t)))throw new Error(Yp(0,21,1,2,1,7,1,12,5))})(t,e);break;case"0002":((t,e)=>{if(!e)throw new Error(Yp(0,39,1,40,1,41,5));const i=im(t);if(!i)throw new Error(Yp(0,0,1,7,1,12,5));const s=i.aU.slice(i.lU,i.aU.length),r=new DataView(s.buffer),n=new Int32Array(8);for(let t=0;tu[e]===t)))throw new Error(Yp(0,21,1,2,1,7,1,12,5))})(t,e);break;default:throw new Error(Yp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}},am=(t,e,i=!0)=>{let s;Kp=!1,e instanceof Mr?(s=e.Cr,e.G()):"container"in e&&(s="string"==typeof e.container?xt.document.getElementById(e.container):e.container);const r=!!s&&(s===xt.document.body||xt.document.body.contains(s)),n=s&&r?s:document.body,o=xt.document.createElement("div");o.id="lcjs-error",n.append(o),o.style.width="100%",o.style.height="100%",o.style.backgroundColor="black",o.style.boxSizing="border-box",o.style.padding="20px",o.style.font="Arial",o.style.fontSize="20px";let h=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");h=(i?Yp(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1);const a=xt.document.createElement("p1");o.append(a),a.innerHTML=h,a.style.color="red"},lm=(t,e,i)=>{e?(t[Yp(-1,17)](Yp(-1,19),i),t[Yp(-1,17)](Yp(-1,20),i),t[Yp(-1,17)](Yp(-1,21),i),t[Yp(-1,17)](Yp(-1,22),i)):(t[Yp(-1,18)](Yp(-1,19),i),t[Yp(-1,18)](Yp(-1,20),i),t[Yp(-1,18)](Yp(-1,21),i),t[Yp(-1,18)](Yp(-1,22),i))},um=(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)}))},cm=t=>{const i=()=>{};let s,r,n;if(new xt.Image instanceof xt.HTMLImageElement){const t=new xt.Image;t.src=Hf,r=new zo({source:t,fitMode:e.ImageFitMode.Stretch});const i=new xt.Image;i.src=Gf,n=new zo({source:i,fitMode:e.ImageFitMode.Stretch})}else if(xt.lcjs_setup){const t=new xt.Image;t.src=Hf;const i=xt.lcjs_setup(t.naturalWidth,t.naturalHeight);i.getContext("2d").drawImage(t,0,0),r=new zo({source:i,fitMode:e.ImageFitMode.Stretch}),n=r}else r=new V({color:T("#f00")}),n=r;const o=e=>{if(e.ed&&(e.uU&&(n?e.ed.Me(n):xt.requestAnimationFrame((()=>o(e)))),e.uU||(r?e.ed.Me(r):xt.requestAnimationFrame((()=>o(e))))),e.ed){const t=(e.uU,150),i=(e.uU,32),s=e.ct.Jt({x:e.ct.x.getInnerEnd(),y:e.ct.y.getInnerStart()},{x:-(3+t),y:3}),r=e.ct.Jt({x:e.ct.x.getInnerEnd(),y:e.ct.y.getInnerStart()},{x:-3,y:3+i}),n={x:r.x-s.x,y:r.y-s.y};e.ed.we(s).q(n)}!1===e.uU&&"W"!==Hf[3361]&&am(Yp(0,36,1,38,5),t,!1),!0===e.uU&&"2"!==Gf[571]&&am(Yp(0,36,1,38,5),t,!1),s&&s.Ss()};return s=t.rF("logo",Number.MAX_SAFE_INTEGER),n=>{const h={ct:n,uU:!1};let a,l;return h.cU=()=>{a=xt.setTimeout((()=>{l=t.Tr(e.MouseStyles.Point),void 0!==h.ed&&(h.ed.setMouseClickEventHandler(dm),h.ed.setTouchEndEventHandler(dm)),h.uU=!0,o(h)}),3e3)},h.dU=()=>{xt.clearTimeout(a),t.Fr(l),void 0!==h.ed&&(h.ed.setMouseClickEventHandler(i),h.ed.setTouchEndEventHandler(i)),h.uU=!1,o(h)},(t=>{t.ed&&t.ed.dispose(),s&&(t.ed=s._e(t.ct).Me(r).setMouseInteractions(!0).setMouseClickEventHandler(i).setTouchEndEventHandler(i).ve(st),t.cU&&t.ed.setMouseEnterEventHandler(t.cU),t.dU&&t.ed.setMouseLeaveEventHandler(t.dU),o(t))})(h),{Ts:()=>o(h),G:()=>(t=>{t.ed&&(t.ed.dispose(),t.ed=void 0,t.cU=()=>{},t.dU=()=>{})})(h)}}},dm=()=>xt.open("https://lightningchart.com/lightningchart-js/"),fm={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"}},gm={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"}},ym={"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"}},pm={"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"}},mm={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"}},Sm={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"}},xm={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"}},bm={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"}},vm={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"}},Mm={World:Sm,USA:xm,NorthAmerica:bm,SouthAmerica:vm,Canada:pm,Europe:mm,Asia:gm,Africa:fm,Australia:ym},Am={Solid:Ou},wm=(t,e)=>{const i=(t=>{const e=new V({color:t.uiStrokeColorContrastHigh}),i=new V({color:t.uiStrokeColorContrastMedium}),s=new V({color:t.uiStrokeColorContrastLow}),r=new tr({family:t.fontFamily,weight:"normal",style:"normal"}),n=r.setSize(18*t.fontScaler),o=r.setSize(16*t.fontScaler),h=r.setSize(14*t.fontScaler),a=r.setSize(10*t.fontScaler),l=r.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),u=r.setSize(13*t.fontScaler),c=new $i({thickness:2,fillStyle:s}),d=new V({color:t.dataHighlightOverlayColor}),f=new $i({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),g=t.dataColorPalette.map((t=>new V({color:t.stroke}))),y=t=>g[t%g.length],p=g.map((t=>new $i({thickness:2,fillStyle:t}))),m=t=>p[t%p.length],S=t.dataColorPalette.map((t=>new V({color:t.border}))).map((t=>new $i({thickness:2,fillStyle:t}))),x=t=>S[t%S.length],b=t.dataColorPalette.map((t=>{const e=t.area;return new tt({angle:180,stops:[{color:ae(e,w(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,w(0,0,0,e.getA()),.3),offset:1}]})})),v=t=>b[t%b.length],M=t.dataColorPaletteInverted.map((t=>{const e=t.area;return new tt({angle:180,stops:[{color:ae(e,w(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ae(e,w(0,0,0,e.getA()),.3),offset:1}]})})),A=t=>M[t%M.length],T=t.dataColorPaletteInverted.map((t=>new V({color:t.border}))).map((t=>new $i({thickness:2,fillStyle:t}))),E=t=>T[t%T.length],I=new V({color:t.dataColorPositive}),C=new V({color:t.dataColorNegative}),P=new $i({thickness:1,fillStyle:new V({color:t.dataStrokeColorContrastHigh.setA(50)})}),k=new $i({thickness:2,fillStyle:t.axisLineFillStyle}),F=st,B=new V({color:w(0,0,0,1)}),_=new $i({thickness:1,fillStyle:t.axisGridMajorFillStyle}),L=new $i({thickness:1,fillStyle:t.axisTickMajorFillStyle}),D=h,O=t.axisLabelMajorFillStyle,R=new $i({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new $i({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=h,H=t.axisLabelMajorFillStyle,U=new $i({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new $i({thickness:1,fillStyle:t.axisTickMinorFillStyle}),X=a,Y=t.axisLabelMinorFillStyle,j=nh,J=new sh({gridStrokeStyle:_,tickStyle:L,tickLength:50,tickPadding:-14,labelFont:D,labelPadding:0,labelFillStyle:O}),$=new sh({gridStrokeStyle:R,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:H}),q=new sh({gridStrokeStyle:U,tickStyle:W,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:Y}),Z=new Th({extremeTickStyle:j,majorTickStyle:$,minorTickStyle:q}),K=new Sh({greatTickStyle:J,majorTickStyle:$,minorTickStyle:q}),Q=new kh({majorTickStyle:$,minorTickStyle:q}),et=new V({color:t.dataHighlightOverlayColor}),it=new $i({thickness:1,fillStyle:i}),rt=new $i({thickness:2,fillStyle:i}),nt=t=>new ur.Triangulated({shape:"sphere",size:10,fillStyle:g[t%g.length]}),ot=g[0],ht=t.uiTextFillStyle,at=t.legendBackgroundFillStyle,lt=new $i({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ut=ue(t.legendButtonDefaultColor),ct=new $i({thickness:1,fillStyle:e}),dt=new $i({thickness:1,fillStyle:t.cursorGridFillStyle});let ft={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:st,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new $i({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:st,chartXYTitleFont:n,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:c,chartXYZoomingRectangleFillStyle:d,chartXYZoomingRectangleStrokeStyle:f,chartXYFittingRectangleFillStyle:d,chartXYFittingRectangleStrokeStyle:f,lineSeriesStrokeStyle:m,pointLineSeriesStrokeStyle:m,pointLineSeriesFillStyle:y,pointSeriesFillStyle:y,ellipseSeriesFillStyle:y,ellipseSeriesStrokeStyle:m,polygonSeriesFillStyle:y,polygonSeriesStrokeStyle:m,rectangleSeriesFillStyle:y,rectangleSeriesStrokeStyle:st,segmentSeriesStrokeStyle:m,boxSeriesBodyFillStyle:y(0),boxSeriesBodyStrokeStyle:st,boxSeriesStrokeStyle:new $i({thickness:1,fillStyle:g[0]}),boxSeriesMedianStrokeStyle:new $i({thickness:1,fillStyle:new V({color:w(0,0,0)})}),ohlcCandleBodyFillStylePositive:I,ohlcCandleBodyFillStyleNegative:C,ohlcCandleBodyStrokeStylePositive:st,ohlcCandleBodyStrokeStyleNegative:st,ohlcCandleStrokeStyle:new $i({thickness:1,fillStyle:new V({color:t.uiStrokeColorContrastHigh})}),ohlcBarStrokeStylePositive:new $i({thickness:2,fillStyle:I}),ohlcBarStrokeStyleNegative:new $i({thickness:2,fillStyle:C}),heatmapGridSeriesFillStyle:y,heatmapGridSeriesWireframeStyle:P,heatmapScrollingGridSeriesFillStyle:y,heatmapScrollingGridSeriesWireframeStyle:P,areaRangeSeriesFillStyle:v,areaRangeSeriesStrokeStyle:x,areaRangeSeriesFillStyleInverted:A,areaRangeSeriesStrokeStyleInverted:E,areaSeriesBipolarHighFillStyle:v,areaSeriesBipolarHighStrokeStyle:x,areaSeriesBipolarLowFillStyle:A,areaSeriesBipolarLowStrokeStyle:E,areaSeriesPositiveFillStyle:v,areaSeriesPositiveStrokeStyle:x,areaSeriesNegativeFillStyle:A,areaSeriesNegativeStrokeStyle:E,xAxisTitleFont:o,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:k,xAxisNibStyle:F,xAxisOverlayStyle:B,xAxisZoomingBandFillStyle:d,xAxisZoomingBandStrokeStyle:st,xAxisNumericTicks:Z,xAxisDateTimeTicks:K,xAxisTimeTicks:Q,yAxisTitleFont:o,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:k,yAxisNibStyle:F,yAxisOverlayStyle:B,yAxisZoomingBandFillStyle:d,yAxisZoomingBandStrokeStyle:st,yAxisNumericTicks:Z,yAxisDateTimeTicks:K,yAxisTimeTicks:Q,bandFillStyle:et,bandStrokeStyle:it,constantLineStrokeStyle:rt,barChartBackgroundFillStyle:t.panelBackgroundFillStyle,barChartBackgroundStrokeStyle:st,barChartTitleFont:n,barChartTitleFillStyle:t.titleFillStyle,barChartSeriesBackgroundFillStyle:z,barChartSeriesBackgroundStrokeStyle:st,barChartBarFillStyle:y,barChartBarStrokeStyle:st,barChartValueAxisTitleFont:o,barChartValueAxisTitleFillStyle:t.axisTitleFillStyle,barChartValueAxisStrokeStyle:k,barChartValueAxisTicks:Z.setMajorTickStyle((t=>t.setGridStrokeStyle(st))).setMinorTickStyle((t=>rh(t)?t.setGridStrokeStyle(st):t)),barChartCategoryAxisTitleFont:o,barChartCategoryAxisTitleFillStyle:t.axisTitleFillStyle,barChartCategoryAxisStrokeStyle:k,barChartCategoryLabels:{formatter:(t,e,i)=>e,labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0,tickStyle:Z.majorTickStyle.tickStyle,tickLength:0},barChartValueLabelsAfterBars:{position:"after-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},barChartValueLabelsInsideBars:{position:"inside-bar",formatter:(t,e,i)=>t.chart.valueAxis.formatValue(i),labelFillStyle:Z.majorTickStyle.labelFillStyle,labelFont:Z.majorTickStyle.labelFont,labelMargin:8,labelRotation:0},chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:st,chart3DTitleFont:n,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:c,chart3DBoundingBoxStrokeStyle:st,xAxis3DTitleFont:o,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:k,xAxis3DNumericTicks:Z,xAxis3DDateTimeTicks:K,xAxis3DTimeTicks:Q,yAxis3DTitleFont:o,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:k,yAxis3DNumericTicks:Z,yAxis3DDateTimeTicks:K,yAxis3DTimeTicks:Q,zAxis3DTitleFont:o,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:k,zAxis3DNumericTicks:Z,zAxis3DDateTimeTicks:K,zAxis3DTimeTicks:Q,lineSeries3DStrokeStyle:m,pointLineSeries3DStrokeStyle:m,pointLineSeries3DPointStyle:nt,pointSeries3DPointStyle:nt,pointCloudSeries3DPointStyle:t=>new ur.Pixelated({size:5,fillStyle:g[t%g.length]}),surfaceGridSeries3DFillStyle:y,surfaceGridSeries3DWireframeStyle:P,surfaceScrollingGridSeries3DFillStyle:y,surfaceScrollingGridSeries3DWireframeStyle:P,boxSeries3DFillStyle:y,polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:st,polarChartTitleFont:n,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:c,polarSectorFillStyle:et,polarSectorStrokeStyle:it,polarAmplitudeAxisTitleFont:o,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:k,polarAmplitudeAxisNumericTicks:Z,polarAmplitudeAxisDateTimeTicks:K,polarAmplitudeAxisTimeTicks:Q,polarRadialAxisTitleFont:o,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:k,polarRadialAxisTickStyle:$,polarLineSeriesStrokeStyle:m,polarPointLineSeriesFillStyle:y,polarPointLineSeriesStrokeStyle:m,polarPointSeriesFillStyle:y,polarPolygonSeriesFillStyle:v,polarPolygonSeriesStrokeStyle:x,polarAreaSeriesFillStyle:v,polarAreaSeriesStrokeStyle:x,polarHeatmapSeriesFillStyle:y,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:st,mapChartTitleFont:n,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ot,mapChartStrokeStyle:new $i({thickness:1,fillStyle:new V({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:z,mapChartOutlierRegionStrokeStyle:new $i({thickness:1,fillStyle:s}),mapChartSeparateRegionFillStyle:at,mapChartSeparateRegionStrokeStyle:lt,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:st,dataGridTitleFont:n,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:h,dataGridTextFillStyle:ot,dataGridCellBackgroundFillStyle:new V({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new $i({thickness:.4,fillStyle:new V({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:st,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:lt,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:lt,dataGridScrollBarButtonArrowFillStyle:ut,dataGridScrollBarButtonArrowStrokeStyle:lt,sparkLineChartStrokeStyle:m(0),sparkPointChartFillStyle:y(0),sparkBarChartFillStyle:y(0),sparkBarChartStrokeStyle:x(0),sparkAreaChartFillStyle:v(0),sparkAreaChartStrokeStyle:x(0),sparkPieChartFillStyle:y,sparkPieChartStrokeStyle:lt,sparkChartBandFillStyle:et,sparkChartBandStrokeStyle:it,sparkChartConstantLineStrokeStyle:rt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:st,spiderChartTitleFont:n,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:c,spiderChartWebStyle:new $i({thickness:2,fillStyle:s}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:h,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:o,spiderChartAxisStrokeStyle:new $i({thickness:2,fillStyle:i}),spiderChartAxisNibStrokeStyle:new $i({thickness:2,fillStyle:e}),spiderSeriesFillStyle:v,spiderSeriesStrokeStyle:x,spiderSeriesPointFillStyle:y,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:st,pieChartTitleFont:n,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:y,pieChartSliceStrokeStyle:lt,pieChartSliceLabelFont:u,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:ct,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:st,funnelChartTitleFont:n,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:y,funnelChartSliceStrokeStyle:lt,funnelChartSliceLabelFont:u,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:ct,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:st,pyramidChartTitleFont:n,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:y,pyramidChartSliceStrokeStyle:lt,pyramidChartSliceLabelFont:u,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:ct,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:st,gaugeChartTitleFont:n,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new V({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:lt,gaugeChartGaugeFillStyle:ot,gaugeChartIntervalLabelsFillStyle:ht,gaugeChartIntervalLabelsFont:u,gaugeChartValueLabelFillStyle:ht,gaugeChartValueLabelFont:u,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:st,onScreenMenuBackgroundColor:w(254,204,0,.7),uiButtonFillStyle:ut,uiButtonStrokeStyle:lt,uiButtonSize:10,uiBackgroundFillStyle:at,uiBackgroundStrokeStyle:lt,uiTextFillStyle:ht,uiTextFont:u,legendTitleFillStyle:ht,legendTitleFont:l,cursorTickMarkerXBackgroundFillStyle:at,cursorTickMarkerXBackgroundStrokeStyle:lt,cursorTickMarkerXTextFillStyle:ht,cursorTickMarkerXTextFont:u,cursorTickMarkerYBackgroundFillStyle:at,cursorTickMarkerYBackgroundStrokeStyle:lt,cursorTickMarkerYTextFillStyle:ht,cursorTickMarkerYTextFont:u,cursorPointMarkerFillStyle:z,cursorPointMarkerStrokeStyle:st,cursorResultTableFillStyle:at,cursorResultTableStrokeStyle:lt,cursorResultTableTextFillStyle:ht,cursorResultTableTextFont:u,cursorGridStrokeStyleX:dt,cursorGridStrokeStyleY:dt,chartMarkerPointMarkerFillStyle:t.legendBackgroundBorderFillStyle,chartMarkerPointMarkerStrokeStyle:st};return t.overrideThemeProperties&&(ft={...ft,...t.overrideThemeProperties}),ft})(t),s={...e,header1Font:i.xAxisTitleFont,header2Font:i.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:i.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...i,examples:s}},Tm=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/themes/${e}`;return i.addEventListener("error",(e=>{Ee(t,s,"Theme with asset",{shouldCrash:!1})})),i.src=s,i},Em=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.5);return new Z({stops:[{color:ae(r,w(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ae(r,w(30,30,30),.5*i).setA(100),offset:1}]})},Im=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.2);return new Z({stops:[{color:ae(r,w(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ae(r,w(0,0,0),.2*i),offset:1}]})},Cm=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ae(e[s%e.length].stroke,w(255,255,255),.2);return new tt({angle:90,stops:[{color:ae(r,w(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ae(r,w(30,30,30),.5*i),offset:1}]})},Pm=(t,e,i)=>i=>{const s=!0===t?e[i%e.length].stroke:ae(e[i%e.length].stroke,w(255,255,255),.3);return new tt({angle:90,stops:[{color:ae(s,w(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ae(s,w(30,30,30),.5),offset:1}]})},km=(t,i,s)=>{const r=i[0].stroke;return new Z({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:ae(r,w(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:ae(r,w(0,0,0),.5*s),offset:1}]})},Fm=we((()=>{const t=w(255,255,255),i=new V({color:t}),s=!0,r=new Xo({spread:1,blur:9,offset:{x:0,y:0},color:w(0,0,0,150)}),n=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(50,51,52)},{offset:.5,color:w(14,15,16)},{offset:1,color:w(0,0,0)}]}),o=new V({color:w(45,45,45)}),h=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(120,120,120,100)},{offset:1,color:w(0,0,0,50)}]}),a=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(30,30,30,200)},{offset:1,color:w(0,0,0,255)}]}),l=new V({color:w(255,255,220)}),u=new V({color:w(255,255,166)}),c=new V({color:w(255,255,220)}),d=new V({color:w(255,255,220,130)}),f=new V({color:w(255,255,200)}),g=f,y=g,p=new tt({angle:45,stops:[{offset:0,color:w(230,230,230)},{offset:1,color:w(150,150,150)}]}),m=new V({color:w(220,220,220)}),S=new V({color:w(200,200,200,50)}),x=new V({color:w(200,200,200,150)}),b=new V({color:w(200,200,200,20)}),v=new V({color:w(150,150,150)}),M=new tt({angle:0,stops:[{offset:0,color:w(10,10,10,220)},{offset:1,color:w(30,30,30,220)}]}),A=i,T=w(255,255,200),E=M,I=A,C=w(20,20,20),P=w(0,0,0),k=t,F=w(150,150,150),B=w(50,50,50),_=w(50,50,50),L=w(100,100,100),D=w(200,200,200),z=[w(255,255,91,255),w(255,205,91,255),w(255,155,91,255),w(255,196,188,255),w(255,148,184,255),w(219,148,198,255),w(235,196,224,255),w(169,148,198,255),w(148,226,198,255),w(148,255,176,255),w(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),O=t.setA(20),R=w(176,255,157,255),N=w(255,112,76,255),G={mapChartFillStyle:new tt({angle:135,stops:[{color:w(255,255,91,255),offset:0},{color:w(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Em(s,z,.5),pieChartSliceFillStylePalette:Im(s,z,1),funnelChartSliceFillStylePalette:Cm(s,z,1),pyramidChartSliceFillStylePalette:Cm(s,z,1),rectangleSeriesFillStyle:Pm(s,z),gaugeChartGaugeFillStyle:km(s,z,1),barChartBarFillStyle:Pm(s,z)},H=new V({color:w(176,255,157,255)}),U=new V({color:w(255,146,146,255)}),W=new V({color:w(176,255,157,255)}),X=new V({color:w(230,63,63,255)}),Y=new V({color:w(176,255,157,120)}),j=new V({color:w(229,63,63,180)}),J=new V({color:w(27,37,36,255)}),$=new V({color:w(62,27,27,255)}),q=[w(255,0,0),w(255,255,0),w(0,255,0)],K=[w(10,10,255),w(10,190,255),w(251,255,0),w(255,38,0)],Q=[w(255,255,0),w(255,204,0),w(255,128,0),w(255,0,0)],et=[w(0,0,0),w(167,4,69,255),w(255,0,0),w(252,252,168,255)],it=new Z({stops:[{color:w(61,61,80,100),offset:0},{color:w(44,44,55,30),offset:1}]}),st=new V({color:w(148,148,198,255)}),rt=Y.getColor().setA(255),nt=w(100,100,100);return wm({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(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:y,axisLineFillStyle:p,axisTickMajorFillStyle:m,axisGridMajorFillStyle:S,axisTickMinorFillStyle:x,axisGridMinorFillStyle:b,cursorGridFillStyle:v,legendBackgroundFillStyle:M,legendBackgroundBorderFillStyle:A,legendButtonDefaultColor:T,resultTableBackgroundFillStyle:E,resultTableBackgroundBorderFillStyle:I,uiBackgroundColor:C,uiBackgroundBorderColor:P,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:F,uiStrokeColorContrastLow:B,dataStrokeColorContrastHigh:_,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:D,dataColorPalette:z,dataColorPaletteInverted:[{area:w(190,50,50,100),border:w(210,80,80)}],dataHighlightOverlayColor:O,dataColorPositive:R,dataColorNegative:N,overrideThemeProperties:G},{positiveTextFillStyle:H,negativeTextFillStyle:U,positiveFillStyle:W,negativeFillStyle:X,positiveAreaFillStyle:Y,negativeAreaFillStyle:j,positiveBackgroundFillStyle:J,negativeBackgroundFillStyle:$,badGoodColorPalette:q,coldHotColorPalette:K,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Bm=we((()=>{const t=w(255,255,255),i=new V({color:t}),s=!0,r=new Xo({spread:0,blur:9,offset:{x:0,y:0},color:w(105,255,236,40)}),n=new V({color:w(2,21,30)}),o=new Z({stops:[{color:w(19,40,66,150),offset:0},{color:w(0,0,0,150),offset:1}]}),h=new V({color:w(0,5,8,150)}),a=i,l=i,u=i,c=new V({color:w(255,255,220,130)}),d=i,f=i,g=f,y=new V({color:w(20,224,250,255)}),p=i,m=new V({color:w(61,94,110,100)}),S=new V({color:w(61,94,110,255)}),x=new V({color:w(61,94,110,40)}),b=i,v=new V({color:w(0,18,23,255)}),M=i,A=t,T=new V({color:w(0,17,22,240)}),E=i,I=w(0,38,48,220),C=w(0,0,0),P=t,k=w(150,150,150),F=w(19,78,93),B=w(50,50,50),_=w(0,36,48),L=w(200,200,200),D=[w(45,253,253,255),w(44,172,247,255),w(46,100,248,255),w(96,84,199,255),w(184,104,245,255),w(98,160,218,255),w(43,238,245,255),w(38,140,206,255),w(112,96,224,255),w(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(50),O=w(3,217,194,255),R=w(230,63,63,255),N={mapChartFillStyle:new tt({angle:135,stops:[{color:w(118,248,231,255),offset:0},{color:w(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Em(s,D,1),pieChartSliceFillStylePalette:Im(s,D,1),funnelChartSliceFillStylePalette:Cm(s,D,1),pyramidChartSliceFillStylePalette:Cm(s,D,1),rectangleSeriesFillStyle:Pm(s,D),gaugeChartGaugeFillStyle:km(s,D,1),barChartBarFillStyle:Pm(s,D)},G=new V({color:w(45,253,253,255)}),H=new V({color:w(255,146,146,255)}),U=new V({color:w(45,253,253,255)}),W=new V({color:w(230,63,63,255)}),X=new V({color:w(1,190,164,120)}),Y=new V({color:w(229,63,63,180)}),j=new V({color:w(1,53,57,255)}),J=new V({color:w(62,27,27,255)}),$=[w(1,104,119,255),w(0,165,144,255),w(0,246,214,255)],q=[w(0,87,95,255),w(0,125,124,255),w(1,209,182,255),w(0,255,221,255),w(218,112,112,255),w(172,47,47,255)],K=[w(126,255,253,255),w(50,233,230,255),w(0,196,193,255),w(62,138,178,255),w(139,88,191,255),w(162,55,143,255)],Q=[w(13,31,52,255),w(101,50,118,255),w(1,142,172,255),w(2,196,170,255),w(0,255,221,255)],et=new Z({stops:[{color:w(122,103,254,70),offset:0},{color:w(178,168,255,10),offset:1}]}),it=new V({color:w(122,103,254,255)}),st=X.getColor().setA(255),rt=w(15,83,83);return wm({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new zo({source:Tm(t,"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:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:m,axisTickMinorFillStyle:S,axisGridMinorFillStyle:x,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:A,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:I,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:P,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:B,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:L,dataColorPalette:D,dataColorPaletteInverted:[{area:w(170,60,210,100),border:w(210,100,250)}],dataHighlightOverlayColor:z,dataColorPositive:O,dataColorNegative:R,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:W,positiveAreaFillStyle:X,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:J,badGoodColorPalette:$,coldHotColorPalette:q,intensityColorPalette:K,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),_m=we((()=>{const t=!1,i=new Xo({spread:0,blur:6,offset:{x:2,y:-2},color:w(0,0,0,30)}),s=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(255,255,255)},{offset:1,color:w(255,255,255)}]}),r=new V({color:w(219,227,233,255)}),n=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,200)},{offset:1,color:w(240,244,246,200)}]}),o=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,255)},{offset:1,color:w(255,255,255,255)}]}),h=new V({color:w(33,43,49)}),a=new V({color:w(33,43,49)}),l=new V({color:w(33,43,49)}),u=new V({color:w(33,43,49,150)}),c=new V({color:w(33,43,49)}),d=c,f=d,g=new tt({angle:45,stops:[{offset:0,color:w(225,225,225)},{offset:1,color:w(225,225,225)}]}),y=new V({color:w(168,186,199,255)}),p=new V({color:w(168,186,199,120)}),m=new V({color:w(168,186,199,40)}),S=new V({color:w(168,186,199,40)}),x=new V({color:w(128,146,159,255)}),b=new tt({angle:0,stops:[{offset:0,color:w(255,255,255,240)},{offset:1,color:w(255,255,255,240)}]}),v=new V({color:w(168,186,199)}),M=w(255,255,200),A=new V({color:w(255,255,255,240)}),T=new V({color:w(128,146,159,255)}),E=w(255,255,255,255),I=w(168,168,199,255),C=w(168,186,199,255),P=w(168,186,199,255),k=w(168,186,199,255),F=w(168,186,199,255),B=w(100,100,100),_=w(200,200,200),L=[w(28,181,140,255),w(255,132,0,255),w(240,39,39,255),w(86,121,251,255),w(2,181,213,255),w(13,212,158,255),w(22,167,3,255),w(234,103,232,255),w(62,183,179,255),w(140,93,3,255),w(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),D=w(150,150,150,80),z=w(46,182,120,255),O=w(255,66,66,255),R=new $i({thickness:2,fillStyle:new V({color:w(168,186,199,255)})}),N={mapChartFillStyle:new tt({angle:-45,stops:[{color:w(2,181,213,255),offset:0},{color:w(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Em(t,L,.8),pieChartSliceFillStylePalette:Im(t,L,.8),funnelChartSliceFillStylePalette:Cm(t,L,.5),pyramidChartSliceFillStylePalette:Cm(t,L,.5),rectangleSeriesFillStyle:Pm(t,L),gaugeChartGaugeFillStyle:km(t,L,.8),barChartBarFillStyle:Pm(t,L),chartXYSeriesBackgroundStrokeStyle:R,chart3DSeriesBackgroundStrokeStyle:R,polarChartSeriesBackgroundStrokeStyle:R,spiderChartSeriesBackgroundStrokeStyle:R,dataGridTextFillStyle:new V({color:w(0,88,64,255)})},G=new V({color:w(4,146,108,255)}),H=new V({color:w(240,39,39,255)}),U=new V({color:w(28,181,140,255)}),W=new V({color:w(230,88,88,255)}),X=new V({color:w(28,181,140,180)}),Y=new V({color:w(230,88,88,180)}),j=new V({color:w(229,243,228)}),J=new V({color:w(232,225,216)}),$=[w(193,48,48,255),w(240,234,60,255),w(45,191,55,255)],q=[w(10,19,255,255),w(15,191,250,255),w(249,255,2,255),w(253,133,0,255),w(255,24,0,255)],K=[w(50,99,213),w(8,179,77),w(255,246,0),w(255,126,0),w(189,36,30)],Q=[w(16,64,176),w(8,179,77),w(255,246,0),w(255,126,0),w(168,6,0)],et=new V({color:w(185,198,207,255)}),it=new Z({stops:[{color:w(151,190,220,10),offset:0},{color:w(151,190,220,50),offset:1}]}),st=X.getColor().setA(255),rt=w(150,150,150);return wm({isDark:t,highlightColorOffset:w(-60,-60,-60,60),highlightColorOffsetAxisOverlay:w(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:y,axisGridMajorFillStyle:p,axisTickMinorFillStyle:m,axisGridMinorFillStyle:S,cursorGridFillStyle:x,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:A,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:E,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:P,uiStrokeColorContrastLow:k,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:B,dataStrokeColorContrastLow:_,dataColorPalette:L,dataColorPaletteInverted:[{area:w(190,50,50,100),border:w(210,80,80)}],dataHighlightOverlayColor:D,dataColorPositive:z,dataColorNegative:O,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:W,positiveAreaFillStyle:X,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:J,badGoodColorPalette:$,coldHotColorPalette:q,intensityColorPalette:K,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:w(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),Lm=we((()=>{const t=!1,i=new Z({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:w(255,255,255)},{offset:1,color:w(255,255,255)}]}),s=new V({color:w(214,236,216,255)}),r=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(233,244,231,70)},{offset:1,color:w(233,244,231,200)}]}),n=new Z({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:w(255,255,255,255)},{offset:1,color:w(255,255,255,255)}]}),o=new V({color:w(1,61,53)}),h=new V({color:w(1,61,53)}),a=new V({color:w(1,61,53)}),l=new V({color:w(1,61,53,150)}),u=new V({color:w(1,61,53)}),c=u,d=c,f=new tt({angle:45,stops:[{offset:0,color:w(225,225,225)},{offset:1,color:w(225,225,225)}]}),g=new V({color:w(188,211,186,255)}),y=new V({color:w(188,211,186,150)}),p=new V({color:w(188,211,186,50)}),m=new V({color:w(188,211,186,50)}),S=new V({color:w(104,148,111,255)}),x=new tt({angle:0,stops:[{offset:0,color:w(255,255,255,240)},{offset:1,color:w(255,255,255,240)}]}),b=new V({color:w(104,148,111)}),v=w(255,255,200),M=new V({color:w(255,255,255,240)}),A=new V({color:w(104,148,111,255)}),T=w(255,255,255,255),E=w(179,201,183,255),I=w(188,211,186,255),C=w(188,211,186,255),P=w(188,211,186,255),k=w(188,211,186,255),F=w(100,100,100),B=w(200,200,200),_=[w(138,195,142,255),w(193,161,114,255),w(178,99,99,255),w(142,156,210,255),w(154,209,219,255),w(164,212,199,255),w(104,156,97,255),w(196,147,195,255),w(92,190,187,255),w(126,100,51,255),w(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),L=w(150,150,150,80),D=w(46,182,84,255),z=w(232,96,96,255),O=new $i({thickness:2,fillStyle:new V({color:w(188,211,186,255)})}),R={mapChartFillStyle:new tt({angle:-45,stops:[{color:w(118,160,121,255),offset:0},{color:w(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Em(t,_,.8),pieChartSliceFillStylePalette:Im(t,_,.8),pyramidChartSliceFillStylePalette:Cm(t,_,.5),funnelChartSliceFillStylePalette:Cm(t,_,.5),rectangleSeriesFillStyle:Pm(t,_),gaugeChartGaugeFillStyle:km(t,_,.8),barChartBarFillStyle:Pm(t,_),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new V({color:w(77,66,21,255)})},N=new V({color:w(93,151,97,255)}),G=new V({color:w(178,99,99,255)}),H=new V({color:w(138,195,142,255)}),U=new V({color:w(178,99,99,255)}),W=new V({color:w(138,195,142,180)}),X=new V({color:w(178,99,99,180)}),Y=new V({color:w(224,240,237)}),j=new V({color:w(251,227,227)}),J=[w(178,99,99,255),w(215,224,111,255),w(80,186,88,255)],$=[w(62,64,142,255),w(66,131,77,255),w(250,250,135,255),w(202,161,78,255),w(179,53,53,255)],q=[w(64,86,138),w(123,192,205),w(255,252,149),w(220,155,92),w(184,78,74)],K=[w(64,86,138),w(123,192,205),w(255,252,149),w(220,155,92),w(132,60,57)],Q=new V({color:w(185,198,207,255)}),et=new Z({stops:[{color:w(151,190,220,10),offset:0},{color:w(151,190,220,50),offset:1}]}),it=W.getColor().setA(255),st=w(150,150,150);return wm({isDark:t,highlightColorOffset:w(-60,-60,-60,60),highlightColorOffsetAxisOverlay:w(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:y,axisTickMinorFillStyle:p,axisGridMinorFillStyle:m,cursorGridFillStyle:S,legendBackgroundFillStyle:x,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:v,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:A,uiBackgroundColor:T,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:C,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:k,dataStrokeColorContrastMedium:F,dataStrokeColorContrastLow:B,dataColorPalette:_,dataColorPaletteInverted:[{area:w(210,70,70,100),border:w(200,110,110)}],dataHighlightOverlayColor:L,dataColorPositive:D,dataColorNegative:z,overrideThemeProperties:R},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:H,negativeFillStyle:U,positiveAreaFillStyle:W,negativeAreaFillStyle:X,positiveBackgroundFillStyle:Y,negativeBackgroundFillStyle:j,badGoodColorPalette:J,coldHotColorPalette:$,intensityColorPalette:q,spectrogramColorPalette:K,bollingerFillStyle:et,bollingerBorderFillStyle:Q,highlightPointColor:w(0,0,0),highlightDataGridColor:it,unfocusedDataColor:st})})),Dm=we((()=>{const t=w(255,255,255),i=new V({color:t}),s=!0,r=new Xo({spread:1,blur:9,offset:{x:0,y:0},color:w(255,255,255,30)}),n=new V({color:w(6,15,36)}),o=new Z({stops:[{color:w(46,13,87,50),offset:0},{color:w(0,0,0,150),offset:1}]}),h=new V({color:w(0,5,8,150)}),a=i,l=i,u=i,c=new V({color:w(255,255,220,130)}),d=i,f=i,g=f,y=new tt({angle:45,stops:[{offset:0,color:w(241,133,255,255)},{offset:1,color:w(115,207,238,255)}]}),p=i,m=new V({color:w(61,94,110,100)}),S=new V({color:w(61,94,110,255)}),x=new V({color:w(61,94,110,40)}),b=i,v=new V({color:w(0,18,23,255)}),M=i,A=w(115,207,238,255),T=new V({color:w(0,17,22,240)}),E=i,I=w(0,38,48,255),C=w(0,0,0),P=t,k=w(150,150,150),F=w(19,57,93),B=w(50,50,50),_=w(0,17,48),L=w(200,200,200),D=[w(20,211,237,255),w(98,147,252,255),w(164,73,250,255),w(129,117,253,255),w(95,134,252,255),w(22,133,212,255),w(35,200,242,255),w(104,121,233,255),w(137,69,232,255),w(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(50),O=w(3,217,194,255),R=w(243,21,110,255),N={mapChartFillStyle:new tt({angle:135,stops:[{color:w(118,248,231,255),offset:0},{color:w(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Em(s,D,.5),pieChartSliceFillStylePalette:Im(s,D,2),funnelChartSliceFillStylePalette:Cm(s,D,1),pyramidChartSliceFillStylePalette:Cm(s,D,1),rectangleSeriesFillStyle:Pm(s,D),gaugeChartGaugeFillStyle:km(s,D,1),barChartBarFillStyle:Pm(s,D)},G=new V({color:w(20,211,237,255)}),H=new V({color:w(253,145,178,255)}),U=new V({color:w(20,211,237,255)}),W=new V({color:w(239,68,121,255)}),X=new V({color:w(20,211,237,120)}),Y=new V({color:w(239,68,121,180)}),j=new V({color:w(1,53,57,255)}),J=new V({color:w(94,19,42,255)}),$=[w(174,51,132,255),w(204,107,218,255),w(189,215,253,255)],q=[w(0,63,95,255),w(0,149,255,255),w(0,225,255,255),w(255,154,254,255),w(204,98,170,255),w(139,39,84,255)],K=[w(197,241,255,255),w(70,210,255,255),w(0,164,217,255),w(90,99,222,255),w(138,75,192,255),w(151,27,162,255)],Q=[w(13,31,52,255),w(129,54,130,255),w(131,108,176,255),w(7,162,213,255),w(26,247,255,255)],et=new Z({stops:[{color:w(219,42,235,60),offset:0},{color:w(237,73,252,10),offset:1}]}),it=new V({color:w(237,73,252,255)}),st=X.getColor().setA(255),rt=w(8,70,100);return wm({isDark:s,highlightColorOffset:w(60,60,60,60),highlightColorOffsetAxisOverlay:w(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new zo({source:Tm(t,"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:y,axisTickMajorFillStyle:p,axisGridMajorFillStyle:m,axisTickMinorFillStyle:S,axisGridMinorFillStyle:x,cursorGridFillStyle:b,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:A,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:I,uiBackgroundBorderColor:C,uiStrokeColorContrastHigh:P,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:F,dataStrokeColorContrastHigh:B,dataStrokeColorContrastMedium:_,dataStrokeColorContrastLow:L,dataColorPalette:D,dataColorPaletteInverted:[{area:w(41,130,255,100),border:w(45,110,240)}],dataHighlightOverlayColor:z,dataColorPositive:O,dataColorNegative:R,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:W,positiveAreaFillStyle:X,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:J,badGoodColorPalette:$,coldHotColorPalette:q,intensityColorPalette:K,spectrogramColorPalette:Q,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),zm={};Object.defineProperty(zm,"darkGold",{get:Fm,enumerable:!0}),Object.defineProperty(zm,"turquoiseHexagon",{get:Bm,enumerable:!0}),Object.defineProperty(zm,"light",{get:_m,enumerable:!0}),Object.defineProperty(zm,"lightNature",{get:Lm,enumerable:!0}),Object.defineProperty(zm,"cyberSpace",{get:Dm,enumerable:!0});const Om=zm,Rm=Om.darkGold,Vm=(t,e,i)=>s=>{const r={theme:Rm,...i,...s},n=t(r),o=e?cm(n):void 0,h=new Vf(n._n,s,n,n.G.bind(n),o);return n.jn((t=>h.mB(t))).$n((()=>h.Y())).Ss(),h},Nm=(t,e)=>{t.jn((t=>{e.Ae(t)})).$n((()=>e.Y())).Ss()},Gm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new Oh(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o);return Nm(n,h),h},Hm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new Wd(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s);return Nm(n,h),h},Um=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new ac(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s);return Nm(n,h),h},Wm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new pu(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s);return Nm(n,h),h},Xm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new(s&&s.type?s.type:aa)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s&&s.disableAnimations);return Nm(n,h),h},Ym=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new(s&&s.type?s.type:Ou)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s&&s.disableAnimations);return Nm(n,h),h},jm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new(s&&s.type?s.type:Eu)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s&&s.disableAnimations);return Nm(n,h),h},Jm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new(s&&s.type?s.type:Xu)(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,!(!s||!s.disableAnimations));return Nm(n,h),h},$m=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new xl(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,s,void 0);return Nm(n,h),h},qm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new Va(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s);return Nm(n,h),h},Zm=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new vf(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0);return Nm(n,h),h},Km=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Rm},n=t(r),o=e?cm(n):void 0,h=new Bf(n._n,qd(n,1).oF(0),ot,n.G.bind(n),o,void 0,s);return Nm(n,h),h};let Qm;const tS={None:Cn,Rectangle:Dn,Circle:zn,Diamond:On,Pointer:Rn},eS={Rectangle:Dn,Circle:zn,Diamond:On},iS={XY:Kl},sS={XY:Zl,Spider:nl,BarChart:ol,Map:al,Polar:nl},rS={None:Pn,UIRectangle:Dn,UICircle:zn,UIDiamond:On};e.Animation=Y,e.AnimationEasings=X,e.Animator=j,e.AreaRangeSeries=wd,e.AreaSeries=md,e.AreaSeriesBipolar=vd,e.AreaSeriesMonopolar=Sd,e.AreaSeriesNegative=bd,e.AreaSeriesPositive=xd,e.AreaSeriesTypes=Md,e.AutoCursor2DBuilder=tl,e.AutoCursorBuilders=sS,e.AutoCursorXYBuilder=$l,e.AutoFitStrategies=Ya,e.AutoFitStrategy=Ua,e.Axis=Zo,e.Axis3D=ya,e.AxisScrollStrategies=zs,e.AxisTickStrategies=Os,e.Band=Ls,e.BarChart=Bf,e.BarChartBar=Pf,e.BarChartCategoryAxis=If,e.BarChartSorting=_f,e.BarChartTypes={Horizontal:"horizontal",Vertical:"vertical"},e.BarChartValueAxis=Cf,e.BasicSeries=uu,e.BorderedPicture=Fn,e.BoxAndWhiskers=pc,e.BoxFigure=yc,e.BoxSeries=gd,e.BoxSeries3D=Ma,e.Button=eo,e.Chart=Vh,e.Chart3D=Va,e.ChartComponent=Gi,e.ChartMarker=eu,e.ChartMarker2D=class extends eu{constructor(t,e,i,s,r,n){super(t,e,i,s.Fx(t,e,i,n),r,n)}},e.ChartMarkerXY=su,e.ChartWithCursor=Sl,e.ChartWithSeries=ka,e.ChartXY=Wd,e.Color=M,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return w(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 w(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 w(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?T(t):T((t=>{const e=I[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),T("#fff")},e.ColorHEX=T,e.ColorHSV=E,e.ColorPalettes=wo,e.ColorRGBA=w,e.ColorShadingStyles=_o,e.ConstantLine=Ds,e.CursorBuilder=Qa,e.CursorBuilderXY=Jl,e.CustomTick=Sn,e.CustomizableFigure=fc,e.Dashboard=Vf,e.DashedLine=class extends Vo{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 this.set("thickness",t)}getThickness(){return this.get("thickness")}L(){const t=this.getThickness();return t<0?1:t}setPattern(t){return this.set("pattern",t)}getPattern(){return this.get("pattern")}setPatternScale(t){return this.set("patternScale",t)}getPatternScale(){return this.get("patternScale")}},e.DataGrid=vf,e.DateTimeTickStrategy=Sh,e.EllipseFigure=Jc,e.EllipseSeries=$c,e.EmptyFill=D,e.EmptyPointMarker=Pn,e.EmptyUIElement=In,e.Figure=cc,e.FigureSeries=dc,e.FontSettings=tr,e.FormattingFunctions=Ci,e.FunnelChart=Au,e.FunnelChartTypes=Cu,e.FunnelChartWithLabelsInsideSlices=Iu,e.FunnelChartWithLabelsOnSides=Eu,e.FunnelSlice=Su,e.GaugeChart=Fu,e.GaugeChartTypes=Am,e.GaugeSlice=_u,e.GenericAxis=$s,e.GlowEffect=Xo,e.HeatmapGridSeries=Cd,e.HeatmapGridSeriesIntensityValues=Pd,e.HeatmapScrollingGridSeries=kd,e.HeatmapScrollingGridSeriesIntensityValues=Fd,e.Highlighter=Hi,e.Icon=Ho,e.ImageFill=zo,e.IndividualPointFill=G,e.LUT=_,e.LegendBoxBuilders=vo,e.LineAndPointSeries3D=Aa,e.LineSeries=Gc,e.LineSeries3D=wa,e.LinearGradientFill=tt,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new tt({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=xl,e.MapRegions=Mm,e.MapRegionsAfrica=fm,e.MapRegionsAsia=gm,e.MapRegionsAustralia=ym,e.MapRegionsCanada=pm,e.MapRegionsEurope=mm,e.MapRegionsNorthAmerica=bm,e.MapRegionsSouthAmerica=vm,e.MapRegionsUSA=xm,e.MapRegionsWorld=Sm,e.MapTypes=ul,e.MarkerBuilders=iS,e.NumericTickStrategy=Th,e.OHLCBar=xc,e.OHLCCandleStick=Sc,e.OHLCFigure=mc,e.OHLCFigures=bc,e.OHLCSeries=ld,e.OHLCSeriesTraditional=ud,e.OHLCSeriesTypes=dd,e.OHLCSeriesWithAutomaticPacking=cd,e.OnScreenMenu=Ed,e.OnScreenMenuAnimationsButton=xs,e.OnScreenMenuButton=cs,e.OnScreenMenuControlBase=Zi,e.OnScreenMenuCustomButton=vs,e.OnScreenMenuOsmToggleButton=Ms,e.OnScreenMenuToggleButton=ds,e.OnScreenMenuZoomInButton=fs,e.OnScreenMenuZoomInXButton=gs,e.OnScreenMenuZoomInYButton=ys,e.OnScreenMenuZoomOutButton=ps,e.OnScreenMenuZoomOutXButton=ms,e.OnScreenMenuZoomOutYButton=Ss,e.OnScreenMenuZoomToFitButton=bs,e.PalettedFill=class extends U{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=Dh,e.PhongShadingStyle=Fo,e.Picture=kn,e.PieChart=Zh,e.PieChartTypes=ua,e.PieChartWithLabelsInsideSlices=la,e.PieChartWithLabelsOnSides=aa,e.PieSlice=Yh,e.PixelatedPoints3D=ar,e.PointCloudSeries3D=Ca,e.PointLineSeries=Tc,e.PointLineSeries3D=Ta,e.PointMarkers=rS,e.PointSeries=Td,e.PointSeries3D=Ia,e.PointSeriesTypes3D=Pa,e.PointStyle3D=ur,e.PolarAreaSeries=fu,e.PolarAreaSeriesInterior=gu,e.PolarAxis=Ml,e.PolarAxisAmplitude=wl,e.PolarAxisTick=Al,e.PolarChart=pu,e.PolarHeatmapSeries=Vl,e.PolarLineSeries=Gl,e.PolarPointLineSeries=Hl,e.PolarPointSeries=Ul,e.PolarPolygon=Wl,e.PolarPolygonSeries=du,e.PolarSector=Fl,e.PolarSeries=_l,e.PolygonFigure=Wc,e.PolygonSeries=Xc,e.PyramidChart=Hu,e.PyramidChartTypes=ju,e.PyramidChartWithLabelsInsideSlices=Yu,e.PyramidChartWithLabelsOnSides=Xu,e.PyramidSlice=Ru,e.RadialGauge=Bu,e.RadialGradientFill=Z,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new Z({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=yd,e.RectangleFigure=Hc,e.RectangleSeries=Uc,e.SegmentFigure=Yc,e.SegmentSeries=jc,e.Series2D=Bl,e.Series3D=va,e.SeriesMarkerXY=ru,e.SeriesXY=nu,e.SimpleFigureSeries=gc,e.SimpleShadingStyle=Po,e.Slice=Wh,e.SliceLabelFormatters=Uh,e.SliceSorters=Hh,e.SolidFill=V,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new V({color:s(t)})},e.SolidGauge=Ou,e.SolidGaugeSlice=Lu,e.SolidLine=$i,e.SpiderAxis=Ku,e.SpiderChart=ac,e.SpiderSeries=tc,e.SplineSeries=Cc,e.StaticCursor2DBuilder=el,e.StaticCursorXYBuilder=ql,e.StepSeries=Nc,e.StipplePatterns=Ro,e.SurfaceGridSeries3D=Da,e.SurfaceScrollingGridSeries3D=za,e.TableContentBuilder=ja,e.Themes=Om,e.Tick=qo,e.TickStyle=ih,e.TimeFormattingFunctions=Ch,e.TimeTickStrategy=kh,e.TriangulatedPoints3D=nr,e.UIBackgrounds=tS,e.UIButtonPictures=eS,e.UICircle=zn,e.UIColumnGrid=class extends Gn{constructor(){super(...arguments),this.Gc=[]}addColumn(){return this.addElement(Yn,void 0)}getColumn(t,e=!1){return e&&this.Gc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Gc[t]}},e.UIDiamond=On,e.UIElementBuilders=bo,e.UIElementColumn=Hn,e.UIElementLine=Nn,e.UIElementRow=Gn,e.UIElementWithBackground=pn,e.UIEmptyBackground=Cn,e.UILabel=_n,e.UILayoutBuilders=Na,e.UILayoutGap=Vn,e.UILegendBoxPanel=Ga,e.UIObject=cn,e.UIOrigins=ws,e.UIPanel=Oh,e.UIPointer=Rn,e.UIPolygon=Bn,e.UIRectangle=Dn,e.UIRowGrid=Wn,e.VisibleFill=R,e.VisibleTicks=sh,e.ZoomBandChart=$d,e.defaultOsmBackgroundColor=Bs,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=z,e.emptyLine=st,e.emptyPoints3D=sr,e.emptyTick=nh,e.formatLongitudeLatitude=vl,e.isColor=A,e.isCoordinate3D=Ra,e.isCoordinateBarChart=kf,e.isCoordinateClient=Oi,e.isCoordinatePolar=kl,e.isCoordinateXY=Vi,e.isDashedLine=No,e.isDateTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"date-time-ticks"!==t.type),e.isEmptyFill=t=>!!(t&&"object"==typeof t&&"type"in t&&"fillstyle"===t.type&&"fillType"in t&&"empty"===t.fillType),e.isEmptyTick=t=>!(!t||"object"!=typeof t||!("type"in t)||"empty-ticks"!==t.type),e.isFontSettings=er,e.isGlowEffect=t=>!(!t||"object"!=typeof t||!("type"in t)||"glow"!==t.type),e.isIcon=Uo,e.isIndividualPointFill=H,e.isLUT=t=>!(!t||"object"!=typeof t||!("type"in t)||"lut"!==t.type),e.isLinearGradientFill=et,e.isNumericTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"numeric-ticks"!==t.type),e.isPalettedFill=W,e.isPhongShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"phong"!==t.type),e.isPixelatedPoints3D=lr,e.isRadialGradientFill=K,e.isSimpleShadingStyle=t=>!(!t||"object"!=typeof t||!("type"in t)||"simple"!==t.type),e.isSolidFill=N,e.isSolidLine=qi,e.isTimeTickStrategy=t=>!(!t||"object"!=typeof t||!("type"in t)||"time-ticks"!==t.type),e.isTriangulatedPoints3D=or,e.isVisibleTicks=rh,e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,r="object"==typeof t?t:void 0,n=new Zp;return n.e=i||"",Qm||(Qm=(t=>{let e,i,s=!1,r=!1,n=!1,o=!1,h="";try{if(jp){const e=(t=>{if(!jp)return;const e=jp.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";default:return}})();if("0001"===e){qp=new Uint8Array([2]);const e=(t=>{if(!jp)return;const e=jp.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();1===e?(n=!om(jp),s=!0):2===e?(hm(jp,t),r=!0):(Kp=!0,sm(jp),o=!0)}else{if("0002"!==e)throw new Error(Yp(0,0,1,7,1,12,5));{const e=(t=>{if(!jp)return;const e=jp.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)Kp=!0,sm(jp),o=!0;else if(189===e)n=!om(jp),s=!0;else{if(159!==e)throw new Error(Yp(0,0,1,7,1,12,5));hm(jp,t),r=!0}}}}else $p=!0}catch(t){t instanceof Error&&(e=t)}try{o&&(i=Xp[Yp(-1,34)][Yp(-1,35)](Yp(-1,39))||void 0)}catch(t){Xp.console.error(t)}let a=!1;if(i){const t=i.split("-");if(2===t.length&&nm(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(a=!0)}}const l=!(e||$p||s||r||a),u=(()=>{const t=new(Xp[Yp(-1,0)]);return t.open(Yp(0,26),Yp(-2,0)),t.setRequestHeader(Yp(-1,24),Yp(-1,25)),t.withCredentials=!0,t})();if(l){let t;try{t=parseInt(jp?jp.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const i=Math.floor(1e6*Math.random());h=(t^i).toString();const s={};let r="",n="",o="";jp=jp||"";const a=Yp(-4,0);for(let t=0;t{if(e)throw am(e.message,t),e;const s={Mn:t=>{const e=`${Yp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${(t=>{switch(t){case 1:return Yp(0,48,49);case 0:return Yp(0,48,50);case 2:return Yp(0,51);case 3:return Yp(0,52,48);case 4:return Yp(0,53,48);case 5:return Yp(0,54,48);case 6:return Yp(0,55,48);case 7:return Yp(0,56,48);case 8:return Yp(0,57,48);case 9:return Yp(0,58,48)}return Me(0,"")})(t)}`;throw am(e,r,!1),new Error(e)},...Jp},r=new cp(t,s),o=t=>{if("error"===(null==t?void 0:t.type)&&i){const t=i.split("-");if(2===t.length&&nm(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return Kp=!1,void lm(u,!1,a)}}if(u.readyState===Xp[Yp(-1,0)].DONE){if(200!==u.status){let e="";try{e=t&&"loadend"!==t.type?Yp(0,0,1,23,1,32,1,24,5):JSON.parse(u[Yp(-1,23)]).message,lm(u,!1,a)}catch(t){console.error(t)}throw am(e,r),new Error(Yp(0,0,1,2,1,7,1,12,5)+e)}{const t=JSON.parse(u[Yp(-1,23)]);if(!nm(h+Yp(-3,0),t.h)){const t=Yp(0,0,1,27,1,28,1,29,1,30,1,31,5);throw am(t,r),new Error(t)}Xp[Yp(-1,34)][Yp(-1,36)](Yp(-1,39),t.t),Xp[Yp(-1,34)][Yp(-1,36)](Yp(-1,33),t.s),Kp=!1}}},a=t=>{o(t)};return lm(u,!0,a),l?setTimeout((()=>{if(Kp){let t=!0;if(i){const e=i.split("-");if(2===e.length&&nm(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&am(Yp(0,25,1,23,1,32,1,24,5),r)}}),1e4):lm(u,!1,a),n?(t=>{let e;Kp=!1;const i=t.Ht(),s=()=>{e&&(t.en(e.sn()),e=void 0),e=t.rF("deployment test"),e.Sr(t.ct).Ch(Yp(0,34,1,33)).we({x:i.x/2,y:i.y/2}).ea(50).Ph(13).Me(new V({color:w(128,128,128,100)})).ia("Arial").ra(500).setMouseInteractions(!1),t.Jr().Qr()};t.lo((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.sn()({Dashboard:Vm(t,e,i),ChartXY:Hm(t,e,i),Spider:Um(t,e,i),Polar:Wm(t,e,i),Pie:Xm(t,e,i),UIPanel:Gm(t,e,i),Gauge:Ym(t,e,i),Funnel:jm(t,e,i),Pyramid:Jm(t,e,i),Chart3D:qm(t,e,i),Map:$m(t,e,i),DataGrid:Zm(t,e,i),BarChart:Km(t,e,i)}))(Qm,n.e,r)},e.onScreenMenuControlBaseHeight=Is,e.onScreenMenuControlBaseWidth=Cs,e.onScreenMenuControlOpacity=Ps,e.onScreenMenuDefaultButtonShape=Fs,e.onScreenMenuSpriteURL=ks,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=Fh,e.synchronizeAxisIntervals=lt,e.translatePoint=at,e.translatePoint3D=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.Fm.GS(t);if("world"===e.id&&"axes"===i.id)return e.chart.Fm.WS(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")},e.transparentFill=Ts,e.transparentLine=Es,e.vec3Utils=Ce,e.xDimensionStrategy=Ko,e.yDimensionStrategy=Qo}}]); \ No newline at end of file diff --git a/js/vendor.dbb0dca8faeafa463e66.bundle.js.LICENSE.txt b/js/vendor.d0bc38925540cdb42af4.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.dbb0dca8faeafa463e66.bundle.js.LICENSE.txt rename to js/vendor.d0bc38925540cdb42af4.bundle.js.LICENSE.txt diff --git a/js/vendor.dbb0dca8faeafa463e66.bundle.js b/js/vendor.dbb0dca8faeafa463e66.bundle.js deleted file mode 100644 index 3595ceb..0000000 --- a/js/vendor.dbb0dca8faeafa463e66.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.dbb0dca8faeafa463e66.bundle.js.LICENSE.txt */ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[736],{102:(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:()=>v,createOHLCGenerator:()=>x,createParametricFunctionGenerator:()=>D,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>k,createSpectrumDataGenerator:()=>I,createTraceGenerator:()=>m,createWaterDropDataGenerator:()=>O,createWhiteNoiseGenerator:()=>M});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}())}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 p({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var p=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 m(){return new y({numberOfPoints:1e3})}var y=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 v(){return new b({numberOfPoints:1e3,minGap:1,maxGap:-1,minAmplitude:.1,maxAmplitude:1,probability:.02})}var b=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 M(){return new A({numberOfPoints:1e3})}var A=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 k(){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 D(){return new E({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 E=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),T={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function I(){return new C(T)}var C=function(t){function e(e){var i=t.call(this,e)||this,s={sampleSize:void 0!==e.sampleSize?e.sampleSize:T.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:T.numberOfSamples,variation:void 0!==e.variation?e.variation:T.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:T.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:T.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:T.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,p=e/3*2,m=p/(f*f)*this.options.narrowFactor1,y=50/(f*f)*this.options.narrowFactor2;for(a=0;ae&&(l=e),(u=50-(d=.8*a-o)*d*y)<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),P={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function O(){return new F(P)}var F=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:P.rows,columns:void 0!==t.columns?t.columns:P.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:P.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:P.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:P.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:P.offsetLevel,volatility:void 0!==t.volatility?t.volatility:P.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,p,m,y,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&&p%1e3==0&&Date.now()-g>=15?[4,new Promise((function(t){return setTimeout(t,0)}))]:[3,4]):[3,5];case 3:v.sent(),g=Date.now(),v.label=4;case 4:return x++,S+=d,[3,2];case 5:return m++,y+=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}()},187:t=>{function e(t,e,s){s=s||2;var n,o,h,a,c,d,g,p=e&&e.length,m=p?e[0]*s:t.length,y=i(t,0,m,s,!0),x=[];if(!y||y.next===y.prev)return x;if(p&&(y=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(y,x,s,n,o,g,0),x}function i(t,e,i,s,r){var n,o;if(r===D(t,e,i,s)>0)for(n=e;n=e;n-=s)o=A(n,t[n],t[n+1],o);return o&&y(o,o.next)&&(k(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,s=t;do{if(i=!1,s.steiner||!y(s,s.next)&&0!==m(s.prev,s,s.next))s=s.next;else{if(k(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,p,m=t;t.prev!==t.next;)if(g=t.prev,p=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(p.i/i|0),k(t),t=p.next,m=p.next;else if((t=p)===m){f?1===f?r(t=h(s(t),e,i),e,i,l,u,c,2):2===f&&a(t,e,i,l,u,c):r(s(t),e,i,l,u,c,1);break}}}function n(t){var e=t.prev,i=t,s=t.next;if(m(e,i,s)>=0)return!1;for(var r=e.x,n=i.x,o=s.x,h=e.y,a=i.y,l=s.y,u=rn?r>o?r:o:n>o?n:o,f=h>a?h>l?h:l:a>l?a:l,p=s.next;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=c&&p.y<=f&&g(r,h,n,a,o,l,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(m(r,n,o)>=0)return!1;for(var h=r.x,a=n.x,l=o.x,u=r.y,c=n.y,f=o.y,p=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,v=d(p,y,e,i,s),b=d(x,S,e,i,s),M=t.prevZ,A=t.nextZ;M&&M.z>=v&&A&&A.z<=b;){if(M.x>=p&&M.x<=x&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;if(M=M.prevZ,A.x>=p&&A.x<=x&&A.y>=y&&A.y<=S&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&m(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;M&&M.z>=v;){if(M.x>=p&&M.x<=x&&M.y>=y&&M.y<=S&&M!==r&&M!==o&&g(h,u,a,c,l,f,M.x,M.y)&&m(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;A&&A.z<=b;){if(A.x>=p&&A.x<=x&&A.y>=y&&A.y<=S&&A!==r&&A!==o&&g(h,u,a,c,l,f,A.x,A.y)&&m(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function h(t,e,i){var r=t;do{var n=r.prev,o=r.next.next;!y(n,o)&&x(n,r,r.next,o)&&b(n,o)&&b(o,n)&&(e.push(n.i/i|0),e.push(r.i/i|0),e.push(o.i/i|0),k(r),k(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&&p(a,l)){var u=M(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=M(i,t);return s(r,r.next),s(i,i.next)}function c(t,e){return m(t.prev,t,e.prev)<0&&m(e.next,t,t.next)<0}function d(t,e,i,s,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function f(t){var e=t,i=t;do{(e.x=(t-o)*(n-h)&&(t-o)*(s-h)>=(i-o)*(e-h)&&(i-o)*(n-h)>=(r-o)*(s-h)}function p(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)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,s=!1,r=(t.x+e.x)/2,n=(t.y+e.y)/2;do{i.y>n!=i.next.y>n&&i.next.y!==i.y&&r<(i.next.x-i.x)*(n-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next}while(i!==t);return s}(t,e)&&(m(t.prev,t,e.prev)||m(t,e.prev,e))||y(t,e)&&m(t.prev,t,t.next)>0&&m(e.prev,e,e.next)>0)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=v(m(t,e,i)),n=v(m(t,e,s)),o=v(m(i,s,t)),h=v(m(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 v(t){return t>0?1:t<0?-1:0}function b(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function M(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 A(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 k(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 D(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}},369:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>w,Iterable:()=>Es,List:()=>ai,Map:()=>Le,OrderedMap:()=>Mi,OrderedSet:()=>ls,PairSorting:()=>gs,Range:()=>ji,Record:()=>ps,Repeat:()=>Ms,Seq:()=>K,Set:()=>Gi,Stack:()=>Ti,default:()=>Ts,fromJS:()=>As,get:()=>ae,getIn:()=>Yi,has:()=>he,hasIn:()=>Zi,hash:()=>yt,is:()=>ft,isAssociative:()=>k,isCollection:()=>S,isImmutable:()=>F,isIndexed:()=>A,isKeyed:()=>b,isList:()=>hi,isMap:()=>ut,isOrdered:()=>B,isOrderedMap:()=>ct,isOrderedSet:()=>Bi,isPlainObject:()=>re,isRecord:()=>O,isSeq:()=>C,isSet:()=>Ri,isStack:()=>Ei,isValueObject:()=>dt,merge:()=>ke,mergeDeep:()=>De,mergeDeepWith:()=>Ee,mergeWith:()=>we,remove:()=>ue,removeIn:()=>me,set:()=>ce,setIn:()=>ge,update:()=>xe,updateIn:()=>de,version:()=>Ds});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&&!y(t)||void 0!==i&&t<=-i)&&(void 0===e||void 0!==i&&e>=i)}function g(t,e){return m(t,e,0)}function p(t,e){return m(t,e,e)}function m(t,e,i){return void 0===t?i:y(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function y(t){return t<0||0===t&&1/t==-1/0}var x="@@__IMMUTABLE_ITERABLE__@@";function S(t){return Boolean(t&&t[x])}var v="@@__IMMUTABLE_KEYED__@@";function b(t){return Boolean(t&&t[v])}var M="@@__IMMUTABLE_INDEXED__@@";function A(t){return Boolean(t&&t[M])}function k(t){return b(t)||A(t)}var w=function(t){return S(t)?t:K(t)},D=function(t){function e(t){return b(t)?t:J(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),E=function(t){function e(t){return A(t)?t:Q(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w),T=function(t){function e(t){return S(t)&&!k(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(w);w.Keyed=D,w.Indexed=E,w.Set=T;var I="@@__IMMUTABLE_SEQ__@@";function C(t){return Boolean(t&&t[I])}var P="@@__IMMUTABLE_RECORD__@@";function O(t){return Boolean(t&&t[P])}function F(t){return S(t)||O(t)}var R="@@__IMMUTABLE_ORDERED__@@";function B(t){return Boolean(t&&t[R])}var z=0,_=1,L=2,G="function"==typeof Symbol&&Symbol.iterator,V="@@iterator",N=G||V,W=function(t){this.next=t};function H(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 U(){return{value:void 0,done:!0}}function X(t){return!!Array.isArray(t)||!!$(t)}function j(t){return t&&"function"==typeof t.next}function Y(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(G&&t[G]||t[V]);if("function"==typeof e)return e}W.prototype.toString=function(){return"[Iterator]"},W.KEYS=z,W.VALUES=_,W.ENTRIES=L,W.prototype.inspect=W.prototype.toSource=function(){return this.toString()},W.prototype[N]=function(){return this};var Z=Object.prototype.hasOwnProperty;function q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var K=function(t){function e(t){return null==t?nt():F(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 W((function(){if(r===s)return{value:void 0,done:!0};var n=i[e?s-++r:r++];return H(t,n[0],n[1])}))}return this.__iteratorUncached(t,e)},e}(w),J=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?b(t)?t.toSeq():t.fromEntrySeq():O(t)?t.toSeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(K),Q=function(t){function e(t){return null==t?nt():S(t)?b(t)?t.entrySeq():t.toIndexedSeq():O(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}(K),tt=function(t){function e(t){return(S(t)&&!k(t)?t:Q(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(K);K.isSeq=C,K.Keyed=J,K.Set=tt,K.Indexed=Q,K.prototype[I]=!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 W((function(){if(r===s)return{value:void 0,done:!0};var n=e?s-++r:r++;return H(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 W((function(){if(n===r)return{value:void 0,done:!0};var o=s[e?r-++n:n++];return H(t,o,i[o])}))},e}(J);it.prototype[R]=!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=Y(this._collection),s=0;if(j(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=Y(this._collection);if(!j(i))return new W(U);var s=0;return new W((function(){var e=i.next();return e.done?e:H(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 q(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)&&B(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 pt(t){return t>>>1&1073741824|3221225471&t}var mt=Object.prototype.valueOf;function yt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return pt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==mt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return pt(e)}(r);case"string":return r.length>Tt?(void 0===(s=Pt[i=r])&&(s=St(i),Ct===It&&(Ct=0,Pt={}),Ct++,Pt[i]=s),s):St(r);case"object":case"function":return function(t){var e;if(kt&&void 0!==(e=At.get(t)))return e;if(void 0!==(e=t[Et]))return e;if(!bt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Et]))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=Mt(),kt)At.set(t,e);else{if(void 0!==vt&&!1===vt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(bt)Object.defineProperty(t,Et,{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[Et]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Et]=e}}return e}(r);case"symbol":return function(t){var e=wt[t];return void 0!==e||(e=Mt(),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===_||t.done?t:H(e,a-1,e===z?void 0:t.value[1],t)}))},l}function Nt(t,e,i,s){var r=qt(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(L,n),a=!0,l=0;return new W((function(){var t,n,u;do{if((t=h.next()).done)return s||r===_?t:H(r,l++,r===z?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===L?t:H(r,n,u,t)}))},r}function Wt(t,e,i){var s=qt(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 jt(t,e,i,s){var r=qt(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(_,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),Y(r?t.reverse():t)})),o=0,h=!1;return new W((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}:H(t,o++,e.apply(null,i.map((function(t){return t.value}))))}))},r}function Yt(t,e){return t===e?t:C(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Zt(t){return b(t)?D:A(t)?E:T}function qt(t){return Object.create((b(t)?J:A(t)?Q:tt).prototype)}function Kt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):K.prototype.cacheResult.call(this)}function Jt(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 Ae(this,e,t)}function Ae(t,e,i){for(var s=[],r=0;r0;)e[i]=arguments[i+1];return Ie(t,e)}function we(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Ie(e,i,t)}function De(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Te(t,e)}function Ee(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Te(e,i,t)}function Te(t,e,i){return Ie(t,e,function(t){return function e(i,s,r){return ne(i)&&ne(s)&&(n=s,o=K(i),h=K(n),A(o)===A(h)&&b(o)===b(h))?Ie(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function Ie(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(F(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?E:D,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 Te(this,e,t)}function Oe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Ie(t,e)}))}function Fe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,qe(),(function(t){return Te(t,e)}))}function Re(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Be(){return this.__ownerID?this:this.__ensureOwner(new l)}function ze(){return this.__ensureOwner()}function _e(){return this.__altered}var Le=function(t){function e(e){return null==e?qe():ut(e)&&!B(e)?e:qe().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 qe().withMutations((function(e){for(var i=0;i=t.length)throw new Error("Missing value for key: "+t[i]);e.set(t[i],t[i+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,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):qe()},e.prototype.sort=function(t){return Mi(Ht(this,t))},e.prototype.sortBy=function(t,e){return Mi(Ht(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 je(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?qe():(this.__ownerID=t,this.__altered=!1,this)},e}(D);Le.isMap=ut;var Ge=Le.prototype;Ge[lt]=!0,Ge[s]=Ge.remove,Ge.removeAll=Ge.deleteAll,Ge.setIn=pe,Ge.removeIn=Ge.deleteIn=ye,Ge.update=Se,Ge.updateIn=ve,Ge.merge=Ge.concat=be,Ge.mergeWith=Me,Ge.mergeDeep=Ce,Ge.mergeDeepWith=Pe,Ge.mergeIn=Oe,Ge.mergeDeepIn=Fe,Ge.withMutations=Re,Ge.wasAltered=_e,Ge.asImmutable=ze,Ge["@@transducer/init"]=Ge.asMutable=Be,Ge["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ge["@@transducer/result"]=function(t){return t.asImmutable()};var Ve=function(t,e){this.ownerID=t,this.entries=e};Ve.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 Ue(t,yt(i),[i,s]),n=0;n>>t)&o),h=this.bitmap;return 0==(h&n)?s:this.nodes[ei(h&n-1)].get(t+r,e,i,s)},Ne.prototype.update=function(t,e,i,s,a,l,u){void 0===i&&(i=yt(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 We(t,o+1,h)}(t,m,f,c,x);if(g&&!x&&2===m.length&&Qe(m[1^p]))return m[1^p];if(g&&x&&1===m.length&&Qe(x))return x;var S=t&&t===this.ownerID,v=g?x?f:f^d:f|d,b=g?x?ii(m,p,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},We.prototype.update=function(t,e,i,s,n,a,l){void 0===i&&(i=yt(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=Je(f,t,e+r,i,s,n,a,l);if(g===f)return this;var p=this.count;if(f){if(!g&&--p>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new Ue(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=pi();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>=vi(t._capacity)?s=mi(s,t.__ownerID,0,e,i,n):r=mi(r,t.__ownerID,t._level,e,i,n),n.value?t.__ownerID?(t._root=r,t._tail=s,t.__hash=void 0,t.__altered=!0,t):gi(t._origin,t._capacity,t._level,r,s):t}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pi()},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=yi(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=yi(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=vi(s),h=t._tail;return function t(a,l,u){return 0===l?function(t,r){var a=r===o?h&&h.array:t&&t.array,l=r>i?0:i-r,u=s-r;return u>n&&(u=n),function(){if(l===u)return di;var t=e?--u:l++;return a&&a[t]}}(a,u):function(o,h,a){var l,u=o&&o.array,c=a>i?0:i-a>>h,d=1+(s-a>>h);return d>n&&(d=n),function(){for(;;){if(l){var i=l();if(i!==di)return i;l=null}if(c===d)return di;var s=e?--d:c++;l=t(u&&u[s],h-r,a+(s<>>i&o,c=t&&u0){var d=t&&t.array[u],f=mi(d,e,i-r,s,n,h);return f===d?t:((l=yi(t,e)).array[u]=f,l)}return c&&t.array[u]===n?t:(h&&a(h),l=yi(t,e),void 0===n&&u===l.array.length-1?l.array.pop():l.array[u]=n,l)}function yi(t,e){return e&&t&&e===t.ownerID?t:new ui(t?t.array.slice():[],e)}function xi(t,e){if(e>=vi(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=vi(h),p=vi(u);p>=1<g?new ui([],s):m;if(m&&p>g&&ar;S-=r){var v=g>>>S&o;x=x.array[v]=yi(x.array[v],s)}x.array[g>>>r&o]=m}if(u=p)a-=p,u-=p,c=r,d=null,y=y&&y.removeBefore(s,0,a);else if(a>n||p>>c&o;if(b!==p>>>c&o)break;b&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&p>>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):Ai(s,r)}Mi.isOrderedMap=ct,Mi.prototype[R]=!0,Mi.prototype[s]=Mi.prototype.remove;var Di="@@__IMMUTABLE_STACK__@@";function Ei(t){return Boolean(t&&t[Di])}var Ti=function(t){function e(t){return null==t?Oi():Ei(t)?t:Oi().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):Pi(e,i)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Ei(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):Pi(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):Oi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(p(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):Pi(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Pi(this.size,this._head,t,this.__hash):0===this.size?Oi():(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 W((function(){if(s){var e=s.value;return s=s.next,H(t,i++,e)}return{value:void 0,done:!0}}))},e}(E);Ti.isStack=Ei;var Ii,Ci=Ti.prototype;function Pi(t,e,i,s){var r=Object.create(Ci);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Oi(){return Ii||(Ii=Pi(0))}Ci[Di]=!0,Ci.shift=Ci.pop,Ci.unshift=Ci.push,Ci.unshiftAll=Ci.pushAll,Ci.withMutations=Re,Ci.wasAltered=_e,Ci.asImmutable=ze,Ci["@@transducer/init"]=Ci.asMutable=Be,Ci["@@transducer/step"]=function(t,e){return t.unshift(e)},Ci["@@transducer/result"]=function(t){return t.asImmutable()};var Fi="@@__IMMUTABLE_SET__@@";function Ri(t){return Boolean(t&&t[Fi])}function Bi(t){return Ri(t)&&B(t)}function zi(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||b(t)!==b(e)||A(t)!==A(e)||B(t)!==B(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!k(t);if(B(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 _i(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 Li(t){if(!t||"object"!=typeof t)return t;if(!S(t)){if(!ne(t))return t;t=K(t)}if(b(t)){var e={};return t.__iterate((function(t,i){e[i]=Li(t)})),e}var i=[];return t.__iterate((function(t){i.push(Li(t))})),i}var Gi=function(t){function e(e){return null==e?Ui():Ri(e)&&!B(e)?e:Ui().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(D(t).keySeq())},e.intersect=function(t){return(t=w(t).toArray()).length?Ni.intersect.apply(e(t.pop()),t):Ui()},e.union=function(t){return(t=w(t).toArray()).length?Ni.union.apply(e(t.pop()),t):Ui()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Wi(this,this._map.set(t,t))},e.prototype.remove=function(t){return Wi(this,this._map.remove(t))},e.prototype.clear=function(){return Wi(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Wi(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|0)^t)^e>>>16,2246822507),e=pt((e=gt(e^e>>>13,3266489909))^e>>>16)}(t.__iterate(i?e?function(t,e){s=31*s+as(yt(t),yt(e))|0}:function(t,e){s=s+as(yt(t),yt(e))|0}:e?function(t){s=31*s+yt(t)|0}:function(t){s=s+yt(t)|0}),s)}(this))}});var Ki=w.prototype;Ki[x]=!0,Ki[N]=Ki.values,Ki.toJSON=Ki.toArray,Ki.__toStringMapper=oe,Ki.inspect=Ki.toSource=function(){return this.toString()},Ki.chain=Ki.flatMap,Ki.contains=Ki.includes,_i(D,{flip:function(){return Yt(this,zt(this))},mapEntries:function(t,e){var i=this,s=0;return Yt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Yt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var Ji=D.prototype;Ji[v]=!0,Ji[N]=Ki.entries,Ji.toJSON=qi,Ji.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},_i(E,{toKeyedSeq:function(){return new Ot(this,!1)},filter:function(t,e){return Yt(this,Gt(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 Yt(this,Lt(this,!1))},slice:function(t,e){return Yt(this,Vt(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 Yt(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 Yt(this,Wt(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)|0}ts.has=Ki.includes,ts.contains=ts.includes,ts.keys=ts.values,_i(J,Ji),_i(Q,Qi),_i(tt,ts);var ls=function(t){function e(t){return null==t?fs():Bi(t)?t:fs().withMutations((function(e){var i=T(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(D(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Gi);ls.isOrderedSet=Bi;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(ki()))}cs[R]=!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},ps=function(t,e){var i;!function(t){if(O(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(F(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 ks(t,e,i,s,r,n){if("string"!=typeof i&&!F(i)&&(q(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,K(i).map((function(s,n){return ks(t,e,s,n,r,i)})),r&&r.slice());return t.pop(),r&&r.pop(),o}return i}function ws(t,e){return A(e)?e.toList():b(e)?e.toMap():e.toSet()}var Ds="4.3.0",Es=w;const Ts={version:Ds,Collection:w,Iterable:w,Seq:K,Map:Le,OrderedMap:Mi,List:ai,Stack:Ti,Set:Gi,OrderedSet:ls,PairSorting:gs,Record:ps,Range:ji,Repeat:Ms,is:ft,fromJS:As,hash:yt,isImmutable:F,isCollection:S,isKeyed:b,isIndexed:A,isAssociative:k,isOrdered:B,isValueObject:dt,isPlainObject:re,isSeq:C,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ei,isSet:Ri,isOrderedSet:Bi,isRecord:O,get:ae,getIn:Yi,has:he,hasIn:Zi,merge:ke,mergeDeep:De,mergeWith:we,mergeDeepWith:Ee,remove:ue,removeIn:me,set:ce,setIn:ge,update:xe,updateIn:de}},475:(t,e,i)=>{Object.defineProperty(e,"i",{value:!0});var s=i(369),r=i(102),n=i(187),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}l(){return this.o}}class l extends a{constructor(t,e){super(),this.u=t,this.o=e}S(t){return t!==this.u&&(this.u=t,this.o=!0),this}M(){return this.u}l(){return super.l()}}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]},p=(t,e)=>({min:t,max:e}),m=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),y=(t,e=!0)=>new l(t,e),x=(t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}),S=x,v=(t,e)=>({left:void 0!==e.left?e.left:t.left,top:void 0!==e.top?e.top:t.top,right:void 0!==e.right?e.right:t.right,bottom:void 0!==e.bottom?e.bottom:t.bottom}),b=s.Record({r:1,g:1,b:1,a:1});class M extends b{constructor(t){super(t)}toString(){return`color:${this.r},${this.g},${this.b},${this.a}`}setA(t){return this.set("a",t/255)}setR(t){return this.set("r",t/255)}setG(t){return this.set("g",t/255)}setB(t){return this.set("b",t/255)}getA(){return 255*this.get("a")}getR(){return 255*this.get("r")}getG(){return 255*this.get("g")}getB(){return 255*this.get("b")}getHighlight(){return this._||(this._=new M({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._}getLighter(){return this.C||(this.C=new M({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.C}getDarker(){return this.T||(this.T=new M({r:this.r-.4*(1-this.r),g:this.g-.4*(1-this.g),b:this.b-.4*(1-this.b),a:this.a})),this.T}toRGBAString(){return`rgba( ${255*this.r}, ${255*this.g}, ${255*this.b}, ${255*this.a} )`}}const A=(t,e,i,s=255)=>new M({r:t/255,g:e/255,b:i/255,a:s/255}),k=t=>{const e=t.startsWith("#")?t.substring(1):t.startsWith("0x")?t.substr(2):t;switch(e.length){case 8:return new M({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 M({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 M({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 M({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}`)}},w=(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 M({r:s,g:r,b:n})},D={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},E=new M({}),T=A(0,0,0,0),I=(t,e)=>t.value-e.value,C=s.Record({steps:[],title:"",units:"",interpolate:!0,color:A(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1}),P=t=>{const{steps:e}=t,i=e.length;e.sort(I);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 O extends C{constructor(t){super(((t,e)=>({steps:t.steps,title:t.title,units:t.units,interpolate:t.interpolate,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.map((t=>`${t.value},${t.color.toString()}`)).join(",")}`}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")}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 M({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 F=s.Record({});class R extends F{constructor(){super(...arguments),this.type="fillstyle"}toString(){return"emptyFill"}}const B=new R,z=s.Record({color:A(255,255,255)});class _ extends z{constructor(){super(...arguments),this.type="fillstyle"}}class L extends _{constructor(t){super(t)}toString(){return`solidFill:${this.color.toString()}`}setColor(t){return t instanceof M?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))}}class G extends _{constructor(t){super(t)}toString(){return`individualPointFill:${this.color.toString()}`}setFallbackColor(t){return t instanceof M?this.set("color",t):this.set("color",t(this.get("color")))}getFallbackColor(){return this.get("color")}}const V=s.Record({lut:new O({steps:[]}),lookUpProperty:"value"});class N extends V{constructor(t){super(t),this.type="fillstyle"}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")}}const W={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=te(t);return(i,s,r)=>{const n=e(i),o=e(s);return e=>e(this.delta===this.duration||this.F)&&0===this.nextAnimations.length,this.values=t,this.action=e,this.duration=i,this.easing=s,this.D=n,this.eases=t.map((([t,e])=>s(t,e,i)))}O(){this.P.emit("start")}start(){return this.D.includes(this)||this.D.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 H(t,e,i,s,this.D);return this.nextAnimations.push(r),r}onAnimationStart(t,e){return this.P.on("start",t,e)}onAnimationEnd(t,e){return this.P.on("end",t,e)}onEveryAnimationEnd(t,e){return this.P.on("everyEnd",t,e)}onAllAnimationEnd(t,e){return this.P.on("allEnd",t,e)}allOffAnimationEnd(){return this.P.topicOff("end"),this}allOffEveryAnimationEnd(){return this.P.topicOff("everyEnd"),this}allOffAllAnimationEnd(){return this.P.topicOff("allEnd"),this}offAnimationEnd(t){return this.P.off(t,"end")}offEveryAnimationEnd(t){return this.P.off(t,"everyEnd")}offAllAnimationEnd(t){return this.P.off(t,"allEnd")}finish(t=!0){if(this.F=!0,this.D.splice(this.D.indexOf(this),1),this.nextAnimations.length>0){const e=this.nextAnimations[0];return t&&(this.P.listeners("allEnd").forEach(((t,i)=>e.onAllAnimationEnd(t,i))),this.P.listeners("everyEnd").forEach(((t,i)=>e.onEveryAnimationEnd(t,i)))),e.addNextAnimations(this.nextAnimations.slice(1)),e.start(),t&&(this.P.emit("end",e),this.P.emit("everyEnd",e)),e}t&&(this.P.emit("end",void 0),this.P.emit("everyEnd",void 0),this.P.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(bt):this.values.map(bt)}getTimeUntilFinish(){let t=this.duration-this.delta;for(let e=0;e{e>60&&console.log("Note: Animator FPS is usually capped at 60 by the browser!");const i=[];let s,r,n=0;const o=()=>{s=void 0;const h=Date.now();r=r||h,n=h-r,n/1e3>=1/e&&(r=Date.now()-n%(1e3/e),i.forEach((t=>{0===t.delta&&t.O(),t.delta+=n-n%(1e3/e),t.delta>t.duration&&(t.delta=t.duration),t.action(t.eases.map((e=>e(t.delta)))),t.delta===t.duration&&t.finish()})),t()),i.length>0?s=mt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=W.linear)=>(r,n,h=t)=>{const a=new H(r,n,h,e,i).start();return s||(s=mt.requestAnimationFrame(o)),a}};var X,j;e.GradientShape=void 0,(X=e.GradientShape||(e.GradientShape={})).circle="circle",X.ellipse="ellipse",e.GradientExtent=void 0,(j=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",j.closestCorner="closest-corner",j.farthestSide="farthest-side",j.farthestCorner="farthest-corner";const Y=s.Record({stops:[{color:k("#f00"),offset:0},{color:k("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class $ extends Y{constructor(t){if(super(t),this.type="fillstyle",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 Z=s.Record({stops:[{color:k("#f00"),offset:0},{color:k("#0f0"),offset:1}],angle:0});class q extends Z{constructor(t){if(super(t),this.type="fillstyle",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?ai(t):t)}getAngle(t){return t?hi(this.get("angle")):this.get("angle")}}const K=s.Record({}),J=new class extends K{constructor(){super(...arguments),this.type="linestyle",this.lineType="empty",this.thickness=0}setThickness(t){return this}getThickness(){return 0}L(){return 0}setFillStyle(t){return this}getFillStyle(){return B}},Q=s.Record({fillStyle:new L({color:A(255,255,255)}),thickness:1});class tt extends Q{constructor(t){super(t),this.type="linestyle",this.lineType="solid"}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")}L(){const t=this.getThickness();return t<0?1:t}}class et{constructor(t,e,i,s){this.cellIndex=t,this.cellSpan=e,this.cellsAmount=i,this.observedAmount=s,this.x=new it,this.y=new it,this.z=new it,this.P=new r.Eventer;const n={...t},o={...e};if(s){const t=t=>{this.cellsAmount.x=t.reduce(Oe,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(Oe,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.N(e),s.y.N(r)}}}G(){return this.V&&(this.V(),this.V=void 0),this}W(t){return this.P.on("cell-resize",t)}H(t){return this.P.off(t,"cell-resize")}}class it extends a{constructor(){super(...arguments),this.U=0,this.$=10,this.Y=1}X(){return this.o=!1,this}j(){return this.o=!0,this}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.getInnerEnd()-this.getInnerStart())}Z(t,e){return this.U=t,this.$=e,this.K(),this}q(t){return this.Y=t,this.K(),this}J(t){return t/this.Y}K(){const t=this.J(this.$-this.U),e=this.Y;void 0!==this.tt&&!1!==kt(t,this.tt)||(this.o=!0,this.it=e,this.tt=t)}st(){return this.tt}et(){return this.it}ht(){return this.$new t.scale1DConstructor(0,1,1,void 0),d2:t=>(new t.scaleXYConstructor).nt({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0),d3:()=>new et({x:0,y:0},{x:1,y:1},{x:1,y:1},void 0)},rt=(t,e,i)=>e===i?t:i.ot(e.ct(t)),nt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Ei?e.x:e.x instanceof Ei?e.x.x:e.x.ut,r=e instanceof Ei?e.y:e.y instanceof Ei?e.y.y:e.y.ut,n=i instanceof Ei?i.x:i.x instanceof Ei?i.x.x:i.x.ut,o=i instanceof Ei?i.y:i.y instanceof Ei?i.y.y:i.y.ut;return{...t,x:rt(t.x,s,n),y:rt(t.y,r,o)}},ot=(...t)=>{if(0===t.length)return{remove:At};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.dt(s,r,!1,!1,"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 ht{constructor(t){this.ft=t,this.St=new Map}yt(t){return!!this.St.get(t)}M(t){const e=this.St.get(t);return e&&e.textureInfo}xt(t){if(t instanceof O){let e=this.St.get(t);e&&(e={textureInfo:e.textureInfo,refs:e.refs+1},this.St.set(t,e))}else t.textureInfo&&this.St.set(t.lut,{textureInfo:t.textureInfo,refs:1});return this}bt(t){if(!t)return this;let e=this.St.get(t);return e&&(e={textureInfo:e.textureInfo,refs:e.refs-1},0===e.refs?(this.ft.deleteTexture(e.textureInfo.texture),this.St.delete(t)):this.St.set(t,e)),this}vt(){this.St.forEach((t=>{this.ft.deleteTexture(t.textureInfo.texture)})),this.St.clear()}Mt(t){const e=this.St.get(t);return e?e.refs:void 0}_t(){return this.St.size}}const at=t=>new ht(t);class lt extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,lt.prototype)}}class ut extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&&mt.alert(s),Object.setPrototypeOf(this,ut.prototype)}}class ct extends ut{constructor(t){super(t),Object.setPrototypeOf(this,ct.prototype)}}var dt,ft,gt,pt;e.UISpace=void 0,(dt=e.UISpace||(e.UISpace={}))[dt.Content=0]="Content",dt[dt.PaddedContent=1]="PaddedContent",dt[dt.PaddedBackground=2]="PaddedBackground",dt[dt.Everything=3]="Everything",e.UIVisibilityModes=void 0,(ft=e.UIVisibilityModes||(e.UIVisibilityModes={}))[ft.never=0]="never",ft[ft.always=1]="always",ft[ft.whenHovered=2]="whenHovered",ft[ft.whenDragged=3]="whenDragged",ft[ft.whenNotDragged=4]="whenNotDragged",ft[ft.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(gt=e.UIDraggingModes||(e.UIDraggingModes={}))[gt.notDraggable=0]="notDraggable",gt[gt.draggable=1]="draggable",gt[gt.onlyHorizontal=2]="onlyHorizontal",gt[gt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(pt=e.UIDirections||(e.UIDirections={}))[pt.Up=0]="Up",pt[pt.Right=1]="Right",pt[pt.Down=2]="Down",pt[pt.Left=3]="Left";const mt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},yt=(t,e)=>t.x===e.x&&t.y===e.y,xt=t=>t!==ke&&t!==we&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,St=(t,e)=>Math.min(t,e.y),vt=(t,e)=>Math.max(t,e.y),bt=t=>t[1],Mt=t=>t.dispose(),At=()=>{},kt=(t,e)=>t===e,wt=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),Dt=t=>Array.prototype.concat.apply([],t),Et=(t,e)=>{const{x:i,y:s}={x:t[0].length,y:t.length},{column:r,row:n}=e,o=Math.max(0,r.start),h=Math.min(i,r.end),a=Math.max(0,n.start),l=Math.min(s,n.end),u=h-o,c=l-a,d=Array.from(Array(c)).map((()=>Array(u)));for(let e=a,i=0;e{const i=e&&void 0!==e.row.start?e.row.start:0,s=e&&void 0!==e.row.end?e.row.end:t.y,r=e&&void 0!==e.column.start?e.column.start:0,n=e&&void 0!==e.column.end?e.column.end:t.x;return[Math.min(i,s),Math.max(i,s),Math.min(r,n),Math.max(r,n)]},It=(t,e)=>{for(;e;)t.push(t.shift()),e-=1},Ct=t=>{const e=[];for(const i of t)e.push(i.slice());return e},Pt=(t,e)=>void 0!==t?t:e,Ot=t=>t.At(),Ft=t=>t.wt(),Rt=t=>t.kt(),Bt=t=>t.Ct(),zt=t=>t.min.x,_t=t=>t.max.x,Lt=t=>t.min.y,Gt=t=>t.max.y,Vt=(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,Wt=u(0,1),Ht=u(1,0),Ut=u(0,-1),Xt=u(-1,0),jt=u(0,0),Yt=t=>{switch(t){case e.UIDirections.Up:return Wt;case e.UIDirections.Right:return Ht;case e.UIDirections.Down:return Ut;case e.UIDirections.Left:return Xt;default:return jt}},$t=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Zt=t=>{t.stopPropagation(),t.preventDefault()},qt=(t,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)},Qt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},ee=te(Math.E),ie=(t,e)=>{const i=e[t];return i?i():void 0},se=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;ili(ti(t,i))-li(ti(e,i))))},re=(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:A(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())),oe=t=>255===t.getA()?t:t.setA(255),he=(()=>{const t=A(0,0,0);return i=>(i=oe(i),new $({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:ne(i,t,.5)}]}))})(),ae=(()=>{const t=t=>{var e;if(t){if(t instanceof L){if(0===t.getColor().getA())return;return t.getColor()}if(t instanceof $||t instanceof q){const i=t.getColorStops();return 3===i.length?i[1].color:null===(e=i[0])||void 0===e?void 0:e.color}}};return(e,i,s)=>{const r=[];if(s.fill&&r.push(s.fill),s.fill2&&r.push(s.fill2),s.stroke){const t=s.stroke;t instanceof tt&&r.push(t.getFillStyle())}if(s.point3D){const t=s.point3D;r.push(t.getFillStyle())}let n;if(s.behavior&&!0===s.behavior.colorStep){const[e,s]=r.reduce(((e,i)=>{if(e[0]&&e[1])return e;const s=t(i);return s&&(void 0===e[0]?e[0]=s:e[1]=s),e}),[void 0,void 0]);n=e&&s?(o=e)===(h=s)||o.getR()===h.getR()&&o.getG()===h.getG()&&o.getB()===h.getB()?he(o):(o=oe(o),h=oe(h),new q({angle:0,stops:[{offset:0,color:h},{offset:.5,color:h},{offset:.5,color:o},{offset:1,color:o}]})):i.uiButtonFillStyle}else{const e=r.reduce(((e,i)=>e||t(i)),void 0);n=e?he(e):i.uiButtonFillStyle}var o,h;e.setButtonOffFillStyle(new L({color:A(255,255,255,0)})).setButtonOffStrokeStyle(i.uiButtonStrokeStyle).setButtonOnFillStyle(n).setButtonOnStrokeStyle(J)}})(),le=t=>{const e=t;if(e instanceof N)return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ue=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},ce=(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,fe=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),ge=(t,e)=>e(),pe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to support@lightningchart.com or Stack Overflow with tag [lightningchart]");new L({color:A(255,255,255,1)});const me=t=>t===De||t.min.x===De.min.x&&t.max.x===De.max.x&&t.min.y===De.min.y&&t.max.y===De.max.y,ye=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,xe=(t,e)=>{throw new Error(e)},Se=()=>{const t=U((()=>{}));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)||W.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)}},ve=t=>{let e;return()=>e||(e=t(),e)},be=t=>{if(t===J)return 0;const e=t.getThickness();return e<0?1:1*e},Me=(t,e,i,s)=>{const r=`LightningChart JS Resources not found.\nresourcesBaseUrl: "${t}"\ninitiator: ${i}\nresource url: ${e}\nFor more information, please find the FAQ from API documentation at below link:\nhttps://lightningchart.com/lightningchart-js-api-documentation/\nand read section "What is LightningChart JS Resources not found error?"`;if(s.shouldCrash)throw mt.alert(r),new Error(r);mt.console.warn(r)},Ae={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=>Ae.divide(t,Ae.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(Ae.dot(t,e)/(Ae.length(t)*Ae.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=Ae.dot(e,t),o=Ae.cross(e,t);return Ae.addVec(Ae.multiply(t,s),Ae.addVec(Ae.multiply(e,(1-s)*n),Ae.multiply(o,r)))},lerp:(t,e,i)=>(i=wt(i,0,1),Ae.addVec(Ae.multiply(t,1-i),Ae.multiply(e,i))),equals:(t,e)=>kt(t.x,e.x)&&kt(t.y,e.y)&&kt(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)})},ke=Number.MAX_SAFE_INTEGER,we=-Number.MAX_SAFE_INTEGER,De=p(u(ke,ke),u(we,we)),Ee=p(f(ke,ke,ke),f(we,we,we)),Te=(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))},Ie=(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),Pe=(t,e)=>p(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Oe=(t,e)=>e+t,Fe=(t,e,i)=>{const s=ti(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=ti(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)},Re=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Be=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},ze=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},_e=(t,e,i)=>{const s=ze(e,i);if(0===s)return[ze(t,e),e];let r=ri(ti(t,e),ti(i,e))/s;r=Math.max(0,Math.min(1,r));const n=u(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y));return[ze(t,n),n]},Le=(t,e,i)=>Qe(t,Je(ti(e,t),i)),Ge=(t,e,i)=>Ae.addVec(t,Ae.multiply(Ae.subtractVec(e,t),i));function Ve(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:ke,y:ke},max:{x:we,y:we}};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},He=(t,e)=>p(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 Ue(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}const Xe=(t,e,i,s)=>u((t.x+e.x+i.x+s.x)/4,(t.y+e.y+i.y+s.y)/4),je=(t,e,i,s,r)=>{if(e.x>i.x)if(e.x>s.x)if(e.x>r.x){if(t.x>e.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(t.xs.x)if(i.x>r.x){if(t.x>i.x)return!1;if(r.xr.x)return!1;if(s.xr.x){if(t.x>s.x)return!1;if(r.xr.x)return!1;if(s.xi.y)if(e.y>s.y)if(e.y>r.y){if(t.y>e.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(t.ys.y)if(i.y>r.y){if(t.y>i.y)return!1;if(r.yr.y)return!1;if(s.yr.y){if(t.y>s.y)return!1;if(r.yr.y)return!1;if(s.y{const s=(i.y-e.y)/(i.x-e.x),r=e.y+(t-e.x)*s;return u(t,r)},oi=(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 hi(t){return t*Math.PI/180}function ai(t){return 180*t/Math.PI}function li(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function ui(t){return u(Math.cos(t),Math.sin(t))}function ci(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 di=(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)},fi=(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 gi{constructor(){this.Tt=!0}getInnerStart(){return this.U}getInnerEnd(){return this.$}getInnerInterval(){return Math.abs(this.$-this.U)}Z(t,e){return this.U=t,this.$=e,this}X(){return this.Tt=!1,this}j(){return this.Tt=!0,this}}class pi extends gi{constructor(t,e,i,s){if(super(),this.It=!0,this.Ft=!0,this.Pt=[0,0],this.Dt=!0,this.Bt=t,this.Ot=e,this.Lt=i,this.Rt=t,this.Et=e,s){const t=s.R(this.zt.bind(this));this.zt(s.M()),this.Vt=()=>s.N(t)}}q(t){return this.Y=t,this.Ft=!0,this}Nt(t){return this.Pt=t.map(Math.abs),this.Dt=!0,this}Gt(){return this.Bt/this.Lt*this.Y+this.Pt[0]}Wt(){return(this.Bt+this.Ot)/this.Lt*this.Y-this.Pt[1]}Ht(){return this.getCellSize()-this.Ut()}$t(){return this.Y}getCellSize(){return this.Yt(this.Y)}Ut(){return this.Pt[0]+this.Pt[1]}Xt(){return this.Pt}zt(t){this.Lt=t.reduce(Oe,0),this.Bt=t.reduce(((t,e,i)=>i>=this.Rt?t:t+e),0),this.Ot=t.reduce(((t,e,i)=>i>=this.Rt&&ivi;return!n&&!o||!!r&&(e>t?{start:n?Si:t,end:o?vi:e}:{start:o?vi:t,end:n?Si:e})}ct(t){const e=this.Gt(),i=this.Wt(),s=Math.max(t,Si);return e+(this.Zt.function(s)-this.Kt.scaleStartLog)/this.Kt.scaleIntervalLog*(i-e)}ot(t){const e=this.Gt(),i=(t-e)/(this.Wt()-e),s=this.Kt.scaleStartLog+i*this.Kt.scaleIntervalLog;return this.Zt.number**s}jt(){this.Zt&&this.qt()}Z(t,e){return super.Z(t,e),this.Zt&&this.qt(),this}Nt(t){return super.Nt(t),this.Zt&&this.qt(),this}q(t){return super.q(t),this.Zt&&this.qt(),this}Jt(t){return this.Zt={internal:t,function:yi(t),number:xi(t)},this}Qt(){return this.Zt.internal}ti(t,e){const i=this.ct(t)+e;return this.ot(i)}get ii(){return this.Ft||this.Tt||this.Dt||this.It}qt(){const t=this.Zt.function(this.U),e=this.Zt.function(this.$)-t,i=2*this.Gt()/this.Y-1,s=2*this.Wt()/this.Y-1-i;return this.Kt={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.Kt}si(){return this.Kt}}const yi=t=>"e"===t?ee:te(t),xi=t=>"e"===t?Math.E:t,Si=.9*1e-9,vi=1.1*10**32,bi=["K","M","B","T"],Mi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Te(s,10),0);return t.toFixed(r)},Ai={Numeric:(t,e)=>Mi(t,e.getInnerStart(),e.getInnerEnd()),NumericUnits:(t,e)=>{const i=Math.abs(e.getInnerEnd()-e.getInnerStart()),s=t<0;t=Math.abs(t);const r=Te(t,1e3),n=1e3**r;let o="",h="";if(i>=1e3&&t>=1e3){const e=10**(Te(i,10)-1),a=Math.round(t/e)*e/n;let l=r;for(;l>0;){const t=Math.min(l,bi.length)-1;h=bi[t]+h,l-=t+1}o=(s?"-":"")+a}else{let e=String(Math.floor(t));for(let t=1;t<=r;t+=1){const i=e.length-(3*t+(t-1));e=`${e.substring(0,i)} ${e.substring(i,e.length)}`}o=(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-Te(i,10)):"")}return o+=h,o}},ki=(t,e)=>{const i=yi(e);return"e"===e?t?(t,e)=>`${Math.floor(i(t))}e`:()=>"":(t,e)=>{const s=t.toString();if(t>1)return s;const r=Math.floor(i(t));return t.toFixed(Math.abs(r))}};class wi extends pi{constructor(t,e,i,s){super(t,e,i,s),this.ei=!1,this.ii=!1,this.hi=0,this.Y=1e3,this.Z(0,10),this.K()}rt(t,e,i,s,r){if(t===e)return!1;const n=Math.abs(s-i),o=Math.abs(e-t);if(!this.ei){const i=((t,e,i)=>{const s=((t,e)=>{if(ewe&&twe){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}}jt(){this.K()}ct(t){return this.Gt()+(t-this.U)/(this.$-this.U)*(this.Wt()-this.Gt())}ot(t){return this.U+(t-this.Gt())/(this.Wt()-this.Gt())*(this.$-this.U)}Z(t,e){return super.Z(t,e),this.K(),this}Nt(t){return super.Nt(t),this.K(),this}q(t){return super.q(t),this.ri=Di(this.$-this.U,this.Pt,this.Y,this.Ot,this.Lt),this.K(),this}ni(){return this.ei=!0,this}oi(){return this.ei}ai(){return Math.abs(this.li)}ci(){return this.ai()/this.ri}ui(){return this.di}fi(){return this.gi}getPixelSize(){return this.ri}si(){return this.Kt}j(){return super.j(),this.ii=!0,this}X(){return super.X(),this.ii=!1,this}pi(t,e=Ai.Numeric){return e(t,this)}mi(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}Si(t){return Di(t,this.Pt,this.Y,this.Ot,this.Lt)}K(){let t=this.U,e=this.$,i=0;this.ei&&(t=0,e=this.$-this.U,i=this.U);const s=e-t,r=Di(s,this.Pt,this.Y,this.Ot,this.Lt);this.gi=t-this.Pt[0]*r,this.di=e+this.Pt[1]*r;const n=this.di-this.gi,o=n-this.li,h=Math.abs(o/r),a=s-this.hi,l=Math.abs(a/r);(!this.Kt||h>=.4||l>=.4)&&(this.hi=s,this.li=n,this.ri=r,this.ii=!0);const u=this.li*this.Lt/(2*this.Ot),c=-(this.gi-this.li*this.Bt/this.Ot)-u,d=2*this.Gt()/this.Y-1,f=2*this.Wt()/this.Y-1-d;this.Kt={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}ti(t,e){return t+this.ri*e}}const Di=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Ei{yi(t,e){return"x"in t?(this.x=t.x,this.y=t.y):(this.x=t,this.y=e),this}X(){return this.x.X(),this.y.X(),this}j(){return this.x.j(),this.y.j(),this}q(t,e){return"object"==typeof t?(this.x.q(t.x),this.y.q(t.y)):(this.x.q(t),this.y.q(e)),this}$t(){return u(this.x.$t(),this.y.$t())}xi(t){return this.x.Nt(t),this}bi(t){return this.y.Nt(t),this}Ut(){return u(this.x.Ut(),this.y.Ut())}vi(t,e){return this.x.Z(t,e),this}Mi(t,e){return this.y.Z(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Ut(),y:e-this.y.Ut()}}_i(){return this.x.ii||this.y.ii}}class Ti extends Ei{constructor(){super(...arguments),this.Ai="LinearScaleXY"}nt(t,e,i,s){return this.x=new wi(t.x,e.x,i.x,s?s.x:void 0),this.y=new wi(t.y,e.y,i.y,s?s.y:void 0),this}oi(){return this.x.oi()||this.y.oi()}wi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}si(){return{x:this.x.si(),y:this.y.si()}}ti(t,e){const i=this.wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}ki(t,e,i,s){const r=this.wi(),n=qe(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 Ii extends Ei{constructor(){super(...arguments),this.Ai="MixedScaleXY"}oi(){return!1}ti(t,e){const i=this.x.ct(t.x),s=this.y.ct(t.y),r={x:i+e.x,y:s+e.y};return{x:this.x.ot(r.x),y:this.y.ot(r.y)}}ki(t,e,i,s){const r={x:this.x.ct(t.x),y:this.y.ct(t.y)},n={x:this.x.ct(e.x),y:this.y.ct(e.y)},o=Ze(ti(n,r)),h=qe(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.ot(a.x),y:this.y.ot(a.y)}}si(){const t=this.x.si(),e=this.y.si();return{uScaleStart:[this.x.U,this.y.U],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 Ci={fitting:{start:(t,e,i,s)=>e>=t?i:s,end:(t,e,i,s)=>e>=t?s:i},expansion:{start:(t,e,i,s)=>e>=t?it?s:t,end:(t,e,i,s)=>e>=t?s>e?s:e:ie>t?Ci.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Ci.progressive.start(t,e,i,s)+(e-t)},regressive:{start:(t,e,i,s)=>e>t?ie>t?Ci.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.Ci,Fi=t=>void 0!==t.Ti,Ri={Ii:Ai.Numeric},Bi=(t,e)=>[t,e],zi=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{kt(t,0)&&(t=0),kt(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},Gi=(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)}},Vi=(...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))}},Ni=(t,e)=>{if(e.has(t))return e.get(t);const i=Ve(t.Pi.Fi());return e.set(t,i),i},Wi=t=>{const e=new Map;if(t!==Ri){for(const i of t.Di)e.set(i,new Map);for(const i of t.Bi)e.set(i,new Map)}return e};class Hi{constructor(t,e,i,s,n,o,h){this.P=new r.Eventer,this.Oi=Ri,this.Li=Pi.Empty,this.Ri=new Map,this.Ei=new Map,this.zi=Ci.fitting,this.Vi=!0,this.Ni=U((()=>this.chart.Wi.Gi()))(300,W.linear),this.Hi=!0,this.Ui=!0,this.$i=!1,this.Yi=we,this.Xi=!1,this.ji=!1,this.Zi=we,this.Ki=we,this.qi=we,this.Ji={},this.Qi=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ri.get(e),l=(t?t.get(a):void 0)||this.ts(a,e);l.ss=!1;const u=this.es(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.hs=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.ns!==i||!!t.find((t=>t===e)))).map((t=>Ie(e,Ni(t,a))?t:void 0)),p=y.some((t=>void 0!==t))}else p=!1;if(p){let t=!0;const e=y.filter((t=>void 0!==t));if(t&&i.os&&e.every((t=>Oi(t.ns)))&&(t=!1),t&&i.os&&i.os.ls&&!1===i.os.ls(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.Oi.Ii(t,this.ut),this.cs=([t,e])=>{this.us(t,e)},this.chart=t,this.ds=e,this.fs=s,this.gs=o,this.ut=i,this.ps=h,"logarithmic"===h.type&&this.setAnimationZoom(W.logarithmic(xi(h.base))),this.Ss=o.numeric,this.setTickStrategy("Numeric"),this.ys=i.getInnerStart(),this.xs=i.getInnerEnd(),n&&this.setAnimationsEnabled(!1)}getTitle(){return this.vs.bs()}setTitle(t){return this.vs.Ms(t),this.chart.Wi.Gi(),this}getTitleFillStyle(){return this.vs._s()}setTitleFillStyle(t){return this.vs.As(t),this.chart.Wi.Gi(),this}getTitleFont(){return this.vs.ws()}setTitleFont(t){return this.vs.ks(t),this.chart.Wi.Gi(),this}setTitleRotation(t){return this.vs.Cs(t),this.chart.Wi.Gi(),this}getTitleRotation(){return this.vs.Ts()}setTitleEffect(t){return this.Fs.Is(t),this.chart.Wi.Gi(),this}getTitleEffect(){return this.Fs.Ps()}setTickStrategy(t,e){if(this.Ri.size>0&&this.Ds(),"Empty"===t)this.Oi=Ri,this.Li=t;else if("Numeric"===t){"Numeric"!==this.Li&&(this.Ss=this.gs.numeric);const i=e||(t=>t);this.Ss=i(this.Ss),this.Oi=this.Ss.Bs(this.ps),this.Li=t}else if("DateTime"===t){"DateTime"!==this.Li&&(this.Ss=this.gs.datetime);const i=e||(t=>t);this.Ss=i(this.Ss),this.Oi=this.Ss.Bs(this.ps),this.Li=t}else if("Time"===t){"Time"!==this.Li&&(this.Ss=this.gs.time);const i=e||(t=>t);this.Ss=i(this.Ss),this.Oi=this.Ss.Bs(this.ps),this.Li=t}return this.Ei.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ei=Wi(this.Oi),this.chart.Wi.Gi(),this}getTickStrategy(){return this.Li}Os(){return this.Oi}Ls(t){this.Oi=t,this.Ei.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ei=Wi(this.Oi),this.chart.Wi.Gi()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.dt(void 0!==e?e:this.ys,void 0!==i?i:this.xs,void 0!==s&&s,void 0===r||r,"userSetInterval"),this}dt(t,e,i=!1,s=!0,r){let n={start:t,end:e};const o=Math.abs(e-t);if(Math.abs(this.xs-this.ys),void 0!==this.Oi.Rs&&this.Oi.Rs>o){const i=(e+t)/2,s=this.Oi.Rs/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.Oi.Es&&this.Oi.Ese?-1:1);n={start:i-s,end:i+s}}const h=this.ut.rt(n.start,n.end,this.ys,this.xs,!0);if(!1===h)return this;let a;switch(!0===h||(n=h),r){case"userSetInterval":case"userFit":case"interactionSetInterval":case"interactionZoom":a=!0;break;case"zoomBandChart":case"synchronizedAxis":a=!1;break;default:return xe(0,""),this}if(this.zs&&this.zs.finishAll(!1),this.Ni&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.zs||this.zs.isOver()?this.Ni:this.zs.NextAnimation.bind(this);this.zs=e([[this.ys,n.start],[this.xs,n.end]],this.cs,t),this.zs.onAnimationEnd((()=>{this.zs=void 0,a&&(this.qi=mt.performance.now())})),this.zs.onAnimationEnd((()=>this.setStopped(s)))}else this.us(n.start,n.end),s&&this.setStopped(!0),a&&(this.qi=mt.performance.now());return this}getInterval(){return{start:this.ys,end:this.xs}}setStopped(t){return t===this.$i||(t&&(this.zs&&this.zs.finishAll(!1),this.zs=void 0),this.$i=t,this.P.emit("stoppedStateChanged",this,this.$i),this.Yi=mt.performance.now(),this.chart.Wi.Gi()),this}getStopped(){return this.$i}onStoppedStateChanged(t){return this.P.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.P.off(t,"stoppedStateChanged")}fit(t,e=!1){const i=this.Vs(!1);if(i){const s=this.xs>=this.ys,r=s?i.min:i.max,n=s?i.max:i.min;this.dt(r,n,t,e,"userFit")}return this}setScrollStrategy(t){return this.zi=t,this.chart.Wi.Gi(),this}getScrollStrategy(){return this.zi}setAnimationScroll(t){return this.Vi=Boolean(t),this.chart.Wi.Gi(),this}setAnimationZoom(t,e=300){return this.zs&&(this.zs.finishAll(!1),this.zs=void 0),this.Ni=t?U((()=>this.chart.Wi.Gi()))(e,t):void 0,this}setAnimationsEnabled(t){return this.Hi=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(W.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.Hi}setVisible(t){const e=this.Ui!==t;return this.Ui=t,this.vs.setVisible(t),this.Ns((e=>{e.Pi.setVisible(t)})),e&&this.P.emit("visibleStateChanged",this,this.Ui),this}getVisible(){return this.Ui}onIntervalChange(t){return this.P.on("scaleChange",t)}offIntervalChange(t){return this.P.off(t,"scaleChange")}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}Gs(t,e){const i=new Map;if(this.Oi===Ri||!this.Ui)return this.Ds(),i;e=e||new Map;const s=this.Ws(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Ji.physicalAxisSize=h;const a=Xi(this.Oi,r,n,this.ys,this.xs,h),l=[];if(this.Hs(),l.push(...this.Us(this.Oi,r,n,a,e,t,i)),this.$s(this.Oi,r,n,a,e,t,l,i),this.Ys(),a)for(const[t,e]of this.Ei){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.Ji.min=r,this.Ji.max=n,this.Ji.scaleInterval=o,this.Ji.physicalAxisSize=h,i}Xs(t){const e=t.ns.js;t.Pi.Ms(e(t.u,this.ut)).Zs()}Ks(t,e){const i=e.qs;t.Pi.As(i.getLabelFillStyle()).ks(i.getLabelFont()).Cs(i.getLabelRotation())}ts(t,e){const i=this.Ei.get(e);let s=i.get(t);s?(i.delete(t),s.ns=e,s.Js(!0)):s=this.Qs(t,e);const r=this.Ri.get(e)||new Map;return r.set(t,s),this.Ri.set(e,r),this.Ks(s,e),s}es(t,e){const i=this.te(t,e);return this.Xs(t),i}Us(t,e,i,s,r,n,o){const h=[];for(const a of t.Di){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ri.get(a),l=(t?t.get(s):void 0)||this.ts(s,a),u=this.es(l,n),c=Ni(l,r);h.find((t=>Ie(c,Ni(t,r))))&&l.Pi.setVisible(!1),l.ss=!1,o.set(l,u),h.push(l)}}return h}$s(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.Bi){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.os){y=!1;break}const t=u.os.ie;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const m=this.hs(p.filter((t=>a.some((e=>kt(t.u,e))))),g,u,d,n,h,e,i,r,o,l);!0!==m?t=t.concat(m):(d+=1,f=-1,t=[])}m=t,p.forEach((e=>{t.find((t=>t===e))||this.se(e)}))}if(l=m,!y)break}}se(t){const e=this.Ri.get(t.ns);null==e||e.delete(t.u);const i=this.Ei.get(t.ns);i&&i.has(t.u)?t.dispose():i&&(t.Js(!1),i.set(t.u,t))}Ns(t){for(const e of this.Ri.values())for(const i of e.values())t(i)}ee(t,e){for(const i of this.Ri.values())for(const s of i.values())e=t(e,s);return e}Ds(){this.Ri.forEach(((t,e)=>{t.forEach((t=>this.se(t)))})),this.Ri.clear()}Hs(){for(const t of this.Ri.values())for(const e of t.values())e.ss=!0}Ys(){for(const t of this.Ri.values())for(const[e,i]of t.entries())i.ss&&(i.dispose(),t.delete(e))}Ws(){const t=this.ut.getInnerStart()this.ut.getInnerStart()?this.ut.getInnerEnd():this.ut.getInnerStart();return p(t,e)}rs(t,e){return!(t.ss||0===t.Pi.bs().length||Oi(e)&&!0!==e.he)}re(t,e){return this.Oi===Ri||(this.Oi.Di.forEach((i=>{e=t(e,i.qs)})),this.Oi.Bi.forEach((i=>{(t=>void 0!==t.js)(i)&&(e=t(e,i.qs))}))),e}Vs(t){let e;for(const t of this.ne()){if(!t.oe())continue;let i=this.ds.ae(t);const s=this.ds.le(t);void 0!==i&&xt(i)&&void 0!==s&&xt(s)&&("logarithmic"===this.ps.type&&(0===i&&(i=Math.min(1,s)),Math.sign(i)!==Math.sign(s)&&(i=Math.min(1,s-.1))),e?(e.min=Math.min(e.min,i),e.max=Math.max(e.max,s)):e=p(i,s))}if(e&&xt(e.min)&&xt(e.max)){if(kt(e.min,e.max)){if(t)return;return{min:e.min-1,max:e.max+1}}return e}}ce(){let t=0;for(const e of this.ne()){if(!e.oe())continue;const i=this.ds.ue(e);i&&(t=Math.max(t,i))}return t}de(){const t=this.ne(),e=this.Xi;let i=!1;if(0!==t.length&&this.zi&&!this.$i){const t=this.Vs(!0);if(t){const e=this.ys,s=this.xs;let r=this.zi.start(e,s,t.min,t.max),n=this.zi.end(e,s,t.min,t.max);const o=!1===kt(e,r),h=!1===kt(s,n);if(r=o?r:e,n=h?n:s,o||h){let t=!1;if(this.Vi)if(this.Vi){t=!0;const a=o?this.fe(e,r):e,l=h?this.fe(s,n):s;if(!0===this.us(a,l,{allowClamping:!1})&&(o&&!1===kt(a,r)||h&&!1===kt(l,n))){this.chart.Wi.Gi(!0),i=!0;let t=Math.abs(n-r)/Math.abs(a-l);t<1&&(t=1/t),this.ji=t>=1.4}}else t=!1;t||this.us(r,n)}}}i?(this.Xi!==i&&(this.Xi=i,this.Zi=mt.performance.now()),this.ge&&(clearTimeout(this.ge),this.ge=void 0)):!0===e&&void 0===this.ge&&(this.ji=!1,this.ge=setTimeout((()=>{!1!==this.Xi&&(this.Xi=!1,this.Zi=mt.performance.now()),this.ge=void 0,this.chart.Wi.Gi()}),200))}us(t,e,i){const s=!i||!("allowClamping"in i)||void 0===i.allowClamping||i.allowClamping;let r={start:t,end:e},n=!0;const o=Math.abs(e-t),h=Math.abs(this.xs-this.ys);if(void 0!==this.Oi.Rs&&this.Oi.Rs>o){const i=(e+t)/2,o=(s?this.Oi.Rs/2:h/2)*(t>e?-1:1);r={start:i-o,end:i+o},n=!1}if(void 0!==this.Oi.Es&&this.Oi.Ese?-1:1);r={start:i-o,end:i+o},n=!1}let a=this.ut.rt(r.start,r.end,this.ys,this.xs,s);if(!1===a)return!1;!0!==a&&(r=a);const l=this.ce(),u=this.pe(Math.min(r.start,r.end),Math.max(r.start,r.end),l);return a=this.ut.rt(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min,this.ys,this.xs,!1),!!a&&(!0===a?this.ut.Z(r.end>r.start?u.min:u.max,r.end>r.start?u.max:u.min):this.ut.Z(r.start,r.end),this.ys=r.start,this.xs=r.end,this.P.emit("scaleChange",this,r.start,r.end),this.Ki=mt.performance.now(),this.chart.Wi.Gi(),n)}me(){return this.Xi}Se(){return void 0!==this.zs}}class Ui{constructor(t,e,i,s,r=i.ye(s).setMouseInteractions(!1)){this.ss=!1,this.xe=!1,this.be=[],this.ns=t,this.u=e,this.ve=i,this.Me=s,this.Pi=r,this.be.push(r)}Js(t){this.be.forEach((e=>e.setVisible(t)))}dispose(){return this.xe||(this.xe=!0,this.be.forEach((t=>t.dispose()))),this}}const Xi=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Di){let t=n._e(e,i,s,r);t=ji(t),o.set(n,t)}let h;for(const s of t.Bi){let t;if(void 0===h)t=s._e(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.Ae&&s.Ae>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Yi=s.Record({size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class $i extends Yi{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 Zi=new $i,qi=new class{},Ki=s.Record({shape:"sphere",size:10,fillStyle:new L,wireframeStyle:J});class Ji extends Ki{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 Qi=s.Record({size:5,fillStyle:new L});class ts extends Qi{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 es={Triangulated:Ji,Pixelated:ts};class is{constructor(t){this.we=new Map,this.Wi=t}ke(t,e,i){const s=i.animationEnabled;this.we.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.we.delete(t),t.offDispose(r)}))}Ce(t,e){const i=e.animationEnabled,s=[],r=t.onDispose((()=>{s.forEach((t=>{this.we.delete(t)})),t.offDispose(r)}));return{Te:(t,e)=>{const r={applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:i,curAnimatedHighlightValue:0};s.push(t),this.we.set(t,r)}}}Ie(t,e){const i=this.we.get(t);i&&(i.curUnanimatedHighlightValue=ye(e),this.Wi.Gi())}Fe(t){const e=this.we.get(t);return e?e.curUnanimatedHighlightValue:0}Pe(t,e){const i=this.we.get(t);i&&(i.animationEnabled=e)}De(t){const e=this.we.get(t);return!!e&&e.animationEnabled}Zs(t){let e=!1;this.we.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.Wi.Gi(!0)}}const ss=new Map,rs=t=>{const e=t.getSize(),i=t.getFamily(),s=t.getWeight(),r=t.getStyle(),n=t.getVariant(),o=`${r} ${n?"small-caps":"normal"} ${s} ${e}px ${i}`;let h=ss.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{size:e,family:i,style:r,variant:n,weight:s}),ss.set(o,h)),h};var ns,os;!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"}(ns||(ns={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(os||(os={}));const hs=t=>({container:t.Be,scale:t.ut,setMouseStyle:(e,i)=>t.Oe(e,i),restoreMouseStyle:e=>t.Le(e),clientLocation2Engine:(e,i)=>t.Re(e,i),engineLocation2Client:(e,i)=>t.Ee(e,i),captureFrame:(e,i)=>t.ze(e,i),renderFrame:(e,i,s=!1)=>t.Ve(e,i,s),layout:()=>{t.Ne(),t.Ge()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.We(e,i)}),as=[];let ls;const us=()=>{if(void 0!==ls){const t=mt.getComputedStyle(mt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));ls.style.height=mt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Gi()),60),this.$e=u(0,0),this.Ye=void 0,this.Xe=()=>{},this.je=()=>{},this.Ze=[],this.Ke=-1,this.qe=[],this.Je=!0,this.xe=!1,this.Ge=()=>{const{bottom:t,left:e}=this.Qe().getBoundingClientRect();return this.$e=u(Math.floor(e),Math.floor(t)),this},this.Ne=()=>{this.th&&this.th()},this.Oe=(t,e)=>{if(!e){this.Be.style.cursor=t;const e=this.Ke;return this.Ke+=1,this.qe.push([e,t]),e}return this.Le(e),this.Oe(t)},this.Le=t=>{const e=t?this.qe.findIndex((e=>e[0]===t)):-1;e>=0?(this.qe.splice(e,1),this.qe.length>0?this.Be.style.cursor=this.qe[this.qe.length-1][1]:this.Be.style.cursor="default"):(this.qe.push([0,"default"]),this.Be.style.cursor="default")},this.ih=t=>(this.sh.S(t),this),this.eh=()=>this.sh.M(),this.hh=()=>{this.Xe&&this.Xe(),this.rh(),this.oh(),this.je&&this.je()},this.ah=t=>(this.He.set(t.lh(),t),this.He=new Map([...this.He.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.uh=t=>(this.He.delete(t),this),this.X=()=>(this.sh.o=!1,this),this.j=()=>(this.sh.o=!0,this),this.dh=t=>{if(!this.Je)return;const e=this.fh,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.Re(t.clientX,t.clientY),r=this.gh(t,{x:t.clientX,y:t.clientY});if(this.ph&&((null==r?void 0:r.entity)!==this.ph.entity||r.collectionMember!==this.ph.collectionMember)&&!this.mh){this.ph.entity.Sh=!1;const e=this.ph.entity.yh;e&&e(this.ph.entity,t,this.ph.collectionMember)}if(r&&r.entity.getMouseInteractions()&&!this.mh)if(r.entity.Sh){if(!i){const e=r.entity.xh;e&&e(r.entity,t,r.collectionMember)}}else{r.entity.Sh=!0;const e=r.entity.bh;e&&e(r.entity,t,r.collectionMember)}if(this.mh){const i=this.mh.entity.Mh,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.mh.entity,t,this.mh.button,this.mh.startLocation,s,this.mh.collectionMember)}this._h=t,this.fh=t,this.Ah=s,this.ph=r},this.wh=t=>{if(this.Je=!1,this.Ah=void 0,this._h=t,this.fh=void 0,this.mh){const e=this.mh.entity.kh;e&&e(this.mh.entity,t,this.mh.button,this.mh.startLocation,this.mh.collectionMember),this.mh.entity.Sh=!1;const i=this.mh.entity.yh;i&&i(this.mh.entity,t,this.mh.collectionMember),this.mh=void 0}if(this.Ch){const e=this.Ch.entity.Th;e&&e(this.Ch.entity,t,this.Ch.collectionMember),this.Ch=void 0}if(this.ph){this.ph.entity.Sh=!1;const e=this.ph.entity.yh;e&&e(this.ph.entity,t,this.ph.collectionMember),this.ph=void 0}},this.Ih=t=>{this.Je=!0,this._h=t},this.Fh=()=>this.Ah,this.fs=t.theme,this.Ph=e.Ph,this.Dh={Bh:e.Bh,Oh:e.Oh,Lh:e.Lh,Rh:e.Rh,Eh:e.Eh,zh:e.zh,Vh:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,Nh:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:`${mt.location.origin}/resources`,Gh:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings,Wh:(()=>{const e=null==t?void 0:t.pickingPrecision;if("string"==typeof e){const t=e.toLowerCase();if("best"===t)return 1;if("high"===t)return.5;if("low"===t)return 1/8}return 1/4})(),Hh:void 0===(null==t?void 0:t.interactable)||t.interactable,Uh:void 0===t.textPixelSnappingEnabled||t.textPixelSnappingEnabled};const i=t?t.container:void 0;if(i){if("string"==typeof i){const t=mt.document.getElementById(i);if(!t)throw new Error(`Container "${i}" doesn't exist.`);this.Be=t}else this.Be=i;mt.addEventListener("resize",this.Ne),this.Ze.push((()=>{mt.removeEventListener("resize",this.Ne)}))}else{if(void 0===ls){const t=mt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",mt.document.body.appendChild(t),ls=t,mt.addEventListener("resize",us)}let t=1;for(;null!==mt.document.getElementById(`chart-${t}`);)t+=1;this.Be=mt.document.createElement("div"),this.Be.id=`chart-${t}`,this.Be.style.flex="1",ls.appendChild(this.Be),us(),as.push(this.Ne),this.Ze.push((()=>{ls&&ls.removeChild(this.Be),as.includes(this.Ne)&&as.splice(as.indexOf(this.Ne),1),0===as.length&&ls&&(mt.document.body.removeChild(ls),ls=void 0,mt.removeEventListener("resize",us))}))}if(mt.ResizeObserver){const t=t=>{for(const e of t)e.target===this.Be&&this.Ne()};this.$h=new mt.ResizeObserver(t.bind(this)),this.$h.observe(this.Be)}""===this.Be.style.position&&(this.Be.style.position="relative"),this.Be.style.boxSizing="content-box",this.Be.addEventListener("fullscreenchange",this.Ne),this.Be.addEventListener("webkitfullscreenchange",this.Ne);const s=t?t.maxFps:void 0;this.Yh=s?-1===s?-1:0!==s?1e3/s:0:0;const n=new Map;let o=!1;const h=(t,e)=>i=>{const s=function(t){return{x:t.clientX,y:t.clientY}}(i);switch(i.type){case"pointerover":case"pointerenter":case"pointermove":case"pointerdown":n.set(i.pointerId,s);break;default:n.delete(i.pointerId),o=!1}switch(i.interactions=Array.from(n.values()),i.pointerType){case"pen":case"mouse":default:t&&t(i);break;case"touch":e&&e(i)}i.defaultPrevented&&(o=!0)};if(this.Be.onwheel=this.Xh(ns.wheel),this.Be.oncontextmenu=this.Xh(ns.contextmenu),this.Be.onclick=this.Xh(ns.click),this.Be.ondblclick=this.Xh(ns.dbclick),this.Be.onlostpointercapture=()=>{o=!1},this.Be.ontouchmove=t=>{o&&t.preventDefault()},this.Be.onpointerover=h(),this.Be.onpointerenter=h(this.Ih),this.Be.onpointerdown=h(this.Xh(ns.mouseDown),this.jh(os.touchStart)),this.Be.onpointermove=h(this.dh,this.jh(os.touchMove)),this.Be.onpointerup=h(this.Xh(ns.mouseUp),this.jh(os.touchEnd)),this.Be.onpointercancel=h(),this.Be.onpointerout=h(),this.Be.onpointerleave=h(this.wh,this.jh(os.touchEnd)),!mt.requestAnimationFrame||!mt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");mt.addEventListener("scroll",this.Ge),this.sh=y(new M({r:0,g:0,b:0,a:0})),this.Zh=new is(this)}Kh(){return this.qh}Jh(){return this.Qh}setBackgroundFillStyle(t){return this.tr.As(t),this}getBackgroundFillStyle(){return this.tr._s()}setBackgroundStrokeStyle(t){return this.tr.ir(t),this}getBackgroundStrokeStyle(){return this.tr.sr()}er(t){return this.je=t,this}hr(t){return this.Xe=t,this}rr(t){return this.He.get(t)}nr(){return Array.from(this.He.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Xh(t){return e=>this.ar(t,e)}ar(t,e){if(!this.Je)return;t===ns.contextmenu&&Zt(e);const i=this.Re(e.clientX,e.clientY),s=this.gh(e,{x:e.clientX,y:e.clientY});if(t===ns.mouseUp){if(this.mh){const t=this.mh.entity.kh;if(t&&t(this.mh.entity,e,this.mh.button,this.mh.startLocation,this.mh.collectionMember),(null==s?void 0:s.entity)!==this.mh.entity){this.mh.entity.Sh=!1;const t=this.mh.entity.yh;t&&t(this.mh.entity,e,this.mh.collectionMember)}this.mh=void 0}if(this.Ch){const t=this.Ch.entity.getMouseInteractions()&&this.Ch.entity.Th;t&&t(this.Ch.entity,e,this.Ch.collectionMember),this.Ch=void 0}}else if(s&&s.entity.getMouseInteractions()){const i=t===ns.click?s.entity.lr:t===ns.dbclick?s.entity.cr:t===ns.mouseDown?s.entity.ur:t===ns.wheel?s.entity.dr:t===ns.contextmenu?s.entity.gr:void 0;if(i&&i(s.entity,e,s.collectionMember),t===ns.mouseDown){this.Ch={entity:s.entity,collectionMember:s.collectionMember,event:e};const t=this.Ch.event.button,i=s.entity.pr;i&&i(s.entity,e,t,s.collectionMember),this.mh={entity:s.entity,collectionMember:s.collectionMember,button:t,startLocation:u(e.clientX,e.clientY)}}}this._h=e,this.Ah=i,this.ph=s}jh(t){return e=>this.mr(t,e)}mr(t,e){const i=e.interactions.length;if(this.Sr=e,this.yr){const s=t===os.touchMove?this.yr.entity.br:t===os.touchEnd?this.yr.entity.vr:t===os.touchStart?this.yr.entity.Mr:void 0;s&&s(this.yr.entity,e,this.yr.collectionMember),t===os.touchEnd&&0===i&&(this.yr.entity.Sh=!1,this.yr=void 0)}else if(t===os.touchStart){for(let t=0;t{t()})),this.Ze.length=0,this.Ye&&mt.cancelAnimationFrame(this.Ye)}Re(t,e){return u(t-this.$e.x,this.$e.y-e)}Ee(t,e){return u(t+this.$e.x,this.$e.y-e)}}const gs=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=Je(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=Je(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=Je(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=Je(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?Ss.Nearest:"nearest-x"===t?Ss.NearestX:"nearest-y"===t?Ss.NearestY:void 0;return void 0!==e?e:Ss.NearestX},bs=(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===Ss.Nearest)return Ms(t,e,n,o,c,d);if(i===Ss.NearestX||i===Ss.NearestY){if("boolean"==typeof l&&("x"===a&&i===Ss.NearestX||"y"===a&&i===Ss.NearestY))return ws(t,nt(e,o,n),a,l,c,d);if(i===Ss.NearestX)return As(t,nt(e,o,n),h,c,d);if(i===Ss.NearestY)return ks(t,nt(e,o,n),h,c,d)}},Ms=(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=nt(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,p=Math.floor((r+n)/2),m=n,y=-1;for(;;){const e=h-(o?t[p].x:t[p].y);if(e*(s?-1:1)>0)g=Math.min(p+1,m),y=Math.floor((g+m)/2);else{if(0===Math.abs(e))return p;m=Math.max(p-1,g),y=Math.floor((g+m)/2)}if(y===p){const i=p>r?Math.abs(h-(o?t[p-1].x:t[p-1].y)):ke,s=p{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,p=Math.floor((r+n)/2),m=n,y=-1;for(;;){const i=h-(o?t[p].x:t[p].y);if(i*(s?-1:1)>0)g=Math.min(p+1,m),y=Math.floor((g+m)/2);else{if(0===Math.abs(i))return{a:p,b:p,lerpAmount:0};m=Math.max(p-1,g),y=Math.floor((g+m)/2)}if(y===p){if(i*(s?-1:1)<0&&p>r){const i=t[p-1],s=t[p];return{a:p-1,b:p,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(pthis.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Wi=t,this.bt=e,this.Pr=i,this.Dr=Es,Es+=1,this.Br=t.fs.highlightColorOffset}Or(t){return void 0!==this.Pr.find((e=>e.type===t))}Lr(t,e){var i;return!!this.Or(t)&&!0===e(null===(i=this.Pr.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.xe||(this.Sh&&this.yh&&this.yh(this,void 0,void 0),this.xe=!0,this.bt(this),this.P.emit("dispose",this)),this}setVisible(t){const e=this.Ui;return this.Ui=t,!t&&e&&(this.Sh&&this.yh&&this.yh(this,void 0,void 0),this.Sh=!1),this}getVisible(){return this.Ui}setMouseInteractions(t){const e=this.kr.M();return this.kr.S(t),t||(e&&this.Sh&&this.yh&&this.yh(this,void 0,void 0),this.Sh=!1),this}getMouseInteractions(){return this.kr.M()}getIsUnderMouse(){return this.Sh}getIsGrabbed(){return this.Tr}setMouseMoveEventHandler(t){return this.xh=t,this}setMouseEnterEventHandler(t){return this.bh=t,this}setMouseLeaveEventHandler(t){return this.yh=t,this}setMouseClickEventHandler(t){return this.lr=t,this}setMouseDoubleClickEventHandler(t){return this.cr=t,this}setMouseDownEventHandler(t){return this.ur=t,this}setMouseUpEventHandler(t){return this.Th=t,this}setMouseWheelEventHandler(t){return this.dr=t,this}setMouseContextMenuEventHandler(t){return this.gr=t,this}setMouseDragEventHandler(t){return this.Mh=t,this}setMouseDragStartEventHandler(t){return this.pr=t,this}setMouseDragStopEventHandler(t){return this.kh=t,this}setTouchStartEventHandler(t){return this.Mr=t,this}setTouchMoveEventHandler(t){return this.br=t,this}setTouchEndEventHandler(t){return this.vr=t,this}Rr(t){return this.Ir=t,this}Er(){return this.Ir?this.Ir:Is}zr(t){return this.Fr=t,this}Vr(){return this.Fr}Nr(t){return this.Br=t,this}Gr(){return this.Br}}const Is=p(u(0,0),u(0,0));class Cs extends Ts{constructor(t,e,i,s){super(t,i,s),this.Wr=0,this.Hr=e,this.Hr.Ur=!0}$r(t){return this.Wr===t||(this.Wr=t,this.Hr.Ur=!0),this}Yr(){return this.Wr}}class Ps extends Cs{constructor(t,e,i,s,r){super(t,e,s,r),this.Xr=!0,this.ut=i}}const Os=(t,e,i)=>{if(i instanceof Ti){const s=i.wi(),r=ei(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return p(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return p(i.ti(u(t.min.x,t.min.y),Je(e,-1)),i.ti(u(t.max.x,t.max.y),e))},Fs=(t,e)=>"function"==typeof e?e(t):e,Rs=(t,e)=>!t||t!==e,Bs=(t,e)=>t===B&&e!==B,zs=t=>t!==B;class _s extends Ps{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jr=ds.fillStyle,this.Wi=t}As(t){return this.jr=Fs(this.jr,t),this}_s(){return this.jr}Zr(){return Rs(this.Kr,this.jr)}qr(){return Bs(this.Kr,this.jr)}Jr(){return zs(this.jr)}Qr(t){this.Kr=t}}class Ls extends _s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.tn=ds.lineStyle,this.Wi=t}ir(t){return this.tn="function"==typeof t?t(this.tn):t,this}sr(){return this.tn}sn(){return!this.en||this.en!==this.tn}hn(t){return!this.en||this.en.getThickness()!==t}Jr(){return this.tn!==J||super.Jr()}qr(){return(this.tn!==J||this.jr!==B)&&this.en===J&&this.Kr===B}rn(t){this.en=t}}class Gs extends _s{constructor(t,e,i,s,r,n=y(5)){super(t,e,i,s,r),this.size=y(5),this.size=n}q(t){return this.size.S(t),this}}class Vs extends _s{constructor(t,e,i,s,r,n=y(ds.font)){super(t,e,i,s,r),this.nn=y(""),this.an=y(u(0,0)),this.ln=y(0),this.cn=y(0),this.un=y(u(0,0)),this.dn=y(0),this.fn=y(Zi),this.gn=u(0,0),this.Pt=y(x(1,1,1,1)),this.pn=y(S(4,4,4,4)),this.font=y(ds.font),this.mn=!1,this.font=n}Jr(){return zs(this.jr)&&this.nn.M().length>0}qr(){return!1===this.mn&&this.Jr()}Ms(t){return this.nn.S(t),this}bs(){return this.nn.M()}ks(t){return t instanceof $i?this.fn.S(t):this.fn.S(t(this.fn.M())),this}ws(){return this.fn.M()}Sn(t){return this.fn.S(this.fn.M().setFamily(t)),this}yn(){return this.fn.M().getFamily()}xn(t){return this.fn.S(this.fn.M().setSize(t)),this}bn(){return this.fn.M().getSize()}vn(t){return this.fn.S(this.fn.M().setWeight(t)),this}Mn(){return this.fn.M().getWeight()}_n(t){return this.fn.S(this.fn.M().setStyle(t)),this}An(){return this.fn.M().getStyle()}wn(t){return this.fn.S(this.fn.M().setVariant(t)),this}kn(){return this.fn.M().getVariant()}Cn(t){return this.an.S(t),this}Tn(){return this.an.M()}Cs(t){return this.dn.S(t),this}Ts(){return this.dn.M()}In(t,e){return this.un.S(u(t,e)),this}Fn(){return this.un.M()}Pn(t){return this.cn.S(t),this}Dn(){return this.cn.M()}Bn(t){return this.ln.S(t),this}On(){return this.ln.M()}Ln(t){return this.cn.S(t.x),this.ln.S(t.y),this}Rn(t){return this.Pt.S(t),this}En(){return this.Pt.M()}zn(t){return this.pn.S(t),this}Vn(){return this.pn.M()}}class Ns extends Gs{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,y(o)),this.Nn=[],this.Gn=y(e.PointShape.Square),this.dn=y(0),this.Wn=y(!1),this.Hn=y(!1),this.Un=y(!1),this.$n=De,this.Yn=0,this.Xn=[],this.jn=0,this.Zn=De,this.Kn=Ss.Nearest,this.qn=!1}Jn(t){return this.Kn=t,this}Qn(){return this.Xn}io(){return this.Nn}so(t){return this.Gn.S(t),this}Cs(t){return this.dn.S(t),this}eo(t){return this.Wn.S(t),this}ho(t){return this.Hn.S(t),this}ro(t){return this.Un.S(t),this}xt(t,e){return Array.isArray(t)||(t=[t]),this.jn+=t.length,this.Xn=re(this.Xn,t,{canReturnB:!0}),this.Zn&&(this.Zn=e?We(this.Zn,e):void 0),this}no(){return this.qn=!0,this.Nn.length=0,this.Yn=0,this.$n=De,this.Xn=[],this.jn=0,this}oo(){return this.Yn}ao(){return this.jn}}class Ws extends Ls{constructor(t,e,i,s,r){super(t,e,i,s,r),this.an=y(u(0,0)),this.Y=y(u(100,100)),this.dn=y(0),this.gn=y(u(0,0)),this.lo=!1}Zs(){return this.co(),this}Cn(t){const e=this.an.M();return t.x===e.x&&t.y===e.y||(this.an.S(t),this.co()),this}Tn(){return this.an.M()}uo(t){const e=this.an.M();return t!==e.x&&(this.an.S(u(t,e.y)),this.co()),this}do(t){const e=this.an.M();return t!==e.y&&(this.an.S(u(e.x,t)),this.co()),this}q(t){const e=this.Y.M();return t.x===e.x&&t.y===e.y||(this.Y.S(u(t.x,t.y)),this.co()),this}$t(){return this.Y.M()}fo(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(t,e.y)),this.co()),this}po(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(e.x,t)),this.co()),this}Cs(t){return this.dn.S(t),this}Ts(){return this.dn.M()}mo(t){const e=this.gn.M();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.lo=!1,this.co()):(this.lo=!0,this.gn.S(t))),this}co(){if(!this.lo){const t=this.an.M(),e=this.Y.M(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.gn.M();i.x===s.x&&i.y===s.y||this.gn.S(i)}}}class Hs extends Ls{constructor(){super(...arguments),this.Nn=[],this.an=y(u(0,0)),this.$n=De,this.So=!1}yo(t){return t=Qt(t),this.Nn=t,this.So=!0,this}xo(){return this.Nn}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return 0}vo(){return 0}}class Us extends Hs{}class Xs extends _s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Mo=new Array,this._o=new Array,this.Ao=y({type:"disabled",packager:(t,e,i)=>t.slice()}),this.$n=De,this.wo=0,this.ko=!1,this.Xn=[Array(),Array()],this.Co=!1,this.To=(new L).setColor(A(42,171,240)),this.qn=!1,this.Io=!1,this.Fo=!1}xt(t,e){const i=this.wo-1,s=i>0&&!this.Co;let[r,n]=s?[[this.Mo[i]],[this._o[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=re(r,e,{canReturnB:!0}),n=re(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.Co?(this.Xn[0]=re(this.Xn[0],r,{canReturnB:!0}),this.Xn[1]=re(this.Xn[1],n,{canReturnB:!0})):(this.Xn=[r,n],this.Co=!0),this.$n=We(this.$n,e||We(Ve(r),Ve(n))),this}no(){return this.qn=!0,this.Mo.length=0,this._o.length=0,this.wo=0,this.$n=De,this}io(){return[this.Mo,this._o]}Qn(){return[this.Xn[0],this.Xn[1]]}Po(t){return this.Ao.S(t),this}Do(){return this.Ao.M()}Bo(t){return this.To="function"==typeof t?t(this.To):t,this}Oo(){return this.To}oo(){return this.wo-(Number(this.Io)+Number(this.Fo))}ao(){return this.Xn.length}Lo(t){return this.Io=t,this}Ro(){return this.Io}Eo(t){return this.Fo=t,this}zo(){return this.Fo}qr(){return this.Kr===B&&this.Vo===B&&(this.jr!==B||this.To!==B)}No(t){this.Vo=t}Jr(){return this.To!==B||super.Jr()}Zr(){return super.Zr()||!this.Vo||this.Vo!==this.To}}class js extends Ls{constructor(t,e,i,s,r){super(t,e,i,s,r),this.an=y(u(0,0)),this.Go=y(0),this.di=y(360),this.Wo=y(100),this.Ho=y(100),this.Uo=y(0),this.$o=y(void 0),this.Yo=u(0,0),this.Xo=u(0,0),this.jo=u(0,0)}Zo(){return this.Wo.M()}Ko(){return this.Ho.M()}Tn(){return this.an.M()}qo(){return this.Go.M()}ui(){return this.di.M()}Jo(){return this.Uo.M()}Qo(){return this.$o.M()}ta(){return this.Yo}ia(){return this.Xo}sa(){return this.jo}Cn(t){return this.an.S(t),this}ea(t){return this.Go.S(t),this}ha(t){return this.di.S(t),this}ra(t){return this.Ho.S(t),this.Wo.S(t),this}na(t){return this.Wo.S(t),this}oa(t){return this.Ho.S(t),this}aa(t){return this.Uo.S(t<0?0:t),this}la(t){return this.$o.S(void 0!==t&&t<=0?void 0:t),this}}var Ys;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(Ys||(Ys={}));class $s extends Ps{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=ds.lineStyle,this.engine=t}ua(t){return this.ca=((t,e)=>"function"==typeof e?e(t):e)(this.ca,t),this}da(){return this.ca}sn(){return((t,e)=>!t||t!==e)(this.fa,this.ca)}ga(t){return((t,e)=>!t||t.getThickness()!==e)(this.fa,t)}qr(){return((t,e)=>t===J&&e!==J)(this.fa,this.ca)}Jr(){return(t=>t!==J&&t.getFillStyle()!==B)(this.ca)}pa(t){this.fa=t}}class Zs extends $s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.gi=u(0,0),this.di=u(0,0),this.ma=!1}S({min:t,max:e}){return t.x===this.gi.x&&t.y===this.gi.y&&e.x===this.di.x&&e.y===this.di.y||(this.ma=!0,this.gi=t,this.di=e),this}fi(){return this.gi}ui(){return this.di}Sa(t){return t.x===this.gi.x&&t.y===this.gi.y||(this.ma=!0,this.gi=t),this}ha(t){return t.x===this.di.x&&t.y===this.di.y||(this.ma=!0,this.di=t),this}}class qs extends $s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ya=[],this.ma=!1}xt(t,e){return this.ya.push(t),this.ya.push(e),this.ma=!0,this}no(){return this.ya.length=0,this.ma=!0,this}}class Ks extends $s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.xa=[],this.$n=De,this.Xn=new Array,this.Yn=0,this.Kn=Ss.NearestX,this.qn=!1,this.ba=y(void 0),this.Io=!1,this.Fo=!1}va(t){return this.ba.S(t),this}Ma(){return this.ba.M()}Qn(){return this.Xn}io(){return this.xa}Jn(t){return this.Kn=t,this}no(){return this.qn=!0,this.xa.length=0,this.Yn=0,this.Xn=[],this.$n=De,this}oo(){return this.Yn-(Number(this.Io)+Number(this.Fo))}ao(){return this.Xn.length}Lo(t){return this.Io=t,this}Ro(){return this.Io}Eo(t){return this.Fo=t,this}zo(){return this.Fo}}class Js extends _s{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wo=0,this._a=0,this.Y=y({x:0,y:0}),this.Aa=y({x:0,y:0}),this.wa=y({x:0,y:0}),this.gi={x:0,y:0},this.di={x:0,y:0},this.ka=!0,this.Ca=!0,this.Ta=!0,this.$n=De,this.Ia=!0,this.Fa=B}Pa(t){return this.Fa=Fs(this.Fa,t),this}Da(){return this.Fa}S(t){return Qs.S(this,t,((t,e)=>({x:t,y:e}))),this}Ba(){return Qs.Ba(this)}Oa(){return Qs.Oa(this)}Tn(){return Qs.Tn(this)}ao(){return Qs.ao(this)}La(t,e,i){return Qs.La(this,t,e,i),this}Ra(t,e,i){return Qs.Ra(this,t,e,i),this}Ea(t,e){return Qs.Ea(this,t,e),this}za(t,e){return Qs.za(this,t,e),this}Va(t,e){return Qs.Va(this,t,e),this}no(){return Qs.no(this,((t,e)=>({x:t,y:e}))),this}Na(){return Qs.Na(this)}Ga(){return Qs.Ga(this)}Wa(){return Qs.Wa(this)}oo(){return Qs.oo(this)}qr(){return Qs.qr(this)}Jr(){return Qs.Jr(this)}Ha(){return this.Ua}$a(){return this.Ya}}const Qs={S(t,e,i){t.ka=!0,t.Ca=!0,t.Ta=!0;const{start:s}=e,{end:r}=e,{rows:n}=e,{columns:o}=e;t.Ia=e.pixelate;const h={x:e.pixelate&&o>=1||!e.pixelate&&o>1?o:0,y:e.pixelate&&n>=1||!e.pixelate&&n>1?n:0};t.Aa.S(h),t.gi={...s},t.di={...r},t.Y.S(ti(r,s)),Qs.Xa(t,i)},Xa(t,e){const i=t.Aa.M();if(i.x>0&&i.y>0){t.Ua?t.Ua.length=0:t.Ua=[];const s=t.Ia?Qe(i,{x:1,y:1}):{x:i.x,y:i.y};t.wa.S(s),t.Ua=Array.from(Array(s.y)).map((()=>Array(s.x))),t.Ya=Array.from(Array(i.y)).map((()=>Array(i.x))),Qs.ja(t,i,s,e),t.wo=s.x*s.y,t._a=i.x*i.y}else t.Ua=void 0,t.wa.S({x:0,y:0})},ja(t,e,i,s){const r=t.gi,n=t.di,o=t.Ua,h=t.Ya;if(o){const e=i.x,h=i.y,{x:a,y:l}=t.Y.M(),u={x:a/(e-1),y:l/(h-1)};for(let t=0;tt.Aa.o||t.wa.o,Oa(t){const e=t.Aa.M();return{columns:e.x,rows:e.y}},Tn(t){const e=t.gi,i=t.di;return{start:{x:e.x,y:e.y},end:{x:i.x,y:i.y}}},ao(t){throw new Error("Method not implemented.")},La(t,e,i,s){const r="geometry"===i||"y"===i?t.Ua:t.Ya;if(r){const n=t.wa.M();if("y"===i){const t=Ct(r);for(let i=0;iIt(t,e)));const o=r===t.Ua?t.wa.M():t.Aa.M(),h={column:{start:o.x-e,end:o.x},row:{start:0,end:o.y}},a=(t=>{const e=t.length,i=e>0?t[0].length:0,s=Array.from(Array(i)).map((()=>Array(e)));for(let r=0;r0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;a0?e[0].length:0;for(let a=r,l=0;at.wo,oo:t=>t._a,qr:t=>Bs(t.Kr,t.jr)||Bs(t.qa,t.Fa),Jr:t=>zs(t.jr)||zs(t.Fa)};class tr{constructor(t,e){this.Nh=t,this.Ja=e,this.Qa=e.rows*Cr,this.tl=e.columns*Pr}}var er,ir;e.OnScreenMenuButtonType=void 0,(er=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[er.ZoomIn=0]="ZoomIn",er[er.ZoomInX=1]="ZoomInX",er[er.ZoomInY=2]="ZoomInY",er[er.ZoomOut=3]="ZoomOut",er[er.ZoomOutX=4]="ZoomOutX",er[er.ZoomOutY=5]="ZoomOutY",er[er.ZoomToFit=6]="ZoomToFit",er[er.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(ir=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[ir.Circle=0]="Circle",ir[ir.Rectangle=1]="Rectangle",ir[ir.RoundedRectangle=2]="RoundedRectangle";const sr={x:-43,y:0},rr={x:-65,y:0},nr={x:-86,y:0},or={x:-107,y:-1},hr={x:-128,y:-3},ar={x:-150,y:0},lr={x:-171,y:0},ur={x:-276,y:0},cr={x:-298,y:0},dr={x:0,y:0},fr={x:-21,y:0};class gr extends tr{constructor(t,e,i,s){super(t,i),this.il=mt.document.createElement("button"),this.sl=mt.document.createElement("div"),this.el=mt.document.createElement("label"),this.Ja=i,this.hl=e,this.rl=s}nl(t,e,i,s){this.ol(t,s),this.al(),this.ll(e),this.cl(),this.el.textContent=i||"";const r=mt.document.createElement("div");this.ul(r),this.il.onclick=this.onClick.bind(this),r.appendChild(this.sl),r.appendChild(this.el),this.il.appendChild(r)}cl(){this.il.style.cursor="pointer"}ul(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}ll(t){"string"==typeof t?(this.sl.style.backgroundImage=`url(${t})`,this.sl.style.backgroundSize="100%",this.sl.style.backgroundRepeat="no-repeat",this.sl.style.backgroundPosition="center",this.sl.style.width="20px",this.sl.style.height="20px"):this.applyStyleForSprite(t),this.sl.style.margin="auto"}al(){switch(this.hl){case e.OnScreenMenuButtonShape.RoundedRectangle:this.il.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.il.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.il.style.borderRadius="31px"}}ol(t,e){this.il.style.width=`${this.tl.toString()}px`,this.il.style.height=`${this.Qa.toString()}px`,this.il.style.backgroundColor=t,this.il.style.opacity=e||Or,this.il.style.alignItems="center",this.il.style.border="2px solid #707070",this.il.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.sl.style.backgroundImage=`url(${this.Nh}/${Fr})`,this.sl.style.backgroundPositionX=`${t.x}px`,this.sl.style.backgroundPositionY=`${t.y}px`,this.sl.style.backgroundSize="1600%",this.sl.style.backgroundRepeat="no-repeat",this.sl.style.width="20px",this.sl.style.height="20px"}dl(t){return t.appendChild(this.il),t}fl(){return this.il}}class pr extends gr{constructor(t,e,i,s){super(t,e,i,s),this.pl="",this.ml="",this.Sl=!1,this.rl=s}yl(){this.xl(),this.onToggledStateAction()}bl(){this.vl(),this.onInitialStateAction()}vl(){this.Ml(this.pl)}xl(){this.Ml(this.ml)}Ml(t){"string"==typeof t?this.sl.style.background=t:(this.sl.style.backgroundImage=`url(${this.Nh}/${Fr})`,this.sl.style.backgroundPositionX=`${t.x}px`,this.sl.style.backgroundPositionY=`${t.y}px`)}onClick(){this.Sl?this.bl():this.yl(),this.Sl=!this.Sl}}class mr extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),sr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:-1,y:-1})}}class yr extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),or)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:-1,y:0})}}class xr extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),ar)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:0,y:-1})}}class Sr extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),rr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:1,y:1})}}class vr extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),hr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:1,y:0})}}class br extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),lr)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:0,y:1})}}class Mr extends pr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.pl=ur,this.ml=cr,this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),this.pl)}onToggledStateAction(){this.rl.setAnimationsEnabled(!1)}onInitialStateAction(){this.rl.setAnimationsEnabled(!0)}}class Ar extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),nr)}onClick(){this.rl.forEachAxis((t=>{t.fit(!0)}))}}class kr extends gr{constructor(t,e,i){super(t,e.shape||Rr,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.nl(r,n,o,h),this.Al=e.action}onClick(){this.Al(this.rl)}}class wr extends pr{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.rl=i,this.wl=s,this.pl=fr,this.ml=dr,this.nl(Br,this.pl)}vl(){this.Ml(this.pl),this.il.style.backgroundColor=Br,this.il.style.border="2px solid #707070",this.il.style.margin="0px"}xl(){this.Ml(this.ml),this.il.style.background="#FECC00 0% 0% no-repeat padding-box",this.il.style.border="10px solid #BCBCBC12",this.il.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.wl)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.wl)||void 0===t||t.style.setProperty("display","none")}}var Dr;e.MouseStyles=void 0,(Dr=e.MouseStyles||(e.MouseStyles={})).Move="move",Dr.ResizeColumn="col-resize",Dr.ResizeRow="row-resize",Dr.Horizontal="ew-resize",Dr.Vertical="ns-resize",Dr.NorthWest="nw-resize",Dr.NorthEast="ne-resize",Dr.Copy="copy",Dr.CrossHair="crosshair",Dr.Default="default",Dr.Help="help",Dr.Restricted="not-allowed",Dr.None="none",Dr.Point="pointer",Dr.Text="text",Dr.Wait="wait",Dr.ZoomIn="zoom-in",Dr.ZoomOut="zoom-out";const Er={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)},Tr=new L({color:A(255,255,255,0)}),Ir=new tt({thickness:1,fillStyle:Tr}),Cr=60,Pr=60,Or="1.0",Fr="osm/osm-sprite-transparent.png",Rr=e.OnScreenMenuButtonShape.Circle,Br="#363636";var zr;e.OSMPosition=void 0,(zr=e.OSMPosition||(e.OSMPosition={}))[zr.TopRight=0]="TopRight",zr[zr.TopLeft=1]="TopLeft",zr[zr.BottomLeft=2]="BottomLeft",zr[zr.BottomRight=3]="BottomRight";const _r=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.Il?(this.Tl.splice(t,1),t-=1):this.Tl[t].state&&(s=!0);return this.Cl?0===e.interactions.length&&(this.Tl.push({state:!1,time:i}),this.Cl=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.Tl.push({state:!0,time:i}),s=!0,this.Cl=!0),s}Zs(t,e,i){if(i){const i=this.Tl.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Fl(t,e),this.Tl.length=0)}}},Vr=class{constructor(t,e,i,s=1,r=100){this.Pl=t,this.Dl=e,this.Bl=i,this.Ol=s,this.Ll=r}kl(t,e){const i=e.interactions.length;if(i===this.Ol){if(void 0!==this.Rl)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=_r(t);let s=0;for(let r=0;r{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 Hr{constructor(){this.Ui=!0,this.P=new r.Eventer,this.Gl=0,this.Wl=(t,e)=>{0===this.Gl&&this.P.emit("mouseEnter",this,e),this.Gl+=1},this.Hl=(t,e)=>{this.Gl-=1,this.Gl<1&&(this.P.emit("mouseLeave",this,e),this.Gl=0)},this.Ul=(t,e)=>{this.P.emit("mouseClick",this,e)},this.$l=(t,e)=>{this.P.emit("mouseDoubleClick",this,e)},this.Yl=(t,e)=>{this.P.emit("mouseDown",this,e)},this.Xl=(t,e)=>{this.P.emit("mouseUp",this,e)},this.jl=(t,e)=>{this.P.emit("mouseMove",this,e)},this.Zl=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.Kl=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.ql=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Jl=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.Ql=(t,e)=>{this.Gl+=1,this.P.emit("touchStart",this,e)},this.tc=(t,e)=>{this.P.emit("touchMove",this,e)},this.ic=(t,e)=>{this.Gl-=1,this.P.emit("touchEnd",this,e)},this.sc=t=>(t instanceof Ps?t.setMouseEnterEventHandler(this.Wl).setMouseLeaveEventHandler(this.Hl).setMouseClickEventHandler(this.Ul).setMouseDoubleClickEventHandler(this.$l).setMouseDownEventHandler(this.Yl).setMouseUpEventHandler(this.Xl).setMouseMoveEventHandler(this.jl).setMouseDragEventHandler(this.Kl).setMouseDragStartEventHandler(this.Zl).setMouseDragStopEventHandler(this.ql).setMouseWheelEventHandler(this.Jl).setTouchStartEventHandler(this.Ql).setTouchMoveEventHandler(this.tc).setTouchEndEventHandler(this.ic):(t.onMouseEnter(this.Wl),t.onMouseLeave(this.Hl),t.onMouseClick(this.Ul),t.onMouseDoubleClick(this.$l),t.onMouseDown(this.Yl),t.onMouseUp(this.Xl),t.onMouseMove(this.jl),t.onMouseDrag(this.Kl),t.onMouseDragStart(this.Zl),t.onMouseDragStop(this.ql),t.onMouseWheel(this.Jl),t.onTouchStart(this.Ql),t.onTouchMove(this.tc),t.onTouchEnd(this.ic)),t)}onMouseEnter(t){return this.P.on("mouseEnter",t)}onMouseLeave(t){return this.P.on("mouseLeave",t)}onMouseClick(t){return this.P.on("mouseClick",t)}onMouseDoubleClick(t){return this.P.on("mouseDoubleClick",t)}onMouseDown(t){return this.P.on("mouseDown",t)}onMouseUp(t){return this.P.on("mouseUp",t)}onMouseMove(t){return this.P.on("mouseMove",t)}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offMouseEnter(t){return this.P.off(t,"mouseEnter")}offMouseLeave(t){return this.P.off(t,"mouseLeave")}offMouseClick(t){return this.P.off(t,"mouseClick")}offMouseDoubleClick(t){return this.P.off(t,"mouseDoubleClick")}offMouseDown(t){return this.P.off(t,"mouseDown")}offMouseUp(t){return this.P.off(t,"mouseUp")}offMouseMove(t){return this.P.off(t,"mouseMove")}offMouseDragStart(t){return this.P.off(t,"mouseDragStart")}offMouseDrag(t){return this.P.off(t,"mouseDrag")}offMouseDragStop(t){return this.P.off(t,"mouseDragStop")}offMouseWheel(t){return this.P.off(t,"mouseWheel")}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}getIsUnderMouse(){return this.Gl>0}setVisible(t){const e=this.Ui!==t;return this.Ui=t,e&&this.P.emit("visibleStateChanged",this,this.Ui),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Ur=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.ti(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.ti({x:o.x.getInnerStart(),y:o.y.getInnerStart()},ei({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.ti({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},ei({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)}},Xr=(t,e,i,s,r)=>{Ur(t,r,e)},jr=(t,e,i,s,r)=>{Ur(t,s,r)};class Yr extends Hr{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.xe=!1,this.hc=void 0,this.rc=void 0,this.nc=Wr,this.oc=void 0,this.ac=()=>{const t="function"==typeof this.nc?this.nc(this):this.nc;t&&(this.rc=this.Hr.Wi.Oe(t))},this.lc=()=>{this.Hr.Wi.Le(this.rc)},this.Pt=x(0,0,0,0),this.Hr=t,this.renderingScale=e,this.scale=i,this.bt=s,this.fs=r,this.Hr.Gi(),this.onMouseEnter(this.ac),this.onMouseLeave(this.lc),this.onMouseDrag(Xr);const n=Lr(new Vr(At,jr,At));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.fs=r}setEffect(t){return this.cc=this.cc||this.Hr.Wi.cc.uc(this,{dc:{shapes:this.fc()}}),this.cc.dc.Is(t),this}getEffect(){return!!this.cc&&this.cc.dc.Ps()}setAutoDispose(t){return this.oc=t,this.Hr.Gi(),this}getAutoDispose(){return this.oc}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this.Pt.left+this.Pt.right),this.size.y+(this.Pt.bottom+this.Pt.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this.Pt="object"==typeof t?v(this.Pt,t):{left:t,top:t,right:t,bottom:t},this.Hr.Gi(),this}getMargin(){return this.Pt}gc(){if(this.oc){const t=this.size,e=this.renderingScale.$t(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.oc.type&&i.x>=this.oc.maxWidth||"max-height"===this.oc.type&&i.y>=this.oc.maxHeight)&&this.dispose()}return this}Zs(){return this}dispose(){return this.xe||(this.Hr.Gi(),this.xe=!0,this.bt(this),this.P.emit("dispose",this)),this}setVisible(t){return super.setVisible(t),this.Hr.Gi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setPosition(t){return this.position=t,this.Hr.Gi(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.ti(this.position,ei({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.ti(r,ei({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.ti(r,{x:this.Pt.left,y:this.Pt.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.ti(n,ei({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Hr.Gi(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.hc=t,this.Hr.Gi(),this}getDraggingMode(){return void 0!==this.hc?this.hc:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.nc=t,this}getMouseStyle(){return this.nc}}class $r extends Yr{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.pn=x(),this.mc=0,this.Hr=t,this.Sc=s,this.backgroundElement=new this.Sc(this.Hr,this.renderingScale,this.scale,At,n),this.sc(this.backgroundElement)}fc(){return this.backgroundElement.fc()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setBackground(t){return t(this.backgroundElement),this}getBackground(){return this.backgroundElement}gc(){return super.gc(),this.xe||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).gc(),this}Zs(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.yc(t).Zs(),super.Zs()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.pn="object"==typeof t?v(this.pn,t):{left:t,top:t,right:t,bottom:t},this.Hr.Gi(),this}getPadding(){return this.pn}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.pn.left+this.pn.right,i.y+this.pn.bottom+this.pn.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.xc()+this.backgroundElement.bc(),i.y+this.backgroundElement.vc()+this.backgroundElement.Mc())),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.ti(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.ti(n,ei({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.ti(n,{x:this.backgroundElement.xc(),y:this.backgroundElement.vc()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.ti(o,ei({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.ti(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.ti(a,ei({x:(t.x+1)/2,y:(t.y+1)/2},l))}setMouseInteractions(t){return this.backgroundElement.setMouseInteractions(t),this}getMouseInteractions(){return this.backgroundElement.getMouseInteractions()}getHighlight(){return this.mc}setHighlight(t){return this.mc=ye(t),this.backgroundElement.setHighlight(t),this.P.emit("highlight",t),this}}const Zr=t=>"setBackground"in t;class qr extends Hr{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.u=0,this._c=1,this.Ac=!0,this.wc=new $i,this.kc=!0,this.xe=!1,this.axisScale=s,this.renderingScale=r,this.Cc=o,this.Tc=h,this.Ic=a,this.bt=l,this.Fc=e,this.Pc=i,this.Dc=this.sc(this.Fc.Bc(this.renderingScale)),this.fs=u,this.Oc=this.sc(this.Ic.Lc(this.Pc,this.renderingScale,n,At,this.fs,!1).setOrigin(Yt(this.Tc)).setDirection(this.Tc)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Oc.Rc?this.Dc.ua(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Oc.Rc?this.Dc.ua(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Oc.Rc&&this.Dc.ua(u.cursorGridStrokeStyleX)}setValue(t){return this.u=t,this.Pc.Gi(),this.P.emit("valueChange",this.u),this}getValue(){return this.u}setTextFormatter(t){return this.Ec=t,this.Pc.Gi(),this}setTickLength(t){return this.Oc.setPointerLength(t),this.Fc.Gi(),this}getTickLength(){return this.Oc.getPointerLength()}setTickLabelPadding(t){return this.Oc.setTickLabelPadding(t),this.Fc.Gi(),this}setTickLabelRotation(t){return this.Oc.setTextRotation(t),this.Fc.Gi(),this}getTickLabelRotation(){return this.Oc.getTextRotation()}getTickLabelPadding(){return this.Oc.getTickLabelPadding()}setGridStrokeLength(t){return this._c=t,this.Fc.Gi(),this}getGridStrokeLength(){return this._c}setGridStrokeStyle(t){return this.Dc.ua(t),this.Fc.Gi(),this}getGridStrokeStyle(){return this.Dc.da()}dispose(){return this.xe||(this.xe=!0,this.Dc.dispose(),this.Oc.dispose(),this.bt(this),this.Fc.Wi.Gi(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setMarkerVisible(t){return this.Ac=t,this.Pc.Gi(),this}getMarkerVisible(){return this.Ac}setMarker(t){return t(this.Oc),this.Pc.Gi(),this}getMarker(){return this.Oc}setMouseInteractions(t){return this.Oc.setMouseInteractions(t),this.Dc.setMouseInteractions(t),this}getMouseInteractions(){return this.Dc.getMouseInteractions()}setAllocatesAxisSpace(t){return this.kc=t,this.Pc.Gi(),this}getAllocatesAxisSpace(){return this.kc}isInScale(){return Re(this.u,this.axisScale.getInnerStart(),this.axisScale.getInnerEnd())}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}}class Kr extends qr{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.zc=!1,this.bt=a,this.Fc=e,this.Pc=i}dispose(){return this.zc=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.zc=!1;const r=rt(this.u,this.axisScale,this.Cc.getWidth(this.renderingScale));this.Dc.setVisible(!0).Sa(this.Cc.toPoint(r,t)).ha(this.Cc.toPoint(r,t-(i+e*this._c))),this.Ac?(this.Ec&&this.Oc.setText(this.Ec(this.u,this)),this.Oc.setVisible(!0).setPosition(this.Cc.toPoint(r,s))):this.Oc.setVisible(!1)}else this.Dc.setVisible(!1),this.Oc.setVisible(!1);return this.Oc.Zs().gc(),this}Vc(){const t=this.Oc.Zs().getSize();return this.Cc.getHeight(t)}}var Jr;e.HighlightModes=void 0,(Jr=e.HighlightModes||(e.HighlightModes={}))[Jr.noHighlighting=0]="noHighlighting",Jr[Jr.onHover=1]="onHover",Jr[Jr.onHoverIndividual=2]="onHoverIndividual";class Qr{constructor(t,i,s,n){this.Nc=!0,this.Gc=e.HighlightModes.onHover,this.xe=!1,this.Ui=!0,this.Wc=0,this.P=new r.Eventer,this.Hc=[],this.Uc=(t,e)=>{this.setVisible(e)},this.$c=()=>this.setHighlight(1),this.Yc=()=>this.setHighlight(0),this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.Xc=(t,e)=>{0===this.Wc&&this.P.emit("mouseEnter",this,e),this.jc()},this.Zc=(t,e)=>{1===this.Wc&&this.P.emit("mouseLeave",this,e),this.Kc()},this.qc=(t,e)=>{this.P.emit("mouseMove",this,e),this.Jc()},this.Qc=(t,e)=>this.P.emit("mouseClick",this,e),this.tu=(t,e)=>this.P.emit("mouseDoubleClick",this,e),this.iu=(t,e)=>this.P.emit("mouseDown",this,e),this.su=(t,e)=>this.P.emit("mouseUp",this,e),this.eu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.hu=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.ru=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.nu=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.ou=(t,e)=>{this.P.emit("touchStart",this,e),this.jc()},this.au=(t,e)=>{this.P.emit("touchMove",this,e),this.Jc()},this.lu=(t,e)=>{this.P.emit("touchEnd",this,e),this.Kc()},this.rl=t,this.cu=i,this.fs=s,this.be=new Map,this.uu=n,this.cc=this.uu.uc(this,{du:{themeEffectEnabled:this.fs.effectsText},fu:{}}),this.rl.Wi.Zh.ke(this,(t=>{this.be.forEach(((e,i)=>i.zr(t))),this.Hc.forEach((e=>{e.setHighlight(t)}))}),{animationEnabled:this.rl.getAnimationsEnabled()})}gu(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.be.set(t,{isText:s});const r=Array.from(this.be);this.cc.du.pu(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.cc.fu.pu(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Nc).setVisible(this.Ui).zr(this.getHighlight()),i&&t.setMouseEnterEventHandler(this.Xc).setMouseLeaveEventHandler(this.Zc).setMouseClickEventHandler(this.Qc).setMouseDoubleClickEventHandler(this.tu).setMouseDownEventHandler(this.iu).setMouseUpEventHandler(this.su).setMouseMoveEventHandler(this.qc).setMouseDragStartEventHandler(this.eu).setMouseDragEventHandler(this.hu).setMouseDragStopEventHandler(this.ru).setMouseWheelEventHandler(this.nu).setTouchStartEventHandler(this.ou).setTouchMoveEventHandler(this.au).setTouchEndEventHandler(this.lu)}mu(t){this.be.delete(t)}setEffect(t){return this.cc.du.Is(t&&this.fs.effectsText),this.cc.fu.Is(t),this.rl.Wi.Gi(),this}getEffect(){return this.cc.du.Ps()||this.cc.fu.Ps()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setName(t){return this.Su=t,this.Hc.forEach((t=>t.setText(this.Su))),this}getName(){return this.Su}dispose(){return this.xe||(this.xe=!0,this.be.forEach(((t,e)=>e.dispose())),this.cu(this),this.Hc.forEach((t=>{t.dispose()})),this.Hc.length=0,this.P.emit("dispose",this),this.rl.Wi.Gi()),this}setVisible(t){return t===this.Ui||(this.Ui=t,this.be.forEach(((e,i)=>i.setVisible(t))),this.Hc.forEach((e=>e.setOn(t))),this.P.emit("visibleStateChanged",this,this.Ui),this.rl.Wi.Gi()),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setHighlight(t){return this.rl.Wi.Zh.Ie(this,t),this.P.emit("highlight",t),this}getHighlight(){return this.rl.Wi.Zh.Fe(this)}setAnimationHighlight(t){return this.rl.Wi.Zh.Pe(this,t),this}getAnimationHighlight(){return this.rl.Wi.Zh.De(this)}setMouseInteractions(t){return this.Nc=t,this.be.forEach(((e,i)=>i.setMouseInteractions(t))),this.rl.Wi.Gi(),this}getMouseInteractions(){return this.Nc}getIsUnderMouse(){return this.Wc>0}setHighlightOnHover(t){return this.Gc=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Gc!==e.HighlightModes.noHighlighting}attach(t,e=!0){t.setText(this.Su),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1));const i=t.getLocked();return t.setLocked(!1).setOn(this.getVisible()).setLocked(i),e&&t.onSwitch(this.Uc),t.setLocked(!e),t.onMouseEnter(this.$c),t.onMouseLeave(this.Yc),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.Hc.push(t),this}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}onDispose(t){return this.P.on("dispose",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}offDispose(t){return this.P.off(t,"dispose")}jc(t=1){this.Wc+=t,this.Wc===t&&this.Gc===e.HighlightModes.onHover&&this.setHighlight(!0)}Kc(t=1){this.Wc=Math.max(0,this.Wc-t),0===this.Wc&&this.Gc===e.HighlightModes.onHover&&this.setHighlight(!1)}Jc(){}}class tn extends Qr{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Hr=t,this.axis=s,this.ut=r,this.yu=n,this.xu()}}class en extends tn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Su="Band",this.bu=0,this.vu=0,this.jr=this.fs.bandFillStyle,this.tn=this.fs.bandStrokeStyle,this.Mu=this.Hr._u(this.ut).As(this.jr).ir(this.tn).zr(this.getHighlight()),this.gu(this.Mu)}setValueStart(t){return this.bu=t,this.P.emit("valueChange",this,this.bu,this.vu),this.Hr.Gi(),this}getValueStart(){return this.bu}setValueEnd(t){return this.vu=t,this.P.emit("valueChange",this,this.bu,this.vu),this.Hr.Gi(),this}getValueEnd(){return this.vu}setFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;return this.Mu.As(e),this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){this.tn="function"==typeof t?t(this.tn):t;const e=this.tn;return this.Mu.ir(e),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}gc(){return this.Mu.Cn(this.yu.toVec2(this.bu,this.yu.getHeight(this.ut).getInnerStart())).q(this.yu.toVec2(this.vu-this.bu,this.yu.getHeight(this.ut).getInnerInterval())),this}attach(t,e){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}Au(t,e){t.zr(e),this.Hr.Gi()}xu(){let t,i;const s=(e,s)=>{const r=nt(this.Hr.Wi.Re(s.x,s.y),this.Hr.Wi.ut,this.ut),n=this.yu.getWidth(r),o=this.axis.ut.ct(this.bu),h=this.axis.ut.ct(this.vu),a=(this.axis.ut.ct(n)-o)/(h-o);t=!(a<.1||a>.9),!1===t&&(i=a<.5)},r=(e,s,r,n,o)=>{const h=this.yu.getWidth(n);t?(this.bu=this.axis.ut.ti(this.bu,h),this.vu=this.axis.ut.ti(this.vu,h)):i?this.bu=this.axis.ut.ti(this.bu,h):this.vu=this.axis.ut.ti(this.vu,h),Zt(o),this.P.emit("valueChange",this,this.bu,this.vu),this.Hr.Gi()};this.onMouseMove(((i,r)=>{s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.yu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.wu=this.rl.engine.setMouseStyle(n,this.wu)})),this.onMouseLeave((()=>{this.rl.engine.restoreMouseStyle(this.wu),this.wu=void 0})),this.onMouseDrag(((t,e,i,s,n)=>{0===i&&r(0,0,0,n,e)}));const n=Lr(new Vr(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class sn extends tn{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.Su="Constant Line",this.u=0,this.tn=this.fs.constantLineStrokeStyle,this.ku=!0,this.Cu=this.Hr.Bc(this.ut).ua(this.tn).zr(this.getHighlight()),this.gu(this.Cu)}setValue(t){return this.u=t,this.P.emit("valueChange",this,this.u),this.Hr.Gi(),this}getValue(){return this.u}setStrokeStyle(t){this.tn="function"==typeof t?t(this.tn):t;const e=this.tn;return this.Cu.ua(e),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}setInteractionMoveByDragging(t){return this.ku=t,this}getInteractionMoveByDragging(){return this.ku}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}gc(){return this.Cu.Sa(this.yu.toVec2(this.u,this.yu.getHeight(this.ut).getInnerStart())).ha(this.yu.toVec2(this.u,this.yu.getHeight(this.ut).getInnerEnd())),this}attach(t,e){return super.attach(t,e),ae(t,this.fs,{stroke:this.tn}),this}Au(t,e){t.zr(e),this.Hr.Gi()}xu(){const t=(t,e)=>{this.ku&&(this.u=this.axis.ut.ti(this.u,this.yu.getWidth(e)),this.P.emit("valueChange",this,this.u),this.Hr.Gi(),Zt(t))};this.onMouseMove((()=>{if(this.ku){const t=this.yu.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.wu=this.rl.engine.setMouseStyle(t,this.wu)}})),this.onMouseLeave((()=>{this.ku&&(this.rl.engine.restoreMouseStyle(this.wu),this.wu=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.ku&&0===s&&t(i,n)}));const i=Lr(new Vr(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const rn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),nn=(t,e)=>(ae(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),on=(t,e,i)=>{i&&Zr(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},hn={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}},an={background:void 0,setBackground(t){return{...this,background:t}}},ln={Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return on(o,r,n),o}},un={Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return on(o,r,n),o}};class cn extends Yr{constructor(){super(...arguments),this.Tu=!0}gc(){return super.gc(),this}setMouseInteractions(t){return this.Tu=t,this}getMouseInteractions(){return this.Tu}fc(){return[]}}class dn extends cn{onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}yc(t){return this.size=t,this}xc(){return 0}bc(){return 0}Mc(){return 0}vc(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return B}setStrokeStyle(){return this}getStrokeStyle(){return J}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class fn extends dn{constructor(){super(...arguments),this.setSize=this.yc.bind(this)}}class gn extends Yr{constructor(){super(...arguments),this.jr=B,this.P=new r.Eventer,this.mc=0}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}fc(){return[this.Gn]}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Gn.As(this.jr),this.Hr.Gi(),this}getFillStyle(){return this.jr}getHighlight(){return this.mc}setHighlight(t){return this.mc=t,this.Gn.zr(t),this.P.emit("highlight",t),this.Hr.Gi(),this}setMouseInteractions(t){return this.Gn.setMouseInteractions(t),this}getMouseInteractions(){return this.Gn.getMouseInteractions()}dispose(){return super.dispose(),this.Gn.dispose(),this}setVisible(t){return super.setVisible(t),this.Gn.setVisible(t),this}}class pn extends gn{constructor(){super(...arguments),this.tn=J}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.Gn.ir(this.tn),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}}class mn extends pn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Hr=t,this.Gn=this.Hr.Iu(this.renderingScale,Ys.Simple).ir(this.getStrokeStyle()).As(this.getFillStyle()).setVisible(!1),this.sc(this.Gn)}Fu(){const t=this.Pu();if(t.length>2){const e=Ve(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=Qe(t,Je(e.min,-1));return this.scale.ti(this.position,Qe(s,ei(Je(Qe(this.origin,u(1,1)),-.5),i)))})).map((t=>nt(t,this.scale,this.renderingScale)));this.Gn.yo(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Gn&&this.Gn.setVisible(!1),this.setContentSize(u(0,0))}gc(){return super.gc(),this.xe||this.Fu(),this}Zs(){return this.Fu(),super.Zs()}setVisible(t){return super.setVisible(t),this.Gn.setVisible(t),this}}class yn extends gn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.nn="label",this.Gn=this.Hr.ye(this.renderingScale).As(this.jr).Ms(this.nn),this.sc(this.Gn)}gc(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=nt(t,this.scale,this.renderingScale);return this.Gn.Cn(i),this}Zs(){this.Gn.Zs();const t=0===this.nn.length?u(0,0):this.Gn.Du();return this.setContentSize(t),super.Zs()}setText(t){return this.nn=t,this.Gn.Ms(this.nn),this.Hr.Gi(),this}getText(){return this.nn}setFont(t){return this.Gn.ks(t),this.Hr.Gi(),this}getFont(){return this.Gn.ws()}setTextRotation(t){return this.Gn.Cs(t),this.Hr.Gi(),this}getTextRotation(){return this.Gn.Ts()}}const xn={...hn,...ln,uiElement:yn};class Sn extends pn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.yc.bind(this),this.setSize=this.fitTo,this.Gn=this.Hr._u(e).As(this.jr).ir(this.getStrokeStyle()),this.sc(this.Gn)}gc(){const t=Ve([this.getPosition(u(-1,-1),e.UISpace.Content),this.getPosition(u(1,1),e.UISpace.Content)].map((t=>nt(t,this.scale,this.renderingScale)))),i={x:t.max.x-t.min.x,y:t.max.y-t.min.y};return this.Gn.q(i).Cn(nt(this.getPosition(u(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)),this}yc(t){return this.setContentSize(t),this.Hr.Gi(),this}xc(){return 0}bc(){return 0}Mc(){return 0}vc(){return 0}}class vn extends pn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Bu=u(0,0),this.setSize=this.fitTo.bind(this),this.Gn=t.Ou(e).ea(0).ha(360).As(this.jr).ir(this.getStrokeStyle()),this.sc(this.Gn)}gc(){const t=this.getSize(e.UISpace.Content).x/2;return this.Gn.na(t*this.renderingScale.wi().x).oa(t*this.renderingScale.wi().y).Cn(nt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).la(255).Zs(),this}yc(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.Bu=t,this.Hr.Gi(),this}xc(){return(this.getSize(e.UISpace.Content).x-this.Bu.x)/2}bc(){return(this.getSize(e.UISpace.Content).x-this.Bu.x)/2}Mc(){return(this.getSize(e.UISpace.Content).y-this.Bu.y)/2}vc(){return(this.getSize(e.UISpace.Content).y-this.Bu.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.Bu=t,this}}class bn extends mn{constructor(t,e,i,s,r){super(t,e,i,Ys.Simple,s,r),this.Lu=y(u(0,0)),this.Ru=!1,this.setSize=this.fitTo.bind(this),this.Hr=t,this.Fu()}Pu(){const t=this.Lu.M();if(this.Ru){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.Lu.M().x*this.Lu.M().x/4+this.Lu.M().y*this.Lu.M().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=Qe(r,Qe(i,s)),o=Qe(n,Qe(s,Je(i,-1)));return[r,n,o,ti(o,Qe(i,s))]}yc(t){return this.Lu.S(t),this.Ru=!1,this.Hr.Gi(),this}xc(){return this.Ru?0:(this.getSize(e.UISpace.Content).x-this.Lu.M().x)/2}bc(){return this.Ru?0:(this.getSize(e.UISpace.Content).x-this.Lu.M().x)/2}Mc(){return this.Ru?0:(this.getSize(e.UISpace.Content).y-this.Lu.M().y)/2}vc(){return this.Ru?0:(this.getSize(e.UISpace.Content).y-this.Lu.M().y)/2}fitTo(t){return this.Lu.S(t),this.Ru=!0,this.Hr.Gi(),this}}class Mn extends mn{constructor(t,i,s,r,n){super(t,i,s,Ys.Simple,r,n),this.Eu=y(u(0,0)),this.zu=y(10),this.Vu=y(void 0),this.Tc=y(e.UIDirections.Right),this.Fu()}setDirection(t){return this.Tc.S(t),this.Hr.Gi(),this}getDirection(){return this.Tc.M()}setPointerLength(t){return this.zu.S(t),this.Hr.Gi(),this}getPointerLength(){return this.zu.M()}setPointerAngle(t){return this.Vu.S(t),this.Hr.Gi(),this}getPointerAngle(){let t=this.Vu.M();if(void 0===t){const e=this.Nu();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)}yc(t){return this.Eu.S(t),this.Hr.Gi(),this}Gu(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Wu(){return $t(this.Tc.M())?this.Eu.M().x:this.Eu.M().y}Nu(){return $t(this.Tc.M())?this.Eu.M().y:this.Eu.M().x}xc(){switch(this.Tc.M()){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.Gu()-this.Nu());default:return 0}}bc(){switch(this.Tc.M()){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.Gu()-this.Nu());default:return 0}}Mc(){switch(this.Tc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Gu()-this.Nu());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}vc(){switch(this.Tc.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Gu()-this.Nu());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}Pu(){const t=Yt(this.Tc.M()),e=qe(u(0,0),t),i=this.getPointerLength(),s=this.Gu(),r=this.Wu(),n=this.Nu();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=Qe(Qe(o,Je(t,-i)),Je(e,s/2)),a=Qe(h,Je(e,(n-s)/2)),l=Qe(a,Je(t,-r)),c=Qe(Qe(o,Je(t,-i)),Je(e,-s/2)),d=Qe(c,Je(e,-(n-s)/2)),f=Qe(d,Je(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:kt(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class An extends cn{setSize(t){return this.setContentSize(t),this.Hr.Gi(),this}}class kn extends $r{constructor(){super(...arguments),this.Hu=[],this.Uu=0,this.$u=t=>{const e=this.Hu.indexOf(t);e>=0&&this.Hu.splice(e,1)}}getMembers(){return this.Hu}getMemberCount(){return this.Hu.length}setMinimumSize(t){return this.Yu=t,this.Hr.Gi(),this}getMinimumSize(){return this.Yu}addElement(t,e=-1){const i=t.Lc(this.Hr,this.renderingScale,this.scale,this.$u,this.fs,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Hu.splice(e,0,i):this.Hu.push(i),i.setVisible(this.getVisible()),this.sc(i),this.xe&&(ge(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Hu.slice().forEach(Mt),this}setVisible(t){return super.setVisible(t),this.Hu.forEach((e=>e.setVisible(t))),this}setMouseInteractions(t){super.setMouseInteractions(t);for(let e=0;et+ +(e instanceof An)),0),s=i>0?(this.size.x-this.Uu)/i:0;return this.Hu.reduce(((e,i)=>i instanceof An?this.scale.ti({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).gc().getPosition(u(1,0)).x),t.x),this}Zs(){for(let t=0;tt+ +(e instanceof An)),0),s=i>0?(this.size.y-this.Uu)/i:0;return this.Hu.reduce(((e,i)=>i instanceof An?this.scale.ti({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).gc().getPosition(u(0,-1)).y),t.y),this}Zs(){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},Rn=Fn("Text",[]),Bn={button:void 0,isLocked:!1,setOn(t){if(!this.isLocked){const e=this.button.getOn()!==t;this.button.setOn(t),e&&this.P.emit("switch",t)}return this},getOn(){return this.button.getOn()},setLocked(t){return this.isLocked=t,this},getLocked(){return this.isLocked},onSwitch(t){return this.P.on("switch",(e=>t(this,e)))},offSwitch(t){return this.P.off(t,"switch")},setButtonOffFillStyle(t){return this.button.setOffFillStyle(t),this},getButtonOffFillStyle(){return this.button.getOffFillStyle()},setButtonOffStrokeStyle(t){return this.button.setOffStrokeStyle(t),this},getButtonOffStrokeStyle(){return this.button.getOffStrokeStyle()},setButtonOffSize(t){return this.button.setOffSize(t),this},getButtonOffSize(){return this.button.getOffSize()},setButtonOnFillStyle(t){return this.button.setOnFillStyle(t),this},getButtonOnFillStyle(){return this.button.getOnFillStyle()},setButtonOnStrokeStyle(t){return this.button.setOnStrokeStyle(t),this},getButtonOnStrokeStyle(){return this.button.getOnStrokeStyle()},setButtonOnSize(t){return this.button.setOnSize(t),this},getButtonOnSize(){return this.button.getOnSize()}},zn={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()}},_n={...hn,...an,background:Sn,Lc(t,e,i,s,r,n){const o=new wn(t,e,i,this.background,s,r),h=o.addElement(xn,void 0),a=Object.assign(o,On,{setTextLabel:h},Rn,{stylableTexts:[h]});return on(a,r,n),this.applyStylers(a,r)}}.addStyler(rn),Ln={...hn,...an,background:Mn,Lc(t,i,s,r,n,o){const h=new wn(t,i,s,this.background,r,n),a=h.addElement(xn,void 0),l=h.getBackground(),u=Object.assign(h,On,{setTextLabel:a},Rn,{stylableTexts:[a]},zn,{pointable:l},{setTickLabelPadding(t){return this.getDirection()===e.UIDirections.Up?this.setPadding({top:t}):this.getDirection()===e.UIDirections.Down?this.setPadding({bottom:t}):this.getDirection()===e.UIDirections.Right?this.setPadding({right:t}):this.getDirection()===e.UIDirections.Left&&this.setPadding({left:t}),this},getTickLabelPadding(){return this.getDirection()===e.UIDirections.Up?this.getPadding().top:this.getDirection()===e.UIDirections.Down?this.getPadding().bottom:this.getDirection()===e.UIDirections.Right?this.getPadding().right:this.getPadding().left}});return u.Rc="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))),on(u,n,o),this.applyStylers(u,n)}};class Gn extends Yr{constructor(t,e,i,s,n,o,h){super(t,e,i,o,h),this.Cl=!1,this.P=new r.Eventer,this.getOn=()=>this.Cl,this.ju=this.sc(new s(this.Hr,this.renderingScale,this.scale,At,h)),this.Zu=this.sc(new n(this.Hr,this.renderingScale,this.scale,At,h))}fc(){return[...this.ju.fc(),...this.Zu.fc()]}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setOn(t){return this.Cl=t,this.Hr.Gi(),this}setOffFillStyle(t){return this.ju.setFillStyle(t),this}getOffFillStyle(){return this.ju.getFillStyle()}setOffStrokeStyle(t){return this.ju.setStrokeStyle(t),this}getOffStrokeStyle(){return this.ju.getStrokeStyle()}setOffSize(t){return this.ju.fitTo("number"==typeof t?u(t,t):t),this}getOffSize(){return this.ju.getSize()}setOnFillStyle(t){return this.Zu.setFillStyle(t),this}getOnFillStyle(){return this.Zu.getFillStyle()}setOnStrokeStyle(t){return this.Zu.setStrokeStyle(t),this}getOnStrokeStyle(){return this.Zu.getStrokeStyle()}setOnSize(t){return this.Zu.fitTo("number"==typeof t?u(t,t):t),this}getOnSize(){return this.Zu.getSize()}gc(){return super.gc(),this.Cl?(this.ju.setVisible(!1),this.Zu.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).gc()):(this.ju.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).gc(),this.Zu.setVisible(!1)),this}Zs(){const t=this.ju.Zs().getSize(),e=this.Zu.Zs().getSize();return this.setContentSize(u(Math.max(t.x,e.x),Math.max(t.y,e.y))),super.Zs()}dispose(){return super.dispose(),this.ju.dispose(),this.Zu.dispose(),this}setMouseInteractions(t){return this.Zu.setMouseInteractions(t),this.ju.setMouseInteractions(t),this}getMouseInteractions(){return this.Zu.getMouseInteractions()}setHighlight(t){const e=ye(t);return this.Zu.setHighlight(e),this.ju.setHighlight(e),this.P.emit("highlight",t),this.Hr.Gi(),this}getHighlight(){return this.Zu.getHighlight()}}const Vn={...hn,uiElement:Gn,pictureOff:vn,pictureOn:vn,setPictureOff(t){return{...this,pictureOff:t}},setPictureOn(t){return{...this,pictureOn:t}},Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.pictureOff,this.pictureOn,s,r),r);return on(o,r,n),o}},Nn={...hn,...an,background:Sn,buttonBuilder:Vn,setPictureOff(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOff(t)}},setPictureOn(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOn(t)}},Lc(t,i,s,r,n,o){const h=new wn(t,i,s,this.background,r,n),a=h.addElement(Cn);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(Cn);u.addGap();const c=u.addElement(xn);u.addGap(),h.addGap();const d=Object.assign(h,On,{setTextLabel:c},Rn,{stylableTexts:[c]},Bn,{button:l});return d.onMouseClick(((t,e)=>{d.setOn(!d.getOn())})),d.onMouseEnter((()=>d.setHighlight(!0))),d.onMouseLeave((()=>d.setHighlight(!1))),d.setMouseStyle(e.MouseStyles.Point),d.setPadding({left:6}),on(d,n,o),this.applyStylers(d,n)}}.addStyler(rn).addStyler(nn);class Wn extends Yr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Ku=[],this.qu=2,this.Ju="",this.Qu=(t,e)=>void 0!==t.label?t.label:Mi(t.value,e.min,e.max),this.td=0,this.sd=0,this.ed=!1,this.Hr=t,this.hd=n,this.rd=this.sc(t._u(e).ir(J)),this.nd=this.sc(t.ye(e).As(r.uiTextFillStyle).ks(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this._t=140,this.od=25):(this._t=160,this.od=15)}fc(){return[this.rd,this.nd]}ad(t){this.ld=t;const e=Xn(t,"vertical"===this.hd?0:90,this.ed);return this.rd.As(e),this.Hr.Gi(),this}ud(){return this.ld}dd(t){return this._t=t,this.Hr.Gi(),this}fd(){return this._t}gd(t){return this.od=t,this.Hr.Gi(),this}pd(){return this.od}md(t){return this.Ju=t,this.Hr.Gi(),this}Sd(){return this.Ju}yd(t){return this.Qu=t,this.Hr.Gi(),this}setLUTDisplayProportionalSteps(t){if(this.ed=t,this.ld){const t=Xn(this.ld,"vertical"===this.hd?0:90,this.ed);this.rd.As(t)}return this.Hr.Gi(),this}getLUTDisplayProportionalSteps(){return this.ed}setFillStyle(t){return this.nd.As(t),this.Hr.Gi(),this}getFillStyle(){return this.nd._s()}setFont(t){return this.nd.ks(t),this.Hr.Gi(),this}getFont(){return this.nd.ws()}setTextRotation(t){return this.sd=t,this.nd.Cs(t),this.Hr.Gi(),this}getTextRotation(){return this.nd.Ts()}gc(){var t,i,s,r;if(super.gc(),this.xe)return this;const n=this.ld;if(n){const o=this.renderingScale.wi(),h=n.min,a=n.max;if("vertical"===this.hd){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=Qe(s,{x:this.rd.$t().x+this.qu*o.x,y:0}),l={x:r.x,y:r.y+(this.Ju.length>0?this.td*o.y+this.nd.$t().y:0)+.5*((null===(t=this.Ku[0])||void 0===t?void 0:t.$t().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Ku[this.Ku.length-1])||void 0===i?void 0:i.$t().y)||0)};this.rd.Cn({x:s.x,y:l.y}),this.nd.Ln({x:-1,y:-1}).Cn(r),n.getSteps().forEach(((t,e)=>{const i=Le(l,u,this.ed?!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.Ku[e].Ln({x:-1,y:0}).Cn(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.Ku.reduce(((t,e)=>Math.max(t,e.$t().y)),0),u=Qe(t,{x:.5*((null===(s=this.Ku[0])||void 0===s?void 0:s.$t().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Ku[this.Ku.length-1])||void 0===r?void 0:r.$t().x)||0)+(this.Ju.length>0?this.td*o.x+this.nd.$t().x:0)),y:u.y},f={x:u.x,y:u.y+this.qu*o.y};this.rd.Cn(f),this.nd.Ln({x:1,y:1}).Cn(c),n.getSteps().forEach(((t,e)=>{const i=Le(u,d,this.ed?!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.Ku[e].Ln({x:0,y:1}).Cn(i)}))}}return this}Zs(){if(this.ld&&this.getVisible()){const t=this.ld.getSteps();for(let e=this.Ku.length;eMath.max(t,e.Zs().Du().x)),0),this.nd.Zs().Du().x),s=(this.Ju.length>0?this.td+this.nd.Zs().Du().y:0)+e+.5*this.Ku[0].Zs().Du().y+.5*this.Ku[this.Ku.length-1].Zs().Du().y;this.setContentSize({x:i,y:s})}else{const t=this._t,e=this.od;this.rd.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Ju.length>0?this.td+this.nd.Zs().Du().x:0,.5*this.Ku[this.Ku.length-1].Zs().Du().x),s=t+.5*this.Ku[0].Zs().Du().x+i,r=e+this.qu+this.Ku.reduce(((t,e)=>Math.max(t,e.Zs().Du().y)),0);this.setContentSize({x:s,y:r})}}else this.Ku.forEach((t=>t.dispose())),this.Ku.length=0,this.nd.setVisible(!1),this.rd.setVisible(!1),this.setContentSize({x:0,y:0});return super.Zs()}dispose(){return super.dispose(),this.rd.dispose(),this.Ku.forEach(Mt),this.nd.dispose(),this}setMouseInteractions(t){return this.rd.setMouseInteractions(t),this}getMouseInteractions(){return this.rd.getMouseInteractions()}}const Hn={lutElement:{},setLUT(t){return this.lutElement.ad(t),this},getLUT(){return this.lutElement.ud()},setLUTLength(t){return this.lutElement.dd(t),this},getLUTLength(){return this.lutElement.fd()},setLUTThickness(t){return this.lutElement.gd(t),this},getLUTThickness(){return this.lutElement.pd()},setLookUpUnit(t){return this.lutElement.md(t),this},getLookUpUnit(){return this.lutElement.Sd()},setLUTStepValueFormatter(t){return this.lutElement.yd(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Un={...hn,...an,background:Sn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},Lc(t,e,i,s,r,n){const o=new Dn(t,e,i,this.background,s,r),h=o.addElement({Lc:()=>new Wn(t,e,i,At,r,this.alignment)}),a=Object.assign(o,Rn,{stylableTexts:[h]},Hn,{lutElement:h});return on(a,r,n),this.applyStylers(a,r)}}.addStyler(rn),Xn=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new q({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 Wn(t,i,s,At,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,On,{setTextLabel:c},Rn,{stylableTexts:[c,d]},Fn("LUTText",[d]),Bn,{button:l},Hn,{lutElement:d});return f.onMouseClick((()=>{f.setOn(!f.getOn())})),f.onMouseEnter((()=>f.setHighlight(!0))),f.onMouseLeave((()=>f.setHighlight(!1))),f.setMouseStyle(e.MouseStyles.Point),f.setPadding({left:6}),this.applyStylers(f,n)}}.addStyler(rn).addStyler(nn),Yn={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=e&&"object"==typeof e&&void 0!==e.builder?e.builder:void 0;return this.legendBoxDisposed()||(t instanceof xo?this.addChart(t,i,s):"attach"in t?this.addAttachable(t,i,s):t&&this.addDashboard(t,i,s)),this},addAttachable(t,e,i){const s=t.ud&&t.ud();let r=i;r||(r=s?jn.setAlignment(this.alignment):Nn);const n=this.addElement(r);if(s&&"setLUT"in n){n.setLUT(s.lut);const t=s.lut.getUnits(),e=s.lookUpProperty,i=t.length>0?t:"x"===e?"x":"y"===e?"y":"z"===e?"z":"";n.setLookUpUnit(i)}return this.entryStylers.forEach((t=>t(n))),this.entries.push({entry:n,component:t}),t.attach(n,e),this},addChart(t,e,i){return t.xd().forEach((t=>this.addAttachable(t,e,i))),this},addDashboard(t,e,i){return t.getCells().filter((t=>t.panel instanceof xo)).forEach((t=>this.addChart(t.panel,e,i))),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}},$n={alignment:"vertical",layoutBuilder:Cn,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Pn:Cn}},getAlignment(){return this.alignment},titleBuilder:_n,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},Zn={...hn,...an,...$n,background:Sn,Lc(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).Lc(t,e,i,s,r,!1);let h=Object.assign(o,Yn,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.xe});h.entries=[];const a=h.addElement("horizontal"===this.alignment?Cn:Pn),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}),on(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class qn extends Yr{constructor(t,i,s,r,n){super(t,i,s,r,n),this.bd=10,this.vd=e.UIDirections.Up,this.Md=0,this.Rc="major",this.nn=this.sc(t.ye(this.renderingScale)),this.Cu=this.sc(t.Bc(this.renderingScale))}fc(){return[this.nn]}gc(){if(super.gc(),this.xe)return this;const t=nt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.ti(t,{x:this.vd===e.UIDirections.Right?-this.bd:this.vd===e.UIDirections.Left?this.bd:0,y:this.vd===e.UIDirections.Up?-this.bd:this.vd===e.UIDirections.Down?this.bd:0}),s=this.renderingScale.ti(i,{x:this.vd===e.UIDirections.Right?-this.Md:this.vd===e.UIDirections.Left?this.Md:0,y:this.vd===e.UIDirections.Up?-this.Md:this.vd===e.UIDirections.Down?this.Md:0});return this.Cu.Sa(t).ha(i),this.nn.Cn(s).Ln(this.vd===e.UIDirections.Up?{x:0,y:1}:this.vd===e.UIDirections.Down?{x:0,y:-1}:this.vd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Zs(){const t=this.Cu.da(),i=t instanceof tt?t.getThickness():0;return this.size=this.vd===e.UIDirections.Left||this.vd===e.UIDirections.Right?{x:this.bd+this.Md+this.nn.Zs().Du().x,y:i}:{y:this.bd+this.Md+this.nn.Zs().Du().y,x:i},super.Zs()}dispose(){return super.dispose(),this.nn.dispose(),this.Cu.dispose(),this}setVisible(t){return super.setVisible(t),this.nn.setVisible(t),this.Cu.setVisible(t),this}setMouseInteractions(t){return this.nn.setMouseInteractions(t),this.Cu.setMouseInteractions(t),this}getMouseInteractions(){return this.nn.getMouseInteractions()}getText(){return this.nn.bs()}setTextFillStyle(t){return this.nn.As(t),this.Hr.Gi(),this}getTextFillStyle(){return this.nn._s()}setTextFont(t){return this.nn.ks(t),this}setTextRotation(t){return this.nn.Cs(t),this}getTextRotation(){return this.nn.Ts()}getTextFont(){return this.nn.ws()}setText(t){return this.nn.Ms(t),this.Hr.Gi(),this}setDirection(t){return this.vd=t,this.Hr.Gi(),this}getDirection(){return this.vd}setPointerLength(t){return this.bd=t,this.Hr.Gi(),this}getPointerLength(){return this.bd}setTickLabelPadding(t){return this.Md=t,this.Hr.Gi(),this}getTickLabelPadding(){return this.Md}setTickStyle(t){return this.Cu.ua(t),this.Hr.Gi(),this}getTickStyle(){return this.Cu.da()}}const Kn={...hn,Lc(t,e,i,s,r,n){const o=new qn(t,e,i,s,r);return on(o,r,n),this.applyStylers(o,r)}}.addStyler(rn),Jn=Kn.addStyler(((t,e)=>(t.Rc="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)))),Qn=Kn.addStyler(((t,e)=>(t.Rc="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)))),to=Nn.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),eo=Zn.setAlignment("horizontal"),io=Zn.setAlignment("vertical"),so={TextBox:_n,CheckBox:Nn,ButtonBox:to,PointableTextBox:Ln,AxisTickMajor:Jn,AxisTickMinor:Qn,LUTRange:Un},ro={HorizontalLegendBox:eo,VerticalLegendBox:io};class no extends Ui{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this._d=r,this.Ad=n}}const oo=(t,e,i)=>wt(t+.1*(e-t)+.5*i.getPixelSize()*Math.sign(e-t),t,e),ho=(t,e,i)=>{const s=i.ct(t),r=i.ct(e);return wt(i.ot(s+.1*(r-s)+.5*Math.sign(r-s)),t,e)};class ao extends Hi{constructor(t,i,s,n,o,h,a,l,c,d,f,g,p,m,y,x,S){var v;super(f,d,l,y,x,{numeric:d.getWidth({x:y.xAxisNumericTicks,y:y.yAxisNumericTicks}),datetime:d.getWidth({x:y.xAxisDateTimeTicks,y:y.yAxisDateTimeTicks}),time:d.getWidth({x:y.xAxisTimeTicks,y:y.yAxisTimeTicks})},S),this.wd=new Map,this.kd=void 0,this.Cd=0,this.Td=[],this.Id=[],this.zi=Ci.fitting,this.Fd=!0,this.Pd=0,this.Dd=8,this.Bd=void 0,this.Od=void 0,this.Ld=20,this.Rd=1,this.Ed=!0,this.zd=!0,this.Vd=!0,this.Nd=!0,this.Gd=!0,this.Wd=!0,this.Hd=!0,this.Ud=!0,this.$d=!0,this.Yd=!0,this.Xd=this.ds.defaultDragMouseStyle,this.jd=this.ds.defaultDragMouseStyle,this.Zd=this.ds.defaultDragMouseStyle,this.Kd=this.ds.defaultDragMouseStyle,this.qd=this.ds.defaultDragMouseStyle,this.P=new r.Eventer,this.Jd=[],this.Qd=t=>{const e=this.Id.indexOf(t);e>=0&&this.Id.splice(e,1)},this.tf=t=>(this.Id.indexOf(t)<0&&this.Id.push(t),this.Qd),this.ou=(t,e)=>this.P.emit("axisAreaTouch",this,e),this.if=Jt(this.Jd),this.onAxisInteractionAreaMouseClick=t=>this.P.on("axisAreaMouseClick",t),this.onAxisInteractionAreaMouseDoubleClick=t=>this.P.on("axisAreaDoubleClick",t),this.onAxisInteractionAreaMouseDown=t=>this.P.on("axisAreaMouseDown",t),this.onAxisInteractionAreaMouseUp=t=>this.P.on("axisAreaMouseUp",t),this.onAxisInteractionAreaMouseEnter=t=>this.P.on("axisAreaMouseEnter",t),this.onAxisInteractionAreaMouseLeave=t=>this.P.on("axisAreaMouseLeave",t),this.onAxisInteractionAreaMouseMove=t=>this.P.on("axisAreaMouseMove",t),this.onAxisInteractionAreaMouseWheel=t=>this.P.on("axisAreaMouseWheel",t),this.onAxisInteractionAreaMouseDragStart=t=>this.P.on("axisAreaMouseDragStart",t),this.onAxisInteractionAreaMouseDrag=t=>this.P.on("axisAreaMouseDrag",t),this.onAxisInteractionAreaMouseDragStop=t=>this.P.on("axisAreaMouseDragStop",t),this.onAxisInteractionAreaTouchStart=t=>this.P.on("axisAreaTouchStart",t),this.onAxisInteractionAreaTouch=t=>this.P.on("axisAreaTouch",t),this.onAxisInteractionAreaTouchStop=t=>this.P.on("axisAreaTouchEnd",t),this.offAxisInteractionAreaMouseClick=t=>this.P.off(t,"axisAreaMouseClick"),this.offAxisInteractionAreaMouseDoubleClick=t=>this.P.off(t,"axisAreaDoubleClick"),this.offAxisInteractionAreaMouseDown=t=>this.P.off(t,"axisAreaMouseDown"),this.offAxisInteractionAreaMouseUp=t=>this.P.off(t,"axisAreaMouseUp"),this.offAxisInteractionAreaMouseEnter=t=>this.P.off(t,"axisAreaMouseEnter"),this.offAxisInteractionAreaMouseLeave=t=>this.P.off(t,"axisAreaMouseLeave"),this.offAxisInteractionAreaMouseMove=t=>this.P.off(t,"axisAreaMouseMove"),this.offAxisInteractionAreaMouseWheel=t=>this.P.off(t,"axisAreaMouseWheel"),this.offAxisInteractionAreaMouseDragStart=t=>this.P.off(t,"axisAreaMouseDragStart"),this.offAxisInteractionAreaMouseDrag=t=>this.P.off(t,"axisAreaMouseDrag"),this.offAxisInteractionAreaMouseDragStop=t=>this.P.off(t,"axisAreaMouseDragStop"),this.offAxisInteractionAreaTouchStart=t=>this.P.off(t,"axisAreaTouchStart"),this.offAxisInteractionAreaTouch=t=>this.P.off(t,"axisAreaTouch"),this.offAxisInteractionAreaTouchStop=t=>this.P.off(t,"axisAreaTouchEnd"),this.sf=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().Vc()):t,this.ef=t=>{const e=this.Td.indexOf(t);-1!==e&&this.Td.splice(e,1)},this.hf=(t,e)=>{this.P.emit("axisAreaDoubleClick",this,e),this.Nd&&(this.setStopped(!1),Zt(e))},this.rf=t=>{this.P.emit("axisAreaMouseEnter",this),(this.zd||this.Ed||this.Vd||this.Nd)&&this.nf(t)},this.af=t=>{this.lf(t),this.P.emit("axisAreaMouseLeave",this)},this.cf=(t,e,i)=>{var s,r;this.P.emit("axisAreaMouseDragStart",this,e,i);const n=Pt(null===(s=this.chart.uf.Vh)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=Pt(null===(r=this.chart.uf.Vh)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.zd?(this.df(t),Zt(e)):i===n&&this.Ed&&(this.ff(t,h),Zt(e))},this.gf=(t,e,i,s,r)=>{var n,o;this.P.emit("axisAreaMouseDrag",this,e,i,s,r);const h=Pt(null===(n=this.chart.uf.Vh)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=Pt(null===(o=this.chart.uf.Vh)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.zd?(this.pf(t,r),Zt(e)):i===h&&this.Ed&&(this.mf(t,s,l,r),Zt(e))},this.Sf=(t,e,i,s)=>{var r,n;this.P.emit("axisAreaMouseDragStop",this,e,i,s);const o=Pt(null===(r=this.chart.uf.Vh)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=Pt(null===(n=this.chart.uf.Vh)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.zd?(this.yf(t),Zt(e)):i===o&&this.Ed&&(this.xf(t,s,a),Zt(e)),t.getIsUnderMouse()&&(this.zd||this.Ed||this.Vd||this.Nd)&&this.nf(t)},this.bf=(t,e)=>{if(this.P.emit("axisAreaMouseWheel",this,e),this.Vd){this.setStopped(!0);const t=this.ds.getWidth(this.vf.Wi.Re(e.clientX,e.clientY)),i=this.ut.ot(t);this.zoom(i,fe(e)),Zt(e)}},this.Mf=(t,e)=>this.P.emit("axisAreaMouseClick",this,e),this._f=(t,e)=>this.P.emit("axisAreaMouseDown",this,e),this.Af=(t,e)=>this.P.emit("axisAreaMouseUp",this,e),this.wf=(t,e)=>this.P.emit("axisAreaMouseMove",this,e),this.kf=(t,e,i)=>{this.P.emit("axisAreaTouchStart",this,i),this.Ed&&(this.nf(t),this.ff(t,e),Zt(i))},this.Cf=(t,e,i,s,r)=>{this.P.emit("axisAreaTouch",this,r),this.Ed&&(this.mf(t,e,i,s),Zt(r))},this.Tf=(t,e,i,s)=>{this.P.emit("axisAreaTouchEnd",this,s),this.Ed&&(this.xf(t,e,i),this.lf(t),Zt(s))},this.If=(t,e,i,s)=>{(this.zd||this.Vd)&&(this.nf(t),this.df(t),Zt(s))},this.Ff=(t,e,i,s,r,n)=>{if(this.zd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.pf(t,e),Zt(n)}if(this.Vd){const t=this.vf.Wi.Re(e.x,e.y),o=this.vf.Wi.Re(i.x,i.y),h=Math.abs(this.ds.getWidth(ti(t,s))-this.ds.getWidth(ti(o,r)))-Math.abs(this.ds.getWidth(t)-this.ds.getWidth(o)),a=this.ut.ti(this.ys,-h),l=this.ut.ti(this.xs,h);this.us(a,l),Zt(n)}},this.Pf=(t,e,i,s)=>{(this.zd||this.Vd)&&(this.yf(t),this.lf(t),Zt(s))},this.Df=(t,e)=>{(this.Gd||this.Wd)&&this.Bf(t)},this.Of=(t,e)=>{this.Lf(t)},this.Rf=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Gd&&this.Ef(t,s)},this.zf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.Vf(t,n,s,r)},this.Nf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Gd&&this.Gf(t,n,s,r)},this.Wf=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Gd||this.Wd)&&this.Hf(t,r,s),(this.Gd||this.Wd)&&this.Bf(t)},this.Uf=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.ys,fe(e)),Zt(e))},this.$f=(t,e)=>{this.Wd&&(this.setStopped(!0),this.zoom(this.xs,fe(e)),Zt(e))},this.Yf=(t,e,i)=>{this.Gd&&(this.Bf(t),this.Ef(t,e),Zt(i))},this.Xf=(t,e,i,s,r)=>{this.Gd&&(this.Vf(t,e,i,s),Zt(r))},this.jf=(t,e,i,s,r)=>{this.Gd&&(this.Gf(t,e,i,s),Zt(r))},this.Zf=(t,e,i,s)=>{this.Gd&&(this.Hf(t,e,i),this.Lf(t),Zt(s))},this._d=t,this.Kf=i,this.vf=s,this.qf=o,this.Jf=h,this.chart=f,this.Qf=p,this.tg=n,this.uu=a,m(this,this.tf),l.ig=this,this.sg=g,this.eg=this.sg>50?1:-1,this.hg=(v=this.ds.toPoint(0,-this.eg),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.rg=c,this.ng=this.ut instanceof wi?(new Ti).yi(this.ds.toVec2(this.ut,this.rg)):(new Ii).yi(this.ds.toVec2(this.ut,this.rg)),this.og=this.chart.pixelScale,this.ag=(new Ti).yi(this.ds.toVec2(this.ds.getWidth(this.og),this.rg)),this.lg=this.vf.Bc(this.ng).setMouseInteractions(!1),this.cg=this.vf.Bc(this.ng).setMouseInteractions(!1),this.ug=this.vf.Bc(this.ng).setMouseInteractions(!1),this.dg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).ir(J).Nr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.gg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).ir(d.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.pg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).ir(J).Nr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.mg=this.tg._u(this.og).As(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).ir(J).Nr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.vs=this.tg.ye(this.ng).setMouseInteractions(!1).Cs(this.ds.getTitleTextRotation(this.eg)),this.chart.Wi.Zh.ke(this.dg,(t=>this.dg.zr(t)),{animationEnabled:this.Hi}),this.chart.Wi.Zh.ke(this.pg,(t=>this.pg.zr(t)),{animationEnabled:this.Hi}),this.chart.Wi.Zh.ke(this.mg,(t=>this.mg.zr(t)),{animationEnabled:this.Hi});const b=Lr(new Vr(this.kf,this.Cf,this.Tf,1),new Nr(this.If,this.Ff,this.Pf),new Gr(this.hf)),M=Lr(new Vr(this.Yf,this.Xf,this.Zf)),A=Lr(new Vr(this.Yf,this.jf,this.Zf));this.dg.setMouseEnterEventHandler(this.rf).setMouseLeaveEventHandler(this.af).setMouseDragStartEventHandler(this.cf).setMouseDragEventHandler(this.gf).setMouseDragStopEventHandler(this.Sf).setMouseWheelEventHandler(this.bf).setMouseDoubleClickEventHandler(this.hf).setMouseClickEventHandler(this.Mf).setMouseDownEventHandler(this._f).setMouseUpEventHandler(this.Af).setMouseMoveEventHandler(this.wf).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.pg.setMouseEnterEventHandler(this.Df).setMouseLeaveEventHandler(this.Of).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.zf).setMouseDragStopEventHandler(this.Wf).setMouseWheelEventHandler(this.Uf).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.mg.setMouseEnterEventHandler(this.Df).setMouseLeaveEventHandler(this.Of).setMouseDragStartEventHandler(this.Rf).setMouseDragEventHandler(this.Nf).setMouseDragStopEventHandler(this.Wf).setMouseWheelEventHandler(this.$f).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),this.lg.ua(d.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.cg.ua(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.ug.ua(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.vs.As(d.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).ks(d.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.cc=a.uc(this,{}),this.Fs=this.cc.Sg([this.vs]).Is(y.effectsText)}me(){return this.Xi}Se(){return void 0!==this.zs}addBand(t=!0){const e=t?this.Jf:this.qf,i=new en(e,this.chart,this.if,this,this.ng,this.ds,this.fs,this.uu);return this.Jd.push(i),i}addConstantLine(t=!0){const e=t?this.Jf:this.qf,i=new sn(e,this.chart,this.if,this,this.ng,this.ds,this.fs,this.uu);return this.Jd.push(i),i}yg(t){this.Jd.forEach(t)}xg(t){return this.Jd.map(t)}getHighlighters(){return this.Jd}setThickness(t){return"number"==typeof t?(this.bg=t,this.vg=t):"object"==typeof t&&(this.bg=t.min,this.vg=t.max),this._d.Gi(),this}getThickness(){return{min:this.bg,max:this.vg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}ne(){return this.Id}Qs(t,e){return new no(e,t,this.vf,this.ng,this._d,this.ng)}Ds(){if(this.wd){for(const t of this.wd)t[1].grid.dispose(),t[1].tick.dispose();this.wd.clear()}super.Ds()}te(t,e){const{tickStart:i}=e,s=t.ns.qs,r=i+s.getTickLength()*this.eg+s.getTickPadding()*this.eg;t.Pi.Cn(this.ds.toPoint(t.u,r)).Ln(this.ds.toPoint(s.getLabelAlignment(),-this.eg)).Cs(s.labelRotation).setVisible(this.getVisible())}Mg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.ns.qs,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.eg;return{gridStroke:{start:this.ds.toPoint(t.u,r),end:this.ds.toPoint(t.u,h)},tickStroke:{start:this.ds.toPoint(t.u,n),end:this.ds.toPoint(t.u,a)}}}_g(t,e,i,s){return this._d.Bc(this.ng).ua(new tt({fillStyle:new L({color:w(360*(1-s))}),thickness:5})).Sa(this.ds.toVec2(t,0)).ha(this.ds.toVec2(t,this.eg*(50*s)))}fe(t,e){return"linear"===this.ps.type?oo(t,e,this.ut):ho(t,e,this.ut)}Ag(t,e){return e instanceof wi?oo:ho}pe(t,e,i){if("linear"===this.ps.type){const s=this.ut.Si(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ut;return{min:s.ti(t,-i),max:s.ti(e,i)}}gc(t,e,i){const s=this.lg.da(),r=this.ut.getInnerStart()this.ut.getInnerStart()?this.ut.getInnerEnd():this.ut.getInnerStart(),o=this.ut.Ht(),h=this.rg.getInnerInterval(),a=s instanceof tt?s.getThickness()*this.eg/2:0,l=this.sg/100*h,u=l+t,c=u+a,d=h*this.eg,f=c+a,g=this.Td.reduce(this.sf,0);let p,m=0;if(this.Ui||this.Ds(),this.Oi!==Ri&&this.Ui){const t=this.ut.Ht();this.Gs({physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});for(const[e,i]of this.Ri){let s=this.wd.get(e);if(!s)if(e.Ci)s={grid:this._d.wg(this.ng).setMouseInteractions(!1),tick:this._d.wg(this.ng).setMouseInteractions(!1)};else if("kg"in e){const t=Array.from(this.Ri.keys()).filter((t=>"kg"in t)).reverse().indexOf(e),i=this.Kf[t];if(!i)throw new Error("Not enough tick layers. This is an internal LCJS error - if you see this, please contact Arction support.");s={grid:i.wg(this.ng).setMouseInteractions(!1),tick:i.wg(this.ng).setMouseInteractions(!1)}}if(s){s.grid.no(),s.tick.no();for(const[e,r]of i){const e=this.Mg(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});s.grid.xt(e.gridStroke.start,e.gridStroke.end),s.tick.xt(e.tickStroke.start,e.tickStroke.end)}s.grid.ua(e.qs.getGridStrokeStyle()),s.tick.ua(e.qs.getTickStyle()),this.wd.set(e,s)}}for(const t of this.Ri.values()){let e=we;for(const i of t.values()){const t=i.ns.qs,s=this.ds.getHeight(i.Pi.$t()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}m=Math.max(m,e)}p=f+Math.max(m,g)*this.eg}else m=0,p=f+g*this.eg;this.lg.Sa(this.ds.toPoint(r,c)).ha(this.ds.toPoint(n,c)),this.cg.Sa(this.ds.toPoint(this.ut.ti(this.ut.getInnerStart(),this.Dd),c)).ha(this.ds.toPoint(this.ut.getInnerStart(),c)),this.ug.Sa(this.ds.toPoint(this.ut.ti(this.ut.getInnerEnd(),-this.Dd),c)).ha(this.ds.toPoint(this.ut.getInnerEnd(),c));const y=this.vs&&this.vs.bs().length>0?this.ds.getHeight(this.vs.Zs().$t()):0,x=p+.5*y*this.eg;this.vs.Cn(this.ds.toPoint(this.ut.ti(this.ut.getInnerStart(),o/2),x));const S=f,v=S+this.eg*this.Cd,b=this.Gd||this.Wd?Math.min(this.Ld,.25*o):0,M={start:this.ds.toVec2(this.ut.ti(this.ut.getInnerStart(),b),S),end:this.ds.toVec2(this.ut.ti(this.ut.getInnerEnd(),-b),v)};if(this.kd){const e=this.sg/100*h+t,i=-this.eg*h-t,s={start:this.ds.toVec2(this.kd.min,f+this.eg*this.Cd),end:this.ds.toVec2(this.kd.max,e+i)},r=nt(s.start,this.ng,this.og),n=nt(s.end,this.ng,this.og);this.gg.Cn(r).q(ti(n,r)).setVisible(!0)}else this.gg.setVisible(!1);const A=nt(this.ds.toVec2(this.ut.getInnerStart(),v),this.ng,this.og),k=nt(M.start,this.ng,this.og),w=nt(M.end,this.ng,this.og),D=nt(this.ds.toVec2(this.ut.getInnerEnd(),S),this.ng,this.og);this.dg.Cn(k).q(ti(w,k)),this.pg.Cn(A).q(ti(k,A)),this.mg.Cn(w).q(ti(D,w));for(const e of this.Td)e.update().plot(u,d,t,f);for(const t of this.Jd)t.gc();const E=(s instanceof tt?s.getThickness():0)+Math.max(m,g)+(this.vs&&this.vs.bs().length>0?y+this.Pd:0);return this.Cd=wt(E,void 0!==this.bg?this.bg:0,void 0!==this.vg?this.vg:ke),this}Cg(t){const e=this.lg.da(),i=e instanceof tt?e.getThickness()*this.eg/2:0,s=this.rg.getInnerInterval(),r=this.sg/100*s+t,n=r+i,o=s*this.eg,h=n+i;for(const e of this.Td)e.update().plot(r,o,t,h);for(const t of this.Jd)t.gc()}Tg(){return this.Cd}Ig(t,e){e=e||so.AxisTickMajor;const i=new Kr(this,t?this._d:this.tg,this.tg,this.ut,this.ag,this.ag,this.ds,this.hg,this.ef,this.fs,e).setTextFormatter(this.formatValue);return this.Td.push(i),i}nf(t){this.chart.Wi.Zh.Ie(t,1),this.Bd=t.Wi.Oe(this.Xd,this.Bd)}lf(t){this.chart.Wi.Zh.Ie(t,0),t.Wi.Le(this.Bd)}df(t){this.setStopped(!0),t.Wi.Le(this.Bd)}pf(t,e){const i=-this.ds.getWidth(e);this.pan(i),this.Bd=t.Wi.Oe(this.jd,this.Bd)}pan(t){const e=this.ys,i=this.xs,s=this.ut.ti(e,t),r=this.ut.ti(i,t);this.us(s,r,{allowClamping:!1})}zoom(t,e){const i=this.ut.ct(this.ys),s=this.ut.ct(this.xs),r=this.ut.ct(t),n=wt((r-i)/(s-i),0,1),o=.2*this.ut.Ht(),h=n*this.Rd*o*-e,a=(1-n)*this.Rd*o*e,l=this.ut.ti(this.ys,h),u=this.ut.ti(this.xs,a);this.us(l,u)}yf(t){this.kd=void 0,t.Wi.Le(this.Bd)}ff(t,e){this.setStopped(!0),t.Wi.Le(this.Bd),this.chart.Wi.Zh.Ie(this.dg,0)}mf(t,e,i,s){const r=nt(this.vf.Wi.Re(i.x,i.y),this.vf.Wi.ut,this.ng),n=wt(this.ds.getWidth(r),this.ys,this.xs),o=this.ds.getWidth(nt(this.vf.Wi.Re(e.x,e.y),this.vf.Wi.ut,this.ng)),h=Re(this.ds.getHeight(r),this.ds.getHeight(nt(this.dg.Tn(),this.og,this.ng)),this.ds.getHeight(nt(Qe(this.dg.Tn(),this.dg.$t()),this.og,this.ng)));Math.abs(this.ut.ct(n)-this.ut.ct(o))>10&&h?(this.kd=p(Math.min(n,o),Math.max(n,o)),this.Bd=t.Wi.Oe(this.Zd,this.Bd)):(this.kd=void 0,this.Bd=t.Wi.Oe(this.Xd,this.Bd)),this.vf.Gi()}xf(t,e,i){if(this.kd){const t=this.kd.min,e=this.kd.max,i=this.xs{e.Js(t)}));for(const e of this.wd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this._d.Gi(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.Hi),this}}const lo=(t,e)=>t instanceof mi||e instanceof mi?(new Ii).yi(t,e):(new Ti).yi(t,e),uo=(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(mt.navigator.msSaveBlob)mt.navigator.msSaveBlob(r,e);else{const t=mt.document.createElement("a");mt.document.body.appendChild(t);const i=mt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{mt.URL.revokeObjectURL(i),mt.document.body.removeChild(t)}),0)}},co=(t,i,s,r,n,o)=>{const h=t.Lc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},fo=t=>{if(t instanceof Ei)return t;const e=t.x instanceof ao?t.x.ut:t.x.x,i=t.y instanceof ao?t.y.ut:t.y.y;return lo(e,i)};class go{constructor(t,e,i,s,n,o,h,a){this.Fg=[],this.Pg=[],this.P=new r.Eventer,this.Dg=void 0,this.Bg=void 0,this.Og=void 0,this.Pt=x(0,0,0,0),this.xe=!1,this.Lg=()=>{this.Rg=!0,this.Eg.Gi()},this.zg=t=>e=>{const i=this.Fg.indexOf(e);-1!==i&&this.Fg.splice(i,1),this.Wi.Gi(),t.G()},this.Vg=t=>{const e=this.Pg.indexOf(t);-1!==e&&this.Pg.splice(e,1),this.Wi.Gi()},this.Rg=!0,this.onResize=t=>this.P.on("resize",t),this.offResize=t=>this.P.off(t,"resize"),this.uf=t,this.Ng=i,this.Eg=s,this.removePanel=n,this.fs=e.Wi.fs;const l=e.Wi.$t();this.uiScale=i.d2({scaleXYConstructor:Ti}).vi(0,100).Mi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:Ti}).vi(0,this.uiScale.x.getCellSize()).Mi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.Wi.Gg,this.Wi=e.Wi.Wg,this.cc=this.Wi.cc.uc(this,{}),this.Hg=()=>e.Ug("unidentified ui"),this.$g=e.Yg(),this.Xg=this.Eg._u(this.uiScale).Cn(u(0,0)).q(u(100,100)).As(o).ir(h).setMouseMoveEventHandler(((t,e)=>this.P.emit("mouseMovePanelBackground",this,e))).setMouseEnterEventHandler(((t,e)=>this.P.emit("mouseEnterPanelBackground",this,e))).setMouseLeaveEventHandler(((t,e)=>this.P.emit("mouseLeavePanelBackground",this,e))).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownPanelBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpPanelBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickPanelBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickPanelBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelPanelBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartPanelBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragPanelBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopPanelBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>this.P.emit("touchStartPanelBackground",this,e))).setTouchMoveEventHandler(((t,e)=>this.P.emit("touchMovePanelBackground",this,e))).setTouchEndEventHandler(((t,e)=>this.P.emit("touchEndPanelBackground",this,e)));const c=e.Wi._r(this.Lg);if(this.jg=e.Wi.Ar.bind(e.Wi,c),a){const t=a.on(this.Lg);this.Zg=()=>a.off(t)}this.Dg=n}getTheme(){return this.fs}setBackgroundFillStyle(t){return this.Xg.As(t),this.Eg.Gi(),this}getBackgroundFillStyle(){return this.Xg._s()}setBackgroundStrokeStyle(t){return this.Xg.ir(t),this.Eg.Gi(),this}getBackgroundStrokeStyle(){return this.Xg.sr()}Kg(t){return this.Fg.push(t),this.Wi.Gi(),t}qg(t){return this.Pg.push(t),this.Wi.Gi(),t}addUIElement(t=_n,e=this.uiScale){e=fo(e);const i=this.Hg();return this.Kg(co(t,i,this.uiScale,e,this.zg(i),this.fs))}addLegendBox(t=Zn,i=this.uiScale){i=fo(i);const s=this.qg(co(t,this.$g,this.uiScale,i,this.Vg,this.fs));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(Er.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Er.CenterBottom).setPosition(this.uiScale.ti({x:50,y:0},{x:0,y:3}))),s}dispose(){return this.xe||(this.xe=!0,this.jg&&this.jg(),this.Zg&&this.Zg(),po(this.uiScale),po(this.pixelScale),this.Bg&&this.Bg(),this.Eg.G(),this.$g.G(),this.Fg.slice().forEach((t=>{t.dispose()})),this.Pg.slice().forEach((t=>{t.dispose()})),this.Wi.Gi(),this.Dg&&this.Dg(this),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return uo(this.engine,t,e,i),this}Rn(t){this.Pt=t,this.Lg()}X(){return this.pixelScale.X(),this.uiScale.X(),this}j(){return this.pixelScale.j(),this.uiScale.j(),this}gc(){if(this.Rg){const t=this.Eg.Wi.$t(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this.Pt.left,this.Pt.right],r=[this.Pt.bottom,this.Pt.top];this.uiScale.xi(s),this.uiScale.bi(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.vi(0,n.x).xi(s).Mi(0,n.y).bi(r),this.P.emit("resize",this,n.x,n.y,e,i)}this.Rg=!1}Jg(){for(let t=0;t{t.Vt&&t.Vt()};class mo extends go{constructor(t,e,i,s,r,n){super(t,e,i,e.tp("uipanel bg",0),s,e.Wi.fs.uiPanelBackgroundFillStyle,e.Wi.fs.uiPanelBackgroundStrokeStyle,n),this.Qg(r,this.pixelScale)}setMinimumSize(t){return this.Yu=t,this.Wi.Gi(),this}getMinimumSize(){return this.Yu}gc(){super.gc(),super.Jg()}}const yo=x(10,10,10,10);class xo extends go{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.ip={},this.pn=yo,this.Hi=!0,this.sp=e.ep("chart internal ui",0),this.hp=this.sp.ye(this.uiScale).Ms("Chart").Cn(u(50,100)).Ln(u(0,1)).ks(h).As(a).setMouseInteractions(!1),this.rp=this.cc.Sg([this.hp]).Is(this.fs.effectsText)}setAnimationsEnabled(t){return this.Hi=t,this}getAnimationsEnabled(){return this.Hi}setTitle(t){return this.hp.Ms(t),this.Wi.Gi(),this}getTitle(){return this.hp.bs()}getTitleSize(){return this.hp.Zs().Du()}setTitleFillStyle(t){return this.hp.As(t),this.Lg(),this}getTitleFillStyle(){return this.hp._s()}setTitleFont(t){return this.hp.ks(t),this.Lg(),this}getTitleFont(){return this.hp.ws()}setTitleRotation(t){return this.hp.Cs(t),this.Wi.Gi(),this}getTitleRotation(){return this.hp.Ts()}setTitleEffect(t){return this.rp.Is(t),this.Wi.Gi(),this}getTitleEffect(){return this.rp.Ps()}setTitleMargin(t){var e,i;return this.ip="object"==typeof t?this.ip?(e=this.ip,{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.Lg(),this}getTitleMargin(){return this.ip}setPadding(t){return this.pn="object"==typeof t?v(this.pn,t):{left:t,top:t,right:t,bottom:t},this.Lg(),this}getPadding(){return this.pn}np(t){const e=t.op(),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.sp.G(),this}}const So={ap:(t,e)=>t._s()!==B&&0!==t.bs().length&&t.getVisible()?t.Zs().Du().y+(void 0!==e.top?e.top:10)+(void 0!==e.bottom?e.bottom:0):0,lp(t,e){t.Cn(u(50,100)).Rn({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var vo;e.SliceLabelIndices=void 0,(vo=e.SliceLabelIndices||(e.SliceLabelIndices={}))[vo.LabelsInsideSlices=0]="LabelsInsideSlices",vo[vo.LabelsOnSides=1]="LabelsOnSides";const bo={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},Mo={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Ao extends Qr{constructor(){super(...arguments),this.Su="Slice",this.u=0}}const ko=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class wo extends Ao{}class Do extends wo{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.cp=!1,this.up=B,this.dp=B,this.fp=this.u,this.gp=this.cp?1:0,this.pp=this.getVisible(),this.mp=U((()=>this.rl.Wi.Gi())),this.Sp=U((()=>this.rl.Wi.Gi())),this.yp=()=>{this.xp=void 0},this.bp=()=>{this.vp=void 0},this.index=t,this.rl=s,this.scale=r,this.cu=n,this.Mp=e.Ou(r).zr(this.getHighlight()),this.gu(this.Mp),this.Pi=i.ye(r).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0}),this.onMouseClick(ko),this.onTouchEnd(ko)}setValue(t){return this.rl.getAnimationsEnabled()?this.pp&&this._p(this.fp,t):this.fp=t,this.u=t,this.rl.Wi.Gi(),this}getValue(){return this.u}setExploded(t){if(t&&!1===this.rl.getMultipleSliceExplosion()){const t=this.rl.getSlices();for(let e=0;e{this.gp=t,this.rl.Wi.Gi()})),this.vp.onEveryAnimationEnd(this.bp),this.cp=!this.cp):!1!==this.rl.getMultipleSliceExplosion()||t?(this.gp=this.cp?0:1,this.cp=!this.cp):(this.gp=0,this.cp=!this.cp),this.rl.Wi.Gi(),this}getExploded(){return this.cp}setVisible(t){return this.pp=t,!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?(this.xp&&(this.xp.finish(!1),this.xp=void 0),this._p(this.fp,0,(()=>super.setVisible(!1)))):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(this.xp&&(this.xp.finish(!1),this.xp=void 0),super.setVisible(!0),this._p(this.fp,this.u)):(this.fp=this.u,super.setVisible(!0)),this}_p(t,e,i){this.xp=this.mp(300,W.ease)([[t,e]],(([t])=>{this.fp=t,this.rl.Wi.Gi()})),this.xp.onEveryAnimationEnd(this.yp),i&&this.xp.onAnimationEnd(i)}setStyle(t,e,i,s){this.up=t,this.dp=i,this.Mp.As(this.up).ir(e),this.Pi.As(this.dp).ks(s);for(let t=0;tQe(e,Je(ui(.5*(t.qo()+t.ui())*Math.PI/180),i)),To=(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.Ap.indexOf(t);e>=0&&(this.Ap.splice(e,1),this.Ep())},this.uf.Oh||this.uf.Bh||this.Wi.Ph(7),this.zp=e.Vp("pieChart bottom",0),this.Np=e.Vp("pieChart top",1),this.hp.Ms("Pie Chart"),this.Qg(r,this.pixelScale),this.onBackgroundMouseDoubleClick(Io);const h=Lr(new Gr(Io));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new Do(this.Pp,this.zp,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);this.Pp+=1,i.setName(t);const s=this.Hi;return this.Hi=!1,i.setValue(e),this.Hi=s,i.setEffect(this.Op),this.Gp(i),this.Ap.push(i),this.Ep(),i.setHighlightOnHover(this.Tp),i}addSlices(t){const e=[];for(let i=0;ie.cc.fu.Is(t))),this.Wi.Gi(),this}getSliceEffect(){return this.Op}setSliceSorter(t){return this.wp=t,this.Ap=this.Ap.sort(this.wp),this.Wi.Gi(),this}getSliceSorter(){return this.wp}setLabelFillStyle(t){this.Fp="function"==typeof t?t(this.Fp):t;for(let t=0;te.cc.du.Is(t))),this.Wi.Gi(),this}getLabelEffect(){return this.Lp}setLabelFormatter(t){return this.Wp=t,this.Wi.Gi(),this}getLabelFormatter(){return this.Wp}setSliceHighlightOnHover(t){return this.Tp=t,this.Ap.forEach((e=>e.setHighlightOnHover(t))),this}gc(){super.gc(),So.lp(this.hp,this.ip),super.Jg();const t=So.ap(this.hp,this.ip),e=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+t)),i=u(this.pn.left+e.x/2,this.pn.bottom+e.y/2);if(this.ld){const t=this.ld;this.Ap.forEach((e=>{this.Gp(e,new L({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.Ap[t].Mp.setVisible(e),this.Ap[t].Pi.setVisible(e)}this.Ap=this.Ap.sort(this.wp);const s=this.Ap.filter((t=>t.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),this}}const Po={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Oo=(...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};var Fo;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(Fo||(Fo={}));const Ro=(t,e,i,s,r,n,o,h,a)=>{if(0===t.length)return;const l=s.x+e*r.x*.5,c=1===i?Math.max:Math.min;let d;for(let r=0;r{const o=r*t.getAnimatedExplosion(),h=t.Mp,a=t.Pi,l=Eo(h,i,s+n+o),c=oi(a.Tn().y,l,i),d=u(a.Tn().x-e*(n+a.$t().x),c.y);return-1===e&&c.xd.x?[l,d]:[l,c,d]},zo=(...t)=>e=>{const i=(t=>{let e=.5*(t.Mp.qo()+t.Mp.ui());for(e%=360;e<0;)e+=360;return e<=90?Fo.TopRight:e<180?Fo.TopLeft:e<270?Fo.BottomLeft:Fo.BottomRight})(e);return t.includes(i)},_o=zo(Fo.BottomLeft,Fo.TopLeft),Lo=zo(Fo.BottomRight,Fo.TopRight),Go=zo(Fo.TopLeft,Fo.TopRight),Vo=zo(Fo.BottomLeft,Fo.BottomRight);class No extends Co{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Wp=Mo.NamePlusValue,this.$p=5,this.Yp=5,this.Xp=[],this.jp=this.fs.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.jp=t;for(let t=0;tt.getXMin(),le:t=>t.getXMax(),ue:t=>t.Jp().x,Qp:t=>t.x,tm:(t,e)=>({x:t.x,y:e.y,z:e.z}),vd:f(0,-1,0),im: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)}}},Xo={ae:t=>t.getYMin(),le:t=>t.getYMax(),ue:t=>t.Jp().y,Qp:t=>t.y,tm:(t,e)=>({x:e.x,y:t.y,z:e.z}),vd:f(-1,0,0),im: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)}}},jo={ae:t=>t.getZMin(),le:t=>t.getZMax(),ue:t=>t.Jp().z,Qp:t=>t.z,tm:(t,e)=>({x:e.x,y:e.y,z:t.z}),vd:f(1,0,0),im: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)}}},Yo=t=>{if(t instanceof tt){const e=t.getThickness(),i=t.getFillStyle();if(i instanceof L)return 1===e?qi:new Ji({size:e,fillStyle:i,shape:"sphere"})}return qi};class $o{constructor(t,e,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.u=0,this.Ui=!0,this.xe=!1,this.Gi=t,this.sm=e,this.hm=i,this.rm=s,this.nm=n,this.om=o,this.sd=h,this.am=a,this.lm=l,this.Ec=u}setValue(t){return t===this.u||(this.u=t,this.Gi(),this.P.emit("valueChange",this.u)),this}getValue(){return this.u}setTickStyle(t){return this.hm="function"==typeof t?t(this.hm):t,this.Gi(),this}getTickStyle(){return this.hm}setTickLength(t){return this.rm=t,this.Gi(),this}getTickLength(){return this.rm}setGridStrokeStyle(t){return this.nm="function"==typeof t?t(this.nm):t,this.Gi(),this}getGridStrokeStyle(){return this.nm}setTextPadding(t){return this.om=t,this.Gi(),this}getTextPadding(){return this.om}setTextRotation(t){return this.sd=t,this.Gi(),this}getTextRotation(){return this.sd}setTextFillStyle(t){return this.am="function"==typeof t?t(this.am):t,this.Gi(),this}getTextFillStyle(){return this.am}setTextFont(t){return this.lm="function"==typeof t?t(this.lm):t,this.Gi(),this}getTextFont(){return this.lm}setTextFormatter(t){return this.Ec=t,this.Gi(),this}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}dispose(){return this.xe||(this.xe=!0,this.sm(),this.Gi(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Ui!==t;return this.Ui=t,e&&(this.P.emit("visibleStateChanged",this,this.Ui),this.Gi()),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}class Zo{constructor(t,e){this.um=[],this.dm=t,this.fm=e}gm(){const t=[];return{add:(e,i)=>{t.push({instanceUniqueProperties:e,instanceSharedProperties:i})},finishPlot:()=>{const e=[];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 i=this.um.slice();e.forEach((t=>{let e=i.pop();e||(e=this.dm(),this.um.push(e)),this.fm(e,t.instances,t.sharedProperties)})),i.forEach((t=>{t.dispose();const e=this.um.indexOf(t);e<0?ge(0,(()=>{})):this.um.splice(e,1)}))}}}pm(){this.um.forEach((t=>{t.dispose()})),this.um.length=0}}class qo{constructor(t){this.Sm=[],this.ym=t}gm(){return this.xm(),{add:()=>this.bm(),finishPlot:()=>{this.vm()}}}bm(){let t=this.Sm.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.ym()},this.Sm.push(t)),t.isFree=!1,t.shape}xm(){this.Sm.forEach((t=>{t.isFree=!0}))}vm(){this.Sm.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.Sm.splice(this.Sm.indexOf(t),1)}))}pm(){this.Sm.forEach((t=>t.shape.dispose())),this.Sm.length=0}}class Ko extends Hi{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.Qp({x:t.Wi.fs.xAxis3DNumericTicks,y:t.Wi.fs.yAxis3DNumericTicks,z:t.Wi.fs.zAxis3DNumericTicks}),datetime:e.Qp({x:t.Wi.fs.xAxis3DDateTimeTicks,y:t.Wi.fs.yAxis3DDateTimeTicks,z:t.Wi.fs.zAxis3DDateTimeTicks}),time:e.Qp({x:t.Wi.fs.xAxis3DTimeTicks,y:t.Wi.fs.yAxis3DTimeTicks,z:t.Wi.fs.zAxis3DTimeTicks})},{type:"linear"}),this.Td=[],this.Mm=()=>{},this._m=()=>{},this.Am=()=>{},this.wm=()=>{},this.km=r,this.Cm=n,this.Tm=o,this.Im=this.km.ut;const l=this.ds.Qp({x:this.fs.xAxis3DStrokeStyle,y:this.fs.yAxis3DStrokeStyle,z:this.fs.zAxis3DStrokeStyle});this.Fm=this.km.Kp([Po.InternalUI]).ua(l).Pm(Yo(l)).setMouseInteractions(!1),this.vs=this.Cm.ye(this.Tm).setMouseInteractions(!1).As(e.Qp({x:t.Wi.fs.xAxis3DTitleFillStyle,y:t.Wi.fs.yAxis3DTitleFillStyle,z:t.Wi.fs.zAxis3DTitleFillStyle})).ks(e.Qp({x:t.Wi.fs.xAxis3DTitleFont,y:t.Wi.fs.yAxis3DTitleFont,z:t.Wi.fs.zAxis3DTitleFont})),this.Dm=new qo((()=>this.Cm.ye(this.Tm))),this.Bm=new Zo((()=>this.km.wg().setMouseInteractions(!1)),((t,e,i)=>{t.no().ua(i.lineStyle),e.forEach((({positions:e})=>t.xt(e)))})),this.cc=a,this.Fs=this.cc.Sg([this.vs]).Is(s.effectsText),this.Fm.setMouseEnterEventHandler(this.Mm).setMouseLeaveEventHandler(this._m).setMouseDragEventHandler(this.Am).setMouseDragStopEventHandler(this.wm),i.ig=this}addCustomTick(){const t=new $o((()=>this.chart.Wi.Gi()),(()=>{const e=this.Td.indexOf(t);e>=0&&this.Td.splice(e,1)}),this.fs.xAxis3DNumericTicks.majorTickStyle.tickStyle,this.fs.xAxis3DNumericTicks.majorTickStyle.tickLength,this.fs.xAxis3DNumericTicks.majorTickStyle.gridStrokeStyle,this.fs.xAxis3DNumericTicks.majorTickStyle.tickPadding,this.fs.xAxis3DNumericTicks.majorTickStyle.labelRotation,this.fs.xAxis3DNumericTicks.majorTickStyle.labelFillStyle,this.fs.xAxis3DNumericTicks.majorTickStyle.labelFont,(t=>this.formatValue(t)));return this.Td.push(t),this.chart.Wi.Gi(),t}setStrokeStyle(t){return this.Fm.ua(t).Pm(Yo(this.Fm.da())),this.chart.Wi.Gi(),this}getStrokeStyle(){return this.Fm.da()}setMouseInteractions(t){return this}setVisible(t){return super.setVisible(t),this.Fm.setVisible(t),!1===t&&(this.Bm.pm(),this.Dm.pm()),this.Cm.Gi(),this}ne(){return this.chart.getSeries()}Om(t){return Math.abs(this.ut.J(t)*this.km.Lm(1))}pe(t,e,i){const s=Math.abs(this.ut.J(e-t)*this.km.Lm(1));return{min:t-i*s,max:e+i*s}}Qs(t,e){return new Jo(e,t,this.Cm,this.Tm,this.km)}te(t,e){const i=this.Rm(e,t.u,t.ns.qs.tickLength,t.ns.qs.tickPadding);return t.Pi.Cn(i.labelPosition).Ln(i.labelAlignment),i}Rm(t,e,i,s){const{wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:a}=t,l=(e-this.ut.getInnerStart())/(this.ut.getInnerEnd()-this.ut.getInnerStart()),c=Ae.addVec(Ge(n,o,l),Ae.multiplyVec(Ae.multiply(h,this.km.Lm(.5*this.Fm.da().getThickness())),r)),d=Ae.addVec(c,Ae.multiplyVec(Ae.multiply(h,this.km.Lm(i)),r)),f=this.km.Em(d)||u(0,0);return{labelPosition:Qe(nt(f,this.chart.engine.scale,this.Tm),Je(a,s)),labelAlignment:{x:-a.x,y:-a.y},posTickEnd3D:d,posTickStart3D:c,tickPositionRelative:l}}_g(t,e,i){const{wuSize:s,start:r,end:n,tickDirection3D:o}=e,h=(t-this.ut.getInnerStart())/(this.ut.getInnerEnd()-this.ut.getInnerStart()),a=Ae.addVec(Ge(r,n,h),Ae.multiplyVec(Ae.multiply(o,this.km.Lm(.5*this.Fm.da().getThickness())),s)),l=Ae.addVec(a,Ae.multiplyVec(Ae.multiply(o,this.km.Lm(10)),s)),c=this.km.Em(a)||u(0,0),d=this.km.Em(l)||u(0,0);return this.Cm.Bc(this.Tm).Sa(c).ha(d).ua(new tt({fillStyle:new L({color:w(120*i)}),thickness:1}))}fe(t,e){return Qo(t,e,this.ut)}gc(t){if(!this.Ui)return;const e=Math.min(this.ys,this.xs),i=Math.max(this.ys,this.xs),s=this.Im,r=f(s.x.st(),s.y.st(),s.z.st());let n,o;this.ds===jo?(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.ds.tm(f(s.x.getInnerEnd(),s.y.getInnerEnd(),s.z.getInnerEnd()),n));const h=this.ds.vd,a=this.km.Em(n)||u(0,0),l=this.km.Em(o)||u(0,0),c=Ge(n,o,.5),d=Ae.addVec(c,Ae.multiplyVec(Ae.multiply(h,-1),r)),g=this.km.Em(c)||u(0,0),p=this.km.Em(d)||u(0,0),m=Ze(ti(nt(g,this.chart.engine.scale,this.Tm),nt(p,this.chart.engine.scale,this.Tm)));this.Fm.no().xt([n,o]);const{gridlinePositionA:y,gridlinePositionB:x,gridlinePositionC:S}=this.ds.im(t),v=t=>({x:-1===t.x?this.Im.x.getInnerStart():1===t.x?this.Im.x.getInnerEnd():0,y:-1===t.y?this.Im.y.getInnerStart():1===t.y?this.Im.y.getInnerEnd():0,z:-1===t.z?this.Im.z.getInnerStart():1===t.z?this.Im.z.getInnerEnd():0}),b=v(y),M=v(x),A=v(S),k={physicalAxisSize:Ke(ti(a,l)),wuSize:r,start:n,end:o,tickDirection3D:h,tickDirection2D:m,gridlinePositionA:b,gridlinePositionB:M,gridlinePositionC:A},w=this.Gs(k),D=this.Bm.gm();for(const[t,e]of this.Ri)for(const[,i]of e){const e=w.get(i);if(!e)continue;const s=this.zm(k,e);D.add({positions:[s.tickStroke.start,s.tickStroke.end]},{lineStyle:t.qs.tickStyle}),s.gridStroke&&D.add({positions:s.gridStroke},{lineStyle:t.qs.gridStrokeStyle})}const E=this.Dm.gm(),T={x:0,y:0};this.Td.forEach((t=>{if(!t.Ui||t.ui)return;const s=this.Rm(k,t.u,t.rm,t.om),r=this.zm(k,s),n=E.add().Cn(s.labelPosition).Ln(s.labelAlignment).As(t.am).ks(t.lm).Ms(t.Ec(t.u)).Cs(t.sd).Zs().$t();T.x=Math.max(T.x,n.x),T.y=Math.max(T.y,n.y),D.add({positions:[r.tickStroke.start,r.tickStroke.end]},{lineStyle:t.hm}),r.gridStroke&&D.add({positions:r.gridStroke},{lineStyle:t.nm})})),E.finishPlot(),D.finishPlot();const I=this.ee(((t,e)=>{const i=e.Pi.$t();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),{x:T.x,y:T.y}),C=Math.atan((l.y-a.y)/(l.x-a.x));this.vs.Ln({x:0,y:0}).Cs(180*-C/Math.PI);const P=Ae.addVec(c,Ae.multiplyVec(Ae.multiply(h,this.km.Lm(.5*this.Fm.da().getThickness()+this.re(((t,e)=>Math.max(t,e.tickLength)),0))),r)),O=this.km.Em(P)||u(0,0),F=Qe(nt(O,this.chart.engine.scale,this.Tm),Qe(Qe(ei(I,m),Je(m,this.re(((t,e)=>Math.max(t,e.labelPadding)),0))),ei(Je(this.vs.Zs().$t(),.5),m)));this.vs.Cn(F),this.Fm.Vm={overrideFollowing:!1,skipMousePicking:!1}}zm(t,e){const{gridlinePositionA:i,gridlinePositionB:s,gridlinePositionC:r}=t,n=e.posTickStart3D,o=e.posTickEnd3D,h=e.tickPositionRelative;let a;return kt(h,0)||kt(h,1)||(a=[this.isX()?{...i,x:n.x}:this.isY()?{...i,y:n.y}:this.isZ()?{...i,z:n.z}:{x:0,y:0,z:0},this.isX()?{...s,x:n.x}:this.isY()?{...s,y:n.y}:this.isZ()?{...s,z:n.z}:{x:0,y:0,z:0},this.isX()?{...r,x:n.x}:this.isY()?{...r,y:n.y}:this.isZ()?{...r,z:n.z}:{x:0,y:0,z:0}]),{gridStroke:a,tickStroke:{start:n,end:o}}}Ds(){super.Ds(),this.Bm.pm(),this.Dm.pm()}isX(){return this.ds===Uo}isY(){return this.ds===Xo}isZ(){return this.ds===jo}}class Jo extends Ui{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._d=r}}const Qo=(t,e,i)=>wt(t+.1*(e-t)+Math.abs(i.st())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e));class th{constructor(){this.type="simple"}}const eh=new th;class ih{constructor(t){this.type="phong",this.ambientReflection=1,this.specularReflection=.1,this.diffuseReflection=1,this.ambientColor=k("#000"),this.specularColor=k("#fff"),this.shininess=32,t&&(this.ambientReflection=Number.isNaN(Number(t.ambientReflection))?this.ambientReflection:Number(t.ambientReflection),this.specularReflection=Number.isNaN(Number(t.specularReflection))?this.specularReflection:Number(t.specularReflection),this.diffuseReflection=Number.isNaN(Number(t.diffuseReflection))?this.diffuseReflection:Number(t.diffuseReflection),this.ambientColor=t.ambientColor||this.ambientColor,this.specularColor=t.specularColor||this.specularColor,this.shininess=t.shininess||this.shininess)}}const sh=new ih,rh={Simple:th,Phong:ih};class nh extends Qr{constructor(t,e,i,s,r){super(t,e,s,r),this.Nm=sh,this.Gm=!0,this.Wm=!0,this.rl=t,this.km=i,this.be=new Map,this.onMouseWheel(this.rl.Hm),this.onMouseDrag(this.rl.Um),this.onTouchStart(this.rl.$m.onTouchStart),this.onTouchMove(this.rl.$m.onTouchMove),this.onTouchEnd(this.rl.$m.onTouchEnd)}setAutoScrollingEnabled(t){return this.Gm=t,this.rl.Wi.Gi(),this}getAutoScrollingEnabled(){return this.Gm}setColorShadingStyle(t){return this.Nm=t,this.be.forEach(((e,i)=>i.Ym(t))),this.km.Gi(),this}getColorShadingStyle(){return this.Nm}setDepthTestEnabled(t){return this.Wm=t,this.be.forEach(((e,i)=>i.Xm(t))),this.km.Gi(),this}getDepthTestEnabled(){return this.Wm}jm(){}gc(){}Zm(){}getXMax(){const t=this.Gn;return t?t.wt():void 0}getXMin(){const t=this.Gn;return t?t.At():void 0}getYMax(){const t=this.Gn;return t?t.Ct():void 0}getYMin(){const t=this.Gn;return t?t.kt():void 0}getZMax(){const t=this.Gn;return t?t.Km():void 0}getZMin(){const t=this.Gn;return t?t.qm():void 0}Jp(){const t=this.Gn;return t?f(t.bo(),t.vo(),t.Jm()):f(0,0,0)}}class oh extends nh{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Su="Box Series 3D",this.Qm=.25,this.ud=()=>le(this.jr),this.jr=de(this.fs.boxSeries3DFillStyle,r),this.Gn=this.km.iS().Xm(this.Wm).As(this.jr).tS(this.Qm).zr(this.getHighlight()),this.gu(this.Gn)}invalidateData(t){const e=t.length;if(0===e)return this;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;ile(this.ca.getFillStyle())}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;return this.Gn.ua(e),this.km.Gi(),this}getStrokeStyle(){return this.ca}add(t){return(t=Array.isArray(t)?t:[t])?(this.Gn.xt(t.slice()),this.km.Gi(),this):this}clear(){return this.Gn.no(),this.Wc=0,this}getPointAmount(){const t=this.Gn;return t.oo()+t.ao()}oe(){return this.Gm&&this.getPointAmount()>0&&this.getVisible()}Au(t,e){t.zr(e),this.km.Gi()}attach(t,e){return super.attach(t,e),ae(t,this.fs,{stroke:this.ca}),this}}class ah extends hh{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Su="Line Series 3D",this.ca=de(s.lineSeries3DStrokeStyle,r),this.eS=ds.pointStyle3D,this.hS(this.ca),this.Gn=this.km.Kp([Po.UserSeries]).Xm(this.Wm).ua(this.ca).Pm(this.eS).zr(this.getHighlight()),this.gu(this.Gn)}setStrokeStyle(t){super.setStrokeStyle(t),this.hS(this.ca);const e=this.eS;return this.Gn.Pm(e),this}hS(t){const e=new es.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.eS=e}}class lh extends hh{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.Su="Point Line Series 3D",this.ud=()=>le(this.ca.getFillStyle())||le(this.eS.getFillStyle()),this.eS=de(s.pointLineSeries3DPointStyle,r),this.ca=de(s.lineSeries3DStrokeStyle,r),this.rS(),this.Gn=this.km.Kp([Po.UserSeries]).Xm(this.Wm).ua(this.ca).Pm(this.eS).zr(this.getHighlight()),this.gu(this.Gn)}setPointStyle(t){return this.eS="function"==typeof t?t(this.eS):t,this.rS(),this.Gn.Pm(this.eS),this.km.Gi(),this}getPointStyle(){return this.eS}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.ca,i=Math.abs(e.getThickness()),s=this.eS;i>s.getSize()&&(this.eS=s.setSize(i)),this.rS();const r=this.eS;return this.Gn.Pm(r),this.km.Gi(),this}rS(){const t=this.eS,e=t.getSize();this.eS=t.setSize(e)}Au(t,e){t.zr(e),this.km.Gi()}}class uh extends nh{constructor(t,e,i,s,r,n){super(t,e,i,s,r)}add(t){return(t=Array.isArray(t)?t:[t])?(this.Gn.xt(t.slice()),this.km.Gi(),this):this}clear(){return this.Gn.no(),this.Wc=0,this}getPointAmount(){const t=this.Gn;return t.oo()+t.ao()}oe(){return this.Gm&&this.getPointAmount()>0&&this.getVisible()}Au(t,e){t.zr(e),this.km.Gi()}attach(t,e){return super.attach(t,e),ae(t,this.fs,{point3D:this.nS}),this}}class ch extends uh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Su="Point Series 3D",this.ud=()=>le(this.nS.getFillStyle());const o=void 0!==(null==n?void 0:n.automaticColorIndex)?n.automaticColorIndex:this.rl.getSeries().length;this.nS=de(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Gn=this.km.aS(h).Xm(this.Wm).oS(this.nS).zr(this.getHighlight()),this.gu(this.Gn)}setPointStyle(t){this.nS="function"==typeof t?t(this.nS):t;const e=this.nS;return this.Gn.oS(e),this.km.Gi(),this}getPointStyle(){return this.nS}}class dh extends uh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Su="Point Cloud Series 3D",this.ud=()=>le(this.nS.getFillStyle());const o=this.rl.getSeries().length;this.nS=de(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Gn=this.km.aS(h).oS(this.nS).zr(this.getHighlight()),this.gu(this.Gn)}setPointStyle(t){this.nS="function"==typeof t?t(this.nS):t;const e=this.nS;return this.Gn.oS(e),this.km.Gi(),this}getPointStyle(){return this.nS}}const fh={Triangulated:ch,Pixelated:dh};class gh extends xo{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,h,a,l),this.lS=[],this.cS=0,this.uS=t=>{const e=this.lS.indexOf(t);e>=0&&(this.lS.splice(e,1),this.P.emit("seriesDispose",this,t))},this.dS=()=>{this.cS+=1},this.fS=()=>{this.cS-=1},this.onSeriesBackgroundMouseEnter=t=>this.P.on("mouseEnterSeriesBackground",t),this.onSeriesBackgroundMouseLeave=t=>this.P.on("mouseLeaveSeriesBackground",t),this.onSeriesBackgroundMouseMove=t=>this.P.on("mouseMoveSeriesBackground",t),this.onSeriesBackgroundMouseDown=t=>this.P.on("mouseDownSeriesBackground",t),this.onSeriesBackgroundMouseUp=t=>this.P.on("mouseUpSeriesBackground",t),this.onSeriesBackgroundMouseClick=t=>this.P.on("mouseClickSeriesBackground",t),this.onSeriesBackgroundMouseDoubleClick=t=>this.P.on("mouseDoubleClickSeriesBackground",t),this.onSeriesBackgroundMouseDragStart=t=>this.P.on("mouseDragStartSeriesBackground",t),this.onSeriesBackgroundMouseDrag=t=>this.P.on("mouseDragSeriesBackground",t),this.onSeriesBackgroundMouseDragStop=t=>this.P.on("mouseDragStopSeriesBackground",t),this.onSeriesBackgroundMouseWheel=t=>this.P.on("mouseWheelSeriesBackground",t),this.onSeriesBackgroundTouchStart=t=>this.P.on("touchStartSeriesBackground",t),this.onSeriesBackgroundTouchMove=t=>this.P.on("touchMoveSeriesBackground",t),this.onSeriesBackgroundTouchEnd=t=>this.P.on("touchEndSeriesBackground",t),this.offSeriesBackgroundMouseEnter=t=>this.P.off(t,"mouseEnterSeriesBackground"),this.offSeriesBackgroundMouseLeave=t=>this.P.off(t,"mouseLeaveSeriesBackground"),this.offSeriesBackgroundMouseMove=t=>this.P.off(t,"mouseMoveSeriesBackground"),this.offSeriesBackgroundMouseDown=t=>this.P.off(t,"mouseDownSeriesBackground"),this.offSeriesBackgroundMouseUp=t=>this.P.off(t,"mouseUpSeriesBackground"),this.offSeriesBackgroundMouseClick=t=>this.P.off(t,"mouseClickSeriesBackground"),this.offSeriesBackgroundMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClickSeriesBackground"),this.offSeriesBackgroundMouseDragStart=t=>this.P.off(t,"mouseDragStartSeriesBackground"),this.offSeriesBackgroundMouseDrag=t=>this.P.off(t,"mouseDragSeriesBackground"),this.offSeriesBackgroundMouseDragStop=t=>this.P.off(t,"mouseDragStopSeriesBackground"),this.offSeriesBackgroundMouseWheel=t=>this.P.off(t,"mouseWheelSeriesBackground"),this.offSeriesBackgroundTouchStart=t=>this.P.off(t,"touchStartSeriesBackground"),this.offSeriesBackgroundTouchMove=t=>this.P.off(t,"touchMoveSeriesBackground"),this.offSeriesBackgroundTouchEnd=t=>this.P.off(t,"touchEndSeriesBackground"),this.gS=this.cc.Sg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.lS.forEach((e=>e.setAnimationHighlight(t))),this}pS(t,e){this.gS.pu([e]),t.setMouseMoveEventHandler(((t,e)=>{this.P.emit("mouseMoveSeriesBackground",this,e)})).setMouseEnterEventHandler(((t,e)=>{this.P.emit("mouseEnterSeriesBackground",this,e)})).setMouseLeaveEventHandler(((t,e)=>{this.P.emit("mouseLeaveSeriesBackground",this,e)})).setMouseDownEventHandler(((t,e)=>this.P.emit("mouseDownSeriesBackground",this,e))).setMouseUpEventHandler(((t,e)=>this.P.emit("mouseUpSeriesBackground",this,e))).setMouseClickEventHandler(((t,e)=>this.P.emit("mouseClickSeriesBackground",this,e))).setMouseDoubleClickEventHandler(((t,e)=>this.P.emit("mouseDoubleClickSeriesBackground",this,e))).setMouseWheelEventHandler(((t,e)=>this.P.emit("mouseWheelSeriesBackground",this,e))).setMouseDragStartEventHandler(((t,e,i)=>this.P.emit("mouseDragStartSeriesBackground",this,e,i))).setMouseDragEventHandler(((t,e,i,s,r)=>this.P.emit("mouseDragSeriesBackground",this,e,i,s,r))).setMouseDragStopEventHandler(((t,e,i,s)=>this.P.emit("mouseDragStopSeriesBackground",this,e,i,s))).setTouchStartEventHandler(((t,e)=>{this.P.emit("touchStartSeriesBackground",this,e)})).setTouchMoveEventHandler(((t,e)=>{this.P.emit("touchMoveSeriesBackground",this,e)})).setTouchEndEventHandler(((t,e)=>{this.P.emit("touchEndSeriesBackground",this,e)}))}setSeriesBackgroundFillStyle(t){return this.mS.As(t),this.Wi.Gi(),this}getSeriesBackgroundFillStyle(){return this.mS._s()}setSeriesBackgroundStrokeStyle(t){return this.SS.ir(t),this.Wi.Gi(),this}getSeriesBackgroundStrokeStyle(){return this.SS.sr()}setSeriesBackgroundEffect(t){return this.gS.Is(t),this.Wi.Gi(),this}getSeriesBackgroundEffect(){return this.gS.Ps()}yS(t){this.lS.push(t),t.onMouseEnter(this.dS),t.onMouseLeave(this.fS),void 0!==this.xS&&t.setHighlightOnHover(this.xS),this.P.emit("seriesAdded",this,t)}xd(){return this.lS}bS(){return this.cS}setSeriesHighlightOnHover(t){return this.xS=t,this.lS.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.lS.slice().forEach(Mt),super.dispose()}}const ph=Ae.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class mh{constructor(t,e,i,s){this.vS=!0,this.MS=!0,this._S=2*-Math.PI/2160,this.AS=2*Math.PI/2160,this.wS=.1,this.kS=1*Math.PI/180,this.CS=t,this.TS=e,this.IS=i,this.Em=s}getDefaultCameraConfiguration(t){const e={direction:ph,location:Ae.multiply(ph,-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.FS(i,t):"wheel-zoom"===t.type?i=this.PS(i,t):"rotate+zoom"===t.type?i=this.DS(i,t):"fixed-rotate"===t.type?i=this.BS(i,t):"move"===t.type&&(i=this.OS(i,t))})),this.vS?i=this.LS(t.boundingBox,i):this.MS&&(i=this.RS(t.boundingBox,i)),i}FS(t,e){const{rotation:i}=e,s=t.location,r=Ae.multiply(Ae.normalize(t.location),-1),{Right:n,Up:o}=this.ES(r);let h=s;const a=this.zS(r),l=i.x*this._S*a;h=Ae.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.AS,a-this.kS);return 0!==u&&(h=Ae.rotateAroundAxis(h,n,u)),{location:h,direction:Ae.multiply(Ae.normalize(h),-1)}}PS(t,e){const{deltaY:i}=e;this.vS&&this.VS(!1);const s=t.location,r=Ae.multiply(Ae.normalize(s),-1),n=i*this.wS,o=Ae.length(s)*-n;return{direction:r,location:Ae.addVec(s,Ae.multiply(r,o))}}DS(t,e){const{rotation:i,cameraDistance:s}=e;this.vS&&this.VS(!1);let r=this.FS(t,{type:"rotate",rotation:i});const n=r.location,o=Ae.multiply(Ae.normalize(n),-1),h=Ae.multiply(o,-s);return r={direction:Ae.multiply(Ae.normalize(h),-1),location:h},r}BS(t,e){this.vS&&this.VS(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.ES(r),h=i.x*this._S;let a=Ae.normalize(Ae.rotateAroundAxis(r,o,h));const l=i.y*this.AS;return a=Ae.normalize(Ae.rotateAroundAxis(a,n,l)),{location:s,direction:a}}OS(t,e){this.vS&&this.VS(!1),this.MS=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.ES(n);return{location:Ae.addVec(r,Ae.multiply(n,.01*s),Ae.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:Ae.multiply(Ae.normalize(t.cameraLocation),-1)};return this.vS?this.LS(t.boundingBox,e):this.RS(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:Ae.multiply(Ae.normalize(t.cameraLocation),-1)};return this.vS?this.LS(t.boundingBox,e):this.RS(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:Ae.multiply(Ae.normalize(t.cameraLocation),-1)};if(this.vS)return this.LS(t.boundingBox,e)}LS(t,e,i){let s=e;i=void 0!==i?i:0,s=this.NS(t,s,100,20,1,i,5);const r=this.zS(s.direction);return s=this.GS(s,this.WS(t,s,100,1),r),s}NS(t,e,i,s,r,n,o){return yh(n,o,(t=>({direction:e.direction,location:Ae.multiply(e.direction,-t)})),(e=>this.HS(t,e)),i,r,"linear",s)}WS(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.ES(e.direction),a=this.US(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:Ae.normalize(Ae.lerp(l.direction,h,t))})),(e=>this.$S(t,e)),0,u,!0,i):xh(0,c,(t=>({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,o,t))})),(e=>this.$S(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,n,t))})),(e=>this.YS(t,e)),0,u,!0,i):xh(0,c,(t=>({location:l.location,direction:Ae.normalize(Ae.lerp(l.direction,r,t))})),(e=>this.YS(t,e)),0,u,!0,i)),l}HS(t,e){const i=this.US(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}YS(t,e){const i=this.US(t,!1,e);return Math.abs(i.left-i.right)}$S(t,e){const i=this.US(t,!1,e);return Math.abs(i.top-i.bottom)}US(t,e,i){const s=Ve(this.XS(t,e,i).map((t=>nt(t,this.CS,this.TS))));return{left:s.min.x,right:this.TS.x.getInnerEnd()-s.max.x,top:this.TS.y.getInnerEnd()-s.max.y,bottom:s.min.y}}XS(t,e,i){const s=this.IS,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.Em(t,i))).filter((t=>void 0!==t))}RS(t,e){const i=Ae.length(e.location),s=this.jS(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)le(this.jr),this.Nm=eh;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.rl.getSeries().length;this.jr=de(this.fs.surfaceGridSeries3DFillStyle,o),this.Fa=de(this.fs.surfaceGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.end?{x:(s.end.x-h.x)/s.columns,z:(s.end.z-h.z)/s.rows}:s.step||{x:1,z:1},l={heatmapDataType:"intensity",dataOrder:s.dataOrder||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this.Dh=l,this.Gn=this.km.KS(l).As(this.jr).Pa(this.Fa).Ym(this.Nm).zr(this.getHighlight()),this.gu(this.Gn)}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Gn.As(this.jr),this.km.Gi(),this}getFillStyle(){return this.jr}setWireframeStyle(t){return this.Fa="function"==typeof t?t(this.Fa):t,this.Gn.Pa(this.Fa),this.km.Gi(),this}getWireframeStyle(){return this.Gn.Da()}setIntensityInterpolation(t){return t=t||"disabled",this.Gn.qS(t),this.km.Gi(),this}getIntensityInterpolation(){return this.Gn.JS()}invalidateIntensityValues(t){if(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.Dh.dataOrder?t.length:t[0].length,rows:"rows"===this.Dh.dataOrder?t.length:t[0].length},i="columns"===this.Dh.dataOrder?this.Dh.columns:this.Dh.rows,s="columns"===this.Dh.dataOrder?this.Dh.rows:this.Dh.columns;if(e.x>i||e.y>s){if(!0===this.rl.uf.Gh){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.rl.uf.Gh){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.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.`;mt.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.rl.uf.Gh){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.rl.uf.Gh){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Dh.columns}x${this.Dh.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.`;mt.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;ele(this.jr),this.Nm=eh;const o=void 0!==(null==s?void 0:s.automaticColorIndex)?s.automaticColorIndex:this.rl.getSeries().length;this.jr=de(this.fs.surfaceScrollingGridSeries3DFillStyle,o),this.Fa=de(this.fs.surfaceScrollingGridSeries3DWireframeStyle,o);const h=s.start||{x:0,z:0},a=s.step||{x:1,z:1},l={heatmapDataType:"intensity",scrollDimension:s.scrollDimension||"columns",columns:s.columns,rows:s.rows,start:h,step:a};this.Dh=l,this.Gn=this.km.ey(l).As(this.jr).Pa(this.Fa).Ym(this.Nm).zr(this.getHighlight()),this.gu(this.Gn)}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Gn.As(this.jr),this.km.Gi(),this}getFillStyle(){return this.jr}setWireframeStyle(t){return this.Fa="function"==typeof t?t(this.Fa):t,this.Gn.Pa(this.Fa),this.km.Gi(),this}getWireframeStyle(){return this.Gn.Da()}setIntensityInterpolation(t){return t=t||"disabled",this.Gn.qS(t),this.km.Gi(),this}getIntensityInterpolation(){return this.Gn.JS()}clear(){return this.Gn.no(),this.km.Gi(),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.Dh.scrollDimension?this.Dh.rows:this.Dh.columns;if(i>s-1){if(!0===this.rl.uf.Gh){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Dh.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.rl.uf.Gh){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Dh.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;mt.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.Gn.hy({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.km.Gi(),this}setCullMode(t){return this.Gn.iy("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Gn.sy()}jm(){}gc(){}Zm(){}oe(){return this.Gm&&this.getVisible()}Au(t,e){t.zr(e),this.km.Gi()}}class bh extends gh{constructor(t,e,i,s,r,n,o){let h;super(t,e,i,e.tp("chart3D bg",0),s,e.Wi.fs.chart3DBackgroundFillStyle,e.Wi.fs.chart3DBackgroundStrokeStyle,e.Wi.fs.chart3DTitleFont,e.Wi.fs.chart3DTitleFillStyle,n),this.ny=1,this.oy=[],this.ly=2,this.uy=!0,this.gy=!0,this.py=!0,this.my=0,this.axes={id:"axes",chart:this},this.world={id:"world",chart:this},this.Ze=[],this.th=()=>{const t=this.km.Sy();this.xy.yy(t),this.by.yy(t);const e=this.vy.viewportChanged(this.My());e&&this._y(e),this.Wi.Gi()},this.Um=(t,e,i,s,r)=>{if(this.py){const t=r;this.oy.push({type:"rotate",rotation:t}),this.Wi.Gi(),Zt(e)}},this.Hm=(t,e)=>{if(this.gy){if(this.uy)Math.sign(this.my)!==Math.sign(e.deltaY)?this.my=fe(e):this.my+=fe(e);else{const t=fe(e);this.oy.push({type:"wheel-zoom",deltaY:t})}this.Wi.Gi(),Zt(e)}},this.uf.Oh||this.uf.Bh||this.Wi.Ph(1),this.hp.Ms("Chart3D"),this.Ay=i.d3(),this.Ay.x.Z(-1,1),this.Ay.y.Z(-1,1),this.Ay.z.Z(-1,1),this.km=e.wy("chart3D layer3D",0,this.Ay),this.xy=e.ky("chart3D series bg",0),this.by=e.Vp("chart3D axis ui",1),this.Cy={x:new Ko(this,Uo,this.Ay.x,this.fs,this.km,this.by,this.pixelScale,!1,this.cc),y:new Ko(this,Xo,this.Ay.y,this.fs,this.km,this.by,this.pixelScale,!1,this.cc),z:new Ko(this,jo,this.Ay.z,this.fs,this.km,this.by,this.pixelScale,!1,this.cc)},this.Ty=this.km.Kp([Po.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.fs.chart3DBoundingBoxStrokeStyle),this.mS=this.xy.Iu(this.engine.scale,Ys.Simple).As(this.fs.chart3DSeriesBackgroundFillStyle).ir(J).setMouseInteractions(!0),this.SS=this.xy.Iu(this.engine.scale,Ys.Simple).As(B).ir(this.fs.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.pS(this.mS,this.SS),this.Iy({x:1,y:1,z:1},!0),this.vy=new mh(this.engine.scale,this.pixelScale,this.Ay,((t,e)=>(e&&this._y(e),this.km.Em(t)))),this.Fy=this.vy.getDefaultCameraConfiguration(this.Py(this.Dy)),this._y(this.Fy),this.$m=Lr(new Nr(((t,e,i)=>{h={locationOne:e,locationTwo:i,cameraLocation:this.km.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.py&&!this.gy)return;const o=(h.locationOne.x-h.locationTwo.x)**2+(h.locationOne.y-h.locationTwo.y)**2,a=(e.x-i.x)**2+(e.y-i.y)**2,l=Ae.length(h.cameraLocation),c=o/a*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.oy.push({type:"rotate+zoom",rotation:this.py?d:{x:0,y:0},cameraDistance:this.gy?c:l}),this.Wi.Gi(),Zt(n)}),(t=>{})),new Vr((t=>{}),((t,e,i,s,r)=>{if(this.py){const t=s;this.oy.push({type:"rotate",rotation:t}),this.Wi.Gi(),Zt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.$m.onTouchStart),this.onBackgroundTouchMove(this.$m.onTouchMove),this.onBackgroundTouchEnd(this.$m.onTouchEnd),this.onSeriesBackgroundTouchStart(this.$m.onTouchStart),this.onSeriesBackgroundTouchMove(this.$m.onTouchMove),this.onSeriesBackgroundTouchEnd(this.$m.onTouchEnd),this.onBackgroundMouseDrag(this.Um),this.onBackgroundMouseWheel(this.Hm),this.onBackgroundMouseDown(((t,e)=>{Zt(e)})),this.onSeriesBackgroundMouseDrag(this.Um),this.onSeriesBackgroundMouseWheel(this.Hm),this.onSeriesBackgroundMouseDown(((t,e)=>{Zt(e)})),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.onResize(this.th),this.th(),this.Qg(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||ch)(this,this.uS,this.km,this.fs,this.Wi.cc,t);return this.yS(e),e}addLineSeries(t){const e=new ah(this,this.uS,this.km,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPointLineSeries(t){const e=new lh(this,this.uS,this.km,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addSurfaceGridSeries(t){const e=new Sh(this,this.uS,this.km,t,this.fs,this.Wi.cc);return this.yS(e),e}addSurfaceScrollingGridSeries(t){const e=new vh(this,this.uS,this.km,t,this.fs,this.Wi.cc);return this.yS(e),e}addBoxSeries(t){const e=new oh(this,this.uS,this.km,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}getDefaultAxisX(){return this.Cy.x}getDefaultAxisY(){return this.Cy.y}getDefaultAxisZ(){return this.Cy.z}getDefaultAxes(){return[this.Cy.x,this.Cy.y,this.Cy.z]}setCameraLocation(t){let e={location:t,direction:Ae.normalize(Ae.multiply(t,-1))};const i=this.vy.cameraLocationChanged(this.My(e));return i&&(e=i),this._y(e),this.Wi.Gi(),this}getCameraLocation(){return this.km.getCameraLocation()}getCameraDirection(){return this.km.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.vy.VS(t);const e=this.vy.cameraLocationChanged(this.My());return e&&this._y(e),this}getCameraAutomaticFittingEnabled(){return this.vy.ZS()}onCameraChange(t){return this.P.on("cameraChange",t)}offCameraChange(t){return this.P.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.Ty.ua(t).Pm(Yo(this.Ty.da())),this.km.Gi(),this}getBoundingBoxStrokeStyle(){return this.Ty.da()}setBoundingBox(t){return this.Iy(t,!1),this}Iy(t,e){this.Dy=t;const i=this.Py(t);if(this.Ay.x.q(i.x),this.Ay.y.q(i.y),this.Ay.z.q(-i.z),!e){const t=this.vy.boundingBoxChanged(this.My());t&&this._y(t)}this.Wi.Gi()}getBoundingBox(){return this.Dy}gc(){const t=mt.performance.now();if(So.lp(this.hp,this.ip),0!==this.my){const e=this.By?t-this.By:1e3/60,i=this.my*e*.006;this.oy.push({type:"wheel-zoom",deltaY:i}),this.my=Math.sign(this.my)*Math.max(Math.abs(this.my)-.01*e,0),0!==this.my?(this.Wi.Gi(!0),this.By=t):this.By=void 0}const e=this.getCameraDirection();if(this.oy.length>0){const t=this.vy.applyCameraInteractions(this.My(),this.oy);t&&this._y(t),this.oy.length=0}this.Oy&&Ae.equals(this.Oy.location,this.Fy.location)&&Ae.equals(this.Oy.direction,this.Fy.direction)||this.P.emit("cameraChange",this,this.getCameraLocation()),this.Oy=this.Fy,super.gc();for(let t=0;tthis.km.Em(t))),o=this.km.Em(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=se(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.Ze.length=0,this.Ay.G(),this.km.G(),this.by.G(),this.xy.G(),super.dispose()}X(){return this.Ay.x.X(),this.Ay.y.X(),this.Ay.z.X(),super.X()}j(){return super.j()}_y(t){this.km.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(Ae.addVec(t.location,Ae.multiply(t.direction,-this.ly))),this.Fy=t,this.Wi.Gi()}Py(t){return Ae.divide(t,Ae.length(t)/this.ny)}My(t=this.Fy){return{boundingBox:this.Py(this.Dy),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.gy=t,this}getMouseInteractionZoom(){return this.gy}setMouseInteractionRotate(t){return this.py=t,this}getMouseInteractionRotate(){return this.py}forEachAxis(t){return t(this.Cy.x),t(this.Cy.y),t(this.Cy.z),this}getMinimumSize(){}getSeries(){return this.lS}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.uy=!!t,this}getAnimationZoom(){return this.uy}}const Mh={Column:Cn,Row:Pn};class Ah extends mo{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ly=new Map,this.Ry=this.addUIElement(Mh.Row).setPosition({x:0,y:100}).setOrigin(Er.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(J)))}add(t,e){return(t instanceof xo?[t]:t instanceof yd?t.getCells().filter((t=>t.panel instanceof xo)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Ry.addElement(ro.VerticalLegendBox).setBackground((t=>t.setFillStyle(B).setStrokeStyle(J))).add(t,e).setTitle(t.getTitle());this.Ly.set(t,i)})),this.Wi.Gi(),this}setLegendBoxes(t){return this.Ly.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.Ry.getSize()}}class kh{constructor(t,e){this.Ey=t,this.zy=e}alter(t){this.Vy=void 0!==this.Vy?this.Vy:this.zy(),this.Ny=t,this.Ey(t)}resetValue(){void 0!==this.Ny&&(void 0!==this.Vy&&this.isAltered()&&this.Ey(this.Vy),this.Vy=void 0,this.Ny=void 0)}getNormalValue(){return void 0!==this.Vy?this.Vy:this.zy()}isAltered(){return void 0!==this.Ny&&this.zy()===this.Ny}}class wh{constructor(t,e){this.Gy=[],this.Wy=t,this.ut=e}update(){return this.Wy.getVisible()?!(this.Hy()&&(!this.Uy()||(this.resetTable(),this.Wy.Zs(),this.Hy()))&&(this.$y(),this.Wy.Zs(),this.Hy()&&(this.resetTable(),this.Wy.Zs(),1))):(this.Uy()&&this.resetTable(),!0)}Uy(){for(let t=0;t{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()||s.yi.y.getInnerEnd()})(this.Wy,this.ut)}Yy(){return((t,i)=>{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.xi.x.getInnerEnd()})(this.Wy,this.ut)}Xy(){return((t,i)=>{const s=nt(t.getPosition(u(-1,-1),e.UISpace.PaddedBackground),t.scale,i),r=nt(t.getPosition(u(1,1),e.UISpace.PaddedBackground),t.scale,i);return s.yi.y.getInnerEnd()})(this.Wy,this.ut)}jy(t){return this.Gy.push(t),t}}class Dh extends wh{constructor(){super(...arguments),this.gn=this.jy(new kh((t=>this.Wy.setOrigin(t)),(()=>this.Wy.getOrigin())))}$y(){const t=this.gn.getNormalValue(),e=u(this.Yy()?-t.x:t.x,this.Xy()?-t.y:t.y);this.gn.alter(e)}}class Eh extends wh{constructor(t,e,i,s){super(t,e),this.Zy=this.jy(new kh((t=>this.Wy.setTextFont((e=>e.setSize(t)))),(()=>this.Wy.getTextFont().getSize()))),this.Ky=i,this.qy=s}$y(){const t=this.Zy.getNormalValue(),e=this.Ky;if(enew Dh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new Eh(i,s,t,e)};class Ih{constructor(){this.Jy=[]}addRow(...t){return this.Jy.push(t),this}}class Ch extends Ih{Lc(){const t=this.Jy;return this.Jy=[],t}Qy(){return this.Jy.length=0,this}}class Ph extends Tn{constructor(){super(...arguments),this.wc=this.fs.cursorResultTableTextFont,this.sd=0,this.am=this.fs.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!==o&&o.length>0){for(let t=h.length;t=h.length)t=r.addElement(xn,void 0);else{const e=h[n];e instanceof An?(r.getMembers()[n].dispose(),t=r.addElement(xn,n)):t=e}t.setFont(this.wc).setFillStyle(this.am).setText(o).setTextRotation(this.sd)}else{for(let t=h.length;t=h.length?r.addGap(void 0,void 0):h[n]instanceof yn&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.Hr.Gi(),this}setTextFillStyle(t){this.am="function"==typeof t?t(this.am):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this.ux=Th.Flip(this.Wy,this.scale)}dispose(){return this.lx.dispose(),this.Wy.dispose(),this}pointAt(t){return this.an=t.series.scale===this.scale?t.location:nt(t.location,t.series.scale,this.scale),this.lx.setPosition(this.an),this.Wy.setPosition(this.an).setContent(t.resultTableContent),this.Hr.Gi(),this}getPosition(){return this.an}setVisible(t){return this.Ui=t,this.Hr.Gi(),this}getVisible(){return this.Ui}setPointMarkerVisible(t){return this.ix=t,this.Hr.Gi(),this}getPointMarkerVisible(){return this.ix}setPointMarker(t){return t(this.lx),this.Hr.Gi(),this}getPointMarker(){return this.lx}setResultTableVisible(t){return this.sx=t,this.Hr.Gi(),this}getResultTableVisible(){return this.sx}setResultTable(t){return t(this.Wy),this.Hr.Gi(),this}getResultTable(){return this.Wy}setAutoFitStrategy(t){return this.ux&&this.ux.resetTable(),this.ux=t?t(this.Wy,this.Hr.Wi.ut):void 0,this.Hr.Gi(),this}getAutoFitStrategy(){return void 0!==this.ux}gc(){return this.ux&&this.ux.update(),this.Wy.setVisible(this.hx&&this.Ui&&this.sx),this.lx.setVisible(this.hx&&this.Ui&&this.ix),this.lx.gc(),this.Wy.gc(),this}Zs(){return this.lx.Zs(),this.Wy.Zs(),this.hx=((t,e,i=e)=>{const s=e!==i?nt(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.an,this.scale),this}}class Fh extends Oh{constructor(){super(...arguments),this.gx=!1}pointAt(t){return this.mx(t.fillStyle),super.pointAt(t)}mx(t){t&&this.gx&&this.Wy.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.gx=t,this.Hr.Gi(),this}getResultTableAutoTextStyle(){return this.gx}}class Rh extends Oh{setPosition(t){return this.an=t,this.lx.setPosition(t),this.Wy.setPosition(t),this.Hr.Gi(),this}}class Bh{constructor(t,e,i=[]){this.Sx=[],this.yx=(t,e)=>(this.Sx.forEach((i=>i(t,e))),t),this.nx=t,this.ox=e,this.Sx=i}}class zh extends Bh{constructor(){super(...arguments),this.xx=(t,e,i,s)=>this.yx(new Fh(t,e,i,this.nx,this.ox,s),s),this.addStyler=t=>new zh(this.nx,this.ox,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new zh(t,this.ox,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new zh(this.nx,t,this.Sx.map((t=>t)))}}class _h extends Bh{constructor(){super(...arguments),this.bx=(t,e,i,s)=>this.yx(new Rh(t,e,i,this.nx,this.ox,s),s),this.addStyler=t=>new _h(this.nx,this.ox,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new _h(t,this.ox,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new _h(this.nx,t,this.Sx.map((t=>t)))}}const Lh=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),Gh=(t,e)=>t.setPointMarker((t=>t.setFillStyle(e.chartMarkerPointMarkerFillStyle).setStrokeStyle(e.chartMarkerPointMarkerStrokeStyle).setSize(u(20,20)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setBackground((t=>t)).setOrigin(u(-1,-1)).setMargin(10)));new zh(Sn,Sn,[Lh]);const Vh=new zh(Sn,Mn,[Lh,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Mn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Nh=Vh;new _h(bn,Sn,[Gh,t=>t.setResultTableVisible(!1)]);const Wh=new _h(fn,Sn,[Gh,t=>t.setResultTable((t=>t.setOrigin(Er.LeftBottom)))]),Hh=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),Uh={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Xh=(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(),jh=(t,e)=>{let i=e.geometry;return i=Yh(t,e,i),i=$h(t,e,i),i},Yh=(t,e,i)=>{if(t===Uh.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===Uh.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=Ve(Dt(i)),h=[];for(let e=0;e{this.lS.includes(t)||(this.lS.push(t),this.P.emit("seriesAdded",this,t))},this._x=i.Ax();const c=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},d=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},f=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},g=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},p=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()},m=()=>{this.vx!==e.AutoCursorModes.disabled&&this.Wi.Gi()};this.onSeriesBackgroundMouseEnter(c),this.onSeriesBackgroundMouseMove(d),this.onSeriesBackgroundMouseLeave(f),this.onSeriesBackgroundTouchStart(g),this.onSeriesBackgroundTouchMove(p),this.onSeriesBackgroundTouchEnd(m),this.wx(((t,e)=>{const i=e.onMouseEnter(c),s=e.onMouseMove(d),r=e.onMouseLeave(f),n=e.onTouchStart(g),o=e.onTouchMove(p),h=e.onTouchEnd(m),a=this.kx(((t,l)=>{l===e&&(e.offMouseEnter(i),e.offMouseMove(s),e.offMouseLeave(r),e.offTouchStart(n),e.offTouchMove(o),e.offTouchEnd(h)),this.Cx(a)}))}))}setAutoCursor(t){return this.Tx&&t(this.Tx),this.Wi.Gi(),this}getAutoCursor(){return this.Tx}setAutoCursorMode(t){return this.vx=t,this.Wi.Gi(),this}getAutoCursorMode(){return this.vx}Ix(t){if(t.xthis.uiScale.x.Wt()||t.ythis.uiScale.y.Wt())return;let e,i=Number.MAX_VALUE;for(const s of this.lS)if(s.getCursorEnabled()&&s.getVisible()){const r=s.Ix(t,!1);if(r){const s=nt(r.location,r.scale,this.engine.scale),n=Be(t,s);Number.isNaN(n)||e&&!(nt.getIsUnderMouse())),r=this.mS.getIsUnderMouse();this.vx===e.AutoCursorModes.snapToClosest?(r||void 0!==s)&&(i=t&&this.Ix(t)):this.vx===e.AutoCursorModes.onHover&&void 0!==s&&s.getCursorEnabled()&&(i=t&&s.Ix(t,!0))}i?this.Tx.pointAt(i).setVisible(!0):this.Tx.setVisible(!1),this.Tx.Zs().gc()}wx(t){return this.P.on("seriesAdded",t)}Px(t){return this.P.off(t)}kx(t){return this.P.on("seriesDispose",t)}Cx(t){return this.P.off(t)}dispose(){return this._x.G(),this.Tx.dispose(),super.dispose()}}class Qh extends xo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("mapChart bg",0),r,i.Wi.fs.mapChartBackgroundFillStyle,i.Wi.fs.mapChartBackgroundStrokeStyle,i.Wi.fs.mapChartTitleFont,i.Wi.fs.mapChartTitleFillStyle,h),this.Dx=[],this.ut=this.Ng.d2({scaleXYConstructor:Ti}),this.Nc=!0,this.Bx=this.fs.mapChartSeparateRegionFillStyle,this.Ox=this.fs.mapChartSeparateRegionStrokeStyle,this.Lx=e.AutoCursorModes.onHover,this.Rx=ta,this.Hi=!0,this.Ex=0,this.zx=!0,this.Vx=new Map,this.onMouseEnter=t=>this.P.on("mouseEnter",t),this.onMouseLeave=t=>this.P.on("mouseLeave",t),this.onMouseClick=t=>this.P.on("mouseClick",t),this.onMouseDoubleClick=t=>this.P.on("mouseDoubleClick",t),this.onMouseDown=t=>this.P.on("mouseDown",t),this.onMouseUp=t=>this.P.on("mouseUp",t),this.onMouseMove=t=>this.P.on("mouseMove",t),this.offMouseEnter=t=>this.P.off(t,"mouseEnter"),this.offMouseLeave=t=>this.P.off(t,"mouseLeave"),this.offMouseClick=t=>this.P.off(t,"mouseClick"),this.offMouseDoubleClick=t=>this.P.off(t,"mouseDoubleClick"),this.offMouseDown=t=>this.P.off(t,"mouseDown"),this.offMouseUp=t=>this.P.off(t,"mouseUp"),this.offMouseMove=t=>this.P.off(t,"mouseMove"),this.offMouseDragStart=t=>this.P.off(t,"mouseDragStart"),this.offMouseDrag=t=>this.P.off(t,"mouseDrag"),this.offMouseDragStop=t=>this.P.off(t,"mouseDragStop"),this.offMouseWheel=t=>this.P.off(t,"mouseWheel"),this.onMapDataReady=t=>{const e=this.P.on("mapDataReady",t);return this.Nx&&mt.setTimeout((()=>t())),e},this.onViewChange=t=>this.P.on("viewChange",t),this.Gx=(t,e,i,s,r)=>{this.ut.x.q(s).Nt([this.Pt.left+this.pn.left,this.Pt.right+this.pn.right]),this.ut.y.q(r).Nt([this.Pt.bottom+this.pn.bottom,this.Pt.top+this.pn.top+So.ap(this.hp,this.ip)]),this.Wx&&this.Hx(this.Ux,this.ut,this.Wx)},this.Xc=(t,i)=>{const s=i;if(!s||!this.Nx)return;const{iRegion:r,region:n}=this.$x(this.Nx,s);this.Lx!==e.AutoCursorModes.disabled&&(this.Yx(n,r),Zt(t)),this.zx&&this.Wi.Zh.Ie(n,!0),this.P.emit("mouseEnter",this,t)},this.Zc=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.Xx(r,s),this.zx&&this.Wi.Zh.Ie(r,!1),this.P.emit("mouseLeave",this,t),t&&Zt(t)},this.qc=(t,i)=>{const s=i;if(!s||!this.Nx)return;const{iRegion:r,region:n}=this.$x(this.Nx,s);this.Lx!==e.AutoCursorModes.disabled&&(this.Yx(n,r),Zt(t)),this.P.emit("mouseMove",this,t)},this.Qc=(t,e)=>this.P.emit("mouseClick",this,t),this.tu=(t,e)=>this.P.emit("mouseDoubleClick",this,t),this.iu=(t,e)=>this.P.emit("mouseDown",this,t),this.su=(t,e)=>this.P.emit("mouseUp",this,t),this.eu=(t,e,i)=>{this.P.emit("mouseDragStart",this,t,e)},this.hu=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,t,e,i,s)},this.ru=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,t,e,i)},this.nu=(t,e)=>{this.P.emit("mouseWheel",this,t)},this.ou=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.jx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Yx(r,s),this.zx&&this.Wi.Zh.Ie(r,!0),this.P.emit("touchStart",this,t),Zt(t)},this.au=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.jx=this.engine.clientLocation2Engine(t.clientX,t.clientY),this.Yx(r,s),this.P.emit("touchMove",this,t),Zt(t)},this.lu=(t,e)=>{const i=e;if(!i||!this.Nx)return;const{iRegion:s,region:r}=this.$x(this.Nx,i);this.jx=void 0,this.Xx(r,s),this.zx&&this.Wi.Zh.Ie(r,!1),this.P.emit("touchEnd",this,t),Zt(t)},this.uf.Oh||this.uf.Bh||this.Wi.Ph(3),(null==o?void 0:o.disableAnimations)&&(this.Hi=!1),this.Zx=i.Vp("mapChart plotting",0),this.onResize(this.Gx),this.hp.Ms("Map Chart");const a=Pt(o?o.autoCursorBuilder:void 0,Wh);this.Kx=a.bx(i.Ax(),this.ut,this.ut,this.fs).setVisible(!1),this.qx=this.cc.Sg(),this.Qg(n,this.uiScale),this.Jx=this.Zx.Qx(this.ut).setMouseInteractions(this.Nc).setMouseEnterEventHandler(((t,e,i)=>this.Xc(e,i))).setMouseLeaveEventHandler(((t,e,i)=>this.Zc(e,i))).setMouseClickEventHandler(((t,e,i)=>this.Qc(e,i))).setMouseDoubleClickEventHandler(((t,e,i)=>this.tu(e,i))).setMouseDownEventHandler(((t,e,i)=>this.iu(e,i))).setMouseUpEventHandler(((t,e,i)=>this.su(e,i))).setMouseMoveEventHandler(((t,e,i)=>this.qc(e,i))).setMouseDragStartEventHandler(((t,e,i,s)=>this.eu(e,i,s))).setMouseDragEventHandler(((t,e,i,s,r,n)=>this.hu(e,i,s,r,n))).setMouseDragStopEventHandler(((t,e,i,s,r)=>this.ru(e,i,s,r))).setMouseWheelEventHandler(((t,e,i)=>this.nu(e,i))).setTouchStartEventHandler(((t,e,i)=>this.ou(e,i))).setTouchMoveEventHandler(((t,e,i)=>this.au(e,i))).setTouchEndEventHandler(((t,e,i)=>this.lu(e,i))).As(this.fs.mapChartFillStyle).ir(this.fs.mapChartStrokeStyle),this.tb=this.Zx.Qx(this.ut).setMouseInteractions(this.Nc).As(this.fs.mapChartOutlierRegionFillStyle).ir(this.fs.mapChartOutlierRegionStrokeStyle);const l=Pt(o&&o.type,Uh.World);this.Ux=l,this.ib(l).then((()=>{this.P.emit("mapDataReady")}))}setFillStyle(t){return this.Jx.As(t),this.Wi.Gi(),this}getFillStyle(){return this.Jx._s()}setStrokeStyle(t){return this.Jx.ir(t),this.Wi.Gi(),this}getStrokeStyle(){return this.Jx.sr()}setEffect(t){return this.qx.Is(t),this.Wi.Gi(),this}getEffect(){return this.qx.Ps()}setOutlierRegionFillStyle(t){return this.tb.As(t),this.Wi.Gi(),this}getOutlierRegionFillStyle(){return this.tb._s()}setOutlierRegionStrokeStyle(t){return this.tb.ir(t),this.Wi.Gi(),this}getOutlierRegionStrokeStyle(){return this.tb.sr()}setSeparateRegionFillStyle(t){return this.Bx="function"==typeof t?t(this.Bx):t,this.Dx.forEach((t=>t.As(this.Bx))),this.Wi.Gi(),this}getSeparateRegionFillStyle(){return this.Bx}setSeparateRegionStrokeStyle(t){return this.Ox="function"==typeof t?t(this.Ox):t,this.Dx.forEach((t=>t.ir(this.Ox))),this.Wi.Gi(),this}getSeparateRegionStrokeStyle(){return this.Ox}invalidateRegionValues(t){if(!this.Nx||!this.sb)return this.eb=this.eb||[],this.eb.push(t),this;if("function"==typeof t)for(let e=0;e{t.hb(r)}))}}else for(const e of t)if(e)for(let t=0;t{t.hb(e.value)}))}}return this.Wi.Gi(),this}setAutoCursor(t){return this.Kx&&t(this.Kx),this.Wi.Gi(),this}getAutoCursor(){return this.Kx}setAutoCursorMode(t){return this.Lx=t,this.Wi.Gi(),this}getAutoCursorMode(){return this.Lx}setCursorResultTableFormatter(t){return this.Rx=t,this.Wi.Gi(),this}getCursorResultTableFormatter(){return this.Rx}onMouseDragStart(t){return this.P.on("mouseDragStart",t)}onMouseDrag(t){return this.P.on("mouseDrag",t)}onMouseDragStop(t){return this.P.on("mouseDragStop",t)}onMouseWheel(t){return this.P.on("mouseWheel",t)}onTouchStart(t){return this.P.on("touchStart",t)}onTouchMove(t){return this.P.on("touchMove",t)}onTouchEnd(t){return this.P.on("touchEnd",t)}offTouchStart(t){return this.P.off(t,"touchStart")}offTouchMove(t){return this.P.off(t,"touchMove")}offTouchEnd(t){return this.P.off(t,"touchEnd")}setMouseInteractions(t){return this.Nc=t,this.Jx.setMouseInteractions(t),this}getMouseInteractions(){return this.Nc}setHighlight(t){var e;return t=ye(t),this.Ex=t,null===(e=this.Nx)||void 0===e||e.regions.forEach((e=>{this.Wi.Zh.Ie(e,t)})),this.P.emit("highlight",t),this}getHighlight(){return this.Ex}setAnimationHighlight(t){var e;return null===(e=this.Nx)||void 0===e||e.regions.forEach((e=>{this.Wi.Zh.Pe(e,t)})),this}getAnimationHighlight(){var t;return this.Wi.Zh.De(null===(t=this.Nx)||void 0===t?void 0:t.regions[0])}setHighlightOnHover(t){return this.zx=t,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.zx}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}offMapDataReady(t){return this.P.off(t,"mapDataReady")}offViewChange(t){return this.P.off(t,"viewChange")}async ib(t){const e=await((t,e)=>{let i;if(t===Uh.World)i="countries_world.json";else if(t===Uh.NorthAmerica)i="countries_northAmerica.json";else if(t===Uh.SouthAmerica)i="countries_southAmerica.json";else if(t===Uh.Africa)i="countries_africa.json";else if(t===Uh.Europe)i="countries_europe.json";else if(t===Uh.Asia)i="countries_asia.json";else if(t===Uh.USA)i="states_usa.json";else if(t===Uh.Canada)i="territoriesProvinces_canada.json";else{if(t!==Uh.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw mt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return mt.fetch(s).then((t=>t.json())).catch((t=>{Me(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.uf.Nh);this.sb=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Zh[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry)this.tb.Te().yo(e);if(t===Uh.USA){const t=25.8,e=29.7;this.Dx.push(this.Zx._u(this.ut).setMouseInteractions(!1).As(this.Bx).ir(this.Ox).Cn({x:-126,y:t}).q({x:10,y:e-t}),this.Zx._u(this.ut).setMouseInteractions(!1).As(this.Bx).ir(this.Ox).Cn({x:-113,y:t}).q({x:7,y:e-t}))}const s=this.Wi.Zh.Ce(this.Jx,{animationEnabled:this.Hi});for(let i=0;i{o.forEach((e=>e.zr(t)))}))}if(this.qx.pu([this.Jx]),this.Wx=i,this.Hx(t,this.ut,i),this.Nx=e,this.eb){for(const t of this.eb)this.invalidateRegionValues(t);this.eb=void 0}this.gc()}Hx(t,e,i){const s=qh[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.Z(o.min.x,o.max.x),e.y.Z(o.min.y,o.max.y);const h=this.ut.x.Xt(),a=this.ut.y.Xt();this.P.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]}})}Yx(t,e){this.rb={region:t,iRegion:e},this.Wi.Gi()}Xx(t,e){this.rb&&t===this.rb.region&&(this.rb=void 0,this.Wi.Gi())}$x(t,e){const i=Array.from(this.Vx.entries()).findIndex((([t,i])=>i.includes(e)));return{iRegion:i,region:null==t?void 0:t.regions[i]}}setAnimationsEnabled(t){return this.Hi=!t,this}getAnimationsEnabled(){return this.Hi}getMinimumSize(){}xd(){return[this]}gc(){super.gc(),super.Jg(),So.lp(this.hp,this.ip);const t=m(this.ut.x.Gt(),this.ut.y.Gt(),this.ut.x.Ht(),this.ut.y.Ht());this.Zx.yy(t);const e=this.Wi.Fh()||this.jx;if(this.rb&&e){const t=this.sb&&this.sb[this.rb.iRegion];let i=nt(e,this.engine.scale,this.ut);i={x:wt(i.x,this.ut.x.getInnerStart(),this.ut.x.getInnerEnd()),y:wt(i.y,this.ut.y.getInnerStart(),this.ut.y.getInnerEnd())};let s=i.x,r=i.y;const n=this.rb.region.transform;this.rb.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.Kx.setPosition(i).setVisible(!0).getResultTable().setContent(this.Rx(new Ch,this.rb.region,t,s,r,this).Lc())}else this.Kx.setVisible(!1);return this.Kx.Zs().gc(),this}dispose(){return this.Zx.G(),this.Kx.dispose(),po(this.ut),super.dispose()}X(){return super.X(),this.ut.X(),this}j(){return super.j(),this.ut.j(),this}ud(){return le(this.getFillStyle())}attach(t,e){return t.setText(this.getTitle()),t.setButtonOffStrokeStyle(t.getButtonOffStrokeStyle().setThickness(1)),t.setButtonOnStrokeStyle(t.getButtonOnStrokeStyle().setThickness(1)),t.setOn(!0).setLocked(!0),t.onMouseEnter((()=>{this.setHighlight(!0)})),t.onMouseLeave((()=>{this.setHighlight(!1)})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),ae(t,this.fs,{fill:this.getFillStyle()}),this}}const ta=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(ea(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),ea=(t,e)=>{const i=t>0,s=e>0;return`${[ce(Math.abs(0|t),2),"° ",ce(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[ce(Math.abs(0|e),2),"° ",ce(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class ia extends Hi{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.nb(i),s,r,{numeric:e.ob({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.ob({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.ob({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.ab=n,this.lb=o,this.cb=h,this.cc=a,this.ub=i,this.fb=e.ob({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.vs=h.ye(i).setMouseInteractions(!1).ks(e.ob({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).As(e.ob({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Fs=this.cc.Sg([this.vs]).Is(s.effectsText)}setStrokeStyle(t){return this.fb="function"==typeof t?t(this.fb):t,this.lb.Gi(),this}getStrokeStyle(){return this.fb}Qs(t,e){return new sa(e,t,this.ub,this.cb,this.cb,this.gb(this.ab,this.ub),this.cb.Bc(this.ub).setMouseInteractions(!1))}te(t,e){const i=this.pb(this.ub,t);this.mb&&!1===this.mb(t)?t.Pi.setVisible(!1):t.Pi.setVisible(!0).Cn(Qe(this.Sb(this.ub,t.u),i.padding)).Ln(i.alignment).Cs(i.rotation).In(i.offset.x,i.offset.y),this.yb(this.ub,t.xb,t.bb,t)}setMouseInteractions(t){return this}gc(){this.Gs({physicalAxisSize:0});const t=this.ee(((t,e)=>{const i=e.ns.qs,s=.5*this.fb.getThickness()+i.tickLength+i.tickPadding+Math.abs(e.Pi.Zs().$t().y/this.ub.wi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.vb(this.ub,this.fb,t),this.Mb(this.ub,this.vs,t),t}}class sa extends no{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.xb=n,this.bb=o,n.setMouseInteractions(!1),this.be.push(n,o)}}class ra extends ia{constructor(t,e,i,s,r,n,o,h,a){super(t,na,e,i,s,r,n,o,h),this.Fm=this.lb.Bc(this.ub).setMouseInteractions(!1),this._b=a,this.setScrollStrategy(Ci.expansion),this.setTickStrategy(Pi.Numeric),this.setTitle("Amplitude")}ne(){return this._b()}fe(t,e){return oo(t,e,this.ub.y)}pe(t,e,i){const s=2*(e-t),r=this.ub.x.Si(s);return{min:t-i*r,max:e+i*r}}Sb(t,e){return{x:t.Ab()?e-t.wb().start:t.wb().start-e,y:0}}gb(t,e){return t.Ou(e)}yb(t,e,i,s){const r=s.ns.qs,n=t.Ab()?s.u-t.wb().start:t.wb().start-s.u;kt(s.u,t.wb().start)||kt(s.u,t.wb().end)?e.setVisible(!1):e.setVisible(!0).ea(0).ha(360).la(void 0).aa(0).ra(n).la(60).As(B).ir(r.gridStrokeStyle);const o=.5*this.fb.getThickness();i.Sa({x:n,y:-o*t.wi().y}).ha({x:n,y:-(o+r.tickLength)*t.wi().y}).ua(r.tickStyle)}pb(t,e){const i=e.ns.qs;return{alignment:{x:0,y:1},padding:{x:0,y:t.wi().y*-(.5*this.fb.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}vb(t,e,i){const s=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;this.Fm.Sa({x:0,y:0}).ha({x:s,y:0}).ua(e)}Mb(t,e,i){const s=t.Ab()?(t.wb().start+t.wb().end)/2-t.wb().start:t.wb().start-(t.wb().start+t.wb().end)/2;e.Ln({x:0,y:1}).Cn({x:s,y:-i*t.wi().y})}}const na={ae:t=>t.getAmplitudeMin(),le:t=>t.getAmplitudeMax(),ue:t=>{},nb:t=>({getInnerStart:()=>t.wb().start,getInnerEnd:()=>t.wb().end,Z:(e,i)=>t.kb(e,i),rt:(e,i,s,r,n)=>t.y.rt(e,i,s,r,n)}),ob:t=>t.amplitude};class oa extends ia{constructor(t,e,i,s,r,n,o,h){super(t,aa,e,i,s,r,n,o,h),this.Cb=90,this.Tb=12,this.Ib=ha,this.Fm=this.lb.Ou(this.ub).setMouseInteractions(!1),this.mb=t=>{let e=180*(t.u-this.ub.Fb())/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.zi=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.Cb)}setTickStyle(t){return this.Pb="function"==typeof t?t(this.Pb):t,this.Db(),this.lb.Gi(),this}getTickStyle(){return this.Pb}setTickFormattingFunction(t){return this.Ib=t,this.Db(),this.lb.Gi(),this}getTickFormattingFunction(){return this.Ib}setClockwise(t){this.ub.Bb(t);const e=this.Cb*Math.PI/180;return t?this.ub.Ob(e+Math.PI/2):this.ub.Ob(e-Math.PI/2),this.lb.Gi(),this}getClockwise(){return!this.ub.Lb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.Cb=t;const e=t*Math.PI/180;return this.getClockwise()?this.ub.Ob(e+Math.PI/2):this.ub.Ob(e-Math.PI/2),this.lb.Gi(),this}getNorth(){return 180*this.ub.Fb()/Math.PI}setDivision(t){return this.Tb=t,this.Db(),this.lb.Gi(),this}getDivision(){return this.Tb}ne(){return[]}fe(t,e){return e}pe(t,e,i){return{min:t,max:e}}Sb(t,e){const i=t.Lb()?1:-1,s=t.Fb(),r=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}gb(t,e){return t.Bc(e)}yb(t,e,i,s){const r=this.Pb,n=t.Lb()?1:-1,o=t.Fb(),h=(s.u-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end,c={x:a*u,y:l*u};e.Sa({x:0,y:0}).ha(c);const d={x:c.x+a*r.tickLength*t.wi().x,y:c.y+l*r.tickLength*t.wi().y};i.Sa(c).ha(d),e.ua(r.gridStrokeStyle),i.ua(r.tickStyle)}pb(t,e){const i=this.Pb,s=t.Lb()?1:-1,r=t.Fb();let n,o=(e.u-r)*s;for(;o<0;)o+=2*Math.PI;for(;o>=2*Math.PI;)o-=2*Math.PI;n=o>0&&o<=Math.PI?-o+Math.PI/2:-o-Math.PI/2;const h=i.tickLength+i.tickPadding,a=Math.cos(o)*h*t.wi().x,l=Math.sin(o)*h*t.wi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}vb(t,e,i){const s=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;this.Fm.ea(0).ha(360).aa(0).ra(s+.5*e.getThickness()*t.wi().x).la(60).As(B).ir(e)}Mb(t,e,i){const s=t.Fb(),r=this.pb(t,{u:0+s}),n=t.Ab()?t.wb().end-t.wb().start:t.wb().start-t.wb().end;e.Ln(r.alignment).Cs(r.rotation).In(r.offset.x,r.offset.y).Cn(Qe({x:n,y:0},r.padding))}Db(){this.Ls({Di:[],Bi:[{Pi:"Radial ticks",kg:0,qs:this.Pb,js:this.Ib,_e:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Tb;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},os:{ie:()=>{},ls:()=>!1},Ae:void 0}],Ii:ha,Rs:void 0,Es:void 0})}}const ha=(t,e,i)=>(180*t/Math.PI).toFixed(0),aa={ae:t=>{},le:t=>{},ue:t=>{},nb:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,Z:(t,e)=>{},rt:(e,i,s,r,n)=>t.x.rt(e,i,s,r,n)}),ob:t=>t.radial};class la extends Qr{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Su="Sector",this.Rb=0,this.Eb=1*Math.PI/2,this.zb=void 0,this.Vb=void 0,this.Hr=t,this.ub=s,this.Mp=this.Hr.Ou(this.ub).zr(this.getHighlight()),this.gu(this.Mp),this.jr=r.polarSectorFillStyle,this.tn=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.Rb=wt(t,0,360),this.Hr.Gi(),this}getAngleStart(){return this.Rb}setAngleEnd(t){return this.Eb=wt(t,0,360),this.Hr.Gi(),this}getAngleEnd(){return this.Eb}setAmplitudeStart(t){return this.zb=t,this.Hr.Gi(),this}getAmplitudeStart(){return this.zb}setAmplitudeEnd(t){return this.Vb=t,this.Hr.Gi(),this}getAmplitudeEnd(){return this.Vb}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.Hr.Gi(),this}getStrokeStyle(){return this.tn}gc(){const t=this.ub.wb(),e=180*this.ub.Fb()/Math.PI,i=void 0!==this.zb?wt(this.zb,t.start,t.end):t.start,s=void 0!==this.Vb?wt(this.Vb,t.start,t.end):t.end,r=this.ub.Ab()?i-t.start:t.start-i,n=this.ub.Ab()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.ub.Lb()?1:-1,l=Math.abs(this.Eb-this.Rb);this.Mp.ea((this.Rb-e)*a).ha((this.Eb-e)*a).aa(100*o/h).ra(h).As(this.jr).ir(this.tn).la(Math.ceil(l/2))}Au(t,e){t.zr(e),this.Hr.Gi()}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}}class ua extends Qr{constructor(){super(...arguments),this.Gm=!0,this.Nb=!0}setAutoScrollingEnabled(t){return this.Gm=t,this.rl.Wi.Gi(),this}getAutoScrollingEnabled(){return this.Gm}jm(){}gc(){}Zm(){}setCursorEnabled(t){return this.Nb=t,this}getCursorEnabled(){return this.Nb}}class ca extends ua{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Rx=da,this.Hr=t,this.rl=e,this.scale=s}getAmplitudeMin(){return this.Gb?this.Gb.min:void 0}getAmplitudeMax(){return this.Gb?this.Gb.max:void 0}setCursorResultTableFormatter(t){return this.Rx=t,this.rl.Wi.Gi(),this}getCursorResultTableFormatter(){return this.Rx}setCursorEnabled(t){return super.setCursorEnabled(t)}}const da=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),fa=(t,e,i)=>t*(1-i)+e*i,ga=(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=fa(i.value,r.value,n),c=fa(e.value,s.value,h);return fa(c,u,l)},pa=(t,e)=>{const i=[],s=e.wb().start,r=e.wb().end,n=e.Ab(),o=e.Lb()?1:-1,h=e.Fb(),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=wt(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},ma=t=>{const e={min:ke,max:we};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ya=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),xa=(t,e)=>{let i=li(t);for(e.Lb()||(i*=-1),i+=180*e.Fb()/Math.PI;i<0;)i+=360;i%=360;const s=Ke(t),r=e.wb(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:fa(r.start,r.end,s/n)}};class Sa extends ca{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Su="Line Series",this.Wb=[],this.Hb=!1,this.Ub=!1,this.ca=de(this.fs.polarLineSeriesStrokeStyle,n),this.$b=t.Kp(s,void 0,[Po.UserSeries]).ua(this.ca).zr(this.getHighlight()).Jn(Ss.Nearest),this.gu(this.$b)}setData(t){return this.Wb=ya(t),this.Hb=!0,this.Gb=ma(this.Wb),this.Hr.Gi(),this}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;return this.$b.ua(e),this.Hr.Gi(),this}getStrokeStyle(){return this.ca}setConnectDataAutomaticallyEnabled(t){return this.Ub=t,this.Hr.Gi(),this}getConnectDataAutomaticallyEnabled(){return this.Ub}oe(){return this.Gm&&this.Wb.length>0&&this.getVisible()}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){return this.Yb(t,this.$b)}solveNearestFromScreen(t){return this.Yb(t,this.$b)}Yb(t,e){const i=e.Xb(t);if(!i)return;const{angle:s,amplitude:r}=xa(i,this.scale);return Hh(i,this.scale,this.Rx(new Ch,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,this.ca.getFillStyle())}gc(){if(this.Hb||this.scale.jb()){const t=pa(this.Wb,this.scale),e=Ve(t);this.Ub?(t.push({...t[0]}),this.$b.Eo(!0)):this.$b.Eo(!1),this.$b.no().xt(t).Rr(e),this.Hb=!1,this.$b.Zs()}}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{stroke:this.ca}),this}}class va extends ca{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Su="Point Line Series",this.Wb=[],this.Hb=!1,this.Ub=!1,this.Zb=3,this.dn=0,this.Kb=e.PointShape.Circle,this.jr=de(this.fs.polarPointLineSeriesFillStyle,o),this.ca=de(this.fs.polarPointLineSeriesStrokeStyle,o),this.$b=t.Kp(r,void 0,[Po.UserSeries]).ua(this.ca).zr(this.getHighlight()).Jn(Ss.Nearest),this.gu(this.$b),this.qb=t.aS(r).As(this.jr).so(this.Kb).q(this.Zb).zr(this.getHighlight()).Jn(Ss.Nearest),this.gu(this.qb)}setData(t){return this.Wb=ya(t),this.Hb=!0,this.Gb=ma(this.Wb),this.Hr.Gi(),this}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;return this.$b.ua(e),this.Hr.Gi(),this}getStrokeStyle(){return this.ca}setPointFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;return this.qb.As(e),this.Hr.Gi(),this}getPointFillStyle(){return this.jr}setPointSize(t){return this.Zb=t,this.qb.q(t),this.Hr.Gi(),this}getPointSize(){return this.Zb}setPointShape(t){return this.Kb=t,this.qb.so(this.Kb),this}getPointShape(){return this.Kb}setPointRotation(t){return this.dn=t,this.qb.Cs(t),this.Hr.Gi(),this}getPointRotation(){return this.dn}setConnectDataAutomaticallyEnabled(t){return this.Ub=t,this.Hr.Gi(),this}getConnectDataAutomaticallyEnabled(){return this.Ub}oe(){return this.Gm&&this.Wb.length>0&&this.getVisible()}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){return this.Yb(t,this.$b)}solveNearestFromScreen(t){return this.Yb(t,this.$b)}Yb(t,e){const i=e instanceof Ns?e.Ix(t):e.Xb(t);if(!i)return;const{angle:s,amplitude:r}=xa(i,this.scale);return Hh(i,this.scale,this.Rx(new Ch,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,"color"in i&&this.jr instanceof G?new L({color:i.color}):this.jr)}gc(){if(this.Hb||this.scale.jb()){const t=pa(this.Wb,this.scale),e=Ve(t);this.Ub?(t.push({...t[0]}),this.$b.Eo(!0)):this.$b.Eo(!1),this.$b.no().xt(t).Rr(e),this.qb.no().xt(t).Rr(e),this.Hb=!1,this.$b.Zs(),this.qb.Zs()}}}class ba extends ca{constructor(t,i,s,r,n,o,h){super(t,i,s,r,n,h),this.Su="Point Series",this.Wb=[],this.Hb=!1,this.Zb=3,this.dn=0,this.Kb=e.PointShape.Circle,this.jr=de(this.fs.polarPointSeriesFillStyle,o),this.qb=t.aS(r).As(this.jr).so(this.Kb).q(this.Zb).zr(this.getHighlight()).Jn(Ss.Nearest),this.gu(this.qb)}setData(t){return this.Wb=ya(t),this.Hb=!0,this.Gb=ma(this.Wb),this.Hr.Gi(),this}setPointFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;return this.qb.As(e),this.Hr.Gi(),this}getPointFillStyle(){return this.jr}setPointSize(t){return this.Zb=t,this.qb.q(t),this.Hr.Gi(),this}getPointSize(){return this.Zb}setPointShape(t){return this.Kb=t,this.qb.so(this.Kb),this}getPointShape(){return this.Kb}setPointRotation(t){return this.dn=t,this.qb.Cs(t),this.Hr.Gi(),this}getPointRotation(){return this.dn}oe(){return this.Gm&&this.Wb.length>0&&this.getVisible()}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){const i=this.qb.Ix(t);if(!i)return;const{angle:s,amplitude:r}=xa(i,this.scale);return Hh(i,this.scale,this.Rx(new Ch,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,"color"in i&&this.jr instanceof G?new L({color:i.color}):this.jr)}solveNearestFromScreen(t){return this.Ix(t,!1)}gc(){if(this.Hb||this.scale.jb()){const t=pa(this.Wb,this.scale),e=Ve(t);this.qb.no().xt(t).Rr(e),this.Hb=!1,this.qb.Zs()}}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr}),this}}class Ma{constructor(t,e,i,s){this.P=new r.Eventer,this.Jb=!1,this.rl=t,this.Qb=e,this.lS=i,this.Gn=s}setGeometry(t){return this.tv=t,this.Jb=!0,this.rl.Wi.Gi(),this}getGeometry(){return this.tv}setMouseInteractions(t){return this.Gn.setMouseInteractions(t),this}dispose(){return this.Gn.dispose(),this.Qb(this),this.P.emit("dispose",this),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setVisible(t){const e=this.Gn.getVisible()!==t;return this.Gn.setVisible(t),e&&this.P.emit("visibleStateChanged",this,t),this.rl.Wi.Gi(),this}getVisible(){return this.Gn.getVisible()}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Aa=(t,e,i)=>{const s=e.ut,r=i.ut;let n=(t.x-s.getInnerStart())/(s.getInnerEnd()-s.getInnerStart()),o=(t.y-r.getInnerStart())/(r.getInnerEnd()-r.getInnerStart());return 1===i.eg&&(n=1-n),1===e.eg&&(o=1-o),u(o,n)};class ka extends Rh{constructor(t,e,i,s,r,n,o,h,a){super(t,e,lo(i.ut,s.ut),r,n,a),this.sv=!1,this.ev=!1,this.hv=!0,this.rv=!0,this.nv=!1,this.ov=!1,this.setGridStrokeYStyle=t=>(this.av.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.av.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.lv=o,this.cv=h,this.uv=this.axisX.Ig(!1,this.lv).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.av=this.axisY.Ig(!1,this.cv).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.uv.dispose(),this.av.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(nt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.uv.setValue(t.x),this.av.setValue(t.y);const e=Aa(u(this.uv.getValue(),this.av.getValue()),this.axisX,this.axisY);return this.uv.setGridStrokeLength(this.nv?e.x:1),this.av.setGridStrokeLength(this.ov?e.y:1),this}gc(){this.uv.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.sv),this.av.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.ev);const t=Aa(u(this.uv.getValue(),this.av.getValue()),this.axisX,this.axisY);return this.uv.setGridStrokeLength(this.nv?t.x:1),this.av.setGridStrokeLength(this.ov?t.y:1),super.gc()}setGridStrokeXCut(t){return this.nv=t,this.Hr.Gi(),this}getGridStrokeXCut(){return this.nv}setGridStrokeYCut(t){return this.ov=t,this.Hr.Gi(),this}getGridStrokeYCut(){return this.ov}setGridStrokeXStyle(t){return this.uv.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.uv.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.sv=t,this.Hr.Gi(),this}getTickMarkerXVisible(){return this.sv}setTickMarkerYVisible(t){return this.ev=t,this.Hr.Gi(),this}getTickMarkerYVisible(){return this.ev}setTickMarkerX(t){return this.uv.setMarker(t),this}setTickMarkerY(t){return this.av.setMarker(t),this}getTickMarkerX(){return this.uv.getMarker()}getTickMarkerY(){return this.av.getMarker()}}class wa extends Fh{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.nv=!1,this.ov=!1,this.dv=!1,this.fv=!1,this.gv=new Map,this.pv=new Map,this.sv=!0,this.ev=!0,this.nx=s,this.ox=r,this.lv=n,this.cv=o,this.mv=h.cursorGridStrokeStyleX,this.Sv=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.gv.forEach((t=>t.dispose())),this.pv.forEach((t=>t.dispose())),this.yv=void 0,this.xv=void 0,this}gc(){return this.yv&&this.yv.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.sv),this.xv&&this.xv.setVisible(this.Ui&&this.hx).setMarkerVisible(this.Ui&&this.hx&&this.ev),super.gc()}pointAt(t){const{location:e}=t,{series:i}=t,{axisX:s}=i,{axisY:r}=i,n=this.ts(s,!0),o=this.ts(r,!1);n!==this.yv&&this.yv&&this.yv.setVisible(!1),o!==this.xv&&this.xv&&this.xv.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=Aa(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.nv?h.x:1),o.setGridStrokeLength(this.ov?h.y:1),this.yv=n,this.xv=o,super.pointAt(t)}mx(t){if(super.mx(t),t){const e=e=>e.setTextFillStyle(t);this.yv&&this.dv&&this.yv.setMarker(e),this.xv&&this.fv&&this.xv.setMarker(e)}}ts(t,e){let i=(e?this.gv:this.pv).get(t);return i||(e?(i=t.Ig(!1,this.lv),this.gv.set(t,i)):(i=t.Ig(!1,this.cv),this.pv.set(t,i)),this.Ks(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}Ks(t,e){const i=e?this.mv:this.Sv;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.sv:this.ev)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.nv=t,this.Hr.Gi(),this}getGridStrokeXCut(){return this.nv}setGridStrokeYCut(t){return this.ov=t,this.Hr.Gi(),this}getGridStrokeYCut(){return this.ov}setGridStrokeXStyle(t){return this.mv=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.gv.forEach((t=>t.setGridStrokeStyle(this.mv))),this}getGridStrokeXStyle(){return this.mv}setGridStrokeYStyle(t){return this.Sv=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.pv.forEach((t=>t.setGridStrokeStyle(this.Sv))),this}getGridStrokeYStyle(){return this.Sv}setTickMarkerXVisible(t){return this.sv=t,this.Hr.Gi(),this}getTickMarkerXVisible(){return this.sv}setTickMarkerYVisible(t){return this.ev=t,this.Hr.Gi(),this}getTickMarkerYVisible(){return this.ev}setTickMarkerX(t){return this.gv.forEach((e=>e.setMarker(t))),this.lv=this.lv.addStyler(t),this.Hr.Gi(),this}setTickMarkerY(t){return this.pv.forEach((e=>e.setMarker(t))),this.cv=this.cv.addStyler(t),this.Hr.Gi(),this}setTickMarkerXAutoTextStyle(t){return this.dv=t,this.Hr.Gi(),this}getTickMarkerXAutoTextStyle(){return this.dv}setTickMarkerYAutoTextStyle(t){return this.fv=t,this.Hr.Gi(),this}getTickMarkerYAutoTextStyle(){return this.fv}}class Da extends Bh{constructor(t,e,i,s,r){super(t,e,r),this.nx=t,this.ox=e,this.lv=i,this.cv=s,this.Sx=r}}class Ea extends Da{constructor(){super(...arguments),this.xx=(t,e,i,s)=>this.yx(new wa(t,e,i,this.nx,this.ox,this.lv,this.cv,s),s),this.addStyler=t=>new Ea(this.nx,this.ox,this.lv,this.cv,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ea(t,this.ox,this.lv,this.cv,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Ea(this.nx,t,this.lv,this.cv,this.Sx.map((t=>t)))}}class Ta extends Da{constructor(){super(...arguments),this.bx=(t,e,i,s,r)=>this.yx(new ka(t,e,i,s,this.nx,this.ox,this.lv,this.cv,r),r),this.addStyler=t=>new Ta(this.nx,this.ox,this.lv,this.cv,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ta(t,this.ox,this.lv,this.cv,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Ta(this.nx,t,this.lv,this.cv,this.Sx.map((t=>t)))}}const Ia=new Ea(Sn,Sn,so.PointableTextBox,so.PointableTextBox,[(t,e)=>{Lh(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Zr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Zr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ca=new Ta(bn,Sn,so.PointableTextBox,so.PointableTextBox,[(t,e)=>{Gh(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),Zr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),Zr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Pa=(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}},Oa=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Fa{constructor(t,i,s,n,o,h){this.bv=e.UIVisibilityModes.always,this.vv=e.UIVisibilityModes.always,this.kr=!0,this.xe=!1,this.Mv=!1,this._v=!1,this.an=u(0,0),this.hc=e.UIDraggingModes.draggable,this.rc=void 0,this.P=new r.Eventer,this.Ui=!0,this.Av=(t,i,s)=>{this.Mv=!0,this.Hr.Gi();const r=this.hc===e.UIDraggingModes.notDraggable?this.hc:s||this.hc;this.rc=this.Hr.Wi.Oe(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.wv=()=>{this.Mv=!1,this.Hr.Gi(),this.Hr.Wi.Le(this.rc)},this.kv=(t,e)=>{this._v=!0,Zt(e),this.Hr.Gi()},this.Cv=(t,i)=>{if(this.hc!==e.UIDraggingModes.notDraggable){const s=i||this.hc,r=nt(this.Hr.Wi.Re(t.x,t.y),this.Hr.Wi.ut,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?Oa(r.x,this.scale.x):this.an.x,s!==e.UIDraggingModes.onlyHorizontal?Oa(r.y,this.scale.y):this.an.y);return this.setPosition(n),!0}return!1},this.Tv=(t,e)=>{this._v=!1,Zt(e),this.Hr.Gi()},this.onDispose=t=>this.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Hr=t,this.renderingScale=i,this.scale=s,this.Kx=n,this.Iv=o,this.fs=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(((t,e)=>this.Av(t,e))),a.onMouseLeave(this.wv),a.onMouseDragStart(this.kv),a.onMouseDrag(((t,e)=>this.Cv(u(e.clientX,e.clientY))&&Zt(e))),a.onMouseDragStop(this.Tv),a.onTouchStart(this.kv),a.onTouchMove(((t,e)=>this.Cv(u(e.clientX,e.clientY))&&Zt(e))),a.onTouchEnd(this.Tv),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.an)}setPosition(t){return this.an=t,this.Kx.setPosition(t),this.P.emit("positionChange",this,this.an),this}getPosition(){return this.an}onPositionChange(t){return this.P.on("positionChange",t)}offPositionChange(t){return this.P.off(t,"positionChange")}setPointMarkerVisibility(t){return this.bv=t,this.Hr.Gi(),this}getPointMarkerVisibility(){return this.bv}setResultTableVisibility(t){return this.vv=t,this.Hr.Gi(),this}getResultTableVisibility(){return this.vv}setMouseInteractions(t){return this.kr=t,this.Kx.getPointMarker().setMouseInteractions(t),this.Kx.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.kr}setAutoFitStrategy(t){return this.Kx.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Kx.getAutoFitStrategy()}isAttached(){return!0}gc(){const t=this.isAttached();return Pa(this.bv,this.Mv,this._v)?this.Kx.setPointMarkerVisible(!0):this.Kx.setPointMarkerVisible(!1),t&&Pa(this.vv,this.Mv,this._v)?this.Kx.setResultTableVisible(!0):this.Kx.setResultTableVisible(!1),this.Kx.gc(),this}Zs(){return this.Kx.Zs(),this}pointAt(t){return this.Kx.pointAt(t),this}dispose(){return this.xe||(this.xe=!0,this.Iv(this),this.Kx.dispose(),this.P.emit("dispose")),this}setVisible(t){const e=this.Ui!==t;return this.Ui=t,this.Kx.setVisible(t),e&&this.P.emit("visibleStateChanged",this,this.Ui),this}getVisible(){return this.Ui}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setPointMarker(t){return this.Kx.setPointMarker(t),this}getPointMarker(){return this.Kx.getPointMarker()}setResultTable(t){return this.Kx.setResultTable(t),this}getResultTable(){return this.Kx.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.hc=t,this.Hr.Gi(),this}getDraggingMode(){return this.hc}}class Ra extends Fa{constructor(t,i,s,r,n,o,h){super(t,i,lo(s.ut,r.ut),n.bx(t,i,s,r,h),o,h),this.Fv=e.UIVisibilityModes.always,this.Pv=e.UIVisibilityModes.always,this.Dv=e.UIVisibilityModes.always,this.Bv=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Kx.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Kx.getGridStrokeYStyle(),this.Hr=t,this.axisX=s,this.axisY=r,this.Iv=o;const a=this.Kx.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.Av(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.wv),a.onMouseDragStart(this.kv),a.onMouseDrag(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i))),a.onMouseDragStop(this.Tv),a.onTouchStart(this.kv),a.onTouchMove(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Zt(i)));const l=this.Kx.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.Av(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.wv),l.onMouseDragStart(this.kv),l.onMouseDrag(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i))),l.onMouseDragStop(this.Tv),l.onTouchStart(this.kv),l.onTouchMove(((t,i)=>this.Cv(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Zt(i)))}gc(){const t=this.isAttached();return this.Ui&&t&&Pa(this.Dv,this.Mv,this._v)?this.Kx.setTickMarkerXVisible(!0):this.Kx.setTickMarkerXVisible(!1),this.Ui&&t&&Pa(this.Bv,this.Mv,this._v)?this.Kx.setTickMarkerYVisible(!0):this.Kx.setTickMarkerYVisible(!1),this.Kx.setGridStrokeXStyle(this.Ui&&t&&Pa(this.Fv,this.Mv,this._v)?this.gridStrokeStyleX:J),this.Kx.setGridStrokeYStyle(this.Ui&&t&&Pa(this.Pv,this.Mv,this._v)?this.gridStrokeStyleY:J),super.gc()}setGridStrokeXVisibility(t){return this.Fv=t,this.Hr.Gi(),this}getGridStrokeXVisibility(){return this.Fv}setGridStrokeYVisibility(t){return this.Pv=t,this.Hr.Gi(),this}getGridStrokeYVisibility(){return this.Pv}setTickMarkerXVisibility(t){return this.Dv=t,this.Hr.Gi(),this}getTickMarkerXVisibility(){return this.Dv}setTickMarkerYVisibility(t){return this.Bv=t,this.Hr.Gi(),this}getTickMarkerYVisibility(){return this.Bv}setGridStrokeXCut(t){return this.Kx.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Kx.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Kx.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Kx.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Kx.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Kx.getGridStrokeYStyle()}setTickMarkerX(t){return this.Kx.setTickMarkerX(t),this}getTickMarkerX(){return this.Kx.getTickMarkerX()}setTickMarkerY(t){return this.Kx.setTickMarkerY(t),this}getTickMarkerY(){return this.Kx.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Kx.getTickMarkerX().setMouseInteractions(t),this.Kx.getTickMarkerY().setMouseInteractions(t),this}}class Ba extends Ra{}class za extends Ba{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.Ov=!1,this.Hr=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.Ov=!1,this.Hr.Gi(),this}Zs(){if(!this.Ov){const t=this.owningSeries.solveNearestFromScreen(nt(this.an,this.scale,this.Hr.Wi.ut));t?(this.an=nt(t.location,this.owningSeries.scale,this.scale),this.Kx.pointAt(t),this.Ov=!0):this.Kx.setPosition(this.an)}return super.Zs()}isAttached(){return this.Ov}}class _a extends ua{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Lv=[],this.addMarker=(t=Ca)=>{const e=new za(this.Rv(),this.rl.uiScale,this,t,this.removeMarker,this.fs);return this.Lv.push(e),e},this.removeMarker=t=>{const e=this.Lv.indexOf(t);-1!==e&&this.Lv.splice(e,1)},this.be=new Map,this.chart=t,this.Hr=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.Rv=h,this.scale=lo(s.ut,r.ut),this.Ev=t.zv,t.zv+=1,this.Vv(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.Nv),this.onMouseLeave(this.chart.Gv),this.onMouseWheel(this.chart.Hm),this.onMouseDragStart(this.chart.Wv),this.onMouseDrag(this.chart.Um),this.onMouseDragStop(this.chart.Hv),this.onTouchStart(this.chart.$m.onTouchStart),this.onTouchMove(this.chart.$m.onTouchMove),this.onTouchEnd(this.chart.$m.onTouchEnd)}attacheAxis(){this.Uv=this.axisXAttachHandler(this),this.$v=this.axisYAttachHandler(this)}gc(){super.gc();for(let t=0;t{e.$r(this.Ev)})),this.rl.Wi.Gi(),this}dispose(){return super.dispose(),this.Lv.slice().forEach((t=>t.dispose())),this.Uv(this),this.$v(this),this}Yv(){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;it.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i)).addRow("Y","",e.axisY.formatValue(s));class Wa extends _a{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.Xv=[],this.xa=[],this.jv=0,this.Sh=!1,this.Gc=e.HighlightModes.onHover,this.Rx=Na,this.Zv=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.jv=void 0!==e&&e>0?e:0,this.Hr.Gi(),this}add(t){if(Array.isArray(t)?this.Kv(t):this.Kv([t]),this.xa.length>0){const t=this.xa[this.xa.length-1];this.qv={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.qv?this.qv.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.oo()+e.ao()),this.xa.length)}clear(){this.Jv=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.Zv.getXMax(this.Xv,this.Jv)||0}getXMin(){return this.Zv.getXMin(this.Xv,this.Jv)||0}getYMax(){return this.Zv.getYMax(this.Xv,this.Jv)||0}getYMin(){return this.Zv.getYMin(this.Xv,this.Jv)||0}Jp(){const t=u(0,0);for(const e of this.Xv)t.x=Math.max(t.x,e.bo()),t.y=Math.max(t.y,e.vo());return t}Qv(t,e,i,s){this.Zv.Qv(t,e,i,s,this.scale,(t=>{this.mu(t)}))}jm(){super.jm();const t=this.Xv.length;this.tM&&this.Qv(this.Xv,this.getPointAmount(),this.tM,this.jv),t!==this.Xv.length&&this.Yv()}gc(){super.gc();const t=this.getBoundaries();this.xa.length>0&&(this.iM(this.xa),this.xa=[]);for(const e of this.Xv)e.Rr(t);return super.gc()}Zm(){super.Zm(),this.Jv=void 0,this.xa.length=0}Kv(t){0!==t.length&&(this.Jv?this.Jv=We(this.Jv,Ve(t)):this.Jv=Ve(t),this.P.emit("dataAdd",this,t,this.Jv),this.xa=re(this.xa,t,{canReturnB:!1}),this.Hr.Gi())}sM(){return Ga(this.Xv)}eM(t){return this.P.on("dataAdd",t)}hM(t){return this.P.off(t)}rM(t){return this.P.on("dataClear",t)}nM(t){return this.P.off(t)}}const Ha=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.aM.indexOf(t);e>=0&&this.aM.splice(e,1);const i=this.oM.findIndex((e=>e===t.Gn));i>=0&&this.oM.splice(i,1),this.mu(t.Gn),this.Hr.Gi()},this.jr=de(this.fs.polarPolygonSeriesFillStyle,n),this.tn=de(this.fs.polarPolygonSeriesStrokeStyle,n)}addPolygon(){const t=new Ma(this.rl,this.lM,this,this.cM());return this.aM.push(t),t}setFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;for(const t of this.oM)t.As(e);return this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){this.tn="function"==typeof t?t(this.tn):t;const e=this.tn;for(const t of this.oM)t.ir(e);return this.Hr.Gi(),this}getStrokeStyle(){return this.tn}oe(){return this.Gm&&void 0!==this.aM.find((t=>void 0!==t.uM))&&this.getVisible()}gc(){this.aM.forEach((t=>{(t.Jb||this.scale.jb())&&t.dM&&(t.Gn.yo(pa(t.dM,this.scale)),t.Jb=!1,t.Gn.Zs())}))}jm(){super.jm();const t=p(ke,we);this.aM.forEach((e=>{if(!e.tv)return;const i=!e.Jb&&e.dM?e.dM:ya(e.tv);e.dM=i;const s=!e.Jb&&e.uM?e.uM:ma(i);e.uM=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.Gb=t}Au(t,e){t.zr(e),this.Hr.Gi()}Ix(t,e){const i=Ha(t,this.oM,((t,e)=>{const i=t.Ix(e);if(i)return nt(i,this.scale,t.Wi.ut)}),Be);if(!i)return;const s=nt(i[0],i[1].Wi.ut,this.scale),r=this.fM(i[1]);if(!r)return;const{angle:n,amplitude:o}=xa(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.Rx(new Ch,this,n,o,this.rl.getAmplitudeAxis().formatValue).Lc(),series:this,fillStyle:this.jr,polarPolygon:r}}solveNearestFromScreen(t){return this.Ix(t,!1)}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}cM(){const t=this.Hr.Iu(this.scale,Ys.Simple).As(this.jr).ir(this.tn).zr(this.getHighlight());return this.oM.push(t),this.gu(t),t}fM(t){return this.aM.find((e=>e.Gn===t))}}class Xa extends ca{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,o),this.Su="Area Series",this.Wb=[],this.Hb=!1,this.Ub=!1,this.gM=!1,this.jr=de(this.fs.polarAreaSeriesFillStyle,n),this.tn=de(this.fs.polarAreaSeriesStrokeStyle,n)}setData(t){const e=(t=>{const e=[];let i,s,r=!1;for(let n=0;n0&&this.getVisible()}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.jr,stroke:this.tn}),this}}class ja extends Xa{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.pM=this.Hr.Iu(this.scale,Ys.Simple).zr(this.getHighlight()),this.gu(this.pM)}gc(){if(this.Hb||this.scale.jb()){const t=this.Wb,e=!0===this.Ub?pa(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(kt(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;!kt(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.mM.start}Bb(t){this.SM=t,this.MM=!0}Lb(){return!1===this.SM}Ob(t){this.yM=t,this.MM=!0}Fb(){return this.yM}oi(){return!1}nt(t,e,i,s){return this.x=new wi(t.x,e.x,i.x,s?s.x:void 0),this.y=new wi(t.y,e.y,i.y,s?s.y:void 0),this}si(){return this.Kt}jb(){return this.vM}wM(){return this.MM}_i(){return this.ii}wi(){return this._M}X(){return this.o=!1,this.ii=!1,this.vM=!1,this.MM=!1,this}j(){return this.o=!0,this.ii=!0,this.vM=!0,this.MM=!0,this}q(t,e){return"object"==typeof t?(this.Y.x=t.x,this.Y.y=t.y):(this.Y.x=t,this.Y.y=e),this.AM(),this}xi(t){return this.xM=t,this.AM(),this}bi(t){return this.bM=t,this.AM(),this}Ut(){return u(this.xM[0]+this.xM[1],this.bM[0]+this.bM[1])}$t(){return this.Y}AM(){const t=this.mM,e=u(this.x.Yt(this.Y.x),this.y.Yt(this.Y.y)),i=this.xM[0]+this.xM[1],s=this.bM[0]+this.bM[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.xM[0]+Math.max((r-2*o)/2,0),this.xM[1]+Math.max((r-2*o)/2,0)],a=[this.bM[0]+Math.max((n-2*o)/2,0),this.bM[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.Y.x).Nt(h).Z(-l,l),this.y.q(this.Y.y).Nt(a).Z(-l,l),this._M={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Kt={x:this.x.si(),y:this.y.si()},this.j()}ti(t,e){const i=this.wi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}ki(t,e,i,s){const r=this.wi(),n=qe(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 $a extends Jh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("polarChart bg",0),r,i.Wi.fs.polarChartBackgroundFillStyle,i.Wi.fs.polarChartBackgroundStrokeStyle,i.Wi.fs.polarChartTitleFont,i.Wi.fs.polarChartTitleFillStyle,h),this.vx=e.AutoCursorModes.snapToClosest,this.Jd=[],this.kr=!0,this.kM=(t,e,i,s,r)=>{this.ub.q(s,r)},this.if=Jt(this.Jd),this.CM=t=>{this.Jd.push(t)},this.TM=()=>this.lS,this.uf.Oh||this.uf.Bh||this.Wi.Ph(4),this.IM=i.ky("polarChart series bg",0),this.FM=i.Vp("polarChart axis gridlines",0),this.PM=i.Vp("polarChart series",1),this.DM=i.Vp("polarChart axis lines",2),this.BM=i.Vp("polarChart axis ticks",3),this.ub=s.d2({scaleXYConstructor:Ya}),this.onResize(this.kM),this.hp.Ms("Polar Chart");const a=Pt(o?o.autoCursorBuilder:void 0,Nh);this.Tx=a.xx(this._x,this.uiScale,this.uiScale,this.fs),this.mS=this.IM.Ou(this.ub).As(this.fs.polarChartSeriesBackgroundFillStyle).ir(J).ea(0).ha(360).aa(0),this.SS=this.IM.Ou(this.ub).As(B).ir(this.fs.polarChartSeriesBackgroundStrokeStyle).ea(0).ha(360).aa(0),super.pS(this.mS,this.SS),this.Qg(n,this.pixelScale),this.OM=new ra(this,this.ub,this.fs,!(!o||!0!==o.disableAnimations),this.FM,this.DM,this.BM,this.cc,this.TM),this.LM=new oa(this,this.ub,this.fs,!(!o||!0!==o.disableAnimations),this.FM,this.DM,this.BM,this.cc),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1)}addLineSeries(t){const e=new Sa(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPointSeries(t){const e=new ba(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPointLineSeries(t){const e=new va(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addAreaSeries(t){const e=new ja(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}addPolygonSeries(t){const e=new Ua(this.PM,this,this.uS,this.ub,this.fs,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length,this.Wi.cc);return this.yS(e),e}getSeries(){return this.lS}addSector(){const t=new la(this.PM,this,this.if,this.ub,this.fs,this.Wi.cc);return this.CM(t),t}getAmplitudeAxis(){return this.OM}getRadialAxis(){return this.LM}gc(){var t,e;super.gc(),So.lp(this.hp,this.ip);for(const t of this.lS)t.jm();this.OM.de(),this.LM.de();for(const t of this.lS)t.gc();for(let t=1;t<=2;t+=1){const e=this.OM.gc(),i=this.LM.gc(),s=So.ap(this.hp,this.ip),r=[this.pn.left+i,this.pn.right+i],n=[this.pn.bottom+i,this.pn.top+i+s];this.ub.xi(r).bi(n);const o=4;if(!(!this.RM||Math.abs(this.RM.amplitude-e)>=o||Math.abs(this.RM.radial-i)>=o)||1!==t){this.RM={amplitude:e,radial:i};break}}const i=this.ub.wb().start,s=this.ub.wb().end,r=this.ub.Ab()?((null===(t=this.RM)||void 0===t?void 0:t.radial)||0)*this.ub.x.getPixelSize()+s-i:((null===(e=this.RM)||void 0===e?void 0:e.radial)||0)*this.ub.x.getPixelSize()+i-s;this.mS.ra(r).la(360),this.SS.ra(r).la(360);for(const t of this.Jd)t.gc();this.Fx(!1);for(const t of this.lS)t.Zm();return super.Jg(),this.EM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.OM.setAnimationsEnabled(t),this.LM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.kr=t,this}getMouseInteractions(){return this.kr}getMinimumSize(){return u(Za,Za)}EM(){}forEachAxis(t){return t(this.OM),t(this.LM),this}dispose(){return this.IM.G(),this.FM.G(),this.PM.G(),this.DM.G(),this.BM.G(),this.Jd.slice().forEach((t=>t.dispose())),super.dispose()}xd(){return[...this.lS,...this.Jd]}}const Za=300;class qa extends Ao{}class Ka extends qa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Su="Slice",this.u=0,this.cp=!1,this.zM=B,this.dp=B,this.fp=this.u,this.mp=U((()=>this.rl.Wi.Gi())),this.yp=()=>{this.xp=void 0},this.index=t,this.rl=s,this.scale=r,this.cu=n,this.pM=e.Iu(r,Ys.Simple).zr(this.getHighlight()),this.gu(this.pM),this.Pi=i.ye(r).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0})}setValue(t){return this.rl.getAnimationsEnabled()?this.getVisible()&&this._p(this.fp,t):this.fp=t,this.u=t,this.rl.Wi.Gi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?(this.xp&&(this.xp.finish(!1),this.xp=void 0),this._p(this.fp,0,(()=>super.setVisible(!1)))):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(this.xp&&(this.xp.finish(!1),this.xp=void 0),super.setVisible(!0),this._p(this.fp,this.u)):(this.fp=this.u,super.setVisible(!0)),this}_p(t,e,i){this.xp=this.mp(300,W.ease)([[t,e]],(([t])=>{this.fp=t,this.rl.Wi.Gi()})),this.xp.onEveryAnimationEnd(this.yp),i&&this.xp.onAnimationEnd(i)}setStyle(t,e,i,s){this.zM=t,this.dp=i,this.pM.As(this.zM).ir(e),this.Pi.As(this.dp).ks(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},tl=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Qa(i,r.x),s=Qa(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},p={x:0,y:n.bottom},m=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:p.x-x*o,y:p.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},p={x:a+v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&p.x>g.x&&y.pM.yo([g,d,f,p])}};class el extends xo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("funnelChart bg",0),r,i.Wi.fs.funnelChartBackgroundFillStyle,i.Wi.fs.funnelChartBackgroundStrokeStyle,i.Wi.fs.funnelChartTitleFont,i.Wi.fs.funnelChartTitleFillStyle,o),this.Ap=[],this.wp=bo.None,this.Tp=!0,this.Pp=0,this.VM=80,this.NM=20,this.GM=0,this.WM=e.FunnelSliceModes.VariableHeight,this.Op=!0,this.Rp=t=>{const e=this.Ap.indexOf(t);e>=0&&(this.Ap.splice(e,1),this.Ep())},this.uf.Oh||this.uf.Bh||this.Wi.Ph(5),this.Lp=this.fs.effectsText,this.zp=i.Vp("funnelChart bottom",0),this.Np=i.Vp("funnelChart top",1),this.hp.Ms("Funnel Chart"),this.kp=this.fs.funnelChartSliceFillStylePalette,this.Cp=this.fs.funnelChartSliceStrokeStyle,this.Ip=this.fs.funnelChartSliceLabelFont,this.Fp=this.fs.funnelChartSliceLabelFillStyle,h&&this.setAnimationsEnabled(!1),this.Qg(n,this.pixelScale)}addSlice(t,e){const i=new Ka(this.Pp,this.zp,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);return this.Pp+=1,i.setName(t),i.setValue(e),i.cc.du.Is(this.Lp),i.cc.fu.Is(this.Op),this.Ap.push(i),this.Wi.Gi(),i.setHighlightOnHover(this.Tp),i}addSlices(t){const e=[];for(let i=0;ie.cc.fu.Is(t))),this.Wi.Gi(),this}getSliceEffect(){return this.Op}setSliceSorter(t){return this.wp=t,this.Ap=this.Ap.sort(this.wp),this.Wi.Gi(),this}getSliceSorter(){return this.wp}setLabelFillStyle(t){return this.Fp="function"==typeof t?t(this.Fp):t,this.Wi.Gi(),this}getLabelFillStyle(){return this.Fp}setLabelFont(t){return this.Ip="function"==typeof t?t(this.Ip):t,this.Wi.Gi(),this}getLabelFont(){return this.Ip}setLabelEffect(t){return this.Lp=t,this.Ap.forEach((e=>e.cc.du.Is(t))),this.Wi.Gi(),this}getLabelEffect(){return this.Lp}setLabelFormatter(t){return this.Wp=t,this.Wi.Gi(),this}getLabelFormatter(){return this.Wp}setSliceHighlightOnHover(t){return this.Tp=t,this.Ap.forEach((e=>e.setHighlightOnHover(t))),this}gc(){super.gc(),So.lp(this.hp,this.ip),super.Jg();const t=So.ap(this.hp,this.ip),e=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+t)),i=u(this.pn.left+e.x/2,this.pn.bottom+e.y/2);this.Ap=this.Ap.sort(this.wp);for(let t=0,{length:e}=this.Ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),super.dispose()}}const il=(t,i,s)=>{const r=t.xo();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}}},sl=t=>{const e=t.xo();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 rl extends el{constructor(){super(...arguments),this.Wp=Mo.NamePlusValue,this.$p=10,this.HM=e.FunnelLabelSide.Left,this.UM=e.SliceLabelIndices.LabelsOnSides,this.Xp=[],this.jp=this.fs.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.jp=t;for(let t=0;t{const e=this.Ap.indexOf(t);e>=0&&this.Ap.splice(e,1)},this.uf.Oh||this.uf.Bh||this.Wi.Ph(6),this.Hr=e.Vp("gaugeChart layer",0),this.Np=e.Vp("gaugeChart top layer",1),this.hp.Ms("Gauge Chart"),this.Qg(r,this.pixelScale);const h=Lr();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}dispose(){return this.Hr.G(),this.Np.G(),this.Ap.slice().forEach((t=>t.dispose())),super.dispose()}}class ul extends ll{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Xo=90,this.jo=-270,this.XM={min:this.Xo,max:this.jo},this.jM=U((()=>this.Hr.Gi())),this.ZM=()=>{this.KM=void 0},this.qM=e.Vp("radialGaugeChart bg arc",2),this.JM=this.Hr.Ou(this.pixelScale).As(this.fs.gaugeChartEmptyGaugeFillStyle).ir(this.fs.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.Xo,s=this.jo,r=this.XM;return this.getAnimationsEnabled()?this.QM(r,{min:t,max:e}):(r.min=t,r.max=e,this.Xo=t,this.jo=e),this.P.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.Wi.Gi(),this}getAngleInterval(){return{min:this.Xo,max:this.jo}}setGaugeFillStyle(t){return this.JM.As(t),this.Wi.Gi(),this}setGaugeStrokeStyle(t){return this.JM.ir(t),this.Wi.Gi(),this}QM(t,e,i){this.KM=this.jM(1e3,W.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.XM={min:t,max:e},this.Xo=t,this.jo=e,this.Hr.Gi()})),this.KM.onEveryAnimationEnd(this.ZM),i&&this.KM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.P.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.P.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.qM.G(),this}}class cl extends Ao{t_(t){return this.P.on("valueChange",t)}i_(t){return this.P.on("valueIntervalChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}offIntervalChange(t){return this.P.off(t,"valueIntervalChange")}attach(t,e=!0){return super.attach(t,e),this.styleAttachedEntry(t),this}styleAttachedEntry(t){ae(t,this.fs,{fill:this.s_})}}class dl extends cl{onValueChange(t){return this.t_(t)}onIntervalChange(t){return this.i_(t)}}class fl extends dl{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.Xo=0,this.jo=0,this.e_=0,this.h_=0,this.r_=0,this.n_=100,this.o_=!0,this.fp=this.u,this.pp=this.getVisible(),this.mp=Se(),this.a_=t=>{this.fp=t,this.rl.Wi.Gi()},this.l_=t,this.ve=e,this.rl=i,this.scale=s,this.s_=this.fs.gaugeChartGaugeFillStyle,this.Mp=t.Ou(s).As(this.s_).ir(J).zr(this.getHighlight()),this.gu(this.Mp),this.c_=e.ye(s).zr(this.getHighlight()),this.gu(this.c_,{isText:!0}),this.u_=e.ye(s).zr(this.getHighlight()),this.gu(this.u_,{isText:!0}),this.Pi=e.ye(s).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0}),this.c_.As(n.gaugeChartIntervalLabelsFillStyle).ks(n.gaugeChartIntervalLabelsFont),this.u_.As(n.gaugeChartIntervalLabelsFillStyle).ks(n.gaugeChartIntervalLabelsFont),this.Pi.As(n.gaugeChartValueLabelFillStyle).ks(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}gc(){const t=this.rl.getDataLabelFormatter(),e=this.Xo/90r&&(i=r);const n=this.jo-e*this.h_,o=this.Xo+e*this.e_,h=this.n_-this.r_,a=(0!==h?(n-o)/h:1/0)*(i-this.r_);this.Mp.ea(o).ha(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this.Pi.Ms(l)}d_(){const t=this.rl.getIntervalLabelFormatter(),e="function"==typeof t?t(this.r_,{getInnerStart:()=>this.r_,getInnerEnd:()=>this.n_}):t.format(this.r_);return this.c_.Ms(e).Zs(),this.c_.$t()}f_(){const t=this.rl.getIntervalLabelFormatter(),e="function"==typeof t?t(this.n_,{getInnerStart:()=>this.r_,getInnerEnd:()=>this.n_}):t.format(this.n_);return this.u_.Ms(e).Zs(),this.u_.$t()}setName(t){return super.setName(t),this.rl.Wi.Gi(),this}setValue(t){const e=this.u;return this.rl.getAnimationsEnabled()?this.pp&&this.mp(e,t,this.a_):this.fp=t,this.u=t,this.P.emit("valueChange",this,e,t),this.rl.Wi.Gi(),this}getValue(){return this.u}setVisible(t){return this.pp=t,!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?this.mp(this.fp,0,this.a_,{onCompleted:()=>super.setVisible(!1)}):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(super.setVisible(!0),this.mp(this.fp,this.u,this.a_)):(this.fp=this.u,super.setVisible(!0)),this}setInterval(t,e){const i=this.r_,s=this.n_;return this.P.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.r_=t,this.n_=e,this.rl.Wi.Gi(),this}setIntervalLabelsFont(t){return this.c_.ks(t),this.u_.ks(t),this.rl.Wi.Gi(),this}getIntervalLabelsFont(){return this.c_.ws()}setIntervalLabelsFillStyle(t){return this.c_.As(t),this.u_.As(t),this.rl.Wi.Gi(),this}getIntervalLabelsFillStyle(){return this.c_._s()}setIntervalLabelsVisible(t){return t?(this.c_.setVisible(!0),this.u_.setVisible(!0)):(this.c_.setVisible(!1),this.u_.setVisible(!1)),this.o_=t,this}getIntervalLabelsVisible(){return this.o_}setAngleInterval(t,e){return this.Xo=t,this.jo=e,this.rl.Wi.Gi(),this}setMinAngle(t){return this.Xo=t,this.rl.Wi.Gi(),this}setMaxAngle(t){return this.jo=t,this.rl.Wi.Gi(),this}setMarginInDegrees(t=this.e_,e=this.h_){return t!==this.e_&&(this.e_=t),e!==this.h_&&(this.h_=e),this.rl.Wi.Gi(),this}setFillStyle(t){this.s_="function"==typeof t?t(this.s_):t;const e=this.s_;this.Mp.As(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 pl extends ul{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.od=20,this.m_=new Intl.NumberFormat,this.S_=new Intl.NumberFormat,this.y_=!1,this.x_=5;const h=new fl(this.Hr,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);this.b_=h,this.Ap.push(h),this.setPadding(10)}gc(){super.gc(),So.lp(this.hp,this.ip),super.Jg();const t=So.ap(this.hp,this.ip),e=Ve([this.b_.d_(),this.b_.f_()]),i=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right+2*e.max.x),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+1*e.max.y+t)),s=Math.max(.5*Math.min(i.x,i.y),0),r=u(this.pn.left+e.max.x+.5*i.x,this.pn.bottom+e.max.y+.5*i.y),n=this.y_?this.v_(r,s):r,o=this.JM.tn.getThickness(),h=s-.5*o,a=s-this.od;let l=a/s*100;l=l>100||l<0?99:l;const c=100*(1-(this.od-o)/s);this.M_(n,a)&&(this.JM.ra(s).aa(l),this.b_.Mp.ra(h).aa(c));const d=.5*(f=s,(g=this.jo-this.Xo)/(2*Math.PI*f*(g/360))*o);var f,g;this.JM.ea(this.Xo).ha(this.jo).Cn(n),this.b_.Mp.Cn(n),this.b_.Pi.Cn(n),this.ld&&this.b_.setFillStyle(new L({color:this.ld.getColors(this.b_.getAnimatedValue())})),this.b_.setMinAngle(this.Xo).setMaxAngle(this.jo).setMarginInDegrees(d,d).gc();const p=this.JM.Zo();if(this.b_.getIntervalLabelsVisible()){this.__(this.Xo,this.jo,n,p+this.x_);const t=this.b_.c_.Zs().Fi(),e=this.b_.u_.Zs().Fi();Ce(t,e)&&this.A_(t,e,n,p+this.x_)}}M_(t,e){const i=Je(this.b_.Pi.Zs().$t(),.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]}v_(t,e){const[i]=gl(t,this.Xo,this.jo,e,e),s=Ve(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return Qe(ti(t,u(s.min.x+r,s.min.y+n)),t)}__(t,e,i,s){const r=hi(t),n=hi(e);this.b_.c_.Cn(Ye(u(i.x+s,i.y),i,-r)),this.b_.u_.Cn(Ye(u(i.x+s,i.y),i,-n)),this.b_.c_.Ln(u(-Math.cos(r),-Math.sin(r))),this.b_.u_.Ln(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.b_}setAutoScaling(t){return this.y_=t,this.Wi.Gi(),this}getAutoScaling(){return this.y_}setDataLabelFormatter(t){return this.S_=t,this.Wi.Gi(),this}getDataLabelFormatter(){return this.S_}setIntervalLabelFormatter(t){return this.m_=t,this.Wi.Gi(),this}getIntervalLabelFormatter(){return this.m_}setIntervalLabelPadding(t){return this.x_=t,this.Wi.Gi(),this}getIntervalLabelPadding(){return this.x_}setThickness(t){return this.od=t,this}setLUT(t){return this.ld=t,this.Wi.Gi(),this}setDataLabelFont(t){return this.b_.Pi.ks(t),this.Wi.Gi(),this}getDataLabelFont(){return this.b_.Pi.ws()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.b_.g_(t),this.Wi.Gi(),this}getDataLabelFillStyle(){return this.b_.p_()}xd(){return this.Ap}dispose(){return this.b_.dispose(),super.dispose()}}class ml extends Ao{}class yl extends ml{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.Su="Slice",this.u=0,this.cp=!1,this.zM=B,this.dp=B,this.fp=this.u,this.mp=U((()=>this.rl.Wi.Gi())),this.yp=()=>{this.xp=void 0},this.index=t,this.rl=s,this.scale=r,this.cu=n,this.pM=e.Iu(r,Ys.Simple).zr(this.getHighlight()),this.gu(this.pM),this.Pi=i.ye(r).zr(this.getHighlight()),this.gu(this.Pi,{isText:!0})}setValue(t){return this.rl.getAnimationsEnabled()?this.getVisible()&&this._p(this.fp,t):this.fp=t,this.u=t,this.rl.Wi.Gi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.rl.getAnimationsEnabled()&&this.fp>0?(this.xp&&(this.xp.finish(!1),this.xp=void 0),this._p(this.fp,0,(()=>super.setVisible(!1)))):(this.fp=0,super.setVisible(!1)):this.rl.getAnimationsEnabled()?(this.xp&&(this.xp.finish(!1),this.xp=void 0),super.setVisible(!0),this._p(this.fp,this.u)):(this.fp=this.u,super.setVisible(!0)),this}_p(t,e,i){this.xp=this.mp(300,W.ease)([[t,e]],(([t])=>{this.fp=t,this.rl.Wi.Gi()})),this.xp.onEveryAnimationEnd(this.yp),i&&this.xp.onAnimationEnd(i)}setStyle(t,e,i,s){this.zM=t,this.dp=i,this.pM.As(this.zM).ir(e),this.Pi.As(this.dp).ks(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},Sl=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=xl(i,r.x),s=xl(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},p={x:0,y:n.bottom},m=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:p.x-x*o,y:p.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},p={x:a+v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&p.x>=g.x&&y.pM.yo([g,d,f,p])}};class vl extends xo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("pyramidChart bg",0),r,i.Wi.fs.pyramidChartBackgroundFillStyle,i.Wi.fs.pyramidChartBackgroundStrokeStyle,i.Wi.fs.pyramidChartTitleFont,i.Wi.fs.pyramidChartTitleFillStyle,o),this.Ap=[],this.wp=bo.None,this.kp=this.fs.pyramidChartSliceFillStylePalette,this.Cp=this.fs.pyramidChartSliceStrokeStyle,this.Tp=!0,this.Ip=this.fs.pyramidChartSliceLabelFont,this.Fp=this.fs.pyramidChartSliceLabelFillStyle,this.Pp=0,this.VM=0,this.NM=80,this.GM=0,this.WM=e.PyramidSliceModes.VariableHeight,this.Op=!0,this.Rp=t=>{const e=this.Ap.indexOf(t);e>=0&&(this.Ap.splice(e,1),this.Ep())},this.uf.Oh||this.uf.Bh||this.Wi.Ph(8),this.Lp=this.fs.effectsText,this.zp=i.Vp("pyramidChart bottom",0),this.Np=i.Vp("pyramidChart top",1),this.hp.Ms("Pyramid Chart"),h&&this.setAnimationsEnabled(!1),this.Qg(n,this.pixelScale)}addSlice(t,e){const i=new yl(this.Pp,this.zp,this.Np,this,this.pixelScale,this.Rp,this.fs,this.Wi.cc);return this.Pp+=1,i.setName(t),i.setValue(e),i.cc.du.Is(this.Lp),i.cc.fu.Is(this.Op),this.Ap.push(i),this.Wi.Gi(),i}addSlices(t){const e=[];for(let i=0;ie.cc.fu.Is(t))),this.Wi.Gi(),this}getSliceEffect(){return this.Op}setSliceSorter(t){return this.wp=t,this.Ap=this.Ap.sort(this.wp),this.Wi.Gi(),this}getSliceSorter(){return this.wp}setLabelFillStyle(t){return this.Fp="function"==typeof t?t(this.Fp):t,this.Wi.Gi(),this}getLabelFillStyle(){return this.Fp}setLabelFont(t){return this.Ip="function"==typeof t?t(this.Ip):t,this.Wi.Gi(),this}getLabelFont(){return this.Ip}setLabelEffect(t){return this.Lp=t,this.Ap.forEach((e=>e.cc.du.Is(t))),this.Wi.Gi(),this}getLabelEffect(){return this.Lp}setLabelFormatter(t){return this.Wp=t,this.Wi.Gi(),this}getLabelFormatter(){return this.Wp}setSliceHighlightOnHover(t){return this.Tp=t,this.Ap.forEach((e=>e.setHighlightOnHover(t))),this}gc(){super.gc(),So.lp(this.hp,this.ip),super.Jg();const t=So.ap(this.hp,this.ip),e=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+t)),i=u(this.pn.left+e.x/2,this.pn.bottom+e.y/2);this.Ap=this.Ap.sort(this.wp);for(let t=0,{length:e}=this.Ap;tt.getAnimatedValue()>0));let r=0;for(let t=0;t0?o/r:0);var o;for(let t=0;tt.dispose())),super.dispose()}}const bl=(t,i,s)=>{const r=t.xo();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}}},Ml=t=>{const e=t.xo();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 Al extends vl{constructor(){super(...arguments),this.Wp=Mo.NamePlusValue,this.$p=10,this.HM=e.PyramidLabelSide.Left,this.UM=e.SliceLabelIndices.LabelsOnSides,this.Xp=[],this.jp=this.fs.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.jp=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),Tl=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Il;e.SpiderWebMode=void 0,(Il=e.SpiderWebMode||(e.SpiderWebMode={}))[Il.Normal=0]="Normal",Il[Il.Circle=1]="Circle";class Cl{constructor(t,e,i,s,n,o,h,a){this.P=new r.Eventer,this.k_=t,this.ve=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.C_=h,this.T_=a,this.I_=this.k_.Bc(this.scale).setMouseInteractions(!1),this.F_=this.ve.ye(this.scale).Ms(this.tag).setMouseInteractions(!1),this.P_=this.C_(this,this.ve.Kp(this.scale,void 0,[Po.InternalUI])).ua(this.chart.getNibStyle()),this.T_.pu([this.F_])}Hp(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.F_.setVisible(!0).Cn(Qe(c,u(h.paddingX,h.paddingY))).Pn(h.alignmentX).Bn(h.alignmentY):this.F_.setVisible(!1)}getLabelSize(){return this.F_.ks(this.chart.getAxisLabelFont()).As(this.chart.getAxisLabelStyle()).Zs().$t()}dispose(){this.I_&&this.I_.dispose(),this.F_&&this.F_.dispose(),this.P_&&this.P_.dispose()}}const Pl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class Ol extends ua{constructor(t,i,s,r,n,o,h,a,l,u,c,d){super(t,l,u,d),this.Su="Spider Series",this.xa=new Map,this.Gc=e.HighlightModes.onHover,this.Rx=Pl,this.Zb=8,this.dn=0,this.D_=Se(),this.B_={},this.O_={},this.pp=this.getVisible(),this.L_=1,this.R_=((t,e)=>{const i=U((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||W.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.L_=t,this.Hr.Wi.Gi()}),(t=>{super.setVisible(t)})),this.rl=t,this.Hr=i,this.Kb=r,this.E_=n,this.Cy=o,this.z_=h,this.V_=a,this.scale=s,this.N_=de(u.spiderSeriesFillStyle,c),this.G_=de(u.spiderSeriesStrokeStyle,c),this.W_=de(u.spiderSeriesPointFillStyle,c)}oe(){return this.Gm&&this.xa.size>0&&this.getVisible()}addPoints(...t){t=t.filter((t=>void 0!==t.axis));for(let e=0;ee.set(t.axis,t.value))),this.D_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.xa.set(s,r+t*(e-r)),this.Hr.Wi.Gi()}))}),{easing:this.B_.easing,durationMs:this.B_.durationMs,onStart:()=>{i=new Map(this.xa)}})}else for(let e=0;e=3&&(this.pM||(this.pM=this.Hr.Iu(this.scale,Ys.Simple).ir(this.G_).As(this.N_).zr(this.getHighlight()),this.gu(this.pM)),this.pM.yo(t),this.qb||(this.qb=this.Hr.aS(this.scale).q(this.Zb).so(this.Kb).Cs(this.dn).As(this.W_).zr(this.getHighlight()),this.gu(this.qb)),this.qb.no().xt(t))}}attach(t,e=!0){return super.attach(t,e),ae(t,this.fs,{fill:this.N_,stroke:this.G_}),this}H_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Rl=t=>Ve(t.F_.Fi()),Bl=t=>Ve(t.Fi()),zl=(t,i,s,r)=>t.aa(0).Cn(s).ea(90).ha(-270).la(i===e.SpiderWebMode.Circle?void 0:r.length),_l={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Ll={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Gl=()=>{Ll.alignmentX=0,Ll.alignmentY=0,Ll.paddingX=0,Ll.paddingY=0};class Vl extends Jh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("spiderChart bg",0),r,i.Wi.fs.spiderChartBackgroundFillStyle,i.Wi.fs.spiderChartBackgroundStrokeStyle,i.Wi.fs.spiderChartTitleFont,i.Wi.fs.spiderChartTitleFillStyle,h),this.vx=e.AutoCursorModes.onHover,this.pn=x(20,20,20,20),this.axisScale=st.d1({scale1DConstructor:wi,dimension:"x"}).Z(0,1),this.Cy=[],this.U_=[],this.Y_=[],this.X_=Ci.expansion,this.j_=!0,this.Z_=Tl,this.K_=El,this.kr=!0,this.q_=e.SpiderWebMode.Normal,this.J_=4,this.Q_=this.fs.spiderChartWebStyle,this.tA=this.fs.spiderChartScaleLabelFillStyle,this.iA=this.fs.spiderChartScaleLabelFont,this.sA=5,this.eA=this.fs.spiderChartAxisLabelFillStyle,this.hA=this.fs.spiderChartAxisLabelFont,this.rA=5,this.nA=this.fs.spiderChartAxisStrokeStyle,this.oA=this.fs.spiderChartAxisNibStrokeStyle,this.Dd=10,this.aA=x(),this.hasAxis=t=>this.Cy.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.pi(t,Ai.Numeric),this.lA=()=>(t=>{const e=t.length;for(let i=0;ithis.uA.Ou(this.pixelScale).setMouseInteractions(!1),this.dA=t=>t.dispose(),this.fA=()=>this.vf.ye(this.pixelScale).setMouseInteractions(!1),this.gA=t=>t.dispose(),this.pA=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.mA=(t,e)=>{let i,s;const r=()=>{void 0!==this.SA&&this.SA.finish(),i=p(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.X_,this.X_=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Cy.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=Fl(a,this.Cy.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=Ke(ti(t.I_.fi(),t.I_.ui())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.Z(i.min,l),Zt(o),this.Wi.Gi()}},o=()=>{if(i=void 0,void 0!==s)if(this.Hi){const t=p(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.yA(),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.SA=this.Eg.Wi.Ue(300,W.ease)([[0,1]],(([e])=>{this.axisScale.Z(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.SA.onAnimationEnd((()=>{this.SA=void 0,this.X_=i}))}else this.X_=s}else this.X_=s;s=void 0};e.setMouseEnterEventHandler(this.xA).setMouseLeaveEventHandler(this.bA).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Lr(new Vr(((t,e,i)=>{this.xA(t),r(),Zt(i)}),n,((t,e,i,s)=>{this.bA(t),o(),Zt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.vA=t=>{this.j_&&!this.hasAxis(t)&&this.addAxis(t)},this.z_=(t,e)=>{for(const i of this.Cy)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return Le(i.I_.fi(),i.I_.ui(),t)}},this.V_=t=>{if(0===this.Cy.length)return;const e=ti(nt(t,this.engine.scale,this.pixelScale),this.Cy[0].I_.fi()),i=Math.atan2(e.y,e.x);let s,r=ke;for(const t of this.Cy){const e=ti(t.I_.ui(),t.I_.fi()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.kr&&(t.ua(this.oA),this.Wi.Gi())},this.bA=t=>{t.ua(this.oA),this.Wi.Gi()},this.uf.Oh||this.uf.Bh||this.Wi.Ph(9),this.IM=i.ky("spiderChart series bg",0),this.uA=i.Vp("spiderChart web shapes",0),this.MA=i.Vp("spiderChart axis bg",1),this.Zx=i.Vp("spiderChart plotting",2),this.vf=i.Vp("spiderChart fg",3),this.T_=this.cc.Sg().Is(this.fs.effectsText),this.hp.Ms("Spider Chart");const a=Pt(o?o.autoCursorBuilder:void 0,Vh);this.Tx=a.xx(this._x,this.uiScale,this.uiScale,this.fs),this.mS=this.IM.Ou(this.pixelScale).As(this.fs.spiderChartSeriesBackgroundFillStyle).ir(J).ea(90).ha(-270).aa(0),this.SS=this.IM.Ou(this.pixelScale).As(B).ir(this.fs.spiderChartSeriesBackgroundStrokeStyle).ea(90).ha(-270).aa(0),super.pS(this.mS,this.SS),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Qg(n,this.pixelScale)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new Cl(this.MA,this.vf,this.pixelScale,this,t,this.axisScale,this.mA,this.T_);this.Cy.push(e)}}else t&&this.Cy.push(t);return this.T_.pu(this.Cy.map((t=>t.F_))),this.Wi.Gi(),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.lS.length,r=new Ol(this,this.Zx,this.pixelScale,i,this.vA,this.Cy,this.z_,this.V_,this.uS,this.fs,s,this.Wi.cc);return this.yS(r),r}getSeriesCount(){return this.lS.length}getSeries(){return this.lS}setWebMode(t){return this.q_=t,this.Wi.Gi(),this}getWebMode(){return this.q_}setWebCount(t){return this.J_=t,this.Wi.Gi(),this}getWebCount(){return this.J_}setWebStyle(t){return this.Q_="function"==typeof t?t(this.Q_):t,this.Wi.Gi(),this}getWebStyle(){return this.Q_}setScaleLabelStyle(t){return this.tA="function"==typeof t?t(this.tA):t,this.Wi.Gi(),this}getScaleLabelStyle(){return this.tA}setScaleLabelFont(t){return this.iA="function"==typeof t?t(this.iA):t,this.Wi.Gi(),this}getScaleLabelFont(){return this.iA}setScaleLabelPadding(t){return this.sA=t,this.Wi.Gi(),this}getScaleLabelPadding(){return this.sA}setScaleLabelStrategy(t){return this.Z_=t,this.Wi.Gi(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.Wi.Gi(),this}setAxisLabelStyle(t){return this.eA="function"==typeof t?t(this.eA):t,this.Wi.Gi(),this}getAxisLabelStyle(){return this.eA}setAxisLabelFont(t){return this.hA="function"==typeof t?t(this.hA):t,this.Wi.Gi(),this}getAxisLabelFont(){return this.hA}setAxisLabelEffect(t){return this.T_.Is(t),this.Wi.Gi(),this}getAxisLabelEffect(){return this.T_.Ps()}setAxisLabelPadding(t){return this.rA=t,this.Wi.Gi(),this}getAxisLabelPadding(){return this.rA}setAxisLabelStrategy(t){return this.K_=t,this.Wi.Gi(),this}setAxisStyle(t){return this.nA="function"==typeof t?t(this.nA):t,this.Wi.Gi(),this}getAxisStyle(){return this.nA}setNibStyle(t){return this.oA="function"==typeof t?t(this.oA):t,this.Wi.Gi(),this}getNibStyle(){return this.oA}setNibLength(t){return this.Dd=t,this.Wi.Gi(),this}getNibLength(){return this.Dd}setAutoAxis(t){return this.j_=t,this}getAutoAxis(){return this.j_}setMouseInteractions(t){return this.kr=t,this}getMouseInteractions(){return this.kr}setAxisScrollStrategy(t){return this.X_=t,this.Wi.Gi(),this}getAxisScrollStrategy(){return this.X_}setAxisInterval(t,e=0){return this.axisScale.Z(e,t),this.Wi.Gi(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}gc(){super.gc(),So.lp(this.hp,this.ip);const t=this.Cy.length,e=So.ap(this.hp,this.ip),i=u(this.pixelScale.x.getInnerInterval()-(this.pn.left+this.pn.right),this.pixelScale.y.getInnerInterval()-(this.pn.bottom+this.pn.top+e)),s=((t=0,e=0,i=0,s=0)=>({left:t,top:e,right:i,bottom:s}))(0,0,0,0);if(void 0!==this.K_){const e=Math.min(i.x,i.y)/2;for(let i=0;i0?s.right=Math.max(s.right,l.x+.5*(1-a.alignmentX)*h.x-e):s.left=Math.max(s.left,-l.x+.5*(a.alignmentX+1)*h.x-e),o>0?s.top=Math.max(s.top,l.y+.5*(1-a.alignmentY)*h.y-e):s.bottom=Math.max(s.bottom,-l.y+.5*(a.alignmentY+1)*h.y-e)}}if(this.X_){const t=this.yA();if(void 0!==t){const e=this.X_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.X_.end(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max);this.axisScale.Z(e,i)}}const r=u(this.pixelScale.x.getInnerStart()+(s.left+this.pixelScale.x.getInnerInterval()-s.right)/2,this.pixelScale.y.getInnerStart()+(s.bottom+this.pixelScale.y.getInnerInterval()-s.top)/2),n=Math.min(i.x/2-(s.left+s.right)/2,i.y/2-(s.bottom+s.top)/2);this.aA=x(this.Pt.left+this.pn.left+s.left,this.Pt.top+this.pn.top+e+s.top,this.Pt.right+this.pn.right+s.right,this.Pt.bottom+this.pn.bottom+s.bottom),this.Hp(r,n);for(const t of this.lS)t.jm();for(const t of this.lS)t.gc();super.Jg(),this.Fx(!1);for(const t of this.lS)t.Zm()}dispose(){return this.IM.G(),this.uA.G(),this.MA.G(),this.Zx.G(),this.vf.G(),super.dispose()}getMinimumSize(){return u(this.aA.left+this.aA.right+100,this.aA.bottom+this.aA.top+100)}Hp(t,e){const i=this.Cy.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];zl(h,i,s,n);const u=r*((l+1)/e);h.ra(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=Le(n,o[a],s);e.Cn(Qe(c,u(m.paddingX,m.paddingY))).Pn(m.alignmentX).Bn(m.alignmentY).Ms(l(s))}}}for(let e=f;e1;for(const s of this.Cy)for(const r of this.lS){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 p(t,e)}}const Nl={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Wl={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},Hl={defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,ae:t=>t.getXMin(),le:t=>t.getXMax(),ue:t=>t.Jp().x},Ul={defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,ae:t=>t.getYMin(),le:t=>t.getYMax(),ue:t=>t.Jp().y},Xl={...Nl,...Hl},jl={...Wl,...Ul};class Yl extends Hr{constructor(t,e,i,s){super(),this.be=[],this.mc=0,this.Tu=!0,this.P=new r.Eventer,this._A=t=>(this.be.push(t),this.sc(t),t.setMouseInteractions(this.Tu),t),this.getHighlight=()=>this.mc,this.Hr=t,this.scale=e,this.AA=i,this.fs=s}wA(){return this.be}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}dispose(){return this.be.forEach(Mt),this.AA&&this.AA(this),this.Hr.Wi.Gi(),this.P.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this.be.forEach((e=>e.setVisible(t))),this.Hr.Wi.Gi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setHighlight(t){return this.mc=ye(t),this.Hr.Gi(),this}setMouseInteractions(t){this.Tu=t;for(let t=0;t{t.wA().forEach((t=>this.mu(t)));const e=this.kA.findIndex((e=>e===t));e>=0&&this.kA.splice(e,1),this.Hr.Gi()}}clear(){return this.kA.slice().forEach(Mt),this.kA.length=0,this.Wc=0,this.Hr.Gi(),this}CA(t,e){void 0!==e?this.kA.splice(e,0,t):this.kA.push(t),t.wA().forEach((t=>this.gu(t,{setEventHandlers:!1}))),t.onMouseEnter(((t,e)=>this.Xc(t,e))),t.onMouseLeave(((t,e)=>this.Zc(t,e))),t.onMouseClick(((t,e)=>this.Qc(t,e))),t.onMouseDoubleClick(((t,e)=>this.tu(t,e))),t.onMouseDown(((t,e)=>this.iu(t,e))),t.onMouseUp(((t,e)=>this.su(t,e))),t.onMouseMove(((t,e)=>this.qc(t,e))),t.onMouseDragStart(((t,e,i)=>this.eu(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.hu(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.ru(t,e,i,s))),t.onMouseWheel(((t,e)=>this.nu(t,e))),t.onTouchStart(((t,e)=>this.ou(t,e))),t.onTouchMove(((t,e)=>this.au(t,e))),t.onTouchEnd(((t,e)=>this.lu(t,e))),this.Hr.Gi()}Au(t,e){t.setHighlight(e)}TA(t){return this.kA.find((e=>e.wA().includes(t)))}setCursorEnabled(t){return super.setCursorEnabled(t)}}class Zl extends Yl{}class ql extends $l{constructor(){super(...arguments),this.IA=void 0,this.FA=()=>{this.IA=void 0}}oe(){return this.Gm&&this.kA.length>0&&this.getVisible()}setDefaultStyle(t){this.PA=t,this.kA.forEach(t),t(this.DA);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.kA.filter((t=>t.getVisible())),this.OA,Be);if(void 0!==i)return{location:nt(i[0],this.Hr.Wi.ut,this.scale),scale:this.scale,resultTableContent:this.Rx(new Ch,this,i[1]).Lc(),series:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.Ix(t,!1)}CA(t){super.CA(t),this.PA&&this.PA(t)}clear(){return this.IA=void 0,super.clear()}getXMax(){return this.IA||(this.IA=this.LA()),this.IA.max.x}getXMin(){return this.IA||(this.IA=this.LA()),this.IA.min.x}getYMax(){return this.IA||(this.IA=this.LA()),this.IA.max.y}getYMin(){return this.IA||(this.IA=this.LA()),this.IA.min.y}Jp(){return u(0,0)}LA(){const t=p(c(ke,ke),c(we,we));for(let e=0;e{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)},ou=(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=Ze(ti(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]=Qe(Je(r,l),f[1]),f[2]=ti(f[2],Je(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.Xv.length>0){const e=this.Xv[this.Xv.length-1];if(t.length>0){const i=e.io(),s=e.Qn(),r=i.length+s.length-+e.Ro();if(r>=this.tM){const n=s.length>0?s[s.length-1]:i[e.Ro()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.xt(o,p(u(o.x,o.y),u(o.x,o.y))).Eo(!0),this.fw([o].concat(t)).Lo(!0)}else e.xt(t,this.Jv)}}else t.length>0&&this.fw(t)},this.gw=t=>{if(this.uw.length>0){const e=this.uw[this.uw.length-1];t.length>0&&((e.io().length+e.Qn().length)*this.cw>=this.tM?this.pw(t):e.xt(t))}else t.length>0&&this.pw(t)},this.mw=(t,e)=>{const i=t.Ix(e);if(i)return nt(i,this.scale,this.Hr.Wi.ut)},this.Sw=(t,e)=>{const i=t.yw(e);if(i)return nt(i,this.scale,this.Hr.Wi.ut)},this.Kb=l,this.xw=f,this.bw=de(c.pointLineSeriesFillStyle,g),this.ca=de(this.fs.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}sM(){return Ga(this.uw)}setStrokeStyle(t){this.ca="function"==typeof t?t(this.ca):t;const e=this.ca;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.aw=t,this.Hr.Wi.Gi(),this}getCursorInterpolationEnabled(){return this.aw}setCursorSolveBasis(t){return this.lw=t,this.Xv.forEach((e=>e.Jn(vs(t)))),this.uw.forEach((e=>e.Jn(vs(t)))),this.Hr.Gi(),this}getCursorSolveBasis(){return this.lw}ud(){return le(this.bw)||le(this.ca.getFillStyle())}Vv(t){}Au(t,e){t.zr(e),this.Hr.Gi()}iM(t){const e=this.Xv.length>0?this.Xv[this.Xv.length-1].io().length+this.Xv[this.Xv.length-1].Qn().length-+this.Xv[this.Xv.length-1].Ro():void 0;La(t,e,this.tM,this.dw),La(t,e,this.tM,this.gw)}pw(t,e){const i=this.Hr.aS(this.scale).xt(t,e).setMouseInteractions(this.Nc).As(this.bw).so(this.Kb).q(this.Zb).Cs(this.dn).eo(this.Wn).ho(this.Hn).ro(this.Un).Jn(vs(this.lw)).zr(this.getHighlight());return this.gu(i),this.uw.push(i),i}fw(t,e){const i=this.Hr.Kp(this.scale,void 0,[Po.UserSeries,...this.xw]).xt(t,e).setMouseInteractions(this.Nc).ua(this.ca).Jn(vs(this.lw)).zr(this.getHighlight());return this.gu(i),this.Xv.push(i),i}attach(t,e=!0){return ae(t,this.fs,{stroke:this.ca,fill:this.bw}),super.attach(t,e)}getPointAmount(){return this.uw.reduce(((t,e)=>t+e.oo()+e.ao()),this.xa.length)}clear(){super.clear();for(let t=0;t{this.mu(t)}))}Ix(t,e,i=this.aw){const s=i?Ha(t,e?this.Xv.filter((t=>t.getIsUnderMouse())):this.Xv,this.Sw,"nearest-x"===this.lw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.lw?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):Ha(t,e?this.uw.filter((t=>t.getIsUnderMouse())):this.uw,this.mw,"nearest-x"===this.lw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.lw?(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=nt(s[0],this.Hr.Wi.ut,this.scale),e=s[1]instanceof Ks?s[1].da():s[1]._s(),i=e instanceof tt?e.getFillStyle():void 0,r=e instanceof G?s[0].color?new L({color:s[0].color}):new L({color:e.getFallbackColor()}):e;return Hh(t,this.scale,this.Rx(new Ch,this,t.x,t.y,t).Lc(),this,i||r)}}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}}const au=(t,e)=>t.Qn().length>=e?t.Qn().slice(-e):Array.prototype.concat(t.io(),t.Qn()).slice(-e),lu=(t,e,i)=>{const s=Array.prototype.concat(t.io(),t.Qn()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.no().xt(s).Zs()};class uu extends hu{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,c,d,f),this.Su="Spline Series",this.cw=32,this.tM=8e3,this.Mw=t=>{if(0===t.length)return;const e=this.uw.length;if(e>0){const i=e>1,s=this.uw[e-1];if(i){const i=Array.prototype.concat(s.io(),s.Qn()),r=i.length;if(32*r>=this.tM){const i=au(s,3),r=Array.prototype.concat(i,t),n=ou(r,32);lu(this.Xv[e-1],n,32),this.fw(n.slice(66))}else if(r<5){const s=this.uw[e-2],r=au(s,3),n=Array.prototype.concat(r,i,t),o=ou(n,32),h=this.Xv[e-1],a=o.slice(66);h.no().xt(a).Zs()}else{const i=this.Xv[e-1],r=Array.prototype.concat(i.io(),i.Qn()),n=au(s,4),o=Array.prototype.concat(n,t),h=ou(o,32),a=r.slice(0,-66).concat(h.slice(33));i.no().xt(a).Zs()}}else{const i=Array.prototype.concat(s.io(),s.Qn()),r=i.length,n=this.Xv[e-1];if(32*r>=this.tM){const e=au(s,3),i=Array.prototype.concat(e,t),r=ou(i,32);lu(this.Xv[0],r,32),this.fw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=ou(e,32);n.no().xt(s).Zs()}else n.xt(t)}}else{const e=t.length>0?ou(t,32):t,i=Ve(e);this.fw(e,i)}this.gw(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}iM(t){const e=this.uw.length,i=this.uw.length>0?this.uw[e-1].io().length+this.uw[e-1].Qn().length:void 0;La(t,i,Math.ceil(this.tM/this.cw),this.Mw)}solveNearestFromScreen(t,e=this.aw){if(e)return super.solveNearestFromScreen(t,e);const i=Ha(t,this.uw,this.mw,"nearest-x"===this.lw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.lw?(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=nt(i[0],this.Hr.Wi.ut,this.scale);return Hh(t,this.scale,this.Rx(new Ch,this,t.x,t.y,t).Lc(),this,i[1]._s())}}}class cu{constructor(){this.Ai="FreeformPattern",this.Ao={type:"disabled",packager:(t,e,i)=>t.slice()}}Qv(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}},fu=s.Record({Ao:{type:"disabled",packager:(t,e,i)=>t.slice()}});class gu extends fu{Qv(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.Aw(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.kt();return t?Math.min(i,t):i},mu=(t,e)=>{const i=e.Ct();return t?Math.max(i,t):i};class yu extends gu{_w(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(mu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(pu,e?e.min.y:void 0)}}const xu=(t,e)=>{const i=e.At();return t?Math.min(i,t):i},Su=(t,e)=>{const i=e.wt();return t?Math.max(i,t):i};class vu extends gu{_w(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(Su,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(xu,e?e.min.x:void 0)}}const bu={horizontalProgressive:new class extends yu{constructor(){super({Ao:gs()}),this.Ai="HorizontalProgressivePattern"}Aw(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].wt():void 0}getXMin(t=[],e){return t.length>0&&t[0].oo()>0?t[0].At():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",gs(du(t)))}},horizontalRegressive:new class extends yu{constructor(){super({Ao:ps()}),this.Ai="HorizontalRegressivePattern"}Aw(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].oo()>0?t[0].wt():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].At():void 0}setPrecision(t){return this.set("_columnPackaging",ps(du(t)))}},verticalProgressive:new class extends vu{constructor(){super({Ao:ms()}),this.Ai="VerticalProgressivePattern"}Aw(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].Ct():void 0}getYMin(t=[],e){return t.length>0&&t[0].oo()>0?t[0].kt():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",ms(du(t)))}},verticalRegressive:new class extends vu{constructor(){super({Ao:ys()}),this.Ai="VerticalRegressivePattern"}Aw(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].oo()>0?t[0].Ct():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].kt():void 0}setPrecision(t){return this.set("_columnPackaging",ys(du(t)))}},freeform:new cu};class Mu extends hu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g){super(t,e,i,s,r,n,o,h,bu.horizontalProgressive,a,c,d,f,g),this.Su="Step Series",this.dw=t=>{const e=this.Xv.length>0?this.Xv[this.Xv.length-1].io().length+this.Xv[this.Xv.length-1].Qn().length:void 0;La(t,e,this.tM,this.ww)},this.ww=t=>{const e=t.length;if(this.Xv.length>0){const i=this.Xv[this.Xv.length-1];if(e>0){const e=i.io(),s=i.Qn(),r=s.length>0?s[s.length-1]:e[e.length-1],n=ru([r].concat(t),this.kw);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.tM?(i.xt(o,p(u(o.x,o.y),u(o.x,o.y))).Eo(!0),this.fw(h).Lo(!0),this.pw(t)):i.xt(h)}}else e>0&&this.fw(ru(t,this.kw));this.gw(t)},this.kw=l,void 0===this.xw.find((t=>"DataPattern"===t.type))&&this.xw.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class Au extends Wa{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.Xv=[],this.Su="Line Series",this.aw=!0,this.tM=void 0,this.lw="nearest-x",this.ba=void 0,this.ud=()=>le(this.ca.getFillStyle()),this.Cw=(t,e)=>{const i=t.Xb(e);if(i)return nt(i,this.scale,this.Hr.Wi.ut)},this.Sw=(t,e)=>{const i=t.yw(e);if(i)return nt(i,this.scale,this.Hr.Wi.ut)},this.xw=c,this.Dh=f,this.ca=de(this.fs.lineSeriesStrokeStyle,d),this.Tw={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.ca="function"==typeof t?t(this.ca):t;const e=this.ca;for(let t=0;tt.va(this.ba))),this.Hr.Gi(),this}setCursorInterpolationEnabled(t){return this.aw=t,this.Hr.Wi.Gi(),this}getCursorInterpolationEnabled(){return this.aw}setCursorSolveBasis(t){return this.lw=t,this.Xv.forEach((e=>e.Jn(vs(t)))),this.Hr.Gi(),this}getCursorSolveBasis(){return this.lw}Vv(t){}iM(t){let e=this.Xv[0];e||(e=this.fw(),this.Xv.push(e),this.gu(e)),e.xt(t)}fw(){return this.Hr.Kp(this.scale,this.Tw,[Po.UserSeries,...this.xw]).ua(this.ca).va(this.ba).Jn(vs(this.lw)).zr(this.getHighlight())}attach(t,e=!0){return ae(t,this.fs,{stroke:this.ca}),super.attach(t,e)}Au(t,e){t.zr(e),this.Hr.Gi()}Qv(t,e,i,s){}Ix(t,e,i=this.aw){const s=Ha(t,e?this.Xv.filter((t=>t.getIsUnderMouse())):this.Xv,i?this.Sw:this.Cw,"nearest-x"===this.lw?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.lw?(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=nt(s[0],this.Hr.Wi.ut,this.scale),e=s[1].da();return Hh(t,this.scale,this.Rx(new Ch,this,t.x,t.y,t).Lc(),this,e instanceof tt?e.getFillStyle():void 0)}}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}}class ku extends Zl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.Iw={x:0,y:0,width:0,height:0},this.Fw={x1:0,y1:0,x2:0,y2:0},this.$n=p(u(0,0),u(0,0)),this.jr=de(r.rectangleSeriesFillStyle,n),this.Hr=t,this.FA=s,this.scale=e,this.tn=de(r.rectangleSeriesStrokeStyle,n),this.Mu=this._A(this.Hr._u(this.scale)).As(this.jr).ir(this.tn)}getBoundaries(){return this.$n}setDimensions(t){return"x"in t?(this.Iw=t,this.Fw={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.Fw=t,this.Iw={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.Mu.Cn(u(this.Iw.x,this.Iw.y)).q(u(this.Iw.width,this.Iw.height)),this.$n=Ve([this.Iw,u(this.Iw.x+this.Iw.width,this.Iw.y+this.Iw.height)]),this.FA(),this.Hr.Gi(),this}getDimensionsPositionAndSize(){return this.Iw}getDimensionsTwoPoints(){return this.Fw}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Mu.As(this.jr),this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.Mu.ir(this.tn),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}getDominantStyle(){return this.Mu._s()}}class wu extends ql{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Su="Rectangle Series",this.Rx=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.Su).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.OA=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return nt(i,this.scale,this.Hr.Wi.ut)},this.Pw=c,this.DA=new ku(this.Hr,this.scale,At,At,this.fs,this.Pw).dispose()}Vv(t){}add(t){const e=new ku(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}class Du extends Zl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.Dw=[],this.$n=De,this.Hr=t,this.scale=e,this.FA=s,this.jr=de(r.polygonSeriesFillStyle,n),this.tn=de(r.polygonSeriesStrokeStyle,n),this.pM=this._A(this.Hr.Iu(this.scale,Ys.Simple)).ir(this.tn).As(this.jr)}getBoundaries(){return this.$n}setDimensions(t){return this.Dw=t,this.pM.yo(this.Dw),this.$n=Ve(this.Dw),this.FA(),this.Hr.Gi(),this}getDimensions(){return this.Dw}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.pM.As(this.jr),this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.pM.ir(this.tn),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}getDominantStyle(){return this.pM._s()}}class Eu extends ql{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Su="Polygon Series",this.Rx=(t,e,i)=>t.addRow(e.getName()),this.OA=t=>{const e=t.getBoundaries(),i=u((e.min.x+e.max.x)/2,(e.min.y+e.max.y)/2);return nt(i,this.scale,this.Hr.Wi.ut)},this.Pw=c,this.DA=new Du(this.Hr,this.scale,At,At,this.fs,this.Pw).dispose()}Vv(t){if(!(t instanceof Ti))throw new Error("PolygonSeries can only be attached to a pair of Linear Axes.")}add(t){const e=new Du(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}class Tu extends Zl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.$n=p(u(0,0),u(0,0)),this.Cu=this._A(this.Hr.Bc(this.scale)),this.fs=r,this.Hr=t,this.scale=e,this.FA=s,this.jr=de(r.segmentSeriesStrokeStyle,n),this.Cu.ua(this.jr)}getBoundaries(){return this.$n}setDimensions(t){return this.dimensions=t,this.Cu.Sa(u(t.startX,t.startY)).ha(u(t.endX,t.endY)),this.$n=p(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.FA(),this.Hr.Gi(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Cu.ua(this.jr),this.Hr.Gi(),this}getStrokeStyle(){return this.jr}getDominantStyle(){const t=this.Cu.da();return t!==J?t.getFillStyle():B}}class Iu extends ql{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Su="Segment Series",this.Rx=(t,e,i)=>t.addRow(e.Su).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.OA=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return nt(i,this.scale,this.Hr.Wi.ut)},this.Pw=c,this.DA=new Tu(this.Hr,this.scale,At,At,this.fs,this.Pw).dispose()}Vv(t){}add(t){const e=new Tu(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}class Cu extends Zl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.$n=p(u(0,0),u(0,0)),this.Bw=this._A(this.Hr.Ou(this.scale)).la(50),this.Hr=t,this.scale=e,this.FA=s,this.jr=de(r.ellipseSeriesFillStyle,n),this.tn=de(r.ellipseSeriesStrokeStyle,n),this.Bw.As(this.jr).ir(this.tn)}getBoundaries(){return this.$n}setDimensions(t){return this.dimensions=t,this.Bw.Cn(u(t.x,t.y)).na(t.radiusX).oa(t.radiusY),this.$n=p(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.FA(),this.Hr.Gi(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.Bw.As(this.jr),this.Hr.Gi(),this}getFillStyle(){return this.jr}setStrokeStyle(t){return this.tn="function"==typeof t?t(this.tn):t,this.Bw.ir(this.tn),this.Hr.Gi(),this}getStrokeStyle(){return this.tn}getDominantStyle(){return this.Bw._s()}}class Pu extends ql{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.Su="Ellipse Series",this.Rx=(t,e,i)=>t.addRow(e.Su).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.OA=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return nt(i,this.scale,this.Hr.Wi.ut)},this.Pw=c,this.DA=new Cu(this.Hr,this.scale,At,At,this.fs,this.Pw).dispose()}Vv(t){if(!(t instanceof Ti||t instanceof Ii))throw new Error("EllipseSeries only supports Linear Axes")}add(t){const e=new Cu(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}function Ou(t,e){return t===e?0:tthis.xt(t))):this.xt(t))}Vw(t){return!!this.root&&(this.Nw(t),this.contentEquals(t,this.root.value))}Gw(t,e){return this.Ow(((i,s)=>i&&t.call(e,s)),!0)}Ww(t,e){return this.Ow(((i,s)=>{t.call(e,s)}),void 0)}M(t){if(this.root&&(this.Nw(t),this.contentEquals(t,this.root.value)))return this.root}xt(t){const e=new Ru(t);if(!this.root)return this.root=e,this.length+=1,e;if(this.Nw(t),!this.contentEquals(t,this.root.value)){const i=this.contentCompare(t,this.root.value);if(0===i)throw new Error(`SortedSet cannot contain incomparable but inequal values: ${t} and ${this.root.value}`);return i<0?(e.right=this.root,e.left=this.root.left,this.root.left=null,this.root.Rw()):(e.left=this.root,e.right=this.root.right,this.root.right=null,this.root.Rw()),e.Rw(),this.root=e,this.length+=1,e}}Hw(t){if(this.root&&(this.Nw(t),this.contentEquals(t,this.root.value))){if(this.root.left){const{right:e}=this.root;this.root=this.root.left,this.Nw(t),this.root.right=e}else this.root=this.root.right;return this.length-=1,this.root&&this.root.Rw(),!0}return!1}Uw(){if(this.root){let t=this.root;for(;t.right;)t=t.right;return t}}$w(){if(this.root){let t=this.root;for(;t.left;)t=t.left;return t}}Yw(t){if(this.root)return this.Nw(t),this.contentCompare(this.root.value,t)>0?this.root.zw():this.root}Xw(t){if(this.root)return this.Nw(t),this.contentCompare(this.root.value,t)>=0?this.root.zw():this.root}jw(t){if(this.root)return this.Nw(t),this.contentCompare(this.root.value,t)>=0?this.root:this.root.Ew()}Zw(t){if(this.root)return this.Nw(t),this.contentCompare(this.root.value,t)<=0?this.root.Ew():this.root}Kw(t){t instanceof Array?t.forEach((t=>this.xt(t))):this.xt(t)}Nw(t){let e,i,s,r,n,o;if(this.root){for(e=new Ru,i=e,s=e,o=new Ru,n=this.root;;){const e=this.contentCompare(t,n.value);if(e<0){if(!n.left)break;if(this.contentCompare(t,n.left.value)<0&&(r=n.left,n.left=r.right,n.Rw(),r.right=n,r.Rw(),n=r,!n.left))break;r=new Ru,r.right=n,r.left=o.left,o.left=r,s.left=n,s.Rw(),s=n,n=n.left}else{if(!(e>0))break;if(!n.right)break;if(this.contentCompare(t,n.right.value)>0&&(r=n.right,n.right=r.left,n.Rw(),r.left=n,r.Rw(),n=r,!n.right))break;r=new Ru,r.left=n,r.right=o.right,o.right=r,i.right=n,i.Rw(),i=n,n=n.right}}for(i.right=n.left,i.Rw(),s.left=n.right,s.Rw(),n.left=e.right,n.right=e.left;o.left;)o.left.right.Rw(),o.left=o.left.left;for(;o.right;)o.right.left.Rw(),o.right=o.right.right;n.Rw(),this.root=n}}Ow(t,e,i){return this.root&&(e=this.root.Ow(t,e,0,i,this)),e}Lw(t,e,i){return this.root&&(e=this.root.Lw(t,e,this.length-1,i,this)),e}no(){this.root=null,this.length=0}qw(t,e){let i,s=this.$w();for(;s;){const r=this.Zw(s.value);t.call(e,i?i.value:void 0,s.value,r?r.value:void 0),i=s,s=r}}Jw(t,e,i){let s,r=this.$w(),n=0;for(;r;){const o=this.Zw(r.value);e=t.call(i,e,s?s.value:void 0,r.value,o?o.value:void 0,n++,this),s=r,r=o}return e}}class zu{constructor(t,e){this.key=t,this.value=e}equals(t){return Fu(this.key,t.key)&&Fu(this.value,t.value)}compare(t){return Ou(this.key,t.key)}}class _u{constructor(t,e=Fu,i=Ou){this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new Bu(void 0,((t,i)=>e(t.key,i.key)),((t,e)=>i(t.key,e.key))),t&&(Array.isArray(t)?t.forEach((t=>this.xt(t.key,t.value))):this.xt(t.key,t.value))}M(t){const e=this.store.M(new zu(t,void 0));return e?e.value.value:void 0}S(t,e){const i=new zu(t,e),s=this.store.M(i);if(s)return s.value.value=e,s;const r=this.store.xt(i);return this.length+=1,r}xt(t,e){return this.S(t,e)}Vw(t){return this.store.Vw(new zu(t,void 0))}no(){this.store.no(),this.length=0}Ow(t,e,i){return this.store.Ow(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}Lw(t,e,i){return this.store.Lw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}Hw(t){const e=new zu(t,void 0);return!!this.store.Vw(e)&&(this.store.Hw(e),this.length--,!0)}Ww(t,e){return this.Ow(((i,s,r)=>{t.call(e,s,r)}),void 0)}Qw(t){return this.store.M(new zu(t,void 0))||void 0}qw(t,e){let i,s=this.store.$w();for(;s;){const r=this.store.Zw(s.value);t.call(e,i?i.value.value:void 0,s.value.value,r?r.value.value:void 0),i=s,s=r}}Jw(t,e,i){let s,r=this.store.$w(),n=0;for(;r;){const o=this.store.Zw(r.value);e=t.call(i,e,s?s.value.value:void 0,r.value.value,o?o.value.value:void 0,n++,this),s=r,r=o}return e}Uw(){return this.store.Uw()}$w(){return this.store.$w()}Yw(t){return this.store.Yw(new zu(t,void 0))}Xw(t){return this.store.Xw(new zu(t,void 0))}jw(t){return this.store.jw(new zu(t,void 0))}Zw(t){return this.store.Zw(new zu(t,void 0))}}const Lu={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},Gu=(t,e)=>Math.min(t,e[3]),Vu=(t,e)=>Math.max(t,e[2]),Nu=(t,e)=>{const i=t.length;if(!(i<2))return[e,t[0].y,t.reduce(vt,we),t.reduce(St,ke),t[i-1].y]},Wu=(t,e)=>{let i=[];const s=t.getDataIndices(),r=e.getDataIndices();return Array.isArray(s)?i=i.concat(s):i.push(s),Array.isArray(r)?i=i.concat(r):i.push(r),i},Hu=(t,e)=>{if(t.length>0)return e>0?t[t.length-1]:t[0]},Uu=(t,e,i)=>t.addRow(e.getName()).addRow("X","",e.axisX.formatValue(i.getPosition())).addRow("Open","",i.getOpen().toFixed(2)).addRow("High","",i.getHigh().toFixed(2)).addRow("Low","",i.getLow().toFixed(2)).addRow("Close","",i.getClose().toFixed(2));class Xu extends $l{constructor(t,i,s,r,n,o,h,a,l,u,d,f,g){super(t,i,s,r,n,o,h,a,d,f),this.Su="OHLC Series",this.tk=new _u,this.IA=p(c(ke,ke),c(we,we)),this.ik=0,this.sk=5,this.ek=Lu,this.ba=void 0,this.hk=void 0,this.rk=void 0,this.nk=!0,this.Gc=e.HighlightModes.onHover,this.Rx=Uu,this.ak=l,this.lk=u,this.ck=new this.ak(this.Hr,this.scale,At,!0,this.fs).dispose(),this.uk=new this.lk(this.Hr,this.scale,At,!1,this.fs).dispose()}Vv(t){if(!(t.x instanceof wi))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.dk=t.x}setStyle(t){return this.fk=t,this.gk(),this.Hr.Gi(),this}setPositiveStyle(t){return this.pk=t,this.gk(),this.Hr.Gi(),this}setNegativeStyle(t){return this.mk=t,this.gk(),this.Hr.Gi(),this}setFigureWidth(t){return this.sk=t,this.Hr.Gi(),this}getFigureWidth(){return this.sk}setFigureAutoFitting(t){return this.ek=t?Lu:void 0,this.Hr.Gi(),this}getFigureAutoFitting(){return void 0!==this.ek}Sk(t,e){return t-e/2<=this.scale.x.getInnerEnd()+.1*this.scale.x.getInnerInterval()&&this.scale.x.getInnerStart()-.1*this.scale.x.getInnerInterval()<=t+e/2}yk(t,e,i,s){const r=(t=>t[4]>=t[1])(t),n=new(r?this.ak:this.lk)(this.Hr,this.scale,this.AA,r,this.fs);return this.CA(n,s),this.xk(n),this.Au(n,this.getHighlight()),n.QA(t[0],t[1],t[2],t[3],t[4],e).fo(i),n}bk(t){const e=this.ik;return this.ik+=1,this.tk.S(e,t),this.nk=!0,this.P.emit("dataAdd",this,[t],void 0),e}gk(){this.kA.forEach((t=>{this.fk&&this.fk(t),t.positive&&this.pk?this.pk(t):!t.positive&&this.mk&&this.mk(t)}))}xk(t){this.fk&&this.fk(t),t.positive&&this.pk?this.pk(t):!t.positive&&this.mk&&this.mk(t)}vk(t){return t*this.dk.getPixelSize()}Mk(t){return t/this.dk.getPixelSize()}_k(t){if(!Array.isArray(t))return this.tk.M(t);if(this.tk.M(t[0])&&this.tk.M(t[t.length-1])){let e=0;const i=this.tk.M(t[0])[1];let s=we,r=ke;const n=this.tk.M(t[t.length-1])[4];for(let i=0;i1){const e=t>0?this.kA.length-1:0;this.kA[e].dispose()}let s;do{s=!1;const r=Hu(this.kA,t);if(r){const n=r.getPosition(),o=r.getDataIndices();let h,a=("number"==typeof o?o:o[t>0?o.length-1:0])+t;const l=[],u=[];for(;;){const s=this.tk.M(a);if(!s)break;if(!this.Sk(s[0],e))break;if(h){if(Math.abs(n-s[0])>=1.5*i)break;t>0?h[4]=s[4]:h[1]=s[1],h[2]=Math.max(h[2],s[2]),h[3]=Math.min(h[3],s[3])}else h=s.slice();l.push(s[0]),t>0?u.push(a):u.splice(0,0,a),a+=t}if(h){const i=t>0?void 0:0;this.yk(h,u,e,i),s=!0}}}while(s)}Qv(t){var e;if(t&&"maxDataPointCount"in t){const e=t.maxDataPointCount;if(e&&this.tk.length>e){const t=this.ik-1,i=this.tk.store.$w();if(i){for(let s=t-e;s>=i.value.key;s-=1)this.tk.Hw(s);let s=!0;this.IA.min.y=ke,this.IA.max.y=we;for(let i=1+t-e;i<=t;i+=1){const t=this.tk.M(i);t&&(this.IA.min.y=Math.min(this.IA.min.y,t[3]),this.IA.max.y=Math.max(this.IA.max.y,t[2]),s&&(this.IA.min.x=t[0],s=!1))}}}}else if(t&&"minDataPointCount"in t&&t.minDataPointCount){const i=t.minDataPointCount,s=this.scale.x.getInnerStart(),r=this.ik-1;let n=this.tk.store.$w();if(n){const t=n.value.key;let o;for(let t=n.value.key;t<=r&&!((null===(e=this.tk.M(t))||void 0===e?void 0:e[0])>=s);t+=1)o=t;if(void 0!==o&&o-t>=1e3&&this.tk.length-(o-t)>=i){for(let e=o;e>=t;e-=1)this.tk.Hw(e);n=this.tk.store.$w();let e=!0;if(this.IA.min.y=ke,this.IA.max.y=we,n)for(let t=n.value.key;t<=r;t+=1){const i=this.tk.M(t);i&&(this.IA.min.y=Math.min(this.IA.min.y,i[3]),this.IA.max.y=Math.max(this.IA.max.y,i[2]),e&&(this.IA.min.x=i[0],e=!1))}}}}return this}setDataCleaning(t){return this.ba=t,this.Hr.Gi(),this}Zm(){super.Zm(),this.Qv(this.ba);const t=this.dk.getPixelSize(),e=this.hk,i=p(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),s=this.rk,r=this.vk(this.sk),n=!s||i.max-i.min!=s.max-s.min,o=this.kA.length;if(!s||i.min>s.min)for(let t=0;t=0;t-=1){const e=this.kA[t];if(this.Sk(e.getPosition(),r))break;e.dispose()}if(0===this.kA.length&&this.tk.length>0)for(let t=0;t0){const o=this.ek?r*this.ek.minGapNew:0;if((n||!s||i.mins.max)&&(this.Ak(1,r,o),this.nk=!0),this.ek){const i=r*this.ek.maxGapFuse,s=r*this.ek.minGapSplit;if(void 0===e||t!==e||this.nk){let t,e;do{t=!1;for(let e=0;e1){const o=i.getPosition(),h=e>0?this.kA[e-1]:void 0,a=e=1.5*s)&&(!a||a.getPosition()-o>=1.5*s)){t=!0,i.dispose();const s=n.length,o=Math.round(s/2),h=n.splice(o,s-o),a=this._k(n),l=this._k(h);void 0!==a&&this.yk(a,n,r,e),void 0!==l&&this.yk(l,h,r,e+1),e+=1}}}}while(t);do{e=!1;for(let t=0;tt.getIsUnderMouse()));return t&&{location:u(t.getPosition(),t.getClose()),scale:this.scale,resultTableContent:this.Rx(new Ch,this,t).Lc(),series:this,fillStyle:t.getDominantStyle(),ohlcSegment:t}}if(i>0){const e=((t,e,i)=>{if(tthis.kA[t].getPosition()));if(void 0===e)return;const s=this.kA[e];return{location:u(s.getPosition(),s.getClose()),scale:this.scale,resultTableContent:this.Rx(new Ch,this,s).Lc(),series:this,fillStyle:s.getDominantStyle(),ohlcSegment:s}}}solveNearestFromScreen(t){return this.Ix(t,!1)}setCursorResultTableFormatter(t){return this.Rx=t,this.rl.Wi.Gi(),this}getCursorResultTableFormatter(){return this.Rx}setCursorEnabled(t){return super.setCursorEnabled(t)}clear(){return this.tk.no(),this.nk=!0,this.IA.min.x=ke,this.IA.min.y=ke,this.IA.max.x=we,this.IA.max.y=we,this.P.emit("dataClear",this),super.clear()}getXMax(){return this.IA.max.x}getXMin(){return this.IA.min.x}getYMax(){return this.IA.max.y}getYMin(){return this.IA.min.y}Jp(){return u(this.sk/2,0)}sM(){const t=[];return this.tk.Ww((e=>{t.push(e)})),t}eM(t){return this.P.on("dataAdd",t)}hM(t){return this.P.off(t)}rM(t){return this.P.on("dataClear",t)}nM(t){return this.P.off(t)}attach(t,e){return super.attach(t,e),ae(t,this.fs,{fill:this.ck.getDominantStyle(),fill2:this.uk.getDominantStyle(),behavior:{colorStep:!0}}),this}}class ju extends Xu{add(t){if(t.length>0){if(Array.isArray(t[0])){const e=t;for(let t=0;t0&&this.getVisible()}}class Yu extends Xu{constructor(){super(...arguments),this.xa=[]}oe(){return this.Gm&&(this.tk.length>0||this.xa.length>0)&&this.getVisible()}add(t){Array.isArray(t)?this.addPoints(t):this.addPoint(t);const e=this.xa[this.xa.length-1];return this.qv=e?{x:e.x,y:e.y}:void 0,this}addPoint(t){return this.xa.push(t),this.Hr.Gi(),this.IA.min.x=Math.min(this.IA.min.x,t.x),this.IA.max.x=Math.max(this.IA.max.x,t.x),this.IA.min.y=Math.min(this.IA.min.y,t.y),this.IA.max.y=Math.max(this.IA.max.y,t.y),this}addPoints(t){return t.length>0&&(this.xa=this.xa.concat(t),this.Hr.Gi(),this.IA.min.x=Math.min(this.IA.min.x,t[0].x),this.IA.max.x=Math.max(this.IA.max.x,t[t.length-1].x),this.IA.min.y=t.reduce(St,this.IA.min.y),this.IA.max.y=t.reduce(vt,this.IA.max.y)),this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.qv?this.qv.x+e:0),this.add(Va(t,e,s)),this}Zm(){if(this.Qv(this.ba),this.xa.length>0){let t;if(void 0!==this.wk)t=this.wk;else{const e=this.ek?this.ek.minGapNew:1;t=this.vk(this.sk*e)}const e=void 0!==this.kk?this.kk:this.xa[0].x,i=((t,e,i)=>{const s=[],r=[];let n=!1;for(;t.length>0;){for(let o=0;o=i+e,n){const n=Nu(r,i+e/2);void 0!==n&&(s.push(n),t.splice(0,r.length-1)),i+=e;break}}if(r.length=0,!n)break}return s})(this.xa,t,e);if(i.length>0){for(let t=0;tt.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 qu extends ql{constructor(t,e,i,s,r,n,o,h,a,l,u,c,d){super(t,e,i,s,r,n,o,h,u,c),this.Su="Box Series",this.Rx=Zu,this.OA=t=>nt(this.yu.toPoint((t.start+t.end)/2,t.median),this.scale,this.Hr.Wi.ut),this.Ck=a,this.yu=l,this.DA=new this.Ck(this.Hr,this.scale,this.AA,this.yu,0,0,0,0,0,0,0,this.fs).dispose()}Vv(t){if(!(t instanceof Ti||t instanceof Ii))throw new Error("BoxSeries only supports Linear Axes")}add(t){const e=new this.Ck(this.Hr,this.scale,this.AA,this.yu,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.fs),i=e.boundaries;return this.IA=this.IA?We(this.IA,i):i,this.Hr.Gi(),this.CA(e),e}}class Ku extends _a{constructor(){super(...arguments),this.Xv=[],this.xa=[],this.Tk=[],this.Ik=[],this.Sh=!1,this.tM=1e3,this.jv=0,this.Gc=e.HighlightModes.onHover,this.Ao={type:"disabled",packager:(t,e,i)=>t.slice()},this.aw=!0,this.Fk=[],this.Pk=[],this.Dk=!1,this.ud=()=>le(this.Bk)||le(this.Ok),this.Lk=t=>{const e=t.length;if(this.Xv.length>0){const i=this.Xv.length-1,s=this.Xv[i];if(e>0){const[e,i]=s.io(),[r,n]=s.Qn();if((r?e.length+r.length:e.length)>=this.tM){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=ni(a,o,u(t[0].position,t[0].high)).y,c=ni(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.xt(f,p(u(a,c),u(a,l))).Eo(!0),this.Rk([f].concat(t)).Lo(!0)}else s.xt(t)}}else e>0&&this.Rk(t)},this.Ek=t=>{const e=this.Fk,i=t.length;if(this.Fk.length>0){if(i>0){const i=e[e.length-1],s=i.io(),r=i.Qn();if(s.length+r.length>=this.tM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ni(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.xt(a,p(u(o,h),u(o,h))).Eo(!0),e.push(this.zk([a].concat(t),this.Jv).Lo(!0))}else i.xt(t)}}else i>0&&e.push(this.zk(t))},this.Vk=t=>{const e=this.Pk,i=t.length;if(this.Pk.length>0){if(i>0){const i=e[e.length-1],s=i.io(),r=i.Qn();if(s.length+r.length>=this.tM){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=ni(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.xt(a,p(u(o,h),u(o,h))).Eo(!0),e.push(this.Nk([a].concat(t)).Lo(!0))}else i.xt(t)}}else i>0&&e.push(this.Nk(t))},this.Gk=(t,e)=>{const i=t.Xb(e);if(i)return[nt(i[0],this.scale,this.Hr.Wi.ut),nt(i[1],this.scale,this.Hr.Wi.ut)]},this.Wk=(t,e)=>{const i=t.yw(e);if(i)return[nt(i[0],this.scale,this.Hr.Wi.ut),nt(i[1],this.scale,this.Hr.Wi.ut)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.jv=void 0!==e&&e>0?e:0,this.Hr.Gi(),this}clear(){for(let t=0;tt+e.oo()+e.ao()),this.xa.length)}setCursorInterpolationEnabled(t){return this.aw=t,this.Hr.Wi.Gi(),this}getCursorInterpolationEnabled(){return this.aw}setCursorResultTableFormatter(t){return this.Rx=t,this.rl.Wi.Gi(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.Rx}getXMax(){return Vt(this.Xv,Ft,Math.max,_t,this.Jv)}getXMin(){return Vt(this.Xv,Ot,Math.min,zt,this.Jv)}getYMax(){return Vt(this.Xv,Bt,Math.max,Gt,this.Jv)}getYMin(){return Vt(this.Xv,Rt,Math.min,Lt,this.Jv)}Jp(){const t=u(0,0);for(const e of this.Xv)t.x=Math.max(t.x,e.bo()),t.y=Math.max(t.y,e.vo());return t}oe(){return this.Gm&&this.getPointAmount()>0&&this.getVisible()}Vv(t){}Kv(t,e,i){this.xa=re(this.xa,t,{canReturnB:!1}),this.Tk=re(this.Tk,e,{canReturnB:!1}),this.Ik=re(this.Ik,i,{canReturnB:!1}),this.Hr.Gi()}Hk(t,e,i,s){this.Uk(e,i,s),this.Kv(Array.isArray(t)?t:[t],e,i)}Uk(t,e,i){const s=We(Ve(t),Ve(e));this.Jv?this.Jv=We(this.Jv,s):this.Jv=s,i&&(this.Jv=We(this.Jv,i))}Aw(){const t=this.Xv.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.Xv[this.Xv.length-1]:void 0,i=e?e.io()[0].length+(e.Qn()[0]?e.Qn()[0].length:0):void 0;La(t,i,this.tM,this.Lk)}Yk(t){const e=this.Fk.length>0?this.Fk[this.Fk.length-1].io().length+this.Fk[this.Fk.length-1].Qn().length:void 0;La(t,e,this.tM,this.Ek)}Xk(t,e){const i=this.Fk.length>0?this.Fk[this.Fk.length-1].io().length+this.Fk[this.Fk.length-1].Qn().length:void 0;La(t,i,this.tM,this.Ek),La(e,i,this.tM,this.Vk)}Rk(t,e){const i=this.Hr.jk(this.scale).xt(t,e).As(this.Bk).Bo(this.Ok).Po(this.Ao).zr(this.getHighlight());return this.Xv.push(i),this.gu(i),i}Zk(t,e,i){const s=this.Hr.Kp(this.scale,void 0,[Po.UserSeries]).xt(t,i).setMouseInteractions(!1).ua(e).zr(this.getHighlight());return this.gu(s),s}zk(t,e){return this.Zk(t,this.Kk,e)}Nk(t,e){return this.Zk(t,this.qk,e)}Jk(t){this.Bk="function"==typeof t?t(this.Bk):t;const e=this.Bk;for(let t=0;t0){const t=this.Xv.length,e=this.Aw();this.Qv(this.Xv,this.tM,this.jv,e);const i=this.Xv.length;this.Fk.length>0&&this.Qv(this.Fk,this.tM,this.jv,e),this.Pk.length>0&&this.Qv(this.Pk,this.tM,this.jv,e),t!==i&&this.Yv(),this.Dk=!0}}gc(){if(super.gc(),this.xa.length>0&&(this.$k(this.xa),this.nC(this.Tk,this.Ik),this.Dk=!0),this.Dk){const t=this.getBoundaries();for(const e of this.Xv)e.Rr(t);for(const e of this.Fk)e.Rr(t);for(const e of this.Pk)e.Rr(t)}}Zm(){this.Jv=void 0,this.xa.length=0,this.Tk.length=0,this.Ik.length=0}Ix(t,e,i=this.aw){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.Xv,i?this.Wk:this.Gk);if(void 0!==s&&void 0!==s[0]){const t=nt(s[0][0],this.Hr.Wi.ut,this.scale),e=nt(s[0][1],this.Hr.Wi.ut,this.scale);return Hh(t,this.scale,this.Rx(new Ch,this,t.x,t.y,e.y).Lc(),this,s[1]._s())}}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}}const Ju=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Position","",e.axisX.formatValue(i)).addRow("Value","",e.axisY.formatValue(s)).addRow("Base","",e.axisY.formatValue(r));class Qu extends Ku{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.Su="Area Series",this.Rx=Ju,this.oC=a}add(t){const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.aC(e),[i,s]=this.lC(t);this.Hk(t,i,s,p(u(ke,this.oC),u(we,this.oC)));const r=this.xa[this.xa.length-1];this.qv=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this.Jv)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.qv?this.qv.position+e:0),this.add(Va(t,e,s)),this}eM(t){return this.P.on("dataAdd",t)}hM(t){return this.P.off(t)}rM(t){return this.P.on("dataClear",t)}nM(t){return this.P.off(t)}}class tc extends Qu{constructor(){super(...arguments),this.qk=J}nC(t){return this.Yk(t)}lC(t){const e=t.length,i=Array(e);for(let s=0;s=n){const t=d(r.x,r.y,n);if(0!==i&&Nt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=di(u(we,n),u(ke,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}sM(){return Ga(this.Xv,(t=>t[0]||[]))}setFillStyle(t){return this.Jk(t),this}getFillStyle(){return this.tC()}attach(t,e=!0){return ae(t,this.fs,{fill:this.Bk,stroke:this.Kk}),super.attach(t,e)}}class ic extends tc{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.Bk=B,this.Ok=de(this.fs.areaSeriesNegativeFillStyle,c),this.Kk=de(this.fs.areaSeriesNegativeStrokeStyle,c)}aC(t){return this.fC(t)}fC(t){const e=[];return 1===t.length?this.uC(t[0],e):this.dC(t,e),e}uC(t,e,i=0){const s=this.oC;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}dC(t,e,i=0){let s=0;const r=t.length-1,n=this.oC;for(;sn){const t=di(u(we,n),u(ke,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&&Nt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=di(u(we,n),u(ke,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}sM(){return Ga(this.Xv,(t=>t[1]))}setFillStyle(t){return this.Qk(t),this}getFillStyle(){return this.Oo()}attach(t,e=!0){return ae(t,this.fs,{fill:this.Ok,stroke:this.Kk}),super.attach(t,e)}}class sc extends Qu{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.Bk=de(this.fs.areaSeriesBipolarHighFillStyle,c),this.Kk=de(this.fs.areaSeriesBipolarHighStrokeStyle,c),this.Ok=de(this.fs.areaSeriesBipolarLowFillStyle,c),this.qk=de(this.fs.areaSeriesBipolarLowStrokeStyle,c)}aC(t){return this.gC(t)}nC(t,e){return this.Xk(t,e)}gC(t){let e=0;const i=[],s=t.length,r=this.oC;return s>0&&(this.pC&&(this.pC.y<=r&&r<=t[0].y||this.pC.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.pC.x+t[0].x),r,r),e+=1),this.pC=t[s-1],1===s?this.uC(t[0],i,e):this.dC(t,i)),i}uC(t,e,i=0){return e[i]=d(t.x,t.y,this.oC),i+1}dC(t,e){let i=0,s=0;const r=t.length-1,n=this.oC;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:fa(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}lC(t){const e=t.length,i=Array(e),s=Array(e),r=this.oC;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.Jk(t),this}setNegativeFillStyle(t){return this.Qk(t),this}setPositiveStrokeStyle(t){return this.iC(t),this}setNegativeStrokeStyle(t){return this.sC(t),this}getPositiveFillStyle(){return this.tC()}getNegativeFillStyle(){return this.Oo()}getPositiveStrokeStyle(){return this.eC()}getNegativeStrokeStyle(){return this.hC()}attach(t,e=!0){return ae(t,this.fs,{fill:this.Bk,fill2:this.Ok,behavior:{colorStep:!0}}),super.attach(t,e)}}const rc={Positive:ec,Negative:ic,Bipolar:sc},nc=(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 oc extends Ku{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.Su="Area Range Series",this.Rx=nc;const c=u;this.Bk=de(this.fs.areaRangeSeriesFillStyle,c),this.Kk=de(this.fs.areaRangeSeriesStrokeStyle,c),this.Ok=de(this.fs.areaRangeSeriesFillStyleInverted,c),this.qk=de(this.fs.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.Hk(t,i,s);const r=this.xa[this.xa.length-1];return this.qv=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this.Jv),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.qv?this.qv.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=t.Ix(e);if(i)return nt(i,this.scale,this.Hr.Wi.ut)},this.Kb=a,this.jr=de(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ud(){return le(this.jr)}Vv(t){}attach(t,e=!0){return ae(t,this.fs,{fill:this.jr}),super.attach(t,e)}Au(t,e){t.zr(e),this.Hr.Gi()}setPointFillStyle(t){this.jr="function"==typeof t?t(this.jr):t;const e=this.jr;for(let t=0;tt.getIsUnderMouse())):this.Xv,this.mw,Be);if(void 0!==i){const t=nt(i[0],this.Hr.Wi.ut,this.scale),e=i[1]._s(),s=e instanceof G?i[0].color?new L({color:i[0].color}):new L({color:e.getFallbackColor()}):e;return Hh(t,this.scale,this.Rx(new Ch,this,t.x,t.y,t).Lc(),this,s)}}solveNearestFromScreen(t){return this.Ix(t,!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class ac{constructor(t,e,i,s){this.mC=!1,this.P=new r.Eventer,this.chart=i,this.SC=s,this.Nh=t.Nh,this.hl=s||Rr,this.yC=mt.document.createElement("div"),this.yC.style.position="absolute",this.yC.style.pointerEvents="none",mt.document.body.append(this.yC);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.yC.style.left=`${t.left}px`,this.yC.style.top=`${t.top}px`,this.yC.style.width=`${t.width}px`,this.yC.style.height=`${t.height}px`};n(),i.onResize(n),this.xC(this.yC),this.bC(),this.vC(),this.MC(),this._C(e),this.chart.AC().push(this)}xC(t){this.wC=mt.document.createElement("div"),this.wC.style.pointerEvents="all",t.append(this.wC),this.kC=mt.document.createElement("div"),this.CC=new wr(this.Nh,this.hl,this.chart,this.kC),this.TC=mt.document.createElement("table"),this.TC.style.borderSpacing="0",this.wC.appendChild(this.CC.fl()),this.wC.appendChild(this.kC),this.kC.appendChild(this.TC)}vC(){let t=0,e=0,i=0,s=0,r=!1;this.mC=!1,this.wC.onmousedown=n=>{n=n||mt.event,i=n.clientX,s=n.clientY,r=!0,mt.document.onmouseup=t=>{this.mC?this.wC.addEventListener("click",Zt,!0):this.wC.removeEventListener("click",Zt,!0),r=!1,this.mC=!1,mt.document.onmouseup=null,mt.document.onmousemove=null},mt.document.onmousemove=n=>{n=n||mt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.mC=!0,this.wC.style.top=this.wC.offsetTop-e+"px",this.wC.style.left=this.wC.offsetLeft-t+"px",this.wC.style.removeProperty("right"),this.wC.style.removeProperty("bottom"))}}}MC(){let t=0,e=0,i=0,s=0,r=!1;this.wC.ontouchstart=n=>{n=n||mt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.wC.ontouchend=()=>{r=!1,mt.document.ontouchend=null,mt.document.ontouchmove=null},this.wC.ontouchmove=n=>{r&&(Zt(n),n=n||mt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.wC.style.top=this.wC.offsetTop-e+"px",this.wC.style.left=this.wC.offsetLeft-t+"px",this.wC.style.removeProperty("right"),this.wC.style.removeProperty("bottom"))}}}bC(){this.wC.style.setProperty("top","10px"),this.wC.style.setProperty("left","10px"),this.wC.style.position="absolute",this.wC.style.display="flex",this.wC.style.alignItems="flex-start",this.kC.style.setProperty("display","none")}removePositionProperty(){this.wC.style.removeProperty("top"),this.wC.style.removeProperty("left"),this.wC.style.removeProperty("bottom"),this.wC.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.wC.style.setProperty("bottom","10px"),this.wC.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.wC.style.setProperty("top","10px"),this.wC.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.wC.style.setProperty("bottom","10px"),this.wC.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.wC.style.setProperty("top","10px"),this.wC.style.setProperty("right","10px")}}_C(t){for(let e=0;et.addRow(e.getName()).addRow("X:","",e.axisX.formatValue(i.x)).addRow("Y:","",e.axisY.formatValue(i.y)).addRow("Intensity:","",i.intensity.toFixed(1));class uc extends _a{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.Su="Heatmap Grid Series",this.Rx=lc,this.aw=!1,this.PC=a,this.fs=l;const d=c;this.jr=de(l.heatmapGridSeriesFillStyle,d),this.Fa=de(this.fs.heatmapGridSeriesWireframeStyle,d);const f=a.start||{x:0,y:0},g=a.end?{x:(a.end.x-f.x)/a.columns,y:(a.end.y-f.y)/a.rows}:a.step||{x:1,y:1},p={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows,start:f,step:g};this.Dh=p,this.DC=this.Hr.BC(this.scale,[],p).As(this.jr).Pa(this.Fa).zr(this.getHighlight()),this.gu(this.DC),this.setHighlightOnHover(!1)}clear(){return this.DC.no(),this.Hr.Gi(),this.P.emit("dataClear",this),this}setWireframeStyle(t){return this.Fa="function"==typeof t?t(this.Fa):t,this.DC.Pa(this.Fa),this.Hr.Gi(),this.P.emit("styleChange",this),this}getWireframeStyle(){return this.Fa}setCursorInterpolationEnabled(t){return this.aw=t,this.Hr.Wi.Gi(),this}getCursorInterpolationEnabled(){return this.aw}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.DC.qS(t),this.Hr.Gi(),this.P.emit("styleChange",this),this}getIntensityInterpolation(){return this.DC.JS()}oe(){return this.Gm&&this.getVisible()}ud(){return le(this.jr)}attach(t,e){return super.attach(t,e),ae(t,this.fs,{fill:this.jr}),this}OC(t){this.DC.OC().forEach((e=>{t.DC.QS(e)}))}nM(t){return this.P.off(t)}rM(t){return this.P.on("dataClear",t)}LC(t){return this.P.on("styleChange",t)}RC(t){return this.P.off(t)}Ix(t,e,i=this.aw){const s=nt(t,this.Hr.Wi.ut,this.scale),r=e?this.DC.getIsUnderMouse()?this.DC:void 0:this.DC;if(!r)return;const n=i?r.EC(s):r.Ix(s);return n?Hh(n,this.scale,this.Rx(new Ch,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).Lc(),this):void 0}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}getXMax(){const t=this.DC;return t?t.wt():void 0}getXMin(){const t=this.DC;return t?t.At():void 0}getYMax(){const t=this.DC;return t?t.Ct():void 0}getYMin(){const t=this.DC;return t?t.kt():void 0}Jp(){const t=u(0,0);return t.x=Math.max(t.x,this.DC.bo()),t.y=Math.max(t.y,this.DC.vo()),t}Vv(t){if(!(t instanceof Ti))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ti&&t.oi())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}Au(t,e){t.zr(e),this.Hr.Gi()}gc(){return super.gc(),this.DC.Rr(this.getBoundaries()),this}}class cc extends uc{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.Rx=lc}invalidateIntensityValues(t){if(Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Dh.dataOrder?t.length:t[0].length,rows:"rows"===this.Dh.dataOrder?t.length:t[0].length},i="columns"===this.Dh.dataOrder?this.Dh.columns:this.Dh.rows,s="columns"===this.Dh.dataOrder?this.Dh.rows:this.Dh.columns;if(e.x>i||e.y>s){if(!0===this.chart.uf.Gh){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Dh.columns}x${this.Dh.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.uf.Gh){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Dh.columns}x${this.Dh.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.`;mt.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.DC.QS({type:"intensity",lengthPrimary:t.values.length,lengthSecondary:t.values[0].length,startPrimary:i,startSecondary:r,values:t.values})}return this.P.emit("invalidateIntensity",this,t),this.Hr.Gi(),this}setFillStyle(t){return this.jr="function"==typeof t?t(this.jr):t,this.DC.As(this.jr),this.P.emit("styleChange",this),this.Hr.Gi(),this}getFillStyle(){return this.jr}setCursorResultTableFormatter(t){return this.Rx=t,this.rl.Wi.Gi(),this}getCursorResultTableFormatter(){return this.Rx}zC(t){return this.P.on("invalidateIntensity",t)}VC(t){return this.P.off(t)}}class dc extends _a{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.Su="Scrolling Heatmap Grid Series",this.Rx=lc,this.aw=!1;const d=c;this.jr=de(l.heatmapScrollingGridSeriesFillStyle,d),this.Fa=de(this.fs.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",start:{x:0,y:0},step:{x:1,y:1},...a};this.Dh=f;const g=[{type:"DataPattern",args:{pattern:"columns"===f.scrollDimension?f.step.x>0?"ProgressiveX":"RegressiveX":f.step.y>0?"ProgressiveY":"RegressiveY",regularProgressiveStep:!0}}];this.NC=this.Hr.GC(this.scale,g,f).As(this.jr).Pa(this.Fa).zr(this.getHighlight()),this.gu(this.NC),this.setHighlightOnHover(!1)}clear(){return this.NC.no(),this.Hr.Gi(),this}setWireframeStyle(t){return this.Fa="function"==typeof t?t(this.Fa):t,this.NC.Pa(this.Fa),this.Hr.Gi(),this}getWireframeStyle(){return this.Fa}setPixelInterpolationMode(t){return t=t||"disabled",this.NC.qS(t),this.Hr.Gi(),this}getPixelInterpolationMode(){return this.NC.JS()}setCursorInterpolationEnabled(t){return this.aw=t,this.Hr.Wi.Gi(),this}getCursorInterpolationEnabled(){return this.aw}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.NC.va(t),this.Hr.Gi(),this}oe(){return this.Gm&&this.getVisible()}ud(){return le(this.jr)}attach(t,e){return super.attach(t,e),ae(t,this.fs,{fill:this.jr}),this}As(t){return this.jr="function"==typeof t?t(this.jr):t,this.NC.As(this.jr),this.Hr.Gi(),this}Ix(t,e,i=this.aw){const s=nt(t,this.Hr.Wi.ut,this.scale),r=e?this.NC.getIsUnderMouse()?this.NC:void 0:this.NC;if(!r)return;const n=i?r.EC(s):r.Ix(s);return n?Hh(n,this.scale,this.Rx(new Ch,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).Lc(),this):void 0}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}Vv(t){if(!(t instanceof Ti))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ti&&t.oi())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.NC.wt()||0}getXMin(){return this.NC.At()||0}getYMax(){return this.NC.Ct()||0}getYMin(){return this.NC.kt()||0}Jp(){const t=u(0,0);return t.x=Math.max(t.x,this.NC.bo()),t.y=Math.max(t.y,this.NC.vo()),t}Au(t,e){t.zr(e),this.Hr.Gi()}}class fc extends dc{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.Rx=lc}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Dh.scrollDimension?t.length:t[0].length,"rows"===this.Dh.scrollDimension?t.length:t[0].length,0+i-1),r=this.Dh.resolution-1;if(s>r){if(!0===this.chart.uf.Gh){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Dh.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;mt.console.warn(t)}const s=[];for(let i=0;i(e,i)=>t.forEach((t=>t.forEach((t=>{t.ut.q(e),t.rg.q(i)})))),pc=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},mc=u(10,10);var yc;e.AxisPosition=void 0,(yc=e.AxisPosition||(e.AxisPosition={}))[yc.Top=0]="Top",yc[yc.Bottom=1]="Bottom",yc[yc.Left=2]="Left",yc[yc.Right=3]="Right";const xc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),Sc=t=>t.de(),vc=t=>t.setStopped(!0),bc=t=>t.getChartInteractionFitByDrag()?t.fit(!0).setStopped(!1):void 0,Mc=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}},Ac=(t,e)=>{const i="linear-highPrecision"===t.ps.type||"linear-highPrecision"===e.ps.type,s="logarithmic"===t.ps.type||"logarithmic"===e.ps.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.ps.type}, y: ${e.ps.type})`;throw new Error(i)}};var kc,wc,Dc;!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"}(kc||(kc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(wc||(wc={}));class Ec extends Jh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.tp("chartXY bg",0),r,i.Wi.fs.chartXYBackgroundFillStyle,i.Wi.fs.chartXYBackgroundStrokeStyle,i.Wi.fs.chartXYTitleFont,i.Wi.fs.chartXYTitleFillStyle,h),this.WC=this.Ng.d2({scaleXYConstructor:Ti}),this.HC=[],this.UC=[],this.$C=[],this.YC=[],this.XC=new Map,this.jC=!0,this.ZC=!0,this.KC=!0,this.Rd=2,this.qC=!0,this.JC=!0,this.QC=[],this.tT=this.sp._u(this.WC).As(B).ir(J).setMouseInteractions(!1),this.iT=this.sp.Bc(this.WC).ua(J).setMouseInteractions(!1),this.sT=this.sp.Bc(this.WC).ua(J).setMouseInteractions(!1),this.eT=this.fs.chartXYZoomingRectangleFillStyle,this.hT=this.fs.chartXYZoomingRectangleStrokeStyle,this.rT=this.fs.chartXYFittingRectangleFillStyle,this.nT=this.fs.chartXYFittingRectangleStrokeStyle,this.oT=e.MouseStyles.Default,this.aT=e.MouseStyles.Move,this.lT=e.MouseStyles.ZoomIn,this.cT=e.MouseStyles.Default,this.uT=void 0,this.dT=Tc,this.zv=0,this.fT=gc(this.UC,this.HC),this.gT=gc(this.$C,this.YC),this.pT=(t,e,i,s,r)=>{this.fT(s,r),this.gT(r,s),this.WC.q(s,r);const n=this.UC.map((t=>t.Tg())),o=this.HC.map((t=>t.Tg())),h=this.$C.map((t=>t.Tg())),a=this.YC.map((t=>t.Tg())),l=n.reduce(Oe,0),c=o.reduce(Oe,0),d=h.reduce(Oe,0),f=a.reduce(Oe,0),g=this.mT(d,f,c,l),p=this.WC.x.getCellSize()-(g.left+g.right),m=this.WC.y.getCellSize()-(g.bottom+g.top),y=[g.left,g.right],x=[g.bottom,g.top];this.WC.x.Z(0,p),this.WC.y.Z(0,m),this.WC.xi(y),this.WC.bi(x),this.mS.q(u(p,m));for(let t=0;t{this.XC.set(t,e)},this.Qf=t=>{this.UC.includes(t)?pc(this.UC,t):this.HC.includes(t)?pc(this.HC,t):this.$C.includes(t)?pc(this.$C,t):this.YC.includes(t)&&pc(this.YC,t),this.XC.delete(t),this.Wi.Gi()},this.yT=(t=!1)=>{const e=t=>(e,i,s,r)=>(i.gc(e,s,r.length),e+i.Tg()*t),i=this.UC.reduce(e(-1),0),s=this.HC.reduce(e(1),0),r=this.$C.reduce(e(-1),0),n=this.YC.reduce(e(1),0),o=this.mT(r,n,s,i),h=this.WC.x.getCellSize()-(o.left+o.right),a=this.WC.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.WC.x.Z(0,h),this.WC.y.Z(0,a),this.WC.x.Nt(l),this.WC.y.Nt(c);for(const t of this.UC)t.ut.Nt(l);for(const t of this.HC)t.ut.Nt(l);for(const t of this.$C)t.ut.Nt(c);for(const t of this.YC)t.ut.Nt(c);if((!this.RM||Math.abs(this.RM.bottom-i)>=4||Math.abs(this.RM.left-r)>=4||Math.abs(this.RM.right-n)>=4||Math.abs(this.RM.top-s)>=4)&&!t)return void this.yT(!0);this.RM={bottom:i,left:r,top:s,right:n},this.mS.Cn(u(0,0)).q(u(h,a)),this.SS.Cn(u(0,0)).q(u(h,a));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=m(d.ut.Gt(),f.ut.Gt(),d.ut.Ht(),f.ut.Ht());this.Zx.yy(g),this.qf.yy(g),this.Jf.yy(g),this.Og&&this.Og();const p=t=>(e,i,s,r)=>(i.Cg(e),e+i.Tg()*t);return this.UC.reduce(p(-1),0),this.HC.reduce(p(1),0),this.$C.reduce(p(-1),0),this.YC.reduce(p(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Ac(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:rc.Positive)(this,this.uS,this.Zx,e,i,this.xT(e),this.xT(i),this.Hg,s,this.fs,this.Wi.cc,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length);return this.yS(r),r},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();Ac(e,i);const s=new oc(this,this.uS,this.Zx,e,i,this.xT(e),this.xT(i),this.Hg,this.fs,this.Wi.cc,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.lS.length);return this.yS(s),s},this.bT=!1,this.vT=!1,this.Nv=()=>{(this.jC||this.ZC)&&(this.uT=this.engine.setMouseStyle(this.oT))},this.Gv=()=>{this.bT=!1,this.engine.restoreMouseStyle(this.uT)},this.Wv=(t,e,i)=>{var s,r;const n=Pt(null===(s=this.uf.Vh)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=Pt(null===(r=this.uf.Vh)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.uT);const h=this.sp.Wi.Re(e.clientX,e.clientY);i===n&&(this.jC||this.ZC)?(this.MT(t,h),Zt(e)):i===o&&this.qC&&(this.uT=this.engine.setMouseStyle(this.aT),this.vT=!0,Zt(e))},this.Um=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=Pt(null===(n=this.uf.Vh)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=Pt(null===(o=this.uf.Vh)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.jC||this.ZC)?(this._T(t,s,h),Zt(e)):i===l&&this.qC&&(this.AT(Je(r,-1)),Zt(e)),this.Wi.Gi()},this.Hv=(t,e,i,s)=>{var r,n;const o=Pt(null===(r=this.uf.Vh)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=Pt(null===(n=this.uf.Vh)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.jC||this.ZC)){const i=u(e.clientX,e.clientY);this.wT(t,s,i),Zt(e)}else i===h&&this.qC&&Zt(e);this.engine.restoreMouseStyle(this.uT),this.mS.getIsUnderMouse()&&(this.uT=this.engine.setMouseStyle(this.oT)),this.bT=!1,this.vT=!1},this.Hm=(t,e)=>{if(this.KC){const t=this.sp.Wi.Re(e.clientX,e.clientY);this.kT(t,u(fe(e),fe(e))),Zt(e)}},this.CT=(t,e,i,s)=>{},this.TT=(t,e,i,s,r,n)=>{if(this.qC){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.AT(t),Zt(n),this.vT=!0}if(this.KC){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=ti(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.dt(t.ut.ti(t.getInterval().start,-h.x),t.ut.ti(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.dt(t.ut.ti(t.getInterval().start,-h.y),t.ut.ti(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Zt(n),this.bT=!0}},this.IT=(t,e,i,s)=>{this.vT=!1,this.bT=!1},this.FT=(t,e,i)=>{(this.ZC||this.jC)&&(this.MT(t,e),Zt(i))},this.PT=(t,e,i,s,r)=>{(this.ZC||this.jC)&&(this._T(t,e,i),Zt(r))},this.DT=(t,e,i,s)=>{(this.ZC||this.jC)&&(this.wT(t,e,i),Zt(s))},this.uf.Oh||this.uf.Bh||this.Wi.Ph(0),this.setPadding({right:24}),this.IM=i.ky("chartXY series bg",kc.seriesBackground),this.BT=[kc.gridLine0,kc.gridLine1,kc.gridLine2].map((t=>i.ky(`chartXY gridline #${t}`,t))),this.qf=i.ky("chartXY highlighters below",kc.highlightersBelow),this.Zx=i.Vp("chartXY plotting",wc.plotting),this.Jf=i.Vp("chartXY highlighters above",wc.highlightersAbove),this.vf=i.Vp("chartXY fg",wc.fg),this.WC.x.Z(0,this.uiScale.x.getCellSize()-(this.Pt.left+this.Pt.right+this.pn.left+this.pn.right)),this.WC.y.Z(0,this.uiScale.y.getCellSize()-(this.Pt.bottom+this.Pt.top+this.pn.bottom+this.pn.top)),this.WC.q(this.uiScale.$t().x,this.uiScale.$t().y),this.mS=this.IM._u(this.WC).As(this.fs.chartXYSeriesBackgroundFillStyle).ir(J),this.SS=this.Jf._u(this.WC).As(B).ir(this.fs.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.pS(this.mS,this.SS),this.setSeriesBackgroundEffect(!1);const a=Pt(o?o.autoCursorBuilder:void 0,Ia);this.Tx=a.xx(this._x,this.WC,this.WC,this.fs),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.pT),this.hp.Ms("ChartXY"),this.$m=Lr(new Vr(this.FT,this.PT,this.DT,1),new Nr(this.CT,this.TT,this.IT)),this.onSeriesBackgroundMouseEnter(this.Nv),this.onSeriesBackgroundMouseLeave(this.Gv),this.onSeriesBackgroundMouseWheel(this.Hm),this.onSeriesBackgroundMouseDragStart(this.Wv),this.onSeriesBackgroundMouseDrag(this.Um),this.onSeriesBackgroundMouseDragStop(this.Hv),this.onSeriesBackgroundTouchStart(this.$m.onTouchStart),this.onSeriesBackgroundTouchMove(this.$m.onTouchMove),this.onSeriesBackgroundTouchEnd(this.$m.onTouchEnd),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Qg(n,this.WC)}getMinimumSize(){const t={x:0,y:0};t.x+=this.Pt.left+this.Pt.right+this.pn.left+this.pn.right,t.y+=this.Pt.top+this.Pt.bottom+this.pn.top+this.pn.bottom;const e=this.hp.Zs().Du(),i=v(Ic(this.dT||Tc),this.ip);t.x+=e.x+i.left+i.right,t.y+=e.y+i.top+i.bottom;const s={x:0,y:0};return this.forEachAxisX((t=>{s.x=Math.max(s.x,t.Tg())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.Tg())})),t.x+=s.x,t.y+=s.y,t.x+=mc.x,t.y+=mc.y,t}getSeries(){return this.lS}addChartMarkerXY(t=Ca,e,i){const s=this.Hg(),r=new Ba(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.zg(s),this.fs);return this.Kg(r),r}addAxisX(t){const{opposite:e,type:i}=Mc(t);let s;s="linear"===i.type?this.Ng.d1({dimension:"x",scale1DConstructor:wi}):"linear-highPrecision"===i.type?this.Ng.d1({dimension:"x",scale1DConstructor:wi}).ni():this.Ng.d1({dimension:"x",scale1DConstructor:mi}).Jt(i.base),s.q(this.WC.x.$t());const r=e?this.HC:this.UC,n=new ao(this.qf,this.BT,this.vf,this.sp,this.qf,this.Jf,this.Wi.cc,s,this.WC.y,Xl,this,e?100:0,this.Qf,this.ST,this.fs,!this.Hi,i);return r.push(n),this.Wi.Gi(),n}addAxisY(t){const{opposite:e,type:i}=Mc(t);let s;s="linear"===i.type?this.Ng.d1({dimension:"y",scale1DConstructor:wi}):"linear-highPrecision"===i.type?this.Ng.d1({dimension:"y",scale1DConstructor:wi}).ni():this.Ng.d1({dimension:"y",scale1DConstructor:mi}).Jt(i.base),s.q(this.WC.y.$t());const r=e?this.YC:this.$C,n=new ao(this.qf,this.BT,this.vf,this.sp,this.qf,this.Jf,this.Wi.cc,s,this.WC.x,jl,this,e?100:0,this.Qf,this.ST,this.fs,!this.Hi,i);return r.push(n),this.Wi.Gi(),n}dispose(){return this.IM.G(),this.Zx.G(),this.vf.G(),this.BT.forEach((t=>t.G())),this.Jf.G(),this.qf.G(),this.AC().forEach((t=>t.dispose())),po(this.WC),this.forEachAxis((t=>{t.dispose()})),this.lS.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return this.UC[0]?this.UC[0]:this.HC[0]}getDefaultAxisY(){return this.$C[0]?this.$C[0]:this.YC[0]}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):xc;return Dt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.HC;case e.AxisPosition.Bottom:return this.UC;case e.AxisPosition.Left:return this.$C;case e.AxisPosition.Right:return this.YC}})))}OT(t){let e;return this.forEachAxisX((i=>{e=t===i?"x":e})),this.forEachAxisY((i=>{e=t===i?"y":e})),e}forEachAxisX(t){this.UC.slice().forEach(t),this.HC.slice().forEach(t)}forEachAxisY(t){this.$C.slice().forEach(t),this.YC.slice().forEach(t)}setTitlePosition(t){return this.dT=t,this.Wi.Gi(),this}getTitlePosition(){return this.dT}mT(t,e,i,s){const r=this.dT||Tc;let n,o=v(Ic(r),this.ip);this.getTitleFillStyle()===B||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.hp.Zs().Du();const h=Math.abs(s)+this.pn.bottom+this.Pt.bottom,a=Math.abs(i)+this.pn.top+this.Pt.top,l={left:Math.abs(t)+this.pn.left+this.Pt.left,right:Math.abs(e)+this.pn.right+this.Pt.right,top:a,bottom:h},u=this.uiScale.wi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Cc(r,u,l,n,o,this.pn);return this.hp.Cn(f).Pn(c).Bn(d),g}gc(){super.gc();for(const t of this.lS)t.jm();for(const t of this.lS)t.gc();this.forEachAxis(Sc);let t=!1;this.forEachAxis((e=>{(e.me()||e.Se())&&(t=!0)}));const e=this.bT||this.vT||!this.JC&&t;this.Fx(e),this.yT(),super.Jg();for(const t of this.lS)t.Zm()}X(){for(let t=0;t=10;n&&a&&o.x===s.x&&this.jC?(this.bT=!0,this.tT.As(this.eT).ir(this.hT),this.iT.ua(J),this.sT.ua(J),this.uT=this.engine.setMouseStyle(this.lT,this.uT)):n&&a&&h.x===s.x&&this.ZC?(this.bT=!0,this.tT.As(this.rT).ir(this.nT),this.iT.ua(this.nT).Sa(s).ha(r),this.sT.ua(this.nT).Sa(u(s.x,r.y)).ha(u(r.x,s.y)),this.uT=this.engine.setMouseStyle(this.cT,this.uT)):(this.bT=!1,this.tT.ir(J).As(B),this.iT.ua(J),this.sT.ua(J),this.engine.restoreMouseStyle(this.uT)),this.Wi.Gi()}wT(t,e,i){if(this.bT){const t=nt(this.engine.clientLocation2Engine(i.x,i.y),this.sp.Wi.ut,this.WC),s=Re(t.x,this.WC.x.getInnerStart(),this.WC.x.getInnerEnd())&&Re(t.y,this.WC.y.getInnerStart(),this.WC.y.getInnerEnd()),r=i.x>=e.x?"zoom":"fit",n=this.tT.Tn(),o=Qe(n,this.tT.$t()),h=Math.min(this.tT.$t().x,this.tT.$t().y)>=10;s&&h&&"zoom"===r&&this.jC?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=nt(n,this.WC,t.ng).x,i=nt(o,this.WC,t.ng).x;t.dt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=nt(n,this.WC,t.ng).y,i=nt(o,this.WC,t.ng).y;t.dt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.ZC&&this.forEachAxis(bc)}this.tT.ir(J).As(B),this.iT.ua(J),this.sT.ua(J),this.Wi.Gi()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}AT(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(vc),this.forEachAxisX((i=>{i.zoom(i.ut.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ut.ot(t.y),e.y)}))}kT(t,e){this.forEachAxis(vc),this.forEachAxisX((i=>{i.getChartInteractionZoomByWheel()&&i.zoom(i.ut.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.getChartInteractionZoomByWheel()&&i.zoom(i.ut.ot(t.y),e.y)}))}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}xd(){const t=[];return this.forEachAxis((e=>e.yg((e=>t.push(e))))),super.xd().concat(t)}AC(){return this.QC}_l(){return this.np(this.Zx)}setAutoCursorEnabledDuringAxisAnimation(t){return this.JC=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this.JC}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}}e.ChartXYTitlePositionOptions=void 0,(Dc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",Dc.RightTop="right-top",Dc.LeftTop="left-top",Dc.CenterBottom="center-bottom",Dc.RightBottom="right-bottom",Dc.LeftBottom="left-bottom",Dc.SeriesCenterTop="series-center-top",Dc.SeriesRightTop="series-right-top",Dc.SeriesLeftTop="series-left-top",Dc.SeriesCenterBottom="series-center-bottom",Dc.SeriesRightBottom="series-right-bottom",Dc.SeriesLeftBottom="series-left-bottom";const Tc=e.ChartXYTitlePositionOptions.CenterTop,Ic=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 xe(0,`Unexpected ChartXY title position selection ${t}`)},Cc=(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 xe(0,`Unexpected ChartXY title position selection ${t}`)},Pc=t=>t instanceof Wa||t instanceof Qu||t instanceof oc||t instanceof cc||t instanceof Xu||t instanceof Mu;class Oc{constructor(t,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.LT=new Map,this.lS=new Map,this.RT=({series:t},e)=>{this.ET&&(e instanceof oc||e instanceof Mu||e instanceof cc||e instanceof Wa||e instanceof Qu||e instanceof Xu)&&this.ET(t,e)},this.zT=t=>{const e=t.map((t=>t.ps.type));if(1!==[...new Set(e)].length)throw new Error("All ZoomBandChart axes must be of the same type")},this.VT=(t,e,i)=>{0!==this.lS.size&&void 0!==[...this.lS.values()].find((({series:t})=>!0===t.getVisible()))||this.NT.dt(e,i,!1,!1,"zoomBandChart")},this.uf=t,this.GT=n,this.attachedAxes=Array.isArray(o)?o:[o],this.zT(this.attachedAxes);const c=this.attachedAxes[0].chart.OT(this.attachedAxes[0])||"x";this.WT=c,this.Cc="x"===c?Nl:Wl;const d=this.attachedAxes[0].onIntervalChange(this.VT);this.HT=()=>this.attachedAxes[0].offIntervalChange(d);const f=this.Cc.toVec2("linear"===(g=this.attachedAxes[0].ps).type||"linear-highPrecision"===g.type?g:{type:"logarithmic",base:"number"==typeof g.base?g.base:"e"===g.base?"e":(()=>{throw new Error(`Unhandled logarithmic base: ${g.base}`)})()},void 0);var g;const p=f.x,m=f.y;this.UT=new Ec(t,i,s,At,a,{...l,defaultAxisX:p,defaultAxisY:m},u).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.UT.engine;const y=this.UT.getDefaultAxisX().setMouseInteractions(!1),x=this.UT.getDefaultAxisY().setMouseInteractions(!1);this.NT=this.Cc.getWidth({x:y,y:x}).setScrollStrategy(Ci.fitting).setAnimationScroll(!1),this.$T(this.Cc.getHeight({x:y,y:x})),this.NT.Ls(this.attachedAxes[0].Os()),this.band=this.NT.addBand(h),this.YT(this.band,this.attachedAxes);for(let t=0;t{t.chart.wx(((t,e)=>{("x"===c?e.axisX:e.axisY)===this.attachedAxes[0]&&Pc(e)&&this.tf(e)})),t.chart.kx(((t,e)=>{var i;if(this.lS.has(e)){const t=null===(i=this.lS.get(e))||void 0===i?void 0:i.series;t&&t.dispose()}}))}))}disposeSeries(t){const e=this.lS.get(t);if(e){const{clearReferences:i}=e;i(),this.lS.delete(t),e.series.dispose();const s=this.Cc.getHeight({x:t.axisX,y:t.axisY}),r=this.LT.get(s);r&&0===r.ne().length&&r!==this.Cc.getHeight({x:this.UT.getDefaultAxisX(),y:this.UT.getDefaultAxisY()})&&(this.LT.delete(s),r.dispose())}return this}setSeriesStyle(t){return this.ET=t,this.lS.forEach(this.RT),this}getDefaultAxisX(){return this.UT.getDefaultAxisX()}getDefaultAxisY(){return this.UT.getDefaultAxisY()}$T(t){t.setTickStrategy(Pi.Empty).setMouseInteractions(!1).setNibStyle(J).setStrokeStyle(J)}YT(t,e){t.setValueStart(e[0].getInterval().start).setValueEnd(e[0].getInterval().end);let i,s,r=!1,n=!1;e.length>1&&ot(...e),e[0].onIntervalChange(((e,i,o)=>{if(r)return;n=!0;const h=mt.performance.now();s=h,t.setValueStart(i).setValueEnd(o),requestAnimationFrame((()=>requestAnimationFrame((()=>{s!==h||(n=!1)}))))})),t.onValueChange(((t,s,o)=>{if(n)return;r=!0;const h=mt.performance.now();i=h,e[0].dt(s,o,!1,!0,"zoomBandChart"),requestAnimationFrame((()=>requestAnimationFrame((()=>{i!==h||(r=!1)}))))}))}tf(t){var e;const i=this.Cc.getHeight({x:t.axisX,y:t.axisY});let s=this.LT.get(i);s||(0===this.LT.size?s=this.Cc.getHeight({x:this.UT.getDefaultAxisX(),y:this.UT.getDefaultAxisY()}):(s=this.Cc.getHeight({x:this.UT.addAxisX.bind(this.UT),y:this.UT.addAxisY.bind(this.UT)})(),this.$T(s))),this.LT.set(i,s);const r=this.Cc.getWidth({x:this.NT,y:s}),n=this.Cc.getHeight({x:this.NT,y:s});let o,h;if(t instanceof oc){o=this.UT.addAreaRangeSeries({xAxis:r,yAxis:n});const e=o;e.add(t.sM());const i=t.eM(((t,i,s)=>e.add(i))),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.hM(i),t.offVisibleStateChanged(s)}}else if(t instanceof Mu){const e=t.kw;o=this.UT.addStepSeries({mode:e,xAxis:r,yAxis:n});const i=o;i.add(t.sM());const s=t.eM(((t,e,s)=>i.add(e))),a=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.hM(s),t.offVisibleStateChanged(a)}}else if(t instanceof cc){const e={...t.PC,xAxis:void 0,yAxis:void 0},i=this.UT.addHeatmapGridSeries(e);o=i;const s=()=>{i.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};s();const r=t.LC(s);t.OC(i);const n=t.zC(((t,e)=>{i.invalidateIntensityValues(e)})),a=t.onVisibleStateChanged(((t,e)=>{i.setVisible(e)}));h=()=>{t.RC(r),t.VC(n),t.offVisibleStateChanged(a)}}else{const i={};t instanceof Au&&(i.dataPattern=null===(e=t.Dh)||void 0===e?void 0:e.dataPattern);const r=this.UT.addLineSeries({...i,xAxis:this.Cc.getWidth({x:this.NT,y:s}),yAxis:this.Cc.getHeight({x:this.NT,y:s})});if(o=r,t instanceof Xu){const e=t=>{const e=[],i=t.length;for(let s=0;s{r.add(e(i))})),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.hM(i),t.offVisibleStateChanged(s)}}else{r.add(t.sM());const e=t.eM(((t,e)=>r.add(e))),i=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.hM(e),t.offVisibleStateChanged(i)}}}t.onHighlight(((t=!0)=>{o.setHighlight(t)})),o.setMouseInteractions(!1),this.RT({series:o},t);const a=t.rM((()=>{o.clear()})),l=h;h=()=>{t.nM(a),l()},this.lS.set(t,{series:o,clearReferences:h})}Rn(t){this.UT.Rn(t)}getMinimumSize(){return this.UT.getMinimumSize()}X(){return this.UT.X()}j(){return this.UT.j()}gc(){const t=Array.from(new Set(this.attachedAxes.map((t=>t.chart))).values());if("x"===this.WT){const e=t.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.sg?t.Tg():0})),Math.max(t,i)}),0),i=t.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.sg?t.Tg():0})),Math.max(t,i)}),0),s=t.reduce(((t,e)=>Math.max(t,e.getPadding().left)),0),r=t.reduce(((t,e)=>Math.max(t,e.getPadding().right)),0);this.getDefaultAxisY().setThickness(e),this.UT.setPadding({left:s,right:r+i})}else{const e=t.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.sg?t.Tg():0})),Math.max(t,i)}),0),i=t.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.sg?t.Tg():0})),Math.max(t,i)}),0),s=t.reduce(((t,e)=>Math.max(t,e.getPadding().bottom)),0),r=t.reduce(((t,e)=>Math.max(t,e.getPadding().top)),0);this.getDefaultAxisX().setThickness(e),this.UT.setPadding({bottom:s,top:r+i})}return this.UT.gc()}getTheme(){return this.UT.getTheme()}setTitle(t){return this.UT.setTitle(t),this}getTitle(){return this.UT.getTitle()}setTitleFillStyle(t){return this.UT.setTitleFillStyle(t),this}getTitleFillStyle(){return this.UT.getTitleFillStyle()}setTitleFont(t){return this.UT.setTitleFont(t),this}getTitleFont(){return this.UT.getTitleFont()}setTitleMargin(t){return this.UT.setTitleMargin(t),this}getTitleMargin(){return this.UT.getTitleMargin()}setPadding(t){return this.UT.setPadding(t),this}getPadding(){return this.UT.getPadding()}setBackgroundFillStyle(t){return this.UT.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.UT.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.UT.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.UT.getBackgroundStrokeStyle()}addUIElement(t,e){return this.UT.addUIElement(t,e)}addLegendBox(t,e){return this.UT.addLegendBox(t,e)}saveToFile(t,e,i){return this.UT.saveToFile(t,e,i),this}dispose(){return this.UT.dispose(),this.band.dispose(),this.LT.clear(),this.lS.clear(),this.GT(this),this}onDispose(t){return this.UT.onDispose((()=>t(this)))}offDispose(t){return this.UT.offDispose(t)}}const Fc=(t,e)=>{const i=Math.floor(99999/e),s=Math.floor(99999/e),r=Math.floor(99998/e),n=Math.floor(99999/(e+1)),o=Math.floor(89999/(e+1)),h=410001+e*o;let a=0;return{XT:()=>{const e=t.jT("dashboard ui",h+a);return a+=1,e},ZT:()=>t.jT("dashboard legend",41e4),KT:e=>{const h=1+e*i,a=100001+e*s,l=200002+e*r,u=300001+e*n,c=410001+e*o;let d=0;return{Wi:t,tp:(e,i)=>{const s=h+i;return t.jT(e,s)},ky:(e,i)=>{const s=a+i;return t.jT(e,s)},Vp:(e,i)=>{const s=l+i;return t.jT(e,s)},wy:(e,i,s)=>{const r=l+i;return t.qT(e,r,s)},ep:(e,i)=>{const s=u+i;return t.jT(e,s)},Ug:e=>{const i=c+d,s=t.jT(e,i);return d+=1,s},Yg:()=>t.jT("panel legend",400002+e),Ax:()=>t.jT("panel cursor",500001+e)}}}};class Rc{constructor(t){this.P=new r.Eventer,this.u=t}S(t){return this.u=t,this.P.emit("set",t),this}M(){return this.u}R(t){return this.P.on("set",t)}N(t){return this.P.off(t,"set")}}const Bc={$i:!1,Yi:0,Xi:!1,Zi:0,ji:!1,Ki:0,qi:0,zi:Ci.fitting},zc=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))},_c=(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&&jc(t,e,u,n,o,h),"spark-bar"===a&&Yc({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Yc({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&$c(t,e,u,n,o,h),"spark-pie"===a&&Zc(t,e,u,n,o,h)},Lc=(t,e,i,s)=>({x:Vc(t.x,e.x,i.x,s),y:Nc(t.y,e.y,i.y,s)}),Gc=(t,e,i,s)=>({position:Vc(t.position,e.x,i.x,s),high:Nc(t.high,e.y,i.y,s),low:Nc(t.low,e.y,i.y,s)}),Vc=(t,e,i,s)=>{const r=wt(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Nc=(t,e,i,s)=>{const r=wt(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Wc=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Hc(a,e,i,r,n,o,h),"axis-band"===a.type&&Uc(a,i,r,n,o,h),"constant-line"===a.type&&Xc(a,i,s,r,n,o,h)},Hc=(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=Lc(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().no().so(void 0!==u?u:e.PointShape.Circle).Cs(d||0).q(c||5).As(l||h.sparkPointChartFillStyle).xt(f)},Uc=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(we,ke),f=u(we,ke);"x"===o&&(d=Lc({x:h,y:we},e,i,s),f=Lc({x:a,y:ke},e,i,s)),"y"===o&&(d=Lc({x:we,y:h},e,i,s),f=Lc({x:ke,y:a},e,i,s));const g=s[0],p=s[1],m=wt(d.x,g.x,g.x+p.x),y=wt(d.y,g.y,g.y+p.y),x=wt(f.x,g.x,g.x+p.x),S=wt(f.y,g.y,g.y+p.y);r.rect.add().uo(m).do(y).q(u(x-m,S-y)).As(l||n.sparkChartBandFillStyle).ir(c||n.sparkChartBandStrokeStyle).ir(J)},Xc=(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,p=i.x,m=[];if("y"===h&&d<=c&&c<=f){const t=Lc(u(g,c),{x:g,y:d},s,r),e=Lc(u(p,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=p){const t=Lc(u(c,d),{x:g,y:d},s,r),e=Lc(u(c,f),{x:g,y:d},s,r);m.push([t,e])}m.length>0&&n.line.add().ua(l||o.sparkChartConstantLineStrokeStyle).Sa(m[0][0]).ha(m[0][1])},jc=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Gh&&mt.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 support@lightningchart.com. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let u=ke,c=we,d=ke,f=we;for(let t=0;tLc(t,{x:u,y:d},g,i)));e.lineSet.add().zr(n).ua(o||s.sparkLineChartStrokeStyle).no().xt(p),a&&Wc(a,p,{x:u,y:d},{x:c,y:f},g,i,e,s)},Yc=(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,p=l||0,m=f/d*1;let y=ke,x=we;if(g)y=-1,x=1;else for(const t of o)y=Math.min(y,t),x=Math.max(x,t);const S={x:0,y:g?-1:Math.min(0,y)},v={x:1*o.length+(o.length-1)*m,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*m,y:g?t>=p?1:0:t},r=Lc({x:1*e+e*m,y:g?t>=p?0:-1:0},S,v,i),n=Lc(s,S,v,i);return{value:t,position:r,width:n.x-r.x,height:n.y-r.y}})).forEach((t=>{var i;e.rect.add().zr(n).Cn(t.position).po(t.height).fo(t.width).As((i=t.value,g?(i>=p?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).ir(a||s.sparkBarChartStrokeStyle)}))},$c=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Gh&&mt.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 support@lightningchart.com. To disable this warning, use LightningChartOptions.warning property (refer to API documentation for more detail).");let c=ke,f=we,g=ke,p=we;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=Lc(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 p=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.add().zr(n).Cn(d).ra(g).aa(0).ea(p).ha(p+r).As(l[i]||de(s.sparkPieChartFillStyle,i)).ir(h||s.sparkPieChartStrokeStyle),p+=r}))};var qc,Kc,Jc;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(qc||(qc={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(Kc||(Kc={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(Jc||(Jc={}));class Qc extends Hr{constructor(t,e,i,s,r){super(),this.Cl=!1,this.Iw={x:0,y:0,height:20,width:20},this.JT={x:10,y:10},this.Hr=t,this.QT=r,this.tI=new Sn(t,e,i,At,s).setMouseInteractions(!0),this.iI=t.Iu(e,Ys.Simple).As(s.dataGridScrollBarButtonArrowFillStyle).ir(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.sc(this),this.tI.onMouseEnter((t=>t.setHighlight(1))),this.tI.onMouseLeave((t=>t.setHighlight(0)))}sI(){switch(this.QT){case Jc.Up:this.iI.yo([{x:this.Iw.x,y:this.Iw.y+this.JT.y/2},{x:this.Iw.x+this.JT.x/2,y:this.Iw.y-this.JT.y/2},{x:this.Iw.x-this.JT.x/2,y:this.Iw.y-this.JT.y/2}]);break;case Jc.Down:this.iI.yo([{x:this.Iw.x-this.JT.x/2,y:this.Iw.y+this.JT.y/2},{x:this.Iw.x+this.JT.x/2,y:this.Iw.y+this.JT.y/2},{x:this.Iw.x,y:this.Iw.y-this.JT.y/2}]);break;case Jc.Left:this.iI.yo([{x:this.Iw.x-this.JT.x/2,y:this.Iw.y},{x:this.Iw.x+this.JT.x/2,y:this.Iw.y+this.JT.y/2},{x:this.Iw.x+this.JT.x/2,y:this.Iw.y-this.JT.y/2}]);break;case Jc.Right:this.iI.yo([{x:this.Iw.x-this.JT.x/2,y:this.Iw.y+this.JT.y/2},{x:this.Iw.x+this.JT.x/2,y:this.Iw.y},{x:this.Iw.x-this.JT.x/2,y:this.Iw.y-this.JT.y/2}])}}Cn(t){return this.Iw.x=t.x,this.Iw.y=t.y,this}Tn(){return u(this.Iw.x,this.Iw.y)}q(t){return this.Iw.height=t.x,this.Iw.width=t.y,this}$t(){return{x:this.Iw.height,y:this.Iw.width}}onMouseDown(t){return this.tI.onMouseDown(t)}onMouseUp(t){return this.tI.onMouseUp(t)}setFillStyle(t){return this.tI.setFillStyle(t),this}getFillStyle(){return this.tI.getFillStyle()}setStrokeStyle(t){return this.tI.setStrokeStyle(t),this}getStrokeStyle(){return this.tI.getStrokeStyle()}gc(){return this.tI.gc(),this.sI(),this}Zs(){return this.tI.setSize(u(this.Iw.height,this.Iw.width)).setPosition(u(this.Iw.x,this.Iw.y)),this}setVisible(t){return this.tI.setVisible(t),this.iI.setVisible(t),this}dispose(){return this.tI.dispose(),this.iI.dispose(),this}setMouseInteractions(t){return this.tI.setMouseInteractions(t),this}getMouseInteractions(){return this.tI.getMouseInteractions()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}getHighlight(){return this.tI.getHighlight()}setHighlight(t){return this.tI.setHighlight(ye(t)),this.P.emit("highlight",Boolean(t)),this.Hr.Gi(),this}}const td=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class ed{constructor(t,i,s,n,o,h,a){this.Lu={x:0,y:0},this.Iw={x:0,y:0,height:0,width:0},this.P=new r.Eventer,this.eI={min:u(0,0),max:u(0,0)},this.Mv=!1,this._v=!1,this.hI={x:0,y:0},this.rc=void 0,this.rI=u(0,0),this.nI={x:0,y:0},this.oI=0,this.aI=15,this.Av=(t,i)=>{this.Mv=!0,this.vf.Gi();const s=this.lI.getDraggingMode();this.rc=this.vf.Wi.Oe(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.cI&&clearInterval(this.cI)},this.wv=()=>{this.Mv=!1,this.vf.Gi(),this.vf.Wi.Le(this.rc)},this.kv=t=>(this._v=!0,this.hI=nt(this.vf.Wi.Re(t.x,t.y),this.vf.Wi.ut,this.scale),!0),this.uI=(t,e)=>(this.dI(e),this.cI=setInterval((()=>this.dI(e)),300),!0),this.fI=()=>(clearInterval(this.cI),!0),this.Cv=(t,i)=>{const s=this.lI.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=nt(this.vf.Wi.Re(t.x,t.y),this.vf.Wi.ut,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?td(n.x,this.scale.x):this.Iw.x,r!==e.UIDraggingModes.onlyHorizontal?td(n.y,this.scale.y):this.Iw.y),h=u(o.x-this.hI.x,o.y-this.hI.y),a=u(this.lI.getPosition().x+h.x,this.lI.getPosition().y+h.y),l=this.gI(a),c={x:Math.abs(this.rI.x-l.x),y:Math.abs(this.rI.y-l.y)};return this.pI(c),this.nI.y>h.y&&(this.hI=n),this.gc(),!0}return!1},this.Tv=(t,e)=>{this._v=!1,Zt(e),this.vf.Gi()},this.vf=t,this.Eg=i,this.scale=n,this.contentScale=o,this.mI=a,this.SI=new Qc(t,s,n,h,a===qc.UpToDown?Jc.Up:Jc.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.yI=new Qc(t,s,n,h,a===qc.UpToDown?Jc.Down:Jc.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.lI=new Sn(t,s,n,At,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===qc.UpToDown?e.UIDraggingModes.onlyVertical:a===qc.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.xI=new Sn(i,s,n,At,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.lI.onMouseEnter(this.Av),this.lI.onMouseLeave(this.wv),this.lI.onMouseDragStart(((t,e)=>this.kv(u(e.clientX,e.clientY))&&Zt(e))),this.lI.onMouseDrag(((t,e)=>this.Cv(u(e.clientX,e.clientY))&&Zt(e))),this.lI.onMouseDragStop(this.Tv),this.lI.onTouchStart(((t,e)=>this.kv(u(e.clientX,e.clientY))&&Zt(e))),this.lI.onTouchMove(((t,e)=>this.Cv(u(e.clientX,e.clientY))&&Zt(e))),this.lI.onTouchEnd(this.Tv),this.SI.onMouseDown(((t,e)=>this.uI(t,e)&&Zt(e))),this.yI.onMouseDown(((t,e)=>this.uI(t,e)&&Zt(e))),this.SI.onMouseUp(((t,e)=>this.fI()&&Zt(e))),this.yI.onMouseUp(((t,e)=>this.fI()&&Zt(e))),this.xI.onMouseWheel(((t,e)=>this.bI(e))),this.lI.onMouseWheel(((t,e)=>this.bI(e))),this.xI.onMouseDown(((t,e)=>this.uI(t,e)&&Zt(e))),this.xI.onMouseUp(((t,e)=>this.fI()&&Zt(e)))}vI(t){return this.Iw=t,this}fo(t){return this.Iw.width=t,this}iw(){return this.Iw.width}MI(t){return this.rI=t,this}_I(t){return this.Lu=t,this}AI(){return this.Lu}wI(t){return this.aI=t,this}kI(){return this.mI}CI(t){let e;switch(this.mI){case qc.UpToDown:return e=t>0?Math.min(this.rI.y-this.eI.max.y,this.nI.y+t):Math.max(0,this.nI.y+t),e!==this.nI.y&&(this.pI({x:0,y:e}),this.gc(),!0);case qc.LeftToRight:return e=Math.min(this.eI.max.x-this.rI.x,this.nI.x+t),e!==this.nI.x&&(this.pI({y:0,x:e}),this.gc(),!0);default:return!1}}TI(t){let e;switch(this.mI){case qc.UpToDown:return e=Math.max(0,this.nI.y-t),e!==this.nI.y&&(this.pI({x:0,y:e}),this.gc(),!0);case qc.LeftToRight:return e=t>0?Math.max(0,this.nI.x-t):Math.min(this.eI.max.x-this.rI.x,this.nI.x-t),e!==this.nI.x&&(this.pI({x:e,y:0}),this.gc(),!0);default:return!0}}II(t){switch(this.mI){case qc.UpToDown:return this.P.on("scrollY",t);case qc.LeftToRight:return this.P.on("scrollX",t)}return this.P.on("scrollY",t)}gI(t){switch(this.mI){case qc.UpToDown:if(t.y>this.eI.min.y)return u(t.x,this.eI.min.y);if(t.ythis.eI.max.x)return u(this.eI.max.x,t.y)}return t}bI(t){t.deltaY>0&&this.FI()&&Zt(t),t.deltaY<0&&this.DI()&&Zt(t)}dI(t){const e=nt(this.vf.Wi.Re(t.clientX,t.clientY),this.vf.Wi.ut,this.scale);let i;const s=this.lI.getPosition(),r=this.lI.getSize();this.BI(e,s,r)?clearInterval(this.cI):(i=this.mI===qc.UpToDown?u(0,e.y-s.y>0?this.aI:-this.aI):u(s.x-e.x>0?this.aI:-this.aI,0),(i.x>0||i.y>0)&&this.OI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.LI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}BI(t,e,i){return this.mI===qc.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.Iw.height?Math.min(this.rI.y-this.eI.max.y,this.nI.y+t):0,e!==this.nI.y&&(this.pI({x:0,y:e}),this.gc(),!0)}case qc.LeftToRight:{const e=Math.min(this.eI.max.x-this.rI.x,this.nI.x+t);return e!==this.nI.x&&(this.pI({y:0,x:e}),this.gc(),!0)}default:return!1}}DI(){return this.OI(this.aI)}FI(){return this.LI(this.aI)}pI(t){if(t.x===this.nI.x&&t.y===this.nI.y)return;let e;switch(this.nI=t,this.mI){case qc.UpToDown:e=this.nI.y*this.oI*this.contentScale.wi().y,this.P.emit("scrollY",Kc.Vertical,e),this.vf.Wi.Gi();break;case qc.LeftToRight:e=this.nI.x*this.oI*this.contentScale.wi().x,this.P.emit("scrollX",Kc.Horizontal,e)}}setVisible(t){return this.SI.setVisible(t),this.yI.setVisible(t),this.xI.setVisible(t),this.lI.setVisible(t),this}dispose(){return this.SI.dispose(),this.yI.dispose(),this.xI.dispose(),this.lI.dispose(),this.cI&&clearInterval(this.cI),this}Zs(){switch(this.EI(),this.zI(),this.mI){case qc.UpToDown:this.SI.Cn({x:this.Iw.x,y:this.Iw.y+this.Iw.height-this.SI.$t().x/2}).q(u(this.Iw.width,this.Iw.width)).Zs(),this.yI.Cn({x:this.Iw.x,y:this.Iw.y+10}).q(u(this.Iw.width,this.Iw.width)).Zs(),this.xI.setSize({x:this.Iw.width,y:this.Iw.height-2*this.SI.$t().x}).setPosition({x:this.Iw.x,y:this.Iw.y+this.yI.$t().y+this.xI.getSize().y/2}),this.lI.setSize(u(this.Iw.width,this.VI())),this.rI={x:this.Iw.x,y:this.SI.Tn().y-this.SI.$t().y/2-this.lI.getSize().y/2},this.RI({min:{x:this.Iw.x,y:this.SI.Tn().y-this.SI.$t().y/2-this.lI.getSize().y/2},max:{x:this.Iw.x,y:this.yI.Tn().y+this.yI.$t().x/2+this.lI.getSize().y/2}});break;case qc.LeftToRight:this.SI.Cn({x:this.Iw.x,y:this.Iw.y}).q(u(this.Iw.height,this.Iw.height)).Zs(),this.yI.Cn({x:this.Iw.x+this.Iw.width-this.yI.$t().x,y:this.Iw.y}).q(u(this.Iw.height,this.Iw.height)).Zs(),this.xI.setSize({y:this.Iw.height,x:this.Iw.width-2*this.SI.$t().y}).setPosition({x:this.Iw.x+this.SI.$t().x/2+this.xI.getSize().x/2,y:this.Iw.y}),this.lI.setSize(u(this.VI(),this.Iw.height)),this.rI={x:this.SI.Tn().x+this.SI.$t().x/2+this.lI.getSize().x/2,y:this.Iw.y},this.RI({min:{x:this.SI.Tn().x+this.SI.$t().x/2+this.lI.getSize().x/2,y:this.Iw.y},max:{x:this.yI.Tn().x-this.yI.$t().x/2-this.lI.getSize().x/2,y:this.Iw.y}})}return this.NI(),this}EI(){switch(this.mI){case qc.UpToDown:this.GI()||this.setVisible(!1),this.GI()&&this.setVisible(!0);break;case qc.LeftToRight:this.WI()||this.setVisible(!1),this.WI()&&this.setVisible(!0)}}zI(){switch(this.mI){case qc.UpToDown:this.GI()||this.pI({x:0,y:0});break;case qc.LeftToRight:this.WI()||this.pI({x:0,y:0})}}GI(){return this.Lu.x>this.Iw.height}WI(){return this.Lu.y>this.Iw.width}VI(){switch(this.mI){case qc.UpToDown:return this.Iw.height*(this.Iw.height-2*this.SI.$t().x)/this.Lu.x;case qc.LeftToRight:return this.Iw.width*(this.Iw.width-2*this.SI.$t().y)/this.Lu.y;default:return 0}}NI(){switch(this.mI){case qc.UpToDown:this.oI=(this.Lu.x-this.Iw.height)/(this.eI.min.y-this.eI.max.y);break;case qc.LeftToRight:this.oI=(this.Lu.y-this.Iw.width)/(this.eI.max.x-this.eI.min.x)}}gc(){switch(this.SI.gc(),this.yI.gc(),this.xI.gc(),this.mI){case qc.UpToDown:this.lI.setPosition({x:this.Iw.x,y:this.SI.Tn().y-this.SI.$t().y/2-this.lI.getSize().y/2-this.nI.y}).gc();break;case qc.LeftToRight:this.lI.setPosition({y:this.Iw.y,x:this.SI.Tn().x+this.SI.$t().x/2+this.lI.getSize().x/2+this.nI.x}).gc()}return this}}class id{constructor(t,e,i,s,r,n,o){switch(this.vf=t,this.Eg=e,this.scale=s,this.contentScale=r,o){case Kc.Vertical:this.HI=this.UI(i,n,qc.UpToDown);break;case Kc.Horizontal:this.$I=this.UI(i,n,qc.LeftToRight);break;case Kc.Both:this.HI=this.UI(i,n,qc.UpToDown),this.$I=this.UI(i,n,qc.LeftToRight)}this.YI=Lr(new Vr(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.$I)||void 0===n?void 0:n.TI(s.x))&&Zt(r),0!==s.y&&(null===(o=this.HI)||void 0===o?void 0:o.CI(s.y))&&Zt(r)})))}UI(t,e,i){return new ed(this.vf,this.Eg,t,this.scale,this.contentScale,e,i)}iw(){return 20}_I(t){var e,i;return null===(e=this.HI)||void 0===e||e._I(t),null===(i=this.$I)||void 0===i||i._I(t),this}XI(t){var e;return null===(e=this.$I)||void 0===e||e.wI(t),this}jI(t){var e;return null===(e=this.HI)||void 0===e||e.wI(t),this}ZI(t){const e=this.HI;return e&&e.bI(t),this}KI(t){return this.YI.onTouchStart(this,t),this}qI(t){return this.YI.onTouchMove(this,t),this}JI(t){return this.YI.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.$I)||void 0===e||e.II(t),null===(i=this.HI)||void 0===i||i.II(t),this}dispose(){var t,e;return null===(t=this.HI)||void 0===t||t.dispose(),null===(e=this.$I)||void 0===e||e.dispose(),this}gc(){var t,e;return null===(t=this.HI)||void 0===t||t.gc(),null===(e=this.$I)||void 0===e||e.gc(),this}Zs(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.HI)||void 0===t||t.vI({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.$I)||void 0===e||e.vI({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.HI)||void 0===i||i.Zs(),null===(s=this.$I)||void 0===s||s.Zs(),this}}const sd=s.Record({width:void 0,height:void 0,QI:void 0,tF:At,iF:At});class rd extends sd{constructor(t,e,i,s){super({...s,QI:t,tF:e,iF:i})}dispose(){return this.iF(this),this}setWidth(t){const e=this.set("width",t);return this.tF(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.tF(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.tF(i),i}$t(){if(!this.QI)return{x:0,y:0};const t=this.QI.width,e=this.QI.height,i=this.width,s=this.height;return"number"==typeof i&&"number"==typeof s?{x:i,y:s}:"number"==typeof i?{x:i,y:e*i/t}:"number"==typeof s?{x:t*s/e,y:s}:{x:t,y:e}}}var nd;e.ImageFitMode=void 0,(nd=e.ImageFitMode||(e.ImageFitMode={}))[nd.Fill=0]="Fill",nd[nd.Fit=1]="Fit",nd[nd.Stretch=2]="Stretch",nd[nd.Center=3]="Center",nd[nd.Tile=4]="Tile";const od=s.Record({source:void 0,surroundingColor:A(0,0,0,0),sourceMissingColor:A(0,0,0,0),fitMode:e.ImageFitMode.Fill});class hd extends od{constructor(t){super(t),this.type="fillstyle"}setSource(t){return this.set("source",t)}getSource(){return this.get("source")}setSurroundingColor(t){return t instanceof M?this.set("surroundingColor",t):this.set("surroundingColor",t(this.get("surroundingColor")))}getSurroundingColor(){return this.get("surroundingColor")}setSourceMissingColor(t){return t instanceof M?this.set("sourceMissingColor",t):this.set("sourceMissingColor",t(this.get("sourceMissingColor")))}getSourceMissingColor(){return this.get("sourceMissingColor")}setFitMode(t){return this.set("fitMode",t)}getFitMode(){return this.get("fitMode")}}class ad extends xo{constructor(t,e,i,s,r,n){super(t,e,i,e.tp("dataGrid bg",0),s,e.Wi.fs.dataGridBackgroundFillStyle,e.Wi.fs.dataGridBackgroundStrokeStyle,e.Wi.fs.dataGridTitleFont,e.Wi.fs.dataGridTitleFillStyle,n),this.sF=[],this.eF=[],this.hF=[],this.rF=new Map,this.nF=!0,this.oF=!0,this.aF=!0,this.lF=!0,this.cF=!0,this.uF=!0,this.dF=!0,this.fF=!0,this.gF=!0,this.pF=!0,this.mF=!0,this.SF=!0,this.yF=!0,this.xF=!0,this.bF=!0,this.vF=!0,this.MF=new Set,this._F=new Set,this.AF=!0,this.wF=!0,this.kF=(t,e)=>{t.borders=void 0===e?fd:{...t.borders,...e},this.CF(t),this.SF=!0,this.Wi.Gi()},this.CF=t=>{t.borders&&(!1===t.borders.top&&this.TF(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.IF,bottom:!1}})),!1===t.borders.bottom&&this.TF(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.IF,top:!1}})),!1===t.borders.left&&this.TF(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.IF,right:!1}})),!1===t.borders.right&&this.TF(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.IF,left:!1}})),!0===t.borders.top&&this.TF(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.IF,bottom:!0}})),!0===t.borders.bottom&&this.TF(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.IF,top:!0}})),!0===t.borders.left&&this.TF(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.IF,right:!0}})),!0===t.borders.right&&this.TF(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.IF,left:!0}})))},this.FF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseEnter,i,e)},this.PF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseLeave,i,e)},this.DF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseClick,i,e)},this.BF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseDoubleClick,i,e)},this.OF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseDown,i,e)},this.LF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseUp,i,e)},this.RF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseMove,i,e)},this.EF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseDrag,i,e)},this.zF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseDragStart,i,e)},this.VF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ld.cellMouseDragStop,i,e)},this.NF=(t,e)=>{const i=this.rF.get(t);i&&(this.P.emit(ld.cellMouseWheel,i,e),!e.defaultPrevented&&this.AF&&this.GF.ZI(e))},this.WF=(t,e)=>{const i=this.rF.get(t);i&&(this.P.emit(ld.cellTouchStart,i,e),!e.defaultPrevented&&this.wF&&this.GF.KI(e))},this.HF=(t,e)=>{const i=this.rF.get(t);i&&(this.P.emit(ld.cellTouchMove,i,e),!e.defaultPrevented&&this.wF&&this.GF.qI(e))},this.UF=(t,e)=>{const i=this.rF.get(t);i&&(this.P.emit(ld.cellTouchEnd,i,e),!e.defaultPrevented&&this.wF&&this.GF.JI(e))},this.uf.Bh||this.uf.Lh||this.Wi.Ph(2),this.hp.Ms("Data Grid"),this.$F=i.d2({scaleXYConstructor:Ti}),this.$F.x.ig=Bc,this.YF=i.d2({scaleXYConstructor:Ti}),this.XF={x:0,y:0},this.jF=this.fs.dataGridTextFont,this.ZF=this.fs.dataGridTextFillStyle,this.IF={top:!0,bottom:!0,left:!0,right:!0},this.KF=this.fs.dataGridCellBackgroundFillStyle,this.qF=this.fs.dataGridBorderStrokeStyle,this.JF="left-center",this.QF={left:5,right:5,bottom:5,top:5},this.tP=e.ky("dataGrid grid bg",0),this.iP=e.ky("dataGrid cell bg",1),this.sP=e.Vp("dataGrid cell content",0),this.eP=e.Vp("dataGrid scrollbar bg",1),this.hP=e.Vp("dataGrid scrollbar fg",2),this.GF=this.rP(),this.onBackgroundMouseWheel(((t,e)=>{this.AF&&this.GF.ZI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.wF&&this.GF.KI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.wF&&this.GF.qI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.wF&&this.GF.JI(e)})),this.nP=this.tP._u(this.$F).As(this.fs.dataGridBackgroundFillStyle).ir(J).setMouseInteractions(!1),this.oP=this.sP.wg(this.$F).setMouseInteractions(!1),this.aP=new qo((()=>this.iP._u(this.$F).setMouseInteractions(!0).setMouseEnterEventHandler(this.FF).setMouseLeaveEventHandler(this.PF).setMouseClickEventHandler(this.DF).setMouseDoubleClickEventHandler(this.BF).setMouseDownEventHandler(this.OF).setMouseUpEventHandler(this.LF).setMouseMoveEventHandler(this.RF).setMouseDragEventHandler(this.EF).setMouseDragStartEventHandler(this.zF).setMouseDragStopEventHandler(this.VF).setMouseWheelEventHandler(this.NF).setTouchStartEventHandler(this.WF).setTouchMoveEventHandler(this.HF).setTouchEndEventHandler(this.UF))),this.lP=new qo((()=>this.sP._u(this.$F).setMouseInteractions(!1))),this.cP=new qo((()=>this.sP.ye(this.$F).setMouseInteractions(!1))),this.uP=new qo((()=>this.sP.Kp(this.$F,{},[Po.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.dP=new qo((()=>this.sP.Bc(this.$F).setMouseInteractions(!1))),this.fP=new qo((()=>this.sP.aS(this.$F).setMouseInteractions(!1))),this.gP=new qo((()=>this.sP._u(this.$F).setMouseInteractions(!1))),this.pP=new qo((()=>this.sP.jk(this.$F).setMouseInteractions(!1))),this.mP=new qo((()=>this.sP.Ou(this.$F).setMouseInteractions(!1))),this.Qg(r,this.uiScale),this.onResize((()=>{this.nF=!0,this.Wi.Gi(),this.$F.q(this.pixelScale.$t()),this.YF.q(this.pixelScale.$t())})),this.SP=this.cc.Sg([this.nP])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}xd(){return[]}dispose(){return super.dispose(),this.tP.G(),this.iP.G(),this.sP.G(),this.eP.G(),this.hP.G(),po(this.$F),po(this.YF),this.GF.dispose(),this.cP.pm(),this.aP.pm(),this.lP.pm(),this.uP.pm(),this.dP.pm(),this.fP.pm(),this.gP.pm(),this.pP.pm(),this.mP.pm(),this}X(){return super.X(),this.$F.X(),this.YF.X(),this}j(){return super.j(),this.$F.j(),this.YF.j(),this}setBackgroundEffect(t){return this.SP.Is(t),this.Wi.Gi(),this}getBackgroundEffect(){return this.SP.Ps()}setInteractionScrollOnWheel(t){return this.AF=t,this}getInteractionScrollOnWheel(){return this.AF}setInteractionPanOnTouch(t){return this.wF=t,this}getInteractionPanOnTouch(){return this.wF}onCellMouseEnter(t){return this.P.on(ld.cellMouseEnter,t)}offCellMouseEnter(t){return this.P.off(t)}onCellMouseLeave(t){return this.P.on(ld.cellMouseLeave,t)}offCellMouseLeave(t){return this.P.off(t)}onCellMouseClick(t){return this.P.on(ld.cellMouseClick,t)}offCellMouseClick(t){return this.P.off(t)}onCellMouseDoubleClick(t){return this.P.on(ld.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.P.off(t)}onCellMouseDown(t){return this.P.on(ld.cellMouseDown,t)}offCellMouseDown(t){return this.P.off(t)}onCellMouseUp(t){return this.P.on(ld.cellMouseUp,t)}offCellMouseUp(t){return this.P.off(t)}onCellMouseMove(t){return this.P.on(ld.cellMouseMove,t)}offCellMouseMove(t){return this.P.off(t)}onCellMouseDrag(t){return this.P.on(ld.cellMouseDrag,t)}offCellMouseDrag(t){return this.P.off(t)}onCellMouseDragStart(t){return this.P.on(ld.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.P.off(t)}onCellMouseDragStop(t){return this.P.on(ld.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.P.off(t)}onCellMouseWheel(t){return this.P.on(ld.cellMouseWheel,t)}offCellMouseWheel(t){return this.P.off(t)}onCellTouchStart(t){return this.P.on(ld.cellTouchStart,t)}offCellTouchStart(t){return this.P.off(t)}onCellTouchMove(t){return this.P.on(ld.cellTouchMove,t)}offCellTouchMove(t){return this.P.off(t)}onCellTouchEnd(t){return this.P.on(ld.cellTouchEnd,t)}offCellTouchEnd(t){return this.P.off(t)}setGridBackgroundFillStyle(t){return this.nP.As(t),this.Wi.Gi(),this}getGridBackgroundFillStyle(){return this.nP._s()}setCellContent(t,e,i,s,r){if("number"==typeof i&&void 0!==s&&void 0!==r){const o=i,h=s,a=r;let l=[];for(let i=t;ie.column===t));return i||(i={column:t,min:void 0,max:void 0},this.eF.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.eF.splice(this.eF.indexOf(i),1):(i.min=e,i.max=e),this.uF=!0,this.Wi.Gi(),this}setRowHeight(t,e){let i=this.hF.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.hF.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.hF.splice(this.hF.indexOf(i),1):(i.min=e,i.max=e),this.uF=!0,this.Wi.Gi(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.xP(t,(t=>this.bP(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.vP(t,(t=>this.bP(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=S(i,i,i,i)),this.TF(t,e,(t=>this.bP(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=S(t,t,t,t)),this.QF={...this.QF,...t},this.MP((t=>this.bP(t,this.QF))),this}setCellBorders(t,e,i){return this.TF(t,e,(t=>this.kF(t,i))),this}setRowBorders(t,e){return this.vP(t,(t=>this.kF(t,e))),this}setColumnBorders(t,e){return this.xP(t,(t=>this.kF(t,e))),this}setCellsBorders(t){return this.IF=void 0===t?fd:t,this.MP((t=>this.kF(t,this.IF))),this}setCellsBorderStrokeStyle(t){return this.qF="function"==typeof t?t(this.qF):t,this.xF=!0,this.Wi.Gi(),this}setColumnTextFillStyle(t,e){return this.xP(t,(t=>this._P(t,e))),this}setRowTextFillStyle(t,e){return this.vP(t,(t=>this._P(t,e))),this}setCellTextFillStyle(t,e,i){return this.TF(t,e,(t=>this._P(t,i))),this}setCellsTextFillStyle(t){return this.ZF="function"==typeof t?t(this.ZF):t,this.MP((t=>this._P(t,this.ZF))),this}setColumnTextFont(t,e){return this.xP(t,(t=>this.AP(t,e))),this}setRowTextFont(t,e){return this.vP(t,(t=>this.AP(t,e))),this}setCellTextFont(t,e,i){return this.TF(t,e,(t=>this.AP(t,i))),this}setCellsTextFont(t){return this.jF="function"==typeof t?t(this.jF):t,this.MP((t=>this.AP(t,this.jF))),this}setColumnContentAlignment(t,e){return this.xP(t,(t=>this.wP(t,e))),this}setRowContentAlignment(t,e){return this.vP(t,(t=>this.wP(t,e))),this}setCellContentAlignment(t,e,i){return this.TF(t,e,(t=>this.wP(t,i))),this}setCellsContentAlignment(t){return this.JF=t,this.MP((t=>this.wP(t,this.JF))),this}setCellBackgroundFillStyle(t,e,i){return this.TF(t,e,(t=>this.kP(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.xP(t,(t=>this.kP(t,e))),this}setRowBackgroundFillStyle(t,e){return this.vP(t,(t=>this.kP(t,e))),this}setCellsBackgroundFillStyle(t){return this.KF="function"==typeof t?t(this.KF):t,this.MP((t=>this.kP(t,this.KF))),this}setCellHighlight(t,e,i){return this.TF(t,e,(t=>{t.highlight=ye(i)})),this.yF=!0,this.Wi.Gi(),this}setColumnHighlight(t,e){const i=ye(e);return this.xP(t,(t=>{t.highlight=i})),this.yF=!0,this.Wi.Gi(),this}setRowHighlight(t,e){const i=ye(e);return this.vP(t,(t=>{t.highlight=i})),this.yF=!0,this.Wi.Gi(),this}removeCell(t,e){return this.TF(t,e,(t=>this.sF.splice(this.sF.indexOf(t),1))),this.cF=!0,this.Wi.Gi(),this}removeRow(t){return this.vP(t,(t=>this.sF.splice(this.sF.indexOf(t),1))),this.sF.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.cF=!0,this.Wi.Gi(),this}removeColumn(t){return this.xP(t,(t=>this.sF.splice(this.sF.indexOf(t),1))),this.sF.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.cF=!0,this.Wi.Gi(),this}removeCells(){return this.sF.splice(0),this.cF=!0,this.Wi.Gi(),this}getColumnMax(){return 0===this.sF.length?0:this.sF.reduce(((t,e)=>Math.max(t,e.column+e.columnSpan-1)),0)}getRowMax(){return 0===this.sF.length?0:this.sF.reduce(((t,e)=>Math.max(t,e.row+e.rowSpan-1)),0)}gc(){super.gc(),So.lp(this.hp,this.ip);const t=Math.round(this.qF.L()),e=t/2;let i=this.oF||this.aF||this.lF||this.cF||this.uF||this.dF||this.mF||this.SF||this.xF||this.vF;if(i){this.sF.forEach((t=>{this._F.add(t.column)})),this.sF.forEach((t=>{this.MF.add(t.row)}));const s=this.cP.gm(),r=this.CP(e,s);s.finishPlot();const n=this.TP(this._F.size,r),o=this.IP(this.MF.size,r),h=n.reduce(Oe,0)+t,a=o.reduce(Oe,0)+t,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.FP.rowHeights.every(((t,e)=>t===o[e]));t&&e&&(i=!1)}this.FP={columnWidths:n,rowHeights:o,dataGridWidth:h,dataGridHeight:a,columnWidthsCumulative:l,rowHeightsCumulative:u,cellsContentSizes:r}}const s=i||this.aF||this.lF||this.cF||this.fF||this.gF||this.pF||this.SF||this.yF||this.xF||this.nF||this.vF;if((s||this.bF)&&this.FP){const i=this.pixelScale.getInnerIntervalPixels(),r=So.ap(this.hp,this.ip),n=[this.pn.left+e,this.pn.right+e],o=[this.pn.bottom+e,this.pn.top+r+e],h={x:i.x-n[0]-n[1],y:i.y-o[0]-o[1]},a=[this.pn.left,this.pn.right],l=[this.pn.bottom,this.pn.top+r],u={x:Math.round(i.x-a[0]-a[1]),y:Math.round(i.y-l[0]-l[1])},c={x:Math.ceil(e),y:Math.floor(u.y-e)};this.YF.xi(n).bi(o).vi(0,h.x).Mi(0,h.y),this.GF._I({x:this.FP.dataGridHeight,y:this.FP.dataGridWidth}).Zs().gc();const d={x:Math.round(this.XF.x),y:Math.round(Math.min(0,this.XF.y))};this.$F.xi(a).bi(l).vi(d.x,u.x+d.x).Mi(d.y,u.y+d.y),this.nP.Cn({x:c.x,y:c.y});const f={x:this.$F.x.Gt(),y:this.$F.y.Gt()+this.GF.iw(),width:this.$F.x.Ht()+t-this.GF.iw(),height:this.$F.y.Ht()+t};this.sP.yy(f),this.iP.yy(f),this.tP.yy(f),s&&this.PP(c,this.FP,t)}this.nF=!1,this.oF=!1,this.aF=!1,this.lF=!1,this.cF=!1,this.uF=!1,this.dF=!1,this.fF=!1,this.gF=!1,this.pF=!1,this.mF=!1,this.SF=!1,this.yF=!1,this.xF=!1,this.bF=!1,this.vF=!1}CP(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.sF){const{content:r}=t,n={...this.QF,...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.Ms(i).ks(t.textFont||this.jF).Zs().Du()}if(zc(r)&&(h=r,l={x:200,y:50}),r instanceof rd){const t=this.Wi.DP(r);t.BP()?(a=r,l=a.$t()):t.OP((()=>{this.vF=!0,this.Wi.Gi()}))}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}PP(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.nP.q(c),this.oP.ua(this.qF),this.rF.clear();const d={cellBackground:this.aP.gm(),cellIconRect:this.lP.gm(),lineSet:this.uP.gm(),line:this.dP.gm(),pointSet:this.fP.gm(),rect:this.gP.gm(),junction:this.pP.gm(),arc:this.mP.gm()},f=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:g,cellMargin:p}=i,m={column:r.column,row:r.row},y={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},x={x:y.x+p.left,y:y.y+p.bottom},S={x:x.x+g.left,y:x.y+g.bottom},v={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)},b={x:v.x-p.left-p.right,y:v.y-p.top-p.bottom},M={x:b.x-g.left-g.right,y:b.y-g.top-g.bottom};if(n){const t=dd(S,M,r.contentAlignment||this.JF);n.Cn(t[0]).Ln({x:t[1],y:t[2]}).As(this.LP(r.textFillStyle||this.ZF,r.content,this.ZF)).zr(r.highlight)}const A=this.LP(r.backgroundFillStyle||this.KF,r.content);if(A!==B){const t=d.cellBackground.add();t.Cn(y).q(v).As(A).ir(J).zr(r.highlight),this.rF.set(t,m)}const k=r.borders||this.IF;if(k&&cd(y,v,k,s,f),o){const t=S,e=M;_c(o,d,this.$F,t,e,this.fs,this.uf,r.highlight)}if(c){const t=c.$t(),i=dd(S,M,r.contentAlignment||this.JF);d.cellIconRect.add().Cn({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).As(new hd({source:c.QI,fitMode:e.ImageFitMode.Stretch})).ir(J).zr(r.highlight)}}this.oP.no();for(const t of f)this.oP.xt(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()}TP(t,e){const i=new Array(t).fill(0);for(const t of this._F.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.eF.find((e=>e.column===t)),n=r?wt(s,void 0!==r.min?r.min:we,void 0!==r.max?r.max:ke):s;i[t]=n}return i}IP(t,e){const i=new Array(t).fill(0);for(const t of this.MF.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.hF.find((e=>e.row===t)),n=r?wt(s,void 0!==r.min?r.min:we,void 0!==r.max?r.max:ke):s;i[t]=n}return i}LP(t,e,i){if(t instanceof N){try{const i=Number(e);return new L({color:t.getPalette().getColors(i)})}catch(t){}return i||B}return t}_P(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.ZF):e,this.pF=!0,this.Wi.Gi()}AP(t,e){t.textFont="function"==typeof e?e(t.textFont||this.jF):e,this.mF=!0,this.Wi.Gi()}kP(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.KF):e,this.gF=!0,this.Wi.Gi()}wP(t,e){t.contentAlignment=e,this.fF=!0,this.Wi.Gi()}bP(t,e){t.padding={...t.padding,...e},this.dF=!0,this.Wi.Gi()}yP(t,e,i){let s=this.TF(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.sF.push(s),this.lF=!0),"string"==typeof s.content||"number"==typeof s.content?this.oF=!0:this.aF=!0,this.Wi.Gi()}MP(t){this.sF.forEach((e=>t(e)))}TF(t,e,i){const s=this.sF.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}xP(t,e){const i=this.sF.filter((e=>t>=e.column&&t+1<=e.column+e.columnSpan));for(const t of i)t&&e(t)}vP(t,e){const i=this.sF.filter((e=>t>=e.row&&t+1<=e.row+e.rowSpan));for(const t of i)t&&e(t)}rP(){return new id(this.hP,this.eP,this.YF,this.YF,this.$F,this.fs,Kc.Both).onScroll(((t,e)=>{this.FP&&(t===Kc.Vertical&&(this.XF.y=-e),t===Kc.Horizontal&&(this.XF.x=e),this.bF=!0,this.Wi.Gi())})).XI(50).jI(12)}}const ld={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 ud;e.DataGridCellContentAlignmentOptions=void 0,(ud=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",ud.RightCenter="right-center",ud.LeftCenter="left-center",ud.RightTop="right-top",ud.LeftTop="left-top",ud.RightBottom="right-bottom",ud.LeftBottom="left-bottom",ud.CenterTop="center-top",ud.CenterBottom="center-bottom";const cd=(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])},dd=(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 xe(0,`Unidentified DataGrid cell content alignment option: ${i}`)},fd={top:!1,bottom:!1,left:!1,right:!1},gd=(t,e)=>e?t.x:t.y,pd=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),md=(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(gd(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&&epd(t,h,n,e))).reduce(((t,e)=>Math.max(t,gd(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>gd(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))/gd(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class yd{constructor(t,e,i,s,n){this.xe=!1,this.sF=new Array,this.P=new r.Eventer,this.RP=[],this.Pg=[],this.EP=void 0,this.zP=!0,this.VP=!0,this.NP=!0,this.GP=([t,e])=>{this.uiScale.q(t,e),this.pixelScale.q(t,e).vi(0,this.uiScale.x.getCellSize()).Mi(0,this.uiScale.y.getCellSize()),this.VP=!0,this.Wi.Gi()},this.WP=[],this.HP=t=>{for(let e=0;e{const e=this.RP.indexOf(t);e>=0&&this.RP.splice(e,1)},this.Vg=t=>{const e=this.Pg.indexOf(t);e>=0&&this.Pg.splice(e,1)},this.$P=(t,e,i,s,r)=>{if(this.YP(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.sF.push(n),this.XP(n),this.zP=!0,t}throw new lt("Out of dashboard range.")},this.jP=e.numberOfRows,this.ZP=e.numberOfColumns,this.uf=t,this.KP=e,this.qP=s;const o=this.ZP*this.jP;this.JP={x:new Rc(new Array(this.ZP).fill(1)),y:new Rc(new Array(this.jP).fill(1))},this.fs=i.fs,this.QP=this.fs.dashboardSplitterStyle,this.Hi=void 0===e.disableAnimations||!e.disableAnimations,this.tD=Fc(i,o),this.iD=i.jT("dashboard splitters",400001),this.Rv=()=>this.tD.XT(),this.$g=this.tD.ZT(),this.cc=i.cc.uc(this,{sD:{}}),this.cc.sD.Is(this.fs.effectsDashboardSplitters);const h=i.$t();this.uiScale=st.d2({scaleXYConstructor:Ti}).vi(0,100).Mi(0,100).q(h),this.pixelScale=st.d2({scaleXYConstructor:Ti}).vi(0,this.uiScale.x.getCellSize()).Mi(0,this.uiScale.y.getCellSize()).q(h),this.eD=i.hD.bind(i),this.rD=i.nD.bind(i),this.oD=i.aD.bind(i),this.lD=i.cD.bind(i),this.Kh=i.Kh.bind(i),this.Jh=i.Jh.bind(i),this.engine=i.Gg,this.Wi=i.Wg,i._r(this.GP),i.Gi(),this.uD(),this.setAnimationsEnabled(this.Hi);const a=((t,e)=>({on:t.on.bind(t,"dashboard-resize"),off:t.off.bind(t)}))(this.P);this.createChartXY=t=>{const e=xd(t,this.KP,this.Hi);return this.$P(new Ec(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=xd(t,this.KP,this.Hi);return this.$P(new Vl(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=xd(t,this.KP,this.Hi);return this.$P(new $a(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=xd(t,this.KP,this.Hi),i=e&&e.type?e.type:No;return this.$P(new i(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=xd(t,this.KP,this.Hi),i=e&&e.type?e.type:pl;return this.$P(new i(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=xd(t,this.KP,this.Hi),i=e&&e.type?e.type:rl;return this.$P(new i(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=xd(t,this.KP,this.Hi),i=t&&t.type?t.type:Al;return this.$P(new i(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=xd(t,this.KP,this.Hi);return this.$P(new mo(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=xd(t,this.KP,this.Hi);return this.$P(new Ah(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=xd(t,this.KP,this.Hi),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return this.$P(new Oc(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,e.axis,i,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=xd(t,this.KP,this.Hi);return this.$P(new Qh(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=xd(t,this.KP,this.Hi),i=new bh(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a,e);return this.$P(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=xd(t,this.KP,this.Hi),i=new ad(this.uf,this.tD.KT(this.dD(t.columnIndex,t.rowIndex)),this.fD(e,this.JP),this.HP,n,a);return this.$P(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}dD(t,e){return t+e*this.ZP}fD(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.ZP:this.jP,"x"===i.dimension?e.x:e.y),d2:i=>(new i.scaleXYConstructor).nt({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ZP,y:this.jP},e),d3:()=>new et({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.ZP,y:this.jP},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.eD(t[0]),this.rD(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.oD(t[0]),this.lD(t[1]),this}getWidth(){return this.Kh()}getHeight(){return this.Jh()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.iD.Gi(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.iD.Gi(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.fs}setSplitterStyle(t){const e=this.QP;return this.QP="function"==typeof t?t(this.QP):t,this.gD(e),this}getSplitterStyle(){return this.QP}setSplitterEffect(t){return this.cc.sD.Is(t),this.Wi.Gi(),this}getSplitterEffect(){return this.cc.sD.Ps()}setAnimationHighlight(t){return this.NP=t,this.WP.forEach((e=>this.Wi.Zh.Pe(e.line,t))),this}getAnimationHighlight(){return this.NP}gD(t){for(const t of this.WP)t.line.ua(this.QP);this.uD()}setColumnWidth(t,e){const i=this.JP.x.M();return t>=0&&t=e.length)throw new lt("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.JP.y.M();return t>=0&&t=e.length)throw new lt("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}pD(t,e,i){if(i&&Math.abs(t.x)>0)this.mD(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.SD(e,t.y)}this.P.emit("dashboard-resize");for(const t of this.sF)t.panel.j();this.Wi.Gi()}SD(t,e){const i=md(this.sF,this.JP.y.M(),t,e,this.pixelScale.$t(),!1);this.JP.y.S(i),this.VP=!0,this.Wi.Gi()}mD(t,e){const i=md(this.sF,this.JP.x.M(),t,e,this.pixelScale.$t(),!0);this.JP.x.S(i),this.VP=!0,this.Wi.Gi()}yD(){this.WP.forEach((t=>t.line.dispose())),this.WP.length=0;for(let t=1;t<=this.ZP-1;t+=1)for(let e=0;e<=this.jP-1;e+=1)if(void 0!==this.sF.find((i=>Re(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Lr(new Vr((()=>{this.xD(t)}),((e,i,s,r,n)=>{this.pD(r,t,!0),Zt(n)}),(()=>{this.bD(t)}))),s=this.iD.Bc(this.pixelScale).ua(this.QP).setMouseEnterEventHandler((()=>{this.xD(t)})).setMouseLeaveEventHandler((()=>{this.bD(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.pD(n,t,!0),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.Wi.Zh.ke(s,(t=>s.zr(t)),{animationEnabled:this.NP}),this.WP.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this.jP-1;t+=1)for(let e=0;e<=this.ZP-1;e+=1)if(void 0!==this.sF.find((i=>Re(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Lr(new Vr((()=>{this.vD(t)}),((e,i,s,r,n)=>{this.pD(r,t,!1),Zt(n)}),(()=>{this.MD(t)}))),s=this.iD.Bc(this.pixelScale).ua(this.QP).setMouseEnterEventHandler((()=>{this.vD(t)})).setMouseLeaveEventHandler((()=>{this.MD(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.pD(n,t,!1),Zt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.Wi.Zh.ke(s,(t=>s.zr(t)),{animationEnabled:this.NP}),this.WP.push({row:t,column:e,line:s,alignment:"horizontal"})}this.cc.sD.pu(this.WP.map((t=>t.line)))}_D(){const t=this.pixelScale.$t(),e=this.JP.x.M(),i=e.reduce(((t,e)=>t+e)),s=this.JP.y.M(),r=s.reduce(((t,e)=>t+e));this.WP.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.Sa(o).ha(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.Sa(o).ha(h)}}))}xD(t){this.WP.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.Wi.Zh.Ie(e.line,1),this.iD.AD(e.line))})),this.EP=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.Wi.Gi()}vD(t){this.WP.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.Wi.Zh.Ie(e.line,1),this.iD.AD(e.line))})),this.EP=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.Wi.Gi()}bD(t){this.WP.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.Wi.Zh.Ie(e.line,0)})),this.engine.restoreMouseStyle(this.EP),this.Wi.Gi()}MD(t){this.WP.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.Wi.Zh.Ie(e.line,0)})),this.engine.restoreMouseStyle(this.EP),this.Wi.Gi()}setAnimationsEnabled(t){return this.Hi=t,this.getCells().filter((t=>t.panel instanceof xo)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.Hi),this}getAnimationsEnabled(){return this.Hi}getCells(){return this.sF.slice()}dispose(){return this.xe||(this.sF.slice().forEach((t=>t.panel.dispose())),this.RP.slice().forEach((t=>t.dispose())),this.Pg.slice().forEach((t=>t.dispose())),this.xe=!0,this.qP(),this.P.emit("dispose",this)),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}saveToFile(t,e,i){return uo(this.engine,t,e,i),this}wD(){this.zP&&(this.yD(),this.zP=!1,this.VP=!0),this.VP&&(this._D(),this.VP=!1);for(const t of this.sF)t.panel.gc();return this.RP.forEach((t=>t.Zs())),this.RP.forEach((t=>t.gc())),this.Pg.forEach((t=>t.Zs())),this.Pg.forEach((t=>t.gc())),this}X(){for(const t of this.sF)t.panel.X();return this.pixelScale.x.X(),this.pixelScale.y.X(),this.uiScale.x.X(),this.uiScale.y.X(),this}j(){for(const t of this.sF)t.panel.j();return this.pixelScale.x.j(),this.pixelScale.y.j(),this.uiScale.x.j(),this.uiScale.y.j(),this}addUIElement(t=_n,e=this.uiScale){e=fo(e);const i=co(t,this.Rv(),this.uiScale,e,this.UP,this.fs);return this.RP.push(i),i}addLegendBox(t=Zn,i=this.uiScale){i=fo(i);const s=co(t,this.$g,this.uiScale,i,this.Vg,this.fs);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Pg.push(s),s}YP(t,e,i,s){return e>=0&&t>=0&&e+s<=this.jP&&t+i<=this.ZP}XP(t){const e=this.QP,i=e===J?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Rn(s)}uD(){this.uiScale.x.Nt([0,0]),this.uiScale.y.Nt([0,0]),this.pixelScale.x.Nt([0,0]),this.pixelScale.y.Nt([0,0]);for(const t of this.sF)this.XP(t);this.Wi.Gi()}}const xd=(t,e,i)=>{const s={...t,columnSpan:t.columnSpan||1,rowSpan:t.rowSpan||1,disableAnimations:void 0!==t.disableAnimations?t.disableAnimations:!i};var r,n;return s.rowIndex=(r=s.rowIndex,n=s.rowSpan,e.numberOfRows-(r+n)),s},Sd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAACXBIWXMAACxLAAAsSwGlPZapAAAE7mlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4yLWMwMDAgNzkuMWI2NWE3OSwgMjAyMi8wNi8xMy0xNzo0NjoxNCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIzLjUgKFdpbmRvd3MpIiB4bXA6Q3JlYXRlRGF0ZT0iMjAyMi0wNy0yMFQxMjowODo1OCswMzowMCIgeG1wOk1vZGlmeURhdGU9IjIwMjItMDktMDdUMTU6MDc6MjErMDM6MDAiIHhtcDpNZXRhZGF0YURhdGU9IjIwMjItMDktMDdUMTU6MDc6MjErMDM6MDAiIGRjOmZvcm1hdD0iaW1hZ2UvcG5nIiBwaG90b3Nob3A6Q29sb3JNb2RlPSIzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjIwMGQwMzM2LWEyOTktZjU0YS05MmYzLTg0NzlmNWM5MzEyMiIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDBkMDMzNi1hMjk5LWY1NGEtOTJmMy04NDc5ZjVjOTMxMjIiIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDoyMDBkMDMzNi1hMjk5LWY1NGEtOTJmMy04NDc5ZjVjOTMxMjIiPiA8eG1wTU06SGlzdG9yeT4gPHJkZjpTZXE+IDxyZGY6bGkgc3RFdnQ6YWN0aW9uPSJjcmVhdGVkIiBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOjIwMGQwMzM2LWEyOTktZjU0YS05MmYzLTg0NzlmNWM5MzEyMiIgc3RFdnQ6d2hlbj0iMjAyMi0wNy0yMFQxMjowODo1OCswMzowMCIgc3RFdnQ6c29mdHdhcmVBZ2VudD0iQWRvYmUgUGhvdG9zaG9wIDIzLjUgKFdpbmRvd3MpIi8+IDwvcmRmOlNlcT4gPC94bXBNTTpIaXN0b3J5PiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ptd9sFgAABOuSURBVHic7Zx7dFXVncc/55x77r1JIBBCSIhAkiYoQkArUhCrtrRVBHWm1WpptdbxMV1o26mOnXb6sEttq7aOVjtabWdq2/FZ2ooMY2tFK1YlgLwfCYQYkEdISEJCEu6957Hnj98+9557c8NjtY6sWfzWOuuce84++/nd399v/377XEMpBcAll1zCEFIEXGkYxidM0ywxDAPDMLISBHn4vo9SCqVU+tr3/fSR+9v3fTzPw/f9d5VSi5VSS3v6DL70qX185fN7YWCoKg0hBvx59zfZ0z+DiJk4zpffcxkNXIf0pwJeBt54X2sE44D/BD4PtOl7FcAvgWuA9uPJ7KqrrkpfR46S9gzTNH9pmuYZpmlimuYgUAFpMJmmmQaMYRj4vg9AAMbgdz7xff9GpdQS4Dql6Aw9GgZYQM9RW2aAr47WpPdN5gB3AY8DhcAS4Ebgt8g4VCGD2w+MAlJAn363DDiAALIUSOh01frcodOV6PdGAHv1vQ8AXcDBUF3G6XSTgTqddyD1+l4MOAXYg0yGglC6QmBkqIxBkh4Fy7Jyn401DGOJZVnjLctKgyofW4WPgIWUUscEqCAPANfj0oGk9RQwF+noawEDeCTvi2bo2oDGzktpP1xPxEwesbz3SWYBvwO+rH+PBc4DmhHWiABR4B912krgnxCWuxeoBTzgBeDbwBeA04A48BDwH8Bv9HsbgO8C9yOgjOp3lgI/A2YDvQh4VgBuqJ6nA+XAkwgAnwD+AvwQOBsB9+/08fhQjU0DyzTNrAeGYXwjANVQwMoFVC6YgrRyMvSRLb6ClGuQchSjhif46FkHLvzkBZ1vkWIa8LTu3EPZlRNmaj14Pnv7P4hpeHgqyu6+GRiG0m0/4eQMoFGfJwEfQgD1K0T1PA7cgoDhXgR0ceCrCGOMBq5CQHOJzuNfgGnA3cBLwFTgDgQMv0c64nbgIgRodcC5CHv6Oq/ncuo5C/gTcD0wAXgFAd9IhC0vBoYjQB5S0sCKRLJUSJFpmpdZlkUkEiGsBvMBK2wzBWnC6XzfwPMVGCoLwEqBaSjOPrWXOdPb+ci0TsrHpcBjJoovE+XhrLmEdFVP/ym82XYbnYm69E0DpZnqhARVFBmksQiguoCbgK0Iw/ybTtcC2MAmxAT4HjKwqxDmmgt8CgHNIeAfEBb7bwRohxBG8hHArQFu0GleAeYjTBSosH26rEAMBPi36zom9bs7EWa9BrgaAZ13pAan0WTbdvj+KNM0RwXAsixrEGDysVQ+UBmGQV8iwsVnrqeo0OapV2spiCZRymAgGeHSD7XwrRt2ilqzoKstwt2/ql5dEPUerq/rZ2pVP7atQIGvfOx4BVsPf4Oe5Fhs83it+/dNJiFGcT1iswTTZRRiI92PgOzbiB3WBExEwFGDgOpB/Xw3wnxjgOd1useAzyJg8BCAbEXUXZDmfuA24IvAu8A5Ov+1oXqW67p+Ved/DcJWTcBbyAT4JrDuaA0eCljKNE0ViUQGMRYMVoFiV/kYhpcFLMMwSLkRRtjbuGH+dgwjxrJ14+g+ZGFaJl7qAJfN2i3d4MO2HUX86+N1bGwpwDIVv10OhTEfwwCFwnUcPn3lAiZPHott9pNPtZ6gEgd+gcz8sHQBlwJfQwzxWxFjHoRZtiPgeAP4L8SWAlGZX0NWc1v1vX5EtYLQ9jXA13WaVQhr/ghZCH1S5/1DhLUCGQE8gADvcgRUd+ln3Qij3n8sDTYCw/n6668P3x9nmuZm27aLw4wVSLZdBYeTYKgU4OF5XuBCwFcGTduaue/6Vcw5zwUFz71UxyNL60kM9FI9aiPPfK8DTNi6Yzi3/HgKnT0mMdtZrRQzpCwpM5VyqKmp5uqrr8b3vbTBf1Lec/k7hOWqERX45lAJw+6GtMFj2/YxHQGL2bZNxC6gqyfF+RP/zDmnbcfxY5imiWVZ2LbNxs3vMO+DG5hzvguHgRRcOruV2opuWlr38pk5PTKPDFj02il09MQpjPtARqWaZnDArFkzsSzzJKj+b2UjYuBfwRFAlStDGe9pcORjLNM02d/Rx+6d6/n8R1dy1fwetu6YwBtNkzENWUW+va6REnszX79uQExAAB8KRrjMnriBFauiXDTbARcOdtmsbBzFsLiHYZh6ZZcRx3Goqamhrq4Ox3GOu2dOyl8lLfo4LhnSjxUAy7bt9DPLskgkkqxe24zT08CdN7RwzgwgCTVlbZSPPER3/wgaGzfzbutWXnygj8JiJWwVSALmn9NDaXGMgiIFJry1ZTT7DxYQt1N4nthmYVYyDIOZM2diWRaed8TFyEk5QeSIwApUXjQaxfM8du3aw8o1Wzmrags/uHU/ZeWkwy7xohT143fz0+c7Wb1qI9//4gBnTXcyvmMDMSk9qCjz+fuPHRbfbwSWravANBlk+AO4rsuECROora0Ns1UR8A1Ekf4AMSzD8jnEH/ME8PZR+qAcMYTfAX4yRJpPI36lx8leng8lBvDPiOf6Po7goT5O+SCymhuNuBQMJCLxKGL/1AHfRxYFf0tZCJwK3EMm9APSvuHIqjFLzQzpIA3bSr29PWxpfIe9e3Zzw9xmFl6+X5oUZiITqkaspqFhGBfNcrnlswOZWJ+BrEU8XbyvDxve3VPEhndKiNl+umphxvJ9n8LCwly2qkOWvYcQ52Cu3I74Y54/Soeh090KLGJoYH0FcSz+8hjyA3Ek3ou0/N5jfOdIUgD8O+J2yJXNiJP1AaSHv/03KC8sFnAn0qa7QveDCMF+neYeyITihgysGYaB4zh0dHTQ+m4ncfMA9y9s4sNnd4jNlBulcWByVQ+zptjcs7CPSFRJRAsgBo8+PYyPn51gYo2b8eJY8Nqmcg4NRCmIJhlKy0UikVyDfbI+v40sx8NiIt7nOLJcDqQAiXEpMvzZhYQwQIzUEn0dMGAE8efUIMv5XmRJ3od4ooNKGfpZQKkOstzvRmb4MOmFdNkpcqMJIiN0mUE6R+f7IAKq3QhTbyMTyjiAMEccMa7jup0HyTgxLZ13IAYy7cPUMFKnAxndbkQj1Ot+CZh6GBJemqnTDUPY/grEnwaEVoVB6EYfllLK6unppaPLYVp1Fw/d3MCHp3dIVfKF/jwYORx+dcdBJtemMqCKw7pNcW5/uJglbxRI9+qS3cMGyzdUYEcGZxhWi5WVlbmMeqY+b85Tk8AZeC0ChmJEVbQgzsmdupP+gHRwAKzvIAPXBLxIJoTShHjHi5AQyCPAdJ1Hi36nFViPOClBQiZ3AucjIPk94tTcjfiIGoGf6zzR+b2k67YH8XJvRlR0DeI9d4HPIP6slUADMnGayUy02bqMFsTrPlff/5i+Hxy7dP1v088rgNUIYIP+uRsJA72O4KRe1/123TcNul9ORQLqY8KDkB4t04qnD9u2I4qInXKjXDy9ke9e8yqnlPdlwDKEGEDVeDczT0xwEhZPvX4ew4tH8tzLNskeU0qNwNbWkTTvK84LrKPINH3OZ+9MQWaUq6u0CPHD7Edm1ItIR6aQQZ9KJrD6W/3eXIRxNur3QTr+h8CvgbN0Hi3AU8hAn46wCcAMZFfBQWQqzUZY5DfAYgTs1yNquAoB1ScQxnkMAWo5MsiXIj22mqG32UzR59eAZxCn6TQyarENAcp39PGkrt99iPe/WvdZC+JErUScqOsRAIFMxB/p/msELgD+iMRzb0FYKy1pYJUUdlNS1M3weC9Jx3Ys0+Wa85dx3YWvE4u4GZIPS4zsHQaQnc6G59+oZ3vbOD50Vh3Ne4t4eaUtZG3AK+srSTkmxlHiezkLizgSdgDYkid50MmvAxciA/YKMthfIRM8Xa1rPwkxrq9EvNQ/DYpFGCro2KeRQfkDEuUH+BbCJjfq34FqCRhkFTJghcCrCIsu0PUBMSq+iQzubcA8XccgzNKIqBw48t6tYKLdjgD2i6H80e14EgnLrACeRbbaBBH7oD+fRmy1TsTMeJbM5P2xbv8KhFWfQQBZp39nBbPTNtZXL3wUDEi5Ud7trBwbtxNWdeVuAUq+cS+EJS8VUjvOYfJEZzDwbGjeOZrnG+qxrQSWXUht7USe/OMh5s9J0t9rs6JxDNGI0Fuu0zPw7kejUSoqKsKG+wRgPGIjbMtTs3p93gxcpq+fIFPD2fq8FrFNRgHLQu+fps8b9XmWPjeG0gTAadXniaEyg+cKAf55+l4wCUydPthTdTECyPDCYDpicOxEGA1EDeUTE2FLBxlgyABlPWIn/R4Bba5sR2ypM/XvnYj9OFnXDWRChtsayAsI0xaSZxWa8bxHXGzLpSg+cNGk8c2Lqst3W2llkSsFsPiPMRbcMZJX345J1XNydVIWv1g2k0TKwjR8XNdlXGUpze21tO6ATe+UsvdAIZbpp0GVe8691jKJjJE5Ok/tApupiRy9ryVgtA2h62BWGvqe0u+DqErIAGM4Yld0ILZKOM1aRM1VI6q3DXERhMuoQNRQM5nFgE9mLAoQltuDMGl4gHP1A4jKrEFU0X59L2CwBkSlzUPU1hRk4gQM26zPZ+jzdsSQadflluj0XeSfxAmGcG1kVoUyfhaKB/EZly8xADFYv30Sd/66iFRyF29sjHGz05edxobFf5nK1l1jiNmH8X0dtPY9ho0Yz5KGNvrdMag0Ew8GVcBYsViMWCwWBlighgL18hpiL3nIkvwDyIDtQtTdFUhUfhZC8R/WHdJMZhYH7DQa6ch9yMCaZMB7D2KHbUaW3m+R8dKdqc/r9Ps2MkgKsccgw3jB7swWXU6TbtP/ICpyOLLSegux9xYhKv1zCGB2IRPARFTXRp1fIxnrNgDzZv0eCDN/UqeZHmq3gUyMPjITJZARZFbKDyL21Yscg+S6G8oQwy2/xGBN00SeeO0ipk4boKPjAKu3DNCx36KszJNuiMIOrQKjdnLQ/veiuOKVTfW4niJuu2nQwWB28jyP4cOHM2LEiPAu1BJkJispjQt15+xDBsFH7AMH2Q1wGmJn3Rh6Zxuy3A9AGLDJOKQVq8iozp8g20jmI53fqc+B7QWiUrsRVpurnweujgqEuYKwSOC6WKXrc6Ou5xn6CNg4YMifI+C+FlGhAaMaCLDG6fxW6vQ2Mo7tyArwGWRj4DSE9ZRuY69+ZxRiizWQvX0ZRP0+ijiIv4So7GMCVnp3A28bIF7d/IHGGLzdWMvPXr4QX5nEYyatra38eXkDT9/Vy/yPJSAJjmfx3Sfn0rinlKiZxMv+aALf93BchfJ9lArthMhK469WSs0I9notWLCACRMmBJ73AsSAz9WRDgKqUt3R3Tpt4IsqQlZYd+vOXoAMWBRRIZ7OdzQCjHAnlyAD2Y8MfCmiAgI1VUEG3MXITA+eVyIDGXyYEDzvROxEU5c7Rj+7D9nxeSWyigwkioDA1G03dZ4xXb8DyMCbOi+lnyudplTnE4ASRJ37utwkQ3++Uqbz6DpCmiN+THFq3jdisGpLDY+9NAdf+UQsh0TCoLKyknHja3h55Sbmf1ya/vyyejbvKqMgmsDzsr/IkUNh4ON6Dq7r4nkeiYT4MaLRaNZeL4BkMklDQwMTJkwIanOYbMderuzWZwPxr1xAxrVQhHT293WaAznvJkLvhyU3ZJTbueEwRy/ZTtvccE74eS2yeo0iE6MIUYV/QnaFhiWVU04gDhmVDAKU3HTJPPUIS277cqXjKM8HSS6w6geliEHDpmoe+cMFKOUTsVzc0HbhqVNOZfOudvz+d9jZMZrfrZhCNJIcBKgwYFzXpby8PB3knjRpEu3t7SxfvjwrLch2nm3btrFz506qqqqOZ3eDiQzQBjIzfA9iJx13tP49Eg9Zpgfsq5D6PsuRJ88JL7nAOj3rVxzWbqnkxy/Mxscnarm4KnvDXzwWIVY8mTVN7SxddxaHEwbRiJNWgfmOZDJJTU0NY8eOpbS0lPXr1zNv3jzWrVtHZ2dnVqwwCC2tWLGCqqoqjkM8/jZxuvdSWpGPRf7fSSTnui79Kw5rtpRz36JzSHk+MTuJ68lqN7xF2fM8ioYV87NlF9DVNwzbSuJ5+T9OzWWtRCLB4cOHaWtr44UXXsDVVBhmLKXUX8NaJ+V9krBfpBK0m8GG1RvHcNeTM+gbUBgqheO4OI7YRcE5ODzXof1gEb7nprcmZ21Rzvny2XGc9AeuixYt4tprr2XNmjV0d3cHn46Zud8rplIp3nzzzbwfzJ6UE0/CwKoGirDgQFfs9e89Pe1A34CBaaSygOR53iBweZ4HyskLptxVn2VZlJSU4Ps+lmXR3t7O0qVLWbhwIUDwsWsiF1i2bdPY2MiOHTuIRnM9siflRJMwsCQMYLP0zU1l89o67bWWmcJ1sxnIcZxBrDTUkctWjuNQVlbG5ZdfTl9fH0opbrrpJlauXIlSitLS0gBYr+dTo77vs3jxYnp7ewftHzspJ5aER+c8YDmKK9c2j+xTvvtwWN3lMlYYQOHfYXbKBZdSip6eHqqrq7nsssvYt28fruty8803U1xcTH9/P0qpXqXUY/kqG4lE2L9/P2vXrj3JWie4hI33Ncj/CgwoFAq1xPO8O5VS3wlWafm2DgeSG4oZ6vP7zs5OHnroIYqKimhpaSEajVJZWUlnZyf9/f0JwzC+QM4WjKwKRyI0NTVx7rnnDtobf1JOHAkD64HgIoCMUuoO13W3GIZxq2maUw3DKMj3xyBhyQesXHC1tbXheR6madLf38+WLVt6gb+YpnkX2bs+B4lhGCSTyaz/hjgpJ578LzXVOI5QBFhrAAAAAElFTkSuQmCC",vd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAgCAYAAADwkoGKAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5goDBwssgK9G3QAAEq5JREFUeNrtnHtsFNe9xz8zsw9717s2Zv0Ib0LBJEAOIQkl0Eua3Ju2N6LcNmracG9VqWpVqWrzb1QpUh9qm6pKpVaR2ihR1fSPKgVKm5oktzeBAMmlkIILHGxMCGAMfuHX4rV3vd7HzNw//Ju9441NTJq2AXGk0T7mzJkz5/c939/vfH9n12AW5aGHHlpqmuYi0zQjxmRxAQzDwHVdAFzXnXI4jvOu1xkOw3Ec13GctOM4nceOHeviBi1a6zrgDsABTKBVKTXwT+7TfGAt8CellCPffQRYqpTa837bDbxXhS1bttxrWdYK0zQLlmXlAFfAVQKU9+oHkWmaOI5TAp9hGFMOrwhIDaAWWLpmzZq21tbWY975tra2EFANJFevXm1f59haA8wF2uWZPqG1blZKjWmt5wEx4LxSqqi1rgXGlFIFrXUIqFBKjYrh5yqlhrXWVcBCoMd3LgpEAVMpdVlrXQPcAnQppdI+QDUBw0ACwAOVlFogqLVeDEwopfrlXqbvPjEgrJQaumZgbd26VVmWtdKyrGHLshzTNEuAmomtbNt+F5gcx5m2fcMwsG0by7IAcplMxrp8+bJatmzZ2PPPP9+1cOHCNZlMJgK8Dbg3AGnFgf1KqUExzmKgRmu9FFgGZIEmrfVeQAFdwDngE8Jwu+WalVrrd4BbgXFgqdb6mFLqMvAQEASOa60rgI8AGanzFjAKfBrIAY3AAuB4WT8rgBpgKdCgtT4MhICVwMtaawv4d+AIcG3A+sxnPlNlWdaKQCAwYlmWa5qmYZpmCSzloPLYygOSx1Z+EE1MTGBZFpZl4boupmlimiYDAwOk02mjsbHR/uxnP5vcunXrbbfeeus9uVwuHQwG32hqakrdAG6wQsZ7kdZ6DrAE6BF2aQKalVJ5rfWnxIBJwNBaVwN1QKfW2pS6F6VOVsDXKGBLC6heEhb8L6BT6iwAbgcmgLTn5rTW/wn4mcwUUB1VSp3VWi8A7gIOiWcBuAcYUkp1XrMrDAQCtwQCgVAgEJgIBAL4QeUv5THUdO4uEAiQTqeprKwsMZppmgCMjIywfPlyHnzwQdatW2c0NTXZhmHE2tvbL23atOngDRRi1Yhh4uJqssCfgbuBlFIqL/WCwkJXgNXAYuB1YI4w1xDQIXFRh9Q/JyBdCgwKqBrlfpelTrtcuxFoERCF5F7+iVsNVCqlzsrnSmHLJJDSWn9M6rz2vmKsUCgUDAQCBAIBLMsqsYtXPKbyx1KmaZaA4xXTNEmnJyfEt771LV544QWOHTvGnDlzyOfz2LbN448/zqpVq5iYmCCXyxlPP/201dzcfOEGi92XAwWl1P4yJusClmmt7xX2soB3gLC4w6NKqUsSUN8OPCPMNgrUAyMSIyWlDQ8kKTlXJyAuSqx0CdgkrnQ54Cil/MCqF/f8McCWOgeVUrbW+oqAe7tSqnC1hzVnOhEMBp1gMOgGg0FCoRChUIhgMDjl8IAXDAZL7s4DogfGSCRCR0cHn/zkJ1m/fj33338/tm0TDAbp7e1l5cqVLFmyhKGhIVKpFN/5znf49a9/7RSLxegNBqxLwNHyL5VSfcAeiWFGgZclkC4A/+OxC3AGeFEplZXPeyVOmiPXIax0StrNSrseC43J938FTgpw24D/LetSCnhZmK4C2KuU6pBzc2Ul2/NeD2vMdOIrX/nKymAwuC4QCIz5XaF/Beg4DuFwmOHhYYrFYsnV2bZNsVikurqa/fv3s2zZMp599lnGxsYIh8P8+Mc/5vjx45w9e5annnqKLVu2MD4+zo9+9CNefPFFFi1aFDMM4+iRI0fOcrN8GOLDlSKTjAL7fG77fTFWiY3KGcqyLKqqqqitraW9vZ3Kykq+/OUvE4/HyeVyGIZBIpHg5MmTDA4O8t3vfpdisUg2m8WyLD7/+c9z+vRp5s+fz/33308ul6Ojo4NDhw6xYMECAoFAaXFws3woSo8w557ZgOq9gnc8NxgIBEorQcuyqKmp4cKFC+zbt4+NGzfy2GOPUV9fT0tLC52dnTQ0NHD+/HkOHjzIs88+y5IlS+ju7sayLEZHR1mxYgX19fVs2rSpBMa//OUvZDIZbrnllnfFaTfLP7copcY8V/o3C6SWZZXA5b2PRqMUi0VeffVVWltb+epXv8rXv/51stlsaXXX0dFBX18fzc3NbNu2jc997nP09vaWAn/btslmszz99NNUVFQwMjJCoVCgpaWFaDQ6RZ64Wa7fclVgeYCqrq7Gsiw6Ozt55ZVXcF2XZ555hs2bN3P58mUKhQKhUIimpiZ2797Njh07WLRoEU8++SQjIyPYtl1yofl8nnQ6TVNTE4VCAcuyOHnyJOfPn6e6unrWoNJaN8hS/ZxS6kzZuSCwCSgCh8pU5enamgesA/4qwfR0dT4q43X4vdqT+lXAx2T5/9cPKNYJiuCZEAnBASLAWdGcNotaf/wDjrEMYIN8fEsp5frOzZeVbK9SqviewDIMA8uyqKioIJ1O09rayltvvcWGDRv4wQ9+QHV1NV1dXSWZoVgsUl9fT19fH47j8POf/5xoNEpvb28JqJ4rdV2XTCYDQDQa5ciRI+RyOaqrq7Fte7bgmidaznRAqJRUR/9sQCBa0UrRlaYbWFOAd3GW7SHSwaJrdSFXMW4t8ICIocMidHq62GkRYO8G3vo7EdBdAmBX+lMJrBJQ5WTFeHw2KR3XdV0GBwdpa2tjcHCQxx57jC9+8Yvkcjn6+/un6FqeWHrPPfdQV1fHhg0b6OubtHltbS0HDhxg586d/PSnPy1pYKFQiKGhIU6cOEEsFrvWh40Cg0D/NOfs8nSDgKNWFiyODEhWcl+VQC8Q0VoHRPO5ItfFBKRZEQgbRR+ypT1bDGwAw0opL5+ZA94Eun3AsHyr8azELuXqvDcQjtgnKcy7WTSpN4G3RcsyAEMp5Witb5XUTVZrnZDnLPVHax0Wkdbf3zFPvpA0zRy5zgRySqkrWuuIpI4ywKjv+efI8xTkc2hWrjAcDgdyuZxx7tw54vE43/jGN1i/fj2pVIpcLvcuUAEMDw/zyCOPEA6HGRwcxHGckv71y1/+kjfffJNvfvObrFq1iuHhYaqqqjh8+DDd3d0kEokZc4ozUHO1pCLSMzDQfaLjDEtaYqPM7qIYPSKz+5QMigv8q4xJUWv9tuhOd4pIOADMZzKR/KJc/28ysF4Z0VoflMTscmHUnQLqB0UXMrxZrrVuVUppeabbhRVCYvys3OMPMokWAO1KqZO+oNrl/3OocVHRbxdhtbw/q4B/ERAYAp6s1vqIUuq8uNdPyfi4gKm1PiKT5zaZpIuk7d9L/7IyEUJl6v3MwHIcx0wmkzQ1NfGFL3yBhoYGhoaGSmq7Pxbz3Jdt24RCIRzHIZ/PYxgGsViMffv2kcvlANi+fTs/+clPME2zFLS/j2C9SgZyptVKjbz2yYx7SDSYN2TwF4rRBwSkCXGpZ0Q4XC0GOgNoGehlwGExzKAANS/gHBfQ3c3kToIhmdF5ue8cmQjtwAUByjpxv1prvUhAeo7JhPuEANiS9yuFwS5eZUziUueITByvP4ulP6fl3h6jeq51NXBeQFwF/EkmyzZR4dsEOEuZzBeOSXtV8qxvSz9X+b3HjDrWxMREbt26debXvvY1amtrSSaTUwBg2zbRaJSKioop6Z1isUixOBnDVVVV0dPTw44dO1i6dCl33nknL730EhcuXKCuro6uri7a2tqoqakptTHLUi0Plpoh5omLC5kQYc8EXldKnRXVuCAzMylt1TC59aRbZu+YGCAn6Q6PGc4ppby4rV7uf0Yp1cVkohcf0OPAFWGVWjFOh1KqRyn1jhg/JQH5XWKUV5VSHUqpXpn0KR8IRr30zQwxYC2TyeWzSqlLPhBmfUp8WPpdJ+yZFRfnjaktz9Erk+q8UspjOEfavqyUcsWNt8gkqQRaZ8VYDz/8cH1DQ0Petm3Gx8ensJRt2zQ0NHD06FG2b9/OE088UYqxPGU+GAximia/+93vSgnoO+64g87OTv74xz/yxBNP0NLSwvDwMA0NDSXWm2WJy8AkpxnkChmkYVk5LQAueVtVfPmwlOS/5spMz/hWXrVAUik1IfUbgQFfvBITYF8sa7MADEqcFhcG8oCRFaAje6SqmUwiR+XaFl/7UbnmrLRZKUYfv0q8GZ+hPz0yJv8h7aTleQ0ZnyFfH8eAoFJqHGj2jUeDhALl+tawjPN7K+9tbW2h06dP39fY2LjQtu1MPp+fAirHcairq6Ojo4MvfelLbN++nZGRESKRyFTLx+O88cYbnDhxgkQiUVLeV61axfHjxxkYGODUqVOEw+EpbFX+ehVgTQB1EpSWn6uS2Z0Tmq6UVYw3u+cwuXvAy39N+Jgm5rGN1J8j342X3SNSFlfMATJKqYy0WeG7h2e0tO8eETmf933nB0qVMJAj7FoJ3CqgRWttyLN49SNljFYj16fErTcwuRdsl1LqD+Li475r5gAjAirKnivmY7b3rWM12ra9zLbtwUnPZ0wBVSwWI5VK8atf/YrR0VEcx6GlpYVt27YxNjaG67rEYjF6enpobm4uiZ6u65LL5UgkEmSzWZ5//nkGBgaIx+PXBCoZzHkyg5cA9VrrjBhCC5gSTO4kcGX3wF3Ap7XWw+LSLN9MXSzGTfuAVudL/noDsEhrvQU4KEb2YjxvVi/wgc/bDeox6kLgsi8dUi/ni0qpca11L3Cb1jou/Qj4gmMvAd0A3MvkvitbSKFCa/2iAMtbzCDgW+i7PiostUI0O0fas2VxE5SY7OR06oA3TtK/E+KqrzlXGBXjvEtKiMVijI+P84tf/IJQKMTDDz8MwOHDh0tbZ0KhEIZhsGvXLsbGxohEIti2PWWHqWVZHDhwgPHx8ZKu5e3r8h8zpTF9gfZpeT8urJOX4x0JsFFKHZLVYZ+4hgqJNTyGugKc8Yl7jrigfrk+KfpWv1xryj3e9rmBkAD1HflclEDdM1q/BMheyctq1GOB/5ZFQMrHTrYHFBGA90j7Y3JdRoBbkD6f9k2WsLz37nlSJp0nKSRkvNokVopIbHVpGnc3KJNpUOrNapVlTOMK18sKKF0Oqmw2y3PPPUdvby+JRIJ4PM6uXbsYHx9nz549BAIBYrEYe/bs4Te/+Q1z584t7YKwbXvKa6FQKLXt/16OmG3bR48ePfo3724QF1gQQAaBj8oKZ5eA5u+9M8DwK9XTnLcEmEXpX4VIEy7wB7+a/c/q4weV0on6lqQ4jkM8Hi8xVU9PD4lEglwux9jYGA888AC//e1vOXToENu2baO9vZ3m5uZSzFX+qxyPjQKBAMlkEsdxyGazJcabO3duSZr4gNTqrWKkvBjOAt74R4DKpzVdrSwTqSElzFMhHmP/PwJUs+zj3wYs+UVMVGYPjuNQU1NDJpPhZz/7GT09PTQ0NJTYJp1OE4/HWb58Oe3t7ViWxY4dO0ilUtTV1VEsFt8FKM/tZbNZNm/eTDKZZN26ddTX17N//35ef/11qqurP6htM1nggG+iGBKgjn6I8rX9TG7oy/sU8X6lVI7ruASmER4rgIIHqnQ6zVNPPUV3dzeNjY3k81O34ySTSRYvXgzACy+8QGtrK7W1tVNANd2RyWRYu3YtiUSC7u5uent7efTRR9m1axexWOwDAZZoN50fZgPIqu26/7HIbIAVdBwnV1NTY2QyGfeHP/whly5dYv78+SU1vXylWFlZSX9/P+fOnSMajZaCdD9blQPLMIyS8r5y5Up2797N3r17mTdvnlf/5r6Z67iUrwpjrusSiUTCyWQy/L3vfc85e/YsdXV15PP5kqpeKBRK723bplAokM1mS9uXve+nYyrLsrhy5Qqjo6MkEgn27t3LwYMHefzxxzl8+LC3e9Rwb24hvaGAFQVikUhkYOfOnWeOHz9eWV9fPwVIHmjK33s48INqOnClUinWrFnD4sWL6evrY+PGjezevZuLFy/y/e9/n66uLi8Wm7hpnhvHFd4SDodHe3t7//zkk0/aGzZsuK1YLAYMwyjO9BP5KUpamQ413f84dHd38+1vf5tTp07R19fHxz/+cerq6njttdd49NFHXdu2KxzHGXddd+CmeW4cxgqGw+E/3X333TZAMBh8u1Ao1Ni2bRSLRdf/Cxzv/XSHn6HKP0ciEfbv38/atWuZN28ezz33HLW1tTzyyCPuwYMHrUAgEHNdt/3kyZO5m+a5fotRJjckVq9ePeW3+Pfdd9+9pmmuME2zYJpmzvsTj+lYqzznNx1rGYbBlStXqK+vZ2Jigu7ubrexsdGorKys6O7utiKRSJvW+thN09xAwJqpbN68ealhGItM04yKKywF1v7/cbgauDxgeXHYxMRkCBUKhYxsNusWCoV0MBjsbGtr67ppluu//B9N0zw2U/fnYwAAAABJRU5ErkJggg==",bd={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)=>bd.multiply(t,bd.translation(e,i,s)),xRotate:(t,e)=>bd.multiply(t,bd.xRotation(e)),yRotate:(t,e)=>bd.multiply(t,bd.yRotation(e)),zRotate:(t,e)=>bd.multiply(t,bd.zRotation(e)),scale:(t,e,i,s)=>bd.multiply(t,bd.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],p=e[13],m=e[14],y=e[15],x=t[0],S=t[1],v=t[2],b=t[3],M=t[4],A=t[5],k=t[6],w=t[7],D=t[8],E=t[9],T=t[10],I=t[11],C=t[12],P=t[13],O=t[14],F=t[15],R=[];return R[0]=i*x+s*M+r*D+n*C,R[1]=i*S+s*A+r*E+n*P,R[2]=i*v+s*k+r*T+n*O,R[3]=i*b+s*w+r*I+n*F,R[4]=o*x+h*M+a*D+l*C,R[5]=o*S+h*A+a*E+l*P,R[6]=o*v+h*k+a*T+l*O,R[7]=o*b+h*w+a*I+l*F,R[8]=u*x+c*M+d*D+f*C,R[9]=u*S+c*A+d*E+f*P,R[10]=u*v+c*k+d*T+f*O,R[11]=u*b+c*w+d*I+f*F,R[12]=g*x+p*M+m*D+y*C,R[13]=g*S+p*A+m*E+y*P,R[14]=g*v+p*k+m*T+y*O,R[15]=g*b+p*w+m*I+y*F,R},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],p=t[13],m=t[14],y=t[15],x=d*y,S=m*f,v=a*y,b=m*l,M=a*f,A=d*l,k=r*y,w=m*n,D=r*f,E=d*n,T=r*l,I=a*n,C=u*p,P=g*c,O=o*p,F=g*h,R=o*c,B=u*h,z=i*p,_=g*s,L=i*c,G=u*s,V=i*h,N=o*s,W=x*h+b*c+M*p-(S*h+v*c+A*p),H=S*s+k*c+E*p-(x*s+w*c+D*p),U=v*s+w*h+T*p-(b*s+k*h+I*p),X=A*s+D*h+I*c-(M*s+E*h+T*c),j=1/(i*W+o*H+u*U+g*X);return e[0]=j*W,e[1]=j*H,e[2]=j*U,e[3]=j*X,e[4]=j*(S*o+v*u+A*g-(x*o+b*u+M*g)),e[5]=j*(x*i+w*u+D*g-(S*i+k*u+E*g)),e[6]=j*(b*i+k*o+I*g-(v*i+w*o+T*g)),e[7]=j*(M*i+E*o+T*u-(A*i+D*o+I*u)),e[8]=j*(C*l+F*f+R*y-(P*l+O*f+B*y)),e[9]=j*(P*n+z*f+G*y-(C*n+_*f+L*y)),e[10]=j*(O*n+_*l+V*y-(F*n+z*l+N*y)),e[11]=j*(B*n+L*l+N*f-(R*n+G*l+V*f)),e[12]=j*(O*d+B*m+P*a-(R*m+C*a+F*d)),e[13]=j*(L*m+C*r+_*d-(z*d+G*m+P*r)),e[14]=j*(z*a+N*m+F*r-(V*m+O*r+_*a)),e[15]=j*(V*d+R*r+G*a-(L*a+N*d+B*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 Md{constructor(t){this.kD=t}}class Ad{constructor(){this.CD=new Array,this.TD=t=>(this.CD.push(t),t),this.ID=this.TD(new Map),this.FD=this.TD(new Map),this.PD=this.TD(new Map),this.DD=this.TD(new Map),this.BD=this.TD(new Map)}OD(){this.CD.forEach((t=>{t.forEach((t=>t.OD())),t.clear()}))}}class kd{constructor(t,e){this.gn=t,this.Y=e,this.LD=!0,this.RD=null,this.ED=null}}class wd{constructor(t){this.zD=!1,this.VD=1,this.ND=t,this.GD={gn:u(0,0),Y:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),LD:!0,RD:null,ED:null},this.WD=u(64,64),this.HD=new Uint8ClampedArray(this.WD.x*this.WD.y*this.VD)}UD(t,e){if(!t.LD)return null;if(t.RD&&t.ED){const i=this.UD(t.RD,e);return null!==i?i:this.UD(t.ED,e)}const i=c(t.Y.x,t.Y.y);if(t.gn.x+t.Y.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.WD.x-t.gn.x-1),t.gn.y+t.Y.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.WD.y-t.gn.y-1),t.Y.x===e.x&&t.Y.y===e.y)return t.LD=!1,t;if(i.xt.Y.y)),h?(s=new kd(Qe(t.gn,{x:0,y:1}),u(t.Y.x,e.y)),r=new kd(Qe(t.gn,{x:0,y:e.y+1}),u(t.Y.x,t.Y.y-1-e.y))):(s=new kd(Qe(t.gn,{x:1,y:0}),u(e.x,t.Y.y)),r=new kd(Qe(t.gn,{x:e.x+1,y:0}),u(t.Y.x-1-e.x,t.Y.y))),t.RD=s,t.ED=r,this.UD(t.RD,e)}$D(t,e){const i={YD:!1,gn:null};let s=this.UD(this.GD,e);if(null===s)for(;null===s&&this.WD.xthis.ND||t.y>this.ND)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.VD);for(let i=0;i{this.kD.sB(t)})),this.JD.clear(),this}eB(t,e){const i=this.qD.get(e);if(i)return i.get(t)}hB(t,e,i){let s=this.qD.get(e);if(s||(s=new Map,this.qD.set(e,s)),s.has(t.glyph))return Ed.Success;const r=this.QD.$D(i,t.size);if(!r||!r.gn)return Ed.Fail;r.YD&&this.rB();const n=this.QD.ZD(r.KD);if(!n)return Ed.Fail;let o=this.JD.get(r.KD);if(!o){const t=this.kD.gl.createTexture();if(!t)throw new ut("Failed to create texture for font!");o=t,this.JD.set(r.KD,t)}const h=r.gn,a=n.WD.x,l=n.WD.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,p=(h.y+t.size.y)/l,m=(h.x+t.size.x)/a,y=h.y/l,x=[g,p,m,p,g,y,g,y,m,p,m,y],S=[u,c,d,c,u,f,u,f,d,c,d,f],v={origin:h,size:t.size,advanceX:t.advance,baseline:t.baseline,vertices:S,texCoords:x,packerId:r.KD,texture:o};s.set(t.glyph,v);const b=this.kD.gl;return b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),b.bindTexture(b.TEXTURE_2D,o),b.texImage2D(b.TEXTURE_2D,0,b.LUMINANCE,n.WD.x,n.WD.y,0,b.LUMINANCE,b.UNSIGNED_BYTE,this.kD.nB?n.HD:new Uint8Array(n.HD)),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.bindTexture(b.TEXTURE_2D,null),r.YD?Ed.Resize:Ed.Success}rB(){this.qD.forEach((t=>{t.forEach(((e,i)=>{const s=this.QD.ZD(e.packerId);if(!s)return;const r=e.origin,n=s.WD.x,o=s.WD.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 Cd=t=>(e,i)=>i%2?e:e+t;class Pd{constructor(t){this.oB=new Map,this.aB=ue("font"),this.lB=new Map,this.cB=new Set,this.kD=t}iB(){return this.oB.forEach((t=>t.iB())),this.cB.clear(),this}uB(t){this.cB.add(t)}dB(t){this.cB.delete(t)}fB(t,e){const i=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let s=this.lB.get(i);s||(s=this.aB(),this.oB.set(s,new Id(this.kD)),this.lB.set(i,s));const r=this.oB.get(s);if(!r)throw new ut("Failed to get font texture!");let n=0,o=0,h=0;const a=t.split(""),l=new Map;let c=0;const d=e.size;for(let t=0;t{t.nn.o=!0})),t=-1,c=0,o=0,n=0,l.clear();continue}if(a===Ed.Fail)throw new ut("Failed to create glyph");if(h=r.eB(i,d),!h)throw new ut("Failed to get glyph after creation")}if(""!==i.trim()){let t=l.get(h.texture);t||(t={vertices:[],texCoords:[]},l.set(h.texture,t)),t.vertices.push(...h.vertices.map(Cd(s))),t.texCoords.push(...h.texCoords),o=Math.max(o,h.baseline),n=Math.min(n,h.baseline-(h.size.y-1))}c+=h.advanceX}h=c;const f=p(u(0,n),u(h,o)),g=[];return l.forEach(((t,e)=>{g.push({texCoords:new Float32Array(t.texCoords),vertices:new Float32Array(t.vertices),texture:e})})),[g,f]}}class Od 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 Fd=(...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},Rd="\nfloat roundUnsigned(float number) {\n return floor(number + 0.5);\n}",Bd="\nfloat linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}",zd="\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 ",_d="\nvec4 pickTexel(sampler2D textureSampler, vec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (iTexel * 2.0 + 1.0) * halfTexel);\n}",Ld="\n uvec4 pickTexelUnsigned(usampler2D textureSampler, vec2 iTexel, vec2 textureSize) {\n vec2 halfTexel = 0.5 / textureSize;\n return texture2D(textureSampler, (iTexel * 2.0 + 1.0) * halfTexel);\n }",Gd=" \nint modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}",Vd="\n#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}",Nd={"2D":"\nvoid main(void) {\n gl_Position = vec4(posWorld, 0.0, 1.0 );\n}\n","3D":"\nuniform mat4 uViewProjectionMatrix;\nvoid main(void) {\n gl_Position = uViewProjectionMatrix * vec4(posWorld, 1.0);\n}\n"},Wd={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 Hd{constructor(t){this.modifiers=[],this.modifiers=t}alter(t){const e=new Hd(this.modifiers.slice());return e.modifiers.push.apply(e.modifiers,t),e}build(t){for(const e of this.modifiers)t=e(t);return t}}const Ud=(...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},Xd=t=>e=>e.replace("void main(void)",`${t}\nvoid main(void)`),jd=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Yd=(...t)=>e=>{for(let e=0;ei=>{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},Zd=(t,...e)=>i=>{for(let t=0;t{if(!a.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${a}")`)})),a},qd=(...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},Kd=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Ud(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Ud(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return qd(`\t${r} = ${s};`)(i)},Jd=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e};class Qd{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new ct(`Could not find ${this.mB()} ${this.SB()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}mB(){return this.id.toString()}SB(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class tf extends Qd{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class ef extends Qd{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class sf{constructor(t,e,i,s=i.createProgram()){this.yB=new Map,this.xB=new Map,this.ft=i,this.bB=s,this.vB=`${t.mB()} vertex`,this.MB=`${e.mB()} fragment`,i.attachShader(s,t.shader),i.attachShader(s,e.shader),i.bindAttribLocation(s,0,"aPos"),i.linkProgram(s),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""}_B(t){return ge(0,(()=>pe()))}AB(t){const e=this.wB(t);if(void 0===e)throw this._B(`Could not get ${t} uniform from ${this.vB} and ${this.MB} shaders.`);return e}wB(t){const e=this.yB.get(t);if(e)return e;const i=this.ft.getUniformLocation(this.bB,t);return i?(this.yB.set(t,i),i):void 0}kB(t){const e=this.CB(t);if(void 0===e)throw this._B(`Could not get ${t} attribute from ${this.vB} and ${this.MB} shaders.`);return e}CB(t){const e=this.xB.get(t);if(e||0===e)return e;const i=this.ft.getAttribLocation(this.bB,t);return i>=0?(this.xB.set(t,i),i):void 0}G(){this.ft.deleteProgram(this.bB)}}const rf=(t,e,i)=>()=>{t.TB=e,i&&i()};class nf{constructor(t,e){if(this.IB=0,this.FB=0,this.PB=!1,this.TB=!1,this.DB=!1,this.BB=!1,this.OB=!1,this.LB=new Set,this.RB=new Set,this.QI=e,this.ft=t,this.EB=null,this.PB=e instanceof mt.HTMLVideoElement,this.QI instanceof mt.HTMLImageElement)this.QI.addEventListener("load",(()=>{this.BB=!0,this.zB()})),this.QI.addEventListener("error",(()=>{this.OB=!0})),this.QI.complete&&(this.BB=!0,this.zB());else if(this.QI instanceof mt.HTMLVideoElement){const t=this;this.QI.addEventListener("canplay",(function(){t.FB=this.videoHeight,t.IB=this.videoWidth,t.BB=!0,t.zB()}),!0),this.QI.addEventListener("play",rf(this,!0,(()=>this.zB()))),this.QI.addEventListener("playing",rf(this,!0,(()=>this.zB()))),this.QI.addEventListener("pause",rf(this,!1)),this.QI.addEventListener("ended",rf(this,!1)),this.QI.readyState>=1&&(this.IB=this.QI.videoWidth,this.FB=this.QI.videoHeight,this.TB=!this.QI.paused,this.BB=!0,this.zB())}else this.BB=!0,this.zB()}uB(t){0===this.RB.size&&this.BB&&this.zB(),this.RB.add(t)}dB(t){this.RB.delete(t),0===this.RB.size&&this.unbindResources()}VB(t){this.LB.add(t),this.DB&&(t(),this.NB(t))}NB(t){this.LB.delete(t)}zB(){if(this.OB||this.DB||!this.BB)return;const t=this.ft.gl;if(!this.EB&&this.QI&&t){this.EB=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.EB),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.QI,o=this.IB>0?this.IB:n.width,h=this.FB>0?this.FB: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.IB=o,this.FB=h,t.bindTexture(t.TEXTURE_2D,null)}this.DB=!0,this.LB&&this.LB.forEach((t=>{t(),this.NB(t)}))}Zs(){const t=this.ft.gl;if(!this.OB&&this.DB&&this.EB){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.QI;n&&(t.bindTexture(t.TEXTURE_2D,this.EB),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}GB(){return this.EB}unbindResources(){return this.DB&&(this.EB&&(this.ft.sB(this.EB),this.EB=null),this.DB=!1),this}}class of extends Ts{constructor(t,e,i){super(t.Wi,e,i),this.Wm=!0,this.Vm={},this.Nm=y(eh),this.Hr=t,this.ut=t.ut}WB(){var t;return this.Nm.o&&this.Nm.M().type!==(null===(t=this.HB)||void 0===t?void 0:t.type)}Xm(t){return this.Wm=t,this}UB(t){return this.Vm=t,this}}const hf=t=>[Ud("uniform float uLookupMin","uniform float uLookupMax","uniform sampler2D uLookupTexture","uniform float uLookupTextureHeightPx","uniform vec4 uFallbackColor"),Xd(Rd),$d("colorFragment","vec4 colorFragment = vec4(0.0)",`if (${t} <= -340282346638528859811704183484516925440.0) {\n colorFragment = uFallbackColor;\n } else {\n float texCoordY = (${t} - uLookupMin) / (uLookupMax - uLookupMin);\n texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx);\n colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY));\n }`)],af=[Ud("uniform sampler2D uMaskTexture"),Ud("varying vec2 vMaskTextureCoord"),Zd("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],lf=[Ud("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;"),Zd("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)")],uf=t=>void 0!==t.find((t=>t.idVertex&&t.idVertex.includes("3D"))),cf=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:[x|y|z]/)})),df=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:value/)})),ff=(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(Ud("attribute vec3 aNormal"),Yd("vec3 normal = aNormal")),"linear-highPrecision"!==n)i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&(!0!==c?s.push(Yd(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(Yd(`${r} ${t.variableNameAxisCoord} = ${e?`vec3(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y, ${t.attributeNameAxisCoord}Z)`:`vec2(${t.attributeNameAxisCoord}X, ${t.attributeNameAxisCoord}Y)`}`)))}));else{if(!0===c)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.forEach((t=>{s.push(Yd(`${r} ${t.variableNameAxisCoord}_highpart = ${t.attributeNameAxisCoord}_highpart`),Yd(`${r} ${t.variableNameAxisCoord}_lowpart = ${t.attributeNameAxisCoord}_lowpart`))}))}if(a&&a.rotation){const t=a.rotation.dataType,e=("uniform"===t?"u":"a")+"Rot";s.push(Ud(`${t} vec2 ${e}`));const i="aInstanceGeo";s.push(Yd(`vec2 rotatedGeo = vec2(${i}.x * ${e}.y + ${i}.y * ${e}.x, ${i}.y * ${e}.y - ${i}.x * ${e}.x)`))}if(a&&s.push(Ud(`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(Ud(`${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(Ud(`${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(Ud(`${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(Ud(`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(Ud(`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(Ud("uniform mat3 uMatrix")),i.forEach((t=>{f.push(`vec2 ${t.variableNameWorldCoord} = (uMatrix * vec3(${t.variableNameAxisCoord}, 1.0)).xy`)}));else if("logarithmic"===n[0]){s.push(Ud(`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(${xi(t).toFixed(1)})`;o.includes(i)||o.push(i)}})),s.push(Ud(...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(Ud("uniform vec2 uRatioPxClip"));const t=("attribute"===a.dataType?"a":"u")+"OffsetPixels",e=!0===a.symmetric?"float":r;s.push(Ud(`${a.dataType} ${e} ${t}`));const n=a.halved?" * 0.5":"",o=`${t} * ${a.rotation?"rotatedGeo":"aInstanceGeo"}${n}`;i.forEach((t=>{f.push(`${t.variableNameWorldCoord} = ${t.variableNameWorldCoord} + ${o} * uRatioPxClip`)}))}if(a&&"wu"===a.sizeUnit){const t=("attribute"===a.dataType?"a":"u")+"OffsetWU",n=!0===a.symmetric?"float":r;s.push(Ud(`${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(Ud("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Ud(`${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(Ud("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($d("gl_Position =",...f)),s},gf=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(Zd(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(Zd(i,`${o} ${s} = ${i} * uScale + uDisp + uScaleStart_highpart + uScaleStart_lowpart`));else{if("matrix"===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(Zd(i,...t))}}return r},pf={"2D":{idFeature:"2D",idVertex:"2D",idFragment:"2D",apply:t=>({defaultVertexShader:"2D",defaultFragmentShader:"FragmentShader"})},"3D":{idFeature:"3D",idVertex:"3D",idFragment:"3D",apply:t=>({defaultVertexShader:"3D",defaultFragmentShader:"FragmentShader"})},PointSize:t=>({idFeature:"PointSize",idVertex:`SizePrimitive:${Fd(t)}`,idFragment:void 0,apply:e=>{const i="uniform"===t?"u":"a";return{vertexShaderModifiers:[Ud(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),qd(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture;let r,n=`Color:${Fd(t)}`;const o=[],h=[];if("uniform"===i)h.push(Ud("uniform vec4 uColor"),Yd("vec4 colorFragment = uColor"),...s?af:[]);else if("attribute"===i)r="colorAttribute",o.push(Kd("attribute vec4 aColor","varying vec4 vColor")),h.push(Ud("varying vec4 vColor"),Yd("vec4 colorFragment = vColor"));else if("texture"===i)r="colorTexCoord",o.push(Kd("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),h.push(Ud("varying vec2 vTextureCoord"),Ud("uniform sampler2D uColorTexture"),Ud("uniform vec4 uColor"),Yd("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)&&"image"===i[0])r="colorTexCoord",o.push(Kd("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?h.push(Ud("uniform sampler2D uColorTexture"),Ud("varying vec2 vTextureCoord"),Yd("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):h.push(Ud("uniform sampler2D uColorTexture"),Ud("varying vec2 vTextureCoord"),Ud("uniform vec4 uColor"),Yd("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)r="lookup:value",o.push(Kd("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push(Kd(e,"varying float vLookupValue"))}h.push(Ud("varying float vLookupValue"),...hf("vLookupValue"))}else if(Array.isArray(i)&&"gradient"===i[0]){n=`Color:${Fd(t)}`;const e=i[1],r=e.getColorStops();e instanceof $?h.push(Ud("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Ud(...Dt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Xd(Bd),Yd("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, mixVal));`)),"vec4 colorFragment = color"),...s?af:[]):e instanceof q&&(n=`Color:${Fd(t)}`,h.push(Ud("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Ud(...Dt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Xd(Bd),Yd("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))",...r.map(((t,e)=>e<2?"":`color = mix(color, color_${e}, linearStep(stop_${e-1}, stop_${e}, magnitude))`)),"vec4 colorFragment = color"),...s?af:[]))}if(!0===s){const t="maskTexture";r=r?`${r} ${t}`:`Color:${t}`,o.push(Kd("attribute vec2 aMaskTextureCoord","varying vec2 vMaskTextureCoord"))}return{idFeature:"Color",idVertex:r,idFragment:n,apply:t=>({vertexShaderModifiers:o,fragmentShader:"FragmentShader",fragmentShaderModifiers:h})}},ColorShaded3D:t=>{const{dataType:e,shadingStyle:i,wireframe:s}=t;let r;const n=`ColorShaded3D:${Fd(t)}`,o=[],h=[];if(o.push("phong"===i&&Kd("normal","varying vec3 vNormal"),Kd("posWorld","varying vec3 vPosWorld")),"uniform"===e)h.push(Ud("uniform vec4 uColorDiffuse"),Yd("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",o.push(Kd("attribute vec4 aColor","varying vec4 vColor")),h.push(Ud("varying vec4 vColor"),Yd("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",o.push(Kd("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push(Kd(e,"varying float vLookupValue"))}h.push(Ud("varying float vLookupValue"),...hf("vLookupValue"))}if(s){const t="wireframe";r=r?`${r},${t}`:t,o.push(Kd("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),h.push(Ud("varying vec3 vTriangleBary"),Ud("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Xd(Vd),Zd("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&h.push(...lf),{idFeature:"ColorShaded3D",idVertex:r,idFragment:n,apply:t=>({fragmentShader:"FragmentShader",vertexShaderModifiers:o,fragmentShaderModifiers:h})}},VertexLocation:t=>({idFeature:"VertexLocation",idVertex:`VertexLocation:${Fd(t)}`,idFragment:void 0,apply:e=>{const i=[],s=uf(e),r=s?"vec3":"vec2";if("linear-highPrecision"!==t.axisWorldTranslation)!0!==t.splitPosAttribute?i.push(Ud(`attribute ${r} aPos`)):i.push(Ud("attribute float aPosX"),Ud("attribute float aPosY"),s&&Ud("attribute float aPosZ"));else{if(!0===t.splitPosAttribute)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.push(Ud(`attribute ${r} aPos_highpart`),Ud(`attribute ${r} aPos_lowpart`))}return i.push(...ff(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),{vertexShaderModifiers:i}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",idVertex:`LineInstanced2D:${Fd(t)}`,idFragment:void 0,apply:e=>({vertexShaderModifiers:[Ud("uniform float uThicknessPixels"),Ud("uniform vec2 uRatioPxClip"),"linear-highPrecision"!==t.axisWorldTranslation&&Ud("attribute vec2 aLocationA"),"linear-highPrecision"!==t.axisWorldTranslation&&Ud("attribute vec2 aLocationB"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationA_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationB_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationA_lowpart"),"linear-highPrecision"===t.axisWorldTranslation&&Ud("attribute vec2 aLocationB_lowpart"),Ud("attribute vec2 aSegmentPosition"),Ud("attribute float aSegmentSide"),...ff(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Zd("worldB = ","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"),...df(e)?[jd("attribute float aLookupValue"),jd("vLookupValue = aLookupValue"),Ud("attribute float aLookupValueA"),Ud("attribute float aLookupValueB"),qd("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],...cf(e)?gf(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",idVertex:`LineInstanced3D:${Fd(t)}`,idFragment:void 0,apply:e=>({defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Ud("uniform float uOffsetWU"),Ud("attribute vec3 aLocationA"),Ud("attribute vec3 aLocationB"),Ud("attribute float aSegmentPosition"),Ud("attribute float aPerpendHorizontal"),Ud("attribute float aPerpendVertical"),...ff({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},uf(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),Zd("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"),...cf(e)?gf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",idVertex:"RoundedEdges3D",idFragment:void 0,apply:t=>({vertexShaderModifiers:[Ud("attribute vec3 aEdge"),Ud("uniform float uEdgeRoundness"),Zd("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",idVertex:void 0,idFragment:`ColorGrid2D:${Fd(t)}`,apply:r=>({fragmentShader:"FragmentShader",fragmentShaderModifiers:[Ud("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues","ubyte"===i&&zd),"bilinear"===t.interpolation?Yd("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"})`):Yd("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})`)),...hf("intensityP")]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",idVertex:`DrawToNormalTexture:${Fd(t)}`,idFragment:`DrawToNormalTexture:${Fd(t)}`,apply:t=>{const o=[],h=[];return o.push(Ud("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&&Rd,Gd,_d,"ubyte"===r&&zd),Yd(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?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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?"pickTexel(uHeightmapTexture, vec2(iCell1.y, iCell1.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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?"pickTexel(uHeightmapTexture, vec2(iCell2.y, iCell2.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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?"pickTexel(uHeightmapTexture, vec2(iCell3.y, iCell3.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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")),h.push(Ud("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),Yd("uint"===s?"gl_FragColor = uvec4(vNormalRGB, -1u)":"gl_FragColor = vec4(vNormalRGB, 1.0)")),{vertexShaderModifiers:o,fragmentShaderModifiers:h,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",idVertex:`SurfaceGrid:${Fd(t)}`,idFragment:`SurfaceGrid:${Fd(t)}`,apply:c=>{const d=[],f=[];return d.push(Ud("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&&Rd,Gd,_d,"ubyte"===a&&zd),Yd(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?"pickTexel(uHeightmapTexture, vec2(iCellVertex.y, iCellVertex.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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)")),d.push(...ff({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(Kd("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Xd(Ld),qd("vec4 normalAxisRGB = vec4(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[qd("vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],qd("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Ud("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Ud("varying vec3 vTriangleBary")),"uniform"===e?f.push(Ud("uniform vec4 uColorDiffuse"),Yd("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(d.push(Kd("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Ud("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp","ubyte"===l&&zd),"bilinear"===i?Yd("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"})`):Yd("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"),...hf("intensityP"))):(d.push(Kd(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Ud("varying float vLookupValue"),...hf("vLookupValue"))):void 0===e&&f.push(Yd("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&f.push(...lf),n&&(d.push(Ud("attribute vec3 aTriangleBary"),Kd("aTriangleBary","varying vec3 vTriangleBary")),f.push(Ud("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Xd(Vd),Zd("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 }"))),{vertexShaderModifiers:d,fragmentShader:"FragmentShader",fragmentShaderModifiers:f}}}},DebugSurfaceGridNormals:t=>({idFeature:"DebugSurfaceGridNormals",idVertex:`DebugSurfaceGridNormals:${Fd(t)}`,idFragment:`DebugSurfaceGridNormals:${Fd(t)}`,apply:e=>({vertexShaderModifiers:[Ud("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",Rd,Gd,_d,"ubyte"===t.heightmapTextureType&&zd,..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),Yd(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?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y01 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y10 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(iCell.y, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)), ${t.littleEndian})`),"float y11 = "+("float"===t.heightmapTextureType?"pickTexel(uHeightmapTexture, vec2(iCell.y + 1.0, iCell.x + 1.0), vec2(uTileDimensions.y, uTileDimensions.x)).x":`decodeUbyteRGBAEncodedFloat(pickTexel(uHeightmapTexture, vec2(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(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)"]:["vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(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?[Xd(Ld)]:[],...ff({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),Zd("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:[qd("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",idVertex:"OffsetTowardsCamera",idFragment:void 0,apply:t=>({vertexShaderModifiers:[Ud("uniform vec3 uCameraLoc"),Zd("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",idVertex:"AliasedEdge",idFragment:"AliasedEdge",apply:t=>({vertexShaderModifiers:[Ud("attribute float aSegmentInside"),Ud("varying float vSegmentInside"),Ud("varying float vSegmentSide"),Zd("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Jd("#extension GL_OES_standard_derivatives : enable"),Ud("uniform float uAALimit"),Ud("varying float vSegmentInside"),Ud("varying float vSegmentSide"),Zd("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",idVertex:`Glow1D:${Fd(t)}`,idFragment:`Glow1D:${Fd(t)}`,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{vertexShaderModifiers:[Kd("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Ud("uniform sampler2D uTexture"),Ud("varying vec2 vTextureCoord"),Ud("uniform vec2 uTextureSize"),r&&Ud("uniform vec2 uOffsetPx"),!r&&Ud("uniform sampler2D uTextureFirstGlowPass"),!r&&Ud("uniform vec4 uGlowColor"),Zd("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",idVertex:void 0,idFragment:"MousePicking",apply:t=>({fragmentShaderModifiers:[Ud("uniform vec4 uColor"),Yd("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",idVertex:"MousePickingAttribute",idFragment:"MousePickingAttribute",apply:t=>({vertexShaderModifiers:[Kd("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Ud("varying vec4 vColor"),Yd("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",idVertex:"AttributeHighlight",idFragment:"AttributeHighlight",apply:t=>({vertexShaderModifiers:[Kd("attribute float aIsHighlighted","varying float vIsHighlighted")],fragmentShaderModifiers:[t=>t.replace("uniform float uIsHighlighted","varying float vIsHighlighted").replace("uIsHighlighted","vIsHighlighted")]})},StippleTexture:{idFeature:"StippleTexture",idVertex:"StippleTexture",idFragment:"StippleTexture",apply:(t,e)=>({vertexShaderModifiers:[Ud("attribute vec2 aLengthSoFar"),Ud("varying float vLengthSoFar"),Ud("uniform vec2 uStippleCount"),qd("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Ud("uniform sampler2D uStippleTexture"),Ud("uniform float uStippleScale"),Ud("varying float vLengthSoFar"),"webgl1"===e&&Ud("uniform float uStippleTextureWidthLimiter"),Zd("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",idVertex:"StippleTextureInstanced",idFragment:"StippleTextureInstanced",apply:(t,e)=>({vertexShaderModifiers:[Ud("attribute vec2 aLengthSoFarA"),Ud("attribute vec2 aLengthSoFarB"),Ud("varying float vLengthSoFar"),Ud("uniform vec2 uStippleCount"),qd("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Ud("uniform sampler2D uStippleTexture"),Ud("uniform float uStippleScale"),Ud("varying float vLengthSoFar"),"webgl1"===e&&Ud("uniform float uStippleTextureWidthLimiter"),Zd("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; }`)]})}};class mf{constructor(t){this.mO=[],this.kD=t}SO(t,e){((t,e,i,s)=>{const r=t.pB(),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.$B(),l=t.YB(),u=t.XB(),c=t.jB(),d=t.ZB();t.KB("disabled"),t.Xm(!1),t.qB(!1);const f=e.JB();((t,e,i)=>{const s=t.gl,r=t.pB();s.bindFramebuffer(s.FRAMEBUFFER,i.frameBuffer),s.bindRenderbuffer(s.RENDERBUFFER,i.depthBuffer),s.bindTexture(s.TEXTURE_2D,i.texture),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.clear(s.DEPTH_BUFFER_BIT);const n=i.sizeDpr;t.QB(0,0,n.x,n.y),e.forEach((e=>{let i;e instanceof Cs?i=e.Hr.op():e instanceof of&&(i=e.Hr.Sy()),i?t.tO(i.x*r,i.y*r,i.width*r,i.height*r):t.qB(!1),e.wD(2)})),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindTexture(s.TEXTURE_2D,null),t.qB(!1)})(t,s,f);let g=f;const p=n+o+5,m=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iIe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=We(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Cs||t instanceof of?t.Hr.iO(t):De;if(me(e))return De;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?De:r})).filter((t=>!me(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=ii(t.min,s),i=ii(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.sO(o),vertexCount:n}})(t,s,{left:p+(h.x<0?-h.x:0),top:p+(h.y>0?h.y:0),right:p+(h.x>0?h.x:0),bottom:p+(h.y<0?-h.y:0)},e.eO()),y=e.JB(f,g),x=t.hO(pf["2D"],pf.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),pf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:"linear",normalSource:void 0}));((t,e,i,s,r,n)=>{const o=t.gl;o.bindFramebuffer(o.FRAMEBUFFER,i.frameBuffer),o.bindRenderbuffer(o.RENDERBUFFER,i.depthBuffer),o.bindTexture(o.TEXTURE_2D,i.texture),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.clear(o.DEPTH_BUFFER_BIT),t.QB(0,0,i.sizeDpr.x,i.sizeDpr.y),t.rO(s,((h,a,l,u)=>(t.uB(s),n&&n(h),t.lO(h("uIsHighlighted"),0).cO(h("uHighlightColorOffset"),E).lO(h("uRenderEffectMask"),0).aO(h("uTexture"),e.texture,0).oO(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).oO(h("uScale"),i.uniforms.uO()).oO(h("uDisp"),i.uniforms.dO()).oO(h("uScaling"),[i.size.x,i.size.y]).oO(h("uTranslationAxis"),[0,0]).nO(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Hp(o.TRIANGLES,r.vertexCount,0),!0))),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)})(t,g,y,x,m,((e,i,s,r)=>(t.oO(e("uOffsetPx"),[h.x,h.y]),!0))),g=y,t.qB(l),t.fO(d);const S=t.hO(pf["2D"],pf.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),pf.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.Wi.$t().x,y:t.Wi.$t().y};t.QB(0,0,o.x*t.pB(),o.y*t.pB());const h=st.d2({scaleXYConstructor:Ti}).q(o).vi(0,o.x).Mi(0,o.y),a=new Sf;a.gO(h),t.rO(i,((h,l,u,c)=>(t.uB(i),r&&r(h),t.lO(h("uIsHighlighted"),0).cO(h("uHighlightColorOffset"),E).lO(h("uRenderEffectMask"),0).aO(h("uTexture"),e.texture,0).oO(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).oO(h("uScale"),a.uO()).oO(h("uDisp"),a.dO()).oO(h("uScaling"),[o.x,o.y]).oO(h("uTranslationAxis"),[0,0]).nO(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Hp(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,m,((e,s,r,n)=>(t.aO(e("uTextureFirstGlowPass"),y.texture,1).cO(e("uGlowColor"),i.color),!0))),t.QB(a.x,a.y,a.width,a.height),t.KB(u),t.Xm(c),t.pO(m.vertexBuffer)})(this.kD,this,e,t)}eO(){const t=this.kD.Wi.$t();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}JB(...t){const e=this.mO,i=this.eO(),s={x:Math.ceil(i.x*this.kD.pB()),y:Math.ceil(i.y*this.kD.pB())},r=this.kD.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.q(i).vi(0,i.x).Mi(0,i.y),n.uniforms.gO(n.scale)),n;const o=r.createTexture(),h=this.kD.yO(),a=this.kD.xO();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),r.bindFramebuffer(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),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindRenderbuffer(r.RENDERBUFFER,null);const l=st.d2({scaleXYConstructor:Ti}).q(i).vi(0,i.x).Mi(0,i.y),u=new Sf;u.gO(l);const c={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:l,uniforms:u};return e.push(c),c}G(){[this.mO].forEach((t=>{t.forEach((t=>{this.kD.bO(t.depthBuffer),this.kD.vO(t.frameBuffer),this.kD.sB(t.texture)})),t.length=0}))}}class yf{constructor(t,i,s,r,n=!0){this.MO=new Ad,this._O=new Map,this.AO=new Map,this.wO=new Map,this.kO=[],this.CO=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(mt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.Wm=!1,this.oO=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.TO=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.IO=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.FO=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.PO=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.DO=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.cO=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.lO=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.BO=(t,e)=>(this.gl.uniform1i(t,e),this),this.aO=(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 ut("Could not bind a texture.")},this.OO=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.sO=(t,e=!1)=>{const i=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,i),this.gl.bufferData(this.gl.ARRAY_BUFFER,t instanceof Float32Array?t:new Float32Array(t),e?this.gl.DYNAMIC_DRAW:this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),i)return i;throw new ut("Could not create vertex buffer")},this.LO=(t,e,i)=>{const s=i||this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ARRAY_BUFFER,s),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(t),this.gl.STATIC_DRAW),e&&this.gl.bufferSubData(this.gl.ARRAY_BUFFER,0,e instanceof Float32Array?e:new Float32Array(e)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),s)return s;throw new ut("Could not create vertex buffer")},this.RO=(t,e,i)=>{this.gl.bindBuffer(this.gl.ARRAY_BUFFER,t),this.gl.bufferSubData(this.gl.ARRAY_BUFFER,e*Float32Array.BYTES_PER_ELEMENT,i instanceof Float32Array?i:new Float32Array(i)),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null)},this.EO=(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.zO=t=>{const e=this.gl.createBuffer();if(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,e),this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER,t,this.gl.STATIC_DRAW),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null),e)return e;throw new ut("Could not create vertex buffer")},this.VO=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 ut("Could not create float buffer")},this.NO=(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.GO=(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.nO=(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.WO(s,e)}return this},this.HO=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this.UO=(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.$O=(t,e)=>(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)),this),this.YO=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.Hp=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.XO=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.jO=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.ZO.ANGLE_instanced_arrays)return mt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.ZO.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.KO=(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.ZO.ANGLE_instanced_arrays)return mt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.ZO.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.WO=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.ZO.ANGLE_instanced_arrays)return mt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.ZO.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.qO=(t,e,i,s=0)=>{const r=this.gl.TEXTURE0+s;this.gl.activeTexture(r),this.gl.bindFramebuffer(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 n=this.YB();n&&this.qB(!1),t(),n&&this.qB(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)},this.JO=(t,e,i)=>{const s=mt.document.createElement("canvas").getContext("2d").createImageData(i.x,i.y),r=s.data;return this.gl.readPixels(t,e,i.x,i.y,this.gl.RGBA,this.gl.UNSIGNED_BYTE,r),s},this.no=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.clear(this.gl.DEPTH_BUFFER_BIT),this),this.QO=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.uB=t=>(this.gl.useProgram(t.bB),this),this.tL=!1,this.iL=[],this.Wi=t,this.uf=i,this.Wi=t,this.gl=s.ctx,this.sL=s.antialias,this.eL=s.lineAntialias,n&&(this.fO(!0),this.hL());const o=[];if(this.ZO={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.ZO).forEach((t=>{null===this.ZO[t]&&o.push(t)})),"webgl2"===s.type)this.gl2={ctx:s.ctx},this.rL=!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.eL=!1),Object.keys(t).forEach((e=>{null===t[e]&&o.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.rL=!!e.OES_texture_float,this.gl1={ctx:s.ctx,ZO:t,optional:e}}this.kO=o,this.tB=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.nB=this.nL(),this.hO=(t=>{const e=t.gl,i=new Map,s=new Map,r=new Map,n={totalMs:0,vertexShaders:0,fragmentShaders:0,programs:0},o=(e,i,s=[])=>{const r=[],n=[],o={allAttributeNames:Array.from(e.matchAll(/attribute\s[^\s]*\s(.*);/g)).map((t=>t[1])),allUniformNames:Array.from(e.matchAll(/uniform\s[^\s]*\s(.*);/g)).map((t=>t[1])),allVaryingNames:Array.from(e.matchAll(/varying\s[^\s]*\s(.*);/g)).map((t=>t[1])),removedVariableNames:[]};if(t.gl1){const t=e.match(/#extension.*/g);t&&n.push(...t),e=e.replace(/#extension.*/g,"")}else if(r.push("#version 300 es"),(e=(e=(e=e.replace(/#extension.*/g,"")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).includes("usampler2D")&&r.push("precision highp usampler2D;"),"vertex"===i)e=e.replace(/varying/g,"out");else{e=e.replace(/varying/g,"in");const t=s.find((t=>"fragOutput"===t.type));e=(e=t?`out ${t.fragOutput} fragOutput;\n${e}`:`out vec4 fragOutput;\n${e}`).replace(/gl_FragColor/g,"fragOutput")}return n&&r.push(...n),r.push("precision highp float;"),r.push("precision highp int;"),{source:e=`${r.join("\n")}\n${e}`,info:o}};return(...h)=>{const a=t.gl2?"webgl2":"webgl1";let l,u,c,d,f,g,p,m,y,x;try{const t=mt.performance.now();l=h.filter((t=>!1!==t&&void 0!==t)),u=(t=>{const e=t.map((t=>t.idVertex)).filter((t=>void 0!==t)).sort().join(" "),i=t.map((t=>t.idFragment)).filter((t=>void 0!==t)).sort().join(" ");return{vertexShaderID:e,fragmentShaderID:i,programID:`vert: ${e} frag: ${i}`}})(l);const S=r.get(u.programID);if(d="new",S)return d="existing",p=S.vertexShaderSrc,m=S.fragmentShaderSrc,S;c=((t,e,i)=>{const{programID:s,vertexShaderID:r,fragmentShaderID:n}=e;let o,h=!1,a=!1;const l=[];let u;const c=[],d=[];if(t.forEach((e=>{const r=e.apply(t,i);if(r.defaultVertexShader&&(h||(o=r.defaultVertexShader)),r.vertexShader){if(o&&h&&o!==r.vertexShader)throw new Od(`Conflicting vertex shader templates ${o} vs ${r.vertexShader}`,s,e);o=r.vertexShader,h=!0}if(r.vertexShaderModifiers)for(const t of r.vertexShaderModifiers)"function"==typeof t&&l.push(t);if(r.defaultFragmentShader&&(a||(u=r.defaultFragmentShader)),r.fragmentShader){if(u&&a&&u!==r.fragmentShader)throw new Od(`Conflicting fragment shader templates ${u} vs ${r.fragmentShader}`,s,e);u=r.fragmentShader,a=!0}if(r.fragmentShaderModifiers)for(const t of r.fragmentShaderModifiers)"function"==typeof t&&c.push(t);r.hints&&r.hints.forEach((t=>{t&&d.push(t)}))})),!o)throw new Od("No vertex shader template defined",s);if(!u)throw new Od("Fragment shader not defined",s);return{id:s,vertexShader:{id:r,template:o,modifiers:l},fragmentShader:{id:n,template:u,modifiers:c},hints:d}})(l,u,a);const v=u.vertexShaderID;let b=i.get(v);if(b)p=b.src,f="existing";else{f="new";const t=new Hd(c.vertexShader.modifiers).build(Nd[c.vertexShader.template]),{source:s,info:r}=o(t,"vertex");p=s,y=r,b=new tf(v,s,e,r),i.set(v,b),n.vertexShaders+=1}const M=c.fragmentShader;let A;const k=M.id;if(A=s.get(k),A)m=A.src,g="existing";else{g="new";const t=Wd[M.template],i=new Hd([...M.modifiers]).build(t),{source:r,info:h}=o(i,"fragment",c.hints);m=r,x=h,A=new ef(k,r,e,h),s.set(k,A),n.fragmentShaders+=1}const w=new sf(b,A,e);return r.set(u.programID,w),n.programs+=1,n.totalMs+=mt.performance.now()-t,w}catch(t){throw ge(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 mt.alert(t),new Error(t)}))}}})(this),this.oL=at(this.gl),this.aL=new bf(this),this.gB=(t=>{const e=mt.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new ut("Failed to get Text canvas rendering context");return i.fillStyle="#fff",(s,r,n)=>{const o=`${r.style} ${r.weight} ${r.size*n}px ${r.family}`;i.font=o,i.textBaseline="alphabetic",i.textAlign="left";const h=i.measureText(s);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(r.size*n),d=void 0!==h.actualBoundingBoxLeft?h.actualBoundingBoxLeft:0;e.width=a>0?a:l,e.height=2*c,i.font=o,i.textBaseline="alphabetic",i.textAlign="left",t?(i.clearRect(0,0,e.width,e.height),i.fillStyle="#fff"):(i.fillStyle="rgba(255,255,255,0)",i.fillRect(0,0,e.width,e.height),i.fillStyle="#000"),i.fillText(s,d,c);const f=i.getImageData(0,0,e.width,e.height);let g=0,p=0;const m=f.width;for(let t=0;t=0;t-=1){for(let e=0;e=t)return this.wL.buffer;this.wL&&(this.pO(this.wL.buffer),this.wL=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.iL.splice(this.iL.indexOf(l),1)}))}PL(t,e,i,s,r,n,o,h){const a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,t),a.readPixels(e,i,s,r,n,o,h),a.bindFramebuffer(a.FRAMEBUFFER,null)}DL(t){const e=this.wO.get(t);if(!e){const e=this.gl.createTexture();if(!e)throw new ut("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{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 mt.setTimeout(o,r)};mt.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 Sf{gO(t){if(t instanceof Ti||t instanceof Ya){const e=t.si();this.RL=e.x.scaling,this.EL=-e.x.displacement,this.zL=e.y.scaling,this.VL=-e.y.displacement,this.NL=e.x.highPrecisionOffset,this.GL=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.WL=e.y.highPrecisionOffset,this.HL=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Ii&&(this.MixedScaleXY=t.si());return this}dO(){return[this.EL,this.VL]}uO(){return[this.RL,this.zL]}UL(){return[this.NL,this.WL]}$L(){return[this.GL,this.HL]}}class vf{constructor(){this.RL=0,this.zL=0,this.YL=0,this.EL=0,this.VL=0,this.XL=0}jL(t){return this.RL=t.st(),this.EL=t.getInnerStart()+.5*this.RL*t.et(),this}ZL(t){return this.zL=t.st(),this.VL=t.getInnerStart()+.5*this.zL*t.et(),this}KL(t){return this.YL=t.st(),this.XL=t.getInnerStart()+.5*this.YL*t.et(),this}uO(){return[this.RL,this.zL,this.YL]}dO(){return[this.EL,this.VL,this.XL]}qL(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=bd.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class bf{constructor(t){this.kD=t}wD(t,e,i,s,r,n=0){const o=this.kD,h=void 0===s;if(!(s=s||o.yO()))throw new ut("Could not bind a framebuffer.");const a=o.$B(),l=o.ZB();o.fO(!1),o.qO((()=>{o.QB(0,0,i.x,i.y),t()}),s,e,n),h&&o.vO(s),this.kD.QO(r),this.kD.QB(a.x,a.y,a.width,a.height),o.fO(l)}}class Mf{constructor(t,e){this.JL=[],this.QL=[],this.uniform=t=>{const e=this.shader.AB(t);return this.QL.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.wB(t);return this.QL.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.kB(t);return this.JL.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.JL)this.glUtils.HO(t.location),this.glUtils.WO(t.location,0)}}class Af extends Cs{constructor(t,e,i,s,r){super(t,e,i,s),this.tR=new Map,this.iR=t,this.sR=e,this.kD=t.eR(),this.hR=r,this.sR=e}rR(t){return!1}iB(){return this}wD(t){if(!this.hR||0!==t||0===this.tR.size)return this;const e=Array.from(this.tR.values()).map((t=>t.nR.filter((t=>t.oR)).map((t=>t.be)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.hR;return this.kD.lL.SO(e,i),this}Zs(){return this}wt(){return 0}At(){return 0}Ct(){return 0}kt(){return 0}bo(){return 0}vo(){return 0}uc(t,e){const i={nR:[]},s=(t,e)=>{const s={be:t||[],oR:void 0===e||e};i.nR.push(s);const r={pu:t=>(s.be=t,r),Is:t=>(s.oR=t,r),Ps:()=>s.oR};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={Sg:s,...r};this.tR.set(t,i);const o=t.onDispose((()=>{this.tR.delete(t),t.offDispose(o)}));return n}}const kf=t=>{if(t instanceof Ti||t instanceof Ya)return t.oi()?"linear-highPrecision":"linear";if(t instanceof Ii){const e={};return t.x instanceof mi&&(e.x={base:t.x.Qt()}),t.y instanceof mi&&(e.y={base:t.y.Qt()}),["logarithmic",e]}return"linear"};function wf(t,i,s,r,n,o){let h=i.x.ct(t.max.x),a=i.x.ct(t.min.x),l=i.y.ct(t.max.y),u=i.y.ct(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,p=d*s.y,m=c-g,y=d-p,x=g>m?[m,g]:[g,m],S=p>y?[y,p]:[p,y];let v,b,M=1,A=1;switch(r){default:case e.GradientExtent.closestSide:if(v=x[0]/c,b=S[0]/d,n===e.GradientShape.circle){const t=Math.min(v*f,b);M=t,A=t}else M=v*f,A=b;break;case e.GradientExtent.farthestSide:if(v=x[1]/c,b=S[1]/d,n===e.GradientShape.circle){const t=Math.max(v*f,b);M=t,A=t}else M=v*f,A=b;break;case e.GradientExtent.closestCorner:if(b=S[0]/d,n===e.GradientShape.circle){v=x[0]/c*f;const t=Math.sqrt(v*v+b*b);M=t,A=t}else{v=x[0]/c;const t=Math.sqrt(v*v+b*b);M=t*f,A=t}break;case e.GradientExtent.farthestCorner:if(b=S[1]/d,n===e.GradientShape.circle){v=x[1]/c*f;const t=Math.sqrt(v*v+b*b);M=t,A=t}else{v=x[1]/c;const t=Math.sqrt(v*v+b*b);M=t*f,A=t}}return{bounds:[a*o,u*o,c*o,d*o],center:[s.x*f,s.y],distance:[Math.max(M,1e-4),Math.max(A,1e-4)],aspectRatio:f}}function Df(t,e,i,s){const r=e.x.ct(t.max.x),n=e.x.ct(t.min.x),o=e.y.ct(t.max.y),h=e.y.ct(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]}}const Ef=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=Je(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),yt(h,d)&&(d=Qe(h,Ze(Je(ti(a,h),-1)))),yt(h,a)&&(a=Qe(h,Ze(Je(ti(d,h),-1))));const s=ii(d,e),g=ii(h,e),p=ii(a,e),m=Ze(ti(g,s)),y=Ze(ti(p,g)),x=Qe(m,y),S=u(-x.y,x.x),v=u(-m.y,m.x),b=1/ri(S,v),M=Ke(S),A=Ze(ti(m,y)),k=Math.sign(ri(S,A))||1,w=ei(S,Je(o,b)),D=ei(S,Je(o,-b));if(M<1||b===1/0){let t={x:0,y:0},e={x:0,y:0},i={x:0,y:0},s={x:0,y:0};const l=u(-y.y,y.x),c=Math.sign(ri(m,S))||k,g=ei(v,Je(o,c)),p=ei(l,Je(o,c));1===k?(t=g,e=D,i=p,s=D):(t=w,e=g,i=w,s=p);const x=4*Be(d,h),M=4*Be(h,a);(b>x||b>M)&&(1===k?(t=g,e=p,i=p,s=g):(t=p,e=g,i=g,s=p));const A=Qe(h,t),E=Qe(h,e),T=Qe(h,i),I=Qe(h,s);r[n]=A,n+=1,r[n]=E,n+=1,r[n]=T,n+=1,r[n]=I,n+=1,f=4}else{const t=Qe(h,w),e=Qe(h,D);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 Tf extends js{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.aR=De,this.lR=De,this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR()}dR(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?gl(this.an.M(),this.Go.M(),this.di.M(),this.Wo.M()*l/100,this.Ho.M()*l/100,a)[0]:[this.an.M()],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.Yo=u(t,e)}else{const t=Math.floor(d/2);this.Yo=u(h[t].x,h[t].y)}this.Xo=h[1];const f=h.length-1;this.jo=h[f],this.Uo.M()&&(h.shift(),c.shift());let g=!1;(this.an.o||this.Go.o||this.di.o||this.Wo.o||this.Ho.o||this.Uo.o||this.$o.o||s)&&(this.lR=p(u(this.Tn().x-n,this.Tn().y-o),u(this.Tn().x+n,this.Tn().y+o)),g=!0,this.an.o=!1,this.Go.o=!1,this.di.o=!1,this.Wo.o=!1,this.Ho.o=!1,this.Uo.o=!1,this.$o.o=!1);const m=this.Zr();(g||m)&&this.jr!==B&&(this.Uo.M()?(this.gR&&this.kD.gl.deleteBuffer(this.gR),[this.pR,this.gR,this.mR,this.SR]=this.dR(h,c)):(this.gR&&this.kD.gl.deleteBuffer(this.gR),[this.pR,this.gR,this.mR,this.SR]=this.dR(h,void 0)),this.jr instanceof $?this.yR=wf(this.lR,this.ut,this.jr.getPosition(),this.jr.getExtent(),this.jr.getShape(),this.kD.pB()):this.jr instanceof q?this.xR=Df(this.lR,this.ut,this.jr.getAngle(!0),this.kD.pB()):(this.yR=void 0,this.xR=void 0));const y=this.jr instanceof L&&this.jr,x=this.jr instanceof q&&this.jr,S=this.jr instanceof $&&this.jr,v=y||x||S;m&&(this.bR=v?this.kD.hO(pf["2D"],pf.Color({dataType:this.jr instanceof $||this.jr instanceof q?["gradient",this.jr]:"uniform"}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.Qr(this.jr));const b=this.tn;if(b instanceof tt&&(g||this.hn(b.getThickness())||s)){this.Uo.M()?360===i?(h.pop(),c.pop(),[this.vR,this.MR]=this.fR(h,void 0,b.getThickness(),r),this._R&&this.vR?this.kD.EO(this._R,this.vR,!0):!this._R&&this.vR?this._R=this.kD.sO(this.vR,!0):this._R&&!this.vR&&(this.kD.pO(this._R),this._R=void 0),[this.AR,this.wR]=this.fR(c,void 0,b.getThickness(),r),this.kR&&this.AR?this.kD.EO(this.kR,this.AR,!0):!this.kR&&this.AR?this.kR=this.kD.sO(this.AR,!0):this.kR&&!this.AR&&(this.kD.pO(this.kR),this.kR=void 0)):([this.vR,this.MR]=this.fR(h,c,b.getThickness(),r),this._R&&this.vR?this.kD.EO(this._R,this.vR,!0):!this._R&&this.vR?this._R=this.kD.sO(this.vR,!0):this._R&&!this.vR&&(this.kD.pO(this._R),this._R=void 0),this.AR&&(this.kR&&this.kD.gl.deleteBuffer(this.kR),this.kR=void 0,this.wR=0)):(360===i&&(h.shift(),h.pop()),[this.vR,this.MR]=this.fR(h,void 0,b.getThickness(),r),this._R&&this.vR?this.kD.EO(this._R,this.vR,!0):!this._R&&this.vR?this._R=this.kD.sO(this.vR,!0):this._R&&!this.vR&&(this.kD.pO(this._R),this._R=void 0));const t=b.getFillStyle();t instanceof $?this.CR=wf(this.lR,this.ut,t.getPosition(),t.getExtent(),t.getShape(),this.kD.pB()):t instanceof q?this.TR=Df(this.lR,this.ut,t.getAngle(!0),this.kD.pB()):(this.CR=void 0,this.TR=void 0),this.IR=t===B?void 0:this.kD.hO(pf["2D"],pf.Color({dataType:t instanceof $||t instanceof q?["gradient",t]:"uniform"}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})),this.rn(b)}if(g){let t=1,e=1;b instanceof tt&&(t=b.getThickness()*r.x,e=b.getThickness()*r.y),this.aR=p(u(this.lR.min.x-t,this.lR.min.y-e),u(this.lR.max.x+t,this.lR.max.y+e))}this.FR=e&&v?this.FR||this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.PR=e&&this.tn!==J?this.PR||this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0}return this}wD(t){if(this.Jr()){const e=1===t?this.FR:this.bR,i=this.jr,s=this.gR;e&&s&&this.kD.uB(e).rO(e,((e,r,n,o)=>{if(this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).oO(o("uScaleStart_highpart"),this.yB.UL()).oO(o("uScaleStart_lowpart"),this.yB.$L()).ML(n,s,this.ut.oi(),void 0).lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0),1===t)this.kD.cO(e("uColor"),this.uR);else if(i instanceof L)this.kD.cO(e("uColor"),i.getColor());else if(i instanceof $){if(!this.yR)return!1;this.kD.yL(n,this.yR,i)}else if(i instanceof q){if(!this.xR)return!1;this.kD.xL(n,this.xR,i)}return this.kD.Hp(this.SR,this.mR),!0}));const r=this.tn;r instanceof tt&&(void 0!==this._R&&this.DR(t,this._R,this.MR,r),void 0!==this.kR&&this.DR(t,this.kR,this.wR,r))}return this}DR(t,e,i,s){const r=1===t?this.PR:this.IR,n=s.getFillStyle();r&&this.kD.uB(r).rO(r,((r,o,h,a)=>{if(this.kD.oO(r("uScale"),this.yB.uO()).oO(r("uDisp"),this.yB.dO()).ML(h,e,this.ut.oi(),void 0).lO(r("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(r("uHighlightColorOffset"),this.Br).lO(r("uRenderEffectMask"),2===t?1:0),1===t)this.kD.cO(r("uColor"),this.uR);else if(n instanceof L)this.kD.cO(r("uColor"),n.getColor());else if(n instanceof $){if(!this.CR)return!1;this.kD.yL(h,this.CR,n)}else if(n instanceof q){if(!this.TR)return!1;this.kD.xL(h,this.TR,n)}const l=s.getThickness(),u=-1===l||1===l;return this.kD.Hp(u?this.kD.gl.LINE_LOOP:this.kD.gl.TRIANGLE_STRIP,i),!0}))}rR(t){return this.cR===t&&{}}iB(){return this.BR&&(this.kD.pO(this.BR),this.BR=void 0),this.OR&&(this.kD.pO(this.OR),this.OR=void 0),this.gR&&(this.kD.pO(this.gR),this.gR=void 0),this._R&&(this.kD.pO(this._R),this._R=void 0),this.kR&&(this.kD.pO(this.kR),this.kR=void 0),this.bR=void 0,this.IR=void 0,this.FR=void 0,this.PR=void 0,this}wt(){return this.lR.max.x}At(){return this.lR.min.x}Ct(){return this.lR.max.y}kt(){return this.lR.min.y}bo(){return be(this.tn)}vo(){return be(this.tn)}}class If{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}LR(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}RR(){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}ER(){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}zR(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.RR(),this}VR(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.ER(),this}NR(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new If).LR(t))(),Pf=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Cf.RR(),n.push(t,e),r.push(Cf.first,Cf.second,Cf.third),h=void 0,o=void 0,r.push(Cf.third,Cf.fourth,Cf.second),a=Cf.third,Cf.ER(),l&&n.push(i,s),[o,h,a]),Of=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Cf.RR(),o.push(t,e),r.push(Cf.first,Cf.second,Cf.third);const c=di(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Cf.third,Cf.fourth,Cf.fifth),l=Cf.fourth),Cf.ER(),u&&o.push(i,s),[h,a,l]},Ff=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Cf.RR(),r.push(t,e),s.push(Cf.first,Cf.second,Cf.third),n=i,o=void 0,h=Cf.third,l?r.push(i):a=!0,[n,o,h,a]),Rf=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Cf.RR(),Cf.RR()):a>0&&(Cf.RR(),u>0&&(u-=1)),n.push(t),r.push(Cf.first,Cf.second,Cf.third),a=Cf.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Bf=(t,e=0)=>{Cf.LR(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],p=s[c],m=!1,y=u>0?g.y!==p.y?2:1:0;if(r>1)for(;cp.y?d.y>f.y?[a,l,u]=Pf(g,p,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Of(g,p,d,f,o,n,h,a,l,u,t):[a,l,u,m]=Ff(g,p,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,Cf.RR()),0===h.length&&u>0&&y>0&&(y-=1)):d.y>f.y?[a,l,u,y]=Rf(g,0,d,f,n,h,a,l,u,t,y):[a,l,u,y]=Rf(g,0,d,f,o,h,a,l,u,t,y)}return[h,new Uint16Array(n),new Uint16Array(o),u,y]};class zf extends Xs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.WR=0,this.Nn=Array(),this.HR=0,this.UR=new Uint16Array(0),this.$R=new Uint16Array(0),this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR()}Zs(){const t=this.qr(),e=this.kr.M(),i=this.qn;if(this.Jr()){this.yB.gO(this.ut);const s=this.ut instanceof Ii==0,r=s?this.ut.wi():void 0,n=this.Do(),o=this.ut._i()||t,h=i||this.Ao.o||o&&"disabled"!==n.type;if(h){if(this.WR=0,this.UR=new Uint16Array(0),this.$R=new Uint16Array(0),this.Nn.length=0,this.HR=0,this.wo>1){const[t,e,i,o]=Bf([s?n.packager(this.Mo,r,.5):this.Mo,s?n.packager(this._o,r,.5):this._o]);this.WR=o,this.UR=e,this.$R=i,this.Nn=t,this.HR=t.length}this.Ao.o=!1}if(this.Co&&this.Xn[0].length>1){const[t,e]=this.Xn,i=t.length,[o,h,a,l,u]=Bf([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.WR);this.WR=l;const c=o.length;for(let t=u;t0||this.wo>0?1:u;s{if(this.kD.ML(o,e,this.ut.oi(),void 0).YO(r).lO(s("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(s("uHighlightColorOffset"),this.Br).lO(s("uRenderEffectMask"),2===t?1:0),this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(s("uScale"),this.yB.uO()).oO(s("uDisp"),this.yB.dO()).oO(h("uScaleStart_highpart"),this.yB.UL()).oO(h("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(h("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(h("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(h("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(h("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(s("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(s("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),1===t)this.kD.cO(s("uColor"),this.uR);else if(i instanceof L)this.kD.cO(s("uColor"),i.getColor());else if(i instanceof $){if(!this.QR)return!1;this.kD.yL(o,this.QR,i)}else if(i instanceof q){if(!this.tE)return!1;this.kD.xL(o,this.tE,i)}else i instanceof N&&this.qR&&this.kD.LL(o,i.lut,this.qR,0);return this.kD.XO(this.rE),!0}))}const r=1===t?this.FR:this.YR;if(r&&this.iE&&this.sE){const i=this.iE,s=this.sE;this.kD.uB(r).rO(r,((r,n,o,h)=>{if(this.kD.ML(o,i,this.ut.oi(),void 0).YO(s).lO(r("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(r("uHighlightColorOffset"),this.Br).lO(r("uRenderEffectMask"),2===t?1:0),this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(r("uScale"),this.yB.uO()).oO(r("uDisp"),this.yB.dO()).oO(h("uScaleStart_highpart"),this.yB.UL()).oO(h("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(h("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(h("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(h("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(h("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(r("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(r("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),1===t)this.kD.cO(r("uColor"),this.uR);else if(e instanceof L)this.kD.cO(r("uColor"),e.getColor());else if(e instanceof $){if(!this.yR)return!1;this.kD.yL(o,this.yR,e)}else if(e instanceof q){if(!this.xR)return!1;this.kD.xL(o,this.xR,e)}else e instanceof N&&this.XR&&this.kD.LL(o,e.lut,this.XR,0);return this.kD.XO(this.eE),!0}))}return this}rR(t){return this.cR===t&&{}}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return 0}vo(){return 0}Xb(t){this.ao()>0&&this.Zs();const[e,i]=this.io(),s=e.length>2&&e[1].x0&&this.Zs();const[e,i]=this.io(),s=e.length;if(0===s)return;const r=this.Io?1:0,n=s-(this.Fo?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.nE;s+=1){const r=i-s*Math.PI/this.nE;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.MO.FD.get(e);return i||(i=new Vf(t,e),t.MO.FD.set(e,i),i)})(t,e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2),Wf={dE:(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.WO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.WO(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.WO(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.WO(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.WO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.WO(i,1),h.enableVertexAttribArray(i)}},fE:(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.WO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(r,n,h.FLOAT,!1,n*Float32Array.BYTES_PER_ELEMENT,(o+n)*Float32Array.BYTES_PER_ELEMENT),t.WO(r,1),h.enableVertexAttribArray(r)},gE:(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,4*r*Float32Array.BYTES_PER_ELEMENT,n*Float32Array.BYTES_PER_ELEMENT),e.WO(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.WO(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.WO(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(a,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(n+r+2)*Float32Array.BYTES_PER_ELEMENT),e.WO(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.WO(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.WO(i,1),h.enableVertexAttribArray(i)}},pE:(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.WO(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.WO(r,1),h.enableVertexAttribArray(r)},wD:(t,e,i,s,r,n,o)=>{const h=t.eR(),{uniform:a,uniformOptional:l}=i,u=1/t.Dh.Wh,c=(r?Math.max(n,u):Math.max(n,0))+1;h.lO(a("uThicknessPixels"),c).lO(l("uAALimit"),1-(c-1)/c).oO(a("uRatioPxClip"),[2/t.$t().x,2/t.$t().y]),e.uB(i,s).Hp(o)}},Hf={dE:(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)}},fE:(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)},wD:(t,e)=>{const i=t.eR();i.Hp(i.gl.LINE_STRIP,e,0)}};class Uf extends Zs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.$n=De,this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR(),this.mE=this.kD.eL}Zs(){const t=this.sn(),e=this.ca,i=e instanceof tt&&e,s=e instanceof Gf&&e,r=i||s,n=r&&r.getFillStyle(),o=n instanceof L&&n,h=n instanceof q&&n,a=n instanceof $&&n,l=n instanceof N&&n,c=o||h||a||l&&["x","y"].includes(l.getLookUpProperty())&&l,d=this.fi(),f=this.ui(),g=this.kr.M(),m=this.kr.o,y=e.L();if(s&&this.ut instanceof Ii)return mt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.yB.gO(this.ut),this.ma&&(this.SE&&this.kD.gl.deleteBuffer(this.SE),this.SE=this.kD.sO(qt([d,f],this.ut.oi())),this.$n=p(u(d.x,d.y),u(f.x,f.y))),t||m){const t=this.Jr()&&r&&c&&y>0,e=h?["gradient",h]:a?["gradient",a]:l?["lookup",l.getLookUpProperty()]:"uniform";if(this.yE=t?{type:"triangulated",shader:this.kD.hO(pf["2D"],pf.Color({dataType:e}),pf.LineInstanced2D({axisWorldTranslation:kf(this.ut),normalSource:void 0}),this.mE?pf.AliasedEdge:void 0,s&&pf.StippleTextureInstanced),mousePickingShader:g?this.kD.hO(pf["2D"],pf.MousePicking,pf.LineInstanced2D({axisWorldTranslation:kf(this.ut),normalSource:void 0}),s&&pf.StippleTextureInstanced):void 0,geometry:Nf(this.kD,y),thickness:y,lineStyleSolid:i,lineStyleDashed:s,fillStyleSolid:o,fillStyleLinearGradient:h,fillStyleRadialGradient:a,fillStylePaletted:l}:void 0,l){if(l&&l.lut.isValid){const t=l.getPalette();this.xE=this.iR.jR(t,this.bE,this.xE),this.bE=t}}else this.iR.oL.bt(this.bE),this.bE=void 0}if(n instanceof $?this.CR=wf(Os(this.$n,{x:this.bo(),y:this.vo()},this.ut),this.ut,n.getPosition(),n.getExtent(),n.getShape(),this.kD.pB()):n instanceof q?this.TR=Df(Os(this.$n,{x:this.bo(),y:this.vo()},this.ut),this.ut,n.getAngle(!0),this.kD.pB()):(this.CR=void 0,this.TR=void 0),s){if(t||this.ma){this.vE&&this.kD.pO(this.vE);const t=[0,0,Math.abs(f.x-d.x),Math.abs(f.y-d.y)];this.vE=this.kD.sO(t)}this.ME=this.kD.DL(s.getPattern())}else this.vE&&(this.kD.pO(this.vE),this.vE=void 0),this.ME=void 0;return this.pa(e),this.ma=!1,this.kr.o=!1,this}wD(t){var e,i;const s=this.SE;if(!s)return this;const r=this.yE;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyleDashed:l,thickness:u}=r,c=1===t?null===(e=this.yE)||void 0===e?void 0:e.mousePickingShader:null===(i=this.yE)||void 0===i?void 0:i.shader;return c?(this.kD.uB(c).rO(c,((e,i,c,d)=>{if(this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0),this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).oO(d("uScaleStart_highpart"),this.yB.UL()).oO(d("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(d("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(d("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(d("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(d("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(e("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(e("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),1===t)this.kD.cO(e("uColor"),this.uR);else if(n)this.kD.cO(e("uColor"),n.getColor());else if(h){if(!this.CR)return!1;this.kD.yL(c,this.CR,h)}else if(o){if(!this.TR)return!1;this.kD.xL(c,this.TR,o)}else if(a){if(!this.xE)return!1;this.kD.LL(c,a.lut,this.xE,0)}if(l){if(!this.vE||!this.ME)return!1;Wf.fE(this.kD,c,this.vE,i("aLengthSoFarA"),i("aLengthSoFarB"),2,0),this.kD.oO(e("uStippleCount"),[this.Wi.$t().x/this.ME.qA,this.Wi.$t().y/this.ME.qA]).lO(d("uStippleTextureWidthLimiter"),this.ME.OL/this.ME.qA).lO(e("uStippleScale"),l.getPatternScale()).aO(e("uStippleTexture"),this.ME.BL,1)}return Wf.dE(this.ut.oi(),this.kD,s,c,this.ut.oi()?4:2,0),Wf.wD(this.iR,r.geometry,c,this.mE&&1!==t,1===t,u,1),!0})),this):this}rR(t){return this.cR===t&&{}}dispose(){return super.dispose(),this.bE&&(this.iR.oL.bt(this.bE),this.bE=void 0),this.xE=void 0,this.yE=void 0,this.SE&&(this.kD.pO(this.SE),this.SE=void 0),this.vE&&(this.kD.pO(this.vE),this.vE=void 0),this.ME=void 0,this}iB(){return this}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return be(this.ca)}vo(){return be(this.ca)}}class Xf extends qs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.$n=De,this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR(),this.mE=this.kD.eL,this._E=t.Dh.Uh}Zs(){const t=this.sn(),e=this.ca,i=this.ya,s=e instanceof tt&&e,r=e instanceof Gf&&e,n=s||r,o=n&&n.getFillStyle(),h=o instanceof L&&o,a=h,l=e.L();if(r&&this.ut instanceof Ii)return mt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;if(this.yB.gO(this.ut),this.ma&&(this.SE&&(this.kD.pO(this.SE),this.SE=void 0),this.SE=this.kD.sO(qt(i,this.ut.oi())),this.$n=Ve(i)),t){const t=i.length>0&&n&&a&&l>0,e="uniform";this.yE=t?{type:"triangulated",shader:this.kD.hO(pf["2D"],pf.Color({dataType:e}),pf.LineInstanced2D({axisWorldTranslation:kf(this.ut),normalSource:void 0,snapToNearestPixel:this._E}),this.mE?pf.AliasedEdge:void 0,r&&pf.StippleTextureInstanced),geometry:Nf(this.kD,l),thickness:l,lineStyleSolid:s,lineStyleDashed:r,fillStyleSolid:h}:void 0}if(r){if(t||this.ma){this.vE&&this.kD.pO(this.vE);const t=new Float32Array(2*i.length);let e=0;for(let s=0;s{if(this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(i("uScale"),this.yB.uO()).oO(i("uDisp"),this.yB.dO()).oO(l("uScaleStart_highpart"),this.yB.UL()).oO(l("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(l("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(l("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(l("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(l("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(i("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(i("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),this._E&&this.kD.oO(l("uViewportSizePx"),[this.Wi.$t().x*this.kD.pB(),this.Wi.$t().y*this.kD.pB()]),this.kD.cO(i("uColor"),s.getColor()).lO(i("uIsHighlighted"),this.Fr).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0),n){if(!this.vE||!this.ME)return!1;Wf.pE(this.kD,a,this.vE,o("aLengthSoFarA"),o("aLengthSoFarB"),2,0),this.kD.oO(i("uStippleCount"),[this.Wi.$t().x/this.ME.qA,this.Wi.$t().y/this.ME.qA]).lO(l("uStippleTextureWidthLimiter"),this.ME.OL/this.ME.qA).lO(i("uStippleScale"),n.getPatternScale()).aO(i("uStippleTexture"),this.ME.BL,0)}return Wf.gE(this.ut.oi(),this.kD,e,a,this.ut.oi()?4:2,0),Wf.wD(this.iR,h,a,this.mE,!1,r,this.ya.length/2),!0})),this}rR(t){return this.cR===t&&{}}dispose(){return super.dispose(),this.yE=void 0,this.SE&&(this.kD.pO(this.SE),this.SE=void 0),this.vE&&(this.kD.pO(this.vE),this.vE=void 0),this.ME=void 0,this}iB(){return this}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return be(this.ca)}vo(){return be(this.ca)}}class jf{constructor(t,e){this.AE=!1,this.wE=!1,this.kE=!1,this.ut=t,this.CE=e,this.CE.Lr("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.AE="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.AE="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.wE=!0),!0===t.regularProgressiveStep&&(this.kE=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.AE?t[0].x:t[0].y,end:"x"===this.AE?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.AE?"x"===this.AE?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.TE=!0)}))}DE(t,e=!1){if(this.TE||!this.AE||"linear"!==this.PE.type)return!1;!1===e&&this.BE&&(clearTimeout(this.BE),this.BE=void 0);const i="x"===this.AE?this.PE.scale.x.ig:this.PE.scale.y.ig;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.AE?r.x:r.y,"x"===this.AE?n.x:n.y,s),h=this.PE.scale,a=Math.abs("x"===this.AE?h.wi().x:h.wi().y),l=a/o,u=Math.floor(l*Yf),c=u*o,d=mt.performance.now(),f=!(d-i.qi<500)&&(i.$i?d-i.Ki<1e3:d-i.Yi<2e3||i.ji),g=s>2*this.IE.totalDataPointsAtTime;if(f&&!g)return this.BE=setTimeout((()=>this.OE(t)),1e3),!1;const p=u>=10,m=this.IE.enabled?this.IE.columnWidthAxis/a<1.5:void 0,y=this.IE.enabled&&u>this.IE.dataPointsPerColumn?u/this.IE.dataPointsPerColumn>=2:void 0;let x;!0===this.IE.enabled?m?y&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=p?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:p&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const S=!1===e;return x?(S&&(this.IE=x),!0):(S&&(this.IE={...this.IE,totalDataPointsAtTime:s}),!1)}Qy(){this.LE=void 0,this.FE.length=0,this.BE&&(clearTimeout(this.BE),this.BE=void 0)}RE(t){if(0===t.length)return t;if(this.TE||!this.AE||"linear"!==this.PE.type||!this.IE.enabled)return t;let e;e=this.FE.length>0?re(this.FE,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.LE,h=-1,a=-1,l=0,u=0;if("x"!==this.AE||this.wE)if("x"===this.AE&&this.wE){const t=this.IE.columnWidthAxis;let c=this.LE?this.LE.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.LE=s[c-1]),s}EE(t){if(this.AE&&"linear"===this.PE.type){const e="x"===this.AE?this.PE.scale.x.ig:this.PE.scale.y.ig;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.zi===Ci.progressive||e.zi===Ci.regressive){const e=Math.abs("x"===this.AE?this.PE.scale.x.getInnerInterval():this.PE.scale.y.getInnerInterval());if(this.IE.enabled)return 2*e/this.IE.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.AE?s.x:s.y,"x"===this.AE?r.x:r.y,i)}}}zE(t,e,i){if(!this.AE)return e;const s=i.length;let r=ws(i,t.min,this.AE,this.wE,0,s-1);void 0===r&&(r=this.wE?s-1:0);let n=ws(i,t.max,this.AE,this.wE,0,s-1);return void 0===n&&(n=this.wE?0:s-1),1+Math.abs(n-r)}VE(){this.BE&&(clearTimeout(this.BE),this.BE=void 0)}OE(t){this.DE(t,!0)&&this.Gi()}}class Zf extends jf{renderVisibleOnly(t,e){const i=this.ut.x.getInnerStart(),s=this.ut.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ut.y.getInnerStart(),h=this.ut.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 qf{constructor(t,e,i){this.NE=e,this.GE=i,this.WE=t,this.HE=[]}UE(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.WE[this.WE.length-1];do{const t=this.WE.length;let r;h||(h=this.$E(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.GE&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.WE[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.WE.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.YE()}XE(t){const e=t,i=this.WE.indexOf(e);i>=0&&this.WE.splice(i,1),e.droppedTimestamp=mt.performance.now(),this.HE.push(e)}jE(){this.WE.slice().forEach((t=>this.XE(t)))}ZE(){this.WE.forEach((t=>this.NE(t))),this.HE.forEach((t=>this.NE(t))),this.WE.length=0,this.HE.length=0}$E(t,e){const i=2*t/3,s=4*t/3,r=this.HE.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.HE[r];return this.HE.splice(r,1),this.WE.push(t),t}}YE(){if(this.HE.length>5){const t=mt.performance.now();for(let e=0;e=1e4)&&(this.NE(i),this.HE.splice(e,1),e-=1)}}}}class Kf extends jf{KE(t,e){if(!e||"object"!=typeof e)return 0;const i=this.ut.x.getInnerStart(),s=this.ut.x.getInnerEnd(),r=Math.min(i,s),n=Math.max(i,s),o=this.ut.y.getInnerStart(),h=this.ut.y.getInnerEnd(),a=Math.min(o,h),l=Math.max(o,h);if("maxDataPointCount"in e)return this.qE(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.JE(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.QE(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}qE(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}QE(t,e,i,s,r,n){if(void 0===e||!this.AE)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.AE?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.AE?a.boundaries.max.x2))break;o+=1}return o}JE(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.AE){if(this.wE?"x"===this.AE?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.AE?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}tz(t,e){const i=t.reduce(((t,e)=>We(t,e.boundaries)),De);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.AE||this.wE?"x"===this.AE&&this.wE?i.max.x=Math.min(i.max.x,t):"y"!==this.AE||this.wE?"y"===this.AE&&this.wE&&(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 Jf extends Ks{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.yB=new Sf,this.Xv=[],this.iz=new Zf(this.ut,this),this.sz=new $f(this.ut,this,(()=>this.Wi.Gi())),this.ez=new qf(this.Xv,(t=>{t.coordsBuffer&&this.kD.pO(t.coordsBuffer),t.vE&&this.kD.pO(t.vE)}),!0),this.hz=new Kf(this.ut,this),this.rz=0,this.nz=0,this.oz=!1,this.sR=e,this.cR=n,this.uR=o,this.Dh=h,this.yE={type:"none"},this.kD=t.eR(),this.iR=t,this.mE=this.kD.eL;const a=this.ut.oi(),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;sqt(e,t))(a,l);this.az={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.ca.getFillStyle())}}lz(t,e){const i=new Float32Array(2*e);let s=0;if(e>0&&(i[s]=this.rz,i[s+1]=this.nz,s+=2),e>1)for(let r=1;r0,o=this.kr.M(),h=this.kr.o,a=e instanceof tt&&e,l=e instanceof Gf&&e,u=a||l,c=u&&u.getThickness(),d=u&&u.getFillStyle(),f=d instanceof L&&d,g=d instanceof q&&d,p=d instanceof $&&d,m=d instanceof N&&d,y=f||g||p||m,x=this.az.individualLookupValuesEnabled;if(l&&this.ut instanceof Ii)return mt.console.error("LightningChart JS DashedLine is not supported on logarithmic axis"),this;n&&(this.xa=re(this.xa,s,{canReturnB:!0}),this.Yn+=r);let S=this.ba.o;const v=this.hz.KE(this.Xv,this.ba.M());if(v>0){let t=0;for(let e=0;e{t.vE&&this.kD.pO(t.vE)})),this.oz=!1),M&&(this.sz.Qy(),this.Xv.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=De,t.lastDataPoint=void 0})),this.ez.jE(),b=this.xa,this.rz=0,this.nz=0);const A=this.sz.RE(b),k=A.length;if(k>0){let t=this.sz.EE(this.xa)||(this.Lr("ApplicationType",(t=>"InternalUI"===t.type))?this.Yn:1e5);k/t>10&&(t=k/10),this.ez.UE(A,t,((t,e,i,s)=>{const r=this.iz.calculateUserDataPointsBoundaries(e);return{allocatedCoordinatesCount:t,existingDataPointsCount:this.sz.zE(r,i,this.xa)-s,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.kD.LO(t*this.az.attributesPerVertex,this.az.prepareRenderData(e,i)),lastDataPoint:e[i-1],vE:this.kD.LO(2*t,this.lz(e,i))}}),((t,e,i,s)=>{const r=We(t.boundaries,this.iz.calculateUserDataPointsBoundaries(e)),n=this.sz.zE(r,t.existingCoordinatesCount+i,this.xa)-(t.jointPointsCount+s);this.kD.RO(t.coordsBuffer,t.existingCoordinatesCount*this.az.attributesPerVertex,this.az.prepareRenderData(e,i)),l&&t.vE&&this.kD.RO(t.vE,2*t.existingCoordinatesCount,this.lz(e,i)),t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}if(S&&(this.$n=this.hz.tz(this.Xv,this.ba.M())),this.yB.gO(this.ut),p?this.CR=wf(this.Er(),this.ut,p.getPosition(),p.getExtent(),p.getShape(),this.kD.pB()):g?this.TR=Df(this.Er(),this.ut,g.getAngle(!0),this.kD.pB()):(this.CR=void 0,this.TR=void 0),i||h){if(m&&"value"===m.getLookUpProperty()&&!x){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw mt.alert(t),new Error(t)}if(y&&u&&!1!==c){const t=-1===c?"primitive":"triangulated",e=g?["gradient",g]:p?["gradient",p]:m?["lookup",m.getLookUpProperty()]:"uniform";this.yE="primitive"===t?{type:t,shader:this.kD.hO(pf["2D"],pf.Color({dataType:e}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0}),l&&pf.StippleTexture),mousePickingShader:o?this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0}),l&&pf.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:p,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.kD.hO(pf["2D"],pf.Color({dataType:e}),pf.LineInstanced2D({axisWorldTranslation:kf(this.ut),normalSource:void 0}),this.mE?pf.AliasedEdge:void 0,l&&pf.StippleTextureInstanced),mousePickingShader:o?this.kD.hO(pf["2D"],pf.MousePicking,pf.LineInstanced2D({axisWorldTranslation:kf(this.ut),normalSource:void 0}),l&&pf.StippleTextureInstanced):void 0,geometry:Nf(this.kD,c),thickness:c,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:p,fillStylePaletted:m}:{type:"none"}}else this.yE={type:"none"};if(m){if(m&&m.lut.isValid){const t=m.getPalette();this.xE=this.iR.jR(t,this.bE,this.xE),this.bE=t}}else this.iR.oL.bt(this.bE),this.bE=void 0}return this.ME=l?this.kD.DL(l.getPattern()):void 0,this.pa(e),this.qn=!1,this.Xn=[],this.kr.o=!1,this.ba.o=!1,this}wD(t){const e=this.kD.gl,i=this.yE;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.kD.uB(s).rO(s,((s,l,u,c)=>{let d=!1;if(this.kD.lO(s("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(s("uHighlightColorOffset"),this.Br).lO(s("uRenderEffectMask"),2===t?1:0),this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(s("uScale"),this.yB.uO()).oO(s("uDisp"),this.yB.dO()).oO(c("uScaleStart_highpart"),this.yB.UL()).oO(c("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(c("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(c("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(c("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(c("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(s("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(s("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),1===t)this.kD.cO(s("uColor"),this.uR);else if(n)this.kD.cO(s("uColor"),n.getColor());else if(h){if(!this.CR)return!1;this.kD.yL(u,this.CR,h)}else if(o){if(!this.TR)return!1;this.kD.xL(u,this.TR,o)}else if(a){if(!this.xE)return!1;this.kD.LL(u,a.lut,this.xE,0)}return this.iz.renderVisibleOnly(this.Xv,(n=>{const{coordsBuffer:o}=n;if(!o)return;e.bindBuffer(e.ARRAY_BUFFER,o);const h="triangulated"===i.type?Wf.dE:Hf.dE;if(this.ut.oi()||void 0===this.az.attributeOffsetCoordinateLowPrecision?this.ut.oi()&&void 0!==this.az.attributeOffsetCoordinateHighPrecision&&h(!0,this.kD,o,u,this.az.attributesPerVertex,this.az.attributeOffsetCoordinateHighPrecision):h(!1,this.kD,o,u,this.az.attributesPerVertex,this.az.attributeOffsetCoordinateLowPrecision),r){if(!n.vE||!this.ME)return;"triangulated"===i.type?Wf.fE(this.kD,u,n.vE,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):Hf.fE(this.kD,u,n.vE,l("aLengthSoFar"),2,0),this.kD.oO(s("uStippleCount"),[this.Wi.$t().x/this.ME.qA,this.Wi.$t().y/this.ME.qA]).lO(c("uStippleTextureWidthLimiter"),this.ME.OL/this.ME.qA).lO(s("uStippleScale"),r.getPatternScale()).aO(s("uStippleTexture"),this.ME.BL,1)}if(a&&"value"===a.lookUpProperty&&void 0!==this.az.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.kD.WO(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.az.attributeOffsetLookUpValue+this.az.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.kD.WO(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if("triangulated"===i.type){const{thickness:e}=i;Wf.wD(this.iR,i.geometry,u,this.mE&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else Hf.wD(this.iR,n.existingCoordinatesCount);d=!0})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}rR(t){return this.cR===t&&{}}xt(t,e){return Array.isArray(t)||(t=[t]),this.Xn=re(this.Xn,t,{canReturnB:!0}),this.$n=We(this.$n,e||this.iz.calculateUserDataPointsBoundaries(t)),this}no(){return super.no(),this.rz=0,this.nz=0,this}dispose(){return super.dispose(),this.ez.ZE(),this.sz.VE(),this.bE&&(this.iR.oL.bt(this.bE),this.bE=void 0),this.yE={type:"none"},this.xE=void 0,this.ME=void 0,this}iB(){return this}Xb(t){this.ao()>0&&this.Zs();const e=this.io(),i=bs(e,t,this.Kn,this.Io,this.Fo,this.ut,this.engine.ut,this.$n,this.iz.AE,this.iz.wE);return void 0!==i?e[i]:void 0}yw(t){this.ao()>0&&this.Zs();const e=this.io(),i=e.length;if(0===i)return;const s=this.Io?1:0,r=i-(this.Fo?2:1);if(this.Kn===Ss.Nearest){let s,r,n=ke;for(let o=0;o{const e=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 Qf(t,e)},eg=t=>{const e=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new Qf(t,e)},ig=(t,e,i)=>{let s=e.MO.ID.get(t);return s||(s=i(e),e.MO.ID.set(t,s)),s};class sg extends Ns{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.aR=p(c(we,we),c(ke,ke)),this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR()}Zs(){const t=this.kr.M(),i=this.kr.o,s=this.Xn,r=s.length,n=r>0,o=this.Gn.M(),h=this.jr,a=this.size.M(),l=this.ut._i(),c=this.size.o||this.Gn.o,d=this.qn||s&&s.length>0,f=l||c;if(n&&(this.Nn=re(this.Nn,s,{canReturnB:!0}),this.Yn+=r),n||this.qn){this.$n=this.Zn?We(this.$n,this.Zn):We(this.$n,Ve(this.Nn));const t=qt(this.Nn,this.ut.oi());this.fz=this.Yn,this.gz=this.kD.sO(t)}if(this.yB.gO(this.ut),c||this.Zr()||i){const e=this.Wn.M()?"attribute":"uniform",i=a<=1&&pf.PointSize(e),s=pf.VertexLocation({offset:a>1?{dataType:e,sizeUnit:"px",symmetric:!0,rotation:(this.Hn.M()||this.dn.M()%360!=0)&&{dataType:this.Hn.M()?"attribute":"uniform"}}:void 0,axisWorldTranslation:kf(this.ut),normalSource:void 0}),r=this.jr instanceof L&&this.jr,n=this.jr instanceof $&&this.jr,o=this.jr instanceof q&&this.jr,h=this.jr instanceof N&&this.jr,l=this.jr instanceof G&&this.jr,u=r||n||o||h||l;this.bB=u?this.kD.hO(pf["2D"],i,s,r?pf.Color({dataType:"uniform"}):l?pf.Color({dataType:"attribute"}):h?pf.Color({dataType:["lookup",h.getLookUpProperty()]}):n?pf.Color({dataType:["gradient",n]}):o?pf.Color({dataType:["gradient",o]}):void 0):void 0,this.FR=t&&u?this.kD.hO(pf["2D"],i,s,pf.MousePicking):void 0}if(h!==B?f&&(this.pz&&(this.pz=void 0),a>1||h instanceof G?a<=1?this.uE=this.kD.gl.POINTS:o===e.PointShape.Triangle?(this.pz=ig(e.PointShape.Triangle,this.kD,tg),this.uE=this.kD.gl.TRIANGLES):o===e.PointShape.Circle?(this.pz=ig(e.PointShape.Circle,this.kD,(t=>((t,e)=>{const i=function(t=25){return gl(u(0,0),0,360,.5,.5,t)[0]}(24);return new Qf(t,i)})(t))),this.uE=this.kD.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.pz=ig(e.PointShape.Square,this.kD,eg),this.uE=this.kD.gl.TRIANGLES):this.uE=this.kD.gl.POINTS:this.uE=this.kD.gl.POINTS):this.pz&&(this.pz=void 0),d||this.Zr()){const t=this.Nn.length;if(h instanceof G&&this.fz&&this.fz>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=hi(this.dn.M()),s=Math.sin(i),r=Math.cos(i);for(let i=0;i0){const e=new Float32Array(t);for(let i=0;i{if(this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).oO(o("uScaleStart_highpart"),this.yB.UL()).oO(o("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(o("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(o("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(o("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(o("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(e("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(e("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),this.kD.ML(n,i,this.ut.oi(),this.pz?1:void 0).lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).lO(o("uDevicePixelRatio"),this.kD.pB()),this.pz){const t=r("aInstanceGeo");this.kD.NO(t,this.pz.HD).WO(t,0)}if(1===t)this.kD.cO(e("uColor"),this.uR);else if(this.jr instanceof L)this.kD.cO(e("uColor"),this.jr.getColor());else if(this.jr instanceof G&&this.mz){const t=r("aColor");this.kD.UO(t,this.mz),this.uE!==this.kD.gl.POINTS&&this.kD.WO(t,1)}else if(this.jr instanceof N&&this.xE){if("value"===this.jr.getLookUpProperty()&&this.xz){const t=r("aLookupValue");this.kD.$O(t,this.xz),this.uE!==this.kD.gl.POINTS&&this.kD.WO(t,1)}this.kD.LL(n,this.jr.lut,this.xE,0)}else if(this.jr instanceof $){if(!this.yR)return!1;this.kD.yL(n,this.yR,this.jr)}else if(this.jr instanceof q){if(!this.xR)return!1;this.kD.xL(n,this.xR,this.jr)}if(this.Sz&&this.uE!==this.kD.gl.POINTS){const t=r("aOffsetPixels");this.kD.$O(t,this.Sz),this.uE!==this.kD.gl.POINTS&&this.kD.WO(t,1)}else if(this.uE!==this.kD.gl.POINTS){const t=e("uOffsetPixels");this.kD.lO(t,this.size.M())}if(this.yz&&this.uE!==this.kD.gl.POINTS){const t=r("aRot");this.kD.NO(t,this.yz),this.uE!==this.kD.gl.POINTS&&this.kD.WO(t,1)}else if(this.uE!==this.kD.gl.POINTS&&this.dn.M()%360!=0){const t=hi(this.dn.M()),i=Math.sin(t),s=Math.cos(t);this.kD.oO(e("uRot"),[i,s])}if(this.uE===this.kD.gl.POINTS)this.kD.lO(e("uPointSize"),this.size.M());else{const t={x:2/this.Wi.$t().x,y:2/this.Wi.$t().y};this.kD.oO(e("uRatioPxClip"),[t.x,t.y])}let h=!1;return this.uE===this.kD.gl.POINTS?(this.kD.Hp(this.uE,s),h=!0):this.pz&&(this.kD.jO(this.uE,0,this.pz.dz,s),h=!0),h}))),this}rR(t){return this.cR===t&&{}}Ix(t){this.ao()>0&&this.Zs();const e=this.io(),i=bs(e,t,this.Kn,!1,!1,this.ut,this.Wi.ut,this.$n,void 0,void 0);return void 0!==i?e[i]:void 0}As(t){return super.As(t)}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return.5*this.size.M()}vo(){return.5*this.size.M()}iB(){return this.gz&&(this.kD.pO(this.gz),this.gz=void 0),this.pz&&(this.pz=void 0),this.mz&&(this.kD.gl.deleteBuffer(this.mz),this.mz=void 0),this.yz&&(this.kD.pO(this.yz),this.yz=void 0),this.xz&&(this.kD.pO(this.xz),this.xz=void 0),this}}class rg extends Ls{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.yE={fill:void 0,border:void 0},this.yB=new Sf,this.$n=De,this.bz=!1,this.vz=!1,this.Mz=!1,this._z=!1,this.Hu=[],this.iR=t,this.sR=e,this.Az=n,this.kD=t.eR(),this.mE=this.kD.eL}Te(){const t=this.Az(),e={Js:t=>this.wz(e,t),zr:t=>this.kz(e,t),yo:t=>this.Cz(e,t),hb:t=>this.Tz(e,t),Nn:[],u:void 0,Fr:0,Iz:!0,cR:t.id,uR:t.color};return this.Hu.push(e),e}no(){return this.Hu.length=0,this.bz=!0,this}wz(t,e){return t.Iz=e,this._z=!0,t}kz(t,e){return t.Fr=e,this.Mz=!0,t}Cz(t,e){return t.Nn=e,this.bz=!0,t}Tz(t,e){return t.u=e,this.vz=!0,t}Zs(){const t=this.kr.M(),e=this.kr.o,i=this.Zr(),s=this.Mz,r=this.bz,n=this.vz,o=this._z,a=this.tn,l=this.sn(),u=this.Hu.filter((t=>t.Iz));if(this.yB.gO(this.ut),(r||o)&&(this.$n=We(...u.map((t=>Ve(t.Nn))))),r||o){this.SE&&(this.kD.gl.deleteBuffer(this.SE),this.SE=void 0),this.Fz&&(this.kD.gl.deleteBuffer(this.Fz),this.Fz=void 0);const t=qt(u.map((t=>[...t.Nn,t.Nn[0],{x:Number.NaN,y:Number.NaN}])).flat(),this.ut.oi()),e=this.ut.oi()?4:2;this.SE=this.kD.sO(t);let i=[];u.reduce(((s,r)=>{const n=s,o=(r.Nn.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.Nn.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=t.Nn.length+2;for(let r=i;rt+e.Nn.length+2),0),e=new Float32Array(4*t);let i=0;u.forEach((t=>{const s=t.Nn.length+2;for(let r=i;rt+e.Nn.length+2),0),e=new Float32Array(t);let i=0;u.forEach((t=>{const s=void 0!==t.u?t.u:-34028234663852886e22,r=t.Nn.length+2;for(let t=i;t{if(this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).oO(f("uScaleStart_highpart"),this.yB.UL()).oO(f("uScaleStart_lowpart"),this.yB.$L()).ML(d,n,this.ut.oi(),void 0).YO(u).$O(s("aIsHighlighted"),1===t||2===t?this.kD.dL:o).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0),1===t){if(!h)return!1;this.kD.UO(s("aColor"),h)}else if(i)this.kD.cO(e("uColor"),i.getColor());else if(a){if(!this.yR)return!1;this.kD.yL(d,this.yR,a)}else if(r){if(!this.xR)return!1;this.kD.xL(d,this.xR,r)}else if(l){if(!this.xE)return!1;if(this.kD.LL(d,l.lut,this.xE,0),"value"===l.getLookUpProperty()){if(!this.Lz)return!1;this.kD.$O(s("aLookupValue"),this.Lz)}}return this.kD.XO(c),!0}))}if(r){const{geometry:e,fillStyleSolid:s,thickness:a}=r,l=this.Dz,u=1===t?null===(i=r.mousePicking)||void 0===i?void 0:i.shader:r.shader;if(!u||!n||!l)return this;this.kD.uB(u).rO(u,((i,r,u,c)=>{if(this.kD.nO(1===t||2===t?this.kD.dL:o,1,{location:r("aIsHighlighted"),size:1}).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0),this.ut instanceof Ti?this.kD.oO(i("uScale"),this.yB.uO()).oO(i("uDisp"),this.yB.dO()).oO(c("uScaleStart_highpart"),this.yB.UL()).oO(c("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(c("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(c("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(c("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(c("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(i("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(i("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),1===t){if(!h)return!1;this.kD.nO(h,1,{location:r("aColor"),size:4})}else s&&this.kD.cO(i("uColor"),s.getColor());return Wf.dE(this.ut.oi(),this.kD,n,u,this.ut.oi()?4:2,0),Wf.wD(this.iR,e,u,this.mE&&1!==t,1===t,a,l),!0}))}return this}rR(t){const e=this.Hu.find((e=>e.cR===t));return!!e&&{collectionMember:e}}iB(){return this.Fz&&(this.kD.pO(this.Fz),this.Fz=void 0),this.SE&&(this.kD.pO(this.SE),this.SE=void 0),this.Bz&&(this.kD.pO(this.Bz),this.Bz=void 0),this.Oz&&(this.kD.pO(this.Oz),this.Oz=void 0),this.Lz&&(this.kD.pO(this.Lz),this.Lz=void 0),this.yE={fill:void 0,border:void 0},this.xE=void 0,this}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return be(this.tn)}vo(){return be(this.tn)}}class ng extends Ws{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.Rz=De,this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR(),this.sR=e}Zs(){super.Zs();const t=this.kr.M(),e=this.Zr(),i=this.an.o||this.Y.o||this.dn.o||this.gn.o,s=this.tn,r=this.sn(),n=s.getThickness(),o=this.hn(n),h=this.dn.M();this.yB.gO(this.ut);const a=this.ut._i();if(i||a){const t=this.Y.M();this.Nn=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]=Ye(n[0],r,t),n[1]=Ye(n[1],r,t),n[2]=Ye(n[2],r,t),n[3]=Ye(n[3],r,t)}return n}(this.an.M(),t.x,t.y,h,this.gn.M()),this.gR&&this.kD.gl.deleteBuffer(this.gR);const e=qt(this.Nn,this.ut.oi());this.gR=this.kD.sO(e),this.mR=this.Nn.length}this.Rz=Ve(this.Nn);const l=this.jr instanceof L&&this.jr,c=this.jr instanceof $&&this.jr,d=this.jr instanceof q&&this.jr,f=this.jr instanceof hd&&this.jr,g=l||c||d||f;if(e&&(this.bR=g?this.kD.hO(pf["2D"],l&&pf.Color({dataType:"uniform"}),d&&pf.Color({dataType:["gradient",d]}),c&&pf.Color({dataType:["gradient",c]}),f&&pf.Color({dataType:["image",f.getFitMode()]}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0),c?this.yR=wf(this.Ir||this.Rz,this.ut,c.getPosition(),c.getExtent(),c.getShape(),this.kD.pB()):d?this.xR=Df(this.Ir||this.Rz,this.ut,d.getAngle(!0),this.kD.pB()):(this.yR=void 0,this.xR=void 0),f){const t=f.getSource();if((!this.Ez||e)&&t){this.Ez&&(this.Ez.texture.dB(this),this.kD.pO(this.Ez.texCoordsBuffer));const e=this.kD.bL(t);e.uB(this),this.Ez={texture:e,texCoordsBuffer:this.kD.sO([]),sourceMissingTexture:this.kD.pL(new Uint8Array(Object.values(f.getSourceMissingColor().toJS()).map((t=>255*t))),this.kD.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{this.Ez&&f&&(this.zz(),this.Wi.Gi())}},e.VB(this.Ez.textureReadyCallback),this.zz()}this.Ez&&this.Ez.texture.DB&&this.Ez.texture.PB&&this.Ez.texture.TB&&(this.Ez.texture.Zs(),this.Wi.Gi()),(a||i)&&this.Ez&&this.Ez.texture.DB&&this.zz()}else this.Ez&&(this.Ez.texture.dB(this),this.kD.pO(this.Ez.texCoordsBuffer),this.Ez=void 0);if(i||o||a&&1!==n){if(1===n||-1===n)[this.vR,this.Vz]=[this.Nn,void 0];else{const t=this.ut;[this.vR,this.Vz]=t instanceof Ii?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.ki(s,r,h,-h),i.ki(r,s,-h,-h),i.ki(o,n,-h,-h),i.ki(n,o,h,-h),i.ki(s,r,-h,h),i.ki(r,s,h,h),i.ki(o,n,h,h),i.ki(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.Nn,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=Ze($e(r,s)),l=Ze($e(o,s)),c=si(a),d=si(l);return[[Qe(s,Qe(Je(c,h.x),Je(d,h.y))),Qe(r,Qe(Je(a,h.x),Je(d,h.y))),Qe(o,Qe(Je(c,h.x),Je(l,h.y))),Qe(n,Qe(Je(a,h.x),Je(l,h.y))),Qe(s,Qe(Je(a,h.x),Je(l,h.y))),Qe(r,Qe(Je(c,h.x),Je(l,h.y))),Qe(o,Qe(Je(a,h.x),Je(d,h.y))),Qe(n,Qe(Je(c,h.x),Je(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.Nn,t.wi(),n)}this._R&&this.kD.gl.deleteBuffer(this._R),this.lE&&this.kD.gl.deleteBuffer(this.lE),this._R=this.kD.sO(qt(this.vR,this.ut.oi())),this.Vz?(this.lE=this.kD.zO(new Uint16Array(this.Vz)),this.MR=this.Vz.length):(this.lE=void 0,this.MR=this.vR.length)}const p=s instanceof tt&&s,m=p&&p.getFillStyle(),y=m&&m instanceof q&&m,x=m&&m instanceof $&&m,S=p,v=m&&m instanceof L&&m||y||x;return r&&(this.IR=S&&v?this.kD.hO(pf["2D"],pf.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0),x?this.CR=wf(this.Rz,this.ut,x.getPosition(),x.getExtent(),x.getShape(),this.kD.pB()):y?this.TR=Df(this.Rz,this.ut,y.getAngle(!0),this.kD.pB()):(this.CR=void 0,this.TR=void 0),this.FR=t&&g?this.FR||this.kD.hO(pf["2D"],pf.Color({dataType:"uniform"}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.PR=t&&this.tn!==J?this.PR||this.kD.hO(pf["2D"],pf.Color({dataType:"uniform"}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.Qr(this.jr),this.rn(s),this.an.o=!1,this.dn.o=!1,this.Y.o=!1,this.gn.o=!1,this}rR(t){return this.cR===t&&{}}zz(){if(this.Ez&&this.jr instanceof hd){const t=nt(this.Tn(),this.ut,this.Wi.ut),i=ti(nt(Qe(this.Tn(),this.$t()),this.ut,this.Wi.ut),t);this.Ez.texCoordsBuffer&&this.kD.pO(this.Ez.texCoordsBuffer),this.Ez.texCoordsBuffer=this.kD.sO(((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,p=0,m=1;switch(n){case e.ImageFitMode.Fill:u{if(this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).oO(h("uScaleStart_highpart"),this.yB.UL()).oO(h("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(h("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(h("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(h("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(h("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(e("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(e("uViewportSize"),this.yB.MixedScaleXY.uViewportSize),1===t)this.kD.cO(e("uColor"),this.uR);else if(r instanceof L)this.kD.cO(e("uColor"),r.getColor());else if(r instanceof $){if(!this.yR)return!1;this.kD.yL(o,this.yR,r)}else if(r instanceof q){if(!this.xR)return!1;this.kD.xL(o,this.xR,r)}else if(r instanceof hd){if(!this.Ez)return!1;const t=this.Ez&&this.Ez.texture.GB();this.kD.cO(h("uColor"),r.getSurroundingColor()).aO(e("uColorTexture"),t||this.Ez.sourceMissingTexture,0).nO(this.Ez.texCoordsBuffer,void 0,{location:n("aTextureCoord"),size:2}).OO(r.fitMode)}return this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).ML(o,i,this.ut.oi(),void 0).Hp(this.kD.gl.TRIANGLE_FAN,s),!0})));const n=1===t?this.PR:this.IR,o=this.tn,h=this._R;return n&&h&&o instanceof tt&&(this.kD.uB(n),this.kD.rO(n,((e,i,s,r)=>{this.ut instanceof Ti||this.ut instanceof Ya?this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).oO(r("uScaleStart_highpart"),this.yB.UL()).oO(r("uScaleStart_lowpart"),this.yB.$L()):this.ut instanceof Ii&&this.kD.oO(r("uScaleStart"),this.yB.MixedScaleXY.uScaleStart).oO(r("uScaleStartLog"),this.yB.MixedScaleXY.uScaleStartLog).oO(r("uScaleInterval"),this.yB.MixedScaleXY.uScaleInterval).oO(r("uScaleIntervalLog"),this.yB.MixedScaleXY.uScaleIntervalLog).oO(e("uViewportStart"),this.yB.MixedScaleXY.uViewportStart).oO(e("uViewportSize"),this.yB.MixedScaleXY.uViewportSize);const n=o.getFillStyle();if(1===t)this.kD.cO(e("uColor"),this.uR);else if(n instanceof L)this.kD.cO(e("uColor"),n.getColor());else if(n instanceof $){if(!this.CR)return!1;this.kD.yL(s,this.CR,n)}else if(n instanceof q){if(!this.TR)return!1;this.kD.xL(s,this.TR,n)}return this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).ML(s,h,this.ut.oi(),void 0),this.lE?this.kD.YO(this.lE).XO(this.MR):this.kD.Hp(this.kD.gl.LINE_LOOP,this.MR),!0}))),this}iB(){return this.lE&&(this.kD.pO(this.lE),this.lE=void 0),this.gR&&(this.kD.pO(this.gR),this.gR=void 0),this._R&&(this.kD.pO(this._R),this._R=void 0),this.Ez&&(this.Ez.texture.dB(this),this.Ez.texture.NB(this.Ez.textureReadyCallback),this.kD.sB(this.Ez.sourceMissingTexture),this.kD.pO(this.Ez.texCoordsBuffer),this.Ez=void 0),this.bR=void 0,this.IR=void 0,this.FR=void 0,this.PR=void 0,this}wt(){return Math.max(this.an.M().x,this.an.M().x+this.Y.M().x)}At(){return Math.min(this.an.M().x,this.an.M().x+this.Y.M().x)}Ct(){return Math.max(this.an.M().y,this.an.M().y+this.Y.M().y)}kt(){return Math.min(this.an.M().y,this.an.M().y+this.Y.M().y)}bo(){return be(this.tn)}vo(){return be(this.tn)}}class og extends Us{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new Sf,this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR(),this.sR=e}Ix(t){let e,i=Number.MAX_VALUE;for(const s of this.Nn){const r=Be(nt(s,this.ut,this.Wi.ut),t);r=3,r=this.tn,n=this.sn(),o=r.getThickness(),a=this.hn(o);this.yB.gO(this.ut),this._M=this.ut.wi();const l=this.ut._i();if(i&&(this.$n=Ve(this.Nn)),i&&(this.gR&&(this.kD.gl.deleteBuffer(this.gR),this.gR=void 0),s)){const t=qt(this.Nn,this.ut.oi());this.gR=this.kD.sO(t),this.Nz=new Uint16Array(h.default(t)),this.Gz&&this.kD.gl.deleteBuffer(this.Gz),this.Gz=this.kD.zO(this.Nz),this.mR=this.Nz.length}const u=this.jr instanceof L&&this.jr,c=this.jr instanceof N&&this.jr,d=this.jr instanceof $&&this.jr,f=this.jr instanceof q&&this.jr,g=u||c&&"value"!==c.getLookUpProperty()&&c||f||d;if(e){if(c){const t=c.getPalette();this.xE=this.iR.jR(t,this.bE,this.xE),this.bE=t}else this.iR.oL.bt(this.bE),this.bE=void 0;this.bR=g?this.kD.hO(pf["2D"],u&&pf.Color({dataType:"uniform"}),f&&pf.Color({dataType:["gradient",f]}),d&&pf.Color({dataType:["gradient",d]}),c&&pf.Color({dataType:["lookup",c.getLookUpProperty()]}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0}if(d?this.yR=wf(this.Ir||this.$n,this.ut,d.getPosition(),d.getExtent(),d.getShape(),this.kD.pB()):f?this.xR=Df(this.Ir||this.$n,this.ut,f.getAngle(!0),this.kD.pB()):(this.yR=void 0,this.xR=void 0),(i||a||l&&1!==o)&&(this._R&&(this.kD.pO(this._R),this._R=void 0),s)){const t=1===o||-1===o?this.Nn:Ef(this.Nn,this._M,o);this.vR=qt(t,this.ut.oi()),this._R=this.kD.sO(this.vR,!0),this.MR=t.length}const p=r instanceof tt&&r,m=p&&p.getFillStyle(),y=m&&m instanceof q&&m,x=m&&m instanceof $&&m,S=p,v=m&&m instanceof L&&m||y||x;return n&&(this.IR=S&&v?this.kD.hO(pf["2D"],pf.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0),x?this.CR=wf(this.Ir||this.$n,this.ut,x.getPosition(),x.getExtent(),x.getShape(),this.kD.pB()):y?this.TR=Df(this.Ir||this.$n,this.ut,y.getAngle(!0),this.kD.pB()):(this.CR=void 0,this.TR=void 0),this.FR=t&&g?this.FR||this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.PR=t&&this.tn!==J?this.FR||this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.So=!1,this.Qr(this.jr),this.rn(r),this}wD(t){const e=this.jr,i=1===t?this.FR:this.bR,s=this.gR,r=this.mR;i&&s&&r&&this.kD.uB(i).rO(i,((i,r,n,o)=>{if(this.kD.oO(i("uScale"),this.yB.uO()).oO(i("uDisp"),this.yB.dO()).oO(o("uScaleStart_highpart"),this.yB.UL()).oO(o("uScaleStart_lowpart"),this.yB.$L()).ML(n,s,this.ut.oi(),void 0).YO(this.Gz).lO(i("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0),1===t)this.kD.cO(i("uColor"),this.uR);else if(e instanceof L)this.kD.cO(i("uColor"),e.getColor());else if(e instanceof $){if(!this.yR)return!1;this.kD.yL(n,this.yR,e)}else if(e instanceof q){if(!this.xR)return!1;this.kD.xL(n,this.xR,e)}else e instanceof N&&this.xE&&this.kD.LL(n,e.lut,this.xE,0);return this.kD.XO(this.mR),!0}));const n=1===t?this.PR:this.IR,o=this.tn,h=this._R,a=this.MR;return n&&h&&a&&this.kD.uB(n).rO(n,((e,i,s,r)=>{this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).ML(s,h,this.ut.oi(),void 0);const n=o.getFillStyle();if(1===t)this.kD.cO(e("uColor"),this.uR);else if(n instanceof L)this.kD.cO(e("uColor"),n.getColor());else if(n instanceof $){if(!this.CR)return!1;this.kD.yL(s,this.CR,n)}else if(n instanceof q){if(!this.TR)return!1;this.kD.xL(s,this.TR,n)}const a=o.getThickness(),l=-1===a||1===a;return this.kD.Hp(l?this.kD.gl.LINE_LOOP:this.kD.gl.TRIANGLE_STRIP,this.MR),!0})),this}rR(t){return this.cR===t&&{}}iB(){return this.Gz&&(this.kD.pO(this.Gz),this.Gz=void 0),this.gR&&(this.kD.pO(this.gR),this.gR=void 0),this._R&&(this.kD.pO(this._R),this._R=void 0),this.bR=void 0,this.IR=void 0,this.FR=void 0,this.PR=void 0,this.xE=void 0,this}}const hg=(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},lg=(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(!Ce(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=Pe(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.pL(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.pL(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.pL(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},dg=(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 fg extends _s{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Wz=y("bilinear"),this.Fa=ds.lineStyle,this.engine=t,this.$n=p({x:Math.min(n.start.x,n.start.x+n.columns*n.step.x),y:Math.min(n.start.y,n.start.y+n.rows*n.step.y)},{x:Math.max(n.start.x,n.start.x+n.columns*n.step.x),y:Math.max(n.start.y,n.start.y+n.rows*n.step.y)});const o="columns"===n.dataOrder?n.columns:n.rows,h="columns"===n.dataOrder?n.rows:n.columns;this.Dh={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}qS(t){return this.Wz.S(t),this}JS(){return this.Wz.M()}Pa(t){return this.Fa="function"==typeof t?t(this.Fa):t,this}Da(){return this.Fa}}class gg extends fg{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.yB=new Sf,this.yE={},this.Uz=[],this.$z=!1,this.qn=!1,this.Yz=hg,this.iR=t,this.sR=e,this.cR=o,this.uR=h,this.kD=t.eR(),this.sR=e;const a=Math.min(this.kD.tB,2048),l={x:Math.min(a,this.Dh.primaryDimensionVectorsCount),y:Math.min(a,this.Dh.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.Dh,l,this.Yz),c=u.gridTiles.map((t=>{const e="columns"===this.Dh.dataOrder?{x:this.Dh.start.x+this.Dh.step.x*t.iFirstVector.primary,y:this.Dh.start.y+this.Dh.step.y*t.iFirstVector.secondary}:{x:this.Dh.start.x+this.Dh.step.x*t.iFirstVector.secondary,y:this.Dh.start.y+this.Dh.step.y*t.iFirstVector.primary},i="columns"===this.Dh.dataOrder?{x:this.Dh.step.x*t.sizeHeatmapDataVectors.primary,y:this.Dh.step.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Dh.step.x*t.sizeHeatmapDataVectors.secondary,y:this.Dh.step.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Dh.dataOrder?{x:this.Dh.start.x+this.Dh.step.x*t.iFirstUniqueVector.primary,y:this.Dh.start.y+this.Dh.step.y*t.iFirstUniqueVector.secondary}:{x:this.Dh.start.x+this.Dh.step.x*t.iFirstUniqueVector.secondary,y:this.Dh.start.y+this.Dh.step.y*t.iFirstUniqueVector.primary},r="columns"===this.Dh.dataOrder?{x:this.Dh.step.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Dh.step.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Dh.step.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Dh.step.y*t.sizeUniqueHeatmapDataVectors.primary},n=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary);return{...t,startLocationAxis:e,startRenderLocationAxis:s,sizeAxis:i,renderSizeAxis:r,intensityData:n,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.Xz={gridTiles:c,gridTileSizes:d}}Zs(){const t=this.Uz,e=this.jr,i=this.Zr(),s=this.Fa,r=s!==this.qa,n=e instanceof N&&e,o=e instanceof L&&e,h=n&&n.getPalette(),a=this.Wz.o,l=this.Wz.M(),u=this.qn,c=this.kr.M();this.jz=this.jz||this.Zz();const d=this.jz,f=lg(t,d,u?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));f.size>0&&(dg(this.kD,f,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.$z=!0),this.yB.gO(this.ut);const g=this.yE;if((i||a)&&(h?(this.Kz=this.iR.jR(h,this.qz,this.Kz),this.qz=h):(this.Kz=void 0,this.iR.oL.bt(this.qz),this.qz=void 0),g.tile=n&&this.Kz?{renderMode:"paletted",fillStylePaletted:n,colorLookupTexture:this.Kz,shader:this.kD.hO(pf["2D"],pf.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===l&&"bilinear",flipXY:"rows"===this.Dh.dataOrder,intensityTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN}),pf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:kf(this.ut),flipXY:"rows"===this.Dh.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.kD.hO(pf["2D"],pf.Color({dataType:"uniform"}),pf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:kf(this.ut),flipXY:"rows"===this.Dh.dataOrder,normalSource:void 0}))}:void 0),r){const t=s instanceof tt&&s,e=t&&t.getFillStyle(),i=e instanceof L&&e;g.wireframe=t&&i?-1===t.getThickness()?{renderMode:"primitive",shader:this.kD.hO(pf["2D"],pf.Color({dataType:"uniform"}),pf.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Dh.dataOrder,axisWorldTranslation:kf(this.ut),normalSource:void 0})),fillStyleSolid:i}:{renderMode:"triangulated",shader:this.kD.hO(pf["2D"],pf.Color({dataType:"uniform"}),pf.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Dh.dataOrder,axisWorldTranslation:kf(this.ut),normalSource:void 0})),geometry:Nf(this.kD,1),solidLine:t,fillStyleSolid:i}:void 0,g.wireframe?this.Jz=this.Jz||this.Qz():this.Jz&&(this.kD.pO(this.Jz.wireframeCoordinatesBuffer),this.Jz=void 0)}return g.mousePicking=c?this.yE.mousePicking||{shader:this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:kf(this.ut),flipXY:"rows"===this.Dh.dataOrder,normalSource:void 0}))}:void 0,this.yE=g,this.qn=!1,this.Uz.length=0,this.Qr(e),this.qa=s,this.Wz.o=!1,this}Zz(){const t=this.Xz.gridTiles.map((t=>{const e=cg(this.kD,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e}})),e=this.Xz.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.kD.sO([0,0,1,0,0,1,1,1]),s=this.kD.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}Qz(){const t=this.Dh.primaryDimensionVectorsCount+1+this.Dh.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{if(1===t)this.kD.cO(e("uColor"),this.uR);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.kD.cO(e("uColor"),t.getColor())}return this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).nO(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).oO(e("uScaling"),[this.Dh.step.x*this.Dh.columns,this.Dh.step.y*this.Dh.rows]).oO(e("uTranslationAxis"),[this.Dh.start.x,this.Dh.start.y]).Hp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{colorLookupTexture:r,fillStylePaletted:n}=i;this.kD.rO(e,((i,o,h)=>{let l=!1;var u,c;return this.kD.uB(e).oO(i("uScale"),this.yB.uO()).oO(i("uDisp"),this.yB.dO()).LL(h,n.lut,r,0).nO(s.rectangleLocationsBuffer,void 0,{location:o("aPos"),size:2}).lO(i("uIsHighlighted"),this.Fr).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0),u=t=>{this.kD.oO(i("uTileDimensions"),["columns"===this.Dh.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Dh.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},c=(t,e)=>{let r;const n=this.kD.pB();if("bilinear"===this.Wz.M()){const e=(this.ut.x.ct(t.startLocationAxis.x)+a.x/2)*n,i=(this.ut.y.ct(t.startLocationAxis.y)+a.y/2)*n;r=[e,i,(this.ut.x.ct(t.startLocationAxis.x+t.sizeAxis.x)-a.x/2)*n-e,(this.ut.y.ct(t.startLocationAxis.y+t.sizeAxis.y)-a.y/2)*n-i]}else{const e=this.ut.x.ct(t.startLocationAxis.x)*n,i=this.ut.y.ct(t.startLocationAxis.y)*n;r=[e,i,this.ut.x.ct(t.startLocationAxis.x+t.sizeAxis.x)*n-e,this.ut.y.ct(t.startLocationAxis.y+t.sizeAxis.y)*n-i]}this.kD.IO(i("uTileBounds"),r).oO(i("uScaling"),[t.renderSizeAxis.x,t.renderSizeAxis.y]).oO(i("uTranslationAxis"),[t.startRenderLocationAxis.x,t.startRenderLocationAxis.y]).aO(i("uTileIntensityValues"),t.intensityDataTexture,1).Hp(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),l=!0},s.gridTileSizes.forEach((t=>{u(t),t.tiles.forEach((t=>{c(t)}))})),l}))}}const n=this.Jz,o=this.yE.wireframe,h=1===t||null==o?void 0:o.shader;if(n&&o&&h&&"primitive"===o.renderMode){const e=h,{fillStyleSolid:i}=o;this.kD.uB(e).rO(e,((e,s,r)=>((this.ut instanceof Ti||this.ut instanceof Ya)&&this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()),this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).cO(e("uColor"),i.getColor()).nO(n.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).oO(e("uScaling"),[this.Dh.step.x,this.Dh.step.y]).oO(e("uTranslationAxis"),[this.Dh.start.x,this.Dh.start.y]).Hp(this.kD.gl.LINES,2*n.wireframeSegmentsLength),!0)))}else if(n&&o&&"triangulated"===o.renderMode){const{shader:e,geometry:i,solidLine:s,fillStyleSolid:r}=o;this.kD.uB(e).rO(e,((e,o,h)=>((this.ut instanceof Ti||this.ut instanceof Ya)&&this.kD.oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()),this.kD.lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0).cO(e("uColor"),r.getColor()).lO(e("uThicknessPixels"),s.getThickness()).oO(e("uRatioPxClip"),[2/this.Wi.$t().x,2/this.Wi.$t().y]).nO(n.wireframeCoordinatesBuffer,1,{location:o("aLocationA"),size:2},{location:o("aLocationB"),size:2}).oO(e("uScaling"),[this.Dh.step.x,this.Dh.step.y]).oO(e("uTranslationAxis"),[this.Dh.start.x,this.Dh.start.y]),i.uB(h,!1).Hp(n.wireframeSegmentsLength),!0)))}return this}QS(t){return this.Uz.push(t),ug(this.Xz.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this}no(){return this.$z&&(this.Xz.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.qn=!0,this.$z=!1),this}dispose(){super.dispose(),this.iR.oL.bt(this.qz),this.qz=void 0,this.Kz=void 0;const t=this.jz;t&&(t.gridTiles.forEach((t=>{this.kD.sB(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.kD.pO(t.rectangleLocationsBuffer)),this.jz=void 0;const e=this.Jz;return e&&this.kD.pO(e.wireframeCoordinatesBuffer),this.Jz=void 0,this.yE={},this}iB(){return this.dispose(),this}rR(t){return this.cR===t&&{}}Ix(t){const e=t,i="columns"===this.Dh.dataOrder?e.x:e.y,s="columns"===this.Dh.dataOrder?e.y:e.x,r="columns"===this.Dh.dataOrder?this.Dh.start.x:this.Dh.start.y,n="columns"===this.Dh.dataOrder?this.Dh.start.y:this.Dh.start.x;let o=(i-r)/("columns"===this.Dh.dataOrder?this.Dh.step.x:this.Dh.step.y),h=(s-n)/("columns"===this.Dh.dataOrder?this.Dh.step.y:this.Dh.step.x);o=Math.floor(wt(o,0,this.Dh.primaryDimensionVectorsCount-1)),h=Math.floor(wt(h,0,this.Dh.secondaryDimensionVectorsCount-1));const a=this.tV(o,h),l="columns"===this.Dh.dataOrder?{x:this.Dh.start.x+(o+.5)*this.Dh.step.x,y:this.Dh.start.y+(h+.5)*this.Dh.step.y}:{x:this.Dh.start.x+(h+.5)*this.Dh.step.x,y:this.Dh.start.y+(o+.5)*this.Dh.step.y},u="columns"===this.Dh.dataOrder?o:h,c="columns"===this.Dh.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}EC(t){if(t.xthis.$n.max.x||t.ythis.$n.max.y)return;const e=t,i="columns"===this.Dh.dataOrder?e.x:e.y,s="columns"===this.Dh.dataOrder?e.y:e.x,r="columns"===this.Dh.dataOrder?this.Dh.start.x:this.Dh.start.y,n="columns"===this.Dh.dataOrder?this.Dh.start.y:this.Dh.start.x,o="columns"===this.Dh.dataOrder?this.Dh.step.x:this.Dh.step.y,h="columns"===this.Dh.dataOrder?this.Dh.step.y:this.Dh.step.x,a=wt((i-r)/o-.5,0,this.Dh.primaryDimensionVectorsCount-1),l=wt((s-n)/h-.5,0,this.Dh.secondaryDimensionVectorsCount-1),u=wt(Math.ceil(a)-1,0,this.Dh.primaryDimensionVectorsCount-1),c=wt(Math.ceil(l)-1,0,this.Dh.secondaryDimensionVectorsCount-1),d={point:{x:u,y:c},value:this.tV(u,c)},f={point:{x:u,y:c+1},value:this.tV(u,c+1)},g={point:{x:u+1,y:c},value:this.tV(u+1,c)},p={point:{x:u+1,y:c+1},value:this.tV(u+1,c+1)},m=ga({x:a,y:l},d,f,g,p);if(void 0===m)return;const y=wt(Math.floor(a+.5),0,this.Dh.primaryDimensionVectorsCount-1),x=wt(Math.floor(l+.5),0,this.Dh.secondaryDimensionVectorsCount-1),S="columns"===this.Dh.dataOrder?y:x,v="columns"===this.Dh.dataOrder?x:y,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:m}}tV(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}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return 0}vo(){return 0}OC(){const t=[];return this.Xz.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){for(let e=0;e0?this.Xv[0].boundaries.min.x:ke:this.$n.min.y=this.Xv.length>0?this.Xv[0].boundaries.min.y:ke}return this.Xv.forEach((t=>t.shape.Zs())),this.ba.o=!1,this}wD(t){return this.Xv.forEach((e=>e.shape.wD(t))),this}hy(t){if(0===t.length)return this;let e=0;const i=this.sV.dataPerSegment,s=t.length;do{let r=this.Xv[this.Xv.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Dh.scrollDimension?i:this.Dh.resolution,rows:"rows"===this.Dh.scrollDimension?i:this.Dh.resolution,heatmapDataType:this.Dh.heatmapDataType,dataOrder:this.Dh.scrollDimension,step:this.Dh.step,start:"columns"===this.Dh.scrollDimension?{x:this.Dh.start.x+this.Dh.step.x*this.iV,y:this.Dh.start.y}:{x:this.Dh.start.x,y:this.Dh.start.y+this.Dh.step.y*this.iV}};this.Xv.length>0&&(t.start="columns"===this.Dh.scrollDimension?{x:t.start.x-1*this.Dh.step.x,y:t.start.y}:{x:t.start.x,y:t.start.y-1*this.Dh.step.y},o=!0);const e=new gg(this.iR,this.sR,this.ut,At,[],t,this.cR,this.uR).qS(this.Wz.M()).As(this.jr).Pa(this.Fa);r={shape:e,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.iV,hasJoint:!1,boundaries:e.$n},this.Xv.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.Dh.resolution};o&&(u.values.unshift(this.eV),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.QS(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),r.boundaries=r.shape.$n,this.eV=l[l.length-1],this.iV+=a,e+=a}while(e{t.shape.dispose().iB()})),this.Xv.length=0,this.$n=this.Dh.initialBoundaries,this.iV=0,this.eV=void 0,this}As(t){return super.As(t),this.Xv.forEach((t=>t.shape.As(this.jr))),this}Pa(t){return super.Pa(t),this.Xv.forEach((t=>t.shape.Pa(this.Fa))),this}qS(t){return super.qS(t),this.Xv.forEach((e=>e.shape.qS(t))),this}dispose(){return super.dispose(),this.Xv.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.Xv.forEach((e=>e.shape.setVisible(t))),this}iB(){return this.Xv.forEach((t=>t.shape.iB())),this}rR(t){return this.cR===t&&{}}Ix(t){const e=nt(t,this.ut,this.engine.ut),i=this.Xv.reduce(((i,s)=>{const r=s.shape.Ix(t);if(r){const t=ze(nt(r,this.ut,this.engine.ut),e);if(void 0===i||t=this.iV||"rows"===this.Dh.scrollDimension&&e>=this.iV)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}EC(t){const e=nt(t,this.ut,this.engine.ut),i=this.Xv.reduce(((i,s)=>{const r=s.shape.EC(t);if(r){const t=ze(nt(r,this.ut,this.engine.ut),e);if(void 0===i||t=this.iV||"rows"===this.Dh.scrollDimension&&e>=this.iV)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}bo(){return 0}vo(){return 0}zr(t){return super.zr(t),this.Xv.forEach((e=>e.shape.zr(t))),this}}const yg={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)=>yg.multiply(t,yg.translation(e,i)),rotate:(t,e)=>yg.multiply(t,yg.rotation(e)),scale:(t,e,i)=>yg.multiply(t,yg.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],p=e[4],m=e[5],y=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+p*n+m*a,g*s+p*o+m*l,g*r+p*h+m*u,y*i+x*n+S*a,y*s+x*o+S*l,y*r+x*h+S*u]},projection:(t,e,i)=>[2/t,0,0,0,-2*i/e,0,-1,1*i,1]};class xg extends Vs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.hV=[],this.yB=new Sf,this.rV=[u(0,0),u(0,0),u(0,0),u(0,0)],this.nV=p(u(0,0),u(0,0)),this.oV=p(u(0,0),u(0,0)),this.aV=u(0,0),this.lV=u(0,0),this._M=u(0,0),this.cV=u(0,0),this.uV=0,this.iR=t,this.sR=e,this.cR=n,this.uR=o,this.kD=t.eR(),this.sR=e,this._E=t.Dh.Uh}Zs(){const t=this.Jr(),e=this.qr(),i=this.kr.M();if(t){const t=this.kD,s=this.kD.pB();if(this.yB.gO(this.ut),this.fn.o){this.dV&&this.dV.dB(this),this.font.S(rs(this.fn.M()));const t=this.font.M();this.dV=this.kD.ws(t.properties.family),this.dV.uB(this)}const r=this.font.o,n=r||this.nn.o;if(n&&this.dV){const e=this.font.M();[this.fV,this.oV]=this.dV.fB(this.nn.M(),e.properties),this.hV.forEach((e=>{e.texCoordBuff&&t.pO(e.texCoordBuff),e.vertexBuff&&t.pO(e.vertexBuff)})),this.hV=this.fV.map((e=>({texCoordBuff:t.sO(e.texCoords,!1),texture:e.texture,info:e}))),this.fn.o=!1,this.font.o=!1,this.nn.o=!1}const o=this.ut._i()||e,h=this.an.o||this.cn.o||this.ln.o||this.un.o||this.pn.o||this.Pt.o||n||o,a=this.pn.M(),l=Je(u(this.cn.M()+1,this.ln.M()+1),.5);if(h&&this.fV&&(this.aV=u(-(a.left*s+this.oV.max.x-this.oV.min.x+a.right*s)*l.x-this.oV.min.x+a.right*s,-(a.bottom*s+this.oV.max.y-this.oV.min.y+a.top*s)*l.y-this.oV.min.y+a.top*s)),(h||o||this.dn.o||this.Zr())&&this.jr!==B){if(this.fV){const e=Qe(this.an.M(),this.un.M()),i=nt(e,this.ut,this.Wi.ut),r=Je(i,s);this.cV=r;const o=hi(this.dn.M());this.uV=o,n&&this.hV.forEach((e=>{const i=e.info;i&&(e.vertexBuffLen=i.vertices.length/2,e.vertexBuff?t.EO(e.vertexBuff,i.vertices,!0):e.vertexBuff=t.sO(i.vertices,!0))}));const h=this.Pt.M(),c=[Qe(Ye(u((this.oV.min.x+(-h.left-a.left)*s+this.aV.x)/s,(this.oV.max.y+(h.top+a.top)*s+this.aV.y)/s),this.gn,o),i),Qe(Ye(u((this.oV.max.x+(h.right+a.right)*s+this.aV.x)/s,(this.oV.max.y+(h.top+a.top)*s+this.aV.y)/s),this.gn,o),i),Qe(Ye(u((this.oV.max.x+(h.right+a.right)*s+this.aV.x)/s,(this.oV.min.y+(-h.bottom-a.bottom)*s+this.aV.y)/s),this.gn,o),i),Qe(Ye(u((this.oV.min.x+(-h.left-a.left)*s+this.aV.x)/s,(this.oV.min.y+(-h.bottom-a.bottom)*s+this.aV.y)/s),this.gn,o),i)];this.rV=[nt(c[0],this.Wi.ut,this.ut),nt(c[1],this.Wi.ut,this.ut),nt(c[2],this.Wi.ut,this.ut),nt(c[3],this.Wi.ut,this.ut)];const d=Ve(c);this.lV=u(-(d.max.x-d.min.x)*s*l.x-d.min.x*s+this.cV.x,-(d.max.y-d.min.y)*s*l.y-d.min.y*s+this.cV.y),this.gV=ti(d.max,d.min);const f=Ve(this.rV),g=this.ut.ti(f.min,this.lV),p=this.ut.ti(f.max,this.lV);this.nV=Ve([g,p])}this.jr instanceof $?this.yR=wf(this.nV,this.ut,this.jr.getPosition(),this.jr.getExtent(),this.jr.getShape(),this.kD.pB()):this.jr instanceof q?this.xR=Df(this.nV,this.ut,this.jr.getAngle(!0),this.kD.pB()):(this.yR=void 0,this.xR=void 0)}const c=this.jr instanceof L&&this.jr,d=this.jr instanceof $&&this.jr,f=this.jr instanceof q&&this.jr,g=c||d||f;(this.Zr()||r)&&(this.bB=g?this.kD.hO(pf["2D"],pf.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this._E}),pf.Color({dataType:d?["gradient",d]:f?["gradient",f]:"uniform",maskTexture:!0})):void 0),this.pV=i&&g?this.pV||this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this._E})):void 0,this.an.o=!1,this.cn.o=!1,this.ln.o=!1,this.un.o=!1,this.dn.o=!1,this.Qr(this.jr)}return this.mn=t,this}wD(t){if(this.Jr()){const e=1===t?this.pV:this.bB;if(!e||0===this.hV.length)return this;const i=this.kD.gl.drawingBufferWidth,s=this.kD.gl.drawingBufferHeight;let r=yg.projection(i,s,-1);const n=yg.translation(this.aV.x,this.aV.y),o=yg.translation(this.lV.x,this.lV.y);r=yg.translate(r,this.cV.x,this.cV.y),r=yg.multiply(r,o),r=yg.rotate(r,this.uV),r=yg.multiply(r,n),1===t&&(r=yg.scale(r,this.oV.max.x,this.oV.max.y)),this.kD.uB(e).rO(e,((e,i,s,n)=>{if(this.kD.PO(e("uMatrix"),r).lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0),this._E&&this.kD.oO(n("uViewportSizePx"),[this.Wi.$t().x*this.kD.pB(),this.Wi.$t().y*this.kD.pB()]),1===t)this.kD.cO(e("uColor"),this.uR);else if(this.jr instanceof L)this.kD.cO(e("uColor"),this.jr.getColor());else if(this.jr instanceof $&&this.yR){this.kD.oO(e("uCenter"),this.yR.center).oO(e("uDistance"),this.yR.distance).IO(e("uBounds"),this.yR.bounds).lO(e("uAspect"),this.yR.aspectRatio);const t=this.jr.getColorStops();for(let i=0;i{this.kD.NO(i("aPos"),t.vertexBuff).NO(i("aMaskTextureCoord"),t.texCoordBuff).aO(e("uMaskTexture"),t.texture,0).Hp(this.kD.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}rR(t){return this.cR===t&&{}}Fi(){return this.Jr()?this.rV:[]}Du(){return this.Jr()&&this.gV?this.gV:u(0,0)}$t(){if(this.Jr()&&this.nV){const t=this.nV;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}iB(){return this.hV.forEach((t=>{t.texCoordBuff&&this.kD.pO(t.texCoordBuff),t.vertexBuff&&this.kD.pO(t.vertexBuff)})),this.hV=[],this.dV&&this.dV.dB(this),this}wt(){return this.nV.max.x}At(){return this.nV.min.x}Ct(){return this.nV.max.y}kt(){return this.nV.min.y}bo(){return 0}vo(){return 0}}class Sg{constructor(t,e,i){this.mV=new Set,this.SV=t=>(this.mV.add(t),t),this.yV=t=>(this.mV.delete(t),t.iB(),this),this.Wi=t,this.Wr=e,this.xV=i}AD(t){this.mV.delete(t)&&this.mV.add(t)}G(){for(const t of this.mV)t.iB().dispose();this.Wi.uh(this.Wr)}Gi(){return this.Wi.Gi(),this}lh(){return this.Wr}}class vg extends Sg{constructor(){super(...arguments),this.bV=y(void 0),this.Ur=!1}yy(t){return this.bV.S(t),this}op(){return this.bV.M()}}class bg extends vg{constructor(t,e,i){super(t,e,i),this.iR=t,this.gl=t.eR(),this.vV=this.mV}iO(t){const e=t instanceof Ps&&t;if(!e)return De;const i=e.At(),s=e.wt(),r=e.kt(),n=e.Ct();if(i===ke||s===we||r===ke||n===we)return De;const o=e.bo(),h=e.vo(),a=Os({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ut),l={min:nt(a.min,e.ut,t.Wi.ut),max:nt(a.max,e.ut,t.Wi.ut)},u=this.bV.M();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.iR._V();return{id:t,color:this.iR.AV(t)}})))}_u(t){const e=this.iR._V();return this.SV(new ng(this.iR,this,t,this.yV,[],e,this.iR.AV(e)))}jk(t){const e=this.iR._V();return this.SV(new zf(this.iR,this,t,this.yV,[],e,this.iR.AV(e)))}Ou(t){const e=this.iR._V();return this.SV(new Tf(this.iR,this,t,this.yV,[],e,this.iR.AV(e)))}GC(t,e,i){if("intensity"===i.heatmapDataType){const s=this.iR._V();return this.SV(new mg(this.iR,this,t,this.yV,e,s,this.iR.AV(s),i))}throw new ut("Unimplemented Heatmap Grid Static type")}BC(t,e,i){const s=this.iR._V();return this.SV(new gg(this.iR,this,t,this.yV,e,i,s,this.iR.AV(s)))}wV(t){return this.SV(new Af(this.iR,this,this.yV,[],t))}Zs(){if(this.Ur){this.Ur=!1;const t=Array.from(this.mV).sort(((t,e)=>t.Yr()-e.Yr()));this.mV.clear();for(const e of t)this.mV.add(e)}for(const t of this.mV)t.Zs();return this}wD(t,e){const i=this.bV.M();if(i&&this.gl.tO(i.x*this.gl.pB()*e,i.y*this.gl.pB()*e,i.width*this.gl.pB()*e,i.height*this.gl.pB()*e),1!==t)for(const e of this.mV)e.getVisible()&&e.wD(t);else for(const e of this.mV)e.getMouseInteractions()&&e.getVisible()&&e.wD(t);return this.gl.qB(!1),this}}class Mg extends Md{constructor(t){super(t)}}class Ag extends Mg{constructor(t){super(t),this.kV="attribute";const{vertices:e,drawSize:i,drawMode:s}=kg(t.gl);this.HD=t.sO(e),this.cE=i,this.uE=s}Hp(t,e,i,s){return this.kD.nO(this.HD,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}).jO(this.uE,0,this.cE,e),this}OD(){this.kD.pO(this.HD)}}const kg=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 wg extends Mg{constructor(t,e){super(t),this.kV="attribute",this.CV=e;const{vertices:i,indices:s}=Dg();this.HD=t.sO(i),this.lE=t.zO(s),this.cE=s.length,this.uE=t.gl.TRIANGLES}Hp(t,e,i,s){return this.kD.nO(this.HD,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).YO(this.lE).lO(t.uniform("uEdgeRoundness"),this.CV/2).KO(this.uE,this.cE,0,e),this}OD(){this.kD.pO(this.HD),this.kD.pO(this.lE)}TV(t){return this.CV=t,this}IV(){return this.CV}}const Dg=()=>{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=Ae.multiply(o,-1),l=Ae.multiply(h,-1),u=i;e[i]={thicknessDirection:Ae.addVec(t,o,h),edge:Ae.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:Ae.addVec(t,a,h),edge:Ae.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:Ae.addVec(t,a,l),edge:Ae.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:Ae.addVec(t,o,l),edge:Ae.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=Ae.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=Ae.normalize(Ae.lerp(t,n.direction,o)),a=Math.PI/2-Ae.angle(h,t),l=Ae.addVec(Ae.multiply(Ae.multiply(n.direction,-1),1-Math.cos(a)),Ae.multiply(Ae.multiply(t,-1),1-Math.sin(a)),Ae.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.MO.BD.get(e);return i||(i=void 0!==e&&e>0?new wg(t,wt(e,0,1)):new Ag(t),t.MO.BD.set(e,i),i)};class Tg extends of{Ym(t){return this.HB=this.Nm.M(),this.Nm.S(t),this}iy(t){return this.FV=t,this}sy(){return this.FV}}class Ig extends Tg{constructor(t,e,i,s,r){super(t,e,i),this.PV=t,this.cR=s,this.uR=r,this.iR=t.iR,this.kD=this.iR.eR()}rR(t){return t===this.cR&&{}}}class Cg extends Ig{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FV="cull-back",this.$n=Ee,this.DV={},this.BV=[],this.jr=ds.fillStyle,this.Nm.S(sh)}Zs(t){const e=this.BV,i=this.jr,s=i!==B,r=this.OV,n=this.Zr()||this.LV!==r,o=this.WB(),h=this.kr.M(),a=this.kr.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.RV||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.DV[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.uz&&i.set(this.uz),this.uz=i,this.EV=e,this.zV=s*t}const d=i instanceof G?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.DV[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=p({x:ke,y:ke,z:ke},{x:we,y:we,z:we});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.$n=e}this.RV=r,this.BV.length=0}return this.Qr(i),this.LV=r,this.Nm.o=!1,this.kr.o=!1,this}wD(t){const e=1===t?this.pV:this.bB,i=this.VV,s=this.aE,r=this.jr,n=this.RV,o=this.Nm.M();return e&&s&&void 0!==n&&this.kD.rO(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.kD.uB(e).FO(h("uScale"),this.PV.yB.uO()).FO(h("uDisp"),this.PV.yB.dO()).DO(h("uViewProjectionMatrix"),this.GV).lO(h("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(h("uHighlightColorOffset"),this.Br).lO(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},p={location:void 0,size:4},m={location:void 0,size:1};if(1!==t&&"phong"===o.type&&this.kD.FO(h("uCameraLoc"),this.WV).FO(h("uLightLoc"),this.HV).lO(h("uAmbientReflection"),o.ambientReflection).lO(h("uSpecularReflection"),o.specularReflection).lO(h("uDiffuseReflection"),o.diffuseReflection).lO(h("uShininess"),o.shininess).cO(h("uLightColor"),o.specularColor).cO(h("uAmbientColor"),o.ambientColor),1===t)this.kD.cO(h("uColor"),this.uR);else if(r instanceof L)this.kD.cO(h("uColorDiffuse"),r.getColor());else if(r instanceof G){const t=a("aColor");p.location=t}else if(r instanceof N){const t=r.getLookUpProperty(),e=r.getPalette();"value"===t&&(m.location=a("aLookupValue")),this.kD.LL(l,e,this.xE,0)}return s&&(this.kD.nO(s,1,f,g,p,m),i.Hp(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}iB(){return this.aE&&(this.kD.pO(this.aE),this.aE=void 0),this.iR.oL.bt(this.bE),this.xE=void 0,this.bE=void 0,this.bB=void 0,this}sS(t){this.BV=re(this.BV,t,{canReturnB:!0})}As(t){return this.jr=Fs(this.jr,t),this}_s(){return this.jr}tS(t){return this.OV=void 0!==t&&t>0?wt(t,0,1):void 0,this}NV(){return this.OV}wt(){return this.$n.max.x}At(){return this.$n.min.x}Ct(){return this.$n.max.y}kt(){return this.$n.min.y}Km(){return this.$n.max.z}qm(){return this.$n.min.z}bo(){return 0}vo(){return 0}Jm(){return 0}Zr(){return Rs(this.Kr,this.jr)}Qr(t){this.Kr=t}}class Pg extends Md{constructor(t,e){super(t),this.kV="custom",this.nE=e;const{vertices:i,drawSize:s}=this.oE();this.aE=t.sO(i),this.cE=s}uB(t){return this.kD.nO(this.aE,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Hp(t){return this.kD.jO(this.kD.gl.TRIANGLE_STRIP,0,this.cE,t),this}oE(){const t=this.nE,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}}OD(){this.kD.pO(this.aE)}}const Og=(t,e=16)=>{let i=t.MO.PD.get(e);return i||(i=new Pg(t,e),t.MO.PD.set(e,i),i)};class Fg extends Ig{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FV="cull-back",this.UV=Ee,this.ya=[],this.$V=!1,this.ca=ds.lineStyle,this.Nm.S(eh)}Zs(t){const e=this.$V,i=this.ca,s=this.fa!==i,r=this.WB(),n=e;if(e){this.YV&&(this.kD.pO(this.YV),this.YV=void 0);const t=Kt(this.ya);this.YV=this.kD.sO(t)}if(n&&(this.UV=Ne(this.ya)),s||r){const t=8,e=i instanceof tt&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.yE=void 0,e instanceof L&&("primitive"===s?this.yE={type:s,shader:this.kD.hO(pf["3D"],pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0}),pf.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.yE={type:s,shader:this.kD.hO(pf["3D"],pf.ColorShaded3D({dataType:"uniform",shadingStyle:this.Nm.M().type}),pf.LineInstanced3D({axisWorldTranslation:kf(this.ut)})),geometry:Og(this.kD,t),fillStyle:e}))}return this.$V=!1,this.fa=i,this.Nm.o=!1,this}wD(t){if(1===t)return this;const e=this.kD.gl,i=this.yE,s=this.YV,r=this.ca,n=this.Nm.M();if(i&&s&&r instanceof tt)switch(i.type){case"instanced":{const o=.5*this.Hr.Lm(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.kD.rO(a,((i,r,u)=>{this.kD.uB(a).FO(i("uScale"),this.PV.yB.uO()).FO(i("uDisp"),this.PV.yB.dO()).DO(i("uViewProjectionMatrix"),this.GV).cO(i("uColorDiffuse"),h).lO(i("uOffsetWU"),o).lO(i("uIsHighlighted"),this.Fr).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.kD.FO(i("uCameraLoc"),this.WV).FO(i("uLightLoc"),this.HV).lO(i("uAmbientReflection"),n.ambientReflection).lO(i("uSpecularReflection"),n.specularReflection).lO(i("uDiffuseReflection"),n.diffuseReflection).lO(i("uShininess"),n.shininess).cO(i("uLightColor"),n.specularColor).cO(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.kD.WO(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.kD.WO(d,1),e.enableVertexAttribArray(d),l.uB(u).Hp(this.ya.length/2),!0}));break}case"primitive":{const n=r instanceof tt?r.getFillStyle():void 0,o=n&&n instanceof L?n.getColor():void 0;if(o){const r=i.shader;this.kD.rO(r,((i,n)=>(this.kD.uB(r).FO(i("uScale"),this.PV.yB.uO()).FO(i("uDisp"),this.PV.yB.dO()).DO(i("uViewProjectionMatrix"),this.GV).cO(i("uColor"),o).lO(i("uIsHighlighted"),this.Fr).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0).nO(s,void 0,{location:n("aPos"),size:3}).Hp(e.LINES,this.ya.length),!0)))}break}}return this}xt(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.kD.uf.Gh&&s>i.length&&mt.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}}OD(){this.kD.pO(this.aE)}}const Bg=(t,e)=>{const i=Math.round(e);i<3&&ge(0,At);const s=i;let r=t.MO.DD.get(Array.from(t.MO.DD.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new Rg(t,i,s),t.MO.DD.set({sectors:i,stacks:s},r),r)};class zg extends Ig{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FV="cull-back",this.Xv=[],this.yE={},this.ez=new qf(this.Xv,(t=>t.vertexBuffer&&this.kD.pO(t.vertexBuffer)),!0),this.xa=[],this.Yn=0,this.Xn=[],this.jn=0,this.$n=Ee,this.Zn=Ee,this.qn=!1,this.ca=ds.lineStyle,this.eS=ds.pointStyle3D,this.Nm.S(sh),this.az={attributesPerVertex:3,prepareRenderData:(t,e)=>Kt(t)}}Zs(t){const e=this.qn,i=this.Xn,s=this.jn,r=s>0,n=this.ca,o=n!==this.fa,h=this.eS,a=h!==this.ZV,l=this.WB(),u=this.kr.o,c=this.kr.M();this.Zn&&(this.$n=He(this.$n,this.Zn),this.Zn=void 0),r&&(this.xa=re(this.xa,i,{canReturnB:!0}),this.Yn+=s);let d=i,f=s;if(e&&(this.Xv.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=Ee})),this.ez.jE(),d=this.xa,f=this.Yn),f>0){const t=1e5,e=Math.floor(this.iR.KV/(this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.Lr("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=wt(i,t,e);this.ez.UE(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:Ee,vertexBuffer:this.kD.LO(t*this.az.attributesPerVertex,this.az.prepareRenderData(e,i))})),((t,e,i,s)=>{this.kD.RO(t.vertexBuffer,t.existingCoordinatesCount*this.az.attributesPerVertex,this.az.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=n instanceof tt&&n,i=e&&e.getFillStyle(),s=i instanceof L&&i,r=i instanceof N&&i,o=s||r,a=h instanceof Ji&&h.getSize(),l=h instanceof Ji&&h.getFillStyle(),u=l instanceof L&&l,d=l instanceof N&&l,f=u||d,g=h instanceof Ji&&h.getWireframeStyle(),p=g&&g instanceof tt&&g,m=p&&p.getFillStyle(),y=m&&m instanceof L&&m,x=n.getThickness()<0||1===n.getThickness()&&this.Lr("ApplicationType",(t=>"InternalUI"===t.type))?"primitive":"instanced",S=r?["lookup",r.getLookUpProperty()]:"uniform";if("primitive"===x&&o?t.lines={type:"primitive",fillStyleSolid:s,fillStylePaletted:r,shader:this.kD.hO(pf["3D"],pf.Color({dataType:S}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})),mousePicking:c?{shader:this.kD.hO(pf["3D"],pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0}))}:void 0}:"instanced"===x&&e&&o&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:s,fillStylePaletted:r,shader:this.kD.hO(pf["3D"],pf.ColorShaded3D({dataType:S,shadingStyle:this.Nm.M().type}),pf.LineInstanced3D({axisWorldTranslation:kf(this.ut)})),geometry:_g(this.kD,e.getThickness()),mousePicking:c?{shader:this.kD.hO(pf["3D"],pf.MousePicking,pf.LineInstanced3D({axisWorldTranslation:kf(this.ut)}))}:void 0}),t.markers=void 0,f){const e=ie(h.getShape(),{cube:()=>Eg(this.kD),sphere:()=>Lg(this.kD,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof a&&a,pointSizeAxis:"object"==typeof a&&a,fillStyleSolid:u,fillStylePaletted:d,shader:this.kD.hO(pf["3D"],pf.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty()]:"uniform",shadingStyle:this.Nm.M().type,wireframe:!1!==y}),pf.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:kf(this.ut),normalSource:e.kV})),mousePicking:c?{shader:this.kD.hO(pf["3D"],pf.MousePicking,pf.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:kf(this.ut),normalSource:void 0}))}:void 0,wireframe:p&&y&&{thickness:p.getThickness(),fillStyleSolid:y}}}if(this.yE=t,r){if(r&&r.lut.isValid){const t=r.getPalette();this.qV=this.iR.jR(t,this.JV,this.qV),this.JV=t}}else this.iR.oL.bt(this.JV),this.JV=void 0;if(d){if(d&&d.lut.isValid){const t=d.getPalette();this.QV=this.iR.jR(t,this.tN,this.QV),this.tN=t}}else this.iR.oL.bt(this.tN),this.tN=void 0}return this.qn=!1,this.Xn=[],this.jn=0,this.fa=n,this.ZV=h,this.Nm.o=!1,this.kr.o=!1,this}wD(t){var e,i;const s=this.kD.gl,{lines:r,markers:n}=this.yE,o=this.Nm.M(),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.kD.rO(e,((r,h,u)=>{let c=!1;return this.kD.uB(e).FO(r("uScale"),this.PV.yB.uO()).FO(r("uDisp"),this.PV.yB.dO()).DO(r("uViewProjectionMatrix"),this.GV).lO(r("uOffsetWU"),this.Hr.Lm(n.getThickness())).lO(r("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(r("uHighlightColorOffset"),this.Br).lO(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.kD.FO(r("uCameraLoc"),this.WV).FO(r("uLightLoc"),this.HV).lO(r("uAmbientReflection"),o.ambientReflection).lO(r("uSpecularReflection"),o.specularReflection).lO(r("uDiffuseReflection"),o.diffuseReflection).lO(r("uShininess"),o.shininess).cO(r("uLightColor"),o.specularColor).cO(r("uAmbientColor"),o.ambientColor),1===t?this.kD.cO(r("uColor"),this.uR):a?this.kD.cO(r("uColorDiffuse"),a.getColor()):l&&this.qV&&this.kD.LL(u,l.lut,this.qV,0),this.Xv.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.kD.WO(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.kD.WO(r,1),s.enableVertexAttribArray(r),i.uB(u).Hp(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.kD.rO(e,((r,o,h)=>{let a=!1;return this.kD.uB(e).FO(r("uScale"),this.PV.yB.uO()).FO(r("uDisp"),this.PV.yB.dO()).DO(r("uViewProjectionMatrix"),this.GV).lO(r("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(r("uHighlightColorOffset"),this.Br).lO(r("uRenderEffectMask"),2===t?1:0),1===t?this.kD.cO(r("uColor"),this.uR):i?this.kD.cO(r("uColor"),i.getColor()):n&&this.qV&&this.kD.LL(h,n.lut,this.qV,0),this.Xv.forEach((t=>{this.kD.nO(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Hp(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.kD.rO(e,((n,a,c,d)=>{let f=!1;return this.kD.uB(e).FO(n("uScale"),this.PV.yB.uO()).FO(n("uDisp"),this.PV.yB.dO()).DO(n("uViewProjectionMatrix"),this.GV).lO(d("uRatioNwuWu"),this.PV.iN()).lO(n("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(n("uHighlightColorOffset"),this.Br).lO(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.kD.FO(n("uCameraLoc"),this.WV).FO(n("uLightLoc"),this.HV).lO(n("uAmbientReflection"),o.ambientReflection).lO(n("uSpecularReflection"),o.specularReflection).lO(n("uDiffuseReflection"),o.diffuseReflection).lO(n("uShininess"),o.shininess).cO(n("uLightColor"),o.specularColor).cO(n("uAmbientColor"),o.ambientColor),1===t?this.kD.cO(n("uColor"),this.uR):s?this.kD.cO(n("uColorDiffuse"),s.getColor()):r&&this.QV&&this.kD.LL(c,r.lut,this.QV,0),u&&1!==t&&this.kD.lO(n("uWireframeThickness"),u.thickness).cO(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.kD.FO(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.kD.lO(n("uOffsetNWU"),l),this.Xv.forEach((e=>{this.kD.nO(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Hp(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}xt(t,e){Array.isArray(t)||(t=[t]),this.Xn=re(this.Xn,t,{canReturnB:!0}),this.jn+=t.length;const i=e||Ne(t);return this.Zn=this.Zn?He(this.Zn,i):i,this}ua(t){return this.ca="function"==typeof t?t(this.ca):t,this}da(){return this.ca}Pm(t){return this.eS="function"==typeof t?t(this.eS):t,this}sN(){return this.eS}wt(){return this.Zn?Math.max(this.Zn.max.x,this.$n.max.x):this.$n.max.x}At(){return this.Zn?Math.min(this.Zn.min.x,this.$n.min.x):this.$n.min.x}Ct(){return this.Zn?Math.max(this.Zn.max.y,this.$n.max.y):this.$n.max.y}kt(){return this.Zn?Math.min(this.Zn.min.y,this.$n.min.y):this.$n.min.y}Km(){return this.Zn?Math.max(this.Zn.max.z,this.$n.max.z):this.$n.max.z}qm(){return this.Zn?Math.min(this.Zn.min.z,this.$n.min.z):this.$n.min.z}bo(){return be(this.ca)}vo(){return be(this.ca)}Jm(){return be(this.ca)}io(){return this.xa}Qn(){return this.Xn}oo(){return this.Yn}ao(){return this.jn}no(){return this.qn=!0,this.xa.length=0,this.Yn=0,this.Xn=[],this.jn=0,this.$n=Ee,this.Zn=void 0,this}dispose(){return super.dispose(),this.ez.ZE(),this.yE={},this.JV&&(this.iR.oL.bt(this.JV),this.JV=void 0),this.qV=void 0,this.tN&&(this.iR.oL.bt(this.tN),this.tN=void 0),this.QV=void 0,this}iB(){return this.dispose(),this}}const _g=(t,e)=>Og(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Lg=(t,e)=>{const i=e.getSize();return Bg(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class Gg extends Ig{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.FV="cull-back",this.Xv=[],this.ez=new qf(this.Xv,(t=>t.vertexBuffer&&this.kD.pO(t.vertexBuffer)),!1),this.xa=[],this.Yn=0,this.Xn=[],this.jn=0,this.$n=Ee,this.Zn=Ee,this.qn=!1,this.Dh=n,this.nS=ds.pointStyle3D,this.Nm.S(sh);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 p=((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&&e instanceof G&&e.getFallbackColor()||E,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;eKt(t))(o,h,a,l);this.az={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>p(t,this.nS,this.nS.fillStyle)}}Zs(t){const e=this.qn,i=this.Xn,s=this.jn,r=s>0,n=this.nS,o=this.nS!==this.eN,h=this.kr.M(),a=this.kr.o,l=this.WB();this.Zn&&(this.$n=He(this.$n,this.Zn),this.Zn=void 0),r&&(this.xa=re(this.xa,i,{canReturnB:!0}),this.Yn+=s);let u=i,c=s;if(e&&(this.Xv.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=Ee})),this.ez.jE(),u=this.xa,c=this.Yn),c>0){const t=Math.floor(this.iR.KV/(this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=wt(c,1e5,t);this.ez.UE(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:Ee,vertexBuffer:this.kD.LO(t*this.az.attributesPerVertex,this.az.prepareRenderData(e,i))})),((t,e,i)=>{this.kD.RO(t.vertexBuffer,t.existingCoordinatesCount*this.az.attributesPerVertex,this.az.prepareRenderData(e,i)),t.existingDataPointsCount+=i,t.existingCoordinatesCount=t.existingDataPointsCount}))}if(o||l||a){let t;const e=n.getSize(),i=n.getFillStyle(),s=this.az.individualPointColorEnabled,r=this.az.individualPointSizeEnabled,o=this.az.individualPointSizeAxisEnabled,a=this.az.individualLookupValuesEnabled,l=i instanceof L&&i,u=i instanceof G&&i,c=i instanceof N&&i,d=i===B&&B;if(u&&!s){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw mt.alert(t),new Error(t)}if(c&&"value"===c.getLookUpProperty()&&!a){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw mt.alert(t),new Error(t)}const f=n instanceof Ji&&n,g=f&&f.getWireframeStyle(),p=g&&g instanceof tt&&g,m=p&&p.getFillStyle(),y=m&&m instanceof L&&m;if(l||u||c||y){const i=u?"attribute":c?["lookup",c.getLookUpProperty()]:"uniform",s=r&&"number"==typeof e,a=o&&"object"==typeof e,f=s||a?"attribute":"uniform";if(n instanceof Ji){const o=ie(n.getShape(),{cube:()=>Eg(this.kD),sphere:()=>Vg(this.kD,n,r)});t={type:"instanced",shader:this.kD.hO(pf["3D"],pf.ColorShaded3D({dataType:i,shadingStyle:this.Nm.M().type,wireframe:!1!==y}),pf.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:kf(this.ut),normalSource:o.kV})),pointStyle:n,useIndividualPointSize:s,useIndividualPointSize3D:a,pointSizeNWU:"number"==typeof e&&e,pointSizeAxis:"object"==typeof e&&e,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,fillStyleEmpty:d,mousePickingShader:h&&this.kD.hO(pf["3D"],pf.MousePicking,pf.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:kf(this.ut),normalSource:void 0})),geometry:o,wireframe:p&&y&&{thickness:p.getThickness()<0?1:p.getThickness(),fillStyleSolid:y}}}else n instanceof ts&&"number"==typeof e&&(t={type:"primitive",shader:this.kD.hO(pf["3D"],pf.PointSize(f),pf.Color({dataType:i}),pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:s,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,mousePickingShader:h&&this.kD.hO(pf["3D"],pf.PointSize(f),pf.MousePicking,pf.VertexLocation({axisWorldTranslation:kf(this.ut),normalSource:void 0}))})}if(this.yE=t,i instanceof N){const t=i.getPalette();this.Kz=this.iR.jR(t,this.bE,this.Kz),this.bE=t}else this.Kz=void 0,this.iR.oL.bt(this.bE),this.bE=void 0}return this.qn=!1,this.Xn=[],this.jn=0,this.eN=n,this.Nm.o=!1,this}wD(t){const e=this.kD.gl,i=this.yE;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.Nm.M(),{fillStyleSolid:n,fillStylePalette:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.kD.rO(s,((u,c,d,f)=>{let g=!1;if(this.kD.uB(s).FO(u("uScale"),this.PV.yB.uO()).FO(u("uDisp"),this.PV.yB.dO()).DO(u("uViewProjectionMatrix"),this.GV).lO(u("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(u("uHighlightColorOffset"),this.Br).lO(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.kD.FO(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.kD.lO(u("uOffsetNWU"),e).lO(f("uRatioNwuWu"),this.PV.iN())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.kD.lO(u("uPointSize"),t).lO(u("uDevicePixelRatio"),this.kD.pB())}return 1===t?this.kD.cO(u("uColor"),this.uR):("instanced"===i.type?("phong"===r.type&&this.kD.FO(u("uCameraLoc"),this.WV).FO(u("uLightLoc"),this.HV).lO(u("uAmbientReflection"),r.ambientReflection).lO(u("uSpecularReflection"),r.specularReflection).lO(u("uDiffuseReflection"),r.diffuseReflection).lO(u("uShininess"),r.shininess).cO(u("uLightColor"),r.specularColor).cO(u("uAmbientColor"),r.ambientColor),l&&this.kD.lO(u("uWireframeThickness"),l.thickness).cO(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.kD.cO(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.kD.cO(u("uColorDiffuse"),T)):"primitive"===i.type&&n&&this.kD.cO(u("uColor"),n.getColor()),o&&this.Kz&&this.kD.LL(d,o.lut,this.Kz,0)),this.Xv.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.kD.WO(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.az.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.kD.WO(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.az.attributeOffsetSize){"instanced"===i.type?this.kD.lO(f("uRatioNwuWu"),this.PV.iN()):"primitive"===i.type&&this.kD.lO(u("uDevicePixelRatio"),this.kD.pB());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.kD.WO(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.az.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.kD.WO(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePalette&&"value"===i.fillStylePalette.getLookUpProperty()&&void 0!==this.az.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.az.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.az.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.kD.WO(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Hp(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.kD.Hp(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}xt(t,e){Array.isArray(t)||(t=[t]),this.Xn=re(this.Xn,t,{canReturnB:!0}),this.jn+=t.length;const i=e||Ne(t);return this.Zn=this.Zn?He(this.Zn,i):i,this}oS(t){return this.nS="function"==typeof t?t(this.nS):t,this}hN(){return this.nS}wt(){return this.Zn?Math.max(this.Zn.max.x,this.$n.max.x):this.$n.max.x}At(){return this.Zn?Math.min(this.Zn.min.x,this.$n.min.x):this.$n.min.x}Ct(){return this.Zn?Math.max(this.Zn.max.y,this.$n.max.y):this.$n.max.y}kt(){return this.Zn?Math.min(this.Zn.min.y,this.$n.min.y):this.$n.min.y}Km(){return this.Zn?Math.max(this.Zn.max.z,this.$n.max.z):this.$n.max.z}qm(){return this.Zn?Math.min(this.Zn.min.z,this.$n.min.z):this.$n.min.z}bo(){const t=this.nS,e=t.getSize();return"number"==typeof e?t instanceof Ji?e/2:t instanceof ts?5:0:0}vo(){return this.bo()}Jm(){return this.bo()}io(){return this.xa}Qn(){return this.Xn}oo(){return this.Yn}ao(){return this.jn}no(){return this.qn=!0,this.xa.length=0,this.Yn=0,this.Xn=[],this.jn=0,this.$n=Ee,this.Zn=void 0,this}dispose(){return super.dispose(),this.ez.ZE(),this.iR.oL.bt(this.bE),this.bE=void 0,this.Kz=void 0,this.yE=void 0,this}iB(){return this.dispose(),this}}const Vg=(t,e,i)=>{const s=e.getSize();return Bg(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class Ng extends Ig{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.FV="disabled",this.jr=ds.fillStyle,this.Fa=ds.lineStyle,this.Wz=y("bilinear"),this.rN=[],this.nN=Ee,this.oN=void 0,this.yE={},this.aN=!1,this.Nm.S(eh);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.Dh={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.nN={min:{x:Math.min(s.start.x,s.start.x+(s.columns-1)*s.step.x),z:Math.min(s.start.z,s.start.z+(s.rows-1)*s.step.z)},max:{x:Math.max(s.start.x,s.start.x+(s.columns-1)*s.step.x),z:Math.max(s.start.z,s.start.z+(s.rows-1)*s.step.z)}},this.lN=new Array(this.Dh.primaryDimensionVectorsCount).fill(void 0),this.DC=new gg(this.iR,t.iR.cN,t.Wi.ut,At,[],{...this.Dh,start:{x:0,y:0},step:{x:1,y:1}},-1,E).Pa(J),this.DC.Yz=ag;const a=this.DC.Xz.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n="columns"===this.Dh.dataOrder?{x:this.Dh.step.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Dh.step.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Dh.step.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Dh.step.z*(t.sizeHeatmapDataVectors.primary-1)},o="columns"===this.Dh.dataOrder?{x:this.Dh.start.x+this.Dh.step.x*t.iFirstVector.primary,z:this.Dh.start.z+this.Dh.step.z*t.iFirstVector.secondary}:{x:this.Dh.start.x+this.Dh.step.x*t.iFirstVector.secondary,z:this.Dh.start.z+this.Dh.step.z*t.iFirstVector.primary},h=new Float32Array(t.sizeHeatmapDataVectors.primary*t.sizeHeatmapDataVectors.secondary),a={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,startLocationAxis:o,sizeAxis:n,heightmapData:h,normalmapSize:a}})),l=this.DC.Xz.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.uN={gridTiles:a,gridTileSizes:l,largestGridTileSize:u}}dN(t){this.fN=t,this.oN=void 0}gN(t){"columns"===this.Dh.dataOrder?(this.nN.min.x=Math.min(this.Dh.start.x,this.Dh.start.x+(this.Dh.columns-1)*this.Dh.step.x)+t,this.nN.max.x=Math.max(this.Dh.start.x,this.Dh.start.x+(this.Dh.columns-1)*this.Dh.step.x)+t):(this.nN.min.z=Math.min(this.Dh.start.z,this.Dh.start.z+(this.Dh.rows-1)*this.Dh.step.z)+t,this.nN.max.z=Math.max(this.Dh.start.z,this.Dh.start.z+(this.Dh.rows-1)*this.Dh.step.z)+t),this.pN=t}Zs(t){const e=this.rN,i=this.jr,s=i instanceof L&&i,r=i instanceof N&&i,n=Rs(this.Kr,i),o=r&&r.getPalette(),h=this.Fa,a=h instanceof tt&&h,l=a&&a.getFillStyle(),u=l&&l instanceof L&&l,c=!1!==u,d=h!==this.qa,f=this.Wz.o,g=this.Wz.M(),p=this.Nm.M(),m=this.WB(),y=this.kr.M();this.DC.Zs();const x=this.DC.jz;if(!x)return this;this.mN=this.mN||this.SN(x);const S=this.mN;this.yN(S);const v=lg(e,S,void 0,(t=>t.sizeGeometryDataVectors));if(v.size>0&&(dg(this.kD,v,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.aN=!0),"phong"===p.type&&(v.size>0||m)){const t=this.kD.gl,e=this.kD.hO(pf["2D"],pf.DrawToNormalTexture({flipXZ:"rows"===this.Dh.dataOrder,vertexIdSource:this.kD.kL(),normalTextureType:this.kD.gl2?"uint":"ubyte",heightmapTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN}));S.gridTileSizes.forEach((i=>{i.tiles.forEach((s=>{const r=s.normalmapTexture;if(!r)return;const n={x:s.normalmapSize.secondary,y:s.normalmapSize.primary},o=n.x*n.y;this.kD.aL.wD((()=>{this.kD.rO(e,((r,n,h,a)=>(this.kD.uB(e).CL(h,o).oO(r("uTileDimensionsXZ"),["columns"===this.Dh.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Dh.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).TO(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).oO(r("uTileStartLocationAxisXZ"),[s.startLocationAxis.x+("columns"===this.Dh.dataOrder&&this.pN||0),s.startLocationAxis.z+("rows"===this.Dh.dataOrder&&this.pN||0)]).oO(r("uTileSizeAxisXZ"),[s.sizeAxis.x,s.sizeAxis.z]).aO(r("uHeightmapTexture"),s.heightmapDataTexture,1).Hp(t.POINTS,o),!0)))}),r,n,void 0,this.Wi.eh(),0)}))}))}const b=this.yE;if(n||d||f){o?(this.Kz=this.iR.jR(o,this.qz,this.Kz),this.qz=o):(this.Kz=void 0,this.iR.oL.bt(this.qz),this.qz=void 0);const t=a&&u?{wireframeSolid:a,wireframeFillSolid:u}:void 0;s?b.surface={shader:this.kD.hO(pf["3D"],pf.SurfaceGrid({axisWorldTranslation:kf(this.ut),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Dh.dataOrder,shadingStyle:p.type,wireframe:c,instanceIdSource:this.kD.TL(),normalTextureType:this.kD.gl2?"uint":"ubyte",intensityTextureType:this.kD.rL?"float":"ubyte",heightmapTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:this.Kz&&r&&"value"===r.getLookUpProperty()?b.surface={shader:this.kD.hO(pf["3D"],pf.SurfaceGrid({axisWorldTranslation:kf(this.ut),fillColor:["lookup","value"],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Dh.dataOrder,shadingStyle:p.type,wireframe:c,instanceIdSource:this.kD.TL(),normalTextureType:this.kD.gl2?"uint":"ubyte",intensityTextureType:this.kD.rL?"float":"ubyte",heightmapTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r,colorLookupTexture:this.Kz},wireframe:t}:this.Kz&&r?b.surface={shader:this.kD.hO(pf["3D"],pf.SurfaceGrid({axisWorldTranslation:kf(this.ut),fillColor:["lookup",r.getLookUpProperty()],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Dh.dataOrder,shadingStyle:p.type,wireframe:c,instanceIdSource:this.kD.TL(),normalTextureType:this.kD.gl2?"uint":"ubyte",intensityTextureType:this.kD.rL?"float":"ubyte",heightmapTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r,colorLookupTexture:this.Kz},wireframe:t}:c&&(b.surface={shader:this.kD.hO(pf["3D"],pf.SurfaceGrid({axisWorldTranslation:kf(this.ut),fillColor:void 0,interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Dh.dataOrder,shadingStyle:p.type,wireframe:c,instanceIdSource:this.kD.TL(),normalTextureType:this.kD.gl2?"uint":"ubyte",intensityTextureType:this.kD.rL?"float":"ubyte",heightmapTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return b.mousePicking=y?this.yE.mousePicking||{shader:this.kD.hO(pf["3D"],pf.SurfaceGrid({axisWorldTranslation:kf(this.ut),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Dh.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.kD.TL(),normalTextureType:this.kD.gl2?"uint":"ubyte",intensityTextureType:this.kD.rL?"float":"ubyte",heightmapTextureType:this.kD.rL?"float":"ubyte",littleEndian:this.kD.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.yE=b,this.rN.length=0,this.Kr=i,this.qa=h,this.Nm.o=!1,this}SN(t){const e=this.uN.gridTiles.map((e=>{const i=cg(this.kD,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}})),i=this.uN.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.kD.sO([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.kD.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}yN(t){var e;if("phong"===this.Nm.M().type)for(let i=0;i{t.normalmapTexture&&(this.kD.sB(t.normalmapTexture),t.normalmapTexture=void 0)}))}wD(t){var e,i,s,r;const n=this.kD.gl,o=this.mN;if(!o)return this;const h=this.Nm.M(),a=this.yE,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.kD.rO(l,((e,i,s,r)=>{let a=!1;if(this.kD.uB(l).IL(s,this.uN.largestGridTileSize.cells).FO(e("uScale"),this.PV.yB.uO()).FO(e("uDisp"),this.PV.yB.dO()).DO(e("uViewProjectionMatrix"),this.GV).lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.kD.FO(e("uCameraLoc"),this.WV).FO(e("uLightLoc"),this.HV).lO(e("uAmbientReflection"),h.ambientReflection).lO(e("uSpecularReflection"),h.specularReflection).lO(e("uDiffuseReflection"),h.diffuseReflection).lO(e("uShininess"),h.shininess).cO(e("uLightColor"),h.specularColor).cO(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.kD.cO(e("uWireframeColor"),t.getColor()).lO(e("uWireframeThickness"),s)}return 1===t?this.kD.cO(e("uColorDiffuse"),this.uR):"solid"===(null==c?void 0:c.fillMode)&&this.kD.cO(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((r=>{this.kD.oO(e("uTileDimensionsXZ"),["columns"===this.Dh.dataOrder?r.sizeHeatmapData.primary:r.sizeHeatmapData.secondary,"columns"===this.Dh.dataOrder?r.sizeHeatmapData.secondary:r.sizeHeatmapData.primary]).TO(e("uTileDimensions"),[r.sizeHeatmapData.primary,r.sizeHeatmapData.secondary]),r.tiles.forEach((h=>{let l=0,d=(h.sizeHeatmapDataVectors.primary-1)*(h.sizeHeatmapDataVectors.secondary-1);if(this.fN){const t=this.fN.fill.iFirstPrimary,e=this.fN.fill.iFirstPrimary+this.fN.fill.amountPrimary-1,i=h.iFirstVector.primary,s=h.iFirstVector.primary+h.sizeHeatmapDataVectors.primary-1;if(i>e||sp(Math.max(t,i),Math.min(e,s)))(t,e,i,s);l=(n.min-h.iFirstVector.primary)*(r.sizeGeometryData.secondary-1),d=(n.max-n.min)*(r.sizeGeometryData.secondary-1)}if(!(l<0||d<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.kD.LL(s,i.lut,t,1).aO(e("uTileIntensityValues"),h.intensityDataTexture,2).IO(e("uTileBoundsAxisXZ"),[h.startLocationAxis.x+("columns"===this.Dh.dataOrder&&this.pN||0),h.startLocationAxis.z+("rows"===this.Dh.dataOrder&&this.pN||0),h.sizeAxis.x,h.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:e}=c;this.kD.LL(s,e.lut,t,1)}1!==t&&"phong"===this.Nm.M().type&&h.normalmapTexture&&this.kD.aO(e("uNormalmapTexture"),h.normalmapTexture,3),this.kD.nO(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).BO(e("uBaseInstance"),l).oO(e("uTileStartLocationAxisXZ"),[h.startLocationAxis.x+("columns"===this.Dh.dataOrder&&this.pN||0),h.startLocationAxis.z+("rows"===this.Dh.dataOrder&&this.pN||0)]).oO(e("uTileSizeAxisXZ"),[h.sizeAxis.x,h.sizeAxis.z]).aO(e("uHeightmapTexture"),h.heightmapDataTexture,0).jO(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,d),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.DC.dispose(),this.iR.oL.bt(this.qz),this.qz=void 0,this.Kz=void 0,this.mN&&(this.mN.gridTileSizes.forEach((t=>{})),this.mN.gridTiles.forEach((t=>{this.kD.sB(t.heightmapDataTexture),t.normalmapTexture&&this.kD.sB(t.normalmapTexture)})),this.kD.pO(this.mN.rectangleLocationsBuffer),this.mN=void 0),this.yE={},this}iB(){return this.dispose(),this.DC.iB(),this}QS(t){return this.DC.QS(t),this}ty(t){this.rN.push(t),ug(this.uN.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.lN[n];if(e)i=ie.max?s:e.max;else{e={min:ke,max:we},this.lN[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.oN={min:i,max:s},this.oN}}class Wg extends Ig{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.FV="disabled",this.iV=0,this.eV={};const o={min:{x:s.start.x,z:s.start.z},max:{x:"rows"===s.scrollDimension?s.start.x+(s.columns-1)*s.step.x:s.start.x,z:"columns"===s.scrollDimension?s.start.z+(s.rows-1)*s.step.z:s.start.z}};this.Dh={...s,initialBoundaries:o,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.nN=o;const h=()=>({shape:new Ng(this.PV,At,this.Pr,{columns:s.columns+("columns"===s.scrollDimension?1:0),rows:s.rows+("rows"===s.scrollDimension?1:0),start:{x:0,z:0},step:s.step,dataOrder:s.scrollDimension,heatmapDataType:"intensity"},this.cR,this.uR).dispose(),hasData:!1});this.Xv=[h(),h()]}Zs(t){return this.Xv.forEach((e=>{e.shape.Zs(t)})),this}wD(t){return this.Xv.forEach((e=>{e.hasData&&(e.shape.GV=this.GV,e.shape.WV=this.WV,e.shape.HV=this.HV,e.shape.wD(t))})),this}no(){return this.iV=0,this.eV={},this.nN=this.Dh.initialBoundaries,this.Xv.forEach((t=>{t.shape.dispose(),t.shape.aN=!1,t.hasData=!1})),this}hy(t){var e;const i=this.Xv[0],s=this.Xv[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.iV/this.Dh.scrollDimensionSize)%this.Xv.length,o=this.Xv[e],h=this.iV%this.Dh.scrollDimensionSize,a=this.Dh.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,p=n+u,m=this.iV>=this.Dh.scrollDimensionSize&&c<=this.Dh.scrollDimensionSize-1,y=l;if(l){const t="columns"===this.Dh.scrollDimension?this.Dh.start.x+(this.iV-1)*this.Dh.step.x:this.Dh.start.z+(this.iV-1)*this.Dh.step.z;o.shape.gN(t)}const x=m?0:1,S=c+(m?1:0);o.shape.dN({fill:{iFirstPrimary:x,amountPrimary:S},wireframe:{iFirstPrimary:x,amountPrimary:S,connectNext:!1}});const v=o===i?s:i,b=c+1,M=1+this.Dh.scrollDimensionSize-b;v.shape.dN({fill:{iFirstPrimary:b,amountPrimary:M},wireframe:{iFirstPrimary:b,amountPrimary:M-1,connectNext:!0}});const A={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,p);let i=!1;y&&this.eV.yValues&&(i=!0,e.splice(0,0,this.eV.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Dh.staticDimensionSize,values:e,type:"y"};o.shape.ty(s),o.hasData=!0,A.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,p);let i=!1;y&&this.eV.intensityValues&&(i=!0,e.splice(0,0,this.eV.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Dh.staticDimensionSize,values:e,type:"intensity"};o.shape.QS(s),o.hasData=!0,A.intensityValues=e[u-1]}this.iV+=u,n+=u,this.eV=A}while(ne.shape.qS(t))),this}JS(){return this.Xv[0].shape.JS()}As(t){return this.Xv.forEach((e=>e.shape.As(t))),this}_s(){return this.Xv[0].shape._s()}Pa(t){return this.Xv.forEach((e=>e.shape.Pa(t))),this}Da(){return this.Xv[0].shape.Da()}iB(){return this.dispose(),this.Xv.forEach((t=>t.shape.iB())),this}dispose(){return super.dispose(),this.Xv.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.Xv.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}Ym(t){return super.Ym(t),this.Xv.forEach((e=>e.shape.Ym(t))),this}wt(){return this.nN.max.x}At(){return this.nN.min.x}Ct(){return Math.max(this.Xv[0].shape.Ct(),this.Xv[1].shape.Ct())}kt(){return Math.min(this.Xv[0].shape.kt(),this.Xv[1].shape.kt())}Km(){return this.nN.max.z}qm(){return this.nN.min.z}bo(){return 0}vo(){return 0}Jm(){return 0}zr(t){return super.zr(t),this.Xv.forEach((e=>e.shape.zr(t))),this}}class Hg extends Sg{constructor(t,e,i,s){super(t,e,i),this.bN=45,this.vN=.1,this.MN=100,this.WV=f(0,0,1),this._N=f(0,0,-1),this.AN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.Nm=new th,this.ut=s}Sy(){const{cellIndex:t,cellSpan:e,cellsAmount:i}=this.ut,s=e.x/i.x,r=e.y/i.y,n=t.x/i.x,o=t.y/i.y,h=this.Wi.$t();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.WV=t,this}getCameraLocation(){return this.WV}setCameraDirection(t){return this._N=Ae.normalize(t),this}getCameraDirection(){return this._N}setLightLocation(t){return this.HV=t,this}getLightLocation(){return this.HV}wN(){return f(this.AN[0],this.AN[1],this.AN[2])}kN(){return f(this.AN[4],this.AN[5],this.AN[6])}}class Ug extends Hg{constructor(t,e,i,s){super(t,e,i,s),this.yB=new vf,this.CN=!0,this.iR=t,this.gl=t.eR(),this.vV=this.mV,this.TN=this.Wi._r((()=>{this.CN=!0})),this.IN=s.W((()=>{this.CN=!0}))}iO(t){const e=t.At(),i=t.kt(),s=t.qm(),r=t.wt(),n=t.Ct(),o=t.Km();if(e===ke||r===we||i===ke||n===we||s===ke||o===we)return De;const h=t.bo(),a=t.vo(),l=t.Jm(),u=Math.abs(t.Hr.Lm(h)*t.ut.x.st()),c=Math.abs(t.Hr.Lm(a)*t.ut.y.st()),d=Math.abs(t.Hr.Lm(l)*t.ut.z.st()),f=e-u,g=r+u,p=i-c,m=n+c,y=s-d,x=o+d;let S;return[{x:f,y:p,z:y},{x:g,y:p,z:y},{x:f,y:m,z:y},{x:g,y:m,z:y},{x:f,y:p,z:x},{x:g,y:p,z:x},{x:f,y:m,z:x},{x:g,y:m,z:x}].map((e=>t.Hr.Em(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};S=S?We(S,{min:t,max:t}):e})),S||De}MV(t){const e=Array.from(this.vV.values());for(let i=0;ipe()));const{viewProjectionMatrix:s}=this.FN();this.PN();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.mV.forEach((t=>{t.GV=s,t.WV=r,t.HV=n,t.Zs(i)})),this}FN(){if(!this.CN&&this.GV)return{viewProjectionMatrix:this.GV};const t=this.Sy(),e=t.width/t.height;this.LN=bd.projectionPerspective(this.bN,e,this.vN,this.MN);const i=this.WV;this.AN[12]=i.x,this.AN[13]=i.y,this.AN[14]=i.z;const s=this._N,r=f(0,1,0),n=Ae.multiply(s,-1),o=Ae.normalize(Ae.cross(r,n)),h=Ae.normalize(Ae.cross(n,o));this.AN[0]=o.x,this.AN[1]=o.y,this.AN[2]=o.z,this.AN[4]=h.x,this.AN[5]=h.y,this.AN[6]=h.z,this.AN[8]=n.x,this.AN[9]=n.y,this.AN[10]=n.z,this.RN=bd.inverse(this.AN);const{cellIndex:a,cellSpan:l,cellsAmount:u}=this.ut,c=l.x/u.x,d=l.y/u.y,g=(a.x+l.x/2)/u.x,p=(a.y+l.y/2)/u.y,m=bd.multiply(bd.translation(fa(-1,1,g),fa(-1,1,p),0),bd.scaling(c,d,1));return this.GV=bd.multiply(m,bd.multiply(this.LN,this.RN)),this.EN=bd.inverse(this.GV),this.CN=!1,{viewProjectionMatrix:this.GV}}PN(){this.yB.jL(this.ut.x),this.yB.ZL(this.ut.y),this.yB.KL(this.ut.z)}wD(t,e){const i=this.gl.pB(),s=this.Sy(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.tO(r.x,r.y,r.width,r.height),this.mV.forEach((e=>{e.getVisible()&&(this.gl.KB(e.FV),1!==t&&this.gl.Xm(e.Wm),(1!==t||e.getMouseInteractions())&&e.wD(t))})),this.gl.KB("disabled"),this.gl.Xm(!1),this.gl.qB(!1),this}setCameraLocation(t){return this.WV.x===t.x&&this.WV.y===t.y&&this.WV.z===t.z||(this.CN=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this._N.x===t.x&&this._N.y===t.y&&this._N.z===t.z||(this.CN=!0),super.setCameraDirection(t),this}G(){super.G(),this.Wi.Ar(this.TN),this.ut.H(this.IN)}aS(t){const e=this.iR._V();return this.SV(new Gg(this,this.yV,[],e,this.iR.AV(e),t))}Kp(t){const e=this.iR._V();return this.SV(new zg(this,this.yV,t,e,this.iR.AV(e)))}iS(){const t=this.iR._V();return this.SV(new Cg(this,this.yV,[],t,this.iR.AV(t)))}wg(){const t=this.iR._V();return this.SV(new Fg(this,this.yV,[],t,this.iR.AV(t)))}KS(t){const e=this.iR._V();return this.SV(new Ng(this,this.yV,[],t,e,this.iR.AV(e)))}ey(t){const e=this.iR._V();return this.SV(new Wg(this,this.yV,[],t,e,this.iR.AV(e)))}}const Xg=(t,e,i,s,r)=>{const{range:n}=i,o={row:{...n.row},column:{...n.column}};if(o.row.end+=1,o.column.end+=1,e){o.row.end+=1,o.column.end+=1;const e=Et(t,o),[n,h,a,l,u]=s.pixelated(e.sliced,e.rows*e.columns,r);i.vbo=n,i.ibo=h,i.length=a,i.lengthWireframe=l,i.boundary=u}else{const e=Et(t,o),[n,h,a,l,u]=s.nonPixelated(e.sliced,e.rows*e.columns,r);i.vbo=n,i.ibo=h,i.length=a,i.lengthWireframe=l,i.boundary=u}},jg={pixelated:(t,e)=>{const i=t.length,s=e/i,r=i-1,n=s-1,o=r*n*6,h=Array(r*n*4*2),a=Array(o),l=p(c(ke,ke),c(we,we));let u=0,d=1,f=2,g=3,m=0,y=0;for(let e=0;e{const i=t.length,s=e/i,r=i-1,n=s-1,o=Array(2*e),h=Array(r*n*6),a=p(c(ke,ke),c(we,we));let l=0;for(let e=0;e{const{range:r}=i,n={row:{...r.row},column:{...r.column}};n.row.end+=1,n.column.end+=1;const o=Et(t,n);i.intensities=e?((t,e,i)=>{const s=t.length,r=e/s,n=new Float32Array(e*i);for(let e=0,o=0;e{const i=new Float32Array(e),s=t.length,r=e/s;for(let e=0,n=0;e{const{range:n}=s,o={row:{...n.row},column:{...n.column}};o.row.end+=1,o.column.end+=1;const h=Et(t,o);s.colors=i?((t,e,i,s)=>{const r=t.length,n=e/r,o=new Float32Array(4*e*s);for(let e=0,h=0;e{const s=new Float32Array(4*e),r=t.length,n=e/r;for(let e=0,o=0;e{const s=i-1;t<=1&&(t+=1),e<=1&&(e+=1);const r=Math.ceil((t-1)/s),n=Math.ceil((e-1)/s),o=Array.from(Array(r)).map((()=>Array(n)));for(let i=0,h=0,a=0,l=t-1;i{const s=Array(i*e);for(let r=0,n=0;r({vbo:void 0,ibo:void 0,colors:void 0,intensities:void 0,length:0}))),this.Aa.o=!1,this.wa.o=!1}const t=this.GN,e=this.VN,s=this.Ua;if(o){this.$n=De;for(const e of t)Xg(s,this.Ia,e,jg,void 0);let r=0;for(const s of e){s.vbo&&i.gl.deleteBuffer(s.vbo),s.ibo&&i.gl.deleteBuffer(s.ibo);const e=t[r];r+=1,s.vbo=i.sO(e.vbo),s.ibo=i.zO(e.ibo),s.length=e.length,s.lengthWireframe=e.lengthWireframe,this.$n=We(this.$n,e.boundary)}this.Ta=!1}}if(this.Zr()){s instanceof N||(this.iR.oL.bt(this.bE),this.bE=void 0),this.bB=s===B?void 0:i.hO(pf["2D"],pf.VertexLocation({translation:"grid"===this.zN?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:kf(this.ut),normalSource:void 0}),s instanceof L?pf.Color({dataType:"uniform"}):s instanceof G?pf.Color({dataType:"attribute"}):s instanceof N?pf.Color({dataType:["lookup",s.getLookUpProperty()]}):s instanceof $||s instanceof q?pf.Color({dataType:["gradient",s]}):void 0);const t=this.Fa;this.HN=t instanceof L?i.hO(pf["2D"],pf.Color({dataType:"uniform"}),pf.VertexLocation({translation:"grid"===this.zN?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0,this.Qr(s),this.qa=this.Fa}const h=this.GN,a=this.VN,l=this.Ya;if(s instanceof N&&s.lut.isValid){if(this.Ca){for(const t of h)Yg(l,this.Ia,t,jg);let t=0;for(const e of a){e&&e.intensities&&i.gl.deleteBuffer(e.intensities);const s=h[t];t+=1,e.intensities=i.VO(s.intensities)}this.Ca=!1}const t=s.getPalette();this.xE=this.iR.jR(t,this.bE,this.xE),this.bE=t}else if(s instanceof G&&(this.UN&&i.vO(this.UN),this.ka)){for(const t of h)$g(l,s.color,this.Ia,t,jg);let t=0;for(const e of a){e.colors&&i.gl.deleteBuffer(e.colors);const s=h[t];t+=1,e.colors=i.VO(s.colors)}this.ka=!1}s instanceof $?this.yR=wf(this.Er(),this.ut,s.getPosition(),s.getExtent(),s.getShape(),this.kD.pB()):s instanceof q?this.xR=Df(this.Er(),this.ut,s.getAngle(!0),this.kD.pB()):(this.yR=void 0,this.xR=void 0),this.FR=e?this.FR||this.kD.hO(pf["2D"],pf.MousePicking,pf.VertexLocation({translation:"grid"===this.zN?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:kf(this.ut),normalSource:void 0})):void 0}return this}wD(t){const e=this.Ya&&this.Ua;if(this.Jr()&&e){const e=1===t?this.FR:this.bB;if(e){const i=this.jr,s=i instanceof L&&i,r=i instanceof N&&i,n=i instanceof G&&i,o=i instanceof $&&i,h=i instanceof q&&i;this.kD.rO(e,((i,a,l)=>{let u=!1;this.kD.uB(e).oO(i("uScale"),this.yB.uO()).oO(i("uDisp"),this.yB.dO()).lO(i("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(i("uHighlightColorOffset"),this.Br).lO(i("uRenderEffectMask"),2===t?1:0),"grid"===this.zN&&this.kD.oO(i("uTranslationAxis"),[this.gi.x,this.gi.y]),1===t?this.kD.cO(i("uColor"),this.uR):s?this.kD.cO(i("uColor"),s.getColor()):r&&r.lut.isValid&&this.xE?this.kD.LL(l,r.lut,this.xE,0):o?this.kD.yL(l,this.yR,o):h&&this.kD.xL(l,this.xR,h);for(const{vbo:e,ibo:i,colors:s,intensities:o,length:h}of this.VN)this.kD.NO(a("aPos"),e).YO(i),1!==t&&(r&&"value"===r.getLookUpProperty()&&this.kD.$O(a("aLookupValue"),o),n&&this.kD.UO(a("aColor"),s)),this.kD.XO(h),u=!0;return u}))}const i=1===t?void 0:this.HN;if(i){const e=this.Fa,s=e instanceof L&&e;this.kD.rO(i,((e,r,n)=>{let o=!1;this.kD.uB(i).oO(e("uScale"),this.yB.uO()).oO(e("uDisp"),this.yB.dO()).lO(e("uIsHighlighted"),1===t||2===t?0:this.Fr).cO(e("uHighlightColorOffset"),this.Br).lO(e("uRenderEffectMask"),2===t?1:0),"grid"===this.zN&&this.kD.oO(e("uTranslationAxis"),[this.gi.x,this.gi.y]),s&&this.kD.cO(e("uColor"),s.getColor());for(const{vbo:t,ibo:e,lengthWireframe:i}of this.VN)this.kD.NO(r("aPos"),t).YO(e).XO(i,this.kD.gl.LINES),o=!0;return o}))}}return this}rR(t){return this.cR===t&&{}}$N(t,e){if(this.kr.M()&&this.$n&&this.Ua){const n="grid"===this.zN?this.gi:{x:0,y:0},o=ti(nt({x:t,y:e},this.Wi.ut,this.ut),n);if(i=o,s=this.$n.min,r=this.$n.max,!(i.x>r.x||i.y>r.y||i.x0){for(const e of this.VN){const{vbo:i,ibo:s,colors:r,intensities:n}=e||{};i&&(t.pO(i),e.vbo=void 0),s&&(t.pO(s),e.ibo=void 0),r&&(t.pO(r),e.colors=void 0),n&&(t.pO(n),e.intensities=void 0)}this.VN.length=0}}iB(){return this.WN(),this.UN&&(this.kD.vO(this.UN),this.UN=void 0),this.iR.oL.bt(this.bE),this.xE=void 0,this}Va(t,e){return this.zN="mesh",super.Va(t,e)}wt(){return"grid"===this.zN?this.$n.max.x+this.gi.x:this.$n.max.x}At(){return"grid"===this.zN?this.$n.min.x+this.gi.x:this.$n.min.x}Ct(){return"grid"===this.zN?this.$n.max.y+this.gi.y:this.$n.max.y}kt(){return"grid"===this.zN?this.$n.min.y+this.gi.y:this.$n.min.y}bo(){return 0}vo(){return 0}}class qg extends fs{constructor(t,e,i=yf){var s,r,n;super(t,e),this.Y=c(1,1),this.YN=!1,this.XN=0,this.jN=!0,this.ZN=0,this.KV=8388608,this.Gi=(t=!1)=>(t&&(this.YN=!0),void 0===this.Ye&&(this.Ye=mt.requestAnimationFrame(this.KN)),this),this.KN=t=>{const e=t-this.XN;e>=this.Yh||-1===this.Yh?(this.XN=t,this.YN=!1,this.Xe&&this.Xe(),this.Ye=void 0,-1!==this.Yh&&(this.Ye=this.YN?mt.requestAnimationFrame(this.KN):void 0),this.Zh.Zs(e),this.rh(),this.oh(),this.je&&this.je()):this.Ye=mt.requestAnimationFrame(this.KN)},this.qN=new Map,this.eR=()=>this.kD,this.JN=()=>{var t,e,i;const s=this.Fh(),r=this.jN,n=mt.performance.now(),o=null===(t=this.QN)||void 0===t?void 0:t.tG.reduce(((t,e)=>t?e.iG&&t.iG&&e.iG>t.iG?e:t:e),void 0),h=null==o?void 0:o.iG,a=null===(e=this._h)||void 0===e?void 0:e.timeStamp,l=null===(i=this.Sr)||void 0===i?void 0:i.timeStamp;return r?(this.Gi(!0),!1):void 0===o||(void 0===o||!o.sG)&&(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.eG=()=>{var t,e;this.hG=void 0;const i=null===(e=null===(t=this.QN)||void 0===t?void 0:t.rG)||void 0===e?void 0:e.nG;void 0===i||i>=this.ZN||this.oG()},this.oh=()=>{const t=this.kD.gl,e=mt.performance.now(),i=this.Y,s=i.x>0&&i.y>0;if(this.sh.o&&this.kD.QO(this.sh.M()),this.kD.no(),t.resize&&s&&t.resize(i.x*this.kD.pB(),i.y*this.kD.pB()),this.kD.QB(0,0,i.x*this.kD.pB(),i.y*this.kD.pB()),this.aG.width=i.x*this.kD.pB(),this.aG.height=i.y*this.kD.pB(),s)for(const t of this.He.values())t.wD(0,1);return this.Dh.Hh&&s&&(this.hG&&(mt.clearTimeout(this.hG),this.hG=void 0),this.JN()?this.oG():this.hG=mt.setTimeout(this.eG,500)),this.X(),this.Ge(),this.fh&&this.dh(this.fh),this.jN=!1,this.ZN=e,this},this.rh=()=>{const t=this.Y;if(0===t.x||0===t.y)return this;this.tr.q(t);for(const t of this.He.values())t.Zs();return this.X(),this},this.lG=1,this.aG=mt.document.createElement("canvas");const o={preserveDrawingBuffer:!0,antialias:t?t.antialias:void 0,alpha:!0,lineAntialias:!t||(!0===t.lineAntiAlias||!1===t.lineAntiAlias?t.lineAntiAlias:!1!==t.antialias)};let h;if("webgl1"!==(null===(s=null==t?void 0:t.webgl)||void 0===s?void 0:s.version)){const t=this.aG.getContext("webgl2",o);t&&(h=new i(this,this.Dh,{type:"webgl2",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.fs.isDark))}if(!h&&"webgl2"!==(null===(r=null==t?void 0:t.webgl)||void 0===r?void 0:r.version)){const t=this.aG.getContext("webgl",o)||this.aG.getContext("experimental-webgl",o);h=new i(this,this.Dh,{type:"webgl1",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.fs.isDark)}if(!h)throw new ut("No WebGL context available."+((null===(n=null==t?void 0:t.webgl)||void 0===n?void 0:n.version)?`\nSelected explicit target: ${t.webgl.version}`:""));this.kD=h,this.oL=at(this.kD.gl);const a=this.kD.kO;if(a.length>0){const t=mt.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=mt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),this.Be.appendChild(t),t.appendChild(e),!1!==this.Dh.Gh&&mt.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",a.join(", "))}let l=1;if(t&&t.devicePixelRatio)l=!0===t.devicePixelRatio?mt.devicePixelRatio||1:t.devicePixelRatio||1;else{const t=mt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(l=mt.devicePixelRatio||1)}this.kD.gL(l),this.aG.style.position="absolute",this.aG.style.top="0",this.aG.style.left="0",this.aG.style.right="0",this.aG.style.bottom="0",this.aG.style.width="100%",this.aG.style.height="100%",this.aG.style.boxSizing="content-box",this.Be.appendChild(this.aG);const u=t?t.width:void 0,d=t?t.height:void 0;this.qh=this.cG(u),this.Qh=this.cG(d),this.uG(this.qh,this.Qh),this.cN=this.jT("engine offscreen",1e6),this.dG=this.jT("engine bg",0);const f="function"==typeof this.fs.lcjsBackgroundFillStyle?this.fs.lcjsBackgroundFillStyle(this.Dh.Nh):this.fs.lcjsBackgroundFillStyle;this.tr=this.dG._u(this.ut).As(f).ir(this.fs.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Cn({x:0,y:0});const g=this.jT("engine effects",200001).wV(this.fs.effect);this.cc=g,this.th(),this.Ge(),this.Gg=hs(this),this.Wg={fs:this.fs,Zh:this.Zh,Gi:t=>this.Gi(t),Fh:()=>this.Fh(),DP:t=>this.DP(t),Dh:this.Dh,Ph:t=>this.Ph(t),cc:this.cc};const p=()=>{this.G()};mt.addEventListener("unload",p),this.Ze.push((()=>{mt.removeEventListener("unload",p)}))}get fG(){return this.He}We(t,e){let i=this.qN.get(t);if(!i){const e=this.kD.bL(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.qN.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{BP:()=>e.DB,OP:t=>{e.DB?t():o.push(t)}}},this.qN.set(t,i),e.uB(this),e.VB((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new rd(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}DP(t){const e=Array.from(this.qN.values()).find((e=>e.instances.has(t)));if(!e)throw ge(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}gh(t,e){var i;const s=null===(i=this.QN)||void 0===i?void 0:i.rG;if(!s)return;const r=this.Re(e.x,e.y),n=Math.round(r.x*this.kD.pB()),o=Math.round(r.y*this.kD.pB());return[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.gG(s,n+t[0]/s.pG,o+t[1]/s.pG))).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)}gG(t,e,i){const s=Math.round(e*t.pG),r=Math.round(i*t.pG);if(s<0||s>=t.Y.x||r<0||r>=t.Y.y)return;const n=4*(s+r*t.Y.x),o=t.mG[n+0],h=t.mG[n+1],a=t.mG[n+2],l=t.mG[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.SG(o,h,a,l):void 0}ze(t,e){return(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=mt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof bg))throw new Error("Unexpected Engine Layer error");return i}return this.ah(new bg(this,e,t))}qT(t,e,i){const s=this.rr(e);if(s){if(ge(0,(()=>{})),!(s instanceof Ug))throw new Error("Unexpected Engine Layer error");return s}return this.ah(new Ug(this,e,t,i))}$t(){return this.Y}cG(t){return t instanceof Array||(t=[t,t]),t}Qe(){return this.aG}oG(){var t;const e=this.kD.gl,i=mt.performance.now(),s=this.Fh(),r=this.Dh.Wh,n={x:Math.ceil(this.Y.x*this.kD.pB()*r),y:Math.ceil(this.Y.y*this.kD.pB()*r)};this.QN||(this.QN={pG:r,yG:n,tG:[],rG:void 0});let o=this.QN.tG.find((t=>!t.sG)),h=!1;o||(h=!0,o={sG:!1,Y:n,BL:e.createTexture(),xG:this.kD.yO(),bG:this.kD.xO(),vG:new Uint8Array,iG:void 0},this.QN.tG.push(o));const a=o;(h||a.Y.x!==n.x||a.Y.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.BL),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),e.bindFramebuffer(e.FRAMEBUFFER,a.xG),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.BL,0),e.bindRenderbuffer(e.RENDERBUFFER,a.bG),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a.bG),a.vG=new Uint8Array(n.x*n.y*4),a.Y=n),a.sG=!0,a.iG=i,e.bindFramebuffer(e.FRAMEBUFFER,a.xG),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.clear(e.DEPTH_BUFFER_BIT),e.disable(e.BLEND),e.resize&&e.resize(n.x,n.y),this.kD.QB(0,0,n.x,n.y);for(const t of this.He.values())t.wD(1,r);e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D,null),e.bindRenderbuffer(e.RENDERBUFFER,null),e.enable(e.BLEND);const l=null===(t=this.kD.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.QN){const t=this.QN.rG;if(t&&t.nG>i)return;this.QN.rG={nG:i,pG:r,Y:n,mG:a.vG,MG:s}}};l?this.kD.FL(l,a.xG,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.vG).then((()=>{this.xe||(a.sG=!1,u())})).catch((t=>{this.xe||(a.sG=!1,mt.console.warn("LightningChart JS mouse picking failed unexpectedly. This could mean that user interactions on charts are compromised.\nPlease report this issue to support@lightningchart.com"))})):(this.kD.PL(a.xG,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.vG),a.sG=!1,u())}th(t){const e=this.Y.x,i=this.Y.y,s=t||{x:this.Be.offsetWidth,y:this.Be.offsetHeight};0!==s.x&&0!==s.y&&(s.x===e&&s.y===i||(this.Y=s,this.ut.x.Z(0,s.x).q(s.x),this.ut.y.Z(0,s.y).q(s.y),this.P.emit("resize",[this.Y.x,this.Y.y])))}G(){super.G(),this.hG&&(mt.clearTimeout(this.hG),this.hG=void 0),this.aG.width=1,this.aG.height=1,this.aG&&(this.Be.removeChild(this.aG),this.aG=void 0,this.Be=void 0),this.oL.vt(),Array.from(this.kD._O.values()).forEach((t=>{t.iB()})),Array.from(this.kD.AO.values()).forEach((t=>{t.unbindResources()})),this.kD.AO.clear(),this.kD.MO.OD(),this.kD.lL.G(),this.kD.pO(this.kD.cL),this.kD.pO(this.kD.uL),this.kD.pO(this.kD.dL),this.kD.wL&&(this.kD.pO(this.kD.wL.buffer),this.kD.wL=void 0),this.QN&&(this.QN.tG.forEach((t=>{this.kD.bO(t.bG),this.kD.vO(t.xG),this.kD.sB(t.BL)})),this.QN=void 0),this.kD.iL.forEach((t=>this.kD.pO(t))),this.qN.clear(),this.kD._L(),this.kD.gl=void 0}jR(t,e,i){const s=this.oL;let r=i;if(s.yt(t))t!==e&&(s.bt(e),r=s.M(t),s.xt(t));else{r={};const e={x:1,y:this.kD.tB};r.textureHeight=e.y;const i=st.d2({scaleXYConstructor:Ti}).q(e);i.x.Z(0,1),i.y.Z(t.min,t.max);const n=new Zg(this,this.cN,i,(()=>{}),[],-1,E);n.As(new G({color:t.color})),t.interpolate?n.S({columns:2,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!1}).Va(((e,i,s)=>({x:s.x,y:t.steps[e].value}))).Ea((e=>t.steps[e].color)):n.S({columns:1,rows:t.length,start:{x:0,y:t.min},end:{x:1,y:t.max},pixelate:!0}).Va(((e,s,r)=>({x:r.x,y:et.steps[e].color)),r.texture=this.kD.pL(null,this.kD.gl.RGBA,!1,!t.interpolate,e,!1),this.kD.aL.wD((()=>{n.Zs(),n.wD(0)}),r.texture,e,void 0,this.sh.M()),s.xt({lut:t,textureInfo:r})}return r}_V(){const t=this.lG;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 support@lightningchart.com!"),this.lG=1),this.lG+=1,t}AV(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,A(i,s,r,e)}SG(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.fG.values()){const e=t.MV(r);if(e)return{entity:e.entity,collectionMember:e.collectionMember,entityIndex:e.index,layerIndex:t.lh()}}}}var Kg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},Jg={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.zB(t||0,e||10,i||"be"))}var n;"object"==typeof Jg?Jg.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.zB=function(t,e,s){if("number"==typeof t)return this._G(t,e,s);if("object"==typeof t)return this.AG(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.wG(t,r):this.kG(t,e,r),"-"===t[0]&&(this.negative=1),this.CG(),"le"===s&&this.AG(this.toArray(),e,s)},r.prototype._G=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.AG(this.toArray(),e,s)},r.prototype.AG=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.CG()},r.prototype.wG=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.CG()},r.prototype.kG=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.PG()},r.prototype.PG=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.CG()}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 p=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?p+s:u[l-p.length]+p+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.CG();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.DG=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.OG=function(t){return 32-Math.clz32(t)}:r.prototype.OG=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.LG=function(t){if(0===t)return 26;var e=t,i=0;return 0==(8191&e)&&(i+=13,e>>>=13),0==(127&e)&&(i+=7,e>>>=7),0==(15&e)&&(i+=4,e>>>=4),0==(3&e)&&(i+=2,e>>>=2),0==(1&e)&&i++,i},r.prototype.bitLength=function(){var t=this.words[this.length-1],e=this.OG(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.FG(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.CG()},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.FG(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.PG()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.PG();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,p=f>>>13,m=0|o[2],y=8191&m,x=m>>>13,S=0|o[3],v=8191&S,b=S>>>13,M=0|o[4],A=8191&M,k=M>>>13,w=0|o[5],D=8191&w,E=w>>>13,T=0|o[6],I=8191&T,C=T>>>13,P=0|o[7],O=8191&P,F=P>>>13,R=0|o[8],B=8191&R,z=R>>>13,_=0|o[9],L=8191&_,G=_>>>13,V=0|h[0],N=8191&V,W=V>>>13,H=0|h[1],U=8191&H,X=H>>>13,j=0|h[2],Y=8191&j,$=j>>>13,Z=0|h[3],q=8191&Z,K=Z>>>13,J=0|h[4],Q=8191&J,tt=J>>>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,pt=ft>>>13;i.negative=t.negative^e.negative,i.length=19;var mt=(l+(s=Math.imul(c,N))|0)+((8191&(r=(r=Math.imul(c,W))+Math.imul(d,N)|0))<<13)|0;l=((n=Math.imul(d,W))+(r>>>13)|0)+(mt>>>26)|0,mt&=67108863,s=Math.imul(g,N),r=(r=Math.imul(g,W))+Math.imul(p,N)|0,n=Math.imul(p,W);var yt=(l+(s=s+Math.imul(c,U)|0)|0)+((8191&(r=(r=r+Math.imul(c,X)|0)+Math.imul(d,U)|0))<<13)|0;l=((n=n+Math.imul(d,X)|0)+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(y,N),r=(r=Math.imul(y,W))+Math.imul(x,N)|0,n=Math.imul(x,W),s=s+Math.imul(g,U)|0,r=(r=r+Math.imul(g,X)|0)+Math.imul(p,U)|0,n=n+Math.imul(p,X)|0;var xt=(l+(s=s+Math.imul(c,Y)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,Y)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(v,N),r=(r=Math.imul(v,W))+Math.imul(b,N)|0,n=Math.imul(b,W),s=s+Math.imul(y,U)|0,r=(r=r+Math.imul(y,X)|0)+Math.imul(x,U)|0,n=n+Math.imul(x,X)|0,s=s+Math.imul(g,Y)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(p,Y)|0,n=n+Math.imul(p,$)|0;var St=(l+(s=s+Math.imul(c,q)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(d,q)|0))<<13)|0;l=((n=n+Math.imul(d,K)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(A,N),r=(r=Math.imul(A,W))+Math.imul(k,N)|0,n=Math.imul(k,W),s=s+Math.imul(v,U)|0,r=(r=r+Math.imul(v,X)|0)+Math.imul(b,U)|0,n=n+Math.imul(b,X)|0,s=s+Math.imul(y,Y)|0,r=(r=r+Math.imul(y,$)|0)+Math.imul(x,Y)|0,n=n+Math.imul(x,$)|0,s=s+Math.imul(g,q)|0,r=(r=r+Math.imul(g,K)|0)+Math.imul(p,q)|0,n=n+Math.imul(p,K)|0;var vt=(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)+(vt>>>26)|0,vt&=67108863,s=Math.imul(D,N),r=(r=Math.imul(D,W))+Math.imul(E,N)|0,n=Math.imul(E,W),s=s+Math.imul(A,U)|0,r=(r=r+Math.imul(A,X)|0)+Math.imul(k,U)|0,n=n+Math.imul(k,X)|0,s=s+Math.imul(v,Y)|0,r=(r=r+Math.imul(v,$)|0)+Math.imul(b,Y)|0,n=n+Math.imul(b,$)|0,s=s+Math.imul(y,q)|0,r=(r=r+Math.imul(y,K)|0)+Math.imul(x,q)|0,n=n+Math.imul(x,K)|0,s=s+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,tt)|0)+Math.imul(p,Q)|0,n=n+Math.imul(p,tt)|0;var bt=(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)+(bt>>>26)|0,bt&=67108863,s=Math.imul(I,N),r=(r=Math.imul(I,W))+Math.imul(C,N)|0,n=Math.imul(C,W),s=s+Math.imul(D,U)|0,r=(r=r+Math.imul(D,X)|0)+Math.imul(E,U)|0,n=n+Math.imul(E,X)|0,s=s+Math.imul(A,Y)|0,r=(r=r+Math.imul(A,$)|0)+Math.imul(k,Y)|0,n=n+Math.imul(k,$)|0,s=s+Math.imul(v,q)|0,r=(r=r+Math.imul(v,K)|0)+Math.imul(b,q)|0,n=n+Math.imul(b,K)|0,s=s+Math.imul(y,Q)|0,r=(r=r+Math.imul(y,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(p,it)|0,n=n+Math.imul(p,st)|0;var Mt=(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)+(Mt>>>26)|0,Mt&=67108863,s=Math.imul(O,N),r=(r=Math.imul(O,W))+Math.imul(F,N)|0,n=Math.imul(F,W),s=s+Math.imul(I,U)|0,r=(r=r+Math.imul(I,X)|0)+Math.imul(C,U)|0,n=n+Math.imul(C,X)|0,s=s+Math.imul(D,Y)|0,r=(r=r+Math.imul(D,$)|0)+Math.imul(E,Y)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(A,q)|0,r=(r=r+Math.imul(A,K)|0)+Math.imul(k,q)|0,n=n+Math.imul(k,K)|0,s=s+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,tt)|0)+Math.imul(b,Q)|0,n=n+Math.imul(b,tt)|0,s=s+Math.imul(y,it)|0,r=(r=r+Math.imul(y,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(p,nt)|0,n=n+Math.imul(p,ot)|0;var At=(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)+(At>>>26)|0,At&=67108863,s=Math.imul(B,N),r=(r=Math.imul(B,W))+Math.imul(z,N)|0,n=Math.imul(z,W),s=s+Math.imul(O,U)|0,r=(r=r+Math.imul(O,X)|0)+Math.imul(F,U)|0,n=n+Math.imul(F,X)|0,s=s+Math.imul(I,Y)|0,r=(r=r+Math.imul(I,$)|0)+Math.imul(C,Y)|0,n=n+Math.imul(C,$)|0,s=s+Math.imul(D,q)|0,r=(r=r+Math.imul(D,K)|0)+Math.imul(E,q)|0,n=n+Math.imul(E,K)|0,s=s+Math.imul(A,Q)|0,r=(r=r+Math.imul(A,tt)|0)+Math.imul(k,Q)|0,n=n+Math.imul(k,tt)|0,s=s+Math.imul(v,it)|0,r=(r=r+Math.imul(v,st)|0)+Math.imul(b,it)|0,n=n+Math.imul(b,st)|0,s=s+Math.imul(y,nt)|0,r=(r=r+Math.imul(y,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(p,at)|0,n=n+Math.imul(p,lt)|0;var kt=(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)+(kt>>>26)|0,kt&=67108863,s=Math.imul(L,N),r=(r=Math.imul(L,W))+Math.imul(G,N)|0,n=Math.imul(G,W),s=s+Math.imul(B,U)|0,r=(r=r+Math.imul(B,X)|0)+Math.imul(z,U)|0,n=n+Math.imul(z,X)|0,s=s+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,$)|0)+Math.imul(F,Y)|0,n=n+Math.imul(F,$)|0,s=s+Math.imul(I,q)|0,r=(r=r+Math.imul(I,K)|0)+Math.imul(C,q)|0,n=n+Math.imul(C,K)|0,s=s+Math.imul(D,Q)|0,r=(r=r+Math.imul(D,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(k,it)|0,n=n+Math.imul(k,st)|0,s=s+Math.imul(v,nt)|0,r=(r=r+Math.imul(v,ot)|0)+Math.imul(b,nt)|0,n=n+Math.imul(b,ot)|0,s=s+Math.imul(y,at)|0,r=(r=r+Math.imul(y,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(p,ct)|0,n=n+Math.imul(p,dt)|0;var wt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,pt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,pt)|0)+(r>>>13)|0)+(wt>>>26)|0,wt&=67108863,s=Math.imul(L,U),r=(r=Math.imul(L,X))+Math.imul(G,U)|0,n=Math.imul(G,X),s=s+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,$)|0)+Math.imul(z,Y)|0,n=n+Math.imul(z,$)|0,s=s+Math.imul(O,q)|0,r=(r=r+Math.imul(O,K)|0)+Math.imul(F,q)|0,n=n+Math.imul(F,K)|0,s=s+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,tt)|0)+Math.imul(C,Q)|0,n=n+Math.imul(C,tt)|0,s=s+Math.imul(D,it)|0,r=(r=r+Math.imul(D,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(k,nt)|0,n=n+Math.imul(k,ot)|0,s=s+Math.imul(v,at)|0,r=(r=r+Math.imul(v,lt)|0)+Math.imul(b,at)|0,n=n+Math.imul(b,lt)|0,s=s+Math.imul(y,ct)|0,r=(r=r+Math.imul(y,dt)|0)+Math.imul(x,ct)|0,n=n+Math.imul(x,dt)|0;var Dt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,pt)|0)+Math.imul(p,gt)|0))<<13)|0;l=((n=n+Math.imul(p,pt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(L,Y),r=(r=Math.imul(L,$))+Math.imul(G,Y)|0,n=Math.imul(G,$),s=s+Math.imul(B,q)|0,r=(r=r+Math.imul(B,K)|0)+Math.imul(z,q)|0,n=n+Math.imul(z,K)|0,s=s+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,tt)|0)+Math.imul(F,Q)|0,n=n+Math.imul(F,tt)|0,s=s+Math.imul(I,it)|0,r=(r=r+Math.imul(I,st)|0)+Math.imul(C,it)|0,n=n+Math.imul(C,st)|0,s=s+Math.imul(D,nt)|0,r=(r=r+Math.imul(D,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(k,at)|0,n=n+Math.imul(k,lt)|0,s=s+Math.imul(v,ct)|0,r=(r=r+Math.imul(v,dt)|0)+Math.imul(b,ct)|0,n=n+Math.imul(b,dt)|0;var Et=(l+(s=s+Math.imul(y,gt)|0)|0)+((8191&(r=(r=r+Math.imul(y,pt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,pt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(L,q),r=(r=Math.imul(L,K))+Math.imul(G,q)|0,n=Math.imul(G,K),s=s+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,tt)|0)+Math.imul(z,Q)|0,n=n+Math.imul(z,tt)|0,s=s+Math.imul(O,it)|0,r=(r=r+Math.imul(O,st)|0)+Math.imul(F,it)|0,n=n+Math.imul(F,st)|0,s=s+Math.imul(I,nt)|0,r=(r=r+Math.imul(I,ot)|0)+Math.imul(C,nt)|0,n=n+Math.imul(C,ot)|0,s=s+Math.imul(D,at)|0,r=(r=r+Math.imul(D,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(k,ct)|0,n=n+Math.imul(k,dt)|0;var Tt=(l+(s=s+Math.imul(v,gt)|0)|0)+((8191&(r=(r=r+Math.imul(v,pt)|0)+Math.imul(b,gt)|0))<<13)|0;l=((n=n+Math.imul(b,pt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(L,Q),r=(r=Math.imul(L,tt))+Math.imul(G,Q)|0,n=Math.imul(G,tt),s=s+Math.imul(B,it)|0,r=(r=r+Math.imul(B,st)|0)+Math.imul(z,it)|0,n=n+Math.imul(z,st)|0,s=s+Math.imul(O,nt)|0,r=(r=r+Math.imul(O,ot)|0)+Math.imul(F,nt)|0,n=n+Math.imul(F,ot)|0,s=s+Math.imul(I,at)|0,r=(r=r+Math.imul(I,lt)|0)+Math.imul(C,at)|0,n=n+Math.imul(C,lt)|0,s=s+Math.imul(D,ct)|0,r=(r=r+Math.imul(D,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var It=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,pt)|0)+Math.imul(k,gt)|0))<<13)|0;l=((n=n+Math.imul(k,pt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(L,it),r=(r=Math.imul(L,st))+Math.imul(G,it)|0,n=Math.imul(G,st),s=s+Math.imul(B,nt)|0,r=(r=r+Math.imul(B,ot)|0)+Math.imul(z,nt)|0,n=n+Math.imul(z,ot)|0,s=s+Math.imul(O,at)|0,r=(r=r+Math.imul(O,lt)|0)+Math.imul(F,at)|0,n=n+Math.imul(F,lt)|0,s=s+Math.imul(I,ct)|0,r=(r=r+Math.imul(I,dt)|0)+Math.imul(C,ct)|0,n=n+Math.imul(C,dt)|0;var Ct=(l+(s=s+Math.imul(D,gt)|0)|0)+((8191&(r=(r=r+Math.imul(D,pt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,pt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(L,nt),r=(r=Math.imul(L,ot))+Math.imul(G,nt)|0,n=Math.imul(G,ot),s=s+Math.imul(B,at)|0,r=(r=r+Math.imul(B,lt)|0)+Math.imul(z,at)|0,n=n+Math.imul(z,lt)|0,s=s+Math.imul(O,ct)|0,r=(r=r+Math.imul(O,dt)|0)+Math.imul(F,ct)|0,n=n+Math.imul(F,dt)|0;var Pt=(l+(s=s+Math.imul(I,gt)|0)|0)+((8191&(r=(r=r+Math.imul(I,pt)|0)+Math.imul(C,gt)|0))<<13)|0;l=((n=n+Math.imul(C,pt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,s=Math.imul(L,at),r=(r=Math.imul(L,lt))+Math.imul(G,at)|0,n=Math.imul(G,lt),s=s+Math.imul(B,ct)|0,r=(r=r+Math.imul(B,dt)|0)+Math.imul(z,ct)|0,n=n+Math.imul(z,dt)|0;var Ot=(l+(s=s+Math.imul(O,gt)|0)|0)+((8191&(r=(r=r+Math.imul(O,pt)|0)+Math.imul(F,gt)|0))<<13)|0;l=((n=n+Math.imul(F,pt)|0)+(r>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,s=Math.imul(L,ct),r=(r=Math.imul(L,dt))+Math.imul(G,ct)|0,n=Math.imul(G,dt);var Ft=(l+(s=s+Math.imul(B,gt)|0)|0)+((8191&(r=(r=r+Math.imul(B,pt)|0)+Math.imul(z,gt)|0))<<13)|0;l=((n=n+Math.imul(z,pt)|0)+(r>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Rt=(l+(s=Math.imul(L,gt))|0)+((8191&(r=(r=Math.imul(L,pt))+Math.imul(G,gt)|0))<<13)|0;return l=((n=Math.imul(G,pt))+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=mt,a[1]=yt,a[2]=xt,a[3]=St,a[4]=vt,a[5]=bt,a[6]=Mt,a[7]=At,a[8]=kt,a[9]=wt,a[10]=Dt,a[11]=Et,a[12]=Tt,a[13]=It,a[14]=Ct,a[15]=Pt,a[16]=Ot,a[17]=Ft,a[18]=Rt,0!==l&&(a[19]=l,i.length++),i};function p(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.CG()}function m(t,e,i){return p(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?p(this,t,e):m(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),m(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.CG()},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.CG();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.CG()},r.prototype.zG=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.OG(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.EG(n,d,c);0!==s.negative;)d--,s.negative=0,s.EG(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.CG(),s.CG(),"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}):0!=(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.zG(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.CG(),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;0==(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,p=1;0==(s.words[0]&p)&&g<26;++g,p<<=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.VG=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;0==(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;0==(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 0==(1&this.words[0])},r.prototype.isOdd=function(){return 1==(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.CG(),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 A(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).NG(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.NG=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.NG(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.GG(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.GG(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.WG(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.WG(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.WG(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.WG(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.WG(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.WG(this),this.red.pow(this,t)};var y={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.HG()}function S(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function b(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(t){if("string"==typeof t){var e=r.UG(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 k(t){A.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.VG(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.HG=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.CG(),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.UG=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new S;else if("p224"===t)e=new v;else if("p192"===t)e=new b;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return y[t]=e,e},A.prototype.WG=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype.GG=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},A.prototype.imod=function(t){return this.prime?this.prime.ireduce(t).NG(this):(a(t,t.umod(this.m).NG(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).NG(this)},A.prototype.add=function(t,e){this.GG(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.NG(this)},A.prototype.iadd=function(t,e){this.GG(t,e);var i=t.iadd(e);return i.cmp(this.m)>=0&&i.isub(this.m),i},A.prototype.sub=function(t,e){this.GG(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.NG(this)},A.prototype.isub=function(t,e){this.GG(t,e);var i=t.isub(e);return i.cmpn(0)<0&&i.iadd(this.m),i},A.prototype.shl=function(t,e){return this.WG(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this.GG(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this.GG(t,e),this.imod(t.mul(e))},A.prototype.isqr=function(t){return this.imul(t,t.clone())},A.prototype.sqr=function(t){return this.mul(t,t)},A.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 p=f,m=0;0!==p.cmp(h);m++)p=p.redSqr();i(m=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},A.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},A.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},r.mont=function(t){return new k(t)},s(k,A),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.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.NG(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).NG(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.NG(this)},k.prototype.invm=function(t){return this.imod(t.VG(this.m).mul(this.r2)).NG(this)}}(0,Kg);var Qg=Jg.exports;function tp(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 ep=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},ip=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),0==(1&h))n=0;else{const e=t.andln(7)+s&7;n=3!==e&&5!==e||2!==a?h:-h}if(i[0].push(n),0==(1&a))o=0;else{const t=e.andln(7)+r&7;o=3!==t&&5!==t||2!==h?a:-a}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 sp{constructor(t,e){this.type=t,this.p=new Qg(e.p,16),this.red=e.prime?Qg.red(e.prime):Qg.mont(this.p),this.zero=new Qg(0).toRed(this.red),this.one=new Qg(1).toRed(this.red),this.two=new Qg(2).toRed(this.red),this.n=e.n&&new Qg(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this.$G=new Array(4),this.YG=new Array(4),this.XG=new Array(4),this.jG=new Array(4),this.ZG=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.KG=!0,this.redN=this.n.toRed(this.red))}qG(t,e){const i=t.JG(),s=ep(e,1,this.ZG);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}iW(t,e,i,s,r){const n=this.$G,o=this.YG,h=this.XG;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]=ep(i[s],n[s],this.ZG),h[r]=ep(i[r],n[r],this.ZG),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=ip(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)}JG(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 Qg(t.a,16),b:new Qg(t.b,16)}))):this.lW(i),{beta:e,lambda:i,basis:s}}aW(t){const e=t===this.p?this.red:Qg.mont(t),i=new Qg(2).toRed(e).redInvm(),s=i.redNeg(),r=new Qg(3).toRed(e).redNeg().redSqrt().redMul(i);return[s.redAdd(r).fromRed(),s.redSub(r).fromRed()]}lW(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 Qg(1),g=new Qg(0),p=new Qg(0),m=new Qg(1),y=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=p.sub(t.mul(f));const o=m.sub(t.mul(g));if(!r&&l.cmp(e)<0)i=a.neg(),s=f,r=l.neg(),n=u;else if(r&&2==++y)break;a=l,d=c,c=l,p=f,f=u,m=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}]}cW(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 op(this,t,e,i)}pointFromX(t,e){(t=new Qg(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)}uW(t,e,i){const s=this.nW,r=this.oW;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 Qg(t,16),this.isInfinity()?this:this.hW(t)?this.curve.qG(this,t):this.curve.endo?this.curve.uW([this],[t]):this.curve.QG(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.uW(s,r):this.curve.iW(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.uW(s,r,!0):this.curve.iW(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 hp extends rp{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 Qg(0)):(this.x=new Qg(e,16),this.y=new Qg(i,16),this.z=new Qg(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 hp(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 ap{constructor(t){this.curve=new np(t),this.g=this.curve.g,this.n=this.curve.n}}const lp={};var up;lp.PresetCurve=ap,up={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 ap(up);return Object.defineProperty(lp,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class cp{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.pW(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof cp?e:new cp(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}pW(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 dp(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 fp{constructor(){this.place=0}}class gp{constructor(t,e){if(t instanceof gp)return t;this.mW(t,e)||(this.r=new Qg(t.r,16),this.s=new Qg(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}mW(t,e){t=tp(t,e);const i=new fp;if(48!==t[i.place++])return!1;const s=dp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=dp(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=dp(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 Qg(n),this.s=new Qg(h),this.recoveryParam=null,!0}}class pp{constructor(t){if(!(this instanceof pp))return new pp(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 cp.fromPublic(this,t,e)}SW(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.SW(new Qg(t,16)),i=this.keyFromPublic(i,s);const r=(e=new gp(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.KG){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 mp,yp={exports:{}};yp.exports=(mp=mp||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!==Kg&&Kg.crypto&&(i=Kg.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.tk=new a.init,this.yW=0},xW:function(t){"string"==typeof t&&(t=d.parse(t)),this.tk.concat(t),this.yW+=t.sigBytes},bW:function(e){var i,s=this.tk,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.vW,0))*o,u=t.min(4*l,n);if(l){for(var c=0;c>>7)^(g<<14|g>>>18)^g>>>3,m=l[f-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;l[f]=p+l[f-7]+y+l[f-16]}var x=s&r^s&n^r&n,S=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),v=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+v|0,o=n,n=r,r=s,s=v+(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},AW:function(){var t=this.tk,i=t.words,s=8*this.yW,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.bW(),this.TW},clone:function(){var t=n.clone.call(this);return t.TW=this.TW.clone(),t}});i.SHA256=n.wW(u),i.HmacSHA256=n.kW(u)}(Math),t.SHA256}(yp.exports),Mp={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({_W:function(){this.TW=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},AW:function(){var t=r.AW.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.wW(n),e.HmacSHA224=r.kW(n),t.SHA224;var e,i,s,r,n}(yp.exports),Ap={exports:{}}.exports=yp.exports.enc.Hex,kp={exports:{}}.exports=yp.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.IW;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.IW,r=this.FW;if(!r){r=this.FW=[];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)},IW:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(yp.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({_W:function(){this.TW=new r.init([1732584193,4023233417,2562383102,271733878])},MW: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.TW.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],p=t[e+4],m=t[e+5],y=t[e+6],x=t[e+7],S=t[e+8],v=t[e+9],b=t[e+10],M=t[e+11],A=t[e+12],k=t[e+13],w=t[e+14],D=t[e+15],E=n[0],T=n[1],I=n[2],C=n[3];E=l(E,T,I,C,o,7,h[0]),C=l(C,E,T,I,a,12,h[1]),I=l(I,C,E,T,f,17,h[2]),T=l(T,I,C,E,g,22,h[3]),E=l(E,T,I,C,p,7,h[4]),C=l(C,E,T,I,m,12,h[5]),I=l(I,C,E,T,y,17,h[6]),T=l(T,I,C,E,x,22,h[7]),E=l(E,T,I,C,S,7,h[8]),C=l(C,E,T,I,v,12,h[9]),I=l(I,C,E,T,b,17,h[10]),T=l(T,I,C,E,M,22,h[11]),E=l(E,T,I,C,A,7,h[12]),C=l(C,E,T,I,k,12,h[13]),I=l(I,C,E,T,w,17,h[14]),E=u(E,T=l(T,I,C,E,D,22,h[15]),I,C,a,5,h[16]),C=u(C,E,T,I,y,9,h[17]),I=u(I,C,E,T,M,14,h[18]),T=u(T,I,C,E,o,20,h[19]),E=u(E,T,I,C,m,5,h[20]),C=u(C,E,T,I,b,9,h[21]),I=u(I,C,E,T,D,14,h[22]),T=u(T,I,C,E,p,20,h[23]),E=u(E,T,I,C,v,5,h[24]),C=u(C,E,T,I,w,9,h[25]),I=u(I,C,E,T,g,14,h[26]),T=u(T,I,C,E,S,20,h[27]),E=u(E,T,I,C,k,5,h[28]),C=u(C,E,T,I,f,9,h[29]),I=u(I,C,E,T,x,14,h[30]),E=c(E,T=u(T,I,C,E,A,20,h[31]),I,C,m,4,h[32]),C=c(C,E,T,I,S,11,h[33]),I=c(I,C,E,T,M,16,h[34]),T=c(T,I,C,E,w,23,h[35]),E=c(E,T,I,C,a,4,h[36]),C=c(C,E,T,I,p,11,h[37]),I=c(I,C,E,T,x,16,h[38]),T=c(T,I,C,E,b,23,h[39]),E=c(E,T,I,C,k,4,h[40]),C=c(C,E,T,I,o,11,h[41]),I=c(I,C,E,T,g,16,h[42]),T=c(T,I,C,E,y,23,h[43]),E=c(E,T,I,C,v,4,h[44]),C=c(C,E,T,I,A,11,h[45]),I=c(I,C,E,T,D,16,h[46]),E=d(E,T=c(T,I,C,E,f,23,h[47]),I,C,o,6,h[48]),C=d(C,E,T,I,x,10,h[49]),I=d(I,C,E,T,w,15,h[50]),T=d(T,I,C,E,m,21,h[51]),E=d(E,T,I,C,A,6,h[52]),C=d(C,E,T,I,g,10,h[53]),I=d(I,C,E,T,b,15,h[54]),T=d(T,I,C,E,a,21,h[55]),E=d(E,T,I,C,S,6,h[56]),C=d(C,E,T,I,D,10,h[57]),I=d(I,C,E,T,y,15,h[58]),T=d(T,I,C,E,k,21,h[59]),E=d(E,T,I,C,p,6,h[60]),C=d(C,E,T,I,M,10,h[61]),I=d(I,C,E,T,f,15,h[62]),T=d(T,I,C,E,v,21,h[63]),n[0]=n[0]+E|0,n[1]=n[1]+T|0,n[2]=n[2]+I|0,n[3]=n[3]+C|0},AW:function(){var t=this.tk,i=t.words,s=8*this.yW,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.bW();for(var h=this.TW,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.TW=this.TW.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.wW(a),i.HmacMD5=n.kW(a)})(Math),t.MD5}(yp.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({_W:function(){this.TW=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},MW:function(t,e){for(var i=this.TW.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},AW:function(){var t=this.tk,e=t.words,i=8*this.yW,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.bW(),this.TW},clone:function(){var t=r.clone.call(this);return t.TW=this.TW.clone(),t}}),e.SHA1=r.wW(h),e.HmacSHA1=r.kW(h),t.SHA1;var e,i,s,r,n,o,h}(yp.exports),Sp=(xp=yp.exports).lib.Base,vp=xp.enc.Utf8,xp.algo.HMAC=Sp.extend({init:function(t,e){t=this.PW=new t.init,"string"==typeof e&&(e=vp.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.DW=e.clone(),n=this.BW=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.RW==this.OW?t=s.createEncryptor:(t=s.createDecryptor,this.vW=1),this.GW&&this.GW.WW==t?this.GW.init(this,i&&i.words):(this.GW=t.call(s,this,i&&i.words),this.GW.WW=t)},MW:function(t,e){this.GW.processBlock(t,e)},AW:function(){var t,e=this.cfg.padding;return this.RW==this.OW?(e.pad(this.tk,this.blockSize),t=this.bW(!0)):(t=this.bW(!0),e.unpad(t)),t},blockSize:4});var p=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=(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),p.create({ciphertext:i,salt:e})}},y=s.SerializableCipher=r.extend({cfg:r.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 p.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.HW(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},HW: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,p.create({key:r,iv:o,salt:s})}},S=s.PasswordBasedCipher=y.extend({cfg:y.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=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.HW(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)}})}()}(yp.exports);var wp={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 p=t[i],m=t[p],y=t[m],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*y^65537*m^257*p^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=p^t[t[t[y^p]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],p=s.AES=i.extend({_W:function(){if(!this.UW||this.$W!==this.EW){for(var t=this.$W=this.EW,e=t.words,i=t.sigBytes/4,s=4*((this.UW=i+6)+1),n=this.YW=[],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.XW=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.jW(t,e,this.YW,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.jW(t,e,this.XW,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},jW:function(t,e,i,s,r,n,o,h){for(var a=this.UW,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++],m=s[u>>>24]^r[c>>>16&255]^n[d>>>8&255]^o[255&l]^i[f++],y=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=p,u=m,c=y,d=x}p=(h[l>>>24]<<24|h[u>>>16&255]<<16|h[c>>>8&255]<<8|h[255&d])^i[f++],m=(h[u>>>24]<<24|h[c>>>16&255]<<16|h[d>>>8&255]<<8|h[255&l])^i[f++],y=(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]=p,t[e+1]=m,t[e+2]=y,t[e+3]=x},keySize:8});e.AES=i.wW(p)}(),t.AES}(yp.exports),Dp={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.zW,s=i.blockSize,r=this.VW,n=this.ZW;r&&(n=this.ZW=r.slice(0),this.VW=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}(yp.exports),Tp={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(yp.exports);const Ip={"-4":["MDQxMmQ1MWU5MjFhYTMzODUwMWE4ZGYzN2ViZTE4NTU3ZDViYmRlZDg1Yzk0OGI3YTJkMDBmZTNhZGVlMjdjY2VmNzBiMWVlOWI3MDZjMTIwYTAzZDZlZTNkNmYyOTc5Y2E2NGEzN2Y3YjY4N2E1ZjljZWY2ODYxN2I1NWU5ZmJjMA=="],"-3":["MjAxODAxMjA="],"-2":["aHR0cHM6Ly9qc2xpY2Vuc2luZy5saWdodG5pbmdjaGFydC5jb20vc2Vzc2lvbg=="],"-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=="]},Cp=mt,Pp=(...t)=>t.slice(1).reduce(((e,i)=>e+Cp.atob(Ip[t[0]][i].toString())),"");let Op,Fp,Rp=!1,Bp=new Uint8Array([34]);class zp{set e(t){Op=t}get e(){Fp={Bh:!1,Oh:!1,Lh:!1,Rh:!1,Eh:!1,zh:!1};const t=Bp.length>=1?Bp[0]:void 0;return void 0!==t&&(Fp.Bh=!!(1&t),Fp.Oh=!!(2&t),Fp.Lh=!!(4&t),Fp.Rh=!!(8&t),Fp.Eh=!!(16&t),Fp.zh=!!(32&t)),Fp.zh}}let _p=!1;const Lp=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Gp=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")}`},Vp=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Np=t=>{const e={},i=t.split("-");if(3!==i.length)throw new Error(Pp(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 Up(d,f)?e:null},Wp=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(Lp(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(-1^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(Vp(h)s[e]===t)))return;break}case"0002":if(!Np(t))throw new Error(Pp(0,0,1,7,1,12,5));return;default:throw new Error(Pp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}throw new Error(Pp(0,0,1,2,1,7,1,12,5))},Hp=t=>{if(!t)throw new Error(Pp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5));const e=(t[Pp(-1,9)]||t[Pp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Cp[Pp(-1,6)][Pp(-1,7)])>-1)return!0;const i=e.filter((t=>t.indexOf("*")>-1));if(Zp(Cp[Pp(-1,6)][Pp(-1,7)],i))return!0;const s=t[Pp(-1,8)]||t[Pp(-1,38)];if(""!==s&&null!=s){if(Zp(Cp[Pp(-1,6)][Pp(-1,7)],[s]))return!1;if(s===Cp[Pp(-1,6)][Pp(-1,7)])return!1}throw new Error(Pp(0,14,1,20,5))},Up=(t,e)=>{const i=new pp("secp256k1").keyFromPublic(Pp(-4,0),"hex"),s=Mp(t).toString();return i.verify(s,e)},Xp=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(!Up(r,n))throw new Error(Pp(0,21,1,2,1,7,1,12,5));const o=Ap.parse(r);i=wp.decrypt({ciphertext:Ap.parse(s)},o,{mode:Dp,padding:Tp,iv:Ap.parse("00000000000000000000000000000001")}).toString(kp)}catch(t){throw new Error(Pp(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(Pp(0,21,1,2,1,7,1,12,5))}if(void 0===e[Pp(-1,5)]||null===e[Pp(-1,4)]||!e[Pp(-1,9)])throw new Error(Pp(0,21,1,2,1,7,1,12,5));const s=parseInt(Pp(-3,0),10)||Number(parseInt(Pp(-3,0),10));if(e[Pp(-1,5)]{const e=Np(t);if(!e)throw new Error(Pp(0,0,1,7,1,12,5));let i,s="";try{const t=e.KW.slice(e.qW,e.qW+16),i=new DataView(t.buffer),r=new Int32Array(4);for(let t=0;t{switch(t.slice(0,4)){case"0001":((t,e)=>{if(!e)throw new Error(Pp(0,39,1,40,1,41,5));const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!Up(`${s}-${r}`,n))throw new Error(Pp(0,21,1,2,1,7,1,12,5));const o=Uint8Array.from(Lp(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Pp(-3,0),10)||Number(parseInt(Pp(-3,0),10))))throw new Error(Pp(0,21,1,2,1,3,1,4,5));const a=Int32Array.from(Lp(s,8)),l=bp(e[Pp(-1,31)]).toString(Ap),u=Int32Array.from(Lp(l,8)),c=bp(e[Pp(-1,32)]).toString(Ap),d=Int32Array.from(Lp(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t)))throw new Error(Pp(0,21,1,2,1,7,1,12,5))})(t,e);break;case"0002":((t,e)=>{if(!e)throw new Error(Pp(0,39,1,40,1,41,5));const i=Np(t);if(!i)throw new Error(Pp(0,0,1,7,1,12,5));const s=i.KW.slice(i.qW,i.KW.length),r=new DataView(s.buffer),n=new Int32Array(8);for(let t=0;tu[e]===t)))throw new Error(Pp(0,21,1,2,1,7,1,12,5))})(t,e);break;default:throw new Error(Pp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}},Yp=(t,e,i=!0)=>{let s;_p=!1,e instanceof fs?(s=e.Be,e.G()):"container"in e&&(s="string"==typeof e.container?mt.document.getElementById(e.container):e.container);const r=!!s&&(s===mt.document.body||mt.document.body.contains(s)),n=s&&r?s:document.body,o=mt.document.createElement("div");o.id="lcjs-error",n.append(o),o.style.width="100%",o.style.height="100%",o.style.backgroundColor="black",o.style.boxSizing="border-box",o.style.padding="20px",o.style.font="Arial",o.style.fontSize="20px";let h=(t||"LICENSE_ERROR").toLowerCase().split("_").join(" ");h=(i?Pp(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1);const a=mt.document.createElement("p1");o.append(a),a.innerHTML=h,a.style.color="red"},$p=(t,e,i)=>{e?(t[Pp(-1,17)](Pp(-1,19),i),t[Pp(-1,17)](Pp(-1,20),i),t[Pp(-1,17)](Pp(-1,21),i),t[Pp(-1,17)](Pp(-1,22),i)):(t[Pp(-1,18)](Pp(-1,19),i),t[Pp(-1,18)](Pp(-1,20),i),t[Pp(-1,18)](Pp(-1,21),i),t[Pp(-1,18)](Pp(-1,22),i))},Zp=(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)}))},qp=t=>{const i=()=>{};let s,r,n;if(new mt.Image instanceof mt.HTMLImageElement){const t=new mt.Image;t.src=vd,r=new hd({source:t,fitMode:e.ImageFitMode.Stretch});const i=new mt.Image;i.src=Sd,n=new hd({source:i,fitMode:e.ImageFitMode.Stretch})}else if(mt.lcjs_setup){const t=new mt.Image;t.src=vd;const i=mt.lcjs_setup(t.naturalWidth,t.naturalHeight);i.getContext("2d").drawImage(t,0,0),r=new hd({source:i,fitMode:e.ImageFitMode.Stretch}),n=r}else r=new L({color:k("#f00")}),n=r;const o=e=>{const i=e.ut.wi();if(e.rd&&(e.JW&&(n?e.rd.As(n):mt.requestAnimationFrame((()=>o(e)))),e.JW||(r?e.rd.As(r):mt.requestAnimationFrame((()=>o(e))))),e.rd){const t=(e.JW,150),s=(e.JW,32),r=e.ut.x.getInnerEnd()-(3+t)*i.x,n=e.ut.y.getInnerStart()+3*i.y;e.rd.Cn({x:r,y:n}).q({x:t*i.x,y:s*i.y})}!1===e.JW&&"W"!==vd[3361]&&Yp(Pp(0,36,1,38,5),t,!1),!0===e.JW&&"2"!==Sd[571]&&Yp(Pp(0,36,1,38,5),t,!1),s&&s.Gi()};return s=t.jT("logo",Number.MAX_SAFE_INTEGER),n=>{const h={ut:n,JW:!1};let a,l;return h.QW=()=>{a=mt.setTimeout((()=>{l=t.Oe(e.MouseStyles.Point),void 0!==h.rd&&(h.rd.setMouseClickEventHandler(Kp),h.rd.setTouchEndEventHandler(Kp)),h.JW=!0,o(h)}),3e3)},h.tH=()=>{mt.clearTimeout(a),t.Le(l),void 0!==h.rd&&(h.rd.setMouseClickEventHandler(i),h.rd.setTouchEndEventHandler(i)),h.JW=!1,o(h)},(t=>{t.rd&&t.rd.dispose(),s&&(t.rd=s._u(t.ut).As(r).setMouseInteractions(!0).setMouseClickEventHandler(i).setTouchEndEventHandler(i).ir(J),t.QW&&t.rd.setMouseEnterEventHandler(t.QW),t.tH&&t.rd.setMouseLeaveEventHandler(t.tH),o(t))})(h),{Zs:()=>o(h),G:()=>(t=>{t.rd&&(t.rd.dispose(),t.rd=void 0,t.QW=()=>{},t.tH=()=>{})})(h)}}},Kp=()=>mt.open("https://lightningchart.com/lightningchart-js/"),Jp=s.Record({color:A(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class Qp extends Jp{constructor(t){super(t),this.type="glow"}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")}}const tm=s.Record({gridStrokeLength:1,gridStrokeStyle:new tt,tickLength:7,tickStyle:new tt,tickPadding:0,labelFont:new $i,labelFillStyle:new L,labelPadding:0,labelAlignment:0,labelRotation:0});class em extends tm{}class im extends em{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 sm=Object.assign(Object.create(new class extends em{}),{}),rm=(t,e,i,s,r)=>n=>o=>{const h=new Date(o+n),a={year:h.getFullYear(),monthIndex:h.getMonth(),day:h.getDate(),hours:h.getHours(),minutes:h.getMinutes(),seconds:h.getSeconds(),millis:h.getMilliseconds()},l=s?s(a):void 0;if(0===t&&!0===l)return o;const u=a[e];r.includes("year")&&(a.year=Math.floor(a.year/i)*i),r.includes("monthIndex")&&(a.monthIndex=0),r.includes("day")&&(a.day=1),r.includes("hours")&&(a.hours=0),r.includes("minutes")&&(a.minutes=0),r.includes("seconds")&&(a.seconds=0),r.includes("millis")&&(a.millis=0);let c=(0===t?1:t)*i;return-1===t&&!1===l&&(c=0),0!==c&&(a[e]=i*(c>0?Math.floor((u+c)/i):Math.ceil((u+c)/i))),new Date(a.year,a.monthIndex,a.day,a.hours,a.minutes,a.seconds,a.millis).getTime()-n},nm=(t,e,i,...s)=>rm(-1,t,e,i,s),om=(t,e,i,...s)=>rm(-1,t,e,i,s),hm=(t,e,i,...s)=>rm(0,t,e,i,s),am=(t,e,...i)=>rm(1,t,e,void 0,i),lm=t=>e=>i=>{const s=new Date(i+e),r=s.getDay(),n=1===r&&0===s.getHours()&&0===s.getMinutes()&&0===s.getSeconds()&&0===s.getMilliseconds();if(0===t&&!0===n)return i;let o=s.getDate();return-1===t&&1===r&&!1===n||(-1===t?o-=r>=2?r-1:r+6:o+=r>0?8-r:1),new Date(s.getFullYear(),s.getMonth(),o,0,0,0,0).getTime()-e},um=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Gi({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Gi(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:nm("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Vi(5,10,15,30)},minorTicks:{amount:4,fitFunction:Gi(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:nm("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Vi(5,10,15,30)},minorTicks:{amount:12,fitFunction:Gi(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:nm("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Vi(3,6,12)},minorTicks:{amount:8,fitFunction:Gi(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:nm("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Gi({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Gi({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:lm(-1),getNextKeyValueIncludingRef:lm(0),getNextKeyValue:lm(1),greatTicks:!0,majorTicks:{fitFunction:Gi(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:om("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:hm("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:am("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Gi(void 0,2,3)},minorTicks:{fitFunction:Gi(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:om("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:hm("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:am("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Gi({ignore:"first"},2,5)},minorTicks:{fitFunction:Gi(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:om("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:hm("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:am("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Gi(void 0,2,4)},minorTicks:{fitFunction:Gi(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:om("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:hm("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:am("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:om("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:hm("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:am("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],cm=(t,e,i)=>{let s=((t,e,i,s,r)=>{const n=e-t;let o;for(let t=0;t(i,s,r,n)=>{const o=cm("great",i,s);if(void 0===o)return[];if("Decade"===o.label||"Century"===o.label||"Millennium"===o.label)return[];const h=n>r?i:s,a=(i+s)/2,l=n>r?s:i;if(um.indexOf(o)<=um.findIndex((t=>"Hour"===t.label)))return"left"===e?[h]:[];let u;if(!0===o.irregular)u=Li(i,s,o.getPrevKeyValue(t),o.getNextKeyValue(t));else{const e=o.greatTicks.getReferenceKeyValue(t)(i);u=_i(i,s,o.unit,e,1)}const c=((t,e,i)=>{for(const s of i)if(s>=t&&s<=e)return s})(i,s,u);return"left"===e?void 0===c||Re(c,a,l)?[h]:[c]:void 0!==c&&Re(c,a,l)?[c]:[l]},fm=(t,e)=>(i,s,r,n)=>{const o=cm(t,r,n);let h;if(void 0===o)return[];if("great"===t&&void 0!==o.greatTicks)if(!0===o.irregular)h=Li(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e));else{const t=o.greatTicks.getReferenceKeyValue(e)(i);h=_i(i,s,o.unit,t,1)}else if("major"===t&&void 0!==o.majorTicks)h=!0===o.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})(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e)):((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})(i,s,o.unit);else{if("minor"!==t||void 0===o.minorTicks)return[];if(!0===o.irregular)h=((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})(i,s,o.getNextKeyValueIncludingRef(e),o.getNextKeyValue(e));else{const t=(t=>{if(void 0!==t)return um[um.indexOf(t)+1]})(o);if(void 0===t)return[];h=zi(i,s,t.unit/o.minorTicks.amount,1)}}return h},gm=t=>(e,i,s,r,n,o)=>{const h=cm(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},pm=s.Record({locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new im,majorTickStyle:new im,minorTickStyle:new im,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 mm extends pm{Bs(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>um.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]},`;mt.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=cm(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){let t;t=!1===kt(n,"left"===i?a:l)?n:!1===c.irregular?"left"===i&&!1===u||"right"===i&&!0===u?c.greatTicks.getReferenceKeyValue(e)(n):c.greatTicks.getReferenceKeyValue(e)(n+1*c.unit):"left"===i&&!1===u||"right"===i&&!0===u?c.getPrevKeyValue(e)(n):c.getNextKeyValue(e)(n),h=t+e}const d=s.get(t);if(void 0===d)return r(h);const f=d[um.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{Pi:"Great ticks (directive)",kg:0,Ti:!0,_e:fm("great",e),Ae:void 0},{Pi:"Major ticks",kg:1,qs:this.majorTickStyle,js:n("major"),_e:fm("major",e),os:{ie:gm("major")},Ae:void 0}];this.greatTickStyle!==sm&&(o.push({Pi:"Great ticks (left)",qs:this.greatTickStyle.setLabelAlignment(-1),js:n("great","left"),_e:dm(e,"left"),Ci:!0,he:!1}),o.push({Pi:"Great ticks (right)",qs:this.greatTickStyle.setLabelAlignment(1),js:n("great","right"),_e:dm(e,"right"),Ci:!0,he:!1})),this.minorTickStyle!==sm&&h.push({Pi:"Minor ticks",kg:2,qs:this.minorTickStyle,js:n("minor"),_e:fm("minor",e),os:{ie:gm("minor"),ls:(t,e,i,s,r,n)=>{const o=cm("minor",r,n);return!o||"Week"!==o.label}},Ae:void 0});const a=this.cursorFormatter;return{Di:o,Bi:h,Ii: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)} `},Rs:1e3,Es:31536e9}}setCursorFormatter(t){return this.set("cursorFormatter",t)}getCursorFormatter(){return this.get("cursorFormatter")}setGreatTickStyle(t){if("function"==typeof t){const e=this.get("greatTickStyle");return e!==sm?this.set("greatTickStyle",t(e)):this}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 e!==sm?this.set("minorTickStyle",t(e)):this}return this.set("minorTickStyle",t)}getMinorTickStyle(){return this.get("minorTickStyle")}setLocale(t){return this.set("locale",t)}getLocale(){return this.get("locale")}setDateOrigin(t){return this.set("dateOrigin",t)}getDateOrigin(){return this.get("dateOrigin")}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 ym=(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 _i(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,zi(i,s,o,h)},xm=(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,Sm=Gi(void 0,2,5),vm=(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,bm=(t,e)=>{const i=yi(t),s=xi(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&&si(e+t,s,r),_e:Bi,Ci:!0,he:!0}),o.push({Pi:"Major ticks",kg:0,qs:this.majorTickStyle,js:void 0===e?s:(t,i,r)=>s(e+t,i,r),_e:"logarithmic"===t.type?bm(t.base,!0):ym(0,!0),os:"logarithmic"===t.type?void 0:{ie:xm},Ae:void 0}),this.minorTickStyle!==sm&&o.push({Pi:"Minor ticks",kg:1,qs:this.minorTickStyle,js:void 0===e?r:(t,i,s)=>r(e+t,i,s),_e:"logarithmic"===t.type?bm(t.base,!1):ym(1,!1),os:"logarithmic"===t.type?{ie:vm}:{ie:Sm},Ae:50});const h=this.cursorFormatter?this.cursorFormatter:Ai.Numeric;return{Di:n,Bi:o,Ii:void 0===e?h:(t,i,s)=>h(e+t,i,s),Rs:1e-9,Es: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 e!==sm?this.set("extremeTickStyle",t(e)):this}return this.set("extremeTickStyle",t)}getExtremeTickStyle(){return this.get("extremeTickStyle")}setFormattingOffset(t){return this.set("formattingOffset",t)}getFormattingOffset(){return this.get("formattingOffset")}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return e!==sm?this.set("minorTickStyle",t(e)):this}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 km=s.Record({cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new im,minorTickStyle:new im}),wm=(t,e)=>{const i=e-t;return i>=864e5?"MajorHours12":i>=36e5?"MajorHours":i>=6e5?"MajorMinutes15":i>=6e4?"MajorMinutes":i>=1e4?"MajorSeconds15":i>=1e3?"MajorSeconds":i>=100?"MajorMilliseconds100":i>=10?"MajorMilliseconds10":i>=1?"MajorMilliseconds":i>=.1?"MajorMicroseconds100":i>=.01?"MajorMicroseconds10":i>=.001?"MajorMicroseconds":i<=.001?"MajorNanoseconds100":"Unknown"},Dm={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}${ce(s,2)}:${ce(r,2)}:${ce(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}${ce(s,2)}:${ce(r,2)}:${ce(n,2)}.${ce(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}${ce(s,2)}:${ce(r,2)}:${ce(n,2)}.${ce(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}${ce(s,2)}:${ce(r,2)}:${ce(n,2)}.${ce(o,3)}${h}`}},Em={MajorHours12:{major:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,_i(t,e,r,void 0,1e6)},fitKeyValues:Gi({ignore:"first"},2,4)},minor:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,36e5,1e6),fitKeyValues:Gi({},2,3,4,6)},defaultValueFormatter:Dm.hhmmss},MajorHours:{major:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,_i(t,e,r,void 0,1e6)},fitKeyValues:Gi({ignore:"first"},2,6,12)},minor:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,3e5,1e6),fitKeyValues:Gi({},2,4,6)},defaultValueFormatter:Dm.hhmmss},MajorMinutes15:{major:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),_i(t,e,9e5,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2)},minor:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,6e4,1e6),fitKeyValues:Gi({},3,5)},defaultValueFormatter:Dm.hhmmss},MajorMinutes:{major:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,_i(t,e,6e4,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,5e3,1e6),fitKeyValues:Gi({},2,3,4,6)},defaultValueFormatter:Dm.hhmmss},MajorSeconds15:{major:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,_i(t,e,15e3,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,4)},minor:{format:Dm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,1e3,1e6),fitKeyValues:Gi({},3,5)},defaultValueFormatter:Dm.hhmmss},MajorSeconds:{major:{format:Dm.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,_i(t,e,1e3,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmm,getKeyValues:(t,e,i,s)=>zi(t,e,100,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.hhmmssmmm},MajorMilliseconds100:{major:{format:Dm.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,_i(t,e,100,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmm,getKeyValues:(t,e,i,s)=>zi(t,e,10,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.hhmmssmmm},MajorMilliseconds10:{major:{format:Dm.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,_i(t,e,10,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmm,getKeyValues:(t,e,i,s)=>zi(t,e,1,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.hhmmssmmm},MajorMilliseconds:{major:{format:Dm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,_i(t,e,1,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>zi(t,e,.1,1e6),fitKeyValues:Gi({},2)},defaultValueFormatter:Dm.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Dm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,_i(t,e,.1,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>zi(t,e,.01,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Dm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,_i(t,e,.01,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>zi(t,e,.001,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Dm.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,_i(t,e,.001,void 0,1e6)),fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>zi(t,e,100*1e-6,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Dm.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,_i(t,e,r,void 0,1e6)},fitKeyValues:Gi({ignore:"first"},2,5)},minor:{format:Dm.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>zi(t,e,10*1e-6,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:Dm.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 Tm extends km{Bs(t){const e=this.timeOrigin||0,i=[{Pi:"Major ticks",kg:0,qs:this.majorTickStyle,js:(t,i,s)=>{const r=wm(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Em[r].major.format)(t+e,i,s)},_e:(t,e,i,s)=>{const r=wm(i,s);return(0,Em[r].major.getKeyValues)(t,e,i,s)},os:{ie:(t,e,i,s,r,n)=>{const o=wm(r,n),h=Em[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Ae:void 0}];return this.minorTickStyle instanceof im&&i.push({Pi:"Minor ticks",kg:1,qs:this.minorTickStyle,js:(t,i,s)=>{const r=wm(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Em[r].minor.format)(t+e,i,s)},_e:(t,e,i,s)=>{const r=wm(i,s);return(0,Em[r].minor.getKeyValues)(t,e,i,s)},os:{ie:(t,e,i,s,r,n)=>{const o=wm(r,n),h=Em[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Ae:void 0}),{Di:[],Bi:i,Ii:this.cursorFormatter||((t,i,s)=>{const r=wm(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Em[r].defaultValueFormatter(t+e,i,s)}),Rs:1e-4,Es:864e6}}setMajorTickStyle(t){return"function"==typeof t?this.set("majorTickStyle",t(this.get("majorTickStyle"))):this.set("majorTickStyle",t)}getMajorTickStyle(){return this.get("majorTickStyle")}setMinorTickStyle(t){if("function"==typeof t){const e=this.get("minorTickStyle");return e!==sm?this.set("minorTickStyle",t(e)):this}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")}}const Im={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"}},Cm={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"}},Pm={"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"}},Om={"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"}},Fm={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"}},Rm={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"}},Bm={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"}},zm={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"}},_m={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"}},Lm={World:Rm,USA:Bm,NorthAmerica:zm,SouthAmerica:_m,Canada:Om,Europe:Fm,Asia:Cm,Africa:Im,Australia:Pm},Gm={Solid:pl},Vm={warm:t=>e=>w(60/(t-1)*e,.8,.8),cold:t=>e=>w(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>w(360/t*e,.8,.8),reverseSpectrum:t=>e=>w(360/t*(t-e),.8,.8),flatUI:t=>e=>w(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return w(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return w(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return w(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return w(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return w(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>w(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return w(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return w(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),w(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return w(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=>w(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Nm([{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=>Nm([{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=>Nm([{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=>Nm([{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=>Nm([{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=>Nm([{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)},Nm=(t,e,i)=>{const s=Hm(e,i),[r,n]=Um(s,t),o=Wm(t[r]),h=Wm(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:fa(o.h,h.h,a),s:fa(o.s,h.s,a),v:fa(o.v,h.v,a)};return w(l.h,l.s,l.v)},Wm=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},Um=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i{const i=(t=>{const e=new L({color:t.uiStrokeColorContrastHigh}),i=new L({color:t.uiStrokeColorContrastMedium}),s=new L({color:t.uiStrokeColorContrastLow}),r=new $i({family:t.fontFamily,weight:"normal",style:"normal"}),n=r.setSize(18*t.fontScaler),o=r.setSize(16*t.fontScaler),h=r.setSize(14*t.fontScaler),a=r.setSize(10*t.fontScaler),l=r.withMutations((e=>e.set("size",14*t.fontScaler).set("weight","bold"))),u=r.setSize(13*t.fontScaler),c=new tt({thickness:2,fillStyle:s}),d=new L({color:t.dataHighlightOverlayColor}),f=new tt({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),g=t.dataColorPalette.map((t=>new L({color:t.stroke}))),p=t=>g[t%g.length],m=g.map((t=>new tt({thickness:2,fillStyle:t}))),y=t=>m[t%m.length],x=t.dataColorPalette.map((t=>new L({color:t.border}))).map((t=>new tt({thickness:2,fillStyle:t}))),S=t=>x[t%x.length],v=t.dataColorPalette.map((t=>{const e=t.area;return new q({angle:180,stops:[{color:ne(e,A(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ne(e,A(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 q({angle:180,stops:[{color:ne(e,A(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:ne(e,A(0,0,0,e.getA()),.3),offset:1}]})})),k=t=>M[t%M.length],w=t.dataColorPaletteInverted.map((t=>new L({color:t.border}))).map((t=>new tt({thickness:2,fillStyle:t}))),D=t=>w[t%w.length],E=new L({color:t.dataColorPositive}),T=new L({color:t.dataColorNegative}),I=new tt({thickness:1,fillStyle:new L({color:t.dataStrokeColorContrastHigh.setA(50)})}),C=new tt({thickness:2,fillStyle:t.axisLineFillStyle}),P=J,O=new L({color:A(0,0,0,1)}),F=new tt({thickness:1,fillStyle:t.axisGridMajorFillStyle}),R=new tt({thickness:1,fillStyle:t.axisTickMajorFillStyle}),z=h,_=t.axisLabelMajorFillStyle,G=new tt({thickness:1,fillStyle:t.axisGridMajorFillStyle}),V=new tt({thickness:1,fillStyle:t.axisTickMajorFillStyle}),N=h,W=t.axisLabelMajorFillStyle,H=new tt({thickness:1,fillStyle:t.axisGridMinorFillStyle}),U=new tt({thickness:1,fillStyle:t.axisTickMinorFillStyle}),X=a,j=t.axisLabelMinorFillStyle,Y=sm,$=new im({gridStrokeStyle:F,tickStyle:R,tickLength:50,tickPadding:-14,labelFont:z,labelPadding:0,labelFillStyle:_}),Z=new im({gridStrokeStyle:G,tickStyle:V,tickLength:7,tickPadding:0,labelFont:N,labelPadding:0,labelFillStyle:W}),K=new im({gridStrokeStyle:H,tickStyle:U,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:j}),Q=new Am({extremeTickStyle:Y,majorTickStyle:Z,minorTickStyle:K}),et=new mm({greatTickStyle:$,majorTickStyle:Z,minorTickStyle:K}),it=new Tm({majorTickStyle:Z,minorTickStyle:K}),st=new L({color:t.dataHighlightOverlayColor}),rt=new tt({thickness:1,fillStyle:i}),nt=new tt({thickness:2,fillStyle:i}),ot=t=>new es.Triangulated({shape:"sphere",size:10,fillStyle:g[t%g.length]}),ht=g[0],at=t.uiTextFillStyle,lt=t.legendBackgroundFillStyle,ut=new tt({thickness:1,fillStyle:t.legendBackgroundBorderFillStyle}),ct=he(t.legendButtonDefaultColor),dt=new tt({thickness:1,fillStyle:e}),ft=new tt({thickness:1,fillStyle:t.cursorGridFillStyle});let gt={isDark:t.isDark,effect:t.effect,effectsText:t.effectsText,effectsDashboardSplitters:t.effectsDashboardSplitters,lcjsBackgroundFillStyle:t.lcjsBackgroundFillStyle,lcjsBackgroundStrokeStyle:J,highlightColorOffset:t.highlightColorOffset,highlightColorOffsetAxisOverlay:t.highlightColorOffsetAxisOverlay,dashboardSplitterStyle:new tt({thickness:4,fillStyle:t.dashboardSplitterFillStyle}),chartXYBackgroundFillStyle:t.panelBackgroundFillStyle,chartXYBackgroundStrokeStyle:J,chartXYTitleFont:n,chartXYTitleFillStyle:t.titleFillStyle,chartXYSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chartXYSeriesBackgroundStrokeStyle:c,chartXYZoomingRectangleFillStyle:d,chartXYZoomingRectangleStrokeStyle:f,chartXYFittingRectangleFillStyle:d,chartXYFittingRectangleStrokeStyle:f,lineSeriesStrokeStyle:y,pointLineSeriesStrokeStyle:y,pointLineSeriesFillStyle:p,pointSeriesFillStyle:p,ellipseSeriesFillStyle:p,ellipseSeriesStrokeStyle:y,polygonSeriesFillStyle:p,polygonSeriesStrokeStyle:y,rectangleSeriesFillStyle:p,rectangleSeriesStrokeStyle:J,segmentSeriesStrokeStyle:y,boxSeriesBodyFillStyle:p(0),boxSeriesBodyStrokeStyle:J,boxSeriesStrokeStyle:new tt({thickness:1,fillStyle:g[0]}),boxSeriesMedianStrokeStyle:new tt({thickness:1,fillStyle:new L({color:A(0,0,0)})}),ohlcCandleBodyFillStylePositive:E,ohlcCandleBodyFillStyleNegative:T,ohlcCandleBodyStrokeStylePositive:J,ohlcCandleBodyStrokeStyleNegative:J,ohlcCandleStrokeStyle:new tt({thickness:1,fillStyle:new L({color:t.uiStrokeColorContrastHigh})}),ohlcBarStrokeStylePositive:new tt({thickness:2,fillStyle:E}),ohlcBarStrokeStyleNegative:new tt({thickness:2,fillStyle:T}),heatmapGridSeriesFillStyle:p,heatmapGridSeriesWireframeStyle:I,heatmapScrollingGridSeriesFillStyle:p,heatmapScrollingGridSeriesWireframeStyle:I,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:k,areaRangeSeriesStrokeStyleInverted:D,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:k,areaSeriesBipolarLowStrokeStyle:D,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:k,areaSeriesNegativeStrokeStyle:D,xAxisTitleFont:o,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:C,xAxisNibStyle:P,xAxisOverlayStyle:O,xAxisZoomingBandFillStyle:d,xAxisZoomingBandStrokeStyle:J,xAxisNumericTicks:Q,xAxisDateTimeTicks:et,xAxisTimeTicks:it,yAxisTitleFont:o,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:C,yAxisNibStyle:P,yAxisOverlayStyle:O,yAxisZoomingBandFillStyle:d,yAxisZoomingBandStrokeStyle:J,yAxisNumericTicks:Q,yAxisDateTimeTicks:et,yAxisTimeTicks:it,bandFillStyle:st,bandStrokeStyle:rt,constantLineStrokeStyle:nt,chart3DBackgroundFillStyle:t.panelBackgroundFillStyle,chart3DBackgroundStrokeStyle:J,chart3DTitleFont:n,chart3DTitleFillStyle:t.titleFillStyle,chart3DSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,chart3DSeriesBackgroundStrokeStyle:c,chart3DBoundingBoxStrokeStyle:J,xAxis3DTitleFont:o,xAxis3DTitleFillStyle:t.axisTitleFillStyle,xAxis3DStrokeStyle:C,xAxis3DNumericTicks:Q,xAxis3DDateTimeTicks:et,xAxis3DTimeTicks:it,yAxis3DTitleFont:o,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:C,yAxis3DNumericTicks:Q,yAxis3DDateTimeTicks:et,yAxis3DTimeTicks:it,zAxis3DTitleFont:o,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:C,zAxis3DNumericTicks:Q,zAxis3DDateTimeTicks:et,zAxis3DTimeTicks:it,lineSeries3DStrokeStyle:y,pointLineSeries3DStrokeStyle:y,pointLineSeries3DPointStyle:ot,pointSeries3DPointStyle:ot,pointCloudSeries3DPointStyle:t=>new es.Pixelated({size:5,fillStyle:g[t%g.length]}),surfaceGridSeries3DFillStyle:p,surfaceGridSeries3DWireframeStyle:I,surfaceScrollingGridSeries3DFillStyle:p,surfaceScrollingGridSeries3DWireframeStyle:I,boxSeries3DFillStyle:p,polarChartBackgroundFillStyle:t.panelBackgroundFillStyle,polarChartBackgroundStrokeStyle:J,polarChartTitleFont:n,polarChartTitleFillStyle:t.titleFillStyle,polarChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,polarChartSeriesBackgroundStrokeStyle:c,polarSectorFillStyle:st,polarSectorStrokeStyle:rt,polarAmplitudeAxisTitleFont:o,polarAmplitudeAxisTitleFillStyle:t.axisTitleFillStyle,polarAmplitudeAxisStrokeStyle:C,polarAmplitudeAxisNumericTicks:Q,polarAmplitudeAxisDateTimeTicks:et,polarAmplitudeAxisTimeTicks:it,polarRadialAxisTitleFont:o,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:C,polarRadialAxisTickStyle:Z,polarLineSeriesStrokeStyle:y,polarPointLineSeriesFillStyle:p,polarPointLineSeriesStrokeStyle:y,polarPointSeriesFillStyle:p,polarPolygonSeriesFillStyle:b,polarPolygonSeriesStrokeStyle:S,polarAreaSeriesFillStyle:b,polarAreaSeriesStrokeStyle:S,mapChartBackgroundFillStyle:t.panelBackgroundFillStyle,mapChartBackgroundStrokeStyle:J,mapChartTitleFont:n,mapChartTitleFillStyle:t.titleFillStyle,mapChartFillStyle:ht,mapChartStrokeStyle:new tt({thickness:1,fillStyle:new L({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:B,mapChartOutlierRegionStrokeStyle:new tt({thickness:1,fillStyle:s}),mapChartSeparateRegionFillStyle:lt,mapChartSeparateRegionStrokeStyle:ut,dataGridBackgroundFillStyle:t.panelBackgroundFillStyle,dataGridBackgroundStrokeStyle:J,dataGridTitleFont:n,dataGridTitleFillStyle:t.titleFillStyle,dataGridTextFont:h,dataGridTextFillStyle:ht,dataGridCellBackgroundFillStyle:new L({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new tt({thickness:.4,fillStyle:new L({color:t.uiBackgroundBorderColor})}),dataGridScrollBarBackgroundFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarBackgroundStrokeStyle:J,dataGridScrollBarFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarStrokeStyle:ut,dataGridScrollBarButtonFillStyle:t.seriesBackgroundFillStyle,dataGridScrollBarButtonStrokeStyle:ut,dataGridScrollBarButtonArrowFillStyle:ct,dataGridScrollBarButtonArrowStrokeStyle:ut,sparkLineChartStrokeStyle:y(0),sparkPointChartFillStyle:p(0),sparkBarChartFillStyle:p(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:p,sparkPieChartStrokeStyle:ut,sparkChartBandFillStyle:st,sparkChartBandStrokeStyle:rt,sparkChartConstantLineStrokeStyle:nt,spiderChartBackgroundFillStyle:t.panelBackgroundFillStyle,spiderChartBackgroundStrokeStyle:J,spiderChartTitleFont:n,spiderChartTitleFillStyle:t.titleFillStyle,spiderChartSeriesBackgroundFillStyle:t.seriesBackgroundFillStyle,spiderChartSeriesBackgroundStrokeStyle:c,spiderChartWebStyle:new tt({thickness:2,fillStyle:s}),spiderChartScaleLabelFillStyle:t.axisLabelMajorFillStyle,spiderChartScaleLabelFont:h,spiderChartAxisLabelFillStyle:t.axisTitleFillStyle,spiderChartAxisLabelFont:o,spiderChartAxisStrokeStyle:new tt({thickness:2,fillStyle:i}),spiderChartAxisNibStrokeStyle:new tt({thickness:2,fillStyle:e}),spiderSeriesFillStyle:b,spiderSeriesStrokeStyle:S,spiderSeriesPointFillStyle:p,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:J,pieChartTitleFont:n,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:p,pieChartSliceStrokeStyle:ut,pieChartSliceLabelFont:u,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:dt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:J,funnelChartTitleFont:n,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:p,funnelChartSliceStrokeStyle:ut,funnelChartSliceLabelFont:u,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:dt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:J,pyramidChartTitleFont:n,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:p,pyramidChartSliceStrokeStyle:ut,pyramidChartSliceLabelFont:u,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:dt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:J,gaugeChartTitleFont:n,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new L({color:t.uiBackgroundColor}),gaugeChartEmptyGaugeStrokeStyle:ut,gaugeChartGaugeFillStyle:ht,gaugeChartIntervalLabelsFillStyle:at,gaugeChartIntervalLabelsFont:u,gaugeChartValueLabelFillStyle:at,gaugeChartValueLabelFont:u,uiPanelBackgroundFillStyle:t.panelBackgroundFillStyle,uiPanelBackgroundStrokeStyle:J,onScreenMenuBackgroundColor:A(254,204,0,.7),uiButtonFillStyle:ct,uiButtonStrokeStyle:ut,uiButtonSize:10,uiBackgroundFillStyle:lt,uiBackgroundStrokeStyle:ut,uiTextFillStyle:at,uiTextFont:u,legendTitleFillStyle:at,legendTitleFont:l,cursorTickMarkerXBackgroundFillStyle:lt,cursorTickMarkerXBackgroundStrokeStyle:ut,cursorTickMarkerXTextFillStyle:at,cursorTickMarkerXTextFont:u,cursorTickMarkerYBackgroundFillStyle:lt,cursorTickMarkerYBackgroundStrokeStyle:ut,cursorTickMarkerYTextFillStyle:at,cursorTickMarkerYTextFont:u,cursorPointMarkerFillStyle:B,cursorPointMarkerStrokeStyle:J,cursorResultTableFillStyle:lt,cursorResultTableStrokeStyle:ut,cursorResultTableTextFillStyle:at,cursorResultTableTextFont:u,cursorGridStrokeStyleX:ft,cursorGridStrokeStyleY:ft,chartMarkerPointMarkerFillStyle:t.legendBackgroundBorderFillStyle,chartMarkerPointMarkerStrokeStyle:J};return t.overrideThemeProperties&&(gt={...gt,...t.overrideThemeProperties}),gt})(t),s={...e,header1Font:i.xAxisTitleFont,header2Font:i.xAxisNumericTicks.getMajorTickStyle().labelFont,header3Font:i.uiTextFont,mainDataColor:t.dataColorPalette[0].stroke};return{...i,examples:s}},jm=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/themes/${e}`;return i.addEventListener("error",(e=>{Me(t,s,"Theme with asset",{shouldCrash:!1})})),i.src=s,i},Ym=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,A(255,255,255),.5);return new $({stops:[{color:ne(r,A(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:ne(r,A(30,30,30),.5*i).setA(100),offset:1}]})},$m=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,A(255,255,255),.2);return new $({stops:[{color:ne(r,A(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:ne(r,A(0,0,0),.2*i),offset:1}]})},Zm=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:ne(e[s%e.length].stroke,A(255,255,255),.2);return new q({angle:90,stops:[{color:ne(r,A(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:ne(r,A(30,30,30),.5*i),offset:1}]})},qm=(t,e,i)=>i=>{const s=!0===t?e[i%e.length].stroke:ne(e[i%e.length].stroke,A(255,255,255),.3);return new q({angle:90,stops:[{color:ne(s,A(255,255,255),.5),offset:0},{color:s,offset:.35},{color:ne(s,A(30,30,30),.5),offset:1}]})},Km=(t,i,s)=>{const r=i[0].stroke;return new $({shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner,position:{x:.5,y:.5},stops:[{color:!0===t?r:ne(r,A(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:ne(r,A(0,0,0),.5*s),offset:1}]})},Jm=ve((()=>{const t=A(255,255,255),i=new L({color:t}),s=!0,r=new Qp({spread:1,blur:9,offset:{x:0,y:0},color:A(0,0,0,150)}),n=new $({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:A(50,51,52)},{offset:.5,color:A(14,15,16)},{offset:1,color:A(0,0,0)}]}),o=new L({color:A(45,45,45)}),h=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(120,120,120,100)},{offset:1,color:A(0,0,0,50)}]}),a=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(30,30,30,200)},{offset:1,color:A(0,0,0,255)}]}),l=new L({color:A(255,255,220)}),u=new L({color:A(255,255,166)}),c=new L({color:A(255,255,220)}),d=new L({color:A(255,255,220,130)}),f=new L({color:A(255,255,200)}),g=f,p=g,m=new q({angle:45,stops:[{offset:0,color:A(230,230,230)},{offset:1,color:A(150,150,150)}]}),y=new L({color:A(220,220,220)}),x=new L({color:A(200,200,200,50)}),S=new L({color:A(200,200,200,150)}),v=new L({color:A(200,200,200,20)}),b=new L({color:A(150,150,150)}),M=new q({angle:0,stops:[{offset:0,color:A(10,10,10,220)},{offset:1,color:A(30,30,30,220)}]}),k=i,w=A(255,255,200),D=M,E=k,T=A(20,20,20),I=A(0,0,0),C=t,P=A(150,150,150),O=A(50,50,50),F=A(50,50,50),R=A(100,100,100),B=A(200,200,200),z=[A(255,255,91,255),A(255,205,91,255),A(255,155,91,255),A(255,196,188,255),A(255,148,184,255),A(219,148,198,255),A(235,196,224,255),A(169,148,198,255),A(148,226,198,255),A(148,255,176,255),A(180,255,165,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),_=t.setA(20),G=A(176,255,157,255),V=A(255,112,76,255),N={mapChartFillStyle:new q({angle:135,stops:[{color:A(255,255,91,255),offset:0},{color:A(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Ym(s,z,.5),pieChartSliceFillStylePalette:$m(s,z,1),funnelChartSliceFillStylePalette:Zm(s,z,1),pyramidChartSliceFillStylePalette:Zm(s,z,1),rectangleSeriesFillStyle:qm(s,z),gaugeChartGaugeFillStyle:Km(s,z,1)},W=new L({color:A(176,255,157,255)}),H=new L({color:A(255,146,146,255)}),U=new L({color:A(176,255,157,255)}),X=new L({color:A(230,63,63,255)}),j=new L({color:A(176,255,157,120)}),Y=new L({color:A(229,63,63,180)}),Z=new L({color:A(27,37,36,255)}),K=new L({color:A(62,27,27,255)}),J=[A(255,0,0),A(255,255,0),A(0,255,0)],Q=[A(10,10,255),A(10,190,255),A(251,255,0),A(255,38,0)],tt=[A(255,255,0),A(255,204,0),A(255,128,0),A(255,0,0)],et=[A(0,0,0),A(167,4,69,255),A(255,0,0),A(252,252,168,255)],it=new $({stops:[{color:A(61,61,80,100),offset:0},{color:A(44,44,55,30),offset:1}]}),st=new L({color:A(148,148,198,255)}),rt=j.getColor().setA(255),nt=A(100,100,100);return Xm({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(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:p,axisLineFillStyle:m,axisTickMajorFillStyle:y,axisGridMajorFillStyle:x,axisTickMinorFillStyle:S,axisGridMinorFillStyle:v,cursorGridFillStyle:b,legendBackgroundFillStyle:M,legendBackgroundBorderFillStyle:k,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:D,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:T,uiBackgroundBorderColor:I,uiStrokeColorContrastHigh:C,uiStrokeColorContrastMedium:P,uiStrokeColorContrastLow:O,dataStrokeColorContrastHigh:F,dataStrokeColorContrastMedium:R,dataStrokeColorContrastLow:B,dataColorPalette:z,dataColorPaletteInverted:[{area:A(190,50,50,100),border:A(210,80,80)}],dataHighlightOverlayColor:_,dataColorPositive:G,dataColorNegative:V,overrideThemeProperties:N},{positiveTextFillStyle:W,negativeTextFillStyle:H,positiveFillStyle:U,negativeFillStyle:X,positiveAreaFillStyle:j,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:Z,negativeBackgroundFillStyle:K,badGoodColorPalette:J,coldHotColorPalette:Q,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),Qm=ve((()=>{const t=A(255,255,255),i=new L({color:t}),s=!0,r=new Qp({spread:0,blur:9,offset:{x:0,y:0},color:A(105,255,236,40)}),n=new L({color:A(2,21,30)}),o=new $({stops:[{color:A(19,40,66,150),offset:0},{color:A(0,0,0,150),offset:1}]}),h=new L({color:A(0,5,8,150)}),a=i,l=i,u=i,c=new L({color:A(255,255,220,130)}),d=i,f=i,g=f,p=new L({color:A(20,224,250,255)}),m=i,y=new L({color:A(61,94,110,100)}),x=new L({color:A(61,94,110,255)}),S=new L({color:A(61,94,110,40)}),v=i,b=new L({color:A(0,18,23,255)}),M=i,k=t,w=new L({color:A(0,17,22,240)}),D=i,E=A(0,38,48,220),T=A(0,0,0),I=t,C=A(150,150,150),P=A(19,78,93),O=A(50,50,50),F=A(0,36,48),R=A(200,200,200),B=[A(45,253,253,255),A(44,172,247,255),A(46,100,248,255),A(96,84,199,255),A(184,104,245,255),A(98,160,218,255),A(43,238,245,255),A(38,140,206,255),A(112,96,224,255),A(206,157,255,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(50),_=A(3,217,194,255),G=A(230,63,63,255),V={mapChartFillStyle:new q({angle:135,stops:[{color:A(118,248,231,255),offset:0},{color:A(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Ym(s,B,1),pieChartSliceFillStylePalette:$m(s,B,1),funnelChartSliceFillStylePalette:Zm(s,B,1),pyramidChartSliceFillStylePalette:Zm(s,B,1),rectangleSeriesFillStyle:qm(s,B),gaugeChartGaugeFillStyle:Km(s,B,1)},N=new L({color:A(45,253,253,255)}),W=new L({color:A(255,146,146,255)}),H=new L({color:A(45,253,253,255)}),U=new L({color:A(230,63,63,255)}),X=new L({color:A(1,190,164,120)}),j=new L({color:A(229,63,63,180)}),Y=new L({color:A(1,53,57,255)}),Z=new L({color:A(62,27,27,255)}),K=[A(1,104,119,255),A(0,165,144,255),A(0,246,214,255)],J=[A(0,87,95,255),A(0,125,124,255),A(1,209,182,255),A(0,255,221,255),A(218,112,112,255),A(172,47,47,255)],Q=[A(126,255,253,255),A(50,233,230,255),A(0,196,193,255),A(62,138,178,255),A(139,88,191,255),A(162,55,143,255)],tt=[A(13,31,52,255),A(101,50,118,255),A(1,142,172,255),A(2,196,170,255),A(0,255,221,255)],et=new $({stops:[{color:A(122,103,254,70),offset:0},{color:A(178,168,255,10),offset:1}]}),it=new L({color:A(122,103,254,255)}),st=X.getColor().setA(255),rt=A(15,83,83);return Xm({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new hd({source:jm(t,"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:p,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:k,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:D,uiBackgroundColor:E,uiBackgroundBorderColor:T,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:C,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:O,dataStrokeColorContrastMedium:F,dataStrokeColorContrastLow:R,dataColorPalette:B,dataColorPaletteInverted:[{area:A(170,60,210,100),border:A(210,100,250)}],dataHighlightOverlayColor:z,dataColorPositive:_,dataColorNegative:G,overrideThemeProperties:V},{positiveTextFillStyle:N,negativeTextFillStyle:W,positiveFillStyle:H,negativeFillStyle:U,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:Y,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),ty=ve((()=>{const t=!1,i=new Qp({spread:0,blur:6,offset:{x:2,y:-2},color:A(0,0,0,30)}),s=new $({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:A(255,255,255)},{offset:1,color:A(255,255,255)}]}),r=new L({color:A(219,227,233,255)}),n=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(255,255,255,200)},{offset:1,color:A(240,244,246,200)}]}),o=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(255,255,255,255)},{offset:1,color:A(255,255,255,255)}]}),h=new L({color:A(33,43,49)}),a=new L({color:A(33,43,49)}),l=new L({color:A(33,43,49)}),u=new L({color:A(33,43,49,150)}),c=new L({color:A(33,43,49)}),d=c,f=d,g=new q({angle:45,stops:[{offset:0,color:A(225,225,225)},{offset:1,color:A(225,225,225)}]}),p=new L({color:A(168,186,199,255)}),m=new L({color:A(168,186,199,120)}),y=new L({color:A(168,186,199,40)}),x=new L({color:A(168,186,199,40)}),S=new L({color:A(128,146,159,255)}),v=new q({angle:0,stops:[{offset:0,color:A(255,255,255,240)},{offset:1,color:A(255,255,255,240)}]}),b=new L({color:A(168,186,199)}),M=A(255,255,200),k=new L({color:A(255,255,255,240)}),w=new L({color:A(128,146,159,255)}),D=A(255,255,255,255),E=A(168,168,199,255),T=A(168,186,199,255),I=A(168,186,199,255),C=A(168,186,199,255),P=A(168,186,199,255),O=A(100,100,100),F=A(200,200,200),R=[A(28,181,140,255),A(255,132,0,255),A(240,39,39,255),A(86,121,251,255),A(2,181,213,255),A(13,212,158,255),A(22,167,3,255),A(234,103,232,255),A(62,183,179,255),A(140,93,3,255),A(155,158,186,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),B=A(150,150,150,80),z=A(46,182,120,255),_=A(255,66,66,255),G=new tt({thickness:2,fillStyle:new L({color:A(168,186,199,255)})}),V={mapChartFillStyle:new q({angle:-45,stops:[{color:A(2,181,213,255),offset:0},{color:A(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Ym(t,R,.8),pieChartSliceFillStylePalette:$m(t,R,.8),funnelChartSliceFillStylePalette:Zm(t,R,.5),pyramidChartSliceFillStylePalette:Zm(t,R,.5),rectangleSeriesFillStyle:qm(t,R),gaugeChartGaugeFillStyle:Km(t,R,.8),chartXYSeriesBackgroundStrokeStyle:G,chart3DSeriesBackgroundStrokeStyle:G,polarChartSeriesBackgroundStrokeStyle:G,spiderChartSeriesBackgroundStrokeStyle:G,dataGridTextFillStyle:new L({color:A(0,88,64,255)})},N=new L({color:A(4,146,108,255)}),W=new L({color:A(240,39,39,255)}),H=new L({color:A(28,181,140,255)}),U=new L({color:A(230,88,88,255)}),X=new L({color:A(28,181,140,180)}),j=new L({color:A(230,88,88,180)}),Y=new L({color:A(229,243,228)}),Z=new L({color:A(232,225,216)}),K=[A(193,48,48,255),A(240,234,60,255),A(45,191,55,255)],J=[A(10,19,255,255),A(15,191,250,255),A(249,255,2,255),A(253,133,0,255),A(255,24,0,255)],Q=[A(50,99,213),A(8,179,77),A(255,246,0),A(255,126,0),A(189,36,30)],et=[A(16,64,176),A(8,179,77),A(255,246,0),A(255,126,0),A(168,6,0)],it=new L({color:A(185,198,207,255)}),st=new $({stops:[{color:A(151,190,220,10),offset:0},{color:A(151,190,220,50),offset:1}]}),rt=X.getColor().setA(255),nt=A(150,150,150);return Xm({isDark:t,highlightColorOffset:A(-60,-60,-60,60),highlightColorOffsetAxisOverlay:A(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:p,axisGridMajorFillStyle:m,axisTickMinorFillStyle:y,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:k,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:D,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:T,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:C,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:O,dataStrokeColorContrastLow:F,dataColorPalette:R,dataColorPaletteInverted:[{area:A(190,50,50,100),border:A(210,80,80)}],dataHighlightOverlayColor:B,dataColorPositive:z,dataColorNegative:_,overrideThemeProperties:V},{positiveTextFillStyle:N,negativeTextFillStyle:W,positiveFillStyle:H,negativeFillStyle:U,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:Y,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:st,bollingerBorderFillStyle:it,highlightPointColor:A(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),ey=ve((()=>{const t=!1,i=new $({position:{x:.8,y:.8},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.ellipse,stops:[{offset:0,color:A(255,255,255)},{offset:1,color:A(255,255,255)}]}),s=new L({color:A(214,236,216,255)}),r=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(233,244,231,70)},{offset:1,color:A(233,244,231,200)}]}),n=new $({position:{x:.5,y:.5},extent:e.GradientExtent.farthestCorner,shape:e.GradientShape.circle,stops:[{offset:0,color:A(255,255,255,255)},{offset:1,color:A(255,255,255,255)}]}),o=new L({color:A(1,61,53)}),h=new L({color:A(1,61,53)}),a=new L({color:A(1,61,53)}),l=new L({color:A(1,61,53,150)}),u=new L({color:A(1,61,53)}),c=u,d=c,f=new q({angle:45,stops:[{offset:0,color:A(225,225,225)},{offset:1,color:A(225,225,225)}]}),g=new L({color:A(188,211,186,255)}),p=new L({color:A(188,211,186,150)}),m=new L({color:A(188,211,186,50)}),y=new L({color:A(188,211,186,50)}),x=new L({color:A(104,148,111,255)}),S=new q({angle:0,stops:[{offset:0,color:A(255,255,255,240)},{offset:1,color:A(255,255,255,240)}]}),v=new L({color:A(104,148,111)}),b=A(255,255,200),M=new L({color:A(255,255,255,240)}),k=new L({color:A(104,148,111,255)}),w=A(255,255,255,255),D=A(179,201,183,255),E=A(188,211,186,255),T=A(188,211,186,255),I=A(188,211,186,255),C=A(188,211,186,255),P=A(100,100,100),O=A(200,200,200),F=[A(138,195,142,255),A(193,161,114,255),A(178,99,99,255),A(142,156,210,255),A(154,209,219,255),A(164,212,199,255),A(104,156,97,255),A(196,147,195,255),A(92,190,187,255),A(126,100,51,255),A(136,138,157,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),R=A(150,150,150,80),B=A(46,182,84,255),z=A(232,96,96,255),_=new tt({thickness:2,fillStyle:new L({color:A(188,211,186,255)})}),G={mapChartFillStyle:new q({angle:-45,stops:[{color:A(118,160,121,255),offset:0},{color:A(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Ym(t,F,.8),pieChartSliceFillStylePalette:$m(t,F,.8),pyramidChartSliceFillStylePalette:Zm(t,F,.5),funnelChartSliceFillStylePalette:Zm(t,F,.5),rectangleSeriesFillStyle:qm(t,F),gaugeChartGaugeFillStyle:Km(t,F,.8),chartXYSeriesBackgroundStrokeStyle:_,chart3DSeriesBackgroundStrokeStyle:_,polarChartSeriesBackgroundStrokeStyle:_,spiderChartSeriesBackgroundStrokeStyle:_,dataGridTextFillStyle:new L({color:A(77,66,21,255)})},V=new L({color:A(93,151,97,255)}),N=new L({color:A(178,99,99,255)}),W=new L({color:A(138,195,142,255)}),H=new L({color:A(178,99,99,255)}),U=new L({color:A(138,195,142,180)}),X=new L({color:A(178,99,99,180)}),j=new L({color:A(224,240,237)}),Y=new L({color:A(251,227,227)}),Z=[A(178,99,99,255),A(215,224,111,255),A(80,186,88,255)],K=[A(62,64,142,255),A(66,131,77,255),A(250,250,135,255),A(202,161,78,255),A(179,53,53,255)],J=[A(64,86,138),A(123,192,205),A(255,252,149),A(220,155,92),A(184,78,74)],Q=[A(64,86,138),A(123,192,205),A(255,252,149),A(220,155,92),A(132,60,57)],et=new L({color:A(185,198,207,255)}),it=new $({stops:[{color:A(151,190,220,10),offset:0},{color:A(151,190,220,50),offset:1}]}),st=U.getColor().setA(255),rt=A(150,150,150);return Xm({isDark:t,highlightColorOffset:A(-60,-60,-60,60),highlightColorOffsetAxisOverlay:A(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:p,axisTickMinorFillStyle:m,axisGridMinorFillStyle:y,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:k,uiBackgroundColor:w,uiBackgroundBorderColor:D,uiStrokeColorContrastHigh:E,uiStrokeColorContrastMedium:T,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:C,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:O,dataColorPalette:F,dataColorPaletteInverted:[{area:A(210,70,70,100),border:A(200,110,110)}],dataHighlightOverlayColor:R,dataColorPositive:B,dataColorNegative:z,overrideThemeProperties:G},{positiveTextFillStyle:V,negativeTextFillStyle:N,positiveFillStyle:W,negativeFillStyle:H,positiveAreaFillStyle:U,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:Y,badGoodColorPalette:Z,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:A(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),iy=ve((()=>{const t=A(255,255,255),i=new L({color:t}),s=!0,r=new Qp({spread:1,blur:9,offset:{x:0,y:0},color:A(255,255,255,30)}),n=new L({color:A(6,15,36)}),o=new $({stops:[{color:A(46,13,87,50),offset:0},{color:A(0,0,0,150),offset:1}]}),h=new L({color:A(0,5,8,150)}),a=i,l=i,u=i,c=new L({color:A(255,255,220,130)}),d=i,f=i,g=f,p=new q({angle:45,stops:[{offset:0,color:A(241,133,255,255)},{offset:1,color:A(115,207,238,255)}]}),m=i,y=new L({color:A(61,94,110,100)}),x=new L({color:A(61,94,110,255)}),S=new L({color:A(61,94,110,40)}),v=i,b=new L({color:A(0,18,23,255)}),M=i,k=A(115,207,238,255),w=new L({color:A(0,17,22,240)}),D=i,E=A(0,38,48,255),T=A(0,0,0),I=t,C=A(150,150,150),P=A(19,57,93),O=A(50,50,50),F=A(0,17,48),R=A(200,200,200),B=[A(20,211,237,255),A(98,147,252,255),A(164,73,250,255),A(129,117,253,255),A(95,134,252,255),A(22,133,212,255),A(35,200,242,255),A(104,121,233,255),A(137,69,232,255),A(70,72,241,255)].map((t=>({stroke:t,border:t,area:t.setA(100)}))),z=t.setA(50),_=A(3,217,194,255),G=A(243,21,110,255),V={mapChartFillStyle:new q({angle:135,stops:[{color:A(118,248,231,255),offset:0},{color:A(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Ym(s,B,.5),pieChartSliceFillStylePalette:$m(s,B,2),funnelChartSliceFillStylePalette:Zm(s,B,1),pyramidChartSliceFillStylePalette:Zm(s,B,1),rectangleSeriesFillStyle:qm(s,B),gaugeChartGaugeFillStyle:Km(s,B,1)},N=new L({color:A(20,211,237,255)}),W=new L({color:A(253,145,178,255)}),H=new L({color:A(20,211,237,255)}),U=new L({color:A(239,68,121,255)}),X=new L({color:A(20,211,237,120)}),j=new L({color:A(239,68,121,180)}),Y=new L({color:A(1,53,57,255)}),Z=new L({color:A(94,19,42,255)}),K=[A(174,51,132,255),A(204,107,218,255),A(189,215,253,255)],J=[A(0,63,95,255),A(0,149,255,255),A(0,225,255,255),A(255,154,254,255),A(204,98,170,255),A(139,39,84,255)],Q=[A(197,241,255,255),A(70,210,255,255),A(0,164,217,255),A(90,99,222,255),A(138,75,192,255),A(151,27,162,255)],tt=[A(13,31,52,255),A(129,54,130,255),A(131,108,176,255),A(7,162,213,255),A(26,247,255,255)],et=new $({stops:[{color:A(219,42,235,60),offset:0},{color:A(237,73,252,10),offset:1}]}),it=new L({color:A(237,73,252,255)}),st=X.getColor().setA(255),rt=A(8,70,100);return Xm({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new hd({source:jm(t,"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:p,axisTickMajorFillStyle:m,axisGridMajorFillStyle:y,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:k,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:D,uiBackgroundColor:E,uiBackgroundBorderColor:T,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:C,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:O,dataStrokeColorContrastMedium:F,dataStrokeColorContrastLow:R,dataColorPalette:B,dataColorPaletteInverted:[{area:A(41,130,255,100),border:A(45,110,240)}],dataHighlightOverlayColor:z,dataColorPositive:_,dataColorNegative:G,overrideThemeProperties:V},{positiveTextFillStyle:N,negativeTextFillStyle:W,positiveFillStyle:H,negativeFillStyle:U,positiveAreaFillStyle:X,negativeAreaFillStyle:j,positiveBackgroundFillStyle:Y,negativeBackgroundFillStyle:Z,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),sy={};Object.defineProperty(sy,"darkGold",{get:Jm,enumerable:!0}),Object.defineProperty(sy,"turquoiseHexagon",{get:Qm,enumerable:!0}),Object.defineProperty(sy,"light",{get:ty,enumerable:!0}),Object.defineProperty(sy,"lightNature",{get:ey,enumerable:!0}),Object.defineProperty(sy,"cyberSpace",{get:iy,enumerable:!0});const ry=sy,ny=ry.darkGold,oy=(t,e,i)=>s=>{const r={theme:ny,...i,...s},n=t(r),o=e?qp(n):void 0,h=new yd(n.Dh,s,n,n.G.bind(n),o);return n.hr((()=>h.wD())).er((()=>h.X())).Gi(),h},hy=(t,e)=>{t.hr((()=>{e.gc()})).er((()=>e.X())).Gi()},ay=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new mo(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o);return hy(n,h),h},ly=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new Ec(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,s);return hy(n,h),h},uy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new Vl(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,s);return hy(n,h),h},cy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new $a(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,s);return hy(n,h),h},dy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new(s&&s.type?s.type:No)(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return hy(n,h),h},fy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new(s&&s.type?s.type:pl)(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return hy(n,h),h},gy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new(s&&s.type?s.type:rl)(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return hy(n,h),h},py=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new(s&&s.type?s.type:Al)(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,void 0,!(!s||!s.disableAnimations));return hy(n,h),h},my=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new Qh(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,s,void 0);return hy(n,h),h},yy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new bh(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,void 0,s);return hy(n,h),h},xy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ny},n=t(r),o=e?qp(n):void 0,h=new ad(n.Dh,Fc(n,1).KT(0),st,n.G.bind(n),o,void 0);return hy(n,h),h};let Sy;const vy={None:dn,Rectangle:Sn,Circle:vn,Diamond:bn,Pointer:Mn},by={Rectangle:Sn,Circle:vn,Diamond:bn},My={XY:Ca},Ay={XY:Ia,Spider:Vh,Map:Wh,Polar:Vh},ky={None:fn,UIRectangle:Sn,UICircle:vn,UIDiamond:bn};e.Animation=H,e.AnimationEasings=W,e.Animator=U,e.AreaRangeSeries=oc,e.AreaSeries=Qu,e.AreaSeriesBipolar=sc,e.AreaSeriesMonopolar=tc,e.AreaSeriesNegative=ic,e.AreaSeriesPositive=ec,e.AreaSeriesTypes=rc,e.AutoCursor2DBuilder=zh,e.AutoCursorBuilders=Ay,e.AutoCursorXYBuilder=Ea,e.AutoFitStrategies=Th,e.AutoFitStrategy=wh,e.Axis=ao,e.Axis3D=Ko,e.AxisScrollStrategies=Ci,e.AxisTickStrategies=Pi,e.Band=en,e.BasicSeries=Wa,e.BorderedPicture=pn,e.BoxAndWhiskers=Jl,e.BoxFigure=Kl,e.BoxSeries=qu,e.BoxSeries3D=oh,e.Button=Gn,e.Chart=xo,e.Chart3D=bh,e.ChartComponent=Qr,e.ChartMarker=Fa,e.ChartMarker2D=class extends Fa{constructor(t,e,i,s,r,n){super(t,e,i,s.bx(t,e,i,n),r,n)}},e.ChartMarkerXY=Ba,e.ChartWithCursor=Jh,e.ChartWithSeries=gh,e.ChartXY=Ec,e.Color=M,e.ColorCSS=t=>{try{if(t.startsWith("rgba")){const e=t.substr(5).slice(0,-1),i=JSON.parse(`[${e}]`);return A(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 A(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 A(i[0],i[1],i[2])}return t.startsWith("#")||t.startsWith("0x")?k(t):k((t=>{const e=D[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),k("#fff")},e.ColorHEX=k,e.ColorHSV=w,e.ColorPalettes=Vm,e.ColorRGBA=A,e.ColorShadingStyles=rh,e.ConstantLine=sn,e.CursorBuilder=Bh,e.CursorBuilderXY=Da,e.CustomTick=qr,e.CustomizableFigure=Zl,e.Dashboard=yd,e.DashedLine=Gf,e.DataGrid=ad,e.DateTimeTickStrategy=mm,e.EllipseFigure=Cu,e.EllipseSeries=Pu,e.EmptyFill=R,e.EmptyPointMarker=fn,e.EmptyUIElement=cn,e.Figure=Yl,e.FigureSeries=$l,e.FontSettings=$i,e.FormattingFunctions=Ai,e.FunnelChart=el,e.FunnelChartTypes=ol,e.FunnelChartWithLabelsInsideSlices=nl,e.FunnelChartWithLabelsOnSides=rl,e.FunnelSlice=qa,e.GaugeChart=ll,e.GaugeChartTypes=Gm,e.GaugeSlice=cl,e.GenericAxis=Hi,e.GlowEffect=Qp,e.HeatmapGridSeries=uc,e.HeatmapGridSeriesIntensityValues=cc,e.HeatmapScrollingGridSeries=dc,e.HeatmapScrollingGridSeriesIntensityValues=fc,e.Highlighter=tn,e.Icon=rd,e.ImageFill=hd,e.IndividualPointFill=G,e.LUT=O,e.LegendBoxBuilders=ro,e.LineAndPointSeries3D=hh,e.LineSeries=Au,e.LineSeries3D=ah,e.LinearGradientFill=q,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new q({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Qh,e.MapRegions=Lm,e.MapRegionsAfrica=Im,e.MapRegionsAsia=Cm,e.MapRegionsAustralia=Pm,e.MapRegionsCanada=Om,e.MapRegionsEurope=Fm,e.MapRegionsNorthAmerica=zm,e.MapRegionsSouthAmerica=_m,e.MapRegionsUSA=Bm,e.MapRegionsWorld=Rm,e.MapTypes=Uh,e.MarkerBuilders=My,e.NumericTickStrategy=Am,e.OHLCBar=eu,e.OHLCCandleStick=tu,e.OHLCFigure=Ql,e.OHLCFigures=iu,e.OHLCSeries=Xu,e.OHLCSeriesTraditional=ju,e.OHLCSeriesTypes=$u,e.OHLCSeriesWithAutomaticPacking=Yu,e.OnScreenMenu=ac,e.OnScreenMenuAnimationsButton=Mr,e.OnScreenMenuButton=gr,e.OnScreenMenuControlBase=tr,e.OnScreenMenuCustomButton=kr,e.OnScreenMenuOsmToggleButton=wr,e.OnScreenMenuToggleButton=pr,e.OnScreenMenuZoomInButton=mr,e.OnScreenMenuZoomInXButton=yr,e.OnScreenMenuZoomInYButton=xr,e.OnScreenMenuZoomOutButton=Sr,e.OnScreenMenuZoomOutXButton=vr,e.OnScreenMenuZoomOutYButton=br,e.OnScreenMenuZoomToFitButton=Ar,e.PalettedFill=N,e.Panel=go,e.PhongShadingStyle=ih,e.Picture=gn,e.PieChart=Co,e.PieChartTypes=Ho,e.PieChartWithLabelsInsideSlices=Wo,e.PieChartWithLabelsOnSides=No,e.PieSlice=wo,e.PixelatedPoints3D=ts,e.PointCloudSeries3D=dh,e.PointLineSeries=hu,e.PointLineSeries3D=lh,e.PointMarkers=ky,e.PointSeries=hc,e.PointSeries3D=ch,e.PointSeriesTypes3D=fh,e.PointStyle3D=es,e.PolarAreaSeries=Xa,e.PolarAreaSeriesInterior=ja,e.PolarAxis=ia,e.PolarAxisAmplitude=ra,e.PolarAxisTick=sa,e.PolarChart=$a,e.PolarLineSeries=Sa,e.PolarPointLineSeries=va,e.PolarPointSeries=ba,e.PolarPolygon=Ma,e.PolarPolygonSeries=Ua,e.PolarSector=la,e.PolarSeries=ca,e.PolygonFigure=Du,e.PolygonSeries=Eu,e.PyramidChart=vl,e.PyramidChartTypes=wl,e.PyramidChartWithLabelsInsideSlices=kl,e.PyramidChartWithLabelsOnSides=Al,e.PyramidSlice=ml,e.RadialGauge=ul,e.RadialGradientFill=$,e.RadialGradientFillPalette=(t,e,i)=>{const s=t(e+1,i);return t=>new $({stops:[{offset:0,color:s(t)},{offset:1,color:s(t).getDarker()}]})},e.RangeSeries=Ku,e.RectangleFigure=ku,e.RectangleSeries=wu,e.SegmentFigure=Tu,e.SegmentSeries=Iu,e.Series2D=ua,e.Series3D=nh,e.SeriesMarkerXY=za,e.SeriesXY=_a,e.SimpleFigureSeries=ql,e.SimpleShadingStyle=th,e.Slice=Ao,e.SliceLabelFormatters=Mo,e.SliceSorters=bo,e.SolidFill=L,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new L({color:s(t)})},e.SolidGauge=pl,e.SolidGaugeSlice=dl,e.SolidLine=tt,e.SpiderAxis=Cl,e.SpiderChart=Vl,e.SpiderSeries=Ol,e.SplineSeries=uu,e.StaticCursor2DBuilder=_h,e.StaticCursorXYBuilder=Ta,e.StepSeries=Mu,e.StipplePatterns=_f,e.SurfaceGridSeries3D=Sh,e.SurfaceScrollingGridSeries3D=vh,e.TableContentBuilder=Ih,e.Themes=ry,e.Tick=no,e.TickStyle=em,e.TimeFormattingFunctions=Dm,e.TimeTickStrategy=Tm,e.TriangulatedPoints3D=Ji,e.UIBackgrounds=vy,e.UIButtonPictures=by,e.UICircle=vn,e.UIColumnGrid=class extends wn{constructor(){super(...arguments),this.Hu=[]}addColumn(){return this.addElement(Cn,void 0)}getColumn(t,e=!1){return e&&this.Hu.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Hu[t]}},e.UIDiamond=bn,e.UIElementBuilders=so,e.UIElementColumn=Dn,e.UIElementLine=kn,e.UIElementRow=wn,e.UIElementWithBackground=$r,e.UIEmptyBackground=dn,e.UILabel=yn,e.UILayoutBuilders=Mh,e.UILayoutGap=An,e.UILegendBoxPanel=Ah,e.UIObject=Hr,e.UIOrigins=Er,e.UIPanel=mo,e.UIPointer=Mn,e.UIPolygon=mn,e.UIRectangle=Sn,e.UIRowGrid=Tn,e.VisibleFill=_,e.VisibleTicks=im,e.ZoomBandChart=Oc,e.defaultOsmBackgroundColor=Br,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=B,e.emptyLine=J,e.emptyPoints3D=qi,e.emptyTick=sm,e.formatLongitudeLatitude=ea,e.isDashedLine=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"dashed"!==t.lineType),e.isSolidLine=t=>!(!t||"object"!=typeof t||!("lineType"in t)||"solid"!==t.lineType),e.lightningChart=(t,e)=>{const i="object"==typeof t?t.license:t,s="object"==typeof t?t.licenseInformation:e,r="object"==typeof t?t:void 0,n=new zp;return n.e=i||"",Sy||(Sy=(t=>{let e,i,s=!1,r=!1,n=!1,o=!1,h="";try{if(Op){const e=(t=>{if(!Op)return;const e=Op.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";default:return}})();if("0001"===e){Bp=new Uint8Array([2]);const e=(t=>{if(!Op)return;const e=Op.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();1===e?(n=!Xp(Op),s=!0):2===e?(jp(Op,t),r=!0):(_p=!0,Wp(Op),o=!0)}else{if("0002"!==e)throw new Error(Pp(0,0,1,7,1,12,5));{const e=(t=>{if(!Op)return;const e=Op.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)_p=!0,Wp(Op),o=!0;else if(189===e)n=!Xp(Op),s=!0;else{if(159!==e)throw new Error(Pp(0,0,1,7,1,12,5));jp(Op,t),r=!0}}}}else Rp=!0}catch(t){t instanceof Error&&(e=t)}try{o&&(i=Cp[Pp(-1,34)][Pp(-1,35)](Pp(-1,39))||void 0)}catch(t){Cp.console.error(t)}let a=!1;if(i){const t=i.split("-");if(2===t.length&&Up(t[0],t[1])){const[e,i]=t[0].split(":").map((t=>Number(t)));Date.now()-i<.95*e*1e3&&(a=!0)}}const l=!(e||Rp||s||r||a),u=(()=>{const t=new(Cp[Pp(-1,0)]);return t.open(Pp(0,26),Pp(-2,0)),t.setRequestHeader(Pp(-1,24),Pp(-1,25)),t.withCredentials=!0,t})();if(l){let t;try{t=parseInt(Op?Op.split("-")[1]:Math.floor(1e6*Math.random()).toString(),16)}catch(e){t=Math.floor(1e6*Math.random())}const i=Math.floor(1e6*Math.random());h=(t^i).toString();const s={};let r="",n="",o="";Op=Op||"";const a=Pp(-4,0);for(let t=0;t{if(e)throw Yp(e.message,t),e;const s={Ph:t=>{const e=`${Pp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${(t=>{switch(t){case 1:return Pp(0,48,49);case 0:return Pp(0,48,50);case 2:return Pp(0,51);case 3:return Pp(0,52,48);case 4:return Pp(0,53,48);case 5:return Pp(0,54,48);case 6:return Pp(0,55,48);case 7:return Pp(0,56,48);case 8:return Pp(0,57,48);case 9:return Pp(0,58,48)}return xe(0,"")})(t)}`;throw Yp(e,r,!1),new Error(e)},...Fp},r=new qg(t,s),o=t=>{if("error"===(null==t?void 0:t.type)&&i){const t=i.split("-");if(2===t.length&&Up(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return _p=!1,void $p(u,!1,a)}}if(u.readyState===Cp[Pp(-1,0)].DONE){if(200!==u.status){let e="";try{e=t&&"loadend"!==t.type?Pp(0,0,1,23,1,32,1,24,5):JSON.parse(u[Pp(-1,23)]).message,$p(u,!1,a)}catch(t){console.error(t)}throw Yp(e,r),new Error(Pp(0,0,1,2,1,7,1,12,5)+e)}{const t=JSON.parse(u[Pp(-1,23)]);if(!Up(h+Pp(-3,0),t.h)){const t=Pp(0,0,1,27,1,28,1,29,1,30,1,31,5);throw Yp(t,r),new Error(t)}Cp[Pp(-1,34)][Pp(-1,36)](Pp(-1,39),t.t),Cp[Pp(-1,34)][Pp(-1,36)](Pp(-1,33),t.s),_p=!1}}},a=t=>{o(t)};return $p(u,!0,a),l?setTimeout((()=>{if(_p){let t=!0;if(i){const e=i.split("-");if(2===e.length&&Up(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&Yp(Pp(0,25,1,23,1,32,1,24,5),r)}}),1e4):$p(u,!1,a),n?(t=>{let e;_p=!1;const i=t.$t(),s=()=>{e&&(t.uh(e.lh()),e=void 0),e=t.jT("deployment test"),e.ye(t.ut).Ms(Pp(0,34,1,33)).Cn({x:i.x/2,y:i.y/2}).xn(50).Cs(13).As(new L({color:A(128,128,128,100)})).Sn("Arial").vn(500).setMouseInteractions(!1),t.rh().oh()};t._r((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.lh()({Dashboard:oy(t,e,i),ChartXY:ly(t,e,i),Spider:uy(t,e,i),Polar:cy(t,e,i),Pie:dy(t,e,i),UIPanel:ay(t,e,i),Gauge:fy(t,e,i),Funnel:gy(t,e,i),Pyramid:py(t,e,i),Chart3D:yy(t,e,i),Map:my(t,e,i),DataGrid:xy(t,e,i)}))(Sy,n.e,r)},e.onScreenMenuControlBaseHeight=Cr,e.onScreenMenuControlBaseWidth=Pr,e.onScreenMenuControlOpacity=Or,e.onScreenMenuDefaultButtonShape=Rr,e.onScreenMenuSpriteURL=Fr,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=uo,e.synchronizeAxisIntervals=ot,e.translatePoint=nt,e.translatePoint3D=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.km.DN(t);if("world"===e.id&&"axes"===i.id)return e.chart.km.ON(t);if(e.id===i.id)return t;throw new Error("LC JS translatePoint3D misusage | originCoordinateSystem and targetCoordinateSystem arguments must be either Chart3D.world or Chart3D.axes")},e.transparentFill=Tr,e.transparentLine=Ir,e.vec3Utils=Ae,e.xDimensionStrategy=Nl,e.yDimensionStrategy=Wl}}]); \ No newline at end of file