diff --git a/index.html b/index.html index 29d027a..671f212 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -app \ No newline at end of file +app \ No newline at end of file diff --git a/js/app.bad4f8d825500332bb07.bundle.js b/js/app.bad4f8d825500332bb07.bundle.js new file mode 100644 index 0000000..d0fff9b --- /dev/null +++ b/js/app.bad4f8d825500332bb07.bundle.js @@ -0,0 +1 @@ +(self.webpackChunk=self.webpackChunk||[]).push([[143],{138:(e,t,s)=>{const a=s(475),o=s(27),{lightningChart:n,SolidFill:r,SolidLine:l,UILayoutBuilders:i,UIElementBuilders:d,AutoCursorModes:c,AxisTickStrategies:x,emptyLine:u,emptyFill:S,AxisScrollStrategies:m,Themes:p}=a,{createProgressiveTraceGenerator:y}=o,g=new Date(2018,0,1),T=g.getTime(),h=["Dev","Maintenance","Support","Sales","Marketing"],w=864e5,k=Promise.all(h.map(((e,t)=>y().setNumberOfPoints(365).generate().toPromise().then((e=>e.map((e=>({x:T+e.x*w,y:t>0?100*Math.abs(e.y)+100:50*Math.abs(e.y)+1800}))))).then((e=>e.map((e=>({x:e.x-T,y:e.y})))))))),f=n().Dashboard({numberOfRows:3,numberOfColumns:2}),D=f.getTheme(),E=new l({thickness:20/window.devicePixelRatio,fillStyle:new r({color:D.examples.unfocusedDataColor})}),I=new r({color:D.examples.mainDataColor}),F=k.then((e=>e.map((e=>e.reduce(((e,t)=>e+t.y),0))))),C=f.createChartXY({columnIndex:0,rowIndex:0,columnSpan:1,rowSpan:2}).setAutoCursorMode(c.disabled).setTitle("Total expenses for 2018 per department").setMouseInteractions(!1),P=C.getDefaultAxisX();P.setTickStrategy(x.Empty).setMouseInteractions(!1).setInterval({start:0,end:100}).setScrollStrategy(void 0),C.getDefaultAxisY().setTitle("Expenses ($)").setStrokeStyle((e=>e.setThickness(0))).setNibStyle(u).setMouseInteractions(!1);const R=C.addSegmentSeries().setHighlightOnHover(!1),b=h.length+1,A=h.map(((e,t)=>P.addCustomTick().setTextFormatter((t=>e)).setValue(100/b*(t+1)).setGridStrokeStyle(u))),M=f.createChartXY({columnIndex:0,rowIndex:2,columnSpan:2,rowSpan:1}).setPadding({right:40});f.setRowHeight(2,2);const X=M.addLineSeries().setName("Total Expenses").setStrokeStyle((e=>e.setFillStyle(I)));M.getDefaultAxisX().setTickStrategy(x.DateTime,(e=>e.setDateOrigin(g))),k.then((e=>{const t=e.reduce(((e,t)=>t.reduce(((e,t)=>e>t.y?e:t.y),e)),0);M.getDefaultAxisY().setTitle("Expenses ($)").setScrollStrategy(m.fitting).setInterval({start:0,end:t,stopAxisAfter:!1})})),X.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),Promise.all([F,k]).then((([e,t])=>{const s=A.map(((t,s)=>{const a=t.getValue();return R.add({startX:a,startY:0,endX:a,endY:e[s]})})),a=e=>{M.setTitle(`${h[e]} expenses per day`),X.clear(),X.add(t[e]),s.forEach((e=>e.setStrokeStyle(E))),A.forEach((e=>e.setMarker((e=>e.setTextFont((e=>e.setWeight("normal"))))))),s[e].setStrokeStyle((e=>e.setFillStyle(I))),A[e].setMarker((e=>e.setTextFont((e=>e.setWeight("bold")))))};s.forEach(((e,t)=>{e.onMouseEnter((()=>a(t))),e.onTouchStart((()=>a(t)))})),a(0)}));const v=f.createUIPanel({columnIndex:1,rowIndex:0,columnSpan:1,rowSpan:1}).addUIElement(i.Column).setPosition({x:50,y:50}).setPadding({right:40}).setBackground((e=>e.setFillStyle(S).setStrokeStyle(u)));F.then((e=>{const t=v.addElement(i.Row);t.addGap(),t.addElement(d.TextBox.addStyler((t=>t.setTextFont((e=>e.setSize(75/window.devicePixelRatio))).setText("$"+e.reduce(((e,t)=>e+t),0).toFixed())))),t.addGap(),v.addElement(d.TextBox.addStyler((e=>e.setTextFont((e=>e.setSize(25/window.devicePixelRatio))).setText("Total company expenses"))))}));const O=f.createChartXY({columnIndex:1,rowIndex:1,columnSpan:1,rowSpan:1}).setTitle("Total expenses per day").setPadding({right:40});O.getDefaultAxisX().setTickStrategy(x.DateTime,(e=>e.setDateOrigin(g)));const Y=O.addSplineSeries().setName("Total Expenses ($)").setStrokeStyle((e=>e.setThickness(2)));k.then((e=>{const t=new Array(365);for(let s=0;s<365;s++)t[s]={x:s*w,y:h.reduce(((t,a,o)=>t+e[o][s].y),0)};Y.setPointFillStyle(S).add(t)})),Y.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),O.getDefaultAxisY().setTitle("Expenses ($)")}},e=>{e.O(0,[736],(()=>(138,e(e.s=138)))),e.O()}]); \ No newline at end of file diff --git a/js/app.cbc258239e7925f03f6c.bundle.js b/js/app.cbc258239e7925f03f6c.bundle.js deleted file mode 100644 index 070ad6f..0000000 --- a/js/app.cbc258239e7925f03f6c.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk=self.webpackChunk||[]).push([[143],{138:(e,t,s)=>{const a=s(475),o=s(27),{lightningChart:n,SolidFill:r,SolidLine:l,UILayoutBuilders:i,UIElementBuilders:d,AutoCursorModes:c,AxisTickStrategies:x,emptyLine:u,emptyFill:S,AxisScrollStrategies:m,Themes:p}=a,{createProgressiveTraceGenerator:g}=o,y=["Dev","Maintenance","Support","Sales","Marketing"],T=864e5,h=Promise.all(y.map(((e,t)=>g().setNumberOfPoints(365).generate().toPromise().then((e=>e.map((e=>({x:e.x*T,y:t>0?100*Math.abs(e.y)+100:50*Math.abs(e.y)+1800})))))))),w=n().Dashboard({numberOfRows:3,numberOfColumns:2}),k=w.getTheme(),f=new l({thickness:20/window.devicePixelRatio,fillStyle:new r({color:k.examples.unfocusedDataColor})}),D=new r({color:k.examples.mainDataColor}),E=h.then((e=>e.map((e=>e.reduce(((e,t)=>e+t.y),0))))),I=w.createChartXY({columnIndex:0,rowIndex:0,columnSpan:1,rowSpan:2}).setAutoCursorMode(c.disabled).setTitle("Total expenses for 2018 per department").setMouseInteractions(!1),F=I.getDefaultAxisX();F.setTickStrategy(x.Empty).setMouseInteractions(!1).setInterval({start:0,end:100}).setScrollStrategy(void 0),I.getDefaultAxisY().setTitle("Expenses ($)").setStrokeStyle((e=>e.setThickness(0))).setNibStyle(u).setMouseInteractions(!1);const C=I.addSegmentSeries().setHighlightOnHover(!1),P=y.length+1,R=y.map(((e,t)=>F.addCustomTick().setTextFormatter((t=>e)).setValue(100/P*(t+1)).setGridStrokeStyle(u))),b=new Date(2018,0,1),A=w.createChartXY({columnIndex:0,rowIndex:2,columnSpan:2,rowSpan:1}).setPadding({right:40});w.setRowHeight(2,2);const M=A.addLineSeries().setName("Total Expenses").setStrokeStyle((e=>e.setFillStyle(D)));A.getDefaultAxisX().setTickStrategy(x.DateTime,(e=>e.setDateOrigin(b))),h.then((e=>{const t=e.reduce(((e,t)=>t.reduce(((e,t)=>e>t.y?e:t.y),e)),0);A.getDefaultAxisY().setTitle("Expenses ($)").setScrollStrategy(m.fitting).setInterval({start:0,end:t,stopAxisAfter:!1})})),M.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),Promise.all([E,h]).then((([e,t])=>{const s=R.map(((t,s)=>{const a=t.getValue();return C.add({startX:a,startY:0,endX:a,endY:e[s]})})),a=e=>{A.setTitle(`${y[e]} expenses per day`),M.clear(),M.add(t[e]),s.forEach((e=>e.setStrokeStyle(f))),R.forEach((e=>e.setMarker((e=>e.setTextFont((e=>e.setWeight("normal"))))))),s[e].setStrokeStyle((e=>e.setFillStyle(D))),R[e].setMarker((e=>e.setTextFont((e=>e.setWeight("bold")))))};s.forEach(((e,t)=>{e.onMouseEnter((()=>a(t))),e.onTouchStart((()=>a(t)))})),a(0)}));const X=w.createUIPanel({columnIndex:1,rowIndex:0,columnSpan:1,rowSpan:1}).addUIElement(i.Column).setPosition({x:50,y:50}).setPadding({right:40}).setBackground((e=>e.setFillStyle(S).setStrokeStyle(u)));E.then((e=>{const t=X.addElement(i.Row);t.addGap(),t.addElement(d.TextBox.addStyler((t=>t.setTextFont((e=>e.setSize(75/window.devicePixelRatio))).setText("$"+e.reduce(((e,t)=>e+t),0).toFixed())))),t.addGap(),X.addElement(d.TextBox.addStyler((e=>e.setTextFont((e=>e.setSize(25/window.devicePixelRatio))).setText("Total company expenses"))))}));const v=w.createChartXY({columnIndex:1,rowIndex:1,columnSpan:1,rowSpan:1}).setTitle("Total expenses per day").setPadding({right:40});v.getDefaultAxisX().setTickStrategy(x.DateTime,(e=>e.setDateOrigin(b)));const O=v.addSplineSeries().setName("Total Expenses ($)").setStrokeStyle((e=>e.setThickness(2)));h.then((e=>{const t=new Array(365);for(let s=0;s<365;s++)t[s]={x:s*T,y:y.reduce(((t,a,o)=>t+e[o][s].y),0)};O.setPointFillStyle(S).add(t)})),O.setCursorResultTableFormatter(((e,t,s,a)=>e.addRow("Total expenses").addRow("Date: "+t.axisX.formatValue(s)).addRow("Expenses: $"+a.toFixed(2)))),v.getDefaultAxisY().setTitle("Expenses ($)")}},e=>{e.O(0,[736],(()=>(138,e(e.s=138)))),e.O()}]); \ No newline at end of file diff --git a/js/vendor.ba735447f654cc2bc66a.bundle.js b/js/vendor.ba735447f654cc2bc66a.bundle.js deleted file mode 100644 index 07c70ae..0000000 --- a/js/vendor.ba735447f654cc2bc66a.bundle.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see vendor.ba735447f654cc2bc66a.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:()=>T,createProgressiveFunctionGenerator:()=>g,createProgressiveRandomGenerator:()=>u,createProgressiveTraceGenerator:()=>d,createSampledDataGenerator:()=>w,createSpectrumDataGenerator:()=>k,createTraceGenerator:()=>p,createWaterDropDataGenerator:()=>P,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 m({samplingFunction:function(t){return t*t},start:0,end:100,step:1})}var m=function(t){function e(e){var i=t.call(this,e)||this;i.x=i.options.start;var s={samplingFunction:e.samplingFunction,start:e.start,end:e.end,step:e.step};return i.options=Object.freeze(s),i.numberOfPoints=Math.ceil(Math.abs(s.end-s.start)/s.step),i}return r(e,t),e.prototype.setSamplingFunction=function(t){return new e(n(n({},this.options),{samplingFunction:t}))},e.prototype.setStart=function(t){return new e(n(n({},this.options),{start:t}))},e.prototype.setEnd=function(t){return new e(n(n({},this.options),{end:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.numberOfPoints},e.prototype.generateDataPoint=function(){var t={x:this.x,y:this.options.samplingFunction(this.x)};return this.x=this.x+this.options.step,t},e.prototype.infiniteReset=function(t,e){return{x:t.x+e.length*(e[e.length-1].x-e[e.length-2].x),y:t.y}},e}(l);function p(){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 w(){return new D({inputData:[],samplingFrequency:50,step:0})}var D=function(t){function e(e){var i=t.call(this,e)||this;i.interval=1/(i.options.samplingFrequency||10);var s={inputData:e.inputData,samplingFrequency:e.samplingFrequency,step:e.step};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setInputData=function(t){return new e(n(n({},this.options),{inputData:t}))},e.prototype.setSamplingFrequency=function(t){return new e(n(n({},this.options),{samplingFrequency:t}))},e.prototype.setStep=function(t){return new e(n(n({},this.options),{step:t}))},e.prototype.getPointCount=function(){return this.options.inputData.length},e.prototype.generateDataPoint=function(t){return{timestamp:t*this.interval+t*this.options.step,data:this.options.inputData[t]}},e.prototype.infiniteReset=function(t,e){return{timestamp:t.timestamp+e[e.length-1].timestamp,data:t.data}},e}(l);function T(){return new 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),B={numberOfSamples:1e3,sampleSize:10,variation:10,frequencyStability:1,narrowFactor1:8,narrowFactor2:24};function k(){return new I(B)}var I=function(t){function e(e){var i=t.call(this,e)||this,s={sampleSize:void 0!==e.sampleSize?e.sampleSize:B.sampleSize,numberOfSamples:void 0!==e.numberOfSamples?e.numberOfSamples:B.numberOfSamples,variation:void 0!==e.variation?e.variation:B.variation,frequencyStability:void 0!==e.frequencyStability?e.frequencyStability:B.frequencyStability,narrowFactor1:void 0!==e.narrowFactor1?e.narrowFactor1:B.narrowFactor1,narrowFactor2:void 0!==e.narrowFactor2?e.narrowFactor2:B.narrowFactor2};return i.options=Object.freeze(s),i}return r(e,t),e.prototype.setNumberOfSamples=function(t){return new e(n(n({},this.options),{numberOfSamples:t}))},e.prototype.setSampleSize=function(t){return new e(n(n({},this.options),{sampleSize:t}))},e.prototype.setVariation=function(t){return new e(n(n({},this.options),{variation:t}))},e.prototype.setFrequencyStability=function(t){return new e(n(n({},this.options),{frequencyStability:t}))},e.prototype.setNarrowFactor1=function(t){return new e(n(n({},this.options),{narrowFactor1:t}))},e.prototype.setNarrowFactor2=function(t){return new e(n(n({},this.options),{narrowFactor2:t}))},e.prototype.getPointCount=function(){return this.options.numberOfSamples},e.prototype.generateDataPoint=function(t){for(var e=100,i=this.options.variation,s=this.options.sampleSize,r=this.options.frequencyStability,n=s/8,o=s/2,h=new Array(s),a=0;as&&(n=s),(o+=(Math.random()-.5)*i/r/100*s)<0&&(o=0),o>s&&(o=s);var g,m=e/3*2,p=m/(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),C={rows:10,columns:10,rowPositionsNormalized:[.2,.5,.7],columnPositionsNormalized:[.6,.5,.3],amplitudes:[15,50,3],offsetLevel:47,volatility:25};function P(){return new L(C)}var L=function(){function t(t){var e={rows:void 0!==t.rows?t.rows:C.rows,columns:void 0!==t.columns?t.columns:C.columns,rowPositionsNormalized:void 0!==t.rowPositionsNormalized?t.rowPositionsNormalized:C.rowPositionsNormalized,columnPositionsNormalized:void 0!==t.columnPositionsNormalized?t.columnPositionsNormalized:C.columnPositionsNormalized,amplitudes:void 0!==t.amplitudes?t.amplitudes:C.amplitudes,offsetLevel:void 0!==t.offsetLevel?t.offsetLevel:C.offsetLevel,volatility:void 0!==t.volatility?t.volatility:C.volatility};this.options=Object.freeze(e)}return t.prototype.setRows=function(e){return new t(n(n({},this.options),{rows:e}))},t.prototype.setColumns=function(e){return new t(n(n({},this.options),{columns:e}))},t.prototype.setWaterDrops=function(e){var i=e.map((function(t){return t.rowNormalized})),s=e.map((function(t){return t.columnNormalized})),r=e.map((function(t){return t.amplitude}));return new t(n(n({},this.options),{rowPositionsNormalized:i,columnPositionsNormalized:s,amplitudes:r}))},t.prototype.setOffsetLevel=function(e){return new t(n(n({},this.options),{offsetLevel:e}))},t.prototype.setVolatility=function(e){return new t(n(n({},this.options),{volatility:e}))},t.prototype.generate=function(){var t=this;return new Promise((function(e){return i=t,s=void 0,n=function(){var t,i,s,r,n,o,h,a,l,u,c,d,f,g,m,p,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&&m%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 p++,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,m=e&&e.length,p=m?e[0]*s:t.length,y=i(t,0,p,s,!0),x=[];if(!y||y.next===y.prev)return x;if(m&&(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===T(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)&&(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||!y(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,m,p=t;t.prev!==t.next;)if(g=t.prev,m=t.next,c?o(t,l,u,c):n(t))e.push(g.i/i|0),e.push(t.i/i|0),e.push(m.i/i|0),w(t),t=m.next,p=m.next;else if((t=m)===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,m=s.next;m!==e;){if(m.x>=u&&m.x<=d&&m.y>=c&&m.y<=f&&g(r,h,n,a,o,l,m.x,m.y)&&p(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function o(t,e,i,s){var r=t.prev,n=t,o=t.next;if(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,m=ha?h>l?h:l:a>l?a:l,S=u>c?u>f?u:f:c>f?c:f,v=d(m,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>=m&&M.x<=x&&M.y>=y&&M.y<=S&&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>=m&&A.x<=x&&A.y>=y&&A.y<=S&&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>=v;){if(M.x>=m&&M.x<=x&&M.y>=y&&M.y<=S&&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<=b;){if(A.x>=m&&A.x<=x&&A.y>=y&&A.y<=S&&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;!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),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&&m(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 m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(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)&&(p(t.prev,t,e.prev)||p(t,e.prev,e))||y(t,e)&&p(t.prev,t,t.next)>0&&p(e.prev,e,e.next)>0)}function p(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,s){var r=v(p(t,e,i)),n=v(p(t,e,s)),o=v(p(i,s,t)),h=v(p(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 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 D(t.i,t.x,t.y),s=new D(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 D(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 D(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,i,s){for(var r=0,n=e,o=i-s;n0&&(s+=t[r-1].length,i.holes.push(s))}return i}},369:(t,e,i)=>{i.r(e),i.d(e,{Collection:()=>D,Iterable:()=>Ts,List:()=>ai,Map:()=>ze,OrderedMap:()=>Mi,OrderedSet:()=>ls,Range:()=>qi,Record:()=>gs,Repeat:()=>bs,Seq:()=>K,Set:()=>Vi,Stack:()=>Bi,default:()=>Es,fromJS:()=>Ms,get:()=>ae,getIn:()=>Xi,has:()=>he,hasIn:()=>ji,hash:()=>yt,is:()=>ft,isAssociative:()=>w,isCollection:()=>S,isImmutable:()=>L,isIndexed:()=>A,isKeyed:()=>b,isList:()=>hi,isMap:()=>ut,isOrdered:()=>F,isOrderedMap:()=>ct,isOrderedSet:()=>Fi,isPlainObject:()=>re,isRecord:()=>P,isSeq:()=>I,isSet:()=>Ri,isStack:()=>Ei,isValueObject:()=>dt,merge:()=>we,mergeDeep:()=>Te,mergeDeepWith:()=>Ee,mergeWith:()=>De,remove:()=>ue,removeIn:()=>pe,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 p(t,e,0)}function m(t,e){return p(t,e,e)}function p(t,e,i){return void 0===t?i:y(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function y(t){return t<0||0===t&&1/t==-1/0}var 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 w(t){return b(t)||A(t)}var D=function(t){return S(t)?t:K(t)},T=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}(D),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}(D),B=function(t){function e(t){return S(t)&&!w(t)?t:tt(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(D);D.Keyed=T,D.Indexed=E,D.Set=B;var k="@@__IMMUTABLE_SEQ__@@";function I(t){return Boolean(t&&t[k])}var C="@@__IMMUTABLE_RECORD__@@";function P(t){return Boolean(t&&t[C])}function L(t){return S(t)||P(t)}var R="@@__IMMUTABLE_ORDERED__@@";function F(t){return Boolean(t&&t[R])}var _=0,O=1,z=2,V="function"==typeof Symbol&&Symbol.iterator,N="@@iterator",G=V||N,U=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 W(){return{value:void 0,done:!0}}function Y(t){return!!Array.isArray(t)||!!$(t)}function q(t){return t&&"function"==typeof t.next}function X(t){var e=$(t);return e&&e.call(t)}function $(t){var e=t&&(V&&t[V]||t[N]);if("function"==typeof e)return e}U.prototype.toString=function(){return"[Iterator]"},U.KEYS=_,U.VALUES=O,U.ENTRIES=z,U.prototype.inspect=U.prototype.toSource=function(){return this.toString()},U.prototype[G]=function(){return this};var j=Object.prototype.hasOwnProperty;function Z(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():L(t)?t.toSeq():function(t){var e,i,s=at(t);if(s)return(i=$(e=t))&&i===e.entries?s.fromEntrySeq():function(t){var e=$(t);return e&&e===t.keys}(t)?s.toSetSeq():s;if("object"==typeof t)return new it(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var i=this._cache;if(i){for(var s=i.length,r=0;r!==s;){var n=i[e?s-++r:r++];if(!1===t(n[1],n[0],this))break}return r}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var i=this._cache;if(i){var s=i.length,r=0;return new U((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}(D),J=function(t){function e(t){return null==t?nt().toKeyedSeq():S(t)?b(t)?t.toSeq():t.fromEntrySeq():P(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():P(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)&&!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}(K);K.isSeq=I,K.Keyed=J,K.Set=tt,K.Indexed=Q,K.prototype[k]=!0;var et=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var i=this._array,s=i.length,r=0;r!==s;){var n=e?s-++r:r++;if(!1===t(i[n],n,this))break}return r},e.prototype.__iterator=function(t,e){var i=this._array,s=i.length,r=0;return new U((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 j.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 U((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=X(this._collection),s=0;if(q(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=X(this._collection);if(!q(i))return new U(W);var s=0;return new U((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 Z(t)?new et(t):Y(t)?new rt(t):void 0}var lt="@@__IMMUTABLE_MAP__@@";function ut(t){return Boolean(t&&t[lt])}function ct(t){return ut(t)&&F(t)}function dt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ft(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(dt(t)&&dt(e)&&t.equals(e))}var gt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var i=65535&(t|=0),s=65535&(e|=0);return i*s+((t>>>16)*s+i*(e>>>16)<<16>>>0)|0};function mt(t){return t>>>1&1073741824|3221225471&t}var pt=Object.prototype.valueOf;function yt(t){if(null==t)return xt(t);if("function"==typeof t.hashCode)return mt(t.hashCode(t));var e,i,s,r=(e=t).valueOf!==pt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return xt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return mt(e)}(r);case"string":return r.length>Bt?(void 0===(s=Ct[i=r])&&(s=St(i),It===kt&&(It=0,Ct={}),It++,Ct[i]=s),s):St(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[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(),wt)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=Dt[t];return void 0!==e||(e=Mt(),Dt[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===O||t.done?t:H(e,a-1,e===_?void 0:t.value[1],t)}))},l}function Gt(t,e,i,s){var r=Zt(t);return r.__iterateUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterate(r,n);var h=!0,a=0;return t.__iterate((function(t,n,l){if(!h||!(h=e.call(i,t,n,l)))return a++,r(t,s?n:a-1,o)})),a},r.__iteratorUncached=function(r,n){var o=this;if(n)return this.cacheResult().__iterator(r,n);var h=t.__iterator(z,n),a=!0,l=0;return new U((function(){var t,n,u;do{if((t=h.next()).done)return s||r===O?t:H(r,l++,r===_?void 0:t.value[1],t);var c=t.value;n=c[0],u=c[1],a&&(a=e.call(i,u,n,o))}while(a);return r===z?t:H(r,n,u,t)}))},r}function Ut(t,e,i){var s=Zt(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 qt(t,e,i,s){var r=Zt(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=D(t),X(r?t.reverse():t)})),o=0,h=!1;return new U((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 Xt(t,e){return t===e?t:I(t)?e:t.constructor(e)}function $t(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function jt(t){return b(t)?T:A(t)?E:B}function Zt(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 ke(t,e)}function De(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return ke(e,i,t)}function Te(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return Be(t,e)}function Ee(t,e){for(var i=[],s=arguments.length-2;s-- >0;)i[s]=arguments[s+2];return Be(e,i,t)}function Be(t,e,i){return ke(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))?ke(i,[s],e):t?t(i,s,r):s;var n,o,h}}(i))}function ke(t,e,i){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(L(t))return"function"==typeof i&&t.mergeWith?t.mergeWith.apply(t,[i].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var s=Array.isArray(t),r=t,n=s?E:T,o=s?function(e){r===t&&(r=le(r)),r.push(e)}:function(e,s){var n=j.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 Be(this,e,t)}function Pe(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ze(),(function(t){return ke(t,e)}))}function Le(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return de(this,t,Ze(),(function(t){return Be(t,e)}))}function Re(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Fe(){return this.__ownerID?this:this.__ensureOwner(new l)}function _e(){return this.__ensureOwner()}function Oe(){return this.__altered}var ze=function(t){function e(e){return null==e?Ze():ut(e)&&!F(e)?e:Ze().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 Ze().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=D(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):Ze()},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 qe(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?je(this.size,this._root,t,this.__hash):0===this.size?Ze():(this.__ownerID=t,this.__altered=!1,this)},e}(T);ze.isMap=ut;var Ve=ze.prototype;Ve[lt]=!0,Ve[s]=Ve.remove,Ve.removeAll=Ve.deleteAll,Ve.setIn=me,Ve.removeIn=Ve.deleteIn=ye,Ve.update=Se,Ve.updateIn=ve,Ve.merge=Ve.concat=be,Ve.mergeWith=Me,Ve.mergeDeep=Ie,Ve.mergeDeepWith=Ce,Ve.mergeIn=Pe,Ve.mergeDeepIn=Le,Ve.withMutations=Re,Ve.wasAltered=Oe,Ve.asImmutable=_e,Ve["@@transducer/init"]=Ve.asMutable=Fe,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,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)},Ge.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 Ue(t,o+1,h)}(t,p,f,c,x);if(g&&!x&&2===p.length&&Qe(p[1^m]))return p[1^m];if(g&&x&&1===p.length&&Qe(x))return x;var S=t&&t===this.ownerID,v=g?x?f:f^d:f|d,b=g?x?ii(p,m,x,S):function(t,e,i){var s=t.length-1;if(i&&e===s)return t.pop(),t;for(var r=new Array(s),n=0,o=0;o>>t)&o,h=this.nodes[n];return h?h.get(t+r,e,i,s):s},Ue.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 m=this.count;if(f){if(!g&&--m>>i)&o,l=(0===i?s:s>>>i)&o,u=a===l?[ti(t,e,i+r,s,n)]:(h=new 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=mi();if(null==e)return i;if(hi(e))return e;var s=t(e),o=s.size;return 0===o?i:(ee(o),o>0&&o=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?Si(t,e).set(0,i):Si(t,0,e+1).set(e,i)}));e+=t._origin;var s=t._tail,r=t._root,n={value:!1};return e>=vi(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):mi()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(i){Si(i,0,e+t.length);for(var s=0;s>>e&o;if(s>=this.array.length)return new ui([],t);var n,h=0===s;if(e>0){var a=this.array[s];if((n=a&&a.removeBefore(t,e-r,i))===a&&h)return this}if(h&&!n)return this;var l=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=pi(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),m=vi(u);m>=1<g?new ui([],s):p;if(p&&m>g&&ar;S-=r){var v=g>>>S&o;x=x.array[v]=yi(x.array[v],s)}x.array[g>>>r&o]=p}if(u=m)a-=m,u-=m,c=r,d=null,y=y&&y.removeBefore(s,0,a);else if(a>n||m>>c&o;if(b!==m>>>c&o)break;b&&(f+=(1<n&&(d=d.removeBefore(s,c,a-f)),d&&m>>r<=n&&a.size>=2*o.size?(s=(r=a.filter((function(t,e){return void 0!==t&&l!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(s.__ownerID=r.__ownerID=t.__ownerID)):(s=o.remove(e),r=l===a.size-1?a.pop():a.set(l,void 0))}else if(u){if(i===a.get(l)[1])return t;s=o,r=a.set(l,[e,i])}else s=o.set(e,a.size),r=a.set(a.size,[e,i]);return t.__ownerID?(t.size=s.size,t._map=s,t._list=r,t.__hash=void 0,t.__altered=!0,t):Ai(s,r)}Mi.isOrderedMap=ct,Mi.prototype[R]=!0,Mi.prototype[s]=Mi.prototype.remove;var Ti="@@__IMMUTABLE_STACK__@@";function Ei(t){return Boolean(t&&t[Ti])}var Bi=function(t){function e(t){return null==t?Pi():Ei(t)?t:Pi().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):Ci(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):Ci(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):Pi()},e.prototype.slice=function(e,i){if(f(e,i,this.size))return this;var s=g(e,this.size);if(m(i,this.size)!==this.size)return t.prototype.slice.call(this,e,i);for(var r=this.size-s,n=this._head;s--;)n=n.next;return this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ci(r,n)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ci(this.size,this._head,t,this.__hash):0===this.size?Pi():(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 U((function(){if(s){var e=s.value;return s=s.next,H(t,i++,e)}return{value:void 0,done:!0}}))},e}(E);Bi.isStack=Ei;var ki,Ii=Bi.prototype;function Ci(t,e,i,s){var r=Object.create(Ii);return r.size=t,r._head=e,r.__ownerID=i,r.__hash=s,r.__altered=!1,r}function Pi(){return ki||(ki=Ci(0))}Ii[Ti]=!0,Ii.shift=Ii.pop,Ii.unshift=Ii.push,Ii.unshiftAll=Ii.pushAll,Ii.withMutations=Re,Ii.wasAltered=Oe,Ii.asImmutable=_e,Ii["@@transducer/init"]=Ii.asMutable=Fe,Ii["@@transducer/step"]=function(t,e){return t.unshift(e)},Ii["@@transducer/result"]=function(t){return t.asImmutable()};var Li="@@__IMMUTABLE_SET__@@";function Ri(t){return Boolean(t&&t[Li])}function Fi(t){return Ri(t)&&F(t)}function _i(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)||F(t)!==F(e))return!1;if(0===t.size&&0===e.size)return!0;var i=!w(t);if(F(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 zi(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]=zi(t)})),e}var i=[];return t.__iterate((function(t){i.push(zi(t))})),i}var Vi=function(t){function e(e){return null==e?Wi():Ri(e)&&!F(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(T(t).keySeq())},e.intersect=function(t){return(t=D(t).toArray()).length?Gi.intersect.apply(e(t.pop()),t):Wi()},e.union=function(t){return(t=D(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 Ui(this,this._map.set(t,t))},e.prototype.remove=function(t){return Ui(this,this._map.remove(t))},e.prototype.clear=function(){return Ui(this,this._map.clear())},e.prototype.map=function(t,e){var i=this,s=!1,r=Ui(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=mt((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=D.prototype;Ki[x]=!0,Ki[G]=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,Oi(T,{flip:function(){return Xt(this,_t(this))},mapEntries:function(t,e){var i=this,s=0;return Xt(this,this.toSeq().map((function(r,n){return t.call(e,[n,r],s++,i)})).fromEntrySeq())},mapKeys:function(t,e){var i=this;return Xt(this,this.toSeq().flip().map((function(s,r){return t.call(e,s,r,i)})).flip())}});var Ji=T.prototype;Ji[v]=!0,Ji[G]=Ki.entries,Ji.toJSON=Zi,Ji.__toStringMapper=function(t,e){return oe(e)+": "+oe(t)},Oi(E,{toKeyedSeq:function(){return new Pt(this,!1)},filter:function(t,e){return Xt(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 Xt(this,zt(this,!1))},slice:function(t,e){return Xt(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 Xt(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 Xt(this,Ut(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,Oi(J,Ji),Oi(Q,Qi),Oi(tt,ts);var ls=function(t){function e(t){return null==t?fs():Fi(t)?t:fs().withMutations((function(e){var i=B(t);ee(i.size),i.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(T(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Vi);ls.isOrderedSet=Fi;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[R]=!0,cs.zip=Qi.zip,cs.zipWith=Qi.zipWith,cs.zipAll=Qi.zipAll,cs.__empty=fs,cs.__make=ds;var gs=function(t,e){var i;!function(t){if(P(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(L(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var s=function(n){var o=this;if(n instanceof s)return n;if(!(this instanceof s))return new s(n);if(!i){i=!0;var h=Object.keys(t),a=r._indices={};r._name=e,r._keys=h,r._defaultValues=t;for(var l=0;l2?[]:void 0,{"":t})}function As(t,e,i,s,r,n){if("string"!=typeof i&&!L(i)&&(Z(i)||Y(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 As(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.2.4",Ts=D;const Es={version:Ds,Collection:D,Iterable:D,Seq:K,Map:ze,OrderedMap:Mi,List:ai,Stack:Bi,Set:Vi,OrderedSet:ls,Record:gs,Range:qi,Repeat:bs,is:ft,fromJS:Ms,hash:yt,isImmutable:L,isCollection:S,isKeyed:b,isIndexed:A,isAssociative:w,isOrdered:F,isValueObject:dt,isPlainObject:re,isSeq:I,isList:hi,isMap:ut,isOrderedMap:ct,isStack:Ei,isSet:Ri,isOrderedSet:Fi,isRecord:P,get:ae,getIn:Xi,has:he,hasIn:ji,merge:we,mergeDeep:Te,mergeWith:De,mergeDeepWith:Ee,remove:ue,removeIn:pe,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]},m=(t,e)=>({min:t,max:e}),p=(t,e,i,s)=>({x:Math.ceil(t),y:Math.ceil(e),width:Math.ceil(i),height:Math.ceil(s)}),y=(t,e=!0)=>new l(t,e),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}),w=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}`)}},D=(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})},T={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({}),B=A(0,0,0,0),k=(t,e)=>t.value-e.value,I=s.Record({steps:[],title:"",units:"",interpolate:!0,color:A(0,0,0,255),length:0,min:0,max:0,subranges:[],isValid:!1}),C=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 P extends I{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,C(t)))}toString(){return`LUT:interpolate=${this.interpolate},steps=${this.steps.map((t=>`${t.value},${t.color.toString()}`)).join(",")}`}setSteps(t){return this.merge(C({...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({});class R extends L{constructor(){super(...arguments),this.type="fillstyle"}toString(){return"emptyFill"}}const F=new R,_=s.Record({color:A(255,255,255)});class O extends _{constructor(){super(...arguments),this.type="fillstyle"}}class z extends O{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 V extends O{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 N=s.Record({lut:new P({steps:[]}),lookUpProperty:"value"});class G extends N{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 U={linear:(t,e,i)=>{const s=e-t;return r=>rs=>ss=>ss=>s{const e=Jt(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)))}L(){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(St):this.values.map(St)}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.L(),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=gt.requestAnimationFrame(o):(s=void 0,r=void 0)};return(t=1e3,e=U.linear)=>(r,n,h=t)=>{const a=new H(r,n,h,e,i).start();return s||(s=gt.requestAnimationFrame(o)),a}};var Y,q;e.GradientShape=void 0,(Y=e.GradientShape||(e.GradientShape={})).circle="circle",Y.ellipse="ellipse",e.GradientExtent=void 0,(q=e.GradientExtent||(e.GradientExtent={})).closestSide="closest-side",q.closestCorner="closest-corner",q.farthestSide="farthest-side",q.farthestCorner="farthest-corner";const X=s.Record({stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],position:u(.5,.5),shape:e.GradientShape.ellipse,extent:e.GradientExtent.farthestCorner});class $ extends X{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 j=s.Record({stops:[{color:w("#f00"),offset:0},{color:w("#0f0"),offset:1}],angle:0});class Z extends j{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?oi(t):t)}getAngle(t){return t?ni(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}O(){return 0}setFillStyle(t){return this}getFillStyle(){return F}},Q=s.Record({fillStyle:new z({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")}O(){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(Ie,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(Ie,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}H(t){return this.P.on("cell-resize",t)}W(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!==Mt(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.ut(t)),nt=(t,e,i)=>{if(e===i)return t;const s=e instanceof Di?e.x:e.x instanceof Di?e.x.x:e.x.ct,r=e instanceof Di?e.y:e.y instanceof Di?e.y.y:e.y.ct,n=i instanceof Di?i.x:i.x instanceof Di?i.x.x:i.x.ct,o=i instanceof Di?i.y:i.y instanceof Di?i.y.y:i.y.ct;return{...t,x:rt(t.x,s,n),y:rt(t.y,r,o)}},ot=(...t)=>{if(0===t.length)return{remove:bt};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 extends Error{constructor(t,e){super(`ChartError: ${t} ${e?`in ${e.constructor.name}`:""}`),Object.setPrototypeOf(this,ht.prototype)}}class at extends Error{constructor(t,e,i=!1){const s=`EngineError: ${t} ${e?`in ${e.constructor.name}`:""}`;super(s),i&>.alert(s),Object.setPrototypeOf(this,at.prototype)}}class lt extends at{constructor(t){super(t),Object.setPrototypeOf(this,lt.prototype)}}var ut,ct,dt,ft;e.UISpace=void 0,(ut=e.UISpace||(e.UISpace={}))[ut.Content=0]="Content",ut[ut.PaddedContent=1]="PaddedContent",ut[ut.PaddedBackground=2]="PaddedBackground",ut[ut.Everything=3]="Everything",e.UIVisibilityModes=void 0,(ct=e.UIVisibilityModes||(e.UIVisibilityModes={}))[ct.never=0]="never",ct[ct.always=1]="always",ct[ct.whenHovered=2]="whenHovered",ct[ct.whenDragged=3]="whenDragged",ct[ct.whenNotDragged=4]="whenNotDragged",ct[ct.whenHoveredOrDragged=5]="whenHoveredOrDragged",e.UIDraggingModes=void 0,(dt=e.UIDraggingModes||(e.UIDraggingModes={}))[dt.notDraggable=0]="notDraggable",dt[dt.draggable=1]="draggable",dt[dt.onlyHorizontal=2]="onlyHorizontal",dt[dt.onlyVertical=3]="onlyVertical",e.UIDirections=void 0,(ft=e.UIDirections||(e.UIDirections={}))[ft.Up=0]="Up",ft[ft.Right=1]="Right",ft[ft.Down=2]="Down",ft[ft.Left=3]="Left";const gt="undefined"!=typeof window?window:void 0!==i.g&&i.g._lcjs?i.g._lcjs:{},mt=(t,e)=>t.x===e.x&&t.y===e.y,pt=t=>t!==Me&&t!==Ae&&!Number.isNaN(t)&&Number.isFinite(t)&&t!==1/0&&t!==-1/0,yt=(t,e)=>Math.min(t,e.y),xt=(t,e)=>Math.max(t,e.y),St=t=>t[1],vt=t=>t.dispose(),bt=()=>{},Mt=(t,e)=>t===e,At=(t,e,i)=>i>e?Math.min(Math.max(t,e),i):Math.min(Math.max(t,i),e),wt=t=>Array.prototype.concat.apply([],t),Dt=(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)]},Et=(t,e)=>{for(;e;)t.push(t.shift()),e-=1},Bt=t=>{const e=[];for(const i of t)e.push(i.slice());return e},kt=(t,e)=>void 0!==t?t:e,It=t=>t.ft(),Ct=t=>t.yt(),Pt=t=>t.St(),Lt=t=>t.xt(),Rt=t=>t.min.x,Ft=t=>t.max.x,_t=t=>t.min.y,Ot=t=>t.max.y,zt=(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,Nt=u(0,1),Gt=u(1,0),Ut=u(0,-1),Ht=u(-1,0),Wt=u(0,0),Yt=t=>{switch(t){case e.UIDirections.Up:return Nt;case e.UIDirections.Right:return Gt;case e.UIDirections.Down:return Ut;case e.UIDirections.Left:return Ht;default:return Wt}},qt=t=>t===e.UIDirections.Left||t===e.UIDirections.Right,Xt=t=>{t.stopPropagation(),t.preventDefault()},$t=(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)},Kt=t=>{let e=t.length;for(let i=0;i{const e=Math.log(t);return t=>Math.log(t)/e},Qt=Jt(Math.E),te=(t,e)=>{const i=e[t];return i?i():void 0},ee=(t,e)=>{let i;if(e)i=e;else{const e={x:0,y:0};for(let i=0;ihi(Je(t,i))-hi(Je(e,i))))},ie=(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())),re=t=>255===t.getA()?t:t.setA(255),ne=(()=>{const t=A(0,0,0);return i=>(i=re(i),new $({shape:e.GradientShape.circle,extent:e.GradientExtent.farthestCorner,position:{x:.2,y:.8},stops:[{offset:0,color:i},{offset:1,color:se(i,t,.5)}]}))})(),oe=(()=>{const t=t=>{var e;if(t){if(t instanceof z){if(0===t.getColor().getA())return;return t.getColor()}if(t instanceof $||t instanceof Z){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()?ne(o):(o=re(o),h=re(h),new Z({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?ne(e):i.uiButtonFillStyle}var o,h;e.setButtonOffFillStyle(new z({color:A(255,255,255,0)})).setButtonOffStrokeStyle(i.uiButtonStrokeStyle).setButtonOnFillStyle(n).setButtonOnStrokeStyle(J)}})(),he=t=>{const e=t;if(e instanceof G)return{lut:e.getPalette(),lookUpProperty:e.getLookUpProperty()}},ae=t=>{let e=0;return()=>(e+=1,`${t}-${e}`)},le=(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,ce=t=>t.ctrlKey?Math.sign(t.deltaY)*Math.min(.05*Math.abs(t.deltaY),1):Math.sign(t.deltaY),de=(t,e)=>e(),fe=()=>new Error("LightningChart JS encountered an unexpected error.\nPlease report this issue to support@lightningchart.com or Stack Overflow with tag [lightningchart]");new z({color:A(255,255,255,1)});const ge=t=>t===we||t.min.x===we.min.x&&t.max.x===we.max.x&&t.min.y===we.min.y&&t.max.y===we.max.y,me=t=>"boolean"==typeof t?t?1:0:t>1?1:t<0?0:t,pe=(t,e)=>{throw new Error(e)},ye=()=>{const t=W((()=>{}));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)||U.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)}},xe=t=>{let e;return()=>e||(e=t(),e)},Se=t=>{if(t===J)return 0;const e=t.getThickness();return e<0?1:1*e},ve=(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 gt.alert(r),new Error(r);gt.console.warn(r)},be={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=>be.divide(t,be.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(be.dot(t,e)/(be.length(t)*be.length(e))),rotateAroundAxis(t,e,i){const s=Math.cos(i),r=Math.sin(i),n=be.dot(e,t),o=be.cross(e,t);return be.addVec(be.multiply(t,s),be.addVec(be.multiply(e,(1-s)*n),be.multiply(o,r)))},lerp:(t,e,i)=>(i=At(i,0,1),be.addVec(be.multiply(t,1-i),be.multiply(e,i))),equals:(t,e)=>Mt(t.x,e.x)&&Mt(t.y,e.y)&&Mt(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)})},Me=Number.MAX_SAFE_INTEGER,Ae=-Number.MAX_SAFE_INTEGER,we=m(u(Me,Me),u(Ae,Ae)),De=m(f(Me,Me,Me),f(Ae,Ae,Ae)),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))},Ee=(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),ke=(t,e)=>m(u(Math.max(Math.min(t[0].x,t[2].x),Math.min(e[0].x,e[2].x)),Math.max(Math.min(t[0].y,t[2].y),Math.min(e[0].y,e[2].y))),u(Math.min(Math.max(t[0].x,t[2].x),Math.max(e[0].x,e[2].x)),Math.min(Math.max(t[0].y,t[2].y),Math.max(e[0].y,e[2].y)))),Ie=(t,e)=>e+t,Ce=(t,e,i)=>{const s=Je(e,t),r=s.x*s.x+s.y*s.y;if(0===r)return t;const n=Je(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)},Pe=(t,e,i)=>i>e?t>=e&&t<=i:t>=i&&t<=e,Le=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)},Re=(t,e)=>{const i=t.x-e.x,s=t.y-e.y;return i*i+s*s},Fe=(t,e,i)=>{const s=Re(e,i);if(0===s)return[Re(t,e),e];let r=ii(Je(t,e),Je(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[Re(t,n),n]},_e=(t,e,i)=>Ke(t,Ze(Je(e,t),i)),Oe=(t,e,i)=>be.addVec(t,be.multiply(be.subtractVec(e,t),i));function ze(t){const e=t.length;if(e>0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y;for(let o=0;oi&&(i=e.x),e.xr&&(r=e.y),e.y0){let i=t[0].x,s=t[0].x,r=t[0].y,n=t[0].y,o=t[0].z,h=t[0].z;for(let a=0;ai&&(i=e.x),e.xr&&(r=e.y),e.yo&&(o=e.z),e.zm(u(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y)),Ge=(t,e)=>m(f(t.min.xe.max.x?t.max.x:e.max.x,t.max.y>e.max.y?t.max.y:e.max.y,t.max.z>e.max.z?t.max.z:e.max.z));function 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 He=(t,e,i,s)=>u((t.x+e.x+i.x+s.x)/4,(t.y+e.y+i.y+s.y)/4),We=(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)},ri=(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 ni(t){return t*Math.PI/180}function oi(t){return 180*t/Math.PI}function hi(t){return 180*Math.atan2(t.y,t.x)/Math.PI}function ai(t){return u(Math.cos(t),Math.sin(t))}function li(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 ui=(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)},ci=(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 di{constructor(){this.bt=!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.bt=!1,this}j(){return this.bt=!0,this}}class fi extends di{constructor(t,e,i,s){if(super(),this.vt=!0,this.Mt=!0,this._t=[0,0],this.At=!0,this.wt=t,this.kt=e,this.Ct=i,this.Tt=t,this.It=e,s){const t=s.R(this.Ft.bind(this));this.Ft(s.M()),this.Pt=()=>s.N(t)}}q(t){return this.Y=t,this.Mt=!0,this}Dt(t){return this._t=t.map(Math.abs),this.At=!0,this}Bt(){return this.wt/this.Ct*this.Y+this._t[0]}Lt(){return(this.wt+this.kt)/this.Ct*this.Y-this._t[1]}Ot(){return this.getCellSize()-this.Rt()}Et(){return this.Y}getCellSize(){return this.zt(this.Y)}Rt(){return this._t[0]+this._t[1]}Vt(){return this._t}Ft(t){this.Ct=t.reduce(Ie,0),this.wt=t.reduce(((t,e,i)=>i>=this.Tt?t:t+e),0),this.kt=t.reduce(((t,e,i)=>i>=this.Tt&&ixi;return!n&&!o||!!r&&(e>t?{start:n?yi:t,end:o?xi:e}:{start:o?xi:t,end:n?yi:e})}ut(t){const e=this.Bt(),i=this.Lt(),s=Math.max(t,yi);return e+(this.Gt.function(s)-this.Ht.scaleStartLog)/this.Ht.scaleIntervalLog*(i-e)}ot(t){const e=this.Bt(),i=(t-e)/(this.Lt()-e),s=this.Ht.scaleStartLog+i*this.Ht.scaleIntervalLog;return this.Gt.number**s}Nt(){this.Gt&&this.Wt()}Z(t,e){return super.Z(t,e),this.Gt&&this.Wt(),this}Dt(t){return super.Dt(t),this.Gt&&this.Wt(),this}q(t){return super.q(t),this.Gt&&this.Wt(),this}Ut(t){return this.Gt={internal:t,function:mi(t),number:pi(t)},this}$t(){return this.Gt.internal}Yt(t,e){const i=this.ut(t)+e;return this.ot(i)}get Xt(){return this.Mt||this.bt||this.At||this.vt}Wt(){const t=this.Gt.function(this.U),e=this.Gt.function(this.$)-t,i=2*this.Bt()/this.Y-1,s=2*this.Lt()/this.Y-1-i;return this.Ht={scaleStartLog:t,scaleIntervalLog:e,viewportStart:i,viewportSize:s},this.Ht}jt(){return this.Ht}}const mi=t=>"e"===t?Qt:Jt(t),pi=t=>"e"===t?Math.E:t,yi=.9*1e-9,xi=1.1*10**32,Si=["K","M","B","T"],vi=(t,e,i)=>{const s=Math.abs(i-e),r=Math.max(2-Te(s,10),0);return t.toFixed(r)},bi={Numeric:(t,e)=>vi(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,Si.length)-1;h=Si[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}},Mi=(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 Ai extends fi{constructor(t,e,i,s){super(t,e,i,s),this.Zt=!1,this.Xt=!1,this.Kt=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.Zt){const i=((t,e,i)=>{const s=((t,e)=>{if(eAe&&tAe){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}}Nt(){this.K()}ut(t){return this.Bt()+(t-this.U)/(this.$-this.U)*(this.Lt()-this.Bt())}ot(t){return this.U+(t-this.Bt())/(this.Lt()-this.Bt())*(this.$-this.U)}Z(t,e){return super.Z(t,e),this.K(),this}Dt(t){return super.Dt(t),this.K(),this}q(t){return super.q(t),this.qt=wi(this.$-this.U,this._t,this.Y,this.kt,this.Ct),this.K(),this}Jt(){return this.Zt=!0,this}Qt(){return this.Zt}ti(){return Math.abs(this.ii)}si(){return this.ti()/this.qt}ei(){return this.hi}ri(){return this.ni}getPixelSize(){return this.qt}jt(){return this.Ht}j(){return super.j(),this.Xt=!0,this}X(){return super.X(),this.Xt=!1,this}oi(t,e=bi.Numeric){return e(t,this)}ai(){const t=Math.abs(this.getInnerEnd()).toString().length,e=Math.abs(this.getInnerStart()).toString().length;return t>e?t:e}li(t){return wi(t,this._t,this.Y,this.kt,this.Ct)}K(){let t=this.U,e=this.$,i=0;this.Zt&&(t=0,e=this.$-this.U,i=this.U);const s=e-t,r=wi(s,this._t,this.Y,this.kt,this.Ct);this.ni=t-this._t[0]*r,this.hi=e+this._t[1]*r;const n=this.hi-this.ni,o=n-this.ii,h=Math.abs(o/r),a=s-this.Kt,l=Math.abs(a/r);(!this.Ht||h>=.4||l>=.4)&&(this.Kt=s,this.ii=n,this.qt=r,this.Xt=!0);const u=this.ii*this.Ct/(2*this.kt),c=-(this.ni-this.ii*this.wt/this.kt)-u,d=2*this.Bt()/this.Y-1,f=2*this.Lt()/this.Y-1-d;this.Ht={displacement:c,scaling:u,highPrecisionOffset:i,viewportStart:d,viewportSize:f,scaleStartLog:0,scaleIntervalLog:0}}Yt(t,e){return t+this.qt*e}}const wi=(t,e,i,s=1,r=1)=>t/(i*s/r-(e[0]+e[1]));class Di{ui(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}Et(){return u(this.x.Et(),this.y.Et())}ci(t){return this.x.Dt(t),this}di(t){return this.y.Dt(t),this}Rt(){return u(this.x.Rt(),this.y.Rt())}fi(t,e){return this.x.Z(t,e),this}gi(t,e){return this.y.Z(t,e),this}getInnerIntervalPixels(){const t=this.x.getCellSize(),e=this.y.getCellSize();return{x:t-this.x.Rt(),y:e-this.y.Rt()}}pi(){return this.x.Xt||this.y.Xt}}class Ti extends Di{constructor(){super(...arguments),this.mi="LinearScaleXY"}nt(t,e,i,s){return this.x=new Ai(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ai(t.y,e.y,i.y,s?s.y:void 0),this}Qt(){return this.x.Qt()||this.y.Qt()}yi(){return u(this.x.getPixelSize(),this.y.getPixelSize())}jt(){return{x:this.x.jt(),y:this.y.jt()}}Yt(t,e){const i=this.yi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Si(t,e,i,s){const r=this.yi(),n=$e(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 Ei extends Di{constructor(){super(...arguments),this.mi="MixedScaleXY"}Qt(){return!1}Yt(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)}}Si(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=Xe(Je(n,r)),h=$e(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)}}jt(){const t=this.x.jt(),e=this.y.jt();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 Bi={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?Bi.progressive.end(t,e,i,s)+(t-e):s>t?s:t,end:(t,e,i,s)=>e>t?s>e?s:e:Bi.progressive.start(t,e,i,s)+(e-t)},regressive:{start:(t,e,i,s)=>e>t?ie>t?Bi.regressive.start(t,e,i,s)+(e-t):ivoid 0!==t.xi,Ci=t=>void 0!==t.bi,Pi={vi:bi.Numeric},Li=(t,e)=>[t,e],Ri=(t,e,i,s)=>{const r=[],n=Math.round(Math.abs((t-e)/i));for(let o=1;o{Mt(t,0)&&(t=0),Mt(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},Oi=(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)}},zi=(t,e)=>{if(e.has(t))return e.get(t);const i=ze(t._i.Mi());return e.set(t,i),i},Vi=t=>{const e=new Map;if(t!==Pi){for(const i of t.Ai)e.set(i,new Map);for(const i of t.wi)e.set(i,new Map)}return e};class Ni{constructor(t,e,i,s,n,o,h){this.P=new r.Eventer,this.ki=Pi,this.Ci=ki.Empty,this.Ti=new Map,this.Ii=new Map,this.Fi=Bi.fitting,this.Pi=!0,this.Di=W((()=>this.chart.Li.Bi()))(300,U.linear),this.Oi=!0,this.Ri=!0,this.Ei=!1,this.zi=Ae,this.Vi=!1,this.Ni=!1,this.Gi=Ae,this.Hi=Ae,this.Wi=Ae,this.Ui={},this.$i=(t,e,i,s,r,n)=>{const o=[],h=[];for(const a of t){if(as){o.push(a);continue}const t=this.Ti.get(e),l=(t?t.get(a):void 0)||this.Yi(a,e);l.Xi=!1;const u=this.ji(l,r);n.set(l,u),o.push(a),h.push(l)}return{displayedKeyValues:o,createdTicks:h}},this.Zi=(t,e,i,s,r,n,o,h,a,l,u)=>{const c=[];for(let d=0;dvoid 0!==t)).filter((e=>e.qi!==i||!!t.find((t=>t===e)))).map((t=>Ee(e,zi(t,a))?t:void 0)),m=y.some((t=>void 0!==t))}else m=!1;if(m){let t=!0;const e=y.filter((t=>void 0!==t));if(t&&i.Ji&&e.every((t=>Ii(t.qi)))&&(t=!1),t&&i.Ji&&i.Ji.Qi&&!1===i.Ji.Qi(g,s,r,n,o,h)&&(t=!1),!1===t)continue;return!0}c.push(f)}return c},this.formatValue=t=>this.ki.vi(t,this.ct),this.ts=([t,e])=>{this.ss(t,e)},this.chart=t,this.es=e,this.hs=s,this.rs=o,this.ct=i,this.ns=h,"logarithmic"===h.type&&this.setAnimationZoom(U.logarithmic(pi(h.base))),this.os=o.numeric,this.setTickStrategy("Numeric"),this.ls=i.getInnerStart(),this.us=i.getInnerEnd(),n&&this.setAnimationsEnabled(!1)}getTitle(){return this.ds.cs()}setTitle(t){return this.ds.fs(t),this.chart.Li.Bi(),this}getTitleFillStyle(){return this.ds.gs()}setTitleFillStyle(t){return this.ds.ps(t),this.chart.Li.Bi(),this}getTitleFont(){return this.ds.ys()}setTitleFont(t){return this.ds.Ss(t),this.chart.Li.Bi(),this}setTitleRotation(t){return this.ds.xs(t),this.chart.Li.Bi(),this}getTitleRotation(){return this.ds.bs()}setTitleEffect(t){return this.Ms.vs(t),this.chart.Li.Bi(),this}getTitleEffect(){return this.Ms._s()}setTickStrategy(t,e){if(this.As(),"Empty"===t)this.ki=Pi,this.Ci=t;else if("Numeric"===t){"Numeric"!==this.Ci&&(this.os=this.rs.numeric);const i=e||(t=>t);this.os=i(this.os),this.ki=this.os.ws(this.ns),this.Ci=t}else if("DateTime"===t){"DateTime"!==this.Ci&&(this.os=this.rs.datetime);const i=e||(t=>t);this.os=i(this.os),this.ki=this.os.ws(this.ns),this.Ci=t}else if("Time"===t){"Time"!==this.Ci&&(this.os=this.rs.time);const i=e||(t=>t);this.os=i(this.os),this.ki=this.os.ws(this.ns),this.Ci=t}return this.Ii.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ii=Vi(this.ki),this.chart.Li.Bi(),this}getTickStrategy(){return this.Ci}ks(){return this.ki}Cs(t){this.ki=t,this.Ii.forEach((t=>Array.from(t.values()).forEach((t=>t.dispose())))),this.Ii=Vi(this.ki),this.chart.Li.Bi()}setInterval(t){const{start:e,end:i,animate:s,stopAxisAfter:r}=t;return this.dt(void 0!==e?e:this.ls,void 0!==i?i:this.us,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.us-this.ls),void 0!==this.ki.Ts&&this.ki.Ts>o){const i=(e+t)/2,s=this.ki.Ts/2*(t>e?-1:1);n={start:i-s,end:i+s}}if(void 0!==this.ki.Is&&this.ki.Ise?-1:1);n={start:i-s,end:i+s}}const h=this.ct.rt(n.start,n.end,this.ls,this.us,!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 pe(0,""),this}if(this.Fs&&this.Fs.finishAll(!1),this.Di&&(!0===i||i>0)){this.setStopped(!0);const t=!0===i?void 0:i,e=!this.Fs||this.Fs.isOver()?this.Di:this.Fs.NextAnimation.bind(this);this.Fs=e([[this.ls,n.start],[this.us,n.end]],this.ts,t),this.Fs.onAnimationEnd((()=>{this.Fs=void 0,a&&(this.Wi=gt.performance.now())})),this.Fs.onAnimationEnd((()=>this.setStopped(s)))}else this.ss(n.start,n.end),s&&this.setStopped(!0),a&&(this.Wi=gt.performance.now());return this}getInterval(){return{start:this.ls,end:this.us}}setStopped(t){return t===this.Ei||(t&&(this.Fs&&this.Fs.finishAll(!1),this.Fs=void 0),this.Ei=t,this.P.emit("stoppedStateChanged",this,this.Ei),this.zi=gt.performance.now(),this.chart.Li.Bi()),this}getStopped(){return this.Ei}onStoppedStateChanged(t){return this.P.on("stoppedStateChanged",t)}offStoppedStateChanged(t){return this.P.off(t,"stoppedStateChanged")}fit(t,e=!1){const i=this.Ps(!1);if(i){const s=this.us>=this.ls,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.Fi=t,this.chart.Li.Bi(),this}getScrollStrategy(){return this.Fi}setAnimationScroll(t){return this.Pi=Boolean(t),this.chart.Li.Bi(),this}setAnimationZoom(t,e=300){return this.Fs&&(this.Fs.finishAll(!1),this.Fs=void 0),this.Di=t?W((()=>this.chart.Li.Bi()))(e,t):void 0,this}setAnimationsEnabled(t){return this.Oi=t,t?(this.setAnimationScroll(!0),this.setAnimationZoom(U.ease,void 0)):(this.setAnimationScroll(void 0),this.setAnimationZoom(void 0)),this}getAnimationsEnabled(){return this.Oi}setVisible(t){const e=this.Ri!==t;return this.Ri=t,this.ds.setVisible(t),this.Ds((e=>{e._i.setVisible(t)})),e&&this.P.emit("visibleStateChanged",this,this.Ri),this}getVisible(){return this.Ri}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")}Bs(t,e){const i=new Map;if(this.ki===Pi)return this.As(),i;e=e||new Map;const s=this.Ls(),r=s.min,n=s.max,o=n-r,h=t.physicalAxisSize;this.Ui.physicalAxisSize=h;const a=Ui(this.ki,r,n,this.ls,this.us,h),l=[];if(this.Os(),l.push(...this.Rs(this.ki,r,n,a,e,t,i)),this.Es(this.ki,r,n,a,e,t,l,i),this.zs(),a)for(const[t,e]of this.Ii){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.Ui.min=r,this.Ui.max=n,this.Ui.scaleInterval=o,this.Ui.physicalAxisSize=h,i}Vs(t){const e=t.qi.Ns;t._i.fs(e(t.u,this.ct)).Gs()}Hs(t,e){const i=e.Ws;t._i.ps(i.getLabelFillStyle()).Ss(i.getLabelFont()).xs(i.getLabelRotation())}Yi(t,e){const i=this.Ii.get(e);let s=i.get(t);s?(i.delete(t),s.qi=e,s.Us(!0)):s=this.$s(t,e);const r=this.Ti.get(e)||new Map;return r.set(t,s),this.Ti.set(e,r),this.Hs(s,e),s}ji(t,e){const i=this.Ys(t,e);return this.Vs(t),i}Rs(t,e,i,s,r,n,o){const h=[];for(const a of t.Ai){const t=s.get(a);for(const s of t){if(si)continue;const t=this.Ti.get(a),l=(t?t.get(s):void 0)||this.Yi(s,a),u=this.ji(l,n),c=zi(l,r);h.find((t=>Ee(c,zi(t,r))))&&l._i.setVisible(!1),l.Xi=!1,o.set(l,u),h.push(l)}}return h}Es(t,e,i,s,r,n,o,h){let a,l=[];for(const u of t.wi){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.Ji){y=!1;break}const t=u.Ji.Xs;if(a=t(a,d-1,n,h,e,i),void 0===a)break}const p=this.Zi(m.filter((t=>a.some((e=>Mt(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,m.forEach((e=>{t.find((t=>t===e))||this.js(e)}))}if(l=p,!y)break}}js(t){const e=this.Ti.get(t.qi);null==e||e.delete(t.u);const i=this.Ii.get(t.qi);i&&i.has(t.u)?t.dispose():i&&(t.Us(!1),i.set(t.u,t))}Ds(t){for(const e of this.Ti.values())for(const i of e.values())t(i)}Zs(t,e){for(const i of this.Ti.values())for(const s of i.values())e=t(e,s);return e}As(){this.Ti.forEach(((t,e)=>{t.forEach((t=>this.js(t)))})),this.Ti.clear()}Os(){for(const t of this.Ti.values())for(const e of t.values())e.Xi=!0}zs(){for(const t of this.Ti.values())for(const[e,i]of t.entries())i.Xi&&(i.dispose(),t.delete(e))}Ls(){const t=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart();return m(t,e)}Ki(t,e){return!(t.Xi||0===t._i.cs().length||Ii(e)&&!0!==e.Ks)}qs(t,e){return this.ki===Pi||(this.ki.Ai.forEach((i=>{e=t(e,i.Ws)})),this.ki.wi.forEach((i=>{(t=>void 0!==t.Ns)(i)&&(e=t(e,i.Ws))}))),e}Ps(t){let e;for(const t of this.Js()){if(!t.Qs())continue;const i=this.es.te(t),s=this.es.ie(t);if(void 0!==i&&pt(i)&&void 0!==s&&pt(s)){if("logarithmic"===this.ns.type){let t;if(Math.sign(i)!==Math.sign(s)&&(t=`Logarithmic series data range must be either > 0 or < 0 (encountered [${i}, ${s}])`),0!==i&&0!==s||(t=`Logarithmic series data range is not defined at 0 (encountered [${i}, ${s}])`),t)throw gt.alert(t),new Error(t)}e?(e.min=Math.min(e.min,i),e.max=Math.max(e.max,s)):e=m(i,s)}}if(e&&pt(e.min)&&pt(e.max)){if(Mt(e.min,e.max)){if(t)return;return{min:e.min-1,max:e.max+1}}return e}}se(){let t=0;for(const e of this.Js()){if(!e.Qs())continue;const i=this.es.ee(e);i&&(t=Math.max(t,i))}return t}he(){const t=this.Js(),e=this.Vi;let i=!1;if(0!==t.length&&this.Fi&&!this.Ei){const t=this.Ps(!0);if(t){const e=this.ls,s=this.us;let r=this.Fi.start(e,s,t.min,t.max),n=this.Fi.end(e,s,t.min,t.max);const o=!1===Mt(e,r),h=!1===Mt(s,n);if(r=o?r:e,n=h?n:s,o||h){let t=!1;if(this.Pi)if(this.Pi){t=!0;const a=o?this.re(e,r):e,l=h?this.re(s,n):s;if(!0===this.ss(a,l,{allowClamping:!1})&&(o&&!1===Mt(a,r)||h&&!1===Mt(l,n))){this.chart.Li.Bi(!0),i=!0;let t=Math.abs(n-r)/Math.abs(a-l);t<1&&(t=1/t),this.Ni=t>=1.4}}else t=!1;t||this.ss(r,n)}}}i?(this.Vi!==i&&(this.Vi=i,this.Gi=gt.performance.now()),this.ne&&(clearTimeout(this.ne),this.ne=void 0)):!0===e&&void 0===this.ne&&(this.Ni=!1,this.ne=setTimeout((()=>{!1!==this.Vi&&(this.Vi=!1,this.Gi=gt.performance.now()),this.ne=void 0,this.chart.Li.Bi()}),200))}ss(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.us-this.ls);if(void 0!==this.ki.Ts&&this.ki.Ts>o){const i=(e+t)/2,o=(s?this.ki.Ts/2:h/2)*(t>e?-1:1);r={start:i-o,end:i+o},n=!1}if(void 0!==this.ki.Is&&this.ki.Ise?-1:1);r={start:i-o,end:i+o},n=!1}let a=this.ct.rt(r.start,r.end,this.ls,this.us,s);if(!1===a)return!1;!0!==a&&(r=a);const l=this.se(),u=this.oe(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.ls,this.us,!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.ls=r.start,this.us=r.end,this.P.emit("scaleChange",this,r.start,r.end),this.Hi=gt.performance.now(),this.chart.Li.Bi(),n)}ae(){return this.Vi}le(){return void 0!==this.Fs}}class Gi{constructor(t,e,i,s,r=i.ue(s).setMouseInteractions(!1)){this.Xi=!1,this.ce=!1,this.de=[],this.qi=t,this.u=e,this.fe=i,this.ge=s,this._i=r,this.de.push(r)}Us(t){this.de.forEach((e=>e.setVisible(t)))}dispose(){return this.ce||(this.ce=!0,this.de.forEach((t=>t.dispose()))),this}}const Ui=(t,e,i,s,r,n)=>{const o=new Map;for(const n of t.Ai){let t=n.pe(e,i,s,r);t=Hi(t),o.set(n,t)}let h;for(const s of t.wi){let t;if(void 0===h)t=s.pe(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.me&&s.me>t)break}for(let t=0;t(t=(t=>{const e={},i=[],s=t.length;let r=0;for(let n=0;nt-e)),Wi=s.Record({size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class Yi extends Wi{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 qi=new Yi,Xi=new class{},$i=s.Record({shape:"sphere",size:10,fillStyle:new z,wireframeStyle:J});class ji extends $i{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 Zi=s.Record({size:5,fillStyle:new z});class Ki extends Zi{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 Ji={Triangulated:ji,Pixelated:Ki};class Qi{constructor(t){this.ye=new Map,this.Li=t}Se(t,e,i){const s=i.animationEnabled;this.ye.set(t,{applyHighlight:e,curUnanimatedHighlightValue:0,curAnimationPositionMillis:0,animationEnabled:s,curAnimatedHighlightValue:0});const r=t.onDispose((()=>{this.ye.delete(t),t.offDispose(r)}))}xe(t,e){const i=this.ye.get(t);i&&(i.curUnanimatedHighlightValue=me(e),this.Li.Bi())}be(t){const e=this.ye.get(t);return e?e.curUnanimatedHighlightValue:0}ve(t,e){const i=this.ye.get(t);i&&(i.animationEnabled=e)}Me(t){const e=this.ye.get(t);return!!e&&e.animationEnabled}Gs(t){let e=!1;this.ye.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.Li.Bi(!0)}}const ts=new Map,es=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=ts.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{size:e,family:i,style:r,variant:n,weight:s}),ts.set(o,h)),h};var is,ss;!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"}(is||(is={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(ss||(ss={}));const rs=t=>({container:t._e,scale:t.ct,setMouseStyle:(e,i)=>t.Ae(e,i),restoreMouseStyle:e=>t.we(e),clientLocation2Engine:(e,i)=>t.ke(e,i),engineLocation2Client:(e,i)=>t.Ce(e,i),captureFrame:(e,i)=>t.Te(e,i),renderFrame:(e,i,s=!1)=>t.Ie(e,i,s),layout:()=>{t.Fe(),t.Pe()},setBackgroundFillStyle(e){return t.setBackgroundFillStyle(e),this},setBackgroundStrokeStyle(e){return t.setBackgroundStrokeStyle(e),this},getBackgroundFillStyle:()=>t.getBackgroundFillStyle(),getBackgroundStrokeStyle:()=>t.getBackgroundStrokeStyle(),addCustomIcon:(e,i)=>t.De(e,i)}),ns=[];let os;const hs=()=>{if(void 0!==os){const t=gt.getComputedStyle(gt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));os.style.height=gt.innerHeight-e+"px",(()=>{for(let t=0;tthis.Bi()),60),this.Oe=u(0,0),this.Re=void 0,this.Ee=()=>{},this.ze=()=>{},this.Ve=[],this.Ne=-1,this.Ge=[],this.He=!0,this.ce=!1,this.Pe=()=>{const{bottom:t,left:e}=this.We().getBoundingClientRect();return this.Oe=u(Math.floor(e),Math.floor(t)),this},this.Fe=()=>{this.Ue&&this.Ue()},this.Ae=(t,e)=>{if(!e){this._e.style.cursor=t;const e=this.Ne;return this.Ne+=1,this.Ge.push([e,t]),e}return this.we(e),this.Ae(t)},this.we=t=>{const e=t?this.Ge.findIndex((e=>e[0]===t)):-1;e>=0?(this.Ge.splice(e,1),this.Ge.length>0?this._e.style.cursor=this.Ge[this.Ge.length-1][1]:this._e.style.cursor="default"):(this.Ge.push([0,"default"]),this._e.style.cursor="default")},this.$e=t=>(this.Ye.S(t),this),this.Xe=()=>this.Ye.M(),this.je=()=>{this.Ee&&this.Ee(),this.Ze(),this.Ke(),this.ze&&this.ze()},this.qe=t=>(this.Be.set(t.Je(),t),this.Be=new Map([...this.Be.entries()].sort(((t,e)=>t[0]-e[0]))),t),this.Qe=t=>(this.Be.delete(t),this),this.X=()=>(this.Ye.o=!1,this),this.j=()=>(this.Ye.o=!0,this),this.th=t=>{if(!this.He)return;const e=this.ih,i=e&&e.clientX===t.clientX&&e.clientY===t.clientY,s=this.ke(t.clientX,t.clientY),r=this.sh(t,{x:t.clientX,y:t.clientY});if(this.eh&&r!==this.eh&&!this.hh){this.eh.rh=!1;const e=this.eh.oh;e&&e(this.eh,t)}if(r&&r.getMouseInteractions()&&!this.hh)if(r.rh){if(!i){const e=r.ah;e&&e(r,t)}}else{r.rh=!0;const e=r.lh;e&&e(r,t)}if(this.hh){const i=this.hh.entity.uh,s=e?u(t.clientX-e.clientX,e.clientY-t.clientY):{x:0,y:0};!i||0===s.x&&0===s.y||i(this.hh.entity,t,this.hh.button,this.hh.startLocation,s)}this.dh=t,this.ih=t,this.fh=s,this.eh=r},this.gh=t=>{if(this.He=!1,this.fh=void 0,this.dh=t,this.ih=void 0,this.hh){const e=this.hh.entity.ph;e&&e(this.hh.entity,t,this.hh.button,this.hh.startLocation),this.hh.entity.rh=!1;const i=this.hh.entity.oh;i&&i(this.hh.entity,t),this.hh=void 0}if(this.mh){const e=this.mh.entity.yh;e&&e(this.mh.entity,t),this.mh=void 0}if(this.eh){this.eh.rh=!1;const e=this.eh.oh;e&&e(this.eh,t),this.eh=void 0}},this.Sh=t=>{this.He=!0,this.dh=t},this.xh=()=>this.fh,this.hs=t.theme,this.bh=e.bh,this.Mh={_h:e._h,Ah:e.Ah,wh:e.wh,kh:e.kh,Ch:e.Ch,Th:e.Th,Ih:t&&t.overrideInteractionMouseButtons?t.overrideInteractionMouseButtons:void 0,Fh:t&&void 0!==t.resourcesBaseUrl&&null!==t.resourcesBaseUrl?t.resourcesBaseUrl:`${gt.location.origin}/resources`,Ph:!t||!("warnings"in t)||"boolean"!=typeof t.warnings||t.warnings,Dh:(()=>{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})(),Bh:void 0===(null==t?void 0:t.interactable)||t.interactable,Lh:void 0===t.textPixelSnappingEnabled||t.textPixelSnappingEnabled};const i=t?t.container:void 0;if(i){if("string"==typeof i){const t=gt.document.getElementById(i);if(!t)throw new Error(`Container "${i}" doesn't exist.`);this._e=t}else this._e=i;gt.addEventListener("resize",this.Fe),this.Ve.push((()=>{gt.removeEventListener("resize",this.Fe)}))}else{if(void 0===os){const t=gt.document.createElement("div");t.id="lcjs-auto-flexbox",t.style.position="relative",t.style.width="100%",t.style.display="flex",t.style.flexDirection="column",gt.document.body.appendChild(t),os=t,gt.addEventListener("resize",hs)}let t=1;for(;null!==gt.document.getElementById(`chart-${t}`);)t+=1;this._e=gt.document.createElement("div"),this._e.id=`chart-${t}`,this._e.style.flex="1",os.appendChild(this._e),hs(),ns.push(this.Fe),this.Ve.push((()=>{os&&os.removeChild(this._e),ns.includes(this.Fe)&&ns.splice(ns.indexOf(this.Fe),1),0===ns.length&&os&&(gt.document.body.removeChild(os),os=void 0,gt.removeEventListener("resize",hs))}))}if(gt.ResizeObserver){const t=t=>{for(const e of t)e.target===this._e&&this.Fe()};this.Oh=new gt.ResizeObserver(t.bind(this)),this.Oh.observe(this._e)}""===this._e.style.position&&(this._e.style.position="relative"),this._e.style.boxSizing="content-box",this._e.addEventListener("fullscreenchange",this.Fe),this._e.addEventListener("webkitfullscreenchange",this.Fe);const s=t?t.maxFps:void 0;this.Rh=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._e.onwheel=this.Eh(is.wheel),this._e.oncontextmenu=this.Eh(is.contextmenu),this._e.onclick=this.Eh(is.click),this._e.ondblclick=this.Eh(is.dbclick),this._e.onlostpointercapture=()=>{o=!1},this._e.ontouchmove=t=>{o&&t.preventDefault()},this._e.onpointerover=h(),this._e.onpointerenter=h(this.Sh),this._e.onpointerdown=h(this.Eh(is.mouseDown),this.zh(ss.touchStart)),this._e.onpointermove=h(this.th,this.zh(ss.touchMove)),this._e.onpointerup=h(this.Eh(is.mouseUp),this.zh(ss.touchEnd)),this._e.onpointercancel=h(),this._e.onpointerout=h(),this._e.onpointerleave=h(this.gh,this.zh(ss.touchEnd)),!gt.requestAnimationFrame||!gt.cancelAnimationFrame)throw new Error("LightningChart JS depends on requestAnimationFrame. Make sure to load a polyfill in older browsers.");gt.addEventListener("scroll",this.Pe),this.Ye=y(new M({r:0,g:0,b:0,a:0})),this.Vh=new Qi(this)}Nh(){return this.Gh}Hh(){return this.Wh}setBackgroundFillStyle(t){return this.Uh.ps(t),this}getBackgroundFillStyle(){return this.Uh.gs()}setBackgroundStrokeStyle(t){return this.Uh.$h(t),this}getBackgroundStrokeStyle(){return this.Uh.Yh()}Xh(t){return this.ze=t,this}jh(t){return this.Ee=t,this}Zh(t){return this.Be.get(t)}Kh(){return Array.from(this.Be.keys()).reverse().reduce(((t,e)=>e!==Number.MAX_SAFE_INTEGER&&e>t?e:t),0)+1}Eh(t){return e=>this.qh(t,e)}qh(t,e){if(!this.He)return;t===is.contextmenu&&Xt(e);const i=this.ke(e.clientX,e.clientY),s=this.sh(e,{x:e.clientX,y:e.clientY});if(t===is.mouseUp){if(this.hh){const t=this.hh.entity.ph;if(t&&t(this.hh.entity,e,this.hh.button,this.hh.startLocation),s!==this.hh.entity){this.hh.entity.rh=!1;const t=this.hh.entity.oh;t&&t(this.hh.entity,e)}this.hh=void 0}if(this.mh){const t=this.mh.entity.getMouseInteractions()&&this.mh.entity.yh;t&&t(this.mh.entity,e),this.mh=void 0}}else if(s&&s.getMouseInteractions()){const i=t===is.click?s.Jh:t===is.dbclick?s.Qh:t===is.mouseDown?s.tr:t===is.wheel?s.ir:t===is.contextmenu?s.sr:void 0;if(i&&i(s,e),t===is.mouseDown){this.mh={entity:s,event:e};const t=this.mh.event.button,i=s.er;i&&i(s,e,t),this.hh={entity:s,button:t,startLocation:u(e.clientX,e.clientY)}}}this.dh=e,this.fh=i,this.eh=s}zh(t){return e=>this.hr(t,e)}hr(t,e){const i=e.interactions.length;if(this.rr=e,this.nr){const s=t===ss.touchMove?this.nr.ar:t===ss.touchEnd?this.nr.lr:t===ss.touchStart?this.nr.ur:void 0;s&&s(this.nr,e),t===ss.touchEnd&&0===i&&(this.nr.rh=!1,this.nr=void 0)}else if(t===ss.touchStart){for(let t=0;t{t()})),this.Ve.length=0,this.Re&>.cancelAnimationFrame(this.Re)}ke(t,e){return u(t-this.Oe.x,this.Oe.y-e)}Ce(t,e){return u(t+this.Oe.x,this.Oe.y-e)}}const cs=(t=1)=>({type:"horizontalProgressive",packager:(e,i,s)=>{if(e.length>1){const r=Ze(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=Ze(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=Ze(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=Ze(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?ps.Nearest:"nearest-x"===t?ps.NearestX:"nearest-y"===t?ps.NearestY:void 0;return void 0!==e?e:ps.NearestX},xs=(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===ps.Nearest)return Ss(t,e,n,o,c,d);if(i===ps.NearestX||i===ps.NearestY){if("boolean"==typeof l&&("x"===a&&i===ps.NearestX||"y"===a&&i===ps.NearestY))return Ms(t,nt(e,o,n),a,l,c,d);if(i===ps.NearestX)return vs(t,nt(e,o,n),h,c,d);if(i===ps.NearestY)return bs(t,nt(e,o,n),h,c,d)}},Ss=(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,m=Math.floor((r+n)/2),p=n,y=-1;for(;;){const e=h-(o?t[m].x:t[m].y);if(e*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(e))return m;p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){const i=m>r?Math.abs(h-(o?t[m-1].x:t[m-1].y)):Me,s=m{const o="x"===i,h=o?e.x:e.y,a=t[r],l=t[n],u=a.xl.x?a.x:l.x,f=a.y>l.y?a.y:l.y;if(o&&(hd)||!o&&(hf))return;let g=r,m=Math.floor((r+n)/2),p=n,y=-1;for(;;){const i=h-(o?t[m].x:t[m].y);if(i*(s?-1:1)>0)g=Math.min(m+1,p),y=Math.floor((g+p)/2);else{if(0===Math.abs(i))return{a:m,b:m,lerpAmount:0};p=Math.max(m-1,g),y=Math.floor((g+p)/2)}if(y===m){if(i*(s?-1:1)<0&&m>r){const i=t[m-1],s=t[m];return{a:m-1,b:m,lerpAmount:o?(e.x-i.x)/(s.x-i.x):(e.y-i.y)/(s.y-i.y)}}if(mthis.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Li=t,this.vr=e,this.Mr=i,this._r=ws,ws+=1,this.Ar=t.hs.highlightColorOffset}wr(t){return void 0!==this.Mr.find((e=>e.type===t))}kr(t,e){var i;return!!this.wr(t)&&!0===e(null===(i=this.Mr.find((e=>e.type===t)))||void 0===i?void 0:i.args)}dispose(){return this.ce||(this.rh&&this.oh&&this.oh(this),this.ce=!0,this.vr(this),this.P.emit("dispose",this)),this}setVisible(t){const e=this.Ri;return this.Ri=t,!t&&e&&(this.rh&&this.oh&&this.oh(this),this.rh=!1),this}getVisible(){return this.Ri}setMouseInteractions(t){const e=this.pr.M();return this.pr.S(t),t||(e&&this.rh&&this.oh&&this.oh(this),this.rh=!1),this}getMouseInteractions(){return this.pr.M()}getIsUnderMouse(){return this.rh}getIsGrabbed(){return this.yr}setMouseMoveEventHandler(t){return this.ah=t,this}setMouseEnterEventHandler(t){return this.lh=t,this}setMouseLeaveEventHandler(t){return this.oh=t,this}setMouseClickEventHandler(t){return this.Jh=t,this}setMouseDoubleClickEventHandler(t){return this.Qh=t,this}setMouseDownEventHandler(t){return this.tr=t,this}setMouseUpEventHandler(t){return this.yh=t,this}setMouseWheelEventHandler(t){return this.ir=t,this}setMouseContextMenuEventHandler(t){return this.sr=t,this}setMouseDragEventHandler(t){return this.uh=t,this}setMouseDragStartEventHandler(t){return this.er=t,this}setMouseDragStopEventHandler(t){return this.ph=t,this}setTouchStartEventHandler(t){return this.ur=t,this}setTouchMoveEventHandler(t){return this.ar=t,this}setTouchEndEventHandler(t){return this.lr=t,this}Cr(t){return this.Sr=t,this}Tr(){return this.Sr?this.Sr:Ts}Ir(t){return this.br=t,this}Fr(){return this.br}Pr(t){return this.Ar=t,this}Dr(){return this.Ar}}const Ts=m(u(0,0),u(0,0));class Es extends Ds{constructor(t,e,i,s){super(t,i,s),this.Br=0,this.Lr=e,this.Lr.Or=!0}Rr(t){return this.Br===t||(this.Br=t,this.Lr.Or=!0),this}Er(){return this.Br}}class Bs extends Es{constructor(t,e,i,s,r){super(t,e,s,r),this.zr=!0,this.ct=i}}const ks=(t,e,i)=>{if(i instanceof Ti){const s=i.yi(),r=Qe(e,{x:Math.abs(s.x),y:Math.abs(s.y)});return m(u(t.min.x-r.x,t.min.y-r.y),u(t.max.x+r.x,t.max.y+r.y))}return m(i.Yt(u(t.min.x,t.min.y),Ze(e,-1)),i.Yt(u(t.max.x,t.max.y),e))},Is=(t,e)=>"function"==typeof e?e(t):e,Cs=(t,e)=>!t||t!==e,Ps=(t,e)=>t===F&&e!==F,Ls=t=>t!==F;class Rs extends Bs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Vr=ls.fillStyle,this.Li=t}ps(t){return this.Vr=Is(this.Vr,t),this}gs(){return this.Vr}Nr(){return Cs(this.Gr,this.Vr)}Hr(){return Ps(this.Gr,this.Vr)}Wr(){return Ls(this.Vr)}Ur(t){this.Gr=t}}class Fs extends Rs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.$r=ls.lineStyle,this.Li=t}$h(t){return this.$r="function"==typeof t?t(this.$r):t,this}Yh(){return this.$r}Yr(){return!this.Xr||this.Xr!==this.$r}jr(t){return!this.Xr||this.Xr.getThickness()!==t}Wr(){return this.$r!==J||super.Wr()}Hr(){return(this.$r!==J||this.Vr!==F)&&this.Xr===J&&this.Gr===F}Zr(t){this.Xr=t}}class _s extends Rs{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 Os extends Rs{constructor(t,e,i,s,r,n=y(ls.font)){super(t,e,i,s,r),this.Kr=y(""),this.qr=y(u(0,0)),this.Jr=y(0),this.Qr=y(0),this.tn=y(u(0,0)),this.sn=y(0),this.en=y(qi),this.hn=u(0,0),this._t=y(x(1,1,1,1)),this.rn=y(S(4,4,4,4)),this.font=y(ls.font),this.nn=!1,this.font=n}Wr(){return Ls(this.Vr)&&this.Kr.M().length>0}Hr(){return!1===this.nn&&this.Wr()}fs(t){return this.Kr.S(t),this}cs(){return this.Kr.M()}Ss(t){return t instanceof Yi?this.en.S(t):this.en.S(t(this.en.M())),this}ys(){return this.en.M()}an(t){return this.en.S(this.en.M().setFamily(t)),this}ln(){return this.en.M().getFamily()}un(t){return this.en.S(this.en.M().setSize(t)),this}cn(){return this.en.M().getSize()}dn(t){return this.en.S(this.en.M().setWeight(t)),this}fn(){return this.en.M().getWeight()}gn(t){return this.en.S(this.en.M().setStyle(t)),this}pn(){return this.en.M().getStyle()}mn(t){return this.en.S(this.en.M().setVariant(t)),this}yn(){return this.en.M().getVariant()}Sn(t){return this.qr.S(t),this}xn(){return this.qr.M()}xs(t){return this.sn.S(t),this}bs(){return this.sn.M()}bn(t,e){return this.tn.S(u(t,e)),this}vn(){return this.tn.M()}Mn(t){return this.Qr.S(t),this}_n(){return this.Qr.M()}An(t){return this.Jr.S(t),this}wn(){return this.Jr.M()}kn(t){return this.Qr.S(t.x),this.Jr.S(t.y),this}Cn(t){return this._t.S(t),this}Tn(){return this._t.M()}In(t){return this.rn.S(t),this}Fn(){return this.rn.M()}}class zs extends _s{constructor(t,i,s,r,n,o=5){super(t,i,s,r,n,y(o)),this.Pn=[],this.Dn=y(e.PointShape.Square),this.sn=y(0),this.Bn=y(!1),this.Ln=y(!1),this.On=y(!1),this.Rn=we,this.En=0,this.zn=[],this.Vn=0,this.Nn=we,this.Gn=ps.Nearest,this.Hn=!1}Wn(t){return this.Gn=t,this}Un(){return this.zn}$n(){return this.Pn}Yn(t){return this.Dn.S(t),this}xs(t){return this.sn.S(t),this}Xn(t){return this.Bn.S(t),this}jn(t){return this.Ln.S(t),this}Zn(t){return this.On.S(t),this}Kn(t,e){return Array.isArray(t)||(t=[t]),this.Vn+=t.length,this.zn=ie(this.zn,t,{canReturnB:!0}),this.Nn&&(this.Nn=e?Ne(this.Nn,e):void 0),this}qn(){return this.Hn=!0,this.Pn.length=0,this.En=0,this.Rn=we,this.zn=[],this.Vn=0,this}Jn(){return this.En}Qn(){return this.Vn}}class Vs extends Fs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.qr=y(u(0,0)),this.Y=y(u(100,100)),this.sn=y(0),this.hn=y(u(0,0)),this.io=!1}Gs(){return this.so(),this}Sn(t){const e=this.qr.M();return t.x===e.x&&t.y===e.y||(this.qr.S(t),this.so()),this}xn(){return this.qr.M()}eo(t){const e=this.qr.M();return t!==e.x&&(this.qr.S(u(t,e.y)),this.so()),this}ho(t){const e=this.qr.M();return t!==e.y&&(this.qr.S(u(e.x,t)),this.so()),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.so()),this}Et(){return this.Y.M()}ro(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(t,e.y)),this.so()),this}no(t){const e=this.Y.M();return t!==e.x&&(this.Y.S(u(e.x,t)),this.so()),this}xs(t){return this.sn.S(t),this}bs(){return this.sn.M()}oo(t){const e=this.hn.M();return t===e&&e.x===t.x&&e.y===t.y||(void 0===t?(this.io=!1,this.so()):(this.io=!0,this.hn.S(t))),this}so(){if(!this.io){const t=this.qr.M(),e=this.Y.M(),i=u(t.x+e.x/2,t.y+e.y/2),s=this.hn.M();i.x===s.x&&i.y===s.y||this.hn.S(i)}}}class Ns extends Fs{constructor(){super(...arguments),this.Pn=[],this.qr=y(u(0,0)),this.Rn=we,this.ao=!1}lo(t){return t=Kt(t),this.Pn=t,this.ao=!0,this}uo(){return this.Pn}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}}class Gs extends Ns{}class Us extends Rs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fo=new Array,this.po=new Array,this.mo=y({type:"disabled",packager:(t,e,i)=>t.slice()}),this.Rn=we,this.yo=0,this.So=!1,this.zn=[Array(),Array()],this.xo=!1,this.bo=(new z).setColor(A(42,171,240)),this.Hn=!1,this.vo=!1,this.Mo=!1}Kn(t,e){const i=this.yo-1,s=i>0&&!this.xo;let[r,n]=s?[[this.fo[i]],[this.po[i]]]:[[],[]];if(t instanceof Array){const[e,i]=g(t);r=ie(r,e,{canReturnB:!0}),n=ie(n,i,{canReturnB:!0})}else{const e=t.position;r.push(u(e,t.high)),n.push(u(e,t.low))}return this.xo?(this.zn[0]=ie(this.zn[0],r,{canReturnB:!0}),this.zn[1]=ie(this.zn[1],n,{canReturnB:!0})):(this.zn=[r,n],this.xo=!0),this.Rn=Ne(this.Rn,e||Ne(ze(r),ze(n))),this}qn(){return this.Hn=!0,this.fo.length=0,this.po.length=0,this.yo=0,this.Rn=we,this}$n(){return[this.fo,this.po]}Un(){return[this.zn[0],this.zn[1]]}_o(t){return this.mo.S(t),this}Ao(){return this.mo.M()}wo(t){return this.bo="function"==typeof t?t(this.bo):t,this}ko(){return this.bo}Jn(){return this.yo-(Number(this.vo)+Number(this.Mo))}Qn(){return this.zn.length}Co(t){return this.vo=t,this}To(){return this.vo}Io(t){return this.Mo=t,this}Fo(){return this.Mo}Hr(){return this.Gr===F&&this.Po===F&&(this.Vr!==F||this.bo!==F)}Do(t){this.Po=t}Wr(){return this.bo!==F||super.Wr()}Nr(){return super.Nr()||!this.Po||this.Po!==this.bo}}class Hs extends Fs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.qr=y(u(0,0)),this.Bo=y(0),this.hi=y(360),this.Lo=y(100),this.Oo=y(100),this.Ro=y(0),this.Eo=y(void 0),this.zo=u(0,0),this.Vo=u(0,0),this.No=u(0,0)}Go(){return this.Lo.M()}Ho(){return this.Oo.M()}xn(){return this.qr.M()}Wo(){return this.Bo.M()}ei(){return this.hi.M()}Uo(){return this.Ro.M()}$o(){return this.Eo.M()}Yo(){return this.zo}Xo(){return this.Vo}jo(){return this.No}Sn(t){return this.qr.S(t),this}Zo(t){return this.Bo.S(t),this}Ko(t){return this.hi.S(t),this}qo(t){return this.Oo.S(t),this.Lo.S(t),this}Jo(t){return this.Lo.S(t),this}Qo(t){return this.Oo.S(t),this}ta(t){return this.Ro.S(t<0?0:t),this}ia(t){return this.Eo.S(void 0!==t&&t<=0?void 0:t),this}}var Ws;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(Ws||(Ws={}));class Ys extends Bs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.sa=ls.lineStyle,this.engine=t}ea(t){return this.sa=((t,e)=>"function"==typeof e?e(t):e)(this.sa,t),this}ha(){return this.sa}Yr(){return((t,e)=>!t||t!==e)(this.ra,this.sa)}na(t){return((t,e)=>!t||t.getThickness()!==e)(this.ra,t)}Hr(){return((t,e)=>t===J&&e!==J)(this.ra,this.sa)}Wr(){return(t=>t!==J&&t.getFillStyle()!==F)(this.sa)}oa(t){this.ra=t}}class qs extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ni=u(0,0),this.hi=u(0,0),this.aa=!1}S({min:t,max:e}){return this.aa=!0,this.ni=t,this.hi=e,this}ri(){return this.ni}ei(){return this.hi}la(t){return this.aa=!0,this.ni=t,this}Ko(t){return this.aa=!0,this.hi=t,this}}class Xs extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ua=[],this.aa=!1}Kn(t,e){return this.ua.push(t),this.ua.push(e),this.aa=!0,this}qn(){return this.ua.length=0,this.aa=!0,this}}class $s extends Ys{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=[],this.Rn=we,this.zn=new Array,this.En=0,this.Gn=ps.NearestX,this.Hn=!1,this.da=y(void 0),this.vo=!1,this.Mo=!1}fa(t){return this.da.S(t),this}ga(){return this.da.M()}Un(){return this.zn}$n(){return this.ca}Wn(t){return this.Gn=t,this}qn(){return this.Hn=!0,this.ca.length=0,this.En=0,this.zn=[],this.Rn=we,this}Jn(){return this.En-(Number(this.vo)+Number(this.Mo))}Qn(){return this.zn.length}Co(t){return this.vo=t,this}To(){return this.vo}Io(t){return this.Mo=t,this}Fo(){return this.Mo}}class js extends Rs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.yo=0,this.pa=0,this.Y=y({x:0,y:0}),this.ma=y({x:0,y:0}),this.ya=y({x:0,y:0}),this.ni={x:0,y:0},this.hi={x:0,y:0},this.Sa=!0,this.xa=!0,this.ba=!0,this.Rn=we,this.va=!0,this.Ma=F}_a(t){return this.Ma=Is(this.Ma,t),this}Aa(){return this.Ma}S(t){return Zs.S(this,t,((t,e)=>({x:t,y:e}))),this}wa(){return Zs.wa(this)}ka(){return Zs.ka(this)}xn(){return Zs.xn(this)}Qn(){return Zs.Qn(this)}Ca(t,e,i){return Zs.Ca(this,t,e,i),this}Ta(t,e,i){return Zs.Ta(this,t,e,i),this}Ia(t,e){return Zs.Ia(this,t,e),this}Fa(t,e){return Zs.Fa(this,t,e),this}Pa(t,e){return Zs.Pa(this,t,e),this}qn(){return Zs.qn(this,((t,e)=>({x:t,y:e}))),this}Da(){return Zs.Da(this)}Ba(){return Zs.Ba(this)}La(){return Zs.La(this)}Jn(){return Zs.Jn(this)}Hr(){return Zs.Hr(this)}Wr(){return Zs.Wr(this)}Oa(){return this.Ra}Ea(){return this.za}}const Zs={S(t,e,i){t.Sa=!0,t.xa=!0,t.ba=!0;const{start:s}=e,{end:r}=e,{rows:n}=e,{columns:o}=e;t.va=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.ma.S(h),t.ni={...s},t.hi={...r},t.Y.S(Je(r,s)),Zs.Va(t,i)},Va(t,e){const i=t.ma.M();if(i.x>0&&i.y>0){t.Ra?t.Ra.length=0:t.Ra=[];const s=t.va?Ke(i,{x:1,y:1}):{x:i.x,y:i.y};t.ya.S(s),t.Ra=Array.from(Array(s.y)).map((()=>Array(s.x))),t.za=Array.from(Array(i.y)).map((()=>Array(i.x))),Zs.Na(t,i,s,e),t.yo=s.x*s.y,t.pa=i.x*i.y}else t.Ra=void 0,t.ya.S({x:0,y:0})},Na(t,e,i,s){const r=t.ni,n=t.hi,o=t.Ra,h=t.za;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.ma.o||t.ya.o,ka(t){const e=t.ma.M();return{columns:e.x,rows:e.y}},xn(t){const e=t.ni,i=t.hi;return{start:{x:e.x,y:e.y},end:{x:i.x,y:i.y}}},Qn(t){throw new Error("Method not implemented.")},Ca(t,e,i,s){const r="geometry"===i||"y"===i?t.Ra:t.za;if(r){const n=t.ya.M();if("y"===i){const t=Bt(r);for(let i=0;iEt(t,e)));const o=r===t.Ra?t.ya.M():t.ma.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.yo,Jn:t=>t.pa,Hr:t=>Ps(t.Gr,t.Vr)||Ps(t.Wa,t.Ma),Wr:t=>Ls(t.Vr)||Ls(t.Ma)};class Ks{constructor(t,e){this.Fh=t,this.Ua=e,this.$a=e.rows*Er,this.Ya=e.columns*Br}}var Js,Qs;e.OnScreenMenuButtonType=void 0,(Js=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[Js.ZoomIn=0]="ZoomIn",Js[Js.ZoomInX=1]="ZoomInX",Js[Js.ZoomInY=2]="ZoomInY",Js[Js.ZoomOut=3]="ZoomOut",Js[Js.ZoomOutX=4]="ZoomOutX",Js[Js.ZoomOutY=5]="ZoomOutY",Js[Js.ZoomToFit=6]="ZoomToFit",Js[Js.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(Qs=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[Qs.Circle=0]="Circle",Qs[Qs.Rectangle=1]="Rectangle",Qs[Qs.RoundedRectangle=2]="RoundedRectangle";const tr={x:-43,y:0},er={x:-65,y:0},ir={x:-86,y:0},sr={x:-107,y:-1},rr={x:-128,y:-3},nr={x:-150,y:0},or={x:-171,y:0},hr={x:-276,y:0},ar={x:-298,y:0},lr={x:0,y:0},ur={x:-21,y:0};class cr extends Ks{constructor(t,e,i,s){super(t,i),this.Xa=gt.document.createElement("button"),this.ja=gt.document.createElement("div"),this.Za=gt.document.createElement("label"),this.Ua=i,this.Ka=e,this.qa=s}Ja(t,e,i,s){this.Qa(t,s),this.tl(),this.il(e),this.sl(),this.Za.textContent=i||"";const r=gt.document.createElement("div");this.el(r),this.Xa.onclick=this.onClick.bind(this),r.appendChild(this.ja),r.appendChild(this.Za),this.Xa.appendChild(r)}sl(){this.Xa.style.cursor="pointer"}el(t){t.style.display="flex",t.style.justifyContent="center",t.style.alignContent="center",t.style.flexDirection="column"}il(t){"string"==typeof t?(this.ja.style.backgroundImage=`url(${t})`,this.ja.style.backgroundSize="100%",this.ja.style.backgroundRepeat="no-repeat",this.ja.style.backgroundPosition="center",this.ja.style.width="20px",this.ja.style.height="20px"):this.applyStyleForSprite(t),this.ja.style.margin="auto"}tl(){switch(this.Ka){case e.OnScreenMenuButtonShape.RoundedRectangle:this.Xa.style.borderRadius="10px";break;case e.OnScreenMenuButtonShape.Rectangle:this.Xa.style.borderRadius="0px";break;case e.OnScreenMenuButtonShape.Circle:default:this.Xa.style.borderRadius="31px"}}Qa(t,e){this.Xa.style.width=`${this.Ya.toString()}px`,this.Xa.style.height=`${this.$a.toString()}px`,this.Xa.style.backgroundColor=t,this.Xa.style.opacity=e||kr,this.Xa.style.alignItems="center",this.Xa.style.border="2px solid #707070",this.Xa.style.transition="background-color .8s ease"}applyStyleForSprite(t){this.ja.style.backgroundImage=`url(${this.Fh}/${Ir})`,this.ja.style.backgroundPositionX=`${t.x}px`,this.ja.style.backgroundPositionY=`${t.y}px`,this.ja.style.backgroundSize="1600%",this.ja.style.backgroundRepeat="no-repeat",this.ja.style.width="20px",this.ja.style.height="20px"}hl(t){return t.appendChild(this.Xa),t}rl(){return this.Xa}}class dr extends cr{constructor(t,e,i,s){super(t,e,i,s),this.nl="",this.ol="",this.al=!1,this.qa=s}ll(){this.ul(),this.onToggledStateAction()}cl(){this.dl(),this.onInitialStateAction()}dl(){this.fl(this.nl)}ul(){this.fl(this.ol)}fl(t){"string"==typeof t?this.ja.style.background=t:(this.ja.style.backgroundImage=`url(${this.Fh}/${Ir})`,this.ja.style.backgroundPositionX=`${t.x}px`,this.ja.style.backgroundPositionY=`${t.y}px`)}onClick(){this.al?this.cl():this.ll(),this.al=!this.al}}class fr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),tr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:-1,y:-1})}}class gr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),sr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:-1,y:0})}}class mr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),nr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:0,y:-1})}}class pr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),er)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:1,y:1})}}class yr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),rr)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:1,y:0})}}class xr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),or)}onClick(){const t=this.qa.pl();t&&this.qa.zoom(t,{x:0,y:1})}}class Sr extends dr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.nl=hr,this.ol=ar,this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),this.nl)}onToggledStateAction(){this.qa.setAnimationsEnabled(!1)}onInitialStateAction(){this.qa.setAnimationsEnabled(!0)}}class vr extends cr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.qa=e;const s=this.qa.getTheme();this.Ja(s.onScreenMenuBackgroundColor.toRGBAString(),ir)}onClick(){this.qa.forEachAxis((t=>{t.fit(!0)}))}}class br extends cr{constructor(t,e,i){super(t,e.shape||Cr,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.Ja(r,n,o,h),this.ml=e.action}onClick(){this.ml(this.qa)}}class Mr extends dr{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.qa=i,this.yl=s,this.nl=ur,this.ol=lr,this.Ja(Pr,this.nl)}dl(){this.fl(this.nl),this.Xa.style.backgroundColor=Pr,this.Xa.style.border="2px solid #707070",this.Xa.style.margin="0px"}ul(){this.fl(this.ol),this.Xa.style.background="#FECC00 0% 0% no-repeat padding-box",this.Xa.style.border="10px solid #BCBCBC12",this.Xa.style.margin="1px"}onToggledStateAction(){var t;null===(t=this.yl)||void 0===t||t.style.setProperty("display","block")}onInitialStateAction(){var t;null===(t=this.yl)||void 0===t||t.style.setProperty("display","none")}}var Ar;e.MouseStyles=void 0,(Ar=e.MouseStyles||(e.MouseStyles={})).Move="move",Ar.ResizeColumn="col-resize",Ar.ResizeRow="row-resize",Ar.Horizontal="ew-resize",Ar.Vertical="ns-resize",Ar.NorthWest="nw-resize",Ar.NorthEast="ne-resize",Ar.Copy="copy",Ar.CrossHair="crosshair",Ar.Default="default",Ar.Help="help",Ar.Restricted="not-allowed",Ar.None="none",Ar.Point="pointer",Ar.Text="text",Ar.Wait="wait",Ar.ZoomIn="zoom-in",Ar.ZoomOut="zoom-out";const wr={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)},Dr=new z({color:A(255,255,255,0)}),Tr=new tt({thickness:1,fillStyle:Dr}),Er=60,Br=60,kr="1.0",Ir="osm/osm-sprite-transparent.png",Cr=e.OnScreenMenuButtonShape.Circle,Pr="#363636";var Lr;e.OSMPosition=void 0,(Lr=e.OSMPosition||(e.OSMPosition={}))[Lr.TopRight=0]="TopRight",Lr[Lr.TopLeft=1]="TopLeft",Lr[Lr.BottomLeft=2]="BottomLeft",Lr[Lr.BottomRight=3]="BottomRight";const Rr=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.vl?(this.bl.splice(t,1),t-=1):this.bl[t].state&&(s=!0);return this.xl?0===e.interactions.length&&(this.bl.push({state:!1,time:i}),this.xl=!1):1===e.interactions.length&&"pointerdown"===e.type&&(this.bl.push({state:!0,time:i}),s=!0,this.xl=!0),s}Gs(t,e,i){if(i){const i=this.bl.reduce(((t,e)=>(e.state?t.on+=1:t.off+=1,t)),{on:0,off:0});i.on>=2&&i.off>=1&&(this.Ml(t,e),this.bl.length=0)}}},Or=class{constructor(t,e,i,s=1,r=100){this._l=t,this.Al=e,this.wl=i,this.kl=s,this.Cl=r}Sl(t,e){const i=e.interactions.length;if(i===this.kl){if(void 0!==this.Tl)return!0;if("pointerdown"===e.type&&(1===i||(t=>{const e=t.length;if(e>0){const i=Rr(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 Nr{constructor(){this.Ri=!0,this.P=new r.Eventer,this.Bl=0,this.Ll=(t,e)=>{0===this.Bl&&this.P.emit("mouseEnter",this,e),this.Bl+=1},this.Ol=(t,e)=>{this.Bl-=1,this.Bl<1&&(this.P.emit("mouseLeave",this,e),this.Bl=0)},this.Rl=(t,e)=>{this.P.emit("mouseClick",this,e)},this.El=(t,e)=>{this.P.emit("mouseDoubleClick",this,e)},this.zl=(t,e)=>{this.P.emit("mouseDown",this,e)},this.Vl=(t,e)=>{this.P.emit("mouseUp",this,e)},this.Nl=(t,e)=>{this.P.emit("mouseMove",this,e)},this.Gl=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.Hl=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Wl=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Ul=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.$l=(t,e)=>{this.Bl+=1,this.P.emit("touchStart",this,e)},this.Yl=(t,e)=>{this.P.emit("touchMove",this,e)},this.Xl=(t,e)=>{this.Bl-=1,this.P.emit("touchEnd",this,e)},this.jl=t=>(t instanceof Bs?t.setMouseEnterEventHandler(this.Ll).setMouseLeaveEventHandler(this.Ol).setMouseClickEventHandler(this.Rl).setMouseDoubleClickEventHandler(this.El).setMouseDownEventHandler(this.zl).setMouseUpEventHandler(this.Vl).setMouseMoveEventHandler(this.Nl).setMouseDragEventHandler(this.Hl).setMouseDragStartEventHandler(this.Gl).setMouseDragStopEventHandler(this.Wl).setMouseWheelEventHandler(this.Ul).setTouchStartEventHandler(this.$l).setTouchMoveEventHandler(this.Yl).setTouchEndEventHandler(this.Xl):(t.onMouseEnter(this.Ll),t.onMouseLeave(this.Ol),t.onMouseClick(this.Rl),t.onMouseDoubleClick(this.El),t.onMouseDown(this.zl),t.onMouseUp(this.Vl),t.onMouseMove(this.Nl),t.onMouseDrag(this.Hl),t.onMouseDragStart(this.Gl),t.onMouseDragStop(this.Wl),t.onMouseWheel(this.Ul),t.onTouchStart(this.$l),t.onTouchMove(this.Yl),t.onTouchEnd(this.Xl)),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.Bl>0}setVisible(t){const e=this.Ri!==t;return this.Ri=t,e&&this.P.emit("visibleStateChanged",this,this.Ri),this}getVisible(){return this.Ri}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const Gr=(t,i,s)=>{const r=t.getDraggingMode();if(r!==e.UIDraggingModes.notDraggable){const n=t.scale.Yt(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.Yt({x:o.x.getInnerStart(),y:o.y.getInnerStart()},Qe({x:(1+a.x)/2,y:(1+a.y)/2},h)),u=o.Yt({x:o.x.getInnerEnd(),y:o.y.getInnerEnd()},Qe({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),Xt(s)}},Ur=(t,e,i,s,r)=>{Gr(t,r,e)},Hr=(t,e,i,s,r)=>{Gr(t,s,r)};class Wr extends Nr{constructor(t,e,i,s,r){super(),this.position=u(50,50),this.origin=u(0,0),this.size=u(0,0),this.ce=!1,this.Zl=void 0,this.Kl=void 0,this.ql=Vr,this.Jl=void 0,this.Ql=()=>{const t="function"==typeof this.ql?this.ql(this):this.ql;t&&(this.Kl=this.Lr.Li.Ae(t))},this.tu=()=>{this.Lr.Li.we(this.Kl)},this._t=x(0,0,0,0),this.Lr=t,this.renderingScale=e,this.scale=i,this.vr=s,this.hs=r,this.Lr.Bi(),this.onMouseEnter(this.Ql),this.onMouseLeave(this.tu),this.onMouseDrag(Ur);const n=Fr(new Or(bt,Hr,bt));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd),this.hs=r}setEffect(t){return this.iu=this.iu||this.Lr.Li.iu.su(this,{eu:{shapes:this.hu()}}),this.iu.eu.vs(t),this}getEffect(){return!!this.iu&&this.iu.eu._s()}setAutoDispose(t){return this.Jl=t,this.Lr.Bi(),this}getAutoDispose(){return this.Jl}getSize(t=e.UISpace.Everything){return t===e.UISpace.Everything?u(this.size.x+(this._t.left+this._t.right),this.size.y+(this._t.bottom+this._t.top)):this.size}setContentSize(t){this.size=t}setMargin(t){return this._t="object"==typeof t?v(this._t,t):{left:t,top:t,right:t,bottom:t},this.Lr.Bi(),this}getMargin(){return this._t}ru(){if(this.Jl){const t=this.size,e=this.renderingScale.Et(),i={x:t.x/e.x,y:t.y/e.y};("max-width"===this.Jl.type&&i.x>=this.Jl.maxWidth||"max-height"===this.Jl.type&&i.y>=this.Jl.maxHeight)&&this.dispose()}return this}Gs(){return this}dispose(){return this.ce||(this.Lr.Bi(),this.ce=!0,this.vr(this),this.P.emit("dispose",this)),this}setVisible(t){return super.setVisible(t),this.Lr.Bi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setPosition(t){return this.position=t,this.Lr.Bi(),this}getPosition(t=this.origin,i=e.UISpace.Everything){const s=this.getSize(e.UISpace.Everything),r=this.scale.Yt(this.position,Qe({x:-(this.origin.x+1)/2,y:-(this.origin.y+1)/2},s));if(i===e.UISpace.Everything)return this.scale.Yt(r,Qe({x:(t.x+1)/2,y:(t.y+1)/2},s));const n=this.scale.Yt(r,{x:this._t.left,y:this._t.bottom}),o=this.getSize(e.UISpace.Content);return this.scale.Yt(n,Qe({x:(t.x+1)/2,y:(t.y+1)/2},o))}setOrigin(t){return this.origin=t,this.Lr.Bi(),this}getOrigin(){return this.origin}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Zl=t,this.Lr.Bi(),this}getDraggingMode(){return void 0!==this.Zl?this.Zl:e.UIDraggingModes.notDraggable}setMouseStyle(t){return this.ql=t,this}getMouseStyle(){return this.ql}}class Yr extends Wr{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.rn=x(),this.nu=0,this.Lr=t,this.ou=s,this.backgroundElement=new this.ou(this.Lr,this.renderingScale,this.scale,bt,n),this.jl(this.backgroundElement)}hu(){return this.backgroundElement.hu()}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}ru(){return super.ru(),this.ce||this.backgroundElement.setOrigin(this.origin).setPosition(this.getPosition(this.origin,e.UISpace.PaddedBackground)).ru(),this}Gs(){const t=this.getSize(e.UISpace.PaddedContent);return this.backgroundElement.au(t).Gs(),super.Gs()}dispose(){return super.dispose(),this.backgroundElement.dispose(),this}setVisible(t){return super.setVisible(t),this.backgroundElement.setVisible(t),this}setPadding(t){return this.rn="object"==typeof t?v(this.rn,t):{left:t,top:t,right:t,bottom:t},this.Lr.Bi(),this}getPadding(){return this.rn}getSize(t=e.UISpace.Everything){let i=super.getSize(t);return t>=e.UISpace.PaddedContent&&(i=u(i.x+this.rn.left+this.rn.right,i.y+this.rn.bottom+this.rn.top)),t>=e.UISpace.PaddedBackground&&(i=u(i.x+this.backgroundElement.lu()+this.backgroundElement.uu(),i.y+this.backgroundElement.cu()+this.backgroundElement.du())),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.Yt(s,{x:r.left,y:r.bottom});if(i===e.UISpace.PaddedBackground){const i=this.getSize(e.UISpace.PaddedBackground);return this.scale.Yt(n,Qe({x:(t.x+1)/2,y:(t.y+1)/2},i))}const o=this.scale.Yt(n,{x:this.backgroundElement.lu(),y:this.backgroundElement.cu()});if(i===e.UISpace.PaddedContent){const i=this.getSize(e.UISpace.PaddedContent);return this.scale.Yt(o,Qe({x:(t.x+1)/2,y:(t.y+1)/2},i))}const h=this.getPadding(),a=this.scale.Yt(o,{x:h.left,y:h.bottom}),l=this.getSize(e.UISpace.Content);return this.scale.Yt(a,Qe({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.nu}setHighlight(t){return this.nu=me(t),this.backgroundElement.setHighlight(t),this.P.emit("highlight",t),this}}const qr=t=>"setBackground"in t;class Xr extends Nr{constructor(t,e,i,s,r,n,o,h,a,l,u){super(),this.u=0,this.fu=1,this.gu=!0,this.pu=new Yi,this.mu=!0,this.ce=!1,this.axisScale=s,this.renderingScale=r,this.yu=o,this.Su=h,this.xu=a,this.vr=l,this.bu=e,this.vu=i,this.Mu=this.jl(this.bu._u(this.renderingScale)),this.hs=u,this.Au=this.jl(this.xu.wu(this.vu,this.renderingScale,n,bt,this.hs,!1).setOrigin(Yt(this.Su)).setDirection(this.Su)),this.axis=t,this.setMouseInteractions(!1),"major"===this.Au.ku?this.Mu.ea(u.xAxisNumericTicks.majorTickStyle.gridStrokeStyle):"minor"===this.Au.ku?this.Mu.ea(u.xAxisNumericTicks.minorTickStyle.gridStrokeStyle):"other"===this.Au.ku&&this.Mu.ea(u.cursorGridStrokeStyleX)}setValue(t){return this.u=t,this.vu.Bi(),this.P.emit("valueChange",this.u),this}getValue(){return this.u}setTextFormatter(t){return this.Cu=t,this.vu.Bi(),this}setTickLength(t){return this.Au.setPointerLength(t),this.bu.Bi(),this}getTickLength(){return this.Au.getPointerLength()}setTickLabelPadding(t){return this.Au.setTickLabelPadding(t),this.bu.Bi(),this}setTickLabelRotation(t){return this.Au.setTextRotation(t),this.bu.Bi(),this}getTickLabelRotation(){return this.Au.getTextRotation()}getTickLabelPadding(){return this.Au.getTickLabelPadding()}setGridStrokeLength(t){return this.fu=t,this.bu.Bi(),this}getGridStrokeLength(){return this.fu}setGridStrokeStyle(t){return this.Mu.ea(t),this.bu.Bi(),this}getGridStrokeStyle(){return this.Mu.ha()}dispose(){return this.ce||(this.ce=!0,this.Mu.dispose(),this.Au.dispose(),this.vr(this),this.bu.Li.Bi(),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.gu=t,this.vu.Bi(),this}getMarkerVisible(){return this.gu}setMarker(t){return t(this.Au),this.vu.Bi(),this}getMarker(){return this.Au}setMouseInteractions(t){return this.Au.setMouseInteractions(t),this.Mu.setMouseInteractions(t),this}getMouseInteractions(){return this.Mu.getMouseInteractions()}setAllocatesAxisSpace(t){return this.mu=t,this.vu.Bi(),this}getAllocatesAxisSpace(){return this.mu}isInScale(){return Pe(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 $r extends Xr{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.Tu=!1,this.vr=a,this.bu=e,this.vu=i}dispose(){return this.Tu=!1,super.dispose()}update(){return this}plot(t,e,i,s){if(this.isInScale()&&this.getVisible()){this.Tu=!1;const r=rt(this.u,this.axisScale,this.yu.getWidth(this.renderingScale));this.Mu.setVisible(!0).la(this.yu.toPoint(r,t)).Ko(this.yu.toPoint(r,t-(i+e*this.fu))),this.gu?(this.Cu&&this.Au.setText(this.Cu(this.u,this)),this.Au.setVisible(!0).setPosition(this.yu.toPoint(r,s))):this.Au.setVisible(!1)}else this.Mu.setVisible(!1),this.Au.setVisible(!1);return this.Au.Gs().ru(),this}Iu(){const t=this.Au.Gs().getSize();return this.yu.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 Zr{constructor(t,i,s,n){this.Fu=!0,this.Pu=e.HighlightModes.onHover,this.ce=!1,this.Ri=!0,this.Du=0,this.P=new r.Eventer,this.Bu=[],this.Lu=(t,e)=>{this.setVisible(e)},this.Ou=()=>this.setHighlight(1),this.Ru=()=>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.Eu=(t,e)=>{0===this.Du&&this.P.emit("mouseEnter",this,e),this.zu()},this.Vu=(t,e)=>{1===this.Du&&this.P.emit("mouseLeave",this,e),this.Nu()},this.Gu=(t,e)=>{this.P.emit("mouseMove",this,e),this.Hu()},this.Wu=(t,e)=>this.P.emit("mouseClick",this,e),this.Uu=(t,e)=>this.P.emit("mouseDoubleClick",this,e),this.$u=(t,e)=>this.P.emit("mouseDown",this,e),this.Yu=(t,e)=>this.P.emit("mouseUp",this,e),this.Xu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.ju=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Zu=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Ku=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.qu=(t,e)=>{this.P.emit("touchStart",this,e),this.zu()},this.Ju=(t,e)=>{this.P.emit("touchMove",this,e),this.Hu()},this.Qu=(t,e)=>{this.P.emit("touchEnd",this,e),this.Nu()},this.qa=t,this.tc=i,this.hs=s,this.de=new Map,this.ic=n,this.iu=this.ic.su(this,{sc:{themeEffectEnabled:this.hs.effectsText},hc:{}}),this.qa.Li.Vh.Se(this,(t=>{this.de.forEach(((e,i)=>i.Ir(t))),this.Bu.forEach((e=>{e.setHighlight(t)}))}),{animationEnabled:this.qa.getAnimationsEnabled()})}rc(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.de.set(t,{isText:s});const r=Array.from(this.de);this.iu.sc.nc(r.filter((t=>t[1].isText)).map((t=>t[0]))),this.iu.hc.nc(r.filter((t=>!t[1].isText)).map((t=>t[0]))),t.setMouseInteractions(this.Fu).setVisible(this.Ri).Ir(this.getHighlight()),i&&t.setMouseEnterEventHandler(this.Eu).setMouseLeaveEventHandler(this.Vu).setMouseClickEventHandler(this.Wu).setMouseDoubleClickEventHandler(this.Uu).setMouseDownEventHandler(this.$u).setMouseUpEventHandler(this.Yu).setMouseMoveEventHandler(this.Gu).setMouseDragStartEventHandler(this.Xu).setMouseDragEventHandler(this.ju).setMouseDragStopEventHandler(this.Zu).setMouseWheelEventHandler(this.Ku).setTouchStartEventHandler(this.qu).setTouchMoveEventHandler(this.Ju).setTouchEndEventHandler(this.Qu)}oc(t){this.de.delete(t)}setEffect(t){return this.iu.sc.vs(t&&this.hs.effectsText),this.iu.hc.vs(t),this.qa.Li.Bi(),this}getEffect(){return this.iu.sc._s()||this.iu.hc._s()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setName(t){return this.ac=t,this.Bu.forEach((t=>t.setText(this.ac))),this}getName(){return this.ac}dispose(){return this.ce||(this.ce=!0,this.de.forEach(((t,e)=>e.dispose())),this.tc(this),this.Bu.forEach((t=>{t.dispose()})),this.Bu.length=0,this.P.emit("dispose",this),this.qa.Li.Bi()),this}setVisible(t){return t===this.Ri||(this.Ri=t,this.de.forEach(((e,i)=>i.setVisible(t))),this.Bu.forEach((e=>e.setOn(t))),this.P.emit("visibleStateChanged",this,this.Ri),this.qa.Li.Bi()),this}getVisible(){return this.Ri}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setHighlight(t){return this.qa.Li.Vh.xe(this,t),this.P.emit("highlight",t),this}getHighlight(){return this.qa.Li.Vh.be(this)}setAnimationHighlight(t){return this.qa.Li.Vh.ve(this,t),this}getAnimationHighlight(){return this.qa.Li.Vh.Me(this)}setMouseInteractions(t){return this.Fu=t,this.de.forEach(((e,i)=>i.setMouseInteractions(t))),this.qa.Li.Bi(),this}getMouseInteractions(){return this.Fu}getIsUnderMouse(){return this.Du>0}setHighlightOnHover(t){return this.Pu=t?e.HighlightModes.onHover:e.HighlightModes.noHighlighting,!1===t&&this.getHighlight()>0&&this.setHighlight(!1),this}getHighlightOnHover(){return this.Pu!==e.HighlightModes.noHighlighting}attach(t,e=!0){t.setText(this.ac),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.Lu),t.setLocked(!e),t.onMouseEnter(this.Ou),t.onMouseLeave(this.Ru),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),this.Bu.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")}zu(t=1){this.Du+=t,this.Du===t&&this.Pu===e.HighlightModes.onHover&&this.setHighlight(!0)}Nu(t=1){this.Du=Math.max(0,this.Du-t),0===this.Du&&this.Pu===e.HighlightModes.onHover&&this.setHighlight(!1)}Hu(){}}class Kr extends Zr{constructor(t,e,i,s,r,n,o,h){super(e,i,o,h),this.Lr=t,this.axis=s,this.ct=r,this.lc=n,this.uc()}}class Jr extends Kr{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.ac="Band",this.cc=0,this.dc=0,this.Vr=this.hs.bandFillStyle,this.$r=this.hs.bandStrokeStyle,this.fc=this.Lr.gc(this.ct).ps(this.Vr).$h(this.$r).Ir(this.getHighlight()),this.rc(this.fc)}setValueStart(t){return this.cc=t,this.P.emit("valueChange",this,this.cc,this.dc),this.Lr.Bi(),this}getValueStart(){return this.cc}setValueEnd(t){return this.dc=t,this.P.emit("valueChange",this,this.cc,this.dc),this.Lr.Bi(),this}getValueEnd(){return this.dc}setFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;return this.fc.ps(e),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){this.$r="function"==typeof t?t(this.$r):t;const e=this.$r;return this.fc.$h(e),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}ru(){return this.fc.Sn(this.lc.toVec2(this.cc,this.lc.getHeight(this.ct).getInnerStart())).q(this.lc.toVec2(this.dc-this.cc,this.lc.getHeight(this.ct).getInnerInterval())),this}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}mc(t,e){t.Ir(e),this.Lr.Bi()}uc(){let t,i;const s=(e,s)=>{const r=nt(this.Lr.Li.ke(s.x,s.y),this.Lr.Li.ct,this.ct),n=this.lc.getWidth(r),o=this.axis.ct.ut(this.cc),h=this.axis.ct.ut(this.dc),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.lc.getWidth(n);t?(this.cc=this.axis.ct.Yt(this.cc,h),this.dc=this.axis.ct.Yt(this.dc,h)):i?this.cc=this.axis.ct.Yt(this.cc,h):this.dc=this.axis.ct.Yt(this.dc,h),Xt(o),this.P.emit("valueChange",this,this.cc,this.dc),this.Lr.Bi()};this.onMouseMove(((i,r)=>{s(0,u(r.clientX,r.clientY));const n=t?e.MouseStyles.Point:this.lc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.yc=this.qa.engine.setMouseStyle(n,this.yc)})),this.onMouseLeave((()=>{this.qa.engine.restoreMouseStyle(this.yc),this.yc=void 0})),this.onMouseDrag(((t,e,i,s,n)=>{0===i&&r(0,0,0,n,e)}));const n=Fr(new Or(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class Qr extends Kr{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n,o,h),this.ac="Constant Line",this.u=0,this.$r=this.hs.constantLineStrokeStyle,this.Sc=!0,this.xc=this.Lr._u(this.ct).ea(this.$r).Ir(this.getHighlight()),this.rc(this.xc)}setValue(t){return this.u=t,this.P.emit("valueChange",this,this.u),this.Lr.Bi(),this}getValue(){return this.u}setStrokeStyle(t){this.$r="function"==typeof t?t(this.$r):t;const e=this.$r;return this.xc.ea(e),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}setInteractionMoveByDragging(t){return this.Sc=t,this}getInteractionMoveByDragging(){return this.Sc}onValueChange(t){return this.P.on("valueChange",t)}offValueChange(t){return this.P.off(t,"valueChange")}ru(){return this.xc.la(this.lc.toVec2(this.u,this.lc.getHeight(this.ct).getInnerStart())).Ko(this.lc.toVec2(this.u,this.lc.getHeight(this.ct).getInnerEnd())),this}attach(t,e){return super.attach(t,e),oe(t,this.hs,{stroke:this.$r}),this}mc(t,e){t.Ir(e),this.Lr.Bi()}uc(){const t=(t,e)=>{this.Sc&&(this.u=this.axis.ct.Yt(this.u,this.lc.getWidth(e)),this.P.emit("valueChange",this,this.u),this.Lr.Bi(),Xt(t))};this.onMouseMove((()=>{if(this.Sc){const t=this.lc.getWidth({x:e.MouseStyles.Horizontal,y:e.MouseStyles.Vertical});this.yc=this.qa.engine.setMouseStyle(t,this.yc)}})),this.onMouseLeave((()=>{this.Sc&&(this.qa.engine.restoreMouseStyle(this.yc),this.yc=void 0)})),this.onMouseDrag(((e,i,s,r,n)=>{this.Sc&&0===s&&t(i,n)}));const i=Fr(new Or(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const tn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),en=(t,e)=>(oe(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),sn=(t,e,i)=>{i&&qr(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},rn={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}},nn={background:void 0,setBackground(t){return{...this,background:t}}},on={wu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return sn(o,r,n),o}},hn={wu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return sn(o,r,n),o}};class an extends Wr{constructor(){super(...arguments),this.bc=!0}ru(){return super.ru(),this}setMouseInteractions(t){return this.bc=t,this}getMouseInteractions(){return this.bc}hu(){return[]}}class ln extends an{onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}au(t){return this.size=t,this}lu(){return 0}uu(){return 0}du(){return 0}cu(){return 0}setHighlight(t){return this}getHighlight(){return 0}setFillStyle(){return this}getFillStyle(){return F}setStrokeStyle(){return this}getStrokeStyle(){return J}setStrokeThickness(){return this}getStrokeThickness(){return 0}}class un extends ln{constructor(){super(...arguments),this.setSize=this.au.bind(this)}}class cn extends Wr{constructor(){super(...arguments),this.Vr=F,this.P=new r.Eventer,this.nu=0}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}hu(){return[this.Dn]}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Dn.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}getHighlight(){return this.nu}setHighlight(t){return this.nu=t,this.Dn.Ir(t),this.P.emit("highlight",t),this.Lr.Bi(),this}setMouseInteractions(t){return this.Dn.setMouseInteractions(t),this}getMouseInteractions(){return this.Dn.getMouseInteractions()}dispose(){return super.dispose(),this.Dn.dispose(),this}setVisible(t){return super.setVisible(t),this.Dn.setVisible(t),this}}class dn extends cn{constructor(){super(...arguments),this.$r=J}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.Dn.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}}class fn extends dn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Lr=t,this.Dn=this.Lr.vc(this.renderingScale,Ws.Simple).$h(this.getStrokeStyle()).ps(this.getFillStyle()).setVisible(!1),this.jl(this.Dn)}Mc(){const t=this._c();if(t.length>2){const e=ze(t),i=u(e.max.x-e.min.x,e.max.y-e.min.y);this.setContentSize(i);const s=t.map((t=>{const s=Ke(t,Ze(e.min,-1));return this.scale.Yt(this.position,Ke(s,Qe(Ze(Ke(this.origin,u(1,1)),-.5),i)))})).map((t=>nt(t,this.scale,this.renderingScale)));this.Dn.lo(s).setVisible(this.getVisible()).setVisible(this.getVisible())}else this.Dn&&this.Dn.setVisible(!1),this.setContentSize(u(0,0))}ru(){return super.ru(),this.ce||this.Mc(),this}Gs(){return this.Mc(),super.Gs()}setVisible(t){return super.setVisible(t),this.Dn.setVisible(t),this}}class gn extends cn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Kr="label",this.Dn=this.Lr.ue(this.renderingScale).ps(this.Vr).fs(this.Kr),this.jl(this.Dn)}ru(){const t=this.getPosition(u(0,0),e.UISpace.Content),i=nt(t,this.scale,this.renderingScale);return this.Dn.Sn(i),this}Gs(){this.Dn.Gs();const t=0===this.Kr.length?u(0,0):this.Dn.Ac();return this.setContentSize(t),super.Gs()}setText(t){return this.Kr=t,this.Dn.fs(this.Kr),this.Lr.Bi(),this}getText(){return this.Kr}setFont(t){return this.Dn.Ss(t),this.Lr.Bi(),this}getFont(){return this.Dn.ys()}setTextRotation(t){return this.Dn.xs(t),this.Lr.Bi(),this}getTextRotation(){return this.Dn.bs()}}const mn={...rn,...on,uiElement:gn};class pn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.fitTo=this.au.bind(this),this.setSize=this.fitTo,this.Dn=this.Lr.gc(e).ps(this.Vr).$h(this.getStrokeStyle()),this.jl(this.Dn)}ru(){const t=ze([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.Dn.q(i).Sn(nt(this.getPosition(u(-1,-1),e.UISpace.Content),this.scale,this.renderingScale)),this}au(t){return this.setContentSize(t),this.Lr.Bi(),this}lu(){return 0}uu(){return 0}du(){return 0}cu(){return 0}}class yn extends dn{constructor(t,e,i,s,r){super(t,e,i,s,r),this.wc=u(0,0),this.setSize=this.fitTo.bind(this),this.Dn=t.kc(e).Zo(0).Ko(360).ps(this.Vr).$h(this.getStrokeStyle()),this.jl(this.Dn)}ru(){const t=this.getSize(e.UISpace.Content).x/2;return this.Dn.Jo(t*this.renderingScale.yi().x).Qo(t*this.renderingScale.yi().y).Sn(nt(this.getPosition(u(0,0),e.UISpace.Content),this.scale,this.renderingScale)).ia(255).Gs(),this}au(t){const e=Math.sqrt(t.x*t.x/4+t.y*t.y/4);return this.setContentSize(u(2*e,2*e)),this.wc=t,this.Lr.Bi(),this}lu(){return(this.getSize(e.UISpace.Content).x-this.wc.x)/2}uu(){return(this.getSize(e.UISpace.Content).x-this.wc.x)/2}du(){return(this.getSize(e.UISpace.Content).y-this.wc.y)/2}cu(){return(this.getSize(e.UISpace.Content).y-this.wc.y)/2}fitTo(t){const e=Math.min(t.x,t.y);return this.setContentSize(u(e,e)),this.wc=t,this}}class xn extends fn{constructor(t,e,i,s,r){super(t,e,i,Ws.Simple,s,r),this.Cc=y(u(0,0)),this.Tc=!1,this.setSize=this.fitTo.bind(this),this.Lr=t,this.Mc()}_c(){const t=this.Cc.M();if(this.Tc){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.Cc.M().x*this.Cc.M().x/4+this.Cc.M().y*this.Cc.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=Ke(r,Ke(i,s)),o=Ke(n,Ke(s,Ze(i,-1)));return[r,n,o,Je(o,Ke(i,s))]}au(t){return this.Cc.S(t),this.Tc=!1,this.Lr.Bi(),this}lu(){return this.Tc?0:(this.getSize(e.UISpace.Content).x-this.Cc.M().x)/2}uu(){return this.Tc?0:(this.getSize(e.UISpace.Content).x-this.Cc.M().x)/2}du(){return this.Tc?0:(this.getSize(e.UISpace.Content).y-this.Cc.M().y)/2}cu(){return this.Tc?0:(this.getSize(e.UISpace.Content).y-this.Cc.M().y)/2}fitTo(t){return this.Cc.S(t),this.Tc=!0,this.Lr.Bi(),this}}class Sn extends fn{constructor(t,i,s,r,n){super(t,i,s,Ws.Simple,r,n),this.Ic=y(u(0,0)),this.Fc=y(10),this.Pc=y(void 0),this.Su=y(e.UIDirections.Right),this.Mc()}setDirection(t){return this.Su.S(t),this.Lr.Bi(),this}getDirection(){return this.Su.M()}setPointerLength(t){return this.Fc.S(t),this.Lr.Bi(),this}getPointerLength(){return this.Fc.M()}setPointerAngle(t){return this.Pc.S(t),this.Lr.Bi(),this}getPointerAngle(){let t=this.Pc.M();if(void 0===t){const e=this.Dc();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)}au(t){return this.Ic.S(t),this.Lr.Bi(),this}Bc(){const t=this.getPointerAngle();return 0===t?0:2*this.getPointerLength()/Math.tan(t*Math.PI/180)}Lc(){return qt(this.Su.M())?this.Ic.M().x:this.Ic.M().y}Dc(){return qt(this.Su.M())?this.Ic.M().y:this.Ic.M().x}lu(){switch(this.Su.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.Bc()-this.Dc());default:return 0}}uu(){switch(this.Su.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.Bc()-this.Dc());default:return 0}}du(){switch(this.Su.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Bc()-this.Dc());case e.UIDirections.Up:return this.getPointerLength();case e.UIDirections.Down:default:return 0}}cu(){switch(this.Su.M()){case e.UIDirections.Right:case e.UIDirections.Left:return Math.max(0,this.Bc()-this.Dc());case e.UIDirections.Up:return 0;case e.UIDirections.Down:return this.getPointerLength();default:return 0}}_c(){const t=Yt(this.Su.M()),e=$e(u(0,0),t),i=this.getPointerLength(),s=this.Bc(),r=this.Lc(),n=this.Dc();if(!(0!==i&&0!==s||0!==r&&0!==n))return[];const o=u(0,0),h=Ke(Ke(o,Ze(t,-i)),Ze(e,s/2)),a=Ke(h,Ze(e,(n-s)/2)),l=Ke(a,Ze(t,-r)),c=Ke(Ke(o,Ze(t,-i)),Ze(e,-s/2)),d=Ke(c,Ze(e,-(n-s)/2)),f=Ke(d,Ze(t,-r));let g;return g=0===r||0===n?[o,h,c]:0===i||0===s?[a,l,f,d]:Mt(n,s)?[o,h,l,f,c]:[o,h,a,l,f,d,c],g}}class vn extends an{setSize(t){return this.setContentSize(t),this.Lr.Bi(),this}}class bn extends Yr{constructor(){super(...arguments),this.Oc=[],this.Rc=0,this.Ec=t=>{const e=this.Oc.indexOf(t);e>=0&&this.Oc.splice(e,1)}}getMembers(){return this.Oc}getMemberCount(){return this.Oc.length}setMinimumSize(t){return this.zc=t,this.Lr.Bi(),this}getMinimumSize(){return this.zc}addElement(t,e=-1){const i=t.wu(this.Lr,this.renderingScale,this.scale,this.Ec,this.hs,!1);return i.setMouseInteractions(this.getMouseInteractions()),e>=0?this.Oc.splice(e,0,i):this.Oc.push(i),i.setVisible(this.getVisible()),this.jl(i),this.ce&&(de(0,(()=>{})),i.dispose()),i}dispose(){return super.dispose(),this.Oc.slice().forEach(vt),this}setVisible(t){return super.setVisible(t),this.Oc.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.Rc)/i:0;return this.Oc.reduce(((e,i)=>i instanceof vn?this.scale.Yt({x:e,y:t.y},{x:s+i.getSize().x,y:0}).x:i.setOrigin(u(-1,1)).setPosition(u(e,t.y)).ru().getPosition(u(1,0)).x),t.x),this}Gs(){for(let t=0;tt+ +(e instanceof vn)),0),s=i>0?(this.size.y-this.Rc)/i:0;return this.Oc.reduce(((e,i)=>i instanceof vn?this.scale.Yt({x:t.x,y:e},{x:0,y:-(s+i.getSize().y)}).y:i.setOrigin(u(-1,1)).setPosition(u(t.x,e)).ru().getPosition(u(0,-1)).y),t.y),this}Gs(){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},Cn=In("Text",[]),Pn={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()}},Ln={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()}},Rn={...rn,...nn,background:pn,wu(t,e,i,s,r,n){const o=new Mn(t,e,i,this.background,s,r),h=o.addElement(mn,void 0),a=Object.assign(o,kn,{setTextLabel:h},Cn,{stylableTexts:[h]});return sn(a,r,n),this.applyStylers(a,r)}}.addStyler(tn),Fn={...rn,...nn,background:Sn,wu(t,i,s,r,n,o){const h=new Mn(t,i,s,this.background,r,n),a=h.addElement(mn,void 0),l=h.getBackground(),u=Object.assign(h,kn,{setTextLabel:a},Cn,{stylableTexts:[a]},Ln,{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.ku="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))),sn(u,n,o),this.applyStylers(u,n)}};class _n extends Wr{constructor(t,e,i,s,n,o,h){super(t,e,i,o,h),this.xl=!1,this.P=new r.Eventer,this.getOn=()=>this.xl,this.Nc=this.jl(new s(this.Lr,this.renderingScale,this.scale,bt,h)),this.Gc=this.jl(new n(this.Lr,this.renderingScale,this.scale,bt,h))}hu(){return[...this.Nc.hu(),...this.Gc.hu()]}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}setOn(t){return this.xl=t,this.Lr.Bi(),this}setOffFillStyle(t){return this.Nc.setFillStyle(t),this}getOffFillStyle(){return this.Nc.getFillStyle()}setOffStrokeStyle(t){return this.Nc.setStrokeStyle(t),this}getOffStrokeStyle(){return this.Nc.getStrokeStyle()}setOffSize(t){return this.Nc.fitTo("number"==typeof t?u(t,t):t),this}getOffSize(){return this.Nc.getSize()}setOnFillStyle(t){return this.Gc.setFillStyle(t),this}getOnFillStyle(){return this.Gc.getFillStyle()}setOnStrokeStyle(t){return this.Gc.setStrokeStyle(t),this}getOnStrokeStyle(){return this.Gc.getStrokeStyle()}setOnSize(t){return this.Gc.fitTo("number"==typeof t?u(t,t):t),this}getOnSize(){return this.Gc.getSize()}ru(){return super.ru(),this.xl?(this.Nc.setVisible(!1),this.Gc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).ru()):(this.Nc.setVisible(this.getVisible()).setPosition(this.getPosition(u(0,0),e.UISpace.Content)).ru(),this.Gc.setVisible(!1)),this}Gs(){const t=this.Nc.Gs().getSize(),e=this.Gc.Gs().getSize();return this.setContentSize(u(Math.max(t.x,e.x),Math.max(t.y,e.y))),super.Gs()}dispose(){return super.dispose(),this.Nc.dispose(),this.Gc.dispose(),this}setMouseInteractions(t){return this.Gc.setMouseInteractions(t),this.Nc.setMouseInteractions(t),this}getMouseInteractions(){return this.Gc.getMouseInteractions()}setHighlight(t){const e=me(t);return this.Gc.setHighlight(e),this.Nc.setHighlight(e),this.P.emit("highlight",t),this.Lr.Bi(),this}getHighlight(){return this.Gc.getHighlight()}}const On={...rn,uiElement:_n,pictureOff:yn,pictureOn:yn,setPictureOff(t){return{...this,pictureOff:t}},setPictureOn(t){return{...this,pictureOn:t}},wu(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.pictureOff,this.pictureOn,s,r),r);return sn(o,r,n),o}},zn={...rn,...nn,background:pn,buttonBuilder:On,setPictureOff(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOff(t)}},setPictureOn(t){return{...this,buttonBuilder:this.buttonBuilder.setPictureOn(t)}},wu(t,i,s,r,n,o){const h=new Mn(t,i,s,this.background,r,n),a=h.addElement(En);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(En);u.addGap();const c=u.addElement(mn);u.addGap(),h.addGap();const d=Object.assign(h,kn,{setTextLabel:c},Cn,{stylableTexts:[c]},Pn,{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}),sn(d,n,o),this.applyStylers(d,n)}}.addStyler(tn).addStyler(en);class Vn extends Wr{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Hc=[],this.Wc=2,this.Uc="",this.$c=(t,e)=>void 0!==t.label?t.label:vi(t.value,e.min,e.max),this.Yc=0,this.Xc=0,this.jc=!1,this.Lr=t,this.Zc=n,this.Kc=this.jl(t.gc(e).$h(J)),this.qc=this.jl(t.ue(e).ps(r.uiTextFillStyle).Ss(r.uiTextFont).setMouseInteractions(!1)),"vertical"===n?(this.Jc=140,this.Qc=25):(this.Jc=160,this.Qc=15)}hu(){return[this.Kc,this.qc]}td(t){this.sd=t;const e=Un(t,"vertical"===this.Zc?0:90,this.jc);return this.Kc.ps(e),this.Lr.Bi(),this}ed(){return this.sd}hd(t){return this.Jc=t,this.Lr.Bi(),this}rd(){return this.Jc}nd(t){return this.Qc=t,this.Lr.Bi(),this}od(){return this.Qc}ad(t){return this.Uc=t,this.Lr.Bi(),this}ld(){return this.Uc}ud(t){return this.$c=t,this.Lr.Bi(),this}setLUTDisplayProportionalSteps(t){if(this.jc=t,this.sd){const t=Un(this.sd,"vertical"===this.Zc?0:90,this.jc);this.Kc.ps(t)}return this.Lr.Bi(),this}getLUTDisplayProportionalSteps(){return this.jc}setFillStyle(t){return this.qc.ps(t),this.Lr.Bi(),this}getFillStyle(){return this.qc.gs()}setFont(t){return this.qc.Ss(t),this.Lr.Bi(),this}getFont(){return this.qc.ys()}setTextRotation(t){return this.Xc=t,this.qc.xs(t),this.Lr.Bi(),this}getTextRotation(){return this.qc.bs()}ru(){var t,i,s,r;if(super.ru(),this.ce)return this;const n=this.sd;if(n){const o=this.renderingScale.yi(),h=n.min,a=n.max;if("vertical"===this.Zc){const s=this.getPosition({x:-1,y:-1},e.UISpace.Content),r=Ke(s,{x:this.Kc.Et().x+this.Wc*o.x,y:0}),l={x:r.x,y:r.y+(this.Uc.length>0?this.Yc*o.y+this.qc.Et().y:0)+.5*((null===(t=this.Hc[0])||void 0===t?void 0:t.Et().y)||0)},u={x:l.x,y:this.getPosition({x:-1,y:1},e.UISpace.Content).y-.5*((null===(i=this.Hc[this.Hc.length-1])||void 0===i?void 0:i.Et().y)||0)};this.Kc.Sn({x:s.x,y:l.y}),this.qc.kn({x:-1,y:-1}).Sn(r),n.getSteps().forEach(((t,e)=>{const i=_e(l,u,this.jc?!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.Hc[e].kn({x:-1,y:0}).Sn(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.Hc.reduce(((t,e)=>Math.max(t,e.Et().y)),0),u=Ke(t,{x:.5*((null===(s=this.Hc[0])||void 0===s?void 0:s.Et().x)||0),y:l}),c={x:i.x,y:u.y},d={x:c.x-(.5*((null===(r=this.Hc[this.Hc.length-1])||void 0===r?void 0:r.Et().x)||0)+(this.Uc.length>0?this.Yc*o.x+this.qc.Et().x:0)),y:u.y},f={x:u.x,y:u.y+this.Wc*o.y};this.Kc.Sn(f),this.qc.kn({x:1,y:1}).Sn(c),n.getSteps().forEach(((t,e)=>{const i=_e(u,d,this.jc?!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.Hc[e].kn({x:0,y:1}).Sn(i)}))}}return this}Gs(){if(this.sd&&this.getVisible()){const t=this.sd.getSteps();for(let e=this.Hc.length;eMath.max(t,e.Gs().Ac().x)),0),this.qc.Gs().Ac().x),s=(this.Uc.length>0?this.Yc+this.qc.Gs().Ac().y:0)+e+.5*this.Hc[0].Gs().Ac().y+.5*this.Hc[this.Hc.length-1].Gs().Ac().y;this.setContentSize({x:i,y:s})}else{const t=this.Jc,e=this.Qc;this.Kc.q({x:t*this.renderingScale.x.getPixelSize(),y:e*this.renderingScale.y.getPixelSize()});const i=Math.max(this.Uc.length>0?this.Yc+this.qc.Gs().Ac().x:0,.5*this.Hc[this.Hc.length-1].Gs().Ac().x),s=t+.5*this.Hc[0].Gs().Ac().x+i,r=e+this.Wc+this.Hc.reduce(((t,e)=>Math.max(t,e.Gs().Ac().y)),0);this.setContentSize({x:s,y:r})}}else this.Hc.forEach((t=>t.dispose())),this.Hc.length=0,this.qc.setVisible(!1),this.Kc.setVisible(!1),this.setContentSize({x:0,y:0});return super.Gs()}dispose(){return super.dispose(),this.Kc.dispose(),this.Hc.forEach(vt),this.qc.dispose(),this}setMouseInteractions(t){return this.Kc.setMouseInteractions(t),this}getMouseInteractions(){return this.Kc.getMouseInteractions()}}const Nn={lutElement:{},setLUT(t){return this.lutElement.td(t),this},getLUT(){return this.lutElement.ed()},setLUTLength(t){return this.lutElement.hd(t),this},getLUTLength(){return this.lutElement.rd()},setLUTThickness(t){return this.lutElement.nd(t),this},getLUTThickness(){return this.lutElement.od()},setLookUpUnit(t){return this.lutElement.ad(t),this},getLookUpUnit(){return this.lutElement.ld()},setLUTStepValueFormatter(t){return this.lutElement.ud(t),this},setLUTDisplayProportionalSteps(t){return this.lutElement.setLUTDisplayProportionalSteps(t),this},getLUTDisplayProportionalSteps(){return this.lutElement.getLUTDisplayProportionalSteps()}},Gn={...rn,...nn,background:pn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},wu(t,e,i,s,r,n){const o=new An(t,e,i,this.background,s,r),h=o.addElement({wu:()=>new Vn(t,e,i,bt,r,this.alignment)}),a=Object.assign(o,Cn,{stylableTexts:[h]},Nn,{lutElement:h});return sn(a,r,n),this.applyStylers(a,r)}}.addStyler(tn),Un=(t,e,i)=>{const s=t.getSteps(),r=t.min,n=t.max-r;if(!0===t.getInterpolation())return new Z({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 Vn(t,i,s,bt,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,kn,{setTextLabel:c},Cn,{stylableTexts:[c,d]},In("LUTText",[d]),Pn,{button:l},Nn,{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(tn).addStyler(en),Wn={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 mo?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.ed&&t.ed();let r=i;r||(r=s?Hn.setAlignment(this.alignment):zn);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.dd().forEach((t=>this.addAttachable(t,e,i))),this},addDashboard(t,e,i){return t.getCells().filter((t=>t.panel instanceof mo)).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}},Yn={alignment:"vertical",layoutBuilder:En,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Bn:En}},getAlignment(){return this.alignment},titleBuilder:Rn,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},qn={...rn,...nn,...Yn,background:pn,wu(t,e,i,s,r,n){const o=this.layoutBuilder.setBackground(this.background).wu(t,e,i,s,r,!1);let h=Object.assign(o,Wn,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.ce});h.entries=[];const a=h.addElement("horizontal"===this.alignment?En:Bn),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}),sn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Xn extends Wr{constructor(t,i,s,r,n){super(t,i,s,r,n),this.fd=10,this.gd=e.UIDirections.Up,this.pd=0,this.ku="major",this.Kr=this.jl(t.ue(this.renderingScale)),this.xc=this.jl(t._u(this.renderingScale))}hu(){return[this.Kr]}ru(){if(super.ru(),this.ce)return this;const t=nt(this.getPosition(),this.scale,this.renderingScale),i=this.renderingScale.Yt(t,{x:this.gd===e.UIDirections.Right?-this.fd:this.gd===e.UIDirections.Left?this.fd:0,y:this.gd===e.UIDirections.Up?-this.fd:this.gd===e.UIDirections.Down?this.fd:0}),s=this.renderingScale.Yt(i,{x:this.gd===e.UIDirections.Right?-this.pd:this.gd===e.UIDirections.Left?this.pd:0,y:this.gd===e.UIDirections.Up?-this.pd:this.gd===e.UIDirections.Down?this.pd:0});return this.xc.la(t).Ko(i),this.Kr.Sn(s).kn(this.gd===e.UIDirections.Up?{x:0,y:1}:this.gd===e.UIDirections.Down?{x:0,y:-1}:this.gd===e.UIDirections.Right?{x:1,y:0}:{x:-1,y:0}),this}Gs(){const t=this.xc.ha(),i=t instanceof tt?t.getThickness():0;return this.size=this.gd===e.UIDirections.Left||this.gd===e.UIDirections.Right?{x:this.fd+this.pd+this.Kr.Gs().Ac().x,y:i}:{y:this.fd+this.pd+this.Kr.Gs().Ac().y,x:i},super.Gs()}dispose(){return super.dispose(),this.Kr.dispose(),this.xc.dispose(),this}setVisible(t){return super.setVisible(t),this.Kr.setVisible(t),this.xc.setVisible(t),this}setMouseInteractions(t){return this.Kr.setMouseInteractions(t),this.xc.setMouseInteractions(t),this}getMouseInteractions(){return this.Kr.getMouseInteractions()}getText(){return this.Kr.cs()}setTextFillStyle(t){return this.Kr.ps(t),this.Lr.Bi(),this}getTextFillStyle(){return this.Kr.gs()}setTextFont(t){return this.Kr.Ss(t),this}setTextRotation(t){return this.Kr.xs(t),this}getTextRotation(){return this.Kr.bs()}getTextFont(){return this.Kr.ys()}setText(t){return this.Kr.fs(t),this.Lr.Bi(),this}setDirection(t){return this.gd=t,this.Lr.Bi(),this}getDirection(){return this.gd}setPointerLength(t){return this.fd=t,this.Lr.Bi(),this}getPointerLength(){return this.fd}setTickLabelPadding(t){return this.pd=t,this.Lr.Bi(),this}getTickLabelPadding(){return this.pd}setTickStyle(t){return this.xc.ea(t),this.Lr.Bi(),this}getTickStyle(){return this.xc.ha()}}const $n={...rn,wu(t,e,i,s,r,n){const o=new Xn(t,e,i,s,r);return sn(o,r,n),this.applyStylers(o,r)}}.addStyler(tn),jn=$n.addStyler(((t,e)=>(t.ku="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)))),Zn=$n.addStyler(((t,e)=>(t.ku="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)))),Kn=zn.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),Jn=qn.setAlignment("horizontal"),Qn=qn.setAlignment("vertical"),to={TextBox:Rn,CheckBox:zn,ButtonBox:Kn,PointableTextBox:Fn,AxisTickMajor:jn,AxisTickMinor:Zn,LUTRange:Gn},eo={HorizontalLegendBox:Jn,VerticalLegendBox:Qn};class io extends Gi{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this.md=r,this.yd=n}}const so=(t,e,i)=>At(t+.1*(e-t)+.5*i.getPixelSize()*Math.sign(e-t),t,e),ro=(t,e,i)=>{const s=i.ut(t),r=i.ut(e);return At(i.ot(s+.1*(r-s)+.5*Math.sign(r-s)),t,e)};class no extends Ni{constructor(t,i,s,n,o,h,a,l,c,d,f,g,m,p,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.Sd=new Map,this.xd=void 0,this.bd=0,this.vd=[],this.Md=[],this.Fi=Bi.fitting,this._d=!0,this.Ad=0,this.wd=8,this.kd=void 0,this.Cd=void 0,this.Td=20,this.Id=1,this.Fd=!0,this.Pd=!0,this.Dd=!0,this.Bd=!0,this.Ld=!0,this.Od=!0,this.Rd=!0,this.Ed=!0,this.zd=!0,this.Vd=!0,this.Nd=this.es.defaultDragMouseStyle,this.Gd=this.es.defaultDragMouseStyle,this.Hd=this.es.defaultDragMouseStyle,this.Wd=this.es.defaultDragMouseStyle,this.Ud=this.es.defaultDragMouseStyle,this.P=new r.Eventer,this.$d=[],this.Yd=t=>{const e=this.Md.indexOf(t);e>=0&&this.Md.splice(e,1)},this.Xd=t=>(this.Md.indexOf(t)<0&&this.Md.push(t),this.Yd),this.qu=(t,e)=>this.P.emit("axisAreaTouch",this,e),this.jd=Zt(this.$d),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.Zd=(t,e)=>e.getAllocatesAxisSpace()?Math.max(t,e.update().Iu()):t,this.Kd=t=>{const e=this.vd.indexOf(t);-1!==e&&this.vd.splice(e,1)},this.qd=(t,e)=>{this.P.emit("axisAreaDoubleClick",this,e),this.Bd&&(this.setStopped(!1),Xt(e))},this.Jd=t=>{this.P.emit("axisAreaMouseEnter",this),(this.Pd||this.Fd||this.Dd||this.Bd)&&this.Qd(t)},this.tf=t=>{this.if(t),this.P.emit("axisAreaMouseLeave",this)},this.sf=(t,e,i)=>{var s,r;this.P.emit("axisAreaMouseDragStart",this,e,i);const n=kt(null===(s=this.chart.ef.Ih)||void 0===s?void 0:s.axisXYZoomMouseButton,0),o=kt(null===(r=this.chart.ef.Ih)||void 0===r?void 0:r.axisXYPanMouseButton,2),h=u(e.clientX,e.clientY);i===o&&this.Pd?(this.hf(t),Xt(e)):i===n&&this.Fd&&(this.rf(t,h),Xt(e))},this.nf=(t,e,i,s,r)=>{var n,o;this.P.emit("axisAreaMouseDrag",this,e,i,s,r);const h=kt(null===(n=this.chart.ef.Ih)||void 0===n?void 0:n.axisXYZoomMouseButton,0),a=kt(null===(o=this.chart.ef.Ih)||void 0===o?void 0:o.axisXYPanMouseButton,2),l=u(e.clientX,e.clientY);i===a&&this.Pd?(this.af(t,r),Xt(e)):i===h&&this.Fd&&(this.lf(t,s,l,r),Xt(e))},this.uf=(t,e,i,s)=>{var r,n;this.P.emit("axisAreaMouseDragStop",this,e,i,s);const o=kt(null===(r=this.chart.ef.Ih)||void 0===r?void 0:r.axisXYZoomMouseButton,0),h=kt(null===(n=this.chart.ef.Ih)||void 0===n?void 0:n.axisXYPanMouseButton,2),a=u(e.clientX,e.clientY);i===h&&this.Pd?(this.cf(t),Xt(e)):i===o&&this.Fd&&(this.df(t,s,a),Xt(e)),t.getIsUnderMouse()&&(this.Pd||this.Fd||this.Dd||this.Bd)&&this.Qd(t)},this.ff=(t,e)=>{if(this.P.emit("axisAreaMouseWheel",this,e),this.Dd){this.setStopped(!0);const t=this.es.getWidth(this.gf.Li.ke(e.clientX,e.clientY)),i=this.ct.ot(t);this.zoom(i,ce(e)),Xt(e)}},this.pf=(t,e)=>this.P.emit("axisAreaMouseClick",this,e),this.mf=(t,e)=>this.P.emit("axisAreaMouseDown",this,e),this.yf=(t,e)=>this.P.emit("axisAreaMouseUp",this,e),this.Sf=(t,e)=>this.P.emit("axisAreaMouseMove",this,e),this.xf=(t,e,i)=>{this.P.emit("axisAreaTouchStart",this,i),this.Fd&&(this.Qd(t),this.rf(t,e),Xt(i))},this.bf=(t,e,i,s,r)=>{this.P.emit("axisAreaTouch",this,r),this.Fd&&(this.lf(t,e,i,s),Xt(r))},this.vf=(t,e,i,s)=>{this.P.emit("axisAreaTouchEnd",this,s),this.Fd&&(this.df(t,e,i),this.if(t),Xt(s))},this.Mf=(t,e,i,s)=>{(this.Pd||this.Dd)&&(this.Qd(t),this.hf(t),Xt(s))},this._f=(t,e,i,s,r,n)=>{if(this.Pd){const e=u((s.x+r.x)/2,(s.y+r.y)/2);this.af(t,e),Xt(n)}if(this.Dd){const t=this.gf.Li.ke(e.x,e.y),o=this.gf.Li.ke(i.x,i.y),h=Math.abs(this.es.getWidth(Je(t,s))-this.es.getWidth(Je(o,r)))-Math.abs(this.es.getWidth(t)-this.es.getWidth(o)),a=this.ct.Yt(this.ls,-h),l=this.ct.Yt(this.us,h);this.ss(a,l),Xt(n)}},this.Af=(t,e,i,s)=>{(this.Pd||this.Dd)&&(this.cf(t),this.if(t),Xt(s))},this.wf=(t,e)=>{(this.Ld||this.Od)&&this.kf(t)},this.Cf=(t,e)=>{this.Tf(t)},this.If=(t,e,i)=>{const s=u(e.clientX,e.clientY);this.Ld&&this.Ff(t,s)},this.Pf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Ld&&this.Df(t,n,s,r)},this.Bf=(t,e,i,s,r)=>{const n=u(e.clientX,e.clientY);this.Ld&&this.Lf(t,n,s,r)},this.Of=(t,e,i,s)=>{const r=u(e.clientX,e.clientY);(this.Ld||this.Od)&&this.Rf(t,r,s),(this.Ld||this.Od)&&this.kf(t)},this.Ef=(t,e)=>{this.Od&&(this.setStopped(!0),this.zoom(this.ls,ce(e)),Xt(e))},this.zf=(t,e)=>{this.Od&&(this.setStopped(!0),this.zoom(this.us,ce(e)),Xt(e))},this.Vf=(t,e,i)=>{this.Ld&&(this.kf(t),this.Ff(t,e),Xt(i))},this.Nf=(t,e,i,s,r)=>{this.Ld&&(this.Df(t,e,i,s),Xt(r))},this.Gf=(t,e,i,s,r)=>{this.Ld&&(this.Lf(t,e,i,s),Xt(r))},this.Hf=(t,e,i,s)=>{this.Ld&&(this.Rf(t,e,i),this.Tf(t),Xt(s))},this.md=t,this.Wf=i,this.gf=s,this.Uf=o,this.$f=h,this.chart=f,this.Yf=m,this.Xf=n,this.ic=a,p(this,this.Xd),l.jf=this,this.Zf=g,this.Kf=this.Zf>50?1:-1,this.qf=(v=this.es.toPoint(0,-this.Kf),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.Jf=c,this.Qf=this.ct instanceof Ai?(new Ti).ui(this.es.toVec2(this.ct,this.Jf)):(new Ei).ui(this.es.toVec2(this.ct,this.Jf)),this.tg=this.chart.pixelScale,this.ig=(new Ti).ui(this.es.toVec2(this.es.getWidth(this.tg),this.Jf)),this.sg=this.gf._u(this.Qf).setMouseInteractions(!1),this.eg=this.gf._u(this.Qf).setMouseInteractions(!1),this.hg=this.gf._u(this.Qf).setMouseInteractions(!1),this.rg=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).$h(J).Pr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.ng=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisZoomingBandFillStyle,y:y.yAxisZoomingBandFillStyle})).$h(d.getWidth({x:y.xAxisZoomingBandStrokeStyle,y:y.yAxisZoomingBandStrokeStyle})),this.og=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).$h(J).Pr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.ag=this.Xf.gc(this.tg).ps(d.getWidth({x:y.xAxisOverlayStyle,y:y.yAxisOverlayStyle})).$h(J).Pr(y.highlightColorOffsetAxisOverlay||y.highlightColorOffset),this.ds=this.Xf.ue(this.Qf).setMouseInteractions(!1).xs(this.es.getTitleTextRotation(this.Kf)),this.chart.Li.Vh.Se(this.rg,(t=>this.rg.Ir(t)),{animationEnabled:this.Oi}),this.chart.Li.Vh.Se(this.og,(t=>this.og.Ir(t)),{animationEnabled:this.Oi}),this.chart.Li.Vh.Se(this.ag,(t=>this.ag.Ir(t)),{animationEnabled:this.Oi});const b=Fr(new Or(this.xf,this.bf,this.vf,1),new zr(this.Mf,this._f,this.Af),new _r(this.qd)),M=Fr(new Or(this.Vf,this.Nf,this.Hf)),A=Fr(new Or(this.Vf,this.Gf,this.Hf));this.rg.setMouseEnterEventHandler(this.Jd).setMouseLeaveEventHandler(this.tf).setMouseDragStartEventHandler(this.sf).setMouseDragEventHandler(this.nf).setMouseDragStopEventHandler(this.uf).setMouseWheelEventHandler(this.ff).setMouseDoubleClickEventHandler(this.qd).setMouseClickEventHandler(this.pf).setMouseDownEventHandler(this.mf).setMouseUpEventHandler(this.yf).setMouseMoveEventHandler(this.Sf).setTouchStartEventHandler(b.onTouchStart).setTouchMoveEventHandler(b.onTouchMove).setTouchEndEventHandler(b.onTouchEnd),this.og.setMouseEnterEventHandler(this.wf).setMouseLeaveEventHandler(this.Cf).setMouseDragStartEventHandler(this.If).setMouseDragEventHandler(this.Pf).setMouseDragStopEventHandler(this.Of).setMouseWheelEventHandler(this.Ef).setTouchStartEventHandler(M.onTouchStart).setTouchMoveEventHandler(M.onTouchMove).setTouchEndEventHandler(M.onTouchEnd),this.ag.setMouseEnterEventHandler(this.wf).setMouseLeaveEventHandler(this.Cf).setMouseDragStartEventHandler(this.If).setMouseDragEventHandler(this.Bf).setMouseDragStopEventHandler(this.Of).setMouseWheelEventHandler(this.zf).setTouchStartEventHandler(A.onTouchStart).setTouchMoveEventHandler(A.onTouchMove).setTouchEndEventHandler(A.onTouchEnd),this.sg.ea(d.getWidth({x:y.xAxisStrokeStyle,y:y.yAxisStrokeStyle})),this.eg.ea(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.hg.ea(d.getWidth({x:y.xAxisNibStyle,y:y.yAxisNibStyle})),this.ds.ps(d.getWidth({x:y.xAxisTitleFillStyle,y:y.yAxisTitleFillStyle})).Ss(d.getWidth({x:y.xAxisTitleFont,y:y.yAxisTitleFont})),this.iu=a.su(this,{}),this.Ms=this.iu.lg([this.ds]).vs(y.effectsText)}ae(){return this.Vi}le(){return void 0!==this.Fs}addBand(t=!0){const e=t?this.$f:this.Uf,i=new Jr(e,this.chart,this.jd,this,this.Qf,this.es,this.hs,this.ic);return this.$d.push(i),i}addConstantLine(t=!0){const e=t?this.$f:this.Uf,i=new Qr(e,this.chart,this.jd,this,this.Qf,this.es,this.hs,this.ic);return this.$d.push(i),i}ug(t){this.$d.forEach(t)}cg(t){return this.$d.map(t)}getHighlighters(){return this.$d}setThickness(t){return"number"==typeof t?(this.dg=t,this.gg=t):"object"==typeof t&&(this.dg=t.min,this.gg=t.max),this.md.Bi(),this}getThickness(){return{min:this.dg,max:this.gg}}setMouseInteractions(t){return this.setAxisInteractionPanByDragging(t).setAxisInteractionReleaseByDoubleClicking(t).setAxisInteractionZoomByDragging(t).setAxisInteractionZoomByWheeling(t).setNibInteractionScaleByDragging(t).setNibInteractionScaleByWheeling(t)}Js(){return this.Md}$s(t,e){return new io(e,t,this.gf,this.Qf,this.md,this.Qf)}As(){if(this.Sd){for(const t of this.Sd)t[1].grid.dispose(),t[1].tick.dispose();this.Sd.clear()}super.As()}Ys(t,e){const{tickStart:i}=e,s=t.qi.Ws,r=i+s.getTickLength()*this.Kf+s.getTickPadding()*this.Kf;t._i.Sn(this.es.toPoint(t.u,r)).kn(this.es.toPoint(s.getLabelAlignment(),-this.Kf)).xs(s.labelRotation).setVisible(this.getVisible())}pg(t,e){const{startPosition:i,gridStrokeLen:s,gridStrokeStart:r,tickStart:n}=e,o=t.qi.Ws,h=i-s*o.getGridStrokeLength(),a=n+o.getTickLength()*this.Kf;return{gridStroke:{start:this.es.toPoint(t.u,r),end:this.es.toPoint(t.u,h)},tickStroke:{start:this.es.toPoint(t.u,n),end:this.es.toPoint(t.u,a)}}}mg(t,e,i,s){return this.md._u(this.Qf).ea(new tt({fillStyle:new z({color:D(360*(1-s))}),thickness:5})).la(this.es.toVec2(t,0)).Ko(this.es.toVec2(t,this.Kf*(50*s)))}re(t,e){return"linear"===this.ns.type?so(t,e,this.ct):ro(t,e,this.ct)}yg(t,e){return e instanceof Ai?so:ro}oe(t,e,i){if("linear"===this.ns.type){const s=this.ct.li(e-t);return{min:t-i*s,max:e+i*s}}const s=this.ct;return{min:s.Yt(t,-i),max:s.Yt(e,i)}}ru(t,e,i){const s=this.sg.ha(),r=this.ct.getInnerStart()this.ct.getInnerStart()?this.ct.getInnerEnd():this.ct.getInnerStart(),o=this.ct.Ot(),h=this.Jf.getInnerInterval(),a=s instanceof tt?s.getThickness()*this.Kf/2:0,l=this.Zf/100*h,u=l+t,c=u+a,d=h*this.Kf,f=c+a,g=this.vd.reduce(this.Zd,0);let m,p=0;if(this.ki!==Pi){const t=this.ct.Ot();this.Bs({physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});for(const[e,i]of this.Ti){let s=this.Sd.get(e);if(!s)if(e.xi)s={grid:this.md.Sg(this.Qf).setMouseInteractions(!1),tick:this.md.Sg(this.Qf).setMouseInteractions(!1)};else if("xg"in e){const t=Array.from(this.Ti.keys()).filter((t=>"xg"in t)).reverse().indexOf(e),i=this.Wf[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.Sg(this.Qf).setMouseInteractions(!1),tick:i.Sg(this.Qf).setMouseInteractions(!1)}}if(s){s.grid.qn(),s.tick.qn();for(const[e,r]of i){const e=this.pg(r,{physicalAxisSize:t,startPosition:l,gridStrokeLen:d,gridStrokeStart:u,tickStart:f});s.grid.Kn(e.gridStroke.start,e.gridStroke.end),s.tick.Kn(e.tickStroke.start,e.tickStroke.end)}s.grid.ea(e.Ws.getGridStrokeStyle()),s.tick.ea(e.Ws.getTickStyle()),this.Sd.set(e,s)}}for(const t of this.Ti.values()){let e=Ae;for(const i of t.values()){const t=i.qi.Ws,s=this.es.getHeight(i._i.Et()),r=t.getTickLength()+t.getTickPadding()+s+t.getLabelPadding();e=Math.max(e,r)}p=Math.max(p,e)}m=f+Math.max(p,g)*this.Kf}else p=0,m=f+g*this.Kf;this.sg.la(this.es.toPoint(r,c)).Ko(this.es.toPoint(n,c)),this.eg.la(this.es.toPoint(this.ct.Yt(this.ct.getInnerStart(),this.wd),c)).Ko(this.es.toPoint(this.ct.getInnerStart(),c)),this.hg.la(this.es.toPoint(this.ct.Yt(this.ct.getInnerEnd(),-this.wd),c)).Ko(this.es.toPoint(this.ct.getInnerEnd(),c));const y=this.ds&&this.ds.cs().length>0?this.es.getHeight(this.ds.Gs().Et()):0,x=m+.5*y*this.Kf;this.ds.Sn(this.es.toPoint(this.ct.Yt(this.ct.getInnerStart(),o/2),x));const S=f,v=S+this.Kf*this.bd,b=this.Ld||this.Od?Math.min(this.Td,.25*o):0,M={start:this.es.toVec2(this.ct.Yt(this.ct.getInnerStart(),b),S),end:this.es.toVec2(this.ct.Yt(this.ct.getInnerEnd(),-b),v)};if(this.xd){const e=this.Zf/100*h+t,i=-this.Kf*h-t,s={start:this.es.toVec2(this.xd.min,f+this.Kf*this.bd),end:this.es.toVec2(this.xd.max,e+i)},r=nt(s.start,this.Qf,this.tg),n=nt(s.end,this.Qf,this.tg);this.ng.Sn(r).q(Je(n,r)).setVisible(!0)}else this.ng.setVisible(!1);const A=nt(this.es.toVec2(this.ct.getInnerStart(),v),this.Qf,this.tg),w=nt(M.start,this.Qf,this.tg),D=nt(M.end,this.Qf,this.tg),T=nt(this.es.toVec2(this.ct.getInnerEnd(),S),this.Qf,this.tg);this.rg.Sn(w).q(Je(D,w)),this.og.Sn(A).q(Je(w,A)),this.ag.Sn(D).q(Je(T,D));for(const e of this.vd)e.update().plot(u,d,t,f);for(const t of this.$d)t.ru();const E=(s instanceof tt?s.getThickness():0)+Math.max(p,g)+(this.ds&&this.ds.cs().length>0?y+this.Ad:0);return this.bd=At(E,void 0!==this.dg?this.dg:0,void 0!==this.gg?this.gg:Me),this}bg(t){const e=this.sg.ha(),i=e instanceof tt?e.getThickness()*this.Kf/2:0,s=this.Jf.getInnerInterval(),r=this.Zf/100*s+t,n=r+i,o=s*this.Kf,h=n+i;for(const e of this.vd)e.update().plot(r,o,t,h);for(const t of this.$d)t.ru()}vg(){return this.bd}Mg(t,e){e=e||to.AxisTickMajor;const i=new $r(this,t?this.md:this.Xf,this.Xf,this.ct,this.ig,this.ig,this.es,this.qf,this.Kd,this.hs,e).setTextFormatter(this.formatValue);return this.vd.push(i),i}Qd(t){this.chart.Li.Vh.xe(t,1),this.kd=t.Li.Ae(this.Nd,this.kd)}if(t){this.chart.Li.Vh.xe(t,0),t.Li.we(this.kd)}hf(t){this.setStopped(!0),t.Li.we(this.kd)}af(t,e){const i=-this.es.getWidth(e);this.pan(i),this.kd=t.Li.Ae(this.Gd,this.kd)}pan(t){const e=this.ls,i=this.us,s=this.ct.Yt(e,t),r=this.ct.Yt(i,t);this.ss(s,r,{allowClamping:!1})}zoom(t,e){const i=this.ct.ut(this.ls),s=this.ct.ut(this.us),r=this.ct.ut(t),n=At((r-i)/(s-i),0,1),o=.2*this.ct.Ot(),h=n*this.Id*o*-e,a=(1-n)*this.Id*o*e,l=this.ct.Yt(this.ls,h),u=this.ct.Yt(this.us,a);this.ss(l,u)}cf(t){this.xd=void 0,t.Li.we(this.kd)}rf(t,e){this.setStopped(!0),t.Li.we(this.kd),this.chart.Li.Vh.xe(this.rg,0)}lf(t,e,i,s){const r=nt(this.gf.Li.ke(i.x,i.y),this.gf.Li.ct,this.Qf),n=At(this.es.getWidth(r),this.ls,this.us),o=this.es.getWidth(nt(this.gf.Li.ke(e.x,e.y),this.gf.Li.ct,this.Qf)),h=Pe(this.es.getHeight(r),this.es.getHeight(nt(this.rg.xn(),this.tg,this.Qf)),this.es.getHeight(nt(Ke(this.rg.xn(),this.rg.Et()),this.tg,this.Qf)));Math.abs(this.ct.ut(n)-this.ct.ut(o))>10&&h?(this.xd=m(Math.min(n,o),Math.max(n,o)),this.kd=t.Li.Ae(this.Hd,this.kd)):(this.xd=void 0,this.kd=t.Li.Ae(this.Nd,this.kd)),this.gf.Bi()}df(t,e,i){if(this.xd){const t=this.xd.min,e=this.xd.max,i=this.us{e.Us(t)}));for(const e of this.Sd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.md.Bi(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationHighlight(this.Oi),this}}const oo=(t,e)=>t instanceof gi||e instanceof gi?(new Ei).ui(t,e):(new Ti).ui(t,e),ho=(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(gt.navigator.msSaveBlob)gt.navigator.msSaveBlob(r,e);else{const t=gt.document.createElement("a");gt.document.body.appendChild(t);const i=gt.URL.createObjectURL(r);t.href=i,t.download=e,t.click(),setTimeout((()=>{gt.URL.revokeObjectURL(i),gt.document.body.removeChild(t)}),0)}},ao=(t,i,s,r,n,o)=>{const h=t.wu(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},lo=t=>{if(t instanceof Di)return t;const e=t.x instanceof no?t.x.ct:t.x.x,i=t.y instanceof no?t.y.ct:t.y.y;return oo(e,i)};class uo{constructor(t,e,i,s,n,o,h,a){this._g=[],this.Ag=[],this.P=new r.Eventer,this.wg=void 0,this.kg=void 0,this.Cg=void 0,this._t=x(0,0,0,0),this.ce=!1,this.Tg=()=>{this.Ig=!0,this.Fg.Bi()},this.Pg=t=>e=>{const i=this._g.indexOf(e);-1!==i&&this._g.splice(i,1),this.Li.Bi(),t.G()},this.Dg=t=>{const e=this.Ag.indexOf(t);-1!==e&&this.Ag.splice(e,1),this.Li.Bi()},this.Ig=!0,this.onResize=t=>this.P.on("resize",t),this.offResize=t=>this.P.off(t,"resize"),this.ef=t,this.Bg=i,this.Fg=s,this.removePanel=n,this.hs=e.Li.hs;const l=e.Li.Et();this.uiScale=i.d2({scaleXYConstructor:Ti}).fi(0,100).gi(0,100).q(l),this.pixelScale=i.d2({scaleXYConstructor:Ti}).fi(0,this.uiScale.x.getCellSize()).gi(0,this.uiScale.y.getCellSize()).q(l),this.engine=e.Li.Lg,this.Li=e.Li.Og,this.iu=this.Li.iu.su(this,{}),this.Rg=()=>e.Eg("unidentified ui"),this.zg=e.Vg(),this.Ng=this.Fg.gc(this.uiScale).Sn(u(0,0)).q(u(100,100)).ps(o).$h(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.Li.cr(this.Tg);if(this.Gg=e.Li.dr.bind(e.Li,c),a){const t=a.on(this.Tg);this.Hg=()=>a.off(t)}this.wg=n}getTheme(){return this.hs}setBackgroundFillStyle(t){return this.Ng.ps(t),this.Fg.Bi(),this}getBackgroundFillStyle(){return this.Ng.gs()}setBackgroundStrokeStyle(t){return this.Ng.$h(t),this.Fg.Bi(),this}getBackgroundStrokeStyle(){return this.Ng.Yh()}Wg(t){return this._g.push(t),this.Li.Bi(),t}Ug(t){return this.Ag.push(t),this.Li.Bi(),t}addUIElement(t=Rn,e=this.uiScale){e=lo(e);const i=this.Rg();return this.Wg(ao(t,i,this.uiScale,e,this.Pg(i),this.hs))}addLegendBox(t=qn,i=this.uiScale){i=lo(i);const s=this.Ug(ao(t,this.zg,this.uiScale,i,this.Dg,this.hs));return s.setDraggingMode(e.UIDraggingModes.notDraggable),void 0!==i&&i!==this.uiScale||(void 0===t||"vertical"===t.getAlignment()?s.setOrigin(wr.RightCenter).setPosition({x:100,y:50}):s.setOrigin(wr.CenterBottom).setPosition(this.uiScale.Yt({x:50,y:0},{x:0,y:3}))),s}dispose(){return this.ce||(this.ce=!0,this.Gg&&this.Gg(),this.Hg&&this.Hg(),co(this.uiScale),co(this.pixelScale),this.kg&&this.kg(),this.Fg.G(),this.zg.G(),this._g.slice().forEach((t=>{t.dispose()})),this.Ag.slice().forEach((t=>{t.dispose()})),this.Li.Bi(),this.wg&&this.wg(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 ho(this.engine,t,e,i),this}Cn(t){this._t=t,this.Tg()}X(){return this.pixelScale.X(),this.uiScale.X(),this}j(){return this.pixelScale.j(),this.uiScale.j(),this}ru(){if(this.Ig){const t=this.Fg.Li.Et(),e=t.x,i=t.y;this.uiScale.q(e,i),this.pixelScale.q(e,i);const s=[this._t.left,this._t.right],r=[this._t.bottom,this._t.top];this.uiScale.ci(s),this.uiScale.di(r);const n=this.uiScale.getInnerIntervalPixels();this.pixelScale.fi(0,n.x).ci(s).gi(0,n.y).di(r),this.P.emit("resize",this,n.x,n.y,e,i)}this.Ig=!1}$g(){for(let t=0;t{t.Pt&&t.Pt()};class fo extends uo{constructor(t,e,i,s,r,n){super(t,e,i,e.Xg("uipanel bg",0),s,e.Li.hs.uiPanelBackgroundFillStyle,e.Li.hs.uiPanelBackgroundStrokeStyle,n),this.Yg(r,this.pixelScale)}setMinimumSize(t){return this.zc=t,this.Li.Bi(),this}getMinimumSize(){return this.zc}ru(){super.ru(),super.$g()}}const go=x(10,10,10,10);class mo extends uo{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,n,o,h,c),this.jg={},this.rn=go,this.Oi=!0,this.Zg=r,this.Kg=this.Zg.ue(this.uiScale).fs("Chart").Sn(u(50,100)).kn(u(0,1)).Ss(a).ps(l).setMouseInteractions(!1),this.qg=this.iu.lg([this.Kg]).vs(this.hs.effectsText)}setAnimationsEnabled(t){return this.Oi=t,this}getAnimationsEnabled(){return this.Oi}setTitle(t){return this.Kg.fs(t),this.Li.Bi(),this}getTitle(){return this.Kg.cs()}getTitleSize(){return this.Kg.Gs().Ac()}setTitleFillStyle(t){return this.Kg.ps(t),this.Tg(),this}getTitleFillStyle(){return this.Kg.gs()}setTitleFont(t){return this.Kg.Ss(t),this.Tg(),this}getTitleFont(){return this.Kg.ys()}setTitleRotation(t){return this.Kg.xs(t),this.Li.Bi(),this}getTitleRotation(){return this.Kg.bs()}setTitleEffect(t){return this.qg.vs(t),this.Li.Bi(),this}getTitleEffect(){return this.qg._s()}setTitleMargin(t){var e,i;return this.jg="object"==typeof t?this.jg?(e=this.jg,{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.Tg(),this}getTitleMargin(){return this.jg}setPadding(t){return this.rn="object"==typeof t?v(this.rn,t):{left:t,top:t,right:t,bottom:t},this.Tg(),this}getPadding(){return this.rn}Jg(t){const e=t.Qg(),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.Zg.G(),this}}const po={tp:(t,e)=>t.gs()!==F&&0!==t.cs().length&&t.getVisible()?t.Gs().Ac().y+(void 0!==e.top?e.top:10)+(void 0!==e.bottom?e.bottom:0):0,ip(t,e){t.Sn(u(50,100)).Cn({top:void 0!==e.top?e.top:10,right:e.right||0,left:e.left||0,bottom:e.bottom||0})}};var yo;e.SliceLabelIndices=void 0,(yo=e.SliceLabelIndices||(e.SliceLabelIndices={}))[yo.LabelsInsideSlices=0]="LabelsInsideSlices",yo[yo.LabelsOnSides=1]="LabelsOnSides";const xo={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},So={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class vo extends Zr{constructor(){super(...arguments),this.ac="Slice",this.u=0}}const bo=(t,e)=>{Xt(e),t.setExploded(!t.getExploded())};class Mo extends vo{}class Ao extends Mo{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.sp=!1,this.ep=F,this.hp=F,this.rp=this.u,this.np=this.sp?1:0,this.op=this.getVisible(),this.ap=W((()=>this.qa.Li.Bi())),this.lp=W((()=>this.qa.Li.Bi())),this.up=()=>{this.cp=void 0},this.dp=()=>{this.fp=void 0},this.index=t,this.qa=s,this.scale=r,this.tc=n,this.gp=e.kc(r).Ir(this.getHighlight()),this.rc(this.gp),this._i=i.ue(r).Ir(this.getHighlight()),this.rc(this._i,{isText:!0}),this.onMouseClick(bo),this.onTouchEnd(bo)}setValue(t){return this.qa.getAnimationsEnabled()?this.op&&this.pp(this.rp,t):this.rp=t,this.u=t,this.qa.Li.Bi(),this}getValue(){return this.u}setExploded(t){if(t&&!1===this.qa.getMultipleSliceExplosion()){const t=this.qa.getSlices();for(let e=0;e{this.np=t,this.qa.Li.Bi()})),this.fp.onEveryAnimationEnd(this.dp),this.sp=!this.sp):!1!==this.qa.getMultipleSliceExplosion()||t?(this.np=this.sp?0:1,this.sp=!this.sp):(this.np=0,this.sp=!this.sp),this.qa.Li.Bi(),this}getExploded(){return this.sp}setVisible(t){return this.op=t,!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?(this.cp&&(this.cp.finish(!1),this.cp=void 0),this.pp(this.rp,0,(()=>super.setVisible(!1)))):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(this.cp&&(this.cp.finish(!1),this.cp=void 0),super.setVisible(!0),this.pp(this.rp,this.u)):(this.rp=this.u,super.setVisible(!0)),this}pp(t,e,i){this.cp=this.ap(300,U.ease)([[t,e]],(([t])=>{this.rp=t,this.qa.Li.Bi()})),this.cp.onEveryAnimationEnd(this.up),i&&this.cp.onAnimationEnd(i)}setStyle(t,e,i,s){this.ep=t,this.hp=i,this.gp.ps(this.ep).$h(e),this._i.ps(this.hp).Ss(s);for(let t=0;tKe(e,Ze(ai(.5*(t.Wo()+t.ei())*Math.PI/180),i)),Do=(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.mp.indexOf(t);e>=0&&(this.mp.splice(e,1),this.Ip())},this.ef.Ah||this.ef._h||this.Li.bh(7),this.Fp=e.Pp("pieChart bottom",0),this.Dp=e.Pp("pieChart top",1),this.Kg.fs("Pie Chart"),this.Yg(r,this.pixelScale),this.onBackgroundMouseDoubleClick(To);const h=Fr(new _r(To));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new Ao(this._p,this.Fp,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);this._p+=1,i.setName(t);const s=this.Oi;return this.Oi=!1,i.setValue(e),this.Oi=s,i.setEffect(this.kp),this.Bp(i),this.mp.push(i),this.Ip(),i.setHighlightOnHover(this.bp),i}addSlices(t){const e=[];for(let i=0;ie.iu.hc.vs(t))),this.Li.Bi(),this}getSliceEffect(){return this.kp}setSliceSorter(t){return this.yp=t,this.mp=this.mp.sort(this.yp),this.Li.Bi(),this}getSliceSorter(){return this.yp}setLabelFillStyle(t){this.Mp="function"==typeof t?t(this.Mp):t;for(let t=0;te.iu.sc.vs(t))),this.Li.Bi(),this}getLabelEffect(){return this.Cp}setLabelFormatter(t){return this.Lp=t,this.Li.Bi(),this}getLabelFormatter(){return this.Lp}setSliceHighlightOnHover(t){return this.bp=t,this.mp.forEach((e=>e.setHighlightOnHover(t))),this}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+t)),i=u(this.rn.left+e.x/2,this.rn.bottom+e.y/2);if(this.sd){const t=this.sd;this.mp.forEach((e=>{this.Bp(e,new z({color:t.getColors(e.getAnimatedValue())}))}))}for(let t=0;t0;this.mp[t].gp.setVisible(e),this.mp[t]._i.setVisible(e)}this.mp=this.mp.sort(this.yp);const s=this.mp.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 Bo={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},ko=(...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 Io;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(Io||(Io={}));const Co=(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.gp,a=t._i,l=wo(h,i,s+n+o),c=ri(a.xn().y,l,i);return[l,c,u(a.xn().x-e*(n+a.Et().x),c.y)]},Lo=(...t)=>e=>{const i=(t=>{let e=.5*(t.gp.Wo()+t.gp.ei());for(e%=360;e<0;)e+=360;return e<=90?Io.TopRight:e<180?Io.TopLeft:e<270?Io.BottomLeft:Io.BottomRight})(e);return t.includes(i)},Ro=Lo(Io.BottomLeft,Io.TopLeft),Fo=Lo(Io.BottomRight,Io.TopRight),_o=Lo(Io.TopLeft,Io.TopRight),Oo=Lo(Io.BottomLeft,Io.BottomRight);class zo extends Eo{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Lp=So.NamePlusValue,this.Rp=5,this.Ep=5,this.zp=[],this.Vp=this.hs.pieChartConnectorStrokeStyle,this.setPadding({bottom:50})}setLabelConnectorStyle(t){this.Vp=t;for(let t=0;tt.getXMin(),ie:t=>t.getXMax(),ee:t=>t.Wp().x,$p:t=>t.x,Yp:(t,e)=>({x:t.x,y:e.y,z:e.z}),gd:f(0,-1,0),Xp: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)}}},Uo={te:t=>t.getYMin(),ie:t=>t.getYMax(),ee:t=>t.Wp().y,$p:t=>t.y,Yp:(t,e)=>({x:e.x,y:t.y,z:e.z}),gd:f(-1,0,0),Xp: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)}}},Ho={te:t=>t.getZMin(),ie:t=>t.getZMax(),ee:t=>t.Wp().z,$p:t=>t.z,Yp:(t,e)=>({x:e.x,y:e.y,z:t.z}),gd:f(1,0,0),Xp: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)}}},Wo=t=>{if(t instanceof tt){const e=t.getThickness(),i=t.getFillStyle();if(i instanceof z)return 1===e?Xi:new ji({size:e,fillStyle:i,shape:"sphere"})}return Xi};class Yo extends Ni{constructor(t,e,i,s,r,n,o,h,a){super(t,e,i,s,h,{numeric:e.$p({x:t.Li.hs.xAxis3DNumericTicks,y:t.Li.hs.yAxis3DNumericTicks,z:t.Li.hs.zAxis3DNumericTicks}),datetime:e.$p({x:t.Li.hs.xAxis3DDateTimeTicks,y:t.Li.hs.yAxis3DDateTimeTicks,z:t.Li.hs.zAxis3DDateTimeTicks}),time:e.$p({x:t.Li.hs.xAxis3DTimeTicks,y:t.Li.hs.yAxis3DTimeTicks,z:t.Li.hs.zAxis3DTimeTicks})},{type:"linear"}),this.Sd=new Map,this.jp=()=>{},this.Zp=()=>{},this.Kp=()=>{},this.qp=()=>{},this.Jp=r,this.Qp=n,this.tm=o,this.im=this.Jp.ct;const l=this.es.$p({x:this.hs.xAxis3DStrokeStyle,y:this.hs.yAxis3DStrokeStyle,z:this.hs.zAxis3DStrokeStyle});this.sm=this.Jp.Gp([Bo.InternalUI]).ea(l).hm(Wo(l)).setMouseInteractions(!1),this.ds=this.Qp.ue(this.tm).setMouseInteractions(!1).ps(e.$p({x:t.Li.hs.xAxis3DTitleFillStyle,y:t.Li.hs.yAxis3DTitleFillStyle,z:t.Li.hs.zAxis3DTitleFillStyle})).Ss(e.$p({x:t.Li.hs.xAxis3DTitleFont,y:t.Li.hs.yAxis3DTitleFont,z:t.Li.hs.zAxis3DTitleFont})),this.iu=a,this.Ms=this.iu.lg([this.ds]).vs(s.effectsText),this.sm.setMouseEnterEventHandler(this.jp).setMouseLeaveEventHandler(this.Zp).setMouseDragEventHandler(this.Kp).setMouseDragStopEventHandler(this.qp),i.jf=this}setStrokeStyle(t){return this.sm.ea(t).hm(Wo(this.sm.ha())),this.chart.Li.Bi(),this}getStrokeStyle(){return this.sm.ha()}setMouseInteractions(t){return this}setVisible(t){this.sm.setVisible(t);for(const e of this.Sd.values())e.grid.setVisible(t),e.tick.setVisible(t);return super.setVisible(t),this.Qp.Bi(),this}Js(){return this.chart.getSeries()}rm(t){return Math.abs(this.ct.J(t)*this.Jp.nm(1))}oe(t,e,i){const s=Math.abs(this.ct.J(e-t)*this.Jp.nm(1));return{min:t-i*s,max:e+i*s}}$s(t,e){return new qo(e,t,this.Qp,this.tm,this.Jp)}Ys(t,e){const{wuSize:i,start:s,end:r,tickDirection3D:n,tickDirection2D:o}=e,h=t.qi.Ws,a=(t.u-this.ct.getInnerStart())/(this.ct.getInnerEnd()-this.ct.getInnerStart()),l=be.addVec(Oe(s,r,a),be.multiplyVec(be.multiply(n,this.Jp.nm(.5*this.sm.ha().getThickness())),i)),c=be.addVec(l,be.multiplyVec(be.multiply(n,this.Jp.nm(h.tickLength)),i)),d=this.Jp.om(c)||u(0,0),f=Ke(nt(d,this.chart.engine.scale,this.tm),Ze(o,h.tickPadding));return t._i.Sn(f).kn({x:-o.x,y:-o.y}),{posTickEnd3D:c,posTickStart3D:l,tickPositionRelative:a}}mg(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=be.addVec(Oe(r,n,h),be.multiplyVec(be.multiply(o,this.Jp.nm(.5*this.sm.ha().getThickness())),s)),l=be.addVec(a,be.multiplyVec(be.multiply(o,this.Jp.nm(10)),s)),c=this.Jp.om(a)||u(0,0),d=this.Jp.om(l)||u(0,0);return this.Qp._u(this.tm).la(c).Ko(d).ea(new tt({fillStyle:new z({color:D(120*i)}),thickness:1}))}re(t,e){return Xo(t,e,this.ct)}ru(t){const e=this.im,i=f(e.x.st(),e.y.st(),e.z.st());let s,r;this.es===Ho?(s=f(e.x.getInnerEnd(),e.y.getInnerStart(),e.z.getInnerStart()),r=f(e.x.getInnerEnd(),e.y.getInnerStart(),e.z.getInnerEnd())):(s=f(e.x.getInnerStart(),e.y.getInnerStart(),e.z.getInnerStart()),r=this.es.Yp(f(e.x.getInnerEnd(),e.y.getInnerEnd(),e.z.getInnerEnd()),s));const n=this.es.gd,o=this.Jp.om(s)||u(0,0),h=this.Jp.om(r)||u(0,0),a=Oe(s,r,.5),l=be.addVec(a,be.multiplyVec(be.multiply(n,-1),i)),c=this.Jp.om(a)||u(0,0),d=this.Jp.om(l)||u(0,0),g=Xe(Je(nt(c,this.chart.engine.scale,this.tm),nt(d,this.chart.engine.scale,this.tm)));this.sm.qn().Kn([s,r]);const{gridlinePositionA:m,gridlinePositionB:p,gridlinePositionC:y}=this.es.Xp(t),x=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}),S=x(m),v=x(p),b=x(y),M={physicalAxisSize:je(Je(o,h)),wuSize:i,start:s,end:r,tickDirection3D:n,tickDirection2D:g,gridlinePositionA:S,gridlinePositionB:v,gridlinePositionC:b},A=this.Bs(M);for(const[t,e]of this.Ti){let i=this.Sd.get(t);i||(i={grid:this.Jp.Sg().setMouseInteractions(!1),tick:this.Jp.Sg().setMouseInteractions(!1)}),i.grid.qn(),i.tick.qn();for(const[,t]of e){const e=this.pg(t,M,A);e.gridStroke&&i.grid.Kn(e.gridStroke),i.tick.Kn([e.tickStroke.start,e.tickStroke.end])}i.grid.ea(t.Ws.getGridStrokeStyle()),i.tick.ea(t.Ws.getTickStyle()),this.Sd.set(t,i)}const w=this.Zs(((t,e)=>{const i=e._i.Et();return t.x=Math.max(t.x,i.x),t.y=Math.max(t.y,i.y),t}),u(0,0)),D=Math.atan((h.y-o.y)/(h.x-o.x));this.ds.kn({x:0,y:0}).xs(180*-D/Math.PI);const T=be.addVec(a,be.multiplyVec(be.multiply(n,this.Jp.nm(.5*this.sm.ha().getThickness()+this.qs(((t,e)=>Math.max(t,e.tickLength)),0))),i)),E=this.Jp.om(T)||u(0,0),B=Ke(nt(E,this.chart.engine.scale,this.tm),Ke(Ke(Qe(w,g),Ze(g,this.qs(((t,e)=>Math.max(t,e.labelPadding)),0))),Qe(Ze(this.ds.Gs().Et(),.5),g)));this.ds.Sn(B),this.sm.am={overrideFollowing:!1,skipMousePicking:!1}}pg(t,e,i){const{gridlinePositionA:s,gridlinePositionB:r,gridlinePositionC:n}=e,o=i.get(t),h=o.posTickStart3D,a=o.posTickEnd3D,l=o.tickPositionRelative;let u;return Mt(l,0)||Mt(l,1)||(u=[this.isX()?{...s,x:h.x}:this.isY()?{...s,y:h.y}:this.isZ()?{...s,z:h.z}:{x:0,y:0,z:0},this.isX()?{...r,x:h.x}:this.isY()?{...r,y:h.y}:this.isZ()?{...r,z:h.z}:{x:0,y:0,z:0},this.isX()?{...n,x:h.x}:this.isY()?{...n,y:h.y}:this.isZ()?{...n,z:h.z}:{x:0,y:0,z:0}]),{gridStroke:u,tickStroke:{start:h,end:a}}}As(){if(this.Sd){for(const t of this.Sd)t[1].grid.dispose(),t[1].tick.dispose();this.Sd.clear()}super.As()}isX(){return this.es===Go}isY(){return this.es===Uo}isZ(){return this.es===Ho}}class qo extends Gi{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this.md=r}}const Xo=(t,e,i)=>At(t+.1*(e-t)+Math.abs(i.st())/100*Math.sign(e-t),Math.min(t,e),Math.max(t,e));class $o{constructor(){this.type="simple"}}const jo=new $o;class Zo{constructor(t){this.type="phong",this.ambientReflection=1,this.specularReflection=.1,this.diffuseReflection=1,this.ambientColor=w("#000"),this.specularColor=w("#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 Ko=new Zo,Jo={Simple:$o,Phong:Zo};class Qo extends Zr{constructor(t,e,i,s,r){super(t,e,s,r),this.lm=Ko,this.um=!0,this.dm=!0,this.qa=t,this.Jp=i,this.de=new Map,this.onMouseWheel(this.qa.fm),this.onMouseDrag(this.qa.gm),this.onTouchStart(this.qa.pm.onTouchStart),this.onTouchMove(this.qa.pm.onTouchMove),this.onTouchEnd(this.qa.pm.onTouchEnd)}setAutoScrollingEnabled(t){return this.um=t,this.qa.Li.Bi(),this}getAutoScrollingEnabled(){return this.um}setColorShadingStyle(t){return this.lm=t,this.de.forEach(((e,i)=>i.ym(t))),this.Jp.Bi(),this}getColorShadingStyle(){return this.lm}setDepthTestEnabled(t){return this.dm=t,this.de.forEach(((e,i)=>i.Sm(t))),this.Jp.Bi(),this}getDepthTestEnabled(){return this.dm}xm(){}ru(){}bm(){}getXMax(){const t=this.Dn;return t?t.yt():void 0}getXMin(){const t=this.Dn;return t?t.ft():void 0}getYMax(){const t=this.Dn;return t?t.xt():void 0}getYMin(){const t=this.Dn;return t?t.St():void 0}getZMax(){const t=this.Dn;return t?t.vm():void 0}getZMin(){const t=this.Dn;return t?t.Mm():void 0}Wp(){const t=this.Dn;return t?f(t.co(),t.do(),t._m()):f(0,0,0)}}class th extends Qo{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ac="Box Series 3D",this.Am=.25,this.ed=()=>he(this.Vr);const n=this.qa.getSeries().length;this.Vr=ue(this.hs.boxSeries3DFillStyle,n),this.Dn=this.Jp.km().Sm(this.dm).ps(this.Vr).wm(this.Am).Ir(this.getHighlight()),this.rc(this.Dn)}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;ihe(this.sa.getFillStyle())}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;return this.Dn.ea(e),this.Jp.Bi(),this}getStrokeStyle(){return this.sa}add(t){return(t=Array.isArray(t)?t:[t])?(this.Dn.Kn(t.slice()),this.Jp.Bi(),this):this}clear(){return this.Dn.qn(),this.Du=0,this}getPointAmount(){const t=this.Dn;return t.Jn()+t.Qn()}Qs(){return this.um&&this.getPointAmount()>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Jp.Bi()}attach(t,e){return super.attach(t,e),oe(t,this.hs,{stroke:this.sa}),this}}class ih extends eh{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ac="Line Series 3D";const n=this.qa.getSeries().length;this.sa=ue(s.lineSeries3DStrokeStyle,n),this.Tm=ls.pointStyle3D,this.Im(this.sa),this.Dn=this.Jp.Gp([Bo.UserSeries]).Sm(this.dm).ea(this.sa).hm(this.Tm).Ir(this.getHighlight()),this.rc(this.Dn)}setStrokeStyle(t){super.setStrokeStyle(t),this.Im(this.sa);const e=this.Tm;return this.Dn.hm(e),this}Im(t){const e=new Ji.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.Tm=e}}class sh extends eh{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ac="Point Line Series 3D",this.ed=()=>he(this.sa.getFillStyle())||he(this.Tm.getFillStyle());const n=this.qa.getSeries().length;this.sa=ue(s.pointLineSeries3DStrokeStyle,n),this.Tm=ue(s.pointLineSeries3DPointStyle,n),this.Fm(),this.Dn=this.Jp.Gp([Bo.UserSeries]).Sm(this.dm).ea(this.sa).hm(this.Tm).Ir(this.getHighlight()),this.rc(this.Dn)}setPointStyle(t){return this.Tm="function"==typeof t?t(this.Tm):t,this.Fm(),this.Dn.hm(this.Tm),this.Jp.Bi(),this}getPointStyle(){return this.Tm}setStrokeStyle(t){super.setStrokeStyle(t);const e=this.sa,i=Math.abs(e.getThickness()),s=this.Tm;i>s.getSize()&&(this.Tm=s.setSize(i)),this.Fm();const r=this.Tm;return this.Dn.hm(r),this.Jp.Bi(),this}Fm(){const t=this.Tm,e=t.getSize();this.Tm=t.setSize(e)}mc(t,e){t.Ir(e),this.Jp.Bi()}}class rh extends Qo{constructor(t,e,i,s,r,n){super(t,e,i,s,r)}add(t){return(t=Array.isArray(t)?t:[t])?(this.Dn.Kn(t.slice()),this.Jp.Bi(),this):this}clear(){return this.Dn.qn(),this.Du=0,this}getPointAmount(){const t=this.Dn;return t.Jn()+t.Qn()}Qs(){return this.um&&this.getPointAmount()>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Jp.Bi()}attach(t,e){return super.attach(t,e),oe(t,this.hs,{point3D:this.Pm}),this}}class nh extends rh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Point Series 3D",this.ed=()=>he(this.Pm.getFillStyle());const o=this.qa.getSeries().length;this.Pm=ue(s.pointSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Dn=this.Jp.Bm(h).Sm(this.dm).Dm(this.Pm).Ir(this.getHighlight()),this.rc(this.Dn)}setPointStyle(t){this.Pm="function"==typeof t?t(this.Pm):t;const e=this.Pm;return this.Dn.Dm(e),this.Jp.Bi(),this}getPointStyle(){return this.Pm}}class oh extends rh{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Point Cloud Series 3D",this.ed=()=>he(this.Pm.getFillStyle());const o=this.qa.getSeries().length;this.Pm=ue(s.pointCloudSeries3DPointStyle,o);const h={individualPointColorEnabled:!1,individualPointSizeEnabled:!1,individualLookupValuesEnabled:!1,individualPointSizeAxisEnabled:!1,...n};this.Dn=this.Jp.Bm(h).Dm(this.Pm).Ir(this.getHighlight()),this.rc(this.Dn)}setPointStyle(t){this.Pm="function"==typeof t?t(this.Pm):t;const e=this.Pm;return this.Dn.Dm(e),this.Jp.Bi(),this}getPointStyle(){return this.Pm}}const hh={Triangulated:nh,Pixelated:oh};class ah extends mo{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l,u),this.Lm=[],this.Om=0,this.Rm=t=>{const e=this.Lm.indexOf(t);e>=0&&(this.Lm.splice(e,1),this.P.emit("seriesDispose",this,t))},this.Em=()=>{this.Om+=1},this.zm=()=>{this.Om-=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.Vm=this.iu.lg()}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.Lm.forEach((e=>e.setAnimationHighlight(t))),this}Nm(t,e){this.Vm.nc([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.Gm.ps(t),this.Li.Bi(),this}getSeriesBackgroundFillStyle(){return this.Gm.gs()}setSeriesBackgroundStrokeStyle(t){return this.Hm.$h(t),this.Li.Bi(),this}getSeriesBackgroundStrokeStyle(){return this.Hm.Yh()}setSeriesBackgroundEffect(t){return this.Vm.vs(t),this.Li.Bi(),this}getSeriesBackgroundEffect(){return this.Vm._s()}Wm(t){this.Lm.push(t),t.onMouseEnter(this.Em),t.onMouseLeave(this.zm),void 0!==this.Um&&t.setHighlightOnHover(this.Um),this.P.emit("seriesAdded",this,t)}dd(){return this.Lm}$m(){return this.Om}setSeriesHighlightOnHover(t){return this.Um=t,this.Lm.forEach((e=>e.setHighlightOnHover(t))),this}dispose(){return this.Lm.slice().forEach(vt),super.dispose()}}const lh=be.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class uh{constructor(t,e,i,s){this.Ym=!0,this.Xm=!0,this.jm=2*-Math.PI/2160,this.Zm=2*Math.PI/2160,this.Km=.1,this.qm=1*Math.PI/180,this.Jm=t,this.Qm=e,this.ty=i,this.om=s}getDefaultCameraConfiguration(t){const e={direction:lh,location:be.multiply(lh,-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.iy(i,t):"wheel-zoom"===t.type?i=this.sy(i,t):"rotate+zoom"===t.type?i=this.ey(i,t):"fixed-rotate"===t.type?i=this.hy(i,t):"move"===t.type&&(i=this.ny(i,t))})),this.Ym?i=this.oy(t.boundingBox,i):this.Xm&&(i=this.ly(t.boundingBox,i)),i}iy(t,e){const{rotation:i}=e,s=t.location,r=be.multiply(be.normalize(t.location),-1),{Right:n,Up:o}=this.uy(r);let h=s;const a=this.gy(r),l=i.x*this.jm*a;h=be.rotateAroundAxis(h,o,l);const u=(i.y>0?1:-1)*Math.min(Math.abs(i.y)*this.Zm,a-this.qm);return 0!==u&&(h=be.rotateAroundAxis(h,n,u)),{location:h,direction:be.multiply(be.normalize(h),-1)}}sy(t,e){const{deltaY:i}=e;this.Ym&&this.py(!1);const s=t.location,r=be.multiply(be.normalize(s),-1),n=i*this.Km,o=be.length(s)*-n;return{direction:r,location:be.addVec(s,be.multiply(r,o))}}ey(t,e){const{rotation:i,cameraDistance:s}=e;this.Ym&&this.py(!1);let r=this.iy(t,{type:"rotate",rotation:i});const n=r.location,o=be.multiply(be.normalize(n),-1),h=be.multiply(o,-s);return r={direction:be.multiply(be.normalize(h),-1),location:h},r}hy(t,e){this.Ym&&this.py(!1);const{rotation:i}=e,s=t.location,r=t.direction,{Right:n,Up:o}=this.uy(r),h=i.x*this.jm;let a=be.normalize(be.rotateAroundAxis(r,o,h));const l=i.y*this.Zm;return a=be.normalize(be.rotateAroundAxis(a,n,l)),{location:s,direction:a}}ny(t,e){this.Ym&&this.py(!1),this.Xm=!1;const{amountRight:i,amountForward:s}=e,r=t.location,n=t.direction,{Right:o}=this.uy(n);return{location:be.addVec(r,be.multiply(n,.01*s),be.multiply(o,.01*i)),direction:n}}boundingBoxChanged(t){const e={location:t.cameraLocation,direction:be.multiply(be.normalize(t.cameraLocation),-1)};return this.Ym?this.oy(t.boundingBox,e):this.ly(t.boundingBox,e)}cameraLocationChanged(t){const e={location:t.cameraLocation,direction:be.multiply(be.normalize(t.cameraLocation),-1)};return this.Ym?this.oy(t.boundingBox,e):this.ly(t.boundingBox,e)}viewportChanged(t){const e={location:t.cameraLocation,direction:be.multiply(be.normalize(t.cameraLocation),-1)};if(this.Ym)return this.oy(t.boundingBox,e)}oy(t,e,i){let s=e;i=void 0!==i?i:0,s=this.my(t,s,100,20,1,i,5);const r=this.gy(s.direction);return s=this.yy(s,this.Sy(t,s,100,1),r),s}my(t,e,i,s,r,n,o){return ch(n,o,(t=>({direction:e.direction,location:be.multiply(e.direction,-t)})),(e=>this.xy(t,e)),i,r,"linear",s)}Sy(t,e,i,s){const{Right:r,Left:n,Up:o,Down:h}=this.uy(e.direction),a=this.by(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:be.normalize(be.lerp(l.direction,h,t))})),(e=>this.vy(t,e)),0,u,!0,i):dh(0,c,(t=>({location:l.location,direction:be.normalize(be.lerp(l.direction,o,t))})),(e=>this.vy(t,e)),0,u,!0,i)),Math.abs(a.left-a.right)>u&&(l=a.left({location:l.location,direction:be.normalize(be.lerp(l.direction,n,t))})),(e=>this.My(t,e)),0,u,!0,i):dh(0,c,(t=>({location:l.location,direction:be.normalize(be.lerp(l.direction,r,t))})),(e=>this.My(t,e)),0,u,!0,i)),l}xy(t,e){const i=this.by(t,!0,e);return Math.min(i.left+i.right,i.top+i.bottom)}My(t,e){const i=this.by(t,!1,e);return Math.abs(i.left-i.right)}vy(t,e){const i=this.by(t,!1,e);return Math.abs(i.top-i.bottom)}by(t,e,i){const s=ze(this._y(t,e,i).map((t=>nt(t,this.Jm,this.Qm))));return{left:s.min.x,right:this.Qm.x.getInnerEnd()-s.max.x,top:this.Qm.y.getInnerEnd()-s.max.y,bottom:s.min.y}}_y(t,e,i){const s=this.ty,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.om(t,i))).filter((t=>void 0!==t))}ly(t,e){const i=be.length(e.location),s=this.Ay(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)he(this.Vr),this.lm=jo;const o=this.qa.getSeries().length;this.Vr=ue(this.hs.surfaceGridSeries3DFillStyle,o),this.Ma=ue(this.hs.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.Mh=l,this.Dn=this.Jp.ky(l).ps(this.Vr)._a(this.Ma).ym(this.lm).Ir(this.getHighlight()),this.rc(this.Dn)}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Dn.ps(this.Vr),this.Jp.Bi(),this}getFillStyle(){return this.Vr}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.Dn._a(this.Ma),this.Jp.Bi(),this}getWireframeStyle(){return this.Dn.Aa()}setIntensityInterpolation(t){return t=t||"disabled",this.Dn.Cy(t),this.Jp.Bi(),this}getIntensityInterpolation(){return this.Dn.Ty()}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.Mh.dataOrder?t.length:t[0].length,rows:"rows"===this.Mh.dataOrder?t.length:t[0].length},i="columns"===this.Mh.dataOrder?this.Mh.columns:this.Mh.rows,s="columns"===this.Mh.dataOrder?this.Mh.rows:this.Mh.columns;if(e.x>i||e.y>s){if(!0===this.qa.ef.Ph){const t=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.qa.ef.Ph){const i=`SurfaceGridSeries3D.invalidateIntensityValues intensity matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.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.`;gt.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.qa.ef.Ph){const t=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.rows}, input ${e.columns}x${e.rows}.\n Excess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.qa.ef.Ph){const i=`SurfaceGridSeries3D.invalidateHeightMap height matrix overflow.\n Grid ${this.Mh.columns}x${this.Mh.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.`;gt.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;ehe(this.Vr),this.lm=jo;const o=this.qa.getSeries().length;this.Vr=ue(this.hs.surfaceScrollingGridSeries3DFillStyle,o),this.Ma=ue(this.hs.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.Mh=l,this.Dn=this.Jp.By(l).ps(this.Vr)._a(this.Ma).ym(this.lm).Ir(this.getHighlight()),this.rc(this.Dn)}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Dn.ps(this.Vr),this.Jp.Bi(),this}getFillStyle(){return this.Vr}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.Dn._a(this.Ma),this.Jp.Bi(),this}getWireframeStyle(){return this.Dn.Aa()}setIntensityInterpolation(t){return t=t||"disabled",this.Dn.Cy(t),this.Jp.Bi(),this}getIntensityInterpolation(){return this.Dn.Ty()}clear(){return this.Dn.qn(),this.Jp.Bi(),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.Mh.scrollDimension?this.Mh.rows:this.Mh.columns;if(i>s-1){if(!0===this.qa.ef.Ph){const e=`SurfaceScrollingGridSeries3D.addValues input yValues overflow.\nGrid was created with ${s} ${"columns"===this.Mh.scrollDimension?"rows":"columns"}, input yValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(e)}const i=[];for(let t=0;ts-1){if(!0===this.qa.ef.Ph){const e=`SurfaceScrollingGridSeries3D.addValues intensityValues overflow.\nGrid was created with ${s} ${"columns"===this.Mh.scrollDimension?"rows":"columns"}, input intensityValues have ${t}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.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.Dn.Ly({startPrimary:0,startSecondary:0,lengthPrimary:s,lengthSecondary:r,heightMapValues:e,intensityValues:i}),this.Jp.Bi(),this}setCullMode(t){return this.Dn.Py("boolean"==typeof t?t?"cull-back":"disabled":t),this}getCullMode(){return this.Dn.Dy()}xm(){}ru(){}bm(){}Qs(){return this.um&&this.getVisible()}mc(t,e){t.Ir(e),this.Jp.Bi()}}class mh extends ah{constructor(t,e,i,s,r,n,o){let h;super(t,e,i,e.Xg("chart3D bg",0),e.Eg("chart3D ui"),s,e.Li.hs.chart3DBackgroundFillStyle,e.Li.hs.chart3DBackgroundStrokeStyle,e.Li.hs.chart3DTitleFont,e.Li.hs.chart3DTitleFillStyle,n),this.Oy=1,this.Ry=[],this.Ey=2,this.zy=!0,this.Vy=!0,this.Ny=!0,this.Gy=0,this.axes={id:"axes",chart:this},this.world={id:"world",chart:this},this.Ve=[],this.Ue=()=>{const t=this.Jp.Hy();this.Uy.Wy(t),this.$y.Wy(t);const e=this.Yy.viewportChanged(this.Xy());e&&this.jy(e),this.Li.Bi()},this.gm=(t,e,i,s,r)=>{if(this.Ny){const t=r;this.Ry.push({type:"rotate",rotation:t}),this.Li.Bi(),Xt(e)}},this.fm=(t,e)=>{if(this.Vy){if(this.zy)Math.sign(this.Gy)!==Math.sign(e.deltaY)?this.Gy=ce(e):this.Gy+=ce(e);else{const t=ce(e);this.Ry.push({type:"wheel-zoom",deltaY:t})}this.Li.Bi(),Xt(e)}},this.ef.Ah||this.ef._h||this.Li.bh(1),this.Kg.fs("Chart3D"),this.Zy=i.d3(),this.Zy.x.Z(-1,1),this.Zy.y.Z(-1,1),this.Zy.z.Z(-1,1),this.Jp=e.Ky("chart3D layer3D",0,this.Zy),this.Uy=e.qy("chart3D series bg",0),this.$y=e.Pp("chart3D axis ui",1),this.Jy={x:new Yo(this,Go,this.Zy.x,this.hs,this.Jp,this.$y,this.pixelScale,!1,this.iu),y:new Yo(this,Uo,this.Zy.y,this.hs,this.Jp,this.$y,this.pixelScale,!1,this.iu),z:new Yo(this,Ho,this.Zy.z,this.hs,this.Jp,this.$y,this.pixelScale,!1,this.iu)},this.Qy=this.Jp.Gp([Bo.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.hs.chart3DBoundingBoxStrokeStyle),this.Gm=this.Uy.vc(this.engine.scale,Ws.Simple).ps(this.hs.chart3DSeriesBackgroundFillStyle).$h(J).setMouseInteractions(!0),this.Hm=this.Uy.vc(this.engine.scale,Ws.Simple).ps(F).$h(this.hs.chart3DSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Nm(this.Gm,this.Hm),this.tS({x:1,y:1,z:1},!0),this.Yy=new uh(this.engine.scale,this.pixelScale,this.Zy,((t,e)=>(e&&this.jy(e),this.Jp.om(t)))),this.iS=this.Yy.getDefaultCameraConfiguration(this.sS(this.eS)),this.jy(this.iS),this.pm=Fr(new zr(((t,e,i)=>{h={locationOne:e,locationTwo:i,cameraLocation:this.Jp.getCameraLocation()}}),((t,e,i,s,r,n)=>{if(!this.Ny&&!this.Vy)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=be.length(h.cameraLocation),c=o/a*l,d=u((s.x+r.x)/2,(s.y+r.y)/2);this.Ry.push({type:"rotate+zoom",rotation:this.Ny?d:{x:0,y:0},cameraDistance:this.Vy?c:l}),this.Li.Bi(),Xt(n)}),(t=>{})),new Or((t=>{}),((t,e,i,s,r)=>{if(this.Ny){const t=s;this.Ry.push({type:"rotate",rotation:t}),this.Li.Bi(),Xt(r)}}),(t=>{}))),this.onBackgroundTouchStart(this.pm.onTouchStart),this.onBackgroundTouchMove(this.pm.onTouchMove),this.onBackgroundTouchEnd(this.pm.onTouchEnd),this.onSeriesBackgroundTouchStart(this.pm.onTouchStart),this.onSeriesBackgroundTouchMove(this.pm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.pm.onTouchEnd),this.onBackgroundMouseDrag(this.gm),this.onBackgroundMouseWheel(this.fm),this.onBackgroundMouseDown(((t,e)=>{Xt(e)})),this.onSeriesBackgroundMouseDrag(this.gm),this.onSeriesBackgroundMouseWheel(this.fm),this.onSeriesBackgroundMouseDown(((t,e)=>{Xt(e)})),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.onResize(this.Ue),this.Ue(),this.Yg(r,this.pixelScale)}addPointSeries(t){const e=new(t&&t.type||nh)(this,this.Rm,this.Jp,this.hs,this.Li.iu,t);return this.Wm(e),e}addLineSeries(){const t=new ih(this,this.Rm,this.Jp,this.hs,this.Li.iu);return this.Wm(t),t}addPointLineSeries(){const t=new sh(this,this.Rm,this.Jp,this.hs,this.Li.iu);return this.Wm(t),t}addSurfaceGridSeries(t){const e=new fh(this,this.Rm,this.Jp,t,this.hs,this.Li.iu);return this.Wm(e),e}addSurfaceScrollingGridSeries(t){const e=new gh(this,this.Rm,this.Jp,t,this.hs,this.Li.iu);return this.Wm(e),e}addBoxSeries(){const t=new th(this,this.Rm,this.Jp,this.hs,this.Li.iu);return this.Wm(t),t}getDefaultAxisX(){return this.Jy.x}getDefaultAxisY(){return this.Jy.y}getDefaultAxisZ(){return this.Jy.z}getDefaultAxes(){return[this.Jy.x,this.Jy.y,this.Jy.z]}setCameraLocation(t){let e={location:t,direction:be.normalize(be.multiply(t,-1))};const i=this.Yy.cameraLocationChanged(this.Xy(e));return i&&(e=i),this.jy(e),this.Li.Bi(),this}getCameraLocation(){return this.Jp.getCameraLocation()}getCameraDirection(){return this.Jp.getCameraDirection()}setCameraAutomaticFittingEnabled(t){this.Yy.py(t);const e=this.Yy.cameraLocationChanged(this.Xy());return e&&this.jy(e),this}getCameraAutomaticFittingEnabled(){return this.Yy.wy()}onCameraChange(t){return this.P.on("cameraChange",t)}offCameraChange(t){return this.P.off(t,"cameraChange")}setBoundingBoxStrokeStyle(t){return this.Qy.ea(t).hm(Wo(this.Qy.ha())),this.Jp.Bi(),this}getBoundingBoxStrokeStyle(){return this.Qy.ha()}setBoundingBox(t){return this.tS(t,!1),this}tS(t,e){this.eS=t;const i=this.sS(t);if(this.Zy.x.q(i.x),this.Zy.y.q(i.y),this.Zy.z.q(-i.z),!e){const t=this.Yy.boundingBoxChanged(this.Xy());t&&this.jy(t)}this.Li.Bi()}getBoundingBox(){return this.eS}ru(){const t=gt.performance.now();if(po.ip(this.Kg,this.jg),0!==this.Gy){const e=this.hS?t-this.hS:1e3/60,i=this.Gy*e*.006;this.Ry.push({type:"wheel-zoom",deltaY:i}),this.Gy=Math.sign(this.Gy)*Math.max(Math.abs(this.Gy)-.01*e,0),0!==this.Gy?(this.Li.Bi(!0),this.hS=t):this.hS=void 0}const e=this.getCameraDirection();if(this.Ry.length>0){const t=this.Yy.applyCameraInteractions(this.Xy(),this.Ry);t&&this.jy(t),this.Ry.length=0}this.rS&&be.equals(this.rS.location,this.iS.location)&&be.equals(this.rS.direction,this.iS.direction)||this.P.emit("cameraChange",this,this.getCameraLocation()),this.rS=this.iS,super.ru();for(let t=0;tthis.Jp.om(t))),o=this.Jp.om(f((s.x+r.x)/2,(s.y+r.y)/2,(s.z+r.z)/2)),h=ee(n,o),a=[];for(let t=0;t0?t-1:h.length-1],h[t{t()})),this.Ve.length=0,this.Zy.G(),this.Jp.G(),this.$y.G(),this.Uy.G(),super.dispose()}X(){return this.Zy.x.X(),this.Zy.y.X(),this.Zy.z.X(),super.X()}j(){return super.j()}jy(t){this.Jp.setCameraLocation(t.location).setCameraDirection(t.direction).setLightLocation(be.addVec(t.location,be.multiply(t.direction,-this.Ey))),this.iS=t,this.Li.Bi()}sS(t){return be.divide(t,be.length(t)/this.Oy)}Xy(t=this.iS){return{boundingBox:this.sS(this.eS),cameraLocation:t.location,cameraDirection:t.direction}}setMouseInteractions(t){return this.setMouseInteractionZoom(t).setMouseInteractionRotate(t)}setMouseInteractionZoom(t){return this.Vy=t,this}getMouseInteractionZoom(){return this.Vy}setMouseInteractionRotate(t){return this.Ny=t,this}getMouseInteractionRotate(){return this.Ny}forEachAxis(t){return t(this.Jy.x),t(this.Jy.y),t(this.Jy.z),this}getMinimumSize(){}getSeries(){return this.Lm}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.setAnimationZoom(t),this.forEachAxis((e=>e.setAnimationsEnabled(t))),this}setAnimationZoom(t){return this.zy=!!t,this}getAnimationZoom(){return this.zy}}const ph={Column:En,Row:Bn};class yh extends fo{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.nS=new Map,this.oS=this.addUIElement(ph.Row).setPosition({x:0,y:100}).setOrigin(wr.LeftTop).setBackground((t=>t.setFillStyle(F).setStrokeStyle(J)))}add(t,e){return(t instanceof mo?[t]:t instanceof fd?t.getCells().filter((t=>t.panel instanceof mo)).map((t=>t.panel)):[]).forEach((t=>{const i=this.oS.addElement(eo.VerticalLegendBox).setBackground((t=>t.setFillStyle(F).setStrokeStyle(J))).add(t,e).setTitle(t.getTitle());this.nS.set(t,i)})),this.Li.Bi(),this}setLegendBoxes(t){return this.nS.forEach(((e,i)=>t(e,i))),this}getMinimumSize(){return super.getMinimumSize()||this.oS.getSize()}}class xh{constructor(t,e){this.aS=t,this.lS=e}alter(t){this.uS=void 0!==this.uS?this.uS:this.lS(),this.cS=t,this.aS(t)}resetValue(){void 0!==this.cS&&(void 0!==this.uS&&this.isAltered()&&this.aS(this.uS),this.uS=void 0,this.cS=void 0)}getNormalValue(){return void 0!==this.uS?this.uS:this.lS()}isAltered(){return void 0!==this.cS&&this.lS()===this.cS}}class Sh{constructor(t,e){this.dS=[],this.fS=t,this.ct=e}update(){return this.fS.getVisible()?!(this.gS()&&(!this.pS()||(this.resetTable(),this.fS.Gs(),this.gS()))&&(this.mS(),this.fS.Gs(),this.gS()&&(this.resetTable(),this.fS.Gs(),1))):(this.pS()&&this.resetTable(),!0)}pS(){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.fS,this.ct)}yS(){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.fS,this.ct)}SS(){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.fS,this.ct)}xS(t){return this.dS.push(t),t}}class vh extends Sh{constructor(){super(...arguments),this.hn=this.xS(new xh((t=>this.fS.setOrigin(t)),(()=>this.fS.getOrigin())))}mS(){const t=this.hn.getNormalValue(),e=u(this.yS()?-t.x:t.x,this.SS()?-t.y:t.y);this.hn.alter(e)}}class bh extends Sh{constructor(t,e,i,s){super(t,e),this.bS=this.xS(new xh((t=>this.fS.setTextFont((e=>e.setSize(t)))),(()=>this.fS.getTextFont().getSize()))),this.vS=i,this.MS=s}mS(){const t=this.bS.getNormalValue(),e=this.vS;if(enew vh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new bh(i,s,t,e)};class Ah{constructor(){this._S=[]}addRow(...t){return this._S.push(t),this}}class wh extends Ah{wu(){const t=this._S;return this._S=[],t}AS(){return this._S.length=0,this}}class Dh extends Dn{constructor(){super(...arguments),this.pu=this.hs.cursorResultTableTextFont,this.Xc=0,this.wS=this.hs.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(mn,void 0);else{const e=h[n];e instanceof vn?(r.getMembers()[n].dispose(),t=r.addElement(mn,n)):t=e}t.setFont(this.pu).setFillStyle(this.wS).setText(o).setTextRotation(this.Xc)}else{for(let t=h.length;t=h.length?r.addGap(void 0,void 0):h[n]instanceof gn&&(r.getMembers()[n].dispose(),r.addGap(void 0,n))}}}}return this.Lr.Bi(),this}setTextFillStyle(t){this.wS="function"==typeof t?t(this.wS):t;for(let t=0;tt.setFillStyle(n.cursorResultTableFillStyle).setStrokeStyle(n.cursorResultTableStrokeStyle))).setTextFillStyle(n.cursorResultTableTextFillStyle).setTextFont(n.cursorResultTableTextFont),this.BS=Mh.Flip(this.fS,this.scale)}dispose(){return this.DS.dispose(),this.fS.dispose(),this}pointAt(t){return this.qr=t.series.scale===this.scale?t.location:nt(t.location,t.series.scale,this.scale),this.DS.setPosition(this.qr),this.fS.setPosition(this.qr).setContent(t.resultTableContent),this.Lr.Bi(),this}getPosition(){return this.qr}setVisible(t){return this.Ri=t,this.Lr.Bi(),this}getVisible(){return this.Ri}setPointMarkerVisible(t){return this.CS=t,this.Lr.Bi(),this}getPointMarkerVisible(){return this.CS}setPointMarker(t){return t(this.DS),this.Lr.Bi(),this}getPointMarker(){return this.DS}setResultTableVisible(t){return this.TS=t,this.Lr.Bi(),this}getResultTableVisible(){return this.TS}setResultTable(t){return t(this.fS),this.Lr.Bi(),this}getResultTable(){return this.fS}setAutoFitStrategy(t){return this.BS&&this.BS.resetTable(),this.BS=t?t(this.fS,this.Lr.Li.ct):void 0,this.Lr.Bi(),this}getAutoFitStrategy(){return void 0!==this.BS}ru(){return this.BS&&this.BS.update(),this.fS.setVisible(this.IS&&this.Ri&&this.TS),this.DS.setVisible(this.IS&&this.Ri&&this.CS),this.DS.ru(),this.fS.ru(),this}Gs(){return this.DS.Gs(),this.fS.Gs(),this.IS=((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.qr,this.scale),this}}class Eh extends Th{constructor(){super(...arguments),this.LS=!1}pointAt(t){return this.OS(t.fillStyle),super.pointAt(t)}OS(t){t&&this.LS&&this.fS.setTextFillStyle(t)}setResultTableAutoTextStyle(t){return this.LS=t,this.Lr.Bi(),this}getResultTableAutoTextStyle(){return this.LS}}class Bh extends Th{setPosition(t){return this.qr=t,this.DS.setPosition(t),this.fS.setPosition(t),this.Lr.Bi(),this}}class kh{constructor(t,e,i=[]){this.RS=[],this.ES=(t,e)=>(this.RS.forEach((i=>i(t,e))),t),this.FS=t,this.PS=e,this.RS=i}}class Ih extends kh{constructor(){super(...arguments),this.zS=(t,e,i,s)=>this.ES(new Eh(t,e,i,this.FS,this.PS,s),s),this.addStyler=t=>new Ih(this.FS,this.PS,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ih(t,this.PS,this.RS.map((t=>t))),this.setResultTableBackground=t=>new Ih(this.FS,t,this.RS.map((t=>t)))}}class Ch extends kh{constructor(){super(...arguments),this.VS=(t,e,i,s)=>this.ES(new Bh(t,e,i,this.FS,this.PS,s),s),this.addStyler=t=>new Ch(this.FS,this.PS,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ch(t,this.PS,this.RS.map((t=>t))),this.setResultTableBackground=t=>new Ch(this.FS,t,this.RS.map((t=>t)))}}const Ph=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),Lh=(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 Ih(pn,pn,[Ph]);const Rh=new Ih(pn,Sn,[Ph,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof Sn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Fh=Rh;new Ch(xn,pn,[Lh,t=>t.setResultTableVisible(!1)]);const _h=new Ch(un,pn,[Lh,t=>t.setResultTable((t=>t.setOrigin(wr.LeftBottom)))]),Oh=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),zh={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Vh=(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(),Nh=(t,e)=>{let i=e.geometry;return i=Gh(t,e,i),i=Uh(t,e,i),i},Gh=(t,e,i)=>{if(t===zh.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===zh.USA&&("alaska"===s?r={translate:{x:55,y:-25},scale:{x:.16,y:.16}}:"hawaii"===s&&(r={translate:{x:48,y:7},scale:{x:1,y:1}})),r){const{translate:t,scale:n}=r,o=ze(wt(i)),h=[];for(let e=0;e{this.Lm.includes(t)||(this.Lm.push(t),this.P.emit("seriesAdded",this,t))},this.HS=i.WS();const d=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},f=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},g=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},m=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},p=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()},y=()=>{this.NS!==e.AutoCursorModes.disabled&&this.Li.Bi()};this.onSeriesBackgroundMouseEnter(d),this.onSeriesBackgroundMouseMove(f),this.onSeriesBackgroundMouseLeave(g),this.onSeriesBackgroundTouchStart(m),this.onSeriesBackgroundTouchMove(p),this.onSeriesBackgroundTouchEnd(y),this.US(((t,e)=>{const i=e.onMouseEnter(d),s=e.onMouseMove(f),r=e.onMouseLeave(g),n=e.onTouchStart(m),o=e.onTouchMove(p),h=e.onTouchEnd(y),a=this.$S(((t,l)=>{l===e&&(e.offMouseEnter(i),e.offMouseMove(s),e.offMouseLeave(r),e.offTouchStart(n),e.offTouchMove(o),e.offTouchEnd(h)),this.YS(a)}))}))}setAutoCursor(t){return this.XS&&t(this.XS),this.Li.Bi(),this}getAutoCursor(){return this.XS}setAutoCursorMode(t){return this.NS=t,this.Li.Bi(),this}getAutoCursorMode(){return this.NS}jS(t){if(t.xthis.uiScale.x.Lt()||t.ythis.uiScale.y.Lt())return;let e,i=Number.MAX_VALUE;for(const s of this.Lm)if(s.getCursorEnabled()&&s.getVisible()){const r=s.jS(t,!1);if(r){const s=nt(r.location,r.scale,this.engine.scale),n=Le(t,s);Number.isNaN(n)||e&&!(nt.getIsUnderMouse())),r=this.Gm.getIsUnderMouse();this.NS===e.AutoCursorModes.snapToClosest?(r||void 0!==s)&&(i=t&&this.jS(t)):this.NS===e.AutoCursorModes.onHover&&void 0!==s&&s.getCursorEnabled()&&(i=t&&s.jS(t,!0))}i?this.XS.pointAt(i).setVisible(!0):this.XS.setVisible(!1),this.XS.Gs().ru()}US(t){return this.P.on("seriesAdded",t)}KS(t){return this.P.off(t)}$S(t){return this.P.on("seriesDispose",t)}YS(t){return this.P.off(t)}dispose(){return this.HS.G(),this.XS.dispose(),super.dispose()}}class Xh extends mo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("mapChart bg",0),i.Eg("mapChart ui"),r,i.Li.hs.mapChartBackgroundFillStyle,i.Li.hs.mapChartBackgroundStrokeStyle,i.Li.hs.mapChartTitleFont,i.Li.hs.mapChartTitleFillStyle,h),this.qS=[],this.JS=[],this.QS=[],this.ct=this.Bg.d2({scaleXYConstructor:Ti}),this.Fu=!0,this.Vr=this.hs.mapChartFillStyle,this.$r=this.hs.mapChartStrokeStyle,this.tx=this.hs.mapChartOutlierRegionFillStyle,this.ix=this.hs.mapChartOutlierRegionStrokeStyle,this.sx=this.hs.mapChartSeparateRegionFillStyle,this.hx=this.hs.mapChartSeparateRegionStrokeStyle,this.nu=0,this.nx=e.AutoCursorModes.onHover,this.ox=$h,this.Oi=!1,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.lx&>.setTimeout((()=>t())),e},this.onViewChange=t=>this.P.on("viewChange",t),this.ux=(t,e,i,s,r)=>{this.ct.x.q(s).Dt([this._t.left+this.rn.left,this._t.right+this.rn.right]),this.ct.y.q(r).Dt([this._t.bottom+this.rn.bottom,this._t.top+this.rn.top+po.tp(this.Kg,this.jg)]),this.gx&&this.mx(this.yx,this.ct,this.gx)},this.Eu=(t,i,s,r)=>{this.nx!==e.AutoCursorModes.disabled&&(this.Sx(t,s,r),Xt(i)),this.P.emit("mouseEnter",this,i)},this.Vu=(t,e,i,s)=>{this.xx(t,i,s),this.P.emit("mouseLeave",this,e),e&&Xt(e)},this.Gu=(t,i,s,r)=>{this.nx!==e.AutoCursorModes.disabled&&(this.Sx(t,s,r),Xt(i)),this.P.emit("mouseMove",this,i)},this.Wu=(t,e)=>this.P.emit("mouseClick",this,e),this.Uu=(t,e)=>this.P.emit("mouseDoubleClick",this,e),this.$u=(t,e)=>this.P.emit("mouseDown",this,e),this.Yu=(t,e)=>this.P.emit("mouseUp",this,e),this.Xu=(t,e,i)=>{this.P.emit("mouseDragStart",this,e,i)},this.ju=(t,e,i,s,r)=>{this.P.emit("mouseDrag",this,e,i,s,r)},this.Zu=(t,e,i,s)=>{this.P.emit("mouseDragStop",this,e,i,s)},this.Ku=(t,e)=>{this.P.emit("mouseWheel",this,e)},this.qu=(t,e,i,s)=>{this.bx=this.engine.clientLocation2Engine(e.clientX,e.clientY),this.Sx(t,i,s),this.P.emit("touchStart",this,e),Xt(e)},this.Ju=(t,e,i,s)=>{this.bx=this.engine.clientLocation2Engine(e.clientX,e.clientY),this.Sx(t,i,s),this.P.emit("touchMove",this,e),Xt(e)},this.Qu=(t,e,i,s)=>{this.bx=void 0,this.xx(t,i,s),this.P.emit("touchEnd",this,e),Xt(e)},this.ef.Ah||this.ef._h||this.Li.bh(3),this.vx=i.Pp("mapChart plotting",0),this.onResize(this.ux),this.Kg.fs("Map Chart");const a=kt(o?o.autoCursorBuilder:void 0,_h);this.Mx=a.VS(i.WS(),this.ct,this.ct,this.hs).setVisible(!1),this._x=this.iu.lg(),this.Yg(n,this.uiScale);const l=kt(o&&o.type,zh.World);this.yx=l,this.Ax(l).then((()=>{this.P.emit("mapDataReady")}))}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.wx(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.wx(),this}getStrokeStyle(){return this.$r}setEffect(t){return this._x.vs(t),this.Li.Bi(),this}getEffect(){return this._x._s()}setOutlierRegionFillStyle(t){return this.tx="function"==typeof t?t(this.tx):t,this.JS.forEach((t=>t.ps(this.tx))),this.Li.Bi(),this}getOutlierRegionFillStyle(){return this.tx}setOutlierRegionStrokeStyle(t){return this.ix="function"==typeof t?t(this.ix):t,this.JS.forEach((t=>t.$h(this.ix))),this.Li.Bi(),this}getOutlierRegionStrokeStyle(){return this.ix}setSeparateRegionFillStyle(t){return this.sx="function"==typeof t?t(this.sx):t,this.QS.forEach((t=>t.ps(this.sx))),this.Li.Bi(),this}getSeparateRegionFillStyle(){return this.sx}setSeparateRegionStrokeStyle(t){return this.hx="function"==typeof t?t(this.hx):t,this.QS.forEach((t=>t.$h(this.hx))),this.Li.Bi(),this}getSeparateRegionStrokeStyle(){return this.hx}invalidateRegionValues(t){if(!this.lx||!this.kx)return this.Cx=this.Cx||[],this.Cx.push(t),this;const e=this.Vr,i=e instanceof G;if("function"==typeof t)for(let s=0;st.setMouseInteractions(this.Fu))),this}getMouseInteractions(){return this.Fu}offMapDataReady(t){return this.P.off(t,"mapDataReady")}offViewChange(t){return this.P.off(t,"viewChange")}async Ax(t){const e=await((t,e)=>{let i;if(t===zh.World)i="countries_world.json";else if(t===zh.NorthAmerica)i="countries_northAmerica.json";else if(t===zh.SouthAmerica)i="countries_southAmerica.json";else if(t===zh.Africa)i="countries_africa.json";else if(t===zh.Europe)i="countries_europe.json";else if(t===zh.Asia)i="countries_asia.json";else if(t===zh.USA)i="states_usa.json";else if(t===zh.Canada)i="territoriesProvinces_canada.json";else{if(t!==zh.Australia){const e=`LCJS MapChart unidentified \`type\`: ${t}`;throw gt.alert(e),new Error(e)}i="territories_australia.json"}const s=`${e}/maps/${i}`;return gt.fetch(s).then((t=>t.json())).catch((t=>{ve(e,s,"Map Chart",{shouldCrash:!0})}))})(t,this.ef.Fh);this.kx=new Array(e.regions.length).map((t=>{})).fill(void 0);const i=Hh[t];if(!i)throw new Error("Unidentified map type.");for(const t of e.outliers)for(const e of t.geometry){const t=this.vx.vc(this.ct,Ws.Simple).lo(e).setMouseInteractions(this.Fu).ps(this.tx).$h(this.ix);this.JS.push(t)}if(t===zh.USA){const t=25.8,e=29.7;this.QS.push(this.vx.gc(this.ct).setMouseInteractions(!1).ps(this.sx).$h(this.hx).Sn({x:-126,y:t}).q({x:10,y:e-t}),this.vx.gc(this.ct).setMouseInteractions(!1).ps(this.sx).$h(this.hx).Sn({x:-113,y:t}).q({x:7,y:e-t}))}for(let s=0;sthis.Eu(e,i,r,s))).setMouseLeaveEventHandler(((t,i)=>this.Vu(e,i,r,s))).setMouseClickEventHandler(this.Wu).setMouseDoubleClickEventHandler(this.Uu).setMouseDownEventHandler(this.$u).setMouseUpEventHandler(this.Yu).setMouseMoveEventHandler(((t,i)=>this.Gu(e,i,r,s))).setMouseDragStartEventHandler(this.Xu).setMouseDragEventHandler(this.ju).setMouseDragStopEventHandler(this.Zu).setMouseWheelEventHandler(this.Ku).setTouchStartEventHandler(((t,i)=>this.qu(e,i,r,s))).setTouchMoveEventHandler(((t,i)=>this.Ju(e,i,r,s))).setTouchEndEventHandler(((t,i)=>this.Qu(e,i,r,s))),n.push(e)}this.qS.push(n)}if(this._x.nc(this.qS.flat()),this.wx(),this.gx=i,this.mx(t,this.ct,i),this.lx=e,this.Cx){for(const t of this.Cx)this.invalidateRegionValues(t);this.Cx=void 0}this.ru()}mx(t,e,i){const s=Wh[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.Vt(),a=this.ct.y.Vt();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]}})}Ix(t){for(let e=0;ei.ps(t).$h(e)));this.Li.Bi()}Tx(t,e,i){const s=void 0!==e?i.getColors(e):i.getFallbackColor(),r=new z({color:s});for(const e of t)e.ps(r)}Sx(t,e,i){this.Fx={polygon:t,region:e,iRegion:i},this.Li.Bi()}xx(t,e,i){this.Fx&&t===this.Fx.polygon&&(this.Fx=void 0,this.Li.Bi())}setAnimationsEnabled(t){return this.Oi=!t,this}getAnimationsEnabled(){return this.Oi}getMinimumSize(){}dd(){return[this]}ru(){super.ru(),super.$g(),po.ip(this.Kg,this.jg);const t=p(this.ct.x.Bt(),this.ct.y.Bt(),this.ct.x.Ot(),this.ct.y.Ot());this.vx.Wy(t);const e=this.Li.xh()||this.bx;if(this.Fx&&e){const t=this.kx&&this.kx[this.Fx.iRegion];let i=nt(e,this.engine.scale,this.ct);i={x:At(i.x,this.ct.x.getInnerStart(),this.ct.x.getInnerEnd()),y:At(i.y,this.ct.y.getInnerStart(),this.ct.y.getInnerEnd())};let s=i.x,r=i.y;const n=this.Fx.region.transform;this.Fx.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.Mx.setPosition(i).setVisible(!0).getResultTable().setContent(this.ox(new wh,this.Fx.region,t,s,r,this).wu())}else this.Mx.setVisible(!1);return this.Mx.Gs().ru(),this}dispose(){return this.vx.G(),this.Mx.dispose(),co(this.ct),super.dispose()}X(){return super.X(),this.ct.X(),this}j(){return super.j(),this.ct.j(),this}ed(){return he(this.Vr)}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((()=>{})),t.onMouseLeave((()=>{})),this.onMouseEnter((()=>t.setHighlight(!0))),this.onMouseLeave((()=>t.setHighlight(!1))),this.onTouchStart((()=>t.setHighlight(!0))),this.onTouchEnd((()=>t.setHighlight(!1))),oe(t,this.hs,{fill:this.Vr}),this}}const $h=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(jh(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),jh=(t,e)=>{const i=t>0,s=e>0;return`${[le(Math.abs(0|t),2),"° ",le(Math.abs(0|(t<0?t=-t:t)%1*60),2),"' "].join("")+(i?"E":"W")}, ${[le(Math.abs(0|e),2),"° ",le(Math.abs(0|(e<0?e=-e:e)%1*60),2),"' "].join("")+(s?"N":"S")}`};class Zh extends Ni{constructor(t,e,i,s,r,n,o,h,a){super(t,e,e.Px(i),s,r,{numeric:e.Dx({amplitude:s.polarAmplitudeAxisNumericTicks,radial:s.polarAmplitudeAxisNumericTicks}),datetime:e.Dx({amplitude:s.polarAmplitudeAxisDateTimeTicks,radial:s.polarAmplitudeAxisDateTimeTicks}),time:e.Dx({amplitude:s.polarAmplitudeAxisTimeTicks,radial:s.polarAmplitudeAxisTimeTicks})},{type:"linear"}),this.Bx=n,this.Lx=o,this.Ox=h,this.iu=a,this.Rx=i,this.Ex=e.Dx({amplitude:s.polarAmplitudeAxisStrokeStyle,radial:s.polarRadialAxisStrokeStyle}),this.ds=h.ue(i).setMouseInteractions(!1).Ss(e.Dx({amplitude:s.polarAmplitudeAxisTitleFont,radial:s.polarRadialAxisTitleFont})).ps(e.Dx({amplitude:s.polarAmplitudeAxisTitleFillStyle,radial:s.polarRadialAxisTitleFillStyle})),this.Ms=this.iu.lg([this.ds]).vs(s.effectsText)}setStrokeStyle(t){return this.Ex="function"==typeof t?t(this.Ex):t,this.Lx.Bi(),this}getStrokeStyle(){return this.Ex}$s(t,e){return new Kh(e,t,this.Rx,this.Ox,this.Ox,this.zx(this.Bx,this.Rx),this.Ox._u(this.Rx).setMouseInteractions(!1))}Ys(t,e){const i=this.Vx(this.Rx,t);this.Nx&&!1===this.Nx(t)?t._i.setVisible(!1):t._i.setVisible(!0).Sn(Ke(this.Gx(this.Rx,t.u),i.padding)).kn(i.alignment).xs(i.rotation).bn(i.offset.x,i.offset.y),this.Hx(this.Rx,t.Wx,t.Ux,t)}setMouseInteractions(t){return this}ru(){this.Bs({physicalAxisSize:0});const t=this.Zs(((t,e)=>{const i=e.qi.Ws,s=.5*this.Ex.getThickness()+i.tickLength+i.tickPadding+Math.abs(e._i.Gs().Et().y/this.Rx.yi().y)+i.labelPadding;return Math.max(t,s)}),0);return this.$x(this.Rx,this.Ex,t),this.Yx(this.Rx,this.ds,t),t}}class Kh extends io{constructor(t,e,i,s,r,n,o,h){super(t,e,s,i,r,i,h),this.Wx=n,this.Ux=o,n.setMouseInteractions(!1),this.de.push(n,o)}}class Jh extends Zh{constructor(t,e,i,s,r,n,o,h,a){super(t,Qh,e,i,s,r,n,o,h),this.sm=this.Lx._u(this.Rx).setMouseInteractions(!1),this.Xx=a,this.setScrollStrategy(Bi.expansion),this.setTickStrategy(ki.Numeric),this.setTitle("Amplitude")}Js(){return this.Xx()}re(t,e){return so(t,e,this.Rx.y)}oe(t,e,i){const s=2*(e-t),r=this.Rx.x.li(s);return{min:t-i*r,max:e+i*r}}Gx(t,e){return{x:t.jx()?e-t.Zx().start:t.Zx().start-e,y:0}}zx(t,e){return t.kc(e)}Hx(t,e,i,s){const r=s.qi.Ws,n=t.jx()?s.u-t.Zx().start:t.Zx().start-s.u;Mt(s.u,t.Zx().start)||Mt(s.u,t.Zx().end)?e.setVisible(!1):e.setVisible(!0).Zo(0).Ko(360).ia(void 0).ta(0).qo(n).ia(60).ps(F).$h(r.gridStrokeStyle);const o=.5*this.Ex.getThickness();i.la({x:n,y:-o*t.yi().y}).Ko({x:n,y:-(o+r.tickLength)*t.yi().y}).ea(r.tickStyle)}Vx(t,e){const i=e.qi.Ws;return{alignment:{x:0,y:1},padding:{x:0,y:t.yi().y*-(.5*this.Ex.getThickness()+i.tickLength+i.tickPadding)},rotation:0,offset:{x:0,y:0}}}$x(t,e,i){const s=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;this.sm.la({x:0,y:0}).Ko({x:s,y:0}).ea(e)}Yx(t,e,i){const s=t.jx()?(t.Zx().start+t.Zx().end)/2-t.Zx().start:t.Zx().start-(t.Zx().start+t.Zx().end)/2;e.kn({x:0,y:1}).Sn({x:s,y:-i*t.yi().y})}}const Qh={te:t=>t.getAmplitudeMin(),ie:t=>t.getAmplitudeMax(),ee:t=>{},Px:t=>({getInnerStart:()=>t.Zx().start,getInnerEnd:()=>t.Zx().end,Z:(e,i)=>t.Kx(e,i),rt:(e,i,s,r,n)=>t.y.rt(e,i,s,r,n)}),Dx:t=>t.amplitude};class ta extends Zh{constructor(t,e,i,s,r,n,o,h){super(t,ia,e,i,s,r,n,o,h),this.qx=90,this.Jx=12,this.Qx=ea,this.sm=this.Lx.kc(this.Rx).setMouseInteractions(!1),this.Nx=t=>{let e=180*(t.u-this.Rx.tb())/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.Fi=void 0,this.setTickStyle(i.polarRadialAxisTickStyle),this.setTitle("Degrees"),this.setNorth(this.qx)}setTickStyle(t){return this.ib="function"==typeof t?t(this.ib):t,this.sb(),this.Lx.Bi(),this}getTickStyle(){return this.ib}setTickFormattingFunction(t){return this.Qx=t,this.sb(),this.Lx.Bi(),this}getTickFormattingFunction(){return this.Qx}setClockwise(t){this.Rx.eb(t);const e=this.qx*Math.PI/180;return t?this.Rx.hb(e+Math.PI/2):this.Rx.hb(e-Math.PI/2),this.Lx.Bi(),this}getClockwise(){return!this.Rx.rb()}setNorth(t){for(;t<0;)t+=360;t%=360,this.qx=t;const e=t*Math.PI/180;return this.getClockwise()?this.Rx.hb(e+Math.PI/2):this.Rx.hb(e-Math.PI/2),this.Lx.Bi(),this}getNorth(){return 180*this.Rx.tb()/Math.PI}setDivision(t){return this.Jx=t,this.sb(),this.Lx.Bi(),this}getDivision(){return this.Jx}Js(){return[]}re(t,e){return e}oe(t,e,i){return{min:t,max:e}}Gx(t,e){const i=t.rb()?1:-1,s=t.tb(),r=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;return{x:Math.cos((e-s)*i)*r,y:Math.sin((e-s)*i)*r}}zx(t,e){return t._u(e)}Hx(t,e,i,s){const r=this.ib,n=t.rb()?1:-1,o=t.tb(),h=(s.u-o)*n,a=Math.cos(h),l=Math.sin(h),u=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end,c={x:a*u,y:l*u};e.la({x:0,y:0}).Ko(c);const d={x:c.x+a*r.tickLength*t.yi().x,y:c.y+l*r.tickLength*t.yi().y};i.la(c).Ko(d),e.ea(r.gridStrokeStyle),i.ea(r.tickStyle)}Vx(t,e){const i=this.ib,s=t.rb()?1:-1,r=t.tb();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.yi().x,l=Math.sin(o)*h*t.yi().y;return{alignment:{x:0,y:0},padding:{x:a,y:l},rotation:180*n/Math.PI,offset:{x:a,y:l}}}$x(t,e,i){const s=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;this.sm.Zo(0).Ko(360).ta(0).qo(s+.5*e.getThickness()*t.yi().x).ia(60).ps(F).$h(e)}Yx(t,e,i){const s=t.tb(),r=this.Vx(t,{u:0+s}),n=t.jx()?t.Zx().end-t.Zx().start:t.Zx().start-t.Zx().end;e.kn(r.alignment).xs(r.rotation).bn(r.offset.x,r.offset.y).Sn(Ke({x:n,y:0},r.padding))}sb(){this.Cs({Ai:[],wi:[{_i:"Radial ticks",xg:0,Ws:this.ib,Ns:this.Qx,pe:(t,e,i,s)=>{const r=[],n=2*Math.PI/this.Jx;for(let t=0;t<2*Math.PI;t+=n)r.push(t);return r},Ji:{Xs:()=>{},Qi:()=>!1},me:void 0}],vi:ea,Ts:void 0,Is:void 0})}}const ea=(t,e,i)=>(180*t/Math.PI).toFixed(0),ia={te:t=>{},ie:t=>{},ee:t=>{},Px:t=>({getInnerStart:()=>0,getInnerEnd:()=>2*Math.PI,Z:(t,e)=>{},rt:(e,i,s,r,n)=>t.x.rt(e,i,s,r,n)}),Dx:t=>t.radial};class sa extends Zr{constructor(t,e,i,s,r,n){super(e,i,r,n),this.ac="Sector",this.nb=0,this.ob=1*Math.PI/2,this.ab=void 0,this.lb=void 0,this.Lr=t,this.Rx=s,this.gp=this.Lr.kc(this.Rx).Ir(this.getHighlight()),this.rc(this.gp),this.Vr=r.polarSectorFillStyle,this.$r=r.polarSectorStrokeStyle,this.setMouseInteractions(!1)}setAngleStart(t){return this.nb=At(t,0,360),this.Lr.Bi(),this}getAngleStart(){return this.nb}setAngleEnd(t){return this.ob=At(t,0,360),this.Lr.Bi(),this}getAngleEnd(){return this.ob}setAmplitudeStart(t){return this.ab=t,this.Lr.Bi(),this}getAmplitudeStart(){return this.ab}setAmplitudeEnd(t){return this.lb=t,this.Lr.Bi(),this}getAmplitudeEnd(){return this.lb}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.Lr.Bi(),this}getStrokeStyle(){return this.$r}ru(){const t=this.Rx.Zx(),e=180*this.Rx.tb()/Math.PI,i=void 0!==this.ab?At(this.ab,t.start,t.end):t.start,s=void 0!==this.lb?At(this.lb,t.start,t.end):t.end,r=this.Rx.jx()?i-t.start:t.start-i,n=this.Rx.jx()?s-t.start:t.start-s,o=Math.min(r,n),h=Math.max(r,n),a=this.Rx.rb()?1:-1,l=Math.abs(this.ob-this.nb);this.gp.Zo((this.nb-e)*a).Ko((this.ob-e)*a).ta(100*o/h).qo(h).ps(this.Vr).$h(this.$r).ia(Math.ceil(l/2))}mc(t,e){t.Ir(e),this.Lr.Bi()}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}}class ra extends Zr{constructor(){super(...arguments),this.um=!0,this.ub=!0}setAutoScrollingEnabled(t){return this.um=t,this.qa.Li.Bi(),this}getAutoScrollingEnabled(){return this.um}xm(){}ru(){}bm(){}setCursorEnabled(t){return this.ub=t,this}getCursorEnabled(){return this.ub}}class na extends ra{constructor(t,e,i,s,r,n){super(e,i,r,n),this.ox=oa,this.Lr=t,this.qa=e,this.scale=s}getAmplitudeMin(){return this.cb?this.cb.min:void 0}getAmplitudeMax(){return this.cb?this.cb.max:void 0}setCursorResultTableFormatter(t){return this.ox=t,this.qa.Li.Bi(),this}getCursorResultTableFormatter(){return this.ox}setCursorEnabled(t){return super.setCursorEnabled(t)}}const oa=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),ha=(t,e,i)=>t*(1-i)+e*i,aa=(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=ha(i.value,r.value,n),c=ha(e.value,s.value,h);return ha(c,u,l)},la=(t,e)=>{const i=[],s=e.Zx().start,r=e.Zx().end,n=e.jx(),o=e.rb()?1:-1,h=e.tb(),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=At(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},ua=t=>{const e={min:Me,max:Ae};for(const i of t)e.min=Math.min(e.min,i.amplitude),e.max=Math.max(e.max,i.amplitude);return e},ca=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),da=(t,e)=>{let i=hi(t);for(e.rb()||(i*=-1),i+=180*e.tb()/Math.PI;i<0;)i+=360;i%=360;const s=je(t),r=e.Zx(),n=Math.abs(r.end-r.start);return{angle:i,amplitude:ha(r.start,r.end,s/n)}};class fa extends na{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Line Series",this.fb=[],this.gb=!1,this.pb=!1;const o=this.qa.getSeries().length;this.sa=ue(this.hs.polarLineSeriesStrokeStyle,o),this.mb=t.Gp(s,void 0,[Bo.UserSeries]).ea(this.sa).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.mb)}setData(t){return this.fb=ca(t),this.gb=!0,this.cb=ua(this.fb),this.Lr.Bi(),this}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;return this.mb.ea(e),this.Lr.Bi(),this}getStrokeStyle(){return this.sa}setConnectDataAutomaticallyEnabled(t){return this.pb=t,this.Lr.Bi(),this}getConnectDataAutomaticallyEnabled(){return this.pb}Qs(){return this.um&&this.fb.length>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){return this.yb(t,this.mb)}solveNearestFromScreen(t){return this.yb(t,this.mb)}yb(t,e){const i=e.Sb(t);if(!i)return;const{angle:s,amplitude:r}=da(i,this.scale);return Oh(i,this.scale,this.ox(new wh,this,s,r,this.qa.getAmplitudeAxis().formatValue).wu(),this,this.sa.getFillStyle())}ru(){if(this.gb||this.scale.xb()){const t=la(this.fb,this.scale),e=ze(t);this.pb?(t.push({...t[0]}),this.mb.Io(!0)):this.mb.Io(!1),this.mb.qn().Kn(t).Cr(e),this.gb=!1,this.mb.Gs()}}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{stroke:this.sa}),this}}class ga extends na{constructor(t,i,s,r,n,o){super(t,i,s,r,n,o),this.ac="Point Line Series",this.fb=[],this.gb=!1,this.pb=!1,this.bb=3,this.sn=0,this.vb=e.PointShape.Circle;const h=this.qa.getSeries().length;this.Vr=ue(this.hs.polarPointLineSeriesFillStyle,h),this.sa=ue(this.hs.polarPointLineSeriesStrokeStyle,h),this.mb=t.Gp(r,void 0,[Bo.UserSeries]).ea(this.sa).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.mb),this.Mb=t.Bm(r).ps(this.Vr).Yn(this.vb).q(this.bb).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.Mb)}setData(t){return this.fb=ca(t),this.gb=!0,this.cb=ua(this.fb),this.Lr.Bi(),this}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;return this.mb.ea(e),this.Lr.Bi(),this}getStrokeStyle(){return this.sa}setPointFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;return this.Mb.ps(e),this.Lr.Bi(),this}getPointFillStyle(){return this.Vr}setPointSize(t){return this.bb=t,this.Mb.q(t),this.Lr.Bi(),this}getPointSize(){return this.bb}setPointShape(t){return this.vb=t,this.Mb.Yn(this.vb),this}getPointShape(){return this.vb}setPointRotation(t){return this.sn=t,this.Mb.xs(t),this.Lr.Bi(),this}getPointRotation(){return this.sn}setConnectDataAutomaticallyEnabled(t){return this.pb=t,this.Lr.Bi(),this}getConnectDataAutomaticallyEnabled(){return this.pb}Qs(){return this.um&&this.fb.length>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){return this.yb(t,this.mb)}solveNearestFromScreen(t){return this.yb(t,this.mb)}yb(t,e){const i=e instanceof zs?e.jS(t):e.Sb(t);if(!i)return;const{angle:s,amplitude:r}=da(i,this.scale);return Oh(i,this.scale,this.ox(new wh,this,s,r,this.qa.getAmplitudeAxis().formatValue).wu(),this,"color"in i&&this.Vr instanceof V?new z({color:i.color}):this.Vr)}ru(){if(this.gb||this.scale.xb()){const t=la(this.fb,this.scale),e=ze(t);this.pb?(t.push({...t[0]}),this.mb.Io(!0)):this.mb.Io(!1),this.mb.qn().Kn(t).Cr(e),this.Mb.qn().Kn(t).Cr(e),this.gb=!1,this.mb.Gs(),this.Mb.Gs()}}}class ma extends na{constructor(t,i,s,r,n,o){super(t,i,s,r,n,o),this.ac="Point Series",this.fb=[],this.gb=!1,this.bb=3,this.sn=0,this.vb=e.PointShape.Circle;const h=this.qa.getSeries().length;this.Vr=ue(this.hs.polarPointSeriesFillStyle,h),this.Mb=t.Bm(r).ps(this.Vr).Yn(this.vb).q(this.bb).Ir(this.getHighlight()).Wn(ps.Nearest),this.rc(this.Mb)}setData(t){return this.fb=ca(t),this.gb=!0,this.cb=ua(this.fb),this.Lr.Bi(),this}setPointFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;return this.Mb.ps(e),this.Lr.Bi(),this}getPointFillStyle(){return this.Vr}setPointSize(t){return this.bb=t,this.Mb.q(t),this.Lr.Bi(),this}getPointSize(){return this.bb}setPointShape(t){return this.vb=t,this.Mb.Yn(this.vb),this}getPointShape(){return this.vb}setPointRotation(t){return this.sn=t,this.Mb.xs(t),this.Lr.Bi(),this}getPointRotation(){return this.sn}Qs(){return this.um&&this.fb.length>0&&this.getVisible()}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){const i=this.Mb.jS(t);if(!i)return;const{angle:s,amplitude:r}=da(i,this.scale);return Oh(i,this.scale,this.ox(new wh,this,s,r,this.qa.getAmplitudeAxis().formatValue).wu(),this,"color"in i&&this.Vr instanceof V?new z({color:i.color}):this.Vr)}solveNearestFromScreen(t){return this.jS(t,!1)}ru(){if(this.gb||this.scale.xb()){const t=la(this.fb,this.scale),e=ze(t);this.Mb.qn().Kn(t).Cr(e),this.gb=!1,this.Mb.Gs()}}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr}),this}}class pa{constructor(t,e,i,s){this.P=new r.Eventer,this._b=!1,this.qa=t,this.Ab=e,this.Lm=i,this.Dn=s}setGeometry(t){return this.wb=t,this._b=!0,this.qa.Li.Bi(),this}getGeometry(){return this.wb}setMouseInteractions(t){return this.Dn.setMouseInteractions(t),this}dispose(){return this.Dn.dispose(),this.Ab(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.Dn.getVisible()!==t;return this.Dn.setVisible(t),e&&this.P.emit("visibleStateChanged",this,t),this.qa.Li.Bi(),this}getVisible(){return this.Dn.getVisible()}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}}const ya=(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.Kf&&(n=1-n),1===e.Kf&&(o=1-o),u(o,n)};class xa extends Bh{constructor(t,e,i,s,r,n,o,h,a){super(t,e,oo(i.ct,s.ct),r,n,a),this.kb=!1,this.Cb=!1,this.Tb=!0,this.Ib=!0,this.Fb=!1,this.Pb=!1,this.setGridStrokeYStyle=t=>(this.Db.setGridStrokeStyle(t),this),this.getGridStrokeYStyle=()=>this.Db.getGridStrokeStyle(),this.axisX=i,this.axisY=s,this.Bb=o,this.Lb=h,this.Ob=this.axisX.Mg(!1,this.Bb).setMouseInteractions(!1).setAllocatesAxisSpace(!1),this.Db=this.axisY.Mg(!1,this.Lb).setMouseInteractions(!1).setAllocatesAxisSpace(!1)}dispose(){return super.dispose(),this.Ob.dispose(),this.Db.dispose(),this}pointAt(t){return super.pointAt(t),this.setPosition(nt(t.location,t.scale,this.scale)),this}setPosition(t){super.setPosition(t),this.Ob.setValue(t.x),this.Db.setValue(t.y);const e=ya(u(this.Ob.getValue(),this.Db.getValue()),this.axisX,this.axisY);return this.Ob.setGridStrokeLength(this.Fb?e.x:1),this.Db.setGridStrokeLength(this.Pb?e.y:1),this}ru(){this.Ob.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.kb),this.Db.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.Cb);const t=ya(u(this.Ob.getValue(),this.Db.getValue()),this.axisX,this.axisY);return this.Ob.setGridStrokeLength(this.Fb?t.x:1),this.Db.setGridStrokeLength(this.Pb?t.y:1),super.ru()}setGridStrokeXCut(t){return this.Fb=t,this.Lr.Bi(),this}getGridStrokeXCut(){return this.Fb}setGridStrokeYCut(t){return this.Pb=t,this.Lr.Bi(),this}getGridStrokeYCut(){return this.Pb}setGridStrokeXStyle(t){return this.Ob.setGridStrokeStyle(t),this}getGridStrokeXStyle(){return this.Ob.getGridStrokeStyle()}setTickMarkerXVisible(t){return this.kb=t,this.Lr.Bi(),this}getTickMarkerXVisible(){return this.kb}setTickMarkerYVisible(t){return this.Cb=t,this.Lr.Bi(),this}getTickMarkerYVisible(){return this.Cb}setTickMarkerX(t){return this.Ob.setMarker(t),this}setTickMarkerY(t){return this.Db.setMarker(t),this}getTickMarkerX(){return this.Ob.getMarker()}getTickMarkerY(){return this.Db.getMarker()}}class Sa extends Eh{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,h),this.Fb=!1,this.Pb=!1,this.Rb=!1,this.Eb=!1,this.zb=new Map,this.Vb=new Map,this.kb=!0,this.Cb=!0,this.FS=s,this.PS=r,this.Bb=n,this.Lb=o,this.Nb=h.cursorGridStrokeStyleX,this.Gb=h.cursorGridStrokeStyleY}dispose(){return super.dispose(),this.zb.forEach((t=>t.dispose())),this.Vb.forEach((t=>t.dispose())),this.Hb=void 0,this.Wb=void 0,this}ru(){return this.Hb&&this.Hb.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.kb),this.Wb&&this.Wb.setVisible(this.Ri&&this.IS).setMarkerVisible(this.Ri&&this.IS&&this.Cb),super.ru()}pointAt(t){const{location:e}=t,{series:i}=t,{axisX:s}=i,{axisY:r}=i,n=this.Yi(s,!0),o=this.Yi(r,!1);n!==this.Hb&&this.Hb&&this.Hb.setVisible(!1),o!==this.Wb&&this.Wb&&this.Wb.setVisible(!1),n.setValue(e.x),o.setValue(e.y);const h=ya(u(e.x,e.y),s,r);return n.setGridStrokeLength(this.Fb?h.x:1),o.setGridStrokeLength(this.Pb?h.y:1),this.Hb=n,this.Wb=o,super.pointAt(t)}OS(t){if(super.OS(t),t){const e=e=>e.setTextFillStyle(t);this.Hb&&this.Rb&&this.Hb.setMarker(e),this.Wb&&this.Eb&&this.Wb.setMarker(e)}}Yi(t,e){let i=(e?this.zb:this.Vb).get(t);return i||(e?(i=t.Mg(!1,this.Bb),this.zb.set(t,i)):(i=t.Mg(!1,this.Lb),this.Vb.set(t,i)),this.Hs(i,e),i.setMouseInteractions(!1).setAllocatesAxisSpace(!1)),i}Hs(t,e){const i=e?this.Nb:this.Gb;return t.setGridStrokeStyle(i),t.setMouseInteractions(!1),(e?this.kb:this.Cb)?t.setMarkerVisible(!0):t.setMarkerVisible(!1),t}setGridStrokeXCut(t){return this.Fb=t,this.Lr.Bi(),this}getGridStrokeXCut(){return this.Fb}setGridStrokeYCut(t){return this.Pb=t,this.Lr.Bi(),this}getGridStrokeYCut(){return this.Pb}setGridStrokeXStyle(t){return this.Nb=t instanceof Function?t(this.getGridStrokeXStyle()):t,this.zb.forEach((t=>t.setGridStrokeStyle(this.Nb))),this}getGridStrokeXStyle(){return this.Nb}setGridStrokeYStyle(t){return this.Gb=t instanceof Function?t(this.getGridStrokeYStyle()):t,this.Vb.forEach((t=>t.setGridStrokeStyle(this.Gb))),this}getGridStrokeYStyle(){return this.Gb}setTickMarkerXVisible(t){return this.kb=t,this.Lr.Bi(),this}getTickMarkerXVisible(){return this.kb}setTickMarkerYVisible(t){return this.Cb=t,this.Lr.Bi(),this}getTickMarkerYVisible(){return this.Cb}setTickMarkerX(t){return this.zb.forEach((e=>e.setMarker(t))),this.Bb=this.Bb.addStyler(t),this.Lr.Bi(),this}setTickMarkerY(t){return this.Vb.forEach((e=>e.setMarker(t))),this.Lb=this.Lb.addStyler(t),this.Lr.Bi(),this}setTickMarkerXAutoTextStyle(t){return this.Rb=t,this.Lr.Bi(),this}getTickMarkerXAutoTextStyle(){return this.Rb}setTickMarkerYAutoTextStyle(t){return this.Eb=t,this.Lr.Bi(),this}getTickMarkerYAutoTextStyle(){return this.Eb}}class va extends kh{constructor(t,e,i,s,r){super(t,e,r),this.FS=t,this.PS=e,this.Bb=i,this.Lb=s,this.RS=r}}class ba extends va{constructor(){super(...arguments),this.zS=(t,e,i,s)=>this.ES(new Sa(t,e,i,this.FS,this.PS,this.Bb,this.Lb,s),s),this.addStyler=t=>new ba(this.FS,this.PS,this.Bb,this.Lb,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new ba(t,this.PS,this.Bb,this.Lb,this.RS.map((t=>t))),this.setResultTableBackground=t=>new ba(this.FS,t,this.Bb,this.Lb,this.RS.map((t=>t)))}}class Ma extends va{constructor(){super(...arguments),this.VS=(t,e,i,s,r)=>this.ES(new xa(t,e,i,s,this.FS,this.PS,this.Bb,this.Lb,r),r),this.addStyler=t=>new Ma(this.FS,this.PS,this.Bb,this.Lb,this.RS.map((t=>t)).concat(t)),this.setPointMarker=t=>new Ma(t,this.PS,this.Bb,this.Lb,this.RS.map((t=>t))),this.setResultTableBackground=t=>new Ma(this.FS,t,this.Bb,this.Lb,this.RS.map((t=>t)))}}const Aa=new ba(pn,pn,to.PointableTextBox,to.PointableTextBox,[(t,e)=>{Ph(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),wa=new Ma(xn,pn,to.PointableTextBox,to.PointableTextBox,[(t,e)=>{Lh(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),qr(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Da=(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}},Ta=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Ea{constructor(t,i,s,n,o,h){this.Ub=e.UIVisibilityModes.always,this.$b=e.UIVisibilityModes.always,this.pr=!0,this.ce=!1,this.Yb=!1,this.Xb=!1,this.qr=u(0,0),this.Zl=e.UIDraggingModes.draggable,this.Kl=void 0,this.P=new r.Eventer,this.Ri=!0,this.jb=(t,i,s)=>{this.Yb=!0,this.Lr.Bi();const r=this.Zl===e.UIDraggingModes.notDraggable?this.Zl:s||this.Zl;this.Kl=this.Lr.Li.Ae(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.Zb=()=>{this.Yb=!1,this.Lr.Bi(),this.Lr.Li.we(this.Kl)},this.Kb=(t,e)=>{this.Xb=!0,Xt(e),this.Lr.Bi()},this.qb=(t,i)=>{if(this.Zl!==e.UIDraggingModes.notDraggable){const s=i||this.Zl,r=nt(this.Lr.Li.ke(t.x,t.y),this.Lr.Li.ct,this.scale),n=u(s!==e.UIDraggingModes.onlyVertical?Ta(r.x,this.scale.x):this.qr.x,s!==e.UIDraggingModes.onlyHorizontal?Ta(r.y,this.scale.y):this.qr.y);return this.setPosition(n),!0}return!1},this.Jb=(t,e)=>{this.Xb=!1,Xt(e),this.Lr.Bi()},this.onDispose=t=>this.P.on("dispose",t),this.offDispose=t=>this.P.off(t,"dispose"),this.Lr=t,this.renderingScale=i,this.scale=s,this.Mx=n,this.Qb=o,this.hs=h;const a=n.getPointMarker().setMouseInteractions(!0);a.onMouseEnter(this.jb),a.onMouseLeave(this.Zb),a.onMouseDragStart(this.Kb),a.onMouseDrag(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),a.onMouseDragStop(this.Jb),a.onTouchStart(this.Kb),a.onTouchMove(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),a.onTouchEnd(this.Jb),n.getResultTable().setMouseInteractions(!0),this.setPosition(this.qr)}setPosition(t){return this.qr=t,this.Mx.setPosition(t),this.P.emit("positionChange",this,this.qr),this}getPosition(){return this.qr}onPositionChange(t){return this.P.on("positionChange",t)}offPositionChange(t){return this.P.off(t,"positionChange")}setPointMarkerVisibility(t){return this.Ub=t,this.Lr.Bi(),this}getPointMarkerVisibility(){return this.Ub}setResultTableVisibility(t){return this.$b=t,this.Lr.Bi(),this}getResultTableVisibility(){return this.$b}setMouseInteractions(t){return this.pr=t,this.Mx.getPointMarker().setMouseInteractions(t),this.Mx.getResultTable().setMouseInteractions(t),this}getMouseInteractions(){return this.pr}setAutoFitStrategy(t){return this.Mx.setAutoFitStrategy(t),this}getAutoFitStrategy(){return this.Mx.getAutoFitStrategy()}isAttached(){return!0}ru(){const t=this.isAttached();return Da(this.Ub,this.Yb,this.Xb)?this.Mx.setPointMarkerVisible(!0):this.Mx.setPointMarkerVisible(!1),t&&Da(this.$b,this.Yb,this.Xb)?this.Mx.setResultTableVisible(!0):this.Mx.setResultTableVisible(!1),this.Mx.ru(),this}Gs(){return this.Mx.Gs(),this}pointAt(t){return this.Mx.pointAt(t),this}dispose(){return this.ce||(this.ce=!0,this.Qb(this),this.Mx.dispose(),this.P.emit("dispose")),this}setVisible(t){const e=this.Ri!==t;return this.Ri=t,this.Mx.setVisible(t),e&&this.P.emit("visibleStateChanged",this,this.Ri),this}getVisible(){return this.Ri}onVisibleStateChanged(t){return this.P.on("visibleStateChanged",t)}offVisibleStateChanged(t){return this.P.off(t,"visibleStateChanged")}setPointMarker(t){return this.Mx.setPointMarker(t),this}getPointMarker(){return this.Mx.getPointMarker()}setResultTable(t){return this.Mx.setResultTable(t),this}getResultTable(){return this.Mx.getResultTable()}setDraggingMode(t=e.UIDraggingModes.notDraggable){return this.Zl=t,this.Lr.Bi(),this}getDraggingMode(){return this.Zl}}class Ba extends Ea{constructor(t,i,s,r,n,o,h){super(t,i,oo(s.ct,r.ct),n.VS(t,i,s,r,h),o,h),this.tv=e.UIVisibilityModes.always,this.sv=e.UIVisibilityModes.always,this.ev=e.UIVisibilityModes.always,this.hv=e.UIVisibilityModes.always,this.gridStrokeStyleX=this.Mx.getGridStrokeXStyle(),this.gridStrokeStyleY=this.Mx.getGridStrokeYStyle(),this.Lr=t,this.axisX=s,this.axisY=r,this.Qb=o;const a=this.Mx.getTickMarkerX().setMouseInteractions(!0);a.onMouseEnter(((t,i)=>this.jb(t,i,e.UIDraggingModes.onlyHorizontal))),a.onMouseLeave(this.Zb),a.onMouseDragStart(this.Kb),a.onMouseDrag(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Xt(i))),a.onMouseDragStop(this.Jb),a.onTouchStart(this.Kb),a.onTouchMove(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyHorizontal)&&Xt(i)));const l=this.Mx.getTickMarkerY().setMouseInteractions(!0);l.onMouseEnter(((t,i)=>this.jb(t,i,e.UIDraggingModes.onlyVertical))),l.onMouseLeave(this.Zb),l.onMouseDragStart(this.Kb),l.onMouseDrag(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Xt(i))),l.onMouseDragStop(this.Jb),l.onTouchStart(this.Kb),l.onTouchMove(((t,i)=>this.qb(u(i.clientX,i.clientY),e.UIDraggingModes.onlyVertical)&&Xt(i)))}ru(){const t=this.isAttached();return this.Ri&&t&&Da(this.ev,this.Yb,this.Xb)?this.Mx.setTickMarkerXVisible(!0):this.Mx.setTickMarkerXVisible(!1),this.Ri&&t&&Da(this.hv,this.Yb,this.Xb)?this.Mx.setTickMarkerYVisible(!0):this.Mx.setTickMarkerYVisible(!1),this.Mx.setGridStrokeXStyle(this.Ri&&t&&Da(this.tv,this.Yb,this.Xb)?this.gridStrokeStyleX:J),this.Mx.setGridStrokeYStyle(this.Ri&&t&&Da(this.sv,this.Yb,this.Xb)?this.gridStrokeStyleY:J),super.ru()}setGridStrokeXVisibility(t){return this.tv=t,this.Lr.Bi(),this}getGridStrokeXVisibility(){return this.tv}setGridStrokeYVisibility(t){return this.sv=t,this.Lr.Bi(),this}getGridStrokeYVisibility(){return this.sv}setTickMarkerXVisibility(t){return this.ev=t,this.Lr.Bi(),this}getTickMarkerXVisibility(){return this.ev}setTickMarkerYVisibility(t){return this.hv=t,this.Lr.Bi(),this}getTickMarkerYVisibility(){return this.hv}setGridStrokeXCut(t){return this.Mx.setGridStrokeXCut(t),this}getGridStrokeXCut(){return this.Mx.getGridStrokeXCut()}setGridStrokeYCut(t){return this.Mx.setGridStrokeYCut(t),this}getGridStrokeYCut(){return this.Mx.getGridStrokeYCut()}setGridStrokeXStyle(t){return this.gridStrokeStyleX="function"==typeof t?t(this.gridStrokeStyleX):t,this}getGridStrokeXStyle(){return this.Mx.getGridStrokeXStyle()}setGridStrokeYStyle(t){return this.gridStrokeStyleY="function"==typeof t?t(this.gridStrokeStyleY):t,this}getGridStrokeYStyle(){return this.Mx.getGridStrokeYStyle()}setTickMarkerX(t){return this.Mx.setTickMarkerX(t),this}getTickMarkerX(){return this.Mx.getTickMarkerX()}setTickMarkerY(t){return this.Mx.setTickMarkerY(t),this}getTickMarkerY(){return this.Mx.getTickMarkerY()}setMouseInteractions(t){return super.setMouseInteractions(t),this.Mx.getTickMarkerX().setMouseInteractions(t),this.Mx.getTickMarkerY().setMouseInteractions(t),this}}class ka extends Ba{}class Ia extends ka{constructor(t,e,i,s,r,n){super(t,e,i.axisX,i.axisY,s,r,n),this.rv=!1,this.Lr=t,this.owningSeries=i}setPosition(t){return super.setPosition(t),this.rv=!1,this.Lr.Bi(),this}Gs(){if(!this.rv){const t=this.owningSeries.solveNearestFromScreen(nt(this.qr,this.scale,this.Lr.Li.ct));t?(this.qr=nt(t.location,this.owningSeries.scale,this.scale),this.Mx.pointAt(t),this.rv=!0):this.Mx.setPosition(this.qr)}return super.Gs()}isAttached(){return this.rv}}class Ca extends ra{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.nv=[],this.addMarker=(t=wa)=>{const e=new Ia(this.ov(),this.qa.uiScale,this,t,this.removeMarker,this.hs);return this.nv.push(e),e},this.removeMarker=t=>{const e=this.nv.indexOf(t);-1!==e&&this.nv.splice(e,1)},this.de=new Map,this.chart=t,this.Lr=i,this.axisX=s,this.axisY=r,this.axisXAttachHandler=n,this.axisYAttachHandler=o,this.ov=h,this.scale=oo(s.ct,r.ct),this.av=t.lv,t.lv+=1,this.uv(this.scale),this.attacheAxis(),this.onMouseEnter(this.chart.cv),this.onMouseLeave(this.chart.dv),this.onMouseWheel(this.chart.fm),this.onMouseDragStart(this.chart.fv),this.onMouseDrag(this.chart.gm),this.onMouseDragStop(this.chart.gv),this.onTouchStart(this.chart.pm.onTouchStart),this.onTouchMove(this.chart.pm.onTouchMove),this.onTouchEnd(this.chart.pm.onTouchEnd)}attacheAxis(){this.pv=this.axisXAttachHandler(this),this.mv=this.axisYAttachHandler(this)}ru(){super.ru();for(let t=0;t{e.Rr(this.av)})),this.qa.Li.Bi(),this}dispose(){return super.dispose(),this.nv.slice().forEach((t=>t.dispose())),this.pv(this),this.mv(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 _a extends Ca{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,i,s,r,n,o,h,a,u,c),this.Sv=[],this.ca=[],this.xv=0,this.rh=!1,this.Pu=e.HighlightModes.onHover,this.ox=Fa,this.bv=l}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.xv=void 0!==e&&e>0?e:0,this.Lr.Bi(),this}add(t){if(Array.isArray(t)?this.vv(t):this.vv([t]),this.ca.length>0){const t=this.ca[this.ca.length-1];this.Mv={x:t.x,y:t.y}}return this}addArrayX(t,e=1,i){let s=i;return s||(s=this.Mv?this.Mv.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.Jn()+e.Qn()),this.ca.length)}clear(){this._v=void 0;for(let t=0;t0&&this.getVisible()}getXMax(){return this.bv.getXMax(this.Sv,this._v)||0}getXMin(){return this.bv.getXMin(this.Sv,this._v)||0}getYMax(){return this.bv.getYMax(this.Sv,this._v)||0}getYMin(){return this.bv.getYMin(this.Sv,this._v)||0}Wp(){const t=u(0,0);for(const e of this.Sv)t.x=Math.max(t.x,e.co()),t.y=Math.max(t.y,e.do());return t}Av(t,e,i,s){this.bv.Av(t,e,i,s,this.scale,(t=>{this.oc(t)}))}xm(){super.xm();const t=this.Sv.length;this.wv&&this.Av(this.Sv,this.getPointAmount(),this.wv,this.xv),t!==this.Sv.length&&this.yv()}ru(){super.ru();const t=this.getBoundaries();this.ca.length>0&&(this.kv(this.ca),this.ca=[]);for(const e of this.Sv)e.Cr(t);return super.ru()}bm(){super.bm(),this._v=void 0,this.ca.length=0}vv(t){0!==t.length&&(this._v?this._v=Ne(this._v,ze(t)):this._v=ze(t),this.P.emit("dataAdd",this,t,this._v),this.ca=ie(this.ca,t,{canReturnB:!1}),this.Lr.Bi())}Cv(){return La(this.Sv)}Tv(t){return this.P.on("dataAdd",t)}Iv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}Pv(t){return this.P.off(t)}}const Oa=(t,e,i,s)=>{let r,n,o=Number.MAX_VALUE;for(let h=0;h{const e=this.Bv.indexOf(t);e>=0&&this.Bv.splice(e,1);const i=this.Dv.findIndex((e=>e===t.Dn));i>=0&&this.Dv.splice(i,1),this.oc(t.Dn),this.Lr.Bi()};const o=this.qa.getSeries().length;this.Vr=ue(this.hs.polarPolygonSeriesFillStyle,o),this.$r=ue(this.hs.polarPolygonSeriesStrokeStyle,o)}addPolygon(){const t=new pa(this.qa,this.Lv,this,this.Ov());return this.Bv.push(t),t}setFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;for(const t of this.Dv)t.ps(e);return this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){this.$r="function"==typeof t?t(this.$r):t;const e=this.$r;for(const t of this.Dv)t.$h(e);return this.Lr.Bi(),this}getStrokeStyle(){return this.$r}Qs(){return this.um&&void 0!==this.Bv.find((t=>void 0!==t.Rv))&&this.getVisible()}ru(){this.Bv.forEach((t=>{(t._b||this.scale.xb())&&t.Ev&&(t.Dn.lo(la(t.Ev,this.scale)),t._b=!1,t.Dn.Gs())}))}xm(){super.xm();const t=m(Me,Ae);this.Bv.forEach((e=>{if(!e.wb)return;const i=!e._b&&e.Ev?e.Ev:ca(e.wb);e.Ev=i;const s=!e._b&&e.Rv?e.Rv:ua(i);e.Rv=s,t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max)})),this.cb=t}mc(t,e){t.Ir(e),this.Lr.Bi()}jS(t,e){const i=Oa(t,this.Dv,((t,e)=>{const i=t.jS(e);if(i)return nt(i,this.scale,t.Li.ct)}),Le);if(!i)return;const s=nt(i[0],i[1].Li.ct,this.scale),r=this.zv(i[1]);if(!r)return;const{angle:n,amplitude:o}=da(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.ox(new wh,this,n,o,this.qa.getAmplitudeAxis().formatValue).wu(),series:this,fillStyle:this.Vr,polarPolygon:r}}solveNearestFromScreen(t){return this.jS(t,!1)}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}Ov(){const t=this.Lr.vc(this.scale,Ws.Simple).ps(this.Vr).$h(this.$r).Ir(this.getHighlight());return this.Dv.push(t),this.rc(t),t}zv(t){return this.Bv.find((e=>e.Dn===t))}}class Va extends na{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.ac="Area Series",this.fb=[],this.gb=!1,this.pb=!1,this.Vv=!1;const o=this.qa.getSeries().length;this.Vr=ue(this.hs.polarAreaSeriesFillStyle,o),this.$r=ue(this.hs.polarAreaSeriesStrokeStyle,o)}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),oe(t,this.hs,{fill:this.Vr,stroke:this.$r}),this}}class Na extends Va{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Nv=this.Lr.vc(this.scale,Ws.Simple).Ir(this.getHighlight()),this.rc(this.Nv)}ru(){if(this.gb||this.scale.xb()){const t=this.fb,e=!0===this.pb?la(t.concat((t=>{if(0===t.length)return t;const e=t[0],i=t[t.length-1];if(Mt(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;!Mt(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.Gv.start}eb(t){this.Hv=t,this.Xv=!0}rb(){return!1===this.Hv}hb(t){this.Wv=t,this.Xv=!0}tb(){return this.Wv}Qt(){return!1}nt(t,e,i,s){return this.x=new Ai(t.x,e.x,i.x,s?s.x:void 0),this.y=new Ai(t.y,e.y,i.y,s?s.y:void 0),this}jt(){return this.Ht}xb(){return this.Yv}Kv(){return this.Xv}pi(){return this.Xt}yi(){return this.jv}X(){return this.o=!1,this.Xt=!1,this.Yv=!1,this.Xv=!1,this}j(){return this.o=!0,this.Xt=!0,this.Yv=!0,this.Xv=!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.Zv(),this}ci(t){return this.Uv=t,this.Zv(),this}di(t){return this.$v=t,this.Zv(),this}Rt(){return u(this.Uv[0]+this.Uv[1],this.$v[0]+this.$v[1])}Et(){return this.Y}Zv(){const t=this.Gv,e=u(this.x.zt(this.Y.x),this.y.zt(this.Y.y)),i=this.Uv[0]+this.Uv[1],s=this.$v[0]+this.$v[1],r=Math.max(e.x-i,0),n=Math.max(e.y-s,0),o=.5*(r>n?n:r),h=[this.Uv[0]+Math.max((r-2*o)/2,0),this.Uv[1]+Math.max((r-2*o)/2,0)],a=[this.$v[0]+Math.max((n-2*o)/2,0),this.$v[1]+Math.max((n-2*o)/2,0)],l=Math.abs(t.end-t.start);this.x.q(this.Y.x).Dt(h).Z(-l,l),this.y.q(this.Y.y).Dt(a).Z(-l,l),this.jv={x:this.x.getPixelSize(),y:this.y.getPixelSize()},this.Ht={x:this.x.jt(),y:this.y.jt()},this.j()}Yt(t,e){const i=this.yi();return{x:t.x+e.x*i.x,y:t.y+e.y*i.y}}Si(t,e,i,s){const r=this.yi(),n=$e(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 Ua extends qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("polarChart bg",0),i.Eg("polarChart ui"),r,i.Li.hs.polarChartBackgroundFillStyle,i.Li.hs.polarChartBackgroundStrokeStyle,i.Li.hs.polarChartTitleFont,i.Li.hs.polarChartTitleFillStyle,h),this.NS=e.AutoCursorModes.snapToClosest,this.$d=[],this.pr=!0,this.qv=(t,e,i,s,r)=>{this.Rx.q(s,r)},this.jd=Zt(this.$d),this.Jv=t=>{this.$d.push(t)},this.Qv=()=>this.Lm,this.ef.Ah||this.ef._h||this.Li.bh(4),this.tM=i.qy("polarChart series bg",0),this.iM=i.Pp("polarChart axis gridlines",0),this.sM=i.Pp("polarChart series",1),this.eM=i.Pp("polarChart axis lines",2),this.hM=i.Pp("polarChart axis ticks",3),this.Rx=s.d2({scaleXYConstructor:Ga}),this.onResize(this.qv),this.Kg.fs("Polar Chart");const a=kt(o?o.autoCursorBuilder:void 0,Fh);this.XS=a.zS(this.HS,this.uiScale,this.uiScale,this.hs),this.Gm=this.tM.kc(this.Rx).ps(this.hs.polarChartSeriesBackgroundFillStyle).$h(J).Zo(0).Ko(360).ta(0),this.Hm=this.tM.kc(this.Rx).ps(F).$h(this.hs.polarChartSeriesBackgroundStrokeStyle).Zo(0).Ko(360).ta(0),super.Nm(this.Gm,this.Hm),this.Yg(n,this.pixelScale),this.rM=new Jh(this,this.Rx,this.hs,!(!o||!0!==o.disableAnimations),this.iM,this.eM,this.hM,this.iu,this.Qv),this.nM=new ta(this,this.Rx,this.hs,!(!o||!0!==o.disableAnimations),this.iM,this.eM,this.hM,this.iu),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1)}addLineSeries(){const t=new fa(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addPointSeries(){const t=new ma(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addPointLineSeries(){const t=new ga(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addAreaSeries(){const t=new Na(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}addPolygonSeries(){const t=new za(this.sM,this,this.Rm,this.Rx,this.hs,this.Li.iu);return this.Wm(t),t}getSeries(){return this.Lm}addSector(){const t=new sa(this.sM,this,this.jd,this.Rx,this.hs,this.Li.iu);return this.Jv(t),t}getAmplitudeAxis(){return this.rM}getRadialAxis(){return this.nM}ru(){var t,e;super.ru(),po.ip(this.Kg,this.jg);for(const t of this.Lm)t.xm();this.rM.he(),this.nM.he();for(const t of this.Lm)t.ru();for(let t=1;t<=2;t+=1){const e=this.rM.ru(),i=this.nM.ru(),s=po.tp(this.Kg,this.jg),r=[this.rn.left+i,this.rn.right+i],n=[this.rn.bottom+i,this.rn.top+i+s];this.Rx.ci(r).di(n);const o=4;if(!(!this.oM||Math.abs(this.oM.amplitude-e)>=o||Math.abs(this.oM.radial-i)>=o)||1!==t){this.oM={amplitude:e,radial:i};break}}const i=this.Rx.Zx().start,s=this.Rx.Zx().end,r=this.Rx.jx()?((null===(t=this.oM)||void 0===t?void 0:t.radial)||0)*this.Rx.x.getPixelSize()+s-i:((null===(e=this.oM)||void 0===e?void 0:e.radial)||0)*this.Rx.x.getPixelSize()+i-s;this.Gm.qo(r).ia(360),this.Hm.qo(r).ia(360);for(const t of this.$d)t.ru();this.ZS(!1);for(const t of this.Lm)t.bm();return super.$g(),this.aM(),this}setAnimationsEnabled(t){return super.setAnimationsEnabled(t),this.rM.setAnimationsEnabled(t),this.nM.setAnimationsEnabled(t),this}setMouseInteractions(t){return this.pr=t,this}getMouseInteractions(){return this.pr}getMinimumSize(){return u(Ha,Ha)}aM(){}forEachAxis(t){return t(this.rM),t(this.nM),this}dispose(){return this.tM.G(),this.iM.G(),this.sM.G(),this.eM.G(),this.hM.G(),this.$d.slice().forEach((t=>t.dispose())),super.dispose()}dd(){return[...this.Lm,...this.$d]}}const Ha=300;class Wa extends vo{}class Ya extends Wa{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.ac="Slice",this.u=0,this.sp=!1,this.lM=F,this.hp=F,this.rp=this.u,this.ap=W((()=>this.qa.Li.Bi())),this.up=()=>{this.cp=void 0},this.index=t,this.qa=s,this.scale=r,this.tc=n,this.Nv=e.vc(r,Ws.Simple).Ir(this.getHighlight()),this.rc(this.Nv),this._i=i.ue(r).Ir(this.getHighlight()),this.rc(this._i,{isText:!0})}setValue(t){return this.qa.getAnimationsEnabled()?this.getVisible()&&this.pp(this.rp,t):this.rp=t,this.u=t,this.qa.Li.Bi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?(this.cp&&(this.cp.finish(!1),this.cp=void 0),this.pp(this.rp,0,(()=>super.setVisible(!1)))):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(this.cp&&(this.cp.finish(!1),this.cp=void 0),super.setVisible(!0),this.pp(this.rp,this.u)):(this.rp=this.u,super.setVisible(!0)),this}pp(t,e,i){this.cp=this.ap(300,U.ease)([[t,e]],(([t])=>{this.rp=t,this.qa.Li.Bi()})),this.cp.onEveryAnimationEnd(this.up),i&&this.cp.onAnimationEnd(i)}setStyle(t,e,i,s){this.lM=t,this.hp=i,this.Nv.ps(this.lM).$h(e),this._i.ps(this.hp).Ss(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},$a=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Xa(i,r.x),s=Xa(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+v,y:parseInt(`${h===e.FunnelSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>g.x&&y.Nv.lo([g,d,f,m])}};class ja extends mo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("funnelChart bg",0),i.Eg("funnelChart ui"),r,i.Li.hs.funnelChartBackgroundFillStyle,i.Li.hs.funnelChartBackgroundStrokeStyle,i.Li.hs.funnelChartTitleFont,i.Li.hs.funnelChartTitleFillStyle,o),this.mp=[],this.yp=xo.None,this.bp=!0,this._p=0,this.uM=80,this.cM=20,this.dM=0,this.fM=e.FunnelSliceModes.VariableHeight,this.kp=!0,this.Tp=t=>{const e=this.mp.indexOf(t);e>=0&&(this.mp.splice(e,1),this.Ip())},this.ef.Ah||this.ef._h||this.Li.bh(5),this.Cp=this.hs.effectsText,this.Fp=i.Pp("funnelChart bottom",0),this.Dp=i.Pp("funnelChart top",1),this.Kg.fs("Funnel Chart"),this.Sp=this.hs.funnelChartSliceFillStylePalette,this.xp=this.hs.funnelChartSliceStrokeStyle,this.vp=this.hs.funnelChartSliceLabelFont,this.Mp=this.hs.funnelChartSliceLabelFillStyle,h&&this.setAnimationsEnabled(!1),this.Yg(n,this.pixelScale)}addSlice(t,e){const i=new Ya(this._p,this.Fp,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);return this._p+=1,i.setName(t),i.setValue(e),i.iu.sc.vs(this.Cp),i.iu.hc.vs(this.kp),this.mp.push(i),this.Li.Bi(),i.setHighlightOnHover(this.bp),i}addSlices(t){const e=[];for(let i=0;ie.iu.hc.vs(t))),this.Li.Bi(),this}getSliceEffect(){return this.kp}setSliceSorter(t){return this.yp=t,this.mp=this.mp.sort(this.yp),this.Li.Bi(),this}getSliceSorter(){return this.yp}setLabelFillStyle(t){return this.Mp="function"==typeof t?t(this.Mp):t,this.Li.Bi(),this}getLabelFillStyle(){return this.Mp}setLabelFont(t){return this.vp="function"==typeof t?t(this.vp):t,this.Li.Bi(),this}getLabelFont(){return this.vp}setLabelEffect(t){return this.Cp=t,this.mp.forEach((e=>e.iu.sc.vs(t))),this.Li.Bi(),this}getLabelEffect(){return this.Cp}setLabelFormatter(t){return this.Lp=t,this.Li.Bi(),this}getLabelFormatter(){return this.Lp}setSliceHighlightOnHover(t){return this.bp=t,this.mp.forEach((e=>e.setHighlightOnHover(t))),this}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+t)),i=u(this.rn.left+e.x/2,this.rn.bottom+e.y/2);this.mp=this.mp.sort(this.yp);for(let t=0,{length:e}=this.mp;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 Za=(t,i,s)=>{const r=t.uo();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}}},Ka=t=>{const e=t.uo();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 Ja extends ja{constructor(){super(...arguments),this.Lp=So.NamePlusValue,this.Rp=10,this.gM=e.FunnelLabelSide.Left,this.pM=e.SliceLabelIndices.LabelsOnSides,this.zp=[],this.Vp=this.hs.funnelChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Vp=t;for(let t=0;t{const e=this.mp.indexOf(t);e>=0&&this.mp.splice(e,1)},this.ef.Ah||this.ef._h||this.Li.bh(6),this.Lr=e.Pp("gaugeChart layer",0),this.Dp=e.Pp("gaugeChart top layer",1),this.Kg.fs("Gauge Chart"),this.Yg(r,this.pixelScale);const h=Fr();this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}dispose(){return this.Lr.G(),this.Dp.G(),this.mp.slice().forEach((t=>t.dispose())),super.dispose()}}class rl extends sl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Vo=90,this.No=-270,this.SM={min:this.Vo,max:this.No},this.xM=W((()=>this.Lr.Bi())),this.bM=()=>{this.vM=void 0},this.MM=e.Pp("radialGaugeChart bg arc",2),this._M=this.Lr.kc(this.pixelScale).ps(this.hs.gaugeChartEmptyGaugeFillStyle).$h(this.hs.gaugeChartEmptyGaugeStrokeStyle)}setAngleInterval(t,e){t===e?e-=360:Math.abs(e-t)>360&&(e-=(e-t)%360);const i=this.Vo,s=this.No,r=this.SM;return this.getAnimationsEnabled()?this.AM(r,{min:t,max:e}):(r.min=t,r.max=e,this.Vo=t,this.No=e),this.P.emit("angleIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.Li.Bi(),this}getAngleInterval(){return{min:this.Vo,max:this.No}}setGaugeFillStyle(t){return this._M.ps(t),this.Li.Bi(),this}setGaugeStrokeStyle(t){return this._M.$h(t),this.Li.Bi(),this}AM(t,e,i){this.vM=this.xM(1e3,U.ease)([[t.min,e.min],[t.max,e.max]],(([t,e])=>{this.SM={min:t,max:e},this.Vo=t,this.No=e,this.Lr.Bi()})),this.vM.onEveryAnimationEnd(this.bM),i&&this.vM.onAnimationEnd(i)}onAngleIntervalChange(t){return this.P.on("angleIntervalChange",t)}offAngleIntervalChange(t){return this.P.off(t,"angleIntervalChange")}dispose(){return super.dispose(),this.MM.G(),this}}class nl extends vo{wM(t){return this.P.on("valueChange",t)}kM(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){oe(t,this.hs,{fill:this.CM})}}class ol extends nl{onValueChange(t){return this.wM(t)}onIntervalChange(t){return this.kM(t)}}class hl extends ol{constructor(t,e,i,s,r,n,o){super(i,r,n,o),this.Vo=0,this.No=0,this.TM=0,this.IM=0,this.FM=0,this.PM=100,this.DM=!0,this.rp=this.u,this.op=this.getVisible(),this.ap=ye(),this.BM=t=>{this.rp=t,this.qa.Li.Bi()},this.LM=t,this.fe=e,this.qa=i,this.scale=s,this.CM=this.hs.gaugeChartGaugeFillStyle,this.gp=t.kc(s).ps(this.CM).$h(J).Ir(this.getHighlight()),this.rc(this.gp),this.OM=e.ue(s).Ir(this.getHighlight()),this.rc(this.OM,{isText:!0}),this.RM=e.ue(s).Ir(this.getHighlight()),this.rc(this.RM,{isText:!0}),this._i=e.ue(s).Ir(this.getHighlight()),this.rc(this._i,{isText:!0}),this.OM.ps(n.gaugeChartIntervalLabelsFillStyle).Ss(n.gaugeChartIntervalLabelsFont),this.RM.ps(n.gaugeChartIntervalLabelsFillStyle).Ss(n.gaugeChartIntervalLabelsFont),this._i.ps(n.gaugeChartValueLabelFillStyle).Ss(n.gaugeChartValueLabelFont),this.setName("Gauge Slice")}ru(){const t=this.qa.getDataLabelFormatter(),e=this.Vo/90r&&(i=r);const n=this.No-e*this.IM,o=this.Vo+e*this.TM,h=this.PM-this.FM,a=(0!==h?(n-o)/h:1/0)*(i-this.FM);this.gp.Zo(o).Ko(o+a);const l="function"==typeof t?t(i,{getInnerStart:()=>s,getInnerEnd:()=>r}):t.format(i);this._i.fs(l)}EM(){const t=this.qa.getIntervalLabelFormatter(),e="function"==typeof t?t(this.FM,{getInnerStart:()=>this.FM,getInnerEnd:()=>this.PM}):t.format(this.FM);return this.OM.fs(e).Gs(),this.OM.Et()}zM(){const t=this.qa.getIntervalLabelFormatter(),e="function"==typeof t?t(this.PM,{getInnerStart:()=>this.FM,getInnerEnd:()=>this.PM}):t.format(this.PM);return this.RM.fs(e).Gs(),this.RM.Et()}setName(t){return super.setName(t),this.qa.Li.Bi(),this}setValue(t){const e=this.u;return this.qa.getAnimationsEnabled()?this.op&&this.ap(e,t,this.BM):this.rp=t,this.u=t,this.P.emit("valueChange",this,e,t),this.qa.Li.Bi(),this}getValue(){return this.u}setVisible(t){return this.op=t,!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?this.ap(this.rp,0,this.BM,{onCompleted:()=>super.setVisible(!1)}):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(super.setVisible(!0),this.ap(this.rp,this.u,this.BM)):(this.rp=this.u,super.setVisible(!0)),this}setInterval(t,e){const i=this.FM,s=this.PM;return this.P.emit("valueIntervalChange",this,{min:i,max:s},{min:t,max:e}),this.FM=t,this.PM=e,this.qa.Li.Bi(),this}setIntervalLabelsFont(t){return this.OM.Ss(t),this.RM.Ss(t),this.qa.Li.Bi(),this}getIntervalLabelsFont(){return this.OM.ys()}setIntervalLabelsFillStyle(t){return this.OM.ps(t),this.RM.ps(t),this.qa.Li.Bi(),this}getIntervalLabelsFillStyle(){return this.OM.gs()}setIntervalLabelsVisible(t){return t?(this.OM.setVisible(!0),this.RM.setVisible(!0)):(this.OM.setVisible(!1),this.RM.setVisible(!1)),this.DM=t,this}getIntervalLabelsVisible(){return this.DM}setAngleInterval(t,e){return this.Vo=t,this.No=e,this.qa.Li.Bi(),this}setMinAngle(t){return this.Vo=t,this.qa.Li.Bi(),this}setMaxAngle(t){return this.No=t,this.qa.Li.Bi(),this}setMarginInDegrees(t=this.TM,e=this.IM){return t!==this.TM&&(this.TM=t),e!==this.IM&&(this.IM=e),this.qa.Li.Bi(),this}setFillStyle(t){this.CM="function"==typeof t?t(this.CM):t;const e=this.CM;this.gp.ps(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 ll extends rl{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Qc=20,this.GM=new Intl.NumberFormat,this.HM=new Intl.NumberFormat,this.WM=!1,this.UM=5;const h=new hl(this.Lr,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);this.$M=h,this.mp.push(h),this.setPadding(10)}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=ze([this.$M.EM(),this.$M.zM()]),i=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right+2*e.max.x),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+2*e.max.y+t)),s=Math.max(.5*Math.min(i.x,i.y),0),r=u(this.rn.left+e.max.x+.5*i.x,this.rn.bottom+e.max.y+.5*i.y),n=this.WM?this.YM(r,s):r,o=this._M.$r.getThickness(),h=s-.5*o,a=s-this.Qc;let l=a/s*100;l=l>100||l<0?99:l;const c=100*(1-(this.Qc-o)/s);this.XM(n,a)&&(this._M.qo(s).ta(l),this.$M.gp.qo(h).ta(c));const d=.5*(f=s,(g=this.No-this.Vo)/(2*Math.PI*f*(g/360))*o);var f,g;this._M.Zo(this.Vo).Ko(this.No).Sn(n),this.$M.gp.Sn(n),this.$M._i.Sn(n),this.sd&&this.$M.setFillStyle(new z({color:this.sd.getColors(this.$M.getAnimatedValue())})),this.$M.setMinAngle(this.Vo).setMaxAngle(this.No).setMarginInDegrees(d,d).ru();const m=this._M.Go();if(this.$M.getIntervalLabelsVisible()){this.jM(this.Vo,this.No,n,m+this.UM);const t=this.$M.OM.Gs().Mi(),e=this.$M.RM.Gs().Mi();Be(t,e)&&this.ZM(t,e,n,m+this.UM)}}XM(t,e){const i=Ze(this.$M._i.Gs().Et(),.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]}YM(t,e){const[i]=al(t,this.Vo,this.No,e,e),s=ze(i),r=.5*(s.max.x-s.min.x),n=.5*(s.max.y-s.min.y);return Ke(Je(t,u(s.min.x+r,s.min.y+n)),t)}jM(t,e,i,s){const r=ni(t),n=ni(e);this.$M.OM.Sn(Ye(u(i.x+s,i.y),i,-r)),this.$M.RM.Sn(Ye(u(i.x+s,i.y),i,-n)),this.$M.OM.kn(u(-Math.cos(r),-Math.sin(r))),this.$M.RM.kn(u(-Math.cos(n),-Math.sin(n)))}getDefaultSlice(){return this.$M}setAutoScaling(t){return this.WM=t,this.Li.Bi(),this}getAutoScaling(){return this.WM}setDataLabelFormatter(t){return this.HM=t,this.Li.Bi(),this}getDataLabelFormatter(){return this.HM}setIntervalLabelFormatter(t){return this.GM=t,this.Li.Bi(),this}getIntervalLabelFormatter(){return this.GM}setIntervalLabelPadding(t){return this.UM=t,this.Li.Bi(),this}getIntervalLabelPadding(){return this.UM}setThickness(t){return this.Qc=t,this}setLUT(t){return this.sd=t,this.Li.Bi(),this}setDataLabelFont(t){return this.$M._i.Ss(t),this.Li.Bi(),this}getDataLabelFont(){return this.$M._i.ys()}getMinimumSize(){return u(500,300)}setDataLabelFillStyle(t){return this.$M.VM(t),this.Li.Bi(),this}getDataLabelFillStyle(){return this.$M.NM()}dd(){return this.mp}dispose(){return this.$M.dispose(),super.dispose()}}class ul extends vo{}class cl extends ul{constructor(t,e,i,s,r,n,o,h){super(s,n,o,h),this.ac="Slice",this.u=0,this.sp=!1,this.lM=F,this.hp=F,this.rp=this.u,this.ap=W((()=>this.qa.Li.Bi())),this.up=()=>{this.cp=void 0},this.index=t,this.qa=s,this.scale=r,this.tc=n,this.Nv=e.vc(r,Ws.Simple).Ir(this.getHighlight()),this.rc(this.Nv),this._i=i.ue(r).Ir(this.getHighlight()),this.rc(this._i,{isText:!0})}setValue(t){return this.qa.getAnimationsEnabled()?this.getVisible()&&this.pp(this.rp,t):this.rp=t,this.u=t,this.qa.Li.Bi(),this}getValue(){return this.u}setVisible(t){return!1===t?this.qa.getAnimationsEnabled()&&this.rp>0?(this.cp&&(this.cp.finish(!1),this.cp=void 0),this.pp(this.rp,0,(()=>super.setVisible(!1)))):(this.rp=0,super.setVisible(!1)):this.qa.getAnimationsEnabled()?(this.cp&&(this.cp.finish(!1),this.cp=void 0),super.setVisible(!0),this.pp(this.rp,this.u)):(this.rp=this.u,super.setVisible(!0)),this}pp(t,e,i){this.cp=this.ap(300,U.ease)([[t,e]],(([t])=>{this.rp=t,this.qa.Li.Bi()})),this.cp.onEveryAnimationEnd(this.up),i&&this.cp.onAnimationEnd(i)}setStyle(t,e,i,s){this.lM=t,this.hp=i,this.Nv.ps(this.lM).$h(e),this._i.ps(this.hp).Ss(s);for(let t=0;t{let i=100;return t<=0?t=0:(i=t>=100?100:t,t=e*(i/100)),t},fl=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=dl(i,r.x),s=dl(s,r.x);const l=t.length;let u=0,c=0;u=t.reduce(((t,e)=>t+e.getAnimatedValue()),0);let d={x:a-i/2,y:r.y+n.bottom},f={x:a+i/2,y:r.y+n.bottom},g={x:0,y:n.bottom},m={x:0,y:n.bottom},p=0,y=0;if(o)for(let i=0;i0&&(d={x:g.x+x*o,y:g.y-o},f={x:m.x-x*o,y:m.y-o}),v=(i+c/u*(s-i))/2,g={x:a-v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?d.y-S:S}`,10)},m={x:a+v,y:parseInt(`${h===e.PyramidSliceModes.VariableWidth?f.y-S:S}`,10)},f.x>=d.x&&m.x>=g.x&&y.Nv.lo([g,d,f,m])}};class gl extends mo{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("pyramidChart bg",0),i.Eg("pyramidChart ui"),r,i.Li.hs.pyramidChartBackgroundFillStyle,i.Li.hs.pyramidChartBackgroundStrokeStyle,i.Li.hs.pyramidChartTitleFont,i.Li.hs.pyramidChartTitleFillStyle,o),this.mp=[],this.yp=xo.None,this.Sp=this.hs.pyramidChartSliceFillStylePalette,this.xp=this.hs.pyramidChartSliceStrokeStyle,this.bp=!0,this.vp=this.hs.pyramidChartSliceLabelFont,this.Mp=this.hs.pyramidChartSliceLabelFillStyle,this._p=0,this.uM=0,this.cM=80,this.dM=0,this.fM=e.PyramidSliceModes.VariableHeight,this.kp=!0,this.Tp=t=>{const e=this.mp.indexOf(t);e>=0&&(this.mp.splice(e,1),this.Ip())},this.ef.Ah||this.ef._h||this.Li.bh(8),this.Cp=this.hs.effectsText,this.Fp=i.Pp("pyramidChart bottom",0),this.Dp=i.Pp("pyramidChart top",1),this.Kg.fs("Pyramid Chart"),h&&this.setAnimationsEnabled(!1),this.Yg(n,this.pixelScale)}addSlice(t,e){const i=new cl(this._p,this.Fp,this.Dp,this,this.pixelScale,this.Tp,this.hs,this.Li.iu);return this._p+=1,i.setName(t),i.setValue(e),i.iu.sc.vs(this.Cp),i.iu.hc.vs(this.kp),this.mp.push(i),this.Li.Bi(),i}addSlices(t){const e=[];for(let i=0;ie.iu.hc.vs(t))),this.Li.Bi(),this}getSliceEffect(){return this.kp}setSliceSorter(t){return this.yp=t,this.mp=this.mp.sort(this.yp),this.Li.Bi(),this}getSliceSorter(){return this.yp}setLabelFillStyle(t){return this.Mp="function"==typeof t?t(this.Mp):t,this.Li.Bi(),this}getLabelFillStyle(){return this.Mp}setLabelFont(t){return this.vp="function"==typeof t?t(this.vp):t,this.Li.Bi(),this}getLabelFont(){return this.vp}setLabelEffect(t){return this.Cp=t,this.mp.forEach((e=>e.iu.sc.vs(t))),this.Li.Bi(),this}getLabelEffect(){return this.Cp}setLabelFormatter(t){return this.Lp=t,this.Li.Bi(),this}getLabelFormatter(){return this.Lp}setSliceHighlightOnHover(t){return this.bp=t,this.mp.forEach((e=>e.setHighlightOnHover(t))),this}ru(){super.ru(),po.ip(this.Kg,this.jg),super.$g();const t=po.tp(this.Kg,this.jg),e=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.top+t)),i=u(this.rn.left+e.x/2,this.rn.bottom+e.y/2);this.mp=this.mp.sort(this.yp);for(let t=0,{length:e}=this.mp;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 ml=(t,i,s)=>{const r=t.uo();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}}},pl=t=>{const e=t.uo();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 yl extends gl{constructor(){super(...arguments),this.Lp=So.NamePlusValue,this.Rp=10,this.gM=e.PyramidLabelSide.Left,this.pM=e.SliceLabelIndices.LabelsOnSides,this.zp=[],this.Vp=this.hs.pyramidChartConnectorStrokeStyle}setLabelConnectorStyle(t){this.Vp=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),Ml=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Al;e.SpiderWebMode=void 0,(Al=e.SpiderWebMode||(e.SpiderWebMode={}))[Al.Normal=0]="Normal",Al[Al.Circle=1]="Circle";class wl{constructor(t,e,i,s,n,o,h,a){this.P=new r.Eventer,this.qM=t,this.fe=e,this.scale=i,this.chart=s,this.tag=n,this.axisScale=o,this.JM=h,this.QM=a,this.t_=this.qM._u(this.scale).setMouseInteractions(!1),this.i_=this.fe.ue(this.scale).fs(this.tag).setMouseInteractions(!1),this.s_=this.JM(this,this.fe.Gp(this.scale,void 0,[Bo.InternalUI])).ea(this.chart.getNibStyle()),this.QM.nc([this.i_])}Op(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.i_.setVisible(!0).Sn(Ke(c,u(h.paddingX,h.paddingY))).Mn(h.alignmentX).An(h.alignmentY):this.i_.setVisible(!1)}getLabelSize(){return this.i_.Ss(this.chart.getAxisLabelFont()).ps(this.chart.getAxisLabelStyle()).Gs().Et()}dispose(){this.t_&&this.t_.dispose(),this.i_&&this.i_.dispose(),this.s_&&this.s_.dispose()}}const Dl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class Tl extends ra{constructor(t,i,s,r,n,o,h,a,l,u,c){super(t,l,u,c),this.ac="Spider Series",this.ca=new Map,this.Pu=e.HighlightModes.onHover,this.ox=Dl,this.bb=8,this.sn=0,this.e_=ye(),this.h_={},this.r_={},this.op=this.getVisible(),this.n_=1,this.o_=((t,e)=>{const i=W((()=>{}));let s,r,n=1;return(o,h,a)=>{if(o===r)return;r=o;const l=(null==a?void 0:a.easing)||U.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.n_=t,this.Lr.Li.Bi()}),(t=>{super.setVisible(t)})),this.qa=t,this.Lr=i,this.vb=r,this.a_=n,this.Jy=o,this.l_=h,this.u_=a,this.scale=s;const d=this.qa.getSeries().length;this.c_=ue(u.spiderSeriesFillStyle,d),this.d_=ue(u.spiderSeriesStrokeStyle,d),this.f_=ue(u.spiderSeriesPointFillStyle,d)}Qs(){return this.um&&this.ca.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.e_(0,1,(t=>{e.forEach(((e,s)=>{const r=(null==i?void 0:i.get(s))||0;this.ca.set(s,r+t*(e-r)),this.Lr.Li.Bi()}))}),{easing:this.h_.easing,durationMs:this.h_.durationMs,onStart:()=>{i=new Map(this.ca)}})}else for(let e=0;e=3&&(this.Nv||(this.Nv=this.Lr.vc(this.scale,Ws.Simple).$h(this.d_).ps(this.c_).Ir(this.getHighlight()),this.rc(this.Nv)),this.Nv.lo(t),this.Mb||(this.Mb=this.Lr.Bm(this.scale).q(this.bb).Yn(this.vb).xs(this.sn).ps(this.f_).Ir(this.getHighlight()),this.rc(this.Mb)),this.Mb.qn().Kn(t))}}attach(t,e=!0){return super.attach(t,e),oe(t,this.hs,{fill:this.c_,stroke:this.d_}),this}g_(){for(let t=0;t{const i=Math.PI/2-2*t*Math.PI/e;return i>=0?i:i+2*Math.PI},Bl=t=>ze(t.i_.Mi()),kl=t=>ze(t.Mi()),Il=(t,i,s,r)=>t.ta(0).Sn(s).Zo(90).Ko(-270).ia(i===e.SpiderWebMode.Circle?void 0:r.length),Cl={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Pl={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Ll=()=>{Pl.alignmentX=0,Pl.alignmentY=0,Pl.paddingX=0,Pl.paddingY=0};class Rl extends qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("spiderChart bg",0),i.Eg("spiderChart ui"),r,i.Li.hs.spiderChartBackgroundFillStyle,i.Li.hs.spiderChartBackgroundStrokeStyle,i.Li.hs.spiderChartTitleFont,i.Li.hs.spiderChartTitleFillStyle,h),this.NS=e.AutoCursorModes.onHover,this.rn=x(20,20,20,20),this.axisScale=st.d1({scale1DConstructor:Ai,dimension:"x"}).Z(0,1),this.Jy=[],this.p_=[],this.m_=[],this.y_=Bi.expansion,this.S_=!0,this.x_=Ml,this.b_=bl,this.pr=!0,this.v_=e.SpiderWebMode.Normal,this.M_=4,this.__=this.hs.spiderChartWebStyle,this.A_=this.hs.spiderChartScaleLabelFillStyle,this.w_=this.hs.spiderChartScaleLabelFont,this.k_=5,this.C_=this.hs.spiderChartAxisLabelFillStyle,this.T_=this.hs.spiderChartAxisLabelFont,this.I_=5,this.F_=this.hs.spiderChartAxisStrokeStyle,this.P_=this.hs.spiderChartAxisNibStrokeStyle,this.wd=10,this.D_=x(),this.hasAxis=t=>this.Jy.reduce(((e,i)=>e||i.tag===t),!1),this.formatValue=t=>this.axisScale.oi(t,bi.Numeric),this.B_=()=>(t=>{const e=t.length;for(let i=0;ithis.O_.kc(this.pixelScale).setMouseInteractions(!1),this.R_=t=>t.dispose(),this.E_=()=>this.gf.ue(this.pixelScale).setMouseInteractions(!1),this.z_=t=>t.dispose(),this.V_=t=>this.formatValue(this.axisScale.getInnerStart()+t*(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart())),this.N_=(t,e)=>{let i,s;const r=()=>{void 0!==this.G_&&this.G_.finish(),i=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),s=this.y_,this.y_=void 0},n=(e,s,r,n,o)=>{const h=u(r.x-s.x,s.y-r.y),a=this.Jy.findIndex((e=>e===t));if(a>=0&&void 0!==i){const e=El(a,this.Jy.length),s=u(Math.cos(e),Math.sin(e)),r=h.x*s.x+h.y*s.y,n=je(Je(t.t_.ri(),t.t_.ei())),l=i.min+(i.max-i.min)*Math.max(1+r/n,.01);this.axisScale.Z(i.min,l),Xt(o),this.Li.Bi()}},o=()=>{if(i=void 0,void 0!==s)if(this.Oi){const t=m(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd()),e=this.H_(),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.G_=this.Fg.Li.Le(300,U.ease)([[0,1]],(([e])=>{this.axisScale.Z(t.min+e*(s-t.min),t.max+e*(r-t.max))})),this.G_.onAnimationEnd((()=>{this.G_=void 0,this.y_=i}))}else this.y_=s}else this.y_=s;s=void 0};e.setMouseEnterEventHandler(this.W_).setMouseLeaveEventHandler(this.U_).setMouseDragStartEventHandler(r).setMouseDragEventHandler(((t,e,i,s,r)=>n(0,u(e.clientX,e.clientY),s,0,e))).setMouseDragStopEventHandler(o);const h=Fr(new Or(((t,e,i)=>{this.W_(t),r(),Xt(i)}),n,((t,e,i,s)=>{this.U_(t),o(),Xt(s)})));return e.setTouchStartEventHandler(h.onTouchStart).setTouchMoveEventHandler(h.onTouchMove).setTouchEndEventHandler(h.onTouchEnd)},this.Y_=t=>{this.S_&&!this.hasAxis(t)&&this.addAxis(t)},this.l_=(t,e)=>{for(const i of this.Jy)if(i.tag===t){const t=Math.max(Math.min((e-this.axisScale.getInnerStart())/(this.axisScale.getInnerEnd()-this.axisScale.getInnerStart()),1),0);return _e(i.t_.ri(),i.t_.ei(),t)}},this.u_=t=>{if(0===this.Jy.length)return;const e=Je(nt(t,this.engine.scale,this.pixelScale),this.Jy[0].t_.ri()),i=Math.atan2(e.y,e.x);let s,r=Me;for(const t of this.Jy){const e=Je(t.t_.ei(),t.t_.ri()),n=Math.atan2(e.y,e.x),o=Math.abs(i-n);o{this.pr&&(t.ea(this.P_),this.Zg.Bi())},this.U_=t=>{t.ea(this.P_),this.Zg.Bi()},this.ef.Ah||this.ef._h||this.Li.bh(9),this.tM=i.qy("spiderChart series bg",0),this.O_=i.Pp("spiderChart web shapes",0),this.X_=i.Pp("spiderChart axis bg",1),this.vx=i.Pp("spiderChart plotting",2),this.gf=i.Pp("spiderChart fg",3),this.QM=this.iu.lg().vs(this.hs.effectsText),this.Kg.fs("Spider Chart");const a=kt(o?o.autoCursorBuilder:void 0,Rh);this.XS=a.zS(this.HS,this.uiScale,this.uiScale,this.hs),this.Gm=this.tM.kc(this.pixelScale).ps(this.hs.spiderChartSeriesBackgroundFillStyle).$h(J).Zo(90).Ko(-270).ta(0),this.Hm=this.tM.kc(this.pixelScale).ps(F).$h(this.hs.spiderChartSeriesBackgroundStrokeStyle).Zo(90).Ko(-270).ta(0),super.Nm(this.Gm,this.Hm),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Yg(n,this.pixelScale)}addAxis(t){if("string"==typeof t){if(!this.hasAxis(t)){const e=new wl(this.X_,this.gf,this.pixelScale,this,t,this.axisScale,this.N_,this.QM);this.Jy.push(e)}}else t&&this.Jy.push(t);return this.QM.nc(this.Jy.map((t=>t.i_))),this.Zg.Bi(),this}addSeries(t=e.PointShape.Circle){const i=new Tl(this,this.vx,this.pixelScale,t,this.Y_,this.Jy,this.l_,this.u_,this.Rm,this.hs,this.Li.iu);return this.Wm(i),i}getSeriesCount(){return this.Lm.length}getSeries(){return this.Lm}setWebMode(t){return this.v_=t,this.Zg.Bi(),this}getWebMode(){return this.v_}setWebCount(t){return this.M_=t,this.Zg.Bi(),this}getWebCount(){return this.M_}setWebStyle(t){return this.__="function"==typeof t?t(this.__):t,this.Zg.Bi(),this}getWebStyle(){return this.__}setScaleLabelStyle(t){return this.A_="function"==typeof t?t(this.A_):t,this.Zg.Bi(),this}getScaleLabelStyle(){return this.A_}setScaleLabelFont(t){return this.w_="function"==typeof t?t(this.w_):t,this.Zg.Bi(),this}getScaleLabelFont(){return this.w_}setScaleLabelPadding(t){return this.k_=t,this.Zg.Bi(),this}getScaleLabelPadding(){return this.k_}setScaleLabelStrategy(t){return this.x_=t,this.Zg.Bi(),this}setScaleLabelFormatter(t){return this.formatValue=t,this.Zg.Bi(),this}setAxisLabelStyle(t){return this.C_="function"==typeof t?t(this.C_):t,this.Zg.Bi(),this}getAxisLabelStyle(){return this.C_}setAxisLabelFont(t){return this.T_="function"==typeof t?t(this.T_):t,this.Zg.Bi(),this}getAxisLabelFont(){return this.T_}setAxisLabelEffect(t){return this.QM.vs(t),this.Li.Bi(),this}getAxisLabelEffect(){return this.QM._s()}setAxisLabelPadding(t){return this.I_=t,this.Zg.Bi(),this}getAxisLabelPadding(){return this.I_}setAxisLabelStrategy(t){return this.b_=t,this.Zg.Bi(),this}setAxisStyle(t){return this.F_="function"==typeof t?t(this.F_):t,this.Zg.Bi(),this}getAxisStyle(){return this.F_}setNibStyle(t){return this.P_="function"==typeof t?t(this.P_):t,this.Zg.Bi(),this}getNibStyle(){return this.P_}setNibLength(t){return this.wd=t,this.Zg.Bi(),this}getNibLength(){return this.wd}setAutoAxis(t){return this.S_=t,this}getAutoAxis(){return this.S_}setMouseInteractions(t){return this.pr=t,this}getMouseInteractions(){return this.pr}setAxisScrollStrategy(t){return this.y_=t,this.Zg.Bi(),this}getAxisScrollStrategy(){return this.y_}setAxisInterval(t,e=0){return this.axisScale.Z(e,t),this.Zg.Bi(),this}getOriginValue(){return this.axisScale.getInnerStart()}getEdgeValue(){return this.axisScale.getInnerEnd()}ru(){super.ru(),po.ip(this.Kg,this.jg);const t=this.Jy.length,e=po.tp(this.Kg,this.jg),i=u(this.pixelScale.x.getInnerInterval()-(this.rn.left+this.rn.right),this.pixelScale.y.getInnerInterval()-(this.rn.bottom+this.rn.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.b_){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.y_){const t=this.H_();if(void 0!==t){const e=this.y_.start(this.axisScale.getInnerStart(),this.axisScale.getInnerEnd(),t.min,t.max),i=this.y_.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.D_=x(this._t.left+this.rn.left+s.left,this._t.top+this.rn.top+e+s.top,this._t.right+this.rn.right+s.right,this._t.bottom+this.rn.bottom+s.bottom),this.Op(r,n);for(const t of this.Lm)t.xm();for(const t of this.Lm)t.ru();super.$g(),this.ZS(!1);for(const t of this.Lm)t.bm()}dispose(){return this.tM.G(),this.O_.G(),this.X_.G(),this.vx.G(),this.gf.G(),super.dispose()}getMinimumSize(){return u(this.D_.left+this.D_.right+100,this.D_.bottom+this.D_.top+100)}Op(t,e){const i=this.Jy.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];Il(h,i,s,n);const u=r*((l+1)/e);h.qo(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=_e(n,o[a],s);e.Sn(Ke(c,u(p.paddingX,p.paddingY))).Mn(p.alignmentX).An(p.alignmentY).fs(l(s))}}}for(let e=f;e1;for(const s of this.Jy)for(const r of this.Lm){const n=r.getValue(s.tag,i);void 0!==n&&(t=void 0===t?n:Math.min(t,n),e=void 0===e?n:Math.max(e,n))}if(void 0!==t&&void 0!==e)return m(t,e)}}const Fl={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},_l={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},Ol={defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,te:t=>t.getXMin(),ie:t=>t.getXMax(),ee:t=>t.Wp().x},zl={defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,te:t=>t.getYMin(),ie:t=>t.getYMax(),ee:t=>t.Wp().y},Vl={...Fl,...Ol},Nl={..._l,...zl};class Gl extends Nr{constructor(t,e,i,s){super(),this.de=[],this.nu=0,this.bc=!0,this.P=new r.Eventer,this.j_=t=>(this.de.push(t),this.jl(t),t.setMouseInteractions(this.bc),t),this.getHighlight=()=>this.nu,this.Lr=t,this.scale=e,this.Z_=i,this.hs=s}K_(){return this.de}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}dispose(){return this.de.forEach(vt),this.Z_&&this.Z_(this),this.Lr.Li.Bi(),this.P.emit("dispose",this),this}setVisible(t){return super.setVisible(t),this.de.forEach((e=>e.setVisible(t))),this.Lr.Li.Bi(),this}onDispose(t){return this.P.on("dispose",t)}offDispose(t){return this.P.off(t,"dispose")}setHighlight(t){return this.nu=me(t),this.Lr.Bi(),this}setMouseInteractions(t){this.bc=t;for(let t=0;t{t.K_().forEach((t=>this.oc(t)));const e=this.q_.findIndex((e=>e===t));e>=0&&this.q_.splice(e,1),this.Lr.Bi()}}clear(){return this.q_.slice().forEach(vt),this.q_.length=0,this.Du=0,this.Lr.Bi(),this}J_(t,e){void 0!==e?this.q_.splice(e,0,t):this.q_.push(t),t.K_().forEach((t=>this.rc(t,{setEventHandlers:!1}))),t.onMouseEnter(((t,e)=>this.Eu(t,e))),t.onMouseLeave(((t,e)=>this.Vu(t,e))),t.onMouseClick(((t,e)=>this.Wu(t,e))),t.onMouseDoubleClick(((t,e)=>this.Uu(t,e))),t.onMouseDown(((t,e)=>this.$u(t,e))),t.onMouseUp(((t,e)=>this.Yu(t,e))),t.onMouseMove(((t,e)=>this.Gu(t,e))),t.onMouseDragStart(((t,e,i)=>this.Xu(t,e,i))),t.onMouseDrag(((t,e,i,s,r)=>this.ju(t,e,i,s,r))),t.onMouseDragStop(((t,e,i,s)=>this.Zu(t,e,i,s))),t.onMouseWheel(((t,e)=>this.Ku(t,e))),t.onTouchStart(((t,e)=>this.qu(t,e))),t.onTouchMove(((t,e)=>this.Ju(t,e))),t.onTouchEnd(((t,e)=>this.Qu(t,e))),this.Lr.Bi()}mc(t,e){t.setHighlight(e)}Q_(t){return this.q_.find((e=>e.K_().includes(t)))}setCursorEnabled(t){return super.setCursorEnabled(t)}}class Hl extends Gl{}class Wl extends Ul{constructor(){super(...arguments),this.tA=void 0,this.iA=()=>{this.tA=void 0}}Qs(){return this.um&&this.q_.length>0&&this.getVisible()}setDefaultStyle(t){this.sA=t,this.q_.forEach(t),t(this.eA);for(let t=0;tt.getVisible()&&t.getIsUnderMouse())):this.q_.filter((t=>t.getVisible())),this.rA,Le);if(void 0!==i)return{location:nt(i[0],this.Lr.Li.ct,this.scale),scale:this.scale,resultTableContent:this.ox(new wh,this,i[1]).wu(),series:this,fillStyle:i[1].getDominantStyle(),figure:i[1]}}solveNearestFromScreen(t){return this.jS(t,!1)}J_(t){super.J_(t),this.sA&&this.sA(t)}clear(){return this.tA=void 0,super.clear()}getXMax(){return this.tA||(this.tA=this.nA()),this.tA.max.x}getXMin(){return this.tA||(this.tA=this.nA()),this.tA.min.x}getYMax(){return this.tA||(this.tA=this.nA()),this.tA.max.y}getYMin(){return this.tA||(this.tA=this.nA()),this.tA.min.y}Wp(){return u(0,0)}nA(){const t=m(c(Me,Me),c(Ae,Ae));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)},tu=(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=Xe(Je(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]=Ke(Ze(r,l),f[1]),f[2]=Je(f[2],Ze(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.Sv.length>0){const e=this.Sv[this.Sv.length-1];if(t.length>0){const i=e.$n(),s=e.Un(),r=i.length+s.length-+e.To();if(r>=this.wv){const n=s.length>0?s[s.length-1]:i[e.To()?r:r-1],o=u((n.x+t[0].x)/2,(n.y+t[0].y)/2);e.Kn(o,m(u(o.x,o.y),u(o.x,o.y))).Io(!0),this.zA([o].concat(t)).Co(!0)}else e.Kn(t,this._v)}}else t.length>0&&this.zA(t)},this.VA=t=>{if(this.RA.length>0){const e=this.RA[this.RA.length-1];t.length>0&&((e.$n().length+e.Un().length)*this.OA>=this.wv?this.NA(t):e.Kn(t))}else t.length>0&&this.NA(t)},this.GA=(t,e)=>{const i=t.jS(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.HA=(t,e)=>{const i=t.WA(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.vb=l,this.UA=f,this.$A=ue(c.pointLineSeriesFillStyle,g),this.sa=ue(this.hs.pointLineSeriesStrokeStyle,g)}add(t){return super.add(t),this}Cv(){return La(this.RA)}setStrokeStyle(t){this.sa="function"==typeof t?t(this.sa):t;const e=this.sa;for(let t=0;te.setVisible(t))),this}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorSolveBasis(t){return this.LA=t,this.Sv.forEach((e=>e.Wn(ys(t)))),this.RA.forEach((e=>e.Wn(ys(t)))),this.Lr.Bi(),this}getCursorSolveBasis(){return this.LA}ed(){return he(this.$A)||he(this.sa.getFillStyle())}uv(t){}mc(t,e){t.Ir(e),this.Lr.Bi()}kv(t){const e=this.Sv.length>0?this.Sv[this.Sv.length-1].$n().length+this.Sv[this.Sv.length-1].Un().length-+this.Sv[this.Sv.length-1].To():void 0;Pa(t,e,this.wv,this.EA),Pa(t,e,this.wv,this.VA)}NA(t,e){const i=this.Lr.Bm(this.scale).Kn(t,e).setMouseInteractions(this.Fu).ps(this.$A).Yn(this.vb).q(this.bb).xs(this.sn).Xn(this.Bn).jn(this.Ln).Zn(this.On).Wn(ys(this.LA)).Ir(this.getHighlight());return this.rc(i),this.RA.push(i),i}zA(t,e){const i=this.Lr.Gp(this.scale,void 0,[Bo.UserSeries,...this.UA]).Kn(t,e).setMouseInteractions(this.Fu).ea(this.sa).Wn(ys(this.LA)).Ir(this.getHighlight());return this.rc(i),this.Sv.push(i),i}attach(t,e=!0){return oe(t,this.hs,{stroke:this.sa,fill:this.$A}),super.attach(t,e)}getPointAmount(){return this.RA.reduce(((t,e)=>t+e.Jn()+e.Qn()),this.ca.length)}clear(){super.clear();for(let t=0;t{this.oc(t)}))}jS(t,e,i=this.BA){const s=i?Oa(t,e?this.Sv.filter((t=>t.getIsUnderMouse())):this.Sv,this.HA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(t,e)=>Math.abs(t.y-e.y):(t,e)=>(t.x-e.x)**2+(t.y-e.y)**2):Oa(t,e?this.RA.filter((t=>t.getIsUnderMouse())):this.RA,this.GA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(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.Lr.Li.ct,this.scale),e=s[1]instanceof $s?s[1].ha():s[1].gs(),i=e instanceof tt?e.getFillStyle():void 0,r=e instanceof V?s[0].color?new z({color:s[0].color}):new z({color:e.getFallbackColor()}):e;return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,i||r)}}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}}const iu=(t,e)=>t.Un().length>=e?t.Un().slice(-e):Array.prototype.concat(t.$n(),t.Un()).slice(-e),su=(t,e,i)=>{const s=Array.prototype.concat(t.$n(),t.Un()).slice(0,-i-1).concat(e.slice(i+1,2*i+2));t.qn().Kn(s).Gs()};class ru extends eu{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.ac="Spline Series",this.OA=32,this.wv=8e3,this.YA=t=>{if(0===t.length)return;const e=this.RA.length;if(e>0){const i=e>1,s=this.RA[e-1];if(i){const i=Array.prototype.concat(s.$n(),s.Un()),r=i.length;if(32*r>=this.wv){const i=iu(s,3),r=Array.prototype.concat(i,t),n=tu(r,32);su(this.Sv[e-1],n,32),this.zA(n.slice(66))}else if(r<5){const s=this.RA[e-2],r=iu(s,3),n=Array.prototype.concat(r,i,t),o=tu(n,32),h=this.Sv[e-1],a=o.slice(66);h.qn().Kn(a).Gs()}else{const i=this.Sv[e-1],r=Array.prototype.concat(i.$n(),i.Un()),n=iu(s,4),o=Array.prototype.concat(n,t),h=tu(o,32),a=r.slice(0,-66).concat(h.slice(33));i.qn().Kn(a).Gs()}}else{const i=Array.prototype.concat(s.$n(),s.Un()),r=i.length,n=this.Sv[e-1];if(32*r>=this.wv){const e=iu(s,3),i=Array.prototype.concat(e,t),r=tu(i,32);su(this.Sv[0],r,32),this.zA(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=tu(e,32);n.qn().Kn(s).Gs()}else n.Kn(t)}}else{const e=t.length>0?tu(t,32):t,i=ze(e);this.zA(e,i)}this.VA(t)}}setCursorInterpolationEnabled(t){return super.setCursorInterpolationEnabled(t)}kv(t){const e=this.RA.length,i=this.RA.length>0?this.RA[e-1].$n().length+this.RA[e-1].Un().length:void 0;Pa(t,i,Math.ceil(this.wv/this.OA),this.YA)}solveNearestFromScreen(t,e=this.BA){if(e)return super.solveNearestFromScreen(t,e);const i=Oa(t,this.RA,this.GA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(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.Lr.Li.ct,this.scale);return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,i[1].gs())}}}class nu{constructor(){this.mi="FreeformPattern",this.mo={type:"disabled",packager:(t,e,i)=>t.slice()}}Av(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}},hu=s.Record({mo:{type:"disabled",packager:(t,e,i)=>t.slice()}});class au extends hu{Av(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.jA(t,r);if(e>0){const i=o-e>0?e:o;if(i>0){for(let e=0;e{const i=e.St();return t?Math.min(i,t):i},uu=(t,e)=>{const i=e.xt();return t?Math.max(i,t):i};class cu extends au{XA(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(uu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(lu,e?e.min.y:void 0)}}const du=(t,e)=>{const i=e.ft();return t?Math.min(i,t):i},fu=(t,e)=>{const i=e.yt();return t?Math.max(i,t):i};class gu extends au{XA(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(fu,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(du,e?e.min.x:void 0)}}const mu={horizontalProgressive:new class extends cu{constructor(){super({mo:cs()}),this.mi="HorizontalProgressivePattern"}jA(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].yt():void 0}getXMin(t=[],e){return t.length>0&&t[0].Jn()>0?t[0].ft():e?e.min.x:void 0}setPrecision(t){return this.set("_columnPackaging",cs(ou(t)))}},horizontalRegressive:new class extends cu{constructor(){super({mo:ds()}),this.mi="HorizontalRegressivePattern"}jA(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].Jn()>0?t[0].yt():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].ft():void 0}setPrecision(t){return this.set("_columnPackaging",ds(ou(t)))}},verticalProgressive:new class extends gu{constructor(){super({mo:fs()}),this.mi="VerticalProgressivePattern"}jA(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].xt():void 0}getYMin(t=[],e){return t.length>0&&t[0].Jn()>0?t[0].St():e?e.min.y:void 0}setPrecision(t){return this.set("_columnPackaging",fs(ou(t)))}},verticalRegressive:new class extends gu{constructor(){super({mo:gs()}),this.mi="VerticalRegressivePattern"}jA(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].Jn()>0?t[0].xt():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].St():void 0}setPrecision(t){return this.set("_columnPackaging",gs(ou(t)))}},freeform:new nu};class pu extends eu{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g){super(t,e,i,s,r,n,o,h,mu.horizontalProgressive,a,c,d,f,g),this.ac="Step Series",this.EA=t=>{const e=this.Sv.length>0?this.Sv[this.Sv.length-1].$n().length+this.Sv[this.Sv.length-1].Un().length:void 0;Pa(t,e,this.wv,this.ZA)},this.ZA=t=>{const e=t.length;if(this.Sv.length>0){const i=this.Sv[this.Sv.length-1];if(e>0){const e=i.$n(),s=i.Un(),r=s.length>0?s[s.length-1]:e[e.length-1],n=Jl([r].concat(t),this.KA);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.wv?(i.Kn(o,m(u(o.x,o.y),u(o.x,o.y))).Io(!0),this.zA(h).Co(!0),this.NA(t)):i.Kn(h)}}else e>0&&this.zA(Jl(t,this.KA));this.VA(t)},this.KA=l,void 0===this.UA.find((t=>"DataPattern"===t.type))&&this.UA.push({type:"DataPattern",args:{pattern:"ProgressiveX"}})}}class yu extends _a{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.Sv=[],this.ac="Line Series",this.BA=!0,this.wv=void 0,this.LA="nearest-x",this.da=void 0,this.ed=()=>he(this.sa.getFillStyle()),this.qA=(t,e)=>{const i=t.Sb(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.HA=(t,e)=>{const i=t.WA(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.UA=c,this.Mh=f,this.sa=ue(this.hs.lineSeriesStrokeStyle,d),this.JA={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.sa="function"==typeof t?t(this.sa):t;const e=this.sa;for(let t=0;tt.fa(this.da))),this.Lr.Bi(),this}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorSolveBasis(t){return this.LA=t,this.Sv.forEach((e=>e.Wn(ys(t)))),this.Lr.Bi(),this}getCursorSolveBasis(){return this.LA}uv(t){}kv(t){let e=this.Sv[0];e||(e=this.zA(),this.Sv.push(e),this.rc(e)),e.Kn(t)}zA(){return this.Lr.Gp(this.scale,this.JA,[Bo.UserSeries,...this.UA]).ea(this.sa).fa(this.da).Wn(ys(this.LA)).Ir(this.getHighlight())}attach(t,e=!0){return oe(t,this.hs,{stroke:this.sa}),super.attach(t,e)}mc(t,e){t.Ir(e),this.Lr.Bi()}Av(t,e,i,s){}jS(t,e,i=this.BA){const s=Oa(t,e?this.Sv.filter((t=>t.getIsUnderMouse())):this.Sv,i?this.HA:this.qA,"nearest-x"===this.LA?(t,e)=>Math.abs(t.x-e.x):"nearest-y"===this.LA?(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.Lr.Li.ct,this.scale),e=s[1].ha();return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,e instanceof tt?e.getFillStyle():void 0)}}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}}class xu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.QA={x:0,y:0,width:0,height:0},this.tw={x1:0,y1:0,x2:0,y2:0},this.Rn=m(u(0,0),u(0,0)),this.Vr=ue(r.rectangleSeriesFillStyle,n),this.Lr=t,this.iA=s,this.scale=e,this.$r=ue(r.rectangleSeriesStrokeStyle,n),this.fc=this.j_(this.Lr.gc(this.scale)).ps(this.Vr).$h(this.$r)}getBoundaries(){return this.Rn}setDimensions(t){return"x"in t?(this.QA=t,this.tw={x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height}):(this.tw=t,this.QA={x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}),this.fc.Sn(u(this.QA.x,this.QA.y)).q(u(this.QA.width,this.QA.height)),this.Rn=ze([this.QA,u(this.QA.x+this.QA.width,this.QA.y+this.QA.height)]),this.iA(),this.Lr.Bi(),this}getDimensionsPositionAndSize(){return this.QA}getDimensionsTwoPoints(){return this.tw}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.fc.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.fc.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}getDominantStyle(){return this.fc.gs()}}class Su extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Rectangle Series",this.ox=(t,e,i)=>{const s=i.getDimensionsPositionAndSize();return t.addRow(e.ac).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.rA=t=>{const e=t.getDimensionsPositionAndSize(),i=u(e.x+e.width/2,e.y+e.height/2);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new xu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){}add(t){const e=new xu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}class vu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.sw=[],this.Rn=we,this.Lr=t,this.scale=e,this.iA=s,this.Vr=ue(r.polygonSeriesFillStyle,n),this.$r=ue(r.polygonSeriesStrokeStyle,n),this.Nv=this.j_(this.Lr.vc(this.scale,Ws.Simple)).$h(this.$r).ps(this.Vr)}getBoundaries(){return this.Rn}setDimensions(t){return this.sw=t,this.Nv.lo(this.sw),this.Rn=ze(this.sw),this.iA(),this.Lr.Bi(),this}getDimensions(){return this.sw}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.Nv.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.Nv.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}getDominantStyle(){return this.Nv.gs()}}class bu extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Polygon Series",this.ox=(t,e,i)=>t.addRow(e.getName()),this.rA=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.Lr.Li.ct)},this.iw=c,this.eA=new vu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){if(!(t instanceof Ti))throw new Error("PolygonSeries can only be attached to a pair of Linear Axes.")}add(t){const e=new vu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}class Mu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={startX:0,startY:0,endX:0,endY:0},this.Rn=m(u(0,0),u(0,0)),this.xc=this.j_(this.Lr._u(this.scale)),this.hs=r,this.Lr=t,this.scale=e,this.iA=s,this.Vr=ue(r.segmentSeriesStrokeStyle,n),this.xc.ea(this.Vr)}getBoundaries(){return this.Rn}setDimensions(t){return this.dimensions=t,this.xc.la(u(t.startX,t.startY)).Ko(u(t.endX,t.endY)),this.Rn=m(u(Math.min(t.startX,t.endX),Math.min(t.startY,t.endY)),u(Math.max(t.startX,t.endX),Math.max(t.startY,t.endY))),this.iA(),this.Lr.Bi(),this}getDimensions(){return this.dimensions}setStrokeStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.xc.ea(this.Vr),this.Lr.Bi(),this}getStrokeStyle(){return this.Vr}getDominantStyle(){const t=this.xc.ha();return t!==J?t.getFillStyle():F}}class Au extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Segment Series",this.ox=(t,e,i)=>t.addRow(e.ac).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.rA=t=>{const e=t.getDimensions(),i=u((e.startX+e.endX)/2,(e.startY+e.endY)/2);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new Mu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){}add(t){const e=new Mu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}class wu extends Hl{constructor(t,e,i,s,r,n){super(t,e,i,r),this.dimensions={x:0,y:0,radiusX:0,radiusY:0},this.Rn=m(u(0,0),u(0,0)),this.ew=this.j_(this.Lr.kc(this.scale)).ia(50),this.Lr=t,this.scale=e,this.iA=s,this.Vr=ue(r.ellipseSeriesFillStyle,n),this.$r=ue(r.ellipseSeriesStrokeStyle,n),this.ew.ps(this.Vr).$h(this.$r)}getBoundaries(){return this.Rn}setDimensions(t){return this.dimensions=t,this.ew.Sn(u(t.x,t.y)).Jo(t.radiusX).Qo(t.radiusY),this.Rn=m(u(t.x-t.radiusX,t.y-t.radiusY),u(t.x+t.radiusX,t.y+t.radiusY)),this.iA(),this.Lr.Bi(),this}getDimensions(){return this.dimensions}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.ew.ps(this.Vr),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setStrokeStyle(t){return this.$r="function"==typeof t?t(this.$r):t,this.ew.$h(this.$r),this.Lr.Bi(),this}getStrokeStyle(){return this.$r}getDominantStyle(){return this.ew.gs()}}class Du extends Wl{constructor(t,e,i,s,r,n,o,h,a,l,c){super(t,e,i,s,r,n,o,h,a,l),this.ac="Ellipse Series",this.ox=(t,e,i)=>t.addRow(e.ac).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.rA=t=>{const e=t.getDimensions(),i=u(e.x,e.y);return nt(i,this.scale,this.Lr.Li.ct)},this.iw=c,this.eA=new wu(this.Lr,this.scale,bt,bt,this.hs,this.iw).dispose()}uv(t){if(!(t instanceof Ti||t instanceof Ei))throw new Error("EllipseSeries only supports Linear Axes")}add(t){const e=new wu(this.Lr,this.scale,this.Z_,this.iA,this.hs,this.iw).setDimensions(t);return this.J_(e),e}}function Tu(t,e){return t===e?0:tthis.Kn(t))):this.Kn(t))}lw(t){return!!this.root&&(this.uw(t),this.contentEquals(t,this.root.value))}cw(t,e){return this.hw(((i,s)=>i&&t.call(e,s)),!0)}dw(t,e){return this.hw(((i,s)=>{t.call(e,s)}),void 0)}M(t){if(this.root&&(this.uw(t),this.contentEquals(t,this.root.value)))return this.root}Kn(t){const e=new Bu(t);if(!this.root)return this.root=e,this.length+=1,e;if(this.uw(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.nw()):(e.left=this.root,e.right=this.root.right,this.root.right=null,this.root.nw()),e.nw(),this.root=e,this.length+=1,e}}fw(t){if(this.root&&(this.uw(t),this.contentEquals(t,this.root.value))){if(this.root.left){const{right:e}=this.root;this.root=this.root.left,this.uw(t),this.root.right=e}else this.root=this.root.right;return this.length-=1,this.root&&this.root.nw(),!0}return!1}gw(){if(this.root){let t=this.root;for(;t.right;)t=t.right;return t}}pw(){if(this.root){let t=this.root;for(;t.left;)t=t.left;return t}}mw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)>0?this.root.aw():this.root}yw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)>=0?this.root.aw():this.root}Sw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)>=0?this.root:this.root.ow()}xw(t){if(this.root)return this.uw(t),this.contentCompare(this.root.value,t)<=0?this.root.ow():this.root}bw(t){t instanceof Array?t.forEach((t=>this.Kn(t))):this.Kn(t)}uw(t){let e,i,s,r,n,o;if(this.root){for(e=new Bu,i=e,s=e,o=new Bu,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.nw(),r.right=n,r.nw(),n=r,!n.left))break;r=new Bu,r.right=n,r.left=o.left,o.left=r,s.left=n,s.nw(),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.nw(),r.left=n,r.nw(),n=r,!n.right))break;r=new Bu,r.left=n,r.right=o.right,o.right=r,i.right=n,i.nw(),i=n,n=n.right}}for(i.right=n.left,i.nw(),s.left=n.right,s.nw(),n.left=e.right,n.right=e.left;o.left;)o.left.right.nw(),o.left=o.left.left;for(;o.right;)o.right.left.nw(),o.right=o.right.right;n.nw(),this.root=n}}hw(t,e,i){return this.root&&(e=this.root.hw(t,e,0,i,this)),e}rw(t,e,i){return this.root&&(e=this.root.rw(t,e,this.length-1,i,this)),e}qn(){this.root=null,this.length=0}Mw(t,e){let i,s=this.pw();for(;s;){const r=this.xw(s.value);t.call(e,i?i.value:void 0,s.value,r?r.value:void 0),i=s,s=r}}_w(t,e,i){let s,r=this.pw(),n=0;for(;r;){const o=this.xw(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 Iu{constructor(t,e){this.key=t,this.value=e}equals(t){return Eu(this.key,t.key)&&Eu(this.value,t.value)}compare(t){return Tu(this.key,t.key)}}class Cu{constructor(t,e=Eu,i=Tu){this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new ku(void 0,((t,i)=>e(t.key,i.key)),((t,e)=>i(t.key,e.key))),t&&(Array.isArray(t)?t.forEach((t=>this.Kn(t.key,t.value))):this.Kn(t.key,t.value))}M(t){const e=this.store.M(new Iu(t,void 0));return e?e.value.value:void 0}S(t,e){const i=new Iu(t,e),s=this.store.M(i);if(s)return s.value.value=e,s;const r=this.store.Kn(i);return this.length+=1,r}Kn(t,e){return this.S(t,e)}lw(t){return this.store.lw(new Iu(t,void 0))}qn(){this.store.qn(),this.length=0}hw(t,e,i){return this.store.hw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}rw(t,e,i){return this.store.rw(((e,s)=>t.call(i,e,s.value,s.key,this)),e,this.store)}fw(t){const e=new Iu(t,void 0);return!!this.store.lw(e)&&(this.store.fw(e),this.length--,!0)}dw(t,e){return this.hw(((i,s,r)=>{t.call(e,s,r)}),void 0)}Aw(t){return this.store.M(new Iu(t,void 0))||void 0}Mw(t,e){let i,s=this.store.pw();for(;s;){const r=this.store.xw(s.value);t.call(e,i?i.value.value:void 0,s.value.value,r?r.value.value:void 0),i=s,s=r}}_w(t,e,i){let s,r=this.store.pw(),n=0;for(;r;){const o=this.store.xw(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}gw(){return this.store.gw()}pw(){return this.store.pw()}mw(t){return this.store.mw(new Iu(t,void 0))}yw(t){return this.store.yw(new Iu(t,void 0))}Sw(t){return this.store.Sw(new Iu(t,void 0))}xw(t){return this.store.xw(new Iu(t,void 0))}}const Pu={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},Lu=(t,e)=>Math.min(t,e[3]),Ru=(t,e)=>Math.max(t,e[2]),Fu=(t,e)=>{const i=t.length;if(!(i<2))return[e,t[0].y,t.reduce(xt,Ae),t.reduce(yt,Me),t[i-1].y]},_u=(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},Ou=(t,e)=>{if(t.length>0)return e>0?t[t.length-1]:t[0]},zu=(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 Vu extends Ul{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.ac="OHLC Series",this.ww=new Cu,this.tA=m(c(Me,Me),c(Ae,Ae)),this.kw=0,this.Cw=5,this.Tw=Pu,this.da=void 0,this.Iw=void 0,this.Fw=void 0,this.Pw=!0,this.Pu=e.HighlightModes.onHover,this.ox=zu,this.Dw=l,this.Bw=u,this.Lw=new this.Dw(this.Lr,this.scale,bt,!0,this.hs).dispose(),this.Ow=new this.Bw(this.Lr,this.scale,bt,!1,this.hs).dispose()}uv(t){if(!(t.x instanceof Ai))throw new Error("OHLCSeries must be attached to a Linear X Axis.");this.Rw=t.x}setStyle(t){return this.Ew=t,this.zw(),this.Lr.Bi(),this}setPositiveStyle(t){return this.Vw=t,this.zw(),this.Lr.Bi(),this}setNegativeStyle(t){return this.Nw=t,this.zw(),this.Lr.Bi(),this}setFigureWidth(t){return this.Cw=t,this.Lr.Bi(),this}getFigureWidth(){return this.Cw}setFigureAutoFitting(t){return this.Tw=t?Pu:void 0,this.Lr.Bi(),this}getFigureAutoFitting(){return void 0!==this.Tw}Gw(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}Hw(t,e,i,s){const r=(t=>t[4]>=t[1])(t),n=new(r?this.Dw:this.Bw)(this.Lr,this.scale,this.Z_,r,this.hs);return this.J_(n,s),this.Ww(n),this.mc(n,this.getHighlight()),n.AA(t[0],t[1],t[2],t[3],t[4],e).ro(i),n}Uw(t){const e=this.kw;return this.kw+=1,this.ww.S(e,t),this.Pw=!0,this.P.emit("dataAdd",this,[t],void 0),e}zw(){this.q_.forEach((t=>{this.Ew&&this.Ew(t),t.positive&&this.Vw?this.Vw(t):!t.positive&&this.Nw&&this.Nw(t)}))}Ww(t){this.Ew&&this.Ew(t),t.positive&&this.Vw?this.Vw(t):!t.positive&&this.Nw&&this.Nw(t)}$w(t){return t*this.Rw.getPixelSize()}Yw(t){return t/this.Rw.getPixelSize()}Xw(t){if(!Array.isArray(t))return this.ww.M(t);if(this.ww.M(t[0])&&this.ww.M(t[t.length-1])){let e=0;const i=this.ww.M(t[0])[1];let s=Ae,r=Me;const n=this.ww.M(t[t.length-1])[4];for(let i=0;i1){const e=t>0?this.q_.length-1:0;this.q_[e].dispose()}let s;do{s=!1;const r=Ou(this.q_,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.ww.M(a);if(!s)break;if(!this.Gw(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.Hw(h,u,e,i),s=!0}}}while(s)}Av(t){var e;if(t&&"maxDataPointCount"in t){const e=t.maxDataPointCount;if(e&&this.ww.length>e){const t=this.kw-1,i=this.ww.store.pw();if(i){for(let s=t-e;s>=i.value.key;s-=1)this.ww.fw(s);let s=!0;this.tA.min.y=Me,this.tA.max.y=Ae;for(let i=1+t-e;i<=t;i+=1){const t=this.ww.M(i);t&&(this.tA.min.y=Math.min(this.tA.min.y,t[3]),this.tA.max.y=Math.max(this.tA.max.y,t[2]),s&&(this.tA.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.kw-1;let n=this.ww.store.pw();if(n){const t=n.value.key;let o;for(let t=n.value.key;t<=r&&!((null===(e=this.ww.M(t))||void 0===e?void 0:e[0])>=s);t+=1)o=t;if(void 0!==o&&o-t>=1e3&&this.ww.length-(o-t)>=i){for(let e=o;e>=t;e-=1)this.ww.fw(e);n=this.ww.store.pw();let e=!0;if(this.tA.min.y=Me,this.tA.max.y=Ae,n)for(let t=n.value.key;t<=r;t+=1){const i=this.ww.M(t);i&&(this.tA.min.y=Math.min(this.tA.min.y,i[3]),this.tA.max.y=Math.max(this.tA.max.y,i[2]),e&&(this.tA.min.x=i[0],e=!1))}}}}return this}setDataCleaning(t){return this.da=t,this.Lr.Bi(),this}bm(){super.bm(),this.Av(this.da);const t=this.Rw.getPixelSize(),e=this.Iw,i=m(this.scale.x.getInnerStart(),this.scale.x.getInnerEnd()),s=this.Fw,r=this.$w(this.Cw),n=!s||i.max-i.min!=s.max-s.min,o=this.q_.length;if(!s||i.min>s.min)for(let t=0;t=0;t-=1){const e=this.q_[t];if(this.Gw(e.getPosition(),r))break;e.dispose()}if(0===this.q_.length&&this.ww.length>0)for(let t=0;t0){const o=this.Tw?r*this.Tw.minGapNew:0;if((n||!s||i.mins.max)&&(this.jw(1,r,o),this.Pw=!0),this.Tw){const i=r*this.Tw.maxGapFuse,s=r*this.Tw.minGapSplit;if(void 0===e||t!==e||this.Pw){let t,e;do{t=!1;for(let e=0;e1){const o=i.getPosition(),h=e>0?this.q_[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.Xw(n),l=this.Xw(h);void 0!==a&&this.Hw(a,n,r,e),void 0!==l&&this.Hw(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.ox(new wh,this,t).wu(),series:this,fillStyle:t.getDominantStyle(),ohlcSegment:t}}if(i>0){const e=nt(t,this.Lr.Li.ct,this.scale);let s;for(let t=0;te.x+r.kA())break;if(n>=e.x){const o=t>0?e.x-this.q_[t-1].getPosition():Number.MAX_VALUE,h=n-e.x,a=t{t.push(e)})),t}Tv(t){return this.P.on("dataAdd",t)}Iv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}Pv(t){return this.P.off(t)}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Lw.getDominantStyle(),fill2:this.Ow.getDominantStyle(),behavior:{colorStep:!0}}),this}}class Nu extends Vu{add(t){if(t.length>0){if(Array.isArray(t[0])){const e=t;for(let t=0;t0&&this.getVisible()}}class Gu extends Vu{constructor(){super(...arguments),this.ca=[]}Qs(){return this.um&&(this.ww.length>0||this.ca.length>0)&&this.getVisible()}add(t){Array.isArray(t)?this.addPoints(t):this.addPoint(t);const e=this.ca[this.ca.length-1];return this.Mv=e?{x:e.x,y:e.y}:void 0,this}addPoint(t){return this.ca.push(t),this.Lr.Bi(),this.tA.min.x=Math.min(this.tA.min.x,t.x),this.tA.max.x=Math.max(this.tA.max.x,t.x),this.tA.min.y=Math.min(this.tA.min.y,t.y),this.tA.max.y=Math.max(this.tA.max.y,t.y),this}addPoints(t){return t.length>0&&(this.ca=this.ca.concat(t),this.Lr.Bi(),this.tA.min.x=Math.min(this.tA.min.x,t[0].x),this.tA.max.x=Math.max(this.tA.max.x,t[t.length-1].x),this.tA.min.y=t.reduce(yt,this.tA.min.y),this.tA.max.y=t.reduce(xt,this.tA.max.y)),this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Mv?this.Mv.x+e:0),this.add(Ra(t,e,s)),this}bm(){if(this.Av(this.da),this.ca.length>0){let t;if(void 0!==this.Zw)t=this.Zw;else{const e=this.Tw?this.Tw.minGapNew:1;t=this.$w(this.Cw*e)}const e=void 0!==this.Kw?this.Kw:this.ca[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=Fu(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.ca,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 Wu extends Wl{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.ac="Box Series",this.ox=Hu,this.rA=t=>nt(this.lc.toPoint((t.start+t.end)/2,t.median),this.scale,this.Lr.Li.ct),this.qw=a,this.lc=l,this.eA=new this.qw(this.Lr,this.scale,this.Z_,this.lc,0,0,0,0,0,0,0,this.hs).dispose()}uv(t){if(!(t instanceof Ti||t instanceof Ei))throw new Error("BoxSeries only supports Linear Axes")}add(t){const e=new this.qw(this.Lr,this.scale,this.Z_,this.lc,t.start,t.end,t.lowerExtreme,t.lowerQuartile,t.median,t.upperQuartile,t.upperExtreme,this.hs),i=e.boundaries;return this.tA=this.tA?Ne(this.tA,i):i,this.Lr.Bi(),this.J_(e),e}}class Yu extends Ca{constructor(){super(...arguments),this.Sv=[],this.ca=[],this.Jw=[],this.Qw=[],this.rh=!1,this.wv=1e3,this.xv=0,this.Pu=e.HighlightModes.onHover,this.mo={type:"disabled",packager:(t,e,i)=>t.slice()},this.BA=!0,this.tk=[],this.ik=[],this.sk=!1,this.ed=()=>he(this.ek)||he(this.hk),this.rk=t=>{const e=t.length;if(this.Sv.length>0){const i=this.Sv.length-1,s=this.Sv[i];if(e>0){const[e,i]=s.$n(),[r,n]=s.Un();if((r?e.length+r.length:e.length)>=this.wv){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=si(a,o,u(t[0].position,t[0].high)).y,c=si(a,h,u(t[0].position,t[0].low)).y,f=d(a,l,c);s.Kn(f,m(u(a,c),u(a,l))).Io(!0),this.nk([f].concat(t)).Co(!0)}else s.Kn(t)}}else e>0&&this.nk(t)},this.ak=t=>{const e=this.tk,i=t.length;if(this.tk.length>0){if(i>0){const i=e[e.length-1],s=i.$n(),r=i.Un();if(s.length+r.length>=this.wv){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=si(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Kn(a,m(u(o,h),u(o,h))).Io(!0),e.push(this.lk([a].concat(t),this._v).Co(!0))}else i.Kn(t)}}else i>0&&e.push(this.lk(t))},this.uk=t=>{const e=this.ik,i=t.length;if(this.ik.length>0){if(i>0){const i=e[e.length-1],s=i.$n(),r=i.Un();if(s.length+r.length>=this.wv){const n=r.length>0?r[r.length-1]:s[s.length-1],o=(n.x+t[0].x)/2,h=si(o,n,u(t[0].x,t[0].y)).y,a=u(o,h);i.Kn(a,m(u(o,h),u(o,h))).Io(!0),e.push(this.ck([a].concat(t)).Co(!0))}else i.Kn(t)}}else i>0&&e.push(this.ck(t))},this.dk=(t,e)=>{const i=t.Sb(e);if(i)return[nt(i[0],this.scale,this.Lr.Li.ct),nt(i[1],this.scale,this.Lr.Li.ct)]},this.fk=(t,e)=>{const i=t.WA(e);if(i)return[nt(i[0],this.scale,this.Lr.Li.ct),nt(i[1],this.scale,this.Lr.Li.ct)]}}setDataCleaning(t){const e=t&&t.minDataPointCount;return this.xv=void 0!==e&&e>0?e:0,this.Lr.Bi(),this}clear(){for(let t=0;tt+e.Jn()+e.Qn()),this.ca.length)}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorResultTableFormatter(t){return this.ox=t,this.qa.Li.Bi(),this}setCursorEnabled(t){return super.setCursorEnabled(t)}getCursorResultTableFormatter(){return this.ox}getXMax(){return zt(this.Sv,Ct,Math.max,Ft,this._v)}getXMin(){return zt(this.Sv,It,Math.min,Rt,this._v)}getYMax(){return zt(this.Sv,Lt,Math.max,Ot,this._v)}getYMin(){return zt(this.Sv,Pt,Math.min,_t,this._v)}Wp(){const t=u(0,0);for(const e of this.Sv)t.x=Math.max(t.x,e.co()),t.y=Math.max(t.y,e.do());return t}Qs(){return this.um&&this.getPointAmount()>0&&this.getVisible()}uv(t){}vv(t,e,i){this.ca=ie(this.ca,t,{canReturnB:!1}),this.Jw=ie(this.Jw,e,{canReturnB:!1}),this.Qw=ie(this.Qw,i,{canReturnB:!1}),this.Lr.Bi()}gk(t,e,i,s){this.pk(e,i,s),this.vv(Array.isArray(t)?t:[t],e,i)}pk(t,e,i){const s=Ne(ze(t),ze(e));this._v?this._v=Ne(this._v,s):this._v=s,i&&(this._v=Ne(this._v,i))}jA(){const t=this.Sv.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.Sv[this.Sv.length-1]:void 0,i=e?e.$n()[0].length+(e.Un()[0]?e.Un()[0].length:0):void 0;Pa(t,i,this.wv,this.rk)}yk(t){const e=this.tk.length>0?this.tk[this.tk.length-1].$n().length+this.tk[this.tk.length-1].Un().length:void 0;Pa(t,e,this.wv,this.ak)}Sk(t,e){const i=this.tk.length>0?this.tk[this.tk.length-1].$n().length+this.tk[this.tk.length-1].Un().length:void 0;Pa(t,i,this.wv,this.ak),Pa(e,i,this.wv,this.uk)}nk(t,e){const i=this.Lr.xk(this.scale).Kn(t,e).ps(this.ek).wo(this.hk)._o(this.mo).Ir(this.getHighlight());return this.Sv.push(i),this.rc(i),i}bk(t,e,i){const s=this.Lr.Gp(this.scale,void 0,[Bo.UserSeries]).Kn(t,i).setMouseInteractions(!1).ea(e).Ir(this.getHighlight());return this.rc(s),s}lk(t,e){return this.bk(t,this.vk,e)}ck(t,e){return this.bk(t,this.Mk,e)}_k(t){this.ek="function"==typeof t?t(this.ek):t;const e=this.ek;for(let t=0;t0){const t=this.Sv.length,e=this.jA();this.Av(this.Sv,this.wv,this.xv,e);const i=this.Sv.length;this.tk.length>0&&this.Av(this.tk,this.wv,this.xv,e),this.ik.length>0&&this.Av(this.ik,this.wv,this.xv,e),t!==i&&this.yv(),this.sk=!0}}ru(){if(super.ru(),this.ca.length>0&&(this.mk(this.ca),this.Pk(this.Jw,this.Qw),this.sk=!0),this.sk){const t=this.getBoundaries();for(const e of this.Sv)e.Cr(t);for(const e of this.tk)e.Cr(t);for(const e of this.ik)e.Cr(t)}}bm(){this._v=void 0,this.ca.length=0,this.Jw.length=0,this.Qw.length=0}jS(t,e,i=this.BA){const s=((t,e,i)=>{let s,r,n=Number.MAX_VALUE;for(let o=0;ot.getIsUnderMouse())):this.Sv,i?this.fk:this.dk);if(void 0!==s&&void 0!==s[0]){const t=nt(s[0][0],this.Lr.Li.ct,this.scale),e=nt(s[0][1],this.Lr.Li.ct,this.scale);return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,e.y).wu(),this,s[1].gs())}}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}}const qu=(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 Xu extends Yu{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.ac="Area Series",this.ox=qu,this.Dk=a}add(t){const e=Array.isArray(t)?t:[t];if(e.length>0){const t=this.Bk(e),[i,s]=this.Lk(t);this.gk(t,i,s,m(u(Me,this.Dk),u(Ae,this.Dk)));const r=this.ca[this.ca.length-1];this.Mv=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this._v)}return this}addArrayY(t,e=1,i=0){let s=i;return s||(s=this.Mv?this.Mv.position+e:0),this.add(Ra(t,e,s)),this}Tv(t){return this.P.on("dataAdd",t)}Iv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}Pv(t){return this.P.off(t)}}class $u extends Xu{constructor(){super(...arguments),this.Mk=J}Pk(t){return this.yk(t)}Lk(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&&Vt(e[i-1],t)||(e[i]=t,i+=1),o.y=n){const t=ui(u(Ae,n),u(Me,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}Cv(){return La(this.Sv,(t=>t[0]||[]))}setFillStyle(t){return this._k(t),this}getFillStyle(){return this.wk()}attach(t,e=!0){return oe(t,this.hs,{fill:this.ek,stroke:this.vk}),super.attach(t,e)}}class Zu extends $u{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.ek=F,this.hk=ue(this.hs.areaSeriesNegativeFillStyle,c),this.vk=ue(this.hs.areaSeriesNegativeStrokeStyle,c)}Bk(t){return this.zk(t)}zk(t){const e=[];return 1===t.length?this.Rk(t[0],e):this.Ek(t,e),e}Rk(t,e,i=0){const s=this.Dk;return e[i]=t.y>s?d(t.x,s,s):d(t.x,t.y,s),i+1}Ek(t,e,i=0){let s=0;const r=t.length-1,n=this.Dk;for(;sn){const t=ui(u(Ae,n),u(Me,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&&Vt(e[i-1],t)||(e[i]=t,i+=1),o.y<=n){const t=ui(u(Ae,n),u(Me,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}Cv(){return La(this.Sv,(t=>t[1]))}setFillStyle(t){return this.Ak(t),this}getFillStyle(){return this.ko()}attach(t,e=!0){return oe(t,this.hs,{fill:this.hk,stroke:this.vk}),super.attach(t,e)}}class Ku extends Xu{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.ek=ue(this.hs.areaSeriesBipolarHighFillStyle,c),this.vk=ue(this.hs.areaSeriesBipolarHighStrokeStyle,c),this.hk=ue(this.hs.areaSeriesBipolarLowFillStyle,c),this.Mk=ue(this.hs.areaSeriesBipolarLowStrokeStyle,c)}Bk(t){return this.Vk(t)}Pk(t,e){return this.Sk(t,e)}Vk(t){let e=0;const i=[],s=t.length,r=this.Dk;return s>0&&(this.Nk&&(this.Nk.y<=r&&r<=t[0].y||this.Nk.y>=r&&r>=t[0].y)&&(i[e]=d(.5*(this.Nk.x+t[0].x),r,r),e+=1),this.Nk=t[s-1],1===s?this.Rk(t[0],i,e):this.Ek(t,i)),i}Rk(t,e,i=0){return e[i]=d(t.x,t.y,this.Dk),i+1}Ek(t,e){let i=0,s=0;const r=t.length-1,n=this.Dk;for(;s=n&&n>=o.y){const t=r.y,s=o.y,h=n,a=t===s?o.x:ha(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}Lk(t){const e=t.length,i=Array(e),s=Array(e),r=this.Dk;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._k(t),this}setNegativeFillStyle(t){return this.Ak(t),this}setPositiveStrokeStyle(t){return this.kk(t),this}setNegativeStrokeStyle(t){return this.Ck(t),this}getPositiveFillStyle(){return this.wk()}getNegativeFillStyle(){return this.ko()}getPositiveStrokeStyle(){return this.Tk()}getNegativeStrokeStyle(){return this.Ik()}attach(t,e=!0){return oe(t,this.hs,{fill:this.ek,fill2:this.hk,behavior:{colorStep:!0}}),super.attach(t,e)}}const Ju={Positive:ju,Negative:Zu,Bipolar:Ku},Qu=(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 tc extends Yu{constructor(t,e,i,s,r,n,o,h,a,l,u){super(t,e,i,s,r,n,o,h,a,l),this.ac="Area Range Series",this.ox=Qu;const c=u;this.ek=ue(this.hs.areaRangeSeriesFillStyle,c),this.vk=ue(this.hs.areaRangeSeriesStrokeStyle,c),this.hk=ue(this.hs.areaRangeSeriesFillStyleInverted,c),this.Mk=ue(this.hs.areaRangeSeriesStrokeStyleInverted,c)}add(t){const e=Array.isArray(t)?t:[t],[i,s]=g(e);this.gk(t,i,s);const r=this.ca[this.ca.length-1];return this.Mv=r?{position:r.position,high:r.high,low:r.low}:void 0,this.P.emit("dataAdd",this,e,this._v),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.Mv?this.Mv.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.jS(e);if(i)return nt(i,this.scale,this.Lr.Li.ct)},this.vb=a,this.Vr=ue(l.pointSeriesFillStyle,c)}add(t){return super.add(t),this}ed(){return he(this.Vr)}uv(t){}attach(t,e=!0){return oe(t,this.hs,{fill:this.Vr}),super.attach(t,e)}mc(t,e){t.Ir(e),this.Lr.Bi()}setPointFillStyle(t){this.Vr="function"==typeof t?t(this.Vr):t;const e=this.Vr;for(let t=0;tt.getIsUnderMouse())):this.Sv,this.GA,Le);if(void 0!==i){const t=nt(i[0],this.Lr.Li.ct,this.scale),e=i[1].gs(),s=e instanceof V?i[0].color?new z({color:i[0].color}):new z({color:e.getFallbackColor()}):e;return Oh(t,this.scale,this.ox(new wh,this,t.x,t.y,t).wu(),this,s)}}solveNearestFromScreen(t){return this.jS(t,!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class ic{constructor(t,e,i,s){this.Gk=!1,this.P=new r.Eventer,this.chart=i,this.Hk=s,this.Fh=t.Fh,this.Ka=s||Cr,this.Wk=gt.document.createElement("div"),this.Wk.style.position="absolute",this.Wk.style.pointerEvents="none",gt.document.body.append(this.Wk);const n=()=>{const t=i.engine.container.getBoundingClientRect();this.Wk.style.left=`${t.left}px`,this.Wk.style.top=`${t.top}px`,this.Wk.style.width=`${t.width}px`,this.Wk.style.height=`${t.height}px`};n(),i.onResize(n),this.Uk(this.Wk),this.$k(),this.Yk(),this.Xk(),this.jk(e),this.chart.Zk().push(this)}Uk(t){this.Kk=gt.document.createElement("div"),this.Kk.style.pointerEvents="all",t.append(this.Kk),this.qk=gt.document.createElement("div"),this.Jk=new Mr(this.Fh,this.Ka,this.chart,this.qk),this.Qk=gt.document.createElement("table"),this.Qk.style.borderSpacing="0",this.Kk.appendChild(this.Jk.rl()),this.Kk.appendChild(this.qk),this.qk.appendChild(this.Qk)}Yk(){let t=0,e=0,i=0,s=0,r=!1;this.Gk=!1,this.Kk.onmousedown=n=>{n=n||gt.event,i=n.clientX,s=n.clientY,r=!0,gt.document.onmouseup=t=>{this.Gk?this.Kk.addEventListener("click",Xt,!0):this.Kk.removeEventListener("click",Xt,!0),r=!1,this.Gk=!1,gt.document.onmouseup=null,gt.document.onmousemove=null},gt.document.onmousemove=n=>{n=n||gt.event,r&&(t=i-n.clientX,e=s-n.clientY,i=n.clientX,s=n.clientY,this.Gk=!0,this.Kk.style.top=this.Kk.offsetTop-e+"px",this.Kk.style.left=this.Kk.offsetLeft-t+"px",this.Kk.style.removeProperty("right"),this.Kk.style.removeProperty("bottom"))}}}Xk(){let t=0,e=0,i=0,s=0,r=!1;this.Kk.ontouchstart=n=>{n=n||gt.event,i=n.touches[0].clientX,s=n.touches[0].clientY,r=!0,this.Kk.ontouchend=()=>{r=!1,gt.document.ontouchend=null,gt.document.ontouchmove=null},this.Kk.ontouchmove=n=>{r&&(Xt(n),n=n||gt.event,t=i-n.touches[0].clientX,e=s-n.touches[0].clientY,i=n.touches[0].clientX,s=n.touches[0].clientY,this.Kk.style.top=this.Kk.offsetTop-e+"px",this.Kk.style.left=this.Kk.offsetLeft-t+"px",this.Kk.style.removeProperty("right"),this.Kk.style.removeProperty("bottom"))}}}$k(){this.Kk.style.setProperty("top","10px"),this.Kk.style.setProperty("left","10px"),this.Kk.style.position="absolute",this.Kk.style.display="flex",this.Kk.style.alignItems="flex-start",this.qk.style.setProperty("display","none")}removePositionProperty(){this.Kk.style.removeProperty("top"),this.Kk.style.removeProperty("left"),this.Kk.style.removeProperty("bottom"),this.Kk.style.removeProperty("right")}setPositionProperty(t){switch(this.removePositionProperty(),t){case e.OSMPosition.BottomLeft:this.Kk.style.setProperty("bottom","10px"),this.Kk.style.setProperty("left","10px");break;case e.OSMPosition.TopLeft:this.Kk.style.setProperty("top","10px"),this.Kk.style.setProperty("left","10px");break;case e.OSMPosition.BottomRight:this.Kk.style.setProperty("bottom","10px"),this.Kk.style.setProperty("right","10px");break;case e.OSMPosition.TopRight:default:this.Kk.style.setProperty("top","10px"),this.Kk.style.setProperty("right","10px")}}jk(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 rc extends Ca{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.ac="Heatmap Grid Series",this.ox=sc,this.BA=!1,this.sC=a,this.hs=l;const d=c;this.Vr=ue(l.heatmapGridSeriesFillStyle,d),this.Ma=ue(this.hs.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},m={heatmapDataType:"intensity",dataOrder:a.dataOrder||"columns",columns:a.columns,rows:a.rows,start:f,step:g};this.Mh=m,this.eC=this.Lr.hC(this.scale,[],m).ps(this.Vr)._a(this.Ma).Ir(this.getHighlight()),this.rc(this.eC),this.setHighlightOnHover(!1)}clear(){return this.eC.qn(),this.Lr.Bi(),this.P.emit("dataClear",this),this}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.eC._a(this.Ma),this.Lr.Bi(),this.P.emit("styleChange",this),this}getWireframeStyle(){return this.Ma}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorEnabled(t){return super.setCursorEnabled(t)}setIntensityInterpolation(t){return t=t||"disabled",this.eC.Cy(t),this.Lr.Bi(),this.P.emit("styleChange",this),this}getIntensityInterpolation(){return this.eC.Ty()}Qs(){return this.um&&this.getVisible()}ed(){return he(this.Vr)}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr}),this}rC(t){this.eC.rC().forEach((e=>{t.eC.Iy(e)}))}Pv(t){return this.P.off(t)}Fv(t){return this.P.on("dataClear",t)}nC(t){return this.P.on("styleChange",t)}oC(t){return this.P.off(t)}jS(t,e,i=this.BA){const s=nt(t,this.Lr.Li.ct,this.scale),r=e?this.eC.getIsUnderMouse()?this.eC:void 0:this.eC;if(!r)return;const n=i?r.aC(s):r.jS(s);return n?Oh(n,this.scale,this.ox(new wh,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).wu(),this):void 0}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}getXMax(){const t=this.eC;return t?t.yt():void 0}getXMin(){const t=this.eC;return t?t.ft():void 0}getYMax(){const t=this.eC;return t?t.xt():void 0}getYMin(){const t=this.eC;return t?t.St():void 0}Wp(){const t=u(0,0);return t.x=Math.max(t.x,this.eC.co()),t.y=Math.max(t.y,this.eC.do()),t}uv(t){if(!(t instanceof Ti))throw new Error("HeatmapGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ti&&t.Qt())throw new Error("HeatmapGridSeries can not be attached to a high precision Axis.")}mc(t,e){t.Ir(e),this.Lr.Bi()}ru(){return super.ru(),this.eC.Cr(this.getBoundaries()),this}}class nc extends rc{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.ox=sc}invalidateIntensityValues(t){if(Array.isArray(t)){if(0===t.length)return this;const e={x:t.length,y:t[0].length,columns:"columns"===this.Mh.dataOrder?t.length:t[0].length,rows:"rows"===this.Mh.dataOrder?t.length:t[0].length},i="columns"===this.Mh.dataOrder?this.Mh.columns:this.Mh.rows,s="columns"===this.Mh.dataOrder?this.Mh.rows:this.Mh.columns;if(e.x>i||e.y>s){if(!0===this.chart.ef.Ph){const t=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Mh.columns}x${this.Mh.rows}, input ${e.columns}x${e.rows}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const r=[];for(let e=0;eo||n>h){if(!0===this.chart.ef.Ph){const i=`HeatmapGridSeries.invalidateIntensityValues intensity matrix overflow.\nGrid ${this.Mh.columns}x${this.Mh.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.`;gt.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.eC.Iy({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.Lr.Bi(),this}setFillStyle(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.eC.ps(this.Vr),this.P.emit("styleChange",this),this.Lr.Bi(),this}getFillStyle(){return this.Vr}setCursorResultTableFormatter(t){return this.ox=t,this.qa.Li.Bi(),this}getCursorResultTableFormatter(){return this.ox}lC(t){return this.P.on("invalidateIntensity",t)}uC(t){return this.P.off(t)}}class oc extends Ca{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.ac="Scrolling Heatmap Grid Series",this.ox=sc,this.BA=!1;const d=c;this.Vr=ue(l.heatmapScrollingGridSeriesFillStyle,d),this.Ma=ue(this.hs.heatmapScrollingGridSeriesWireframeStyle,d);const f={scrollDimension:"columns",heatmapDataType:"intensity",start:{x:0,y:0},step:{x:1,y:1},...a};this.Mh=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.cC=this.Lr.dC(this.scale,g,f).ps(this.Vr)._a(this.Ma).Ir(this.getHighlight()),this.rc(this.cC),this.setHighlightOnHover(!1)}clear(){return this.cC.qn(),this.Lr.Bi(),this}setWireframeStyle(t){return this.Ma="function"==typeof t?t(this.Ma):t,this.cC._a(this.Ma),this.Lr.Bi(),this}getWireframeStyle(){return this.Ma}setPixelInterpolationMode(t){return t=t||"disabled",this.cC.Cy(t),this.Lr.Bi(),this}getPixelInterpolationMode(){return this.cC.Ty()}setCursorInterpolationEnabled(t){return this.BA=t,this.Lr.Li.Bi(),this}getCursorInterpolationEnabled(){return this.BA}setCursorEnabled(t){return super.setCursorEnabled(t)}setDataCleaning(t){return this.cC.fa(t),this.Lr.Bi(),this}Qs(){return this.um&&this.getVisible()}ed(){return he(this.Vr)}attach(t,e){return super.attach(t,e),oe(t,this.hs,{fill:this.Vr}),this}ps(t){return this.Vr="function"==typeof t?t(this.Vr):t,this.cC.ps(this.Vr),this.Lr.Bi(),this}jS(t,e,i=this.BA){const s=nt(t,this.Lr.Li.ct,this.scale),r=e?this.cC.getIsUnderMouse()?this.cC:void 0:this.cC;if(!r)return;const n=i?r.aC(s):r.jS(s);return n?Oh(n,this.scale,this.ox(new wh,this,{x:n.x,y:n.y,column:n.column,row:n.column,intensity:n.cellValue}).wu(),this):void 0}solveNearestFromScreen(t,e=this.BA){return this.jS(t,!1,e)}uv(t){if(!(t instanceof Ti))throw new Error("HeatmapScrollingGridSeries can only be attached to a pair of Linear Axes.");if(t instanceof Ti&&t.Qt())throw new Error("HeatmapScrollingGridSeries can not be attached to a high precision Axis.")}getXMax(){return this.cC.yt()||0}getXMin(){return this.cC.ft()||0}getYMax(){return this.cC.xt()||0}getYMin(){return this.cC.St()||0}Wp(){const t=u(0,0);return t.x=Math.max(t.x,this.cC.co()),t.y=Math.max(t.y,this.cC.do()),t}mc(t,e){t.Ir(e),this.Lr.Bi()}}class hc extends oc{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.ox=sc}addIntensityValues(t){if(0===t.length||0===t[0].length)return this;const e=t.length,i=t[0].length,s=("columns"===this.Mh.scrollDimension?t.length:t[0].length,"rows"===this.Mh.scrollDimension?t.length:t[0].length,0+i-1),r=this.Mh.resolution-1;if(s>r){if(!0===this.chart.ef.Ph){const t=`HeatmapScrollingGridSeries.addIntensityValues intensity matrix overflow.\nGrid resolution: ${this.Mh.resolution}, input ${e}x${i}.\nExcess data will be automatically clipped. This can result in sub-optimal performance.`;gt.console.warn(t)}const s=[];for(let i=0;i(e,i)=>t.forEach((t=>t.forEach((t=>{t.ct.q(e),t.Jf.q(i)})))),lc=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},uc=u(10,10);var cc;e.AxisPosition=void 0,(cc=e.AxisPosition||(e.AxisPosition={}))[cc.Top=0]="Top",cc[cc.Bottom=1]="Bottom",cc[cc.Left=2]="Left",cc[cc.Right=3]="Right";const dc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),fc=t=>t.he(),gc=t=>t.setStopped(!0),mc=t=>t.getChartInteractionFitByDrag()?t.fit(!0).setStopped(!1):void 0,pc=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}},yc=(t,e)=>{const i="linear-highPrecision"===t.ns.type||"linear-highPrecision"===e.ns.type,s="logarithmic"===t.ns.type||"logarithmic"===e.ns.type;if(i&&s){const i=`Invalid Axis combination | 'logarithmic' can't be combined with 'linear-highPrecision' (x: ${t.ns.type}, y: ${e.ns.type})`;throw new Error(i)}};var xc,Sc,vc,bc;!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"}(xc||(xc={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(Sc||(Sc={})),function(t){t[t.axisUi=0]="axisUi"}(vc||(vc={}));class Mc extends qh{constructor(t,i,s,r,n,o,h){super(t,i,s,i.Xg("chartXY bg",0),i.Eg("chartXY ui"),r,i.Li.hs.chartXYBackgroundFillStyle,i.Li.hs.chartXYBackgroundStrokeStyle,i.Li.hs.chartXYTitleFont,i.Li.hs.chartXYTitleFillStyle,h),this.fC=this.Bg.d2({scaleXYConstructor:Ti}),this.gC=[],this.pC=[],this.mC=[],this.yC=[],this.SC=new Map,this.xC=!0,this.bC=!0,this.vC=!0,this.Id=2,this.MC=!0,this._C=!0,this.AC=[],this.wC=this.Zg.gc(this.fC).ps(F).$h(J).setMouseInteractions(!1),this.kC=this.Zg._u(this.fC).ea(J).setMouseInteractions(!1),this.CC=this.Zg._u(this.fC).ea(J).setMouseInteractions(!1),this.TC=this.hs.chartXYZoomingRectangleFillStyle,this.IC=this.hs.chartXYZoomingRectangleStrokeStyle,this.FC=this.hs.chartXYFittingRectangleFillStyle,this.PC=this.hs.chartXYFittingRectangleStrokeStyle,this.DC=e.MouseStyles.Default,this.BC=e.MouseStyles.Move,this.LC=e.MouseStyles.ZoomIn,this.OC=e.MouseStyles.Default,this.RC=void 0,this.EC=Ac,this.lv=0,this.zC=ac(this.pC,this.gC),this.VC=ac(this.mC,this.yC),this.NC=(t,e,i,s,r)=>{this.zC(s,r),this.VC(r,s),this.fC.q(s,r);const n=this.pC.map((t=>t.vg())),o=this.gC.map((t=>t.vg())),h=this.mC.map((t=>t.vg())),a=this.yC.map((t=>t.vg())),l=n.reduce(Ie,0),c=o.reduce(Ie,0),d=h.reduce(Ie,0),f=a.reduce(Ie,0),g=this.GC(d,f,c,l),m=this.fC.x.getCellSize()-(g.left+g.right),p=this.fC.y.getCellSize()-(g.bottom+g.top),y=[g.left,g.right],x=[g.bottom,g.top];this.fC.x.Z(0,m),this.fC.y.Z(0,p),this.fC.ci(y),this.fC.di(x),this.Gm.q(u(m,p));for(let t=0;t{this.SC.set(t,e)},this.Yf=t=>{this.pC.includes(t)?lc(this.pC,t):this.gC.includes(t)?lc(this.gC,t):this.mC.includes(t)?lc(this.mC,t):this.yC.includes(t)&&lc(this.yC,t),this.SC.delete(t),this.Li.Bi()},this.WC=(t=!1)=>{const e=t=>(e,i,s,r)=>(i.ru(e,s,r.length),e+i.vg()*t),i=this.pC.reduce(e(-1),0),s=this.gC.reduce(e(1),0),r=this.mC.reduce(e(-1),0),n=this.yC.reduce(e(1),0),o=this.GC(r,n,s,i),h=this.fC.x.getCellSize()-(o.left+o.right),a=this.fC.y.getCellSize()-(o.bottom+o.top),l=[o.left,o.right],c=[o.bottom,o.top];this.fC.x.Z(0,h),this.fC.y.Z(0,a),this.fC.x.Dt(l),this.fC.y.Dt(c);for(const t of this.pC)t.ct.Dt(l);for(const t of this.gC)t.ct.Dt(l);for(const t of this.mC)t.ct.Dt(c);for(const t of this.yC)t.ct.Dt(c);if((!this.oM||Math.abs(this.oM.bottom-i)>=4||Math.abs(this.oM.left-r)>=4||Math.abs(this.oM.right-n)>=4||Math.abs(this.oM.top-s)>=4)&&!t)return void this.WC(!0);this.oM={bottom:i,left:r,top:s,right:n},this.Gm.Sn(u(0,0)).q(u(h,a)),this.Hm.Sn(u(0,0)).q(u(h,a));const d=this.getDefaultAxisX(),f=this.getDefaultAxisY();if(!d||!f)return;const g=p(d.ct.Bt(),f.ct.Bt(),d.ct.Ot(),f.ct.Ot());this.vx.Wy(g),this.Uf.Wy(g),this.$f.Wy(g),this.Cg&&this.Cg();const m=t=>(e,i,s,r)=>(i.bg(e),e+i.vg()*t);return this.pC.reduce(m(-1),0),this.gC.reduce(m(1),0),this.mC.reduce(m(-1),0),this.yC.reduce(m(1),0),g},this.addAreaSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();yc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:Ju.Positive)(this,this.Rm,this.vx,e,i,this.UC(e),this.UC(i),this.Rg,s,this.hs,this.Li.iu,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lm.length);return this.Wm(r),r},this.addAreaRangeSeries=t=>{const e=t&&t.xAxis?t.xAxis:this.getDefaultAxisX(),i=t&&t.yAxis?t.yAxis:this.getDefaultAxisY();yc(e,i);const s=new tc(this,this.Rm,this.vx,e,i,this.UC(e),this.UC(i),this.Rg,this.hs,this.Li.iu,void 0!==(null==t?void 0:t.automaticColorIndex)?t.automaticColorIndex:this.Lm.length);return this.Wm(s),s},this.$C=!1,this.YC=!1,this.cv=()=>{(this.xC||this.bC)&&(this.RC=this.engine.setMouseStyle(this.DC))},this.dv=()=>{this.$C=!1,this.engine.restoreMouseStyle(this.RC)},this.fv=(t,e,i)=>{var s,r;const n=kt(null===(s=this.ef.Ih)||void 0===s?void 0:s.chartXYRectangleZoomFitMouseButton,0),o=kt(null===(r=this.ef.Ih)||void 0===r?void 0:r.chartXYPanMouseButton,2);this.engine.restoreMouseStyle(this.RC);const h=this.Zg.Li.ke(e.clientX,e.clientY);i===n&&(this.xC||this.bC)?(this.XC(t,h),Xt(e)):i===o&&this.MC&&(this.RC=this.engine.setMouseStyle(this.BC),this.YC=!0,Xt(e))},this.gm=(t,e,i,s,r)=>{var n,o;const h=u(e.clientX,e.clientY),a=kt(null===(n=this.ef.Ih)||void 0===n?void 0:n.chartXYRectangleZoomFitMouseButton,0),l=kt(null===(o=this.ef.Ih)||void 0===o?void 0:o.chartXYPanMouseButton,2);i===a&&(this.xC||this.bC)?(this.jC(t,s,h),Xt(e)):i===l&&this.MC&&(this.ZC(Ze(r,-1)),Xt(e)),this.Zg.Bi()},this.gv=(t,e,i,s)=>{var r,n;const o=kt(null===(r=this.ef.Ih)||void 0===r?void 0:r.chartXYRectangleZoomFitMouseButton,0),h=kt(null===(n=this.ef.Ih)||void 0===n?void 0:n.chartXYPanMouseButton,2);if(i===o&&(this.xC||this.bC)){const i=u(e.clientX,e.clientY);this.KC(t,s,i),Xt(e)}else i===h&&this.MC&&Xt(e);this.engine.restoreMouseStyle(this.RC),this.Gm.getIsUnderMouse()&&(this.RC=this.engine.setMouseStyle(this.DC)),this.$C=!1,this.YC=!1},this.fm=(t,e)=>{if(this.vC){const t=this.Zg.Li.ke(e.clientX,e.clientY);this.qC(t,u(ce(e),ce(e))),Xt(e)}},this.JC=(t,e,i,s)=>{},this.QC=(t,e,i,s,r,n)=>{if(this.MC){const t=u(-(s.x+r.x)/2,-(s.y+r.y)/2);this.ZC(t),Xt(n),this.YC=!0}if(this.vC){const t=this.engine.clientLocation2Engine(e.x,e.y),o=this.engine.clientLocation2Engine(i.x,i.y),h=Je(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.Yt(t.getInterval().start,-h.x),t.ct.Yt(t.getInterval().end,h.x),!1,!0,"interactionZoom")})),this.forEachAxisY((t=>{t.getChartInteractionZoomByWheel()&&t.dt(t.ct.Yt(t.getInterval().start,-h.y),t.ct.Yt(t.getInterval().end,h.y),!1,!0,"interactionZoom")})),Xt(n),this.$C=!0}},this.tT=(t,e,i,s)=>{this.YC=!1,this.$C=!1},this.iT=(t,e,i)=>{(this.bC||this.xC)&&(this.XC(t,e),Xt(i))},this.sT=(t,e,i,s,r)=>{(this.bC||this.xC)&&(this.jC(t,e,i),Xt(r))},this.eT=(t,e,i,s)=>{(this.bC||this.xC)&&(this.KC(t,e,i),Xt(s))},this.ef.Ah||this.ef._h||this.Li.bh(0),this.setPadding({right:24}),this.tM=i.qy("chartXY series bg",xc.seriesBackground),this.hT=[xc.gridLine0,xc.gridLine1,xc.gridLine2].map((t=>i.qy(`chartXY gridline #${t}`,t))),this.Uf=i.qy("chartXY highlighters below",xc.highlightersBelow),this.vx=i.Pp("chartXY plotting",Sc.plotting),this.$f=i.Pp("chartXY highlighters above",Sc.highlightersAbove),this.gf=i.Pp("chartXY fg",Sc.fg),this.rT=i.nT("chartXY axisUi",vc.axisUi),this.fC.x.Z(0,this.uiScale.x.getCellSize()-(this._t.left+this._t.right+this.rn.left+this.rn.right)),this.fC.y.Z(0,this.uiScale.y.getCellSize()-(this._t.bottom+this._t.top+this.rn.bottom+this.rn.top)),this.fC.q(this.uiScale.Et().x,this.uiScale.Et().y),this.Gm=this.tM.gc(this.fC).ps(this.hs.chartXYSeriesBackgroundFillStyle).$h(J),this.Hm=this.$f.gc(this.fC).ps(F).$h(this.hs.chartXYSeriesBackgroundStrokeStyle).setMouseInteractions(!1),super.Nm(this.Gm,this.Hm),this.setSeriesBackgroundEffect(!1);const a=kt(o?o.autoCursorBuilder:void 0,Aa);this.XS=a.zS(this.HS,this.fC,this.fC,this.hs),this.addAxisX(o&&o.defaultAxisX),this.addAxisY(o&&o.defaultAxisY),this.onResize(this.NC),this.Kg.fs("ChartXY"),this.pm=Fr(new Or(this.iT,this.sT,this.eT,1),new zr(this.JC,this.QC,this.tT)),this.onSeriesBackgroundMouseEnter(this.cv),this.onSeriesBackgroundMouseLeave(this.dv),this.onSeriesBackgroundMouseWheel(this.fm),this.onSeriesBackgroundMouseDragStart(this.fv),this.onSeriesBackgroundMouseDrag(this.gm),this.onSeriesBackgroundMouseDragStop(this.gv),this.onSeriesBackgroundTouchStart(this.pm.onTouchStart),this.onSeriesBackgroundTouchMove(this.pm.onTouchMove),this.onSeriesBackgroundTouchEnd(this.pm.onTouchEnd),o&&!0===o.disableAnimations&&this.setAnimationsEnabled(!1),this.Yg(n,this.fC)}getMinimumSize(){const t={x:0,y:0};t.x+=this._t.left+this._t.right+this.rn.left+this.rn.right,t.y+=this._t.top+this._t.bottom+this.rn.top+this.rn.bottom;const e=this.Kg.Gs().Ac(),i=v(wc(this.EC||Ac),this.jg);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.vg())})),this.forEachAxisY((t=>{s.y=Math.max(s.y,t.vg())})),t.x+=s.x,t.y+=s.y,t.x+=uc.x,t.y+=uc.y,t}getSeries(){return this.Lm}addChartMarkerXY(t=wa,e,i){const s=this.Rg(),r=new ka(s,this.uiScale,e||this.getDefaultAxisX(),i||this.getDefaultAxisY(),t,this.Pg(s),this.hs);return this.Wg(r),r}addAxisX(t){const{opposite:e,type:i}=pc(t);let s;s="linear"===i.type?this.Bg.d1({dimension:"x",scale1DConstructor:Ai}):"linear-highPrecision"===i.type?this.Bg.d1({dimension:"x",scale1DConstructor:Ai}).Jt():this.Bg.d1({dimension:"x",scale1DConstructor:gi}).Ut(i.base),s.q(this.fC.x.Et());const r=e?this.gC:this.pC,n=new no(this.Uf,this.hT,this.gf,this.rT,this.Uf,this.$f,this.Li.iu,s,this.fC.y,Vl,this,e?100:0,this.Yf,this.HC,this.hs,!this.Oi,i);return r.push(n),this.Zg.Bi(),n}addAxisY(t){const{opposite:e,type:i}=pc(t);let s;s="linear"===i.type?this.Bg.d1({dimension:"y",scale1DConstructor:Ai}):"linear-highPrecision"===i.type?this.Bg.d1({dimension:"y",scale1DConstructor:Ai}).Jt():this.Bg.d1({dimension:"y",scale1DConstructor:gi}).Ut(i.base),s.q(this.fC.y.Et());const r=e?this.yC:this.mC,n=new no(this.Uf,this.hT,this.gf,this.rT,this.Uf,this.$f,this.Li.iu,s,this.fC.x,Nl,this,e?100:0,this.Yf,this.HC,this.hs,!this.Oi,i);return r.push(n),this.Zg.Bi(),n}dispose(){return this.tM.G(),this.vx.G(),this.gf.G(),this.rT.G(),this.hT.forEach((t=>t.G())),this.$f.G(),this.Uf.G(),this.Zk().forEach((t=>t.dispose())),co(this.fC),this.forEachAxis((t=>{t.dispose()})),this.Lm.slice().forEach((t=>{t.dispose()})),super.dispose()}getDefaultAxisX(){return this.pC[0]?this.pC[0]:this.gC[0]}getDefaultAxisY(){return this.mC[0]?this.mC[0]:this.yC[0]}getDefaultAxes(){return[this.getDefaultAxisX(),this.getDefaultAxisY()]}getAxes(...t){const i=t&&t.length>0?new Set(t):dc;return wt(Array.from(i).map((t=>{switch(t){default:case e.AxisPosition.Top:return this.gC;case e.AxisPosition.Bottom:return this.pC;case e.AxisPosition.Left:return this.mC;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.pC.slice().forEach(t),this.gC.slice().forEach(t)}forEachAxisY(t){this.mC.slice().forEach(t),this.yC.slice().forEach(t)}setTitlePosition(t){return this.EC=t,this.Li.Bi(),this}getTitlePosition(){return this.EC}GC(t,e,i,s){const r=this.EC||Ac;let n,o=v(wc(r),this.jg);this.getTitleFillStyle()===F||0===this.getTitle().length?(n={x:0,y:0},o={left:0,top:0,right:0,bottom:0}):n=this.Kg.Gs().Ac();const h=Math.abs(s)+this.rn.bottom+this._t.bottom,a=Math.abs(i)+this.rn.top+this._t.top,l={left:Math.abs(t)+this.rn.left+this._t.left,right:Math.abs(e)+this.rn.right+this._t.right,top:a,bottom:h},u=this.uiScale.yi(),{horizontalAlignment:c,verticalAlignment:d,position:f,marginsWithTitle:g}=Dc(r,u,l,n,o,this.rn);return this.Kg.Sn(f).Mn(c).An(d),g}ru(){super.ru();for(const t of this.Lm)t.xm();for(const t of this.Lm)t.ru();this.forEachAxis(fc);let t=!1;this.forEachAxis((e=>{(e.ae()||e.le())&&(t=!0)}));const e=this.$C||this.YC||!this._C&&t;this.ZS(e),this.WC(),super.$g();for(const t of this.Lm)t.bm()}X(){for(let t=0;t=10;n&&a&&o.x===s.x&&this.xC?(this.$C=!0,this.wC.ps(this.TC).$h(this.IC),this.kC.ea(J),this.CC.ea(J),this.RC=this.engine.setMouseStyle(this.LC,this.RC)):n&&a&&h.x===s.x&&this.bC?(this.$C=!0,this.wC.ps(this.FC).$h(this.PC),this.kC.ea(this.PC).la(s).Ko(r),this.CC.ea(this.PC).la(u(s.x,r.y)).Ko(u(r.x,s.y)),this.RC=this.engine.setMouseStyle(this.OC,this.RC)):(this.$C=!1,this.wC.$h(J).ps(F),this.kC.ea(J),this.CC.ea(J),this.engine.restoreMouseStyle(this.RC)),this.Zg.Bi()}KC(t,e,i){if(this.$C){const t=nt(this.engine.clientLocation2Engine(i.x,i.y),this.Zg.Li.ct,this.fC),s=Pe(t.x,this.fC.x.getInnerStart(),this.fC.x.getInnerEnd())&&Pe(t.y,this.fC.y.getInnerStart(),this.fC.y.getInnerEnd()),r=i.x>=e.x?"zoom":"fit",n=this.wC.xn(),o=Ke(n,this.wC.Et()),h=Math.min(this.wC.Et().x,this.wC.Et().y)>=10;s&&h&&"zoom"===r&&this.xC?(this.forEachAxisX((t=>{if(t.getChartInteractionZoomByDrag()){const e=nt(n,this.fC,t.Qf).x,i=nt(o,this.fC,t.Qf).x;t.dt(e,i,!0,!0,"interactionSetInterval")}})),this.forEachAxisY((t=>{if(t.getChartInteractionZoomByDrag()){const e=nt(n,this.fC,t.Qf).y,i=nt(o,this.fC,t.Qf).y;t.dt(e,i,!0,!0,"interactionSetInterval")}}))):s&&h&&"fit"===r&&this.bC&&this.forEachAxis(mc)}this.wC.$h(J).ps(F),this.kC.ea(J),this.CC.ea(J),this.Zg.Bi()}pan(t){this.forEachAxisX((e=>{e.setStopped(!0).pan(t.x)})),this.forEachAxisY((e=>{e.setStopped(!0).pan(t.y)}))}ZC(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(gc),this.forEachAxisX((i=>{i.zoom(i.ct.ot(t.x),e.x)})),this.forEachAxisY((i=>{i.zoom(i.ct.ot(t.y),e.y)}))}qC(t,e){this.forEachAxis(gc),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}dd(){const t=[];return this.forEachAxis((e=>e.ug((e=>t.push(e))))),super.dd().concat(t)}Zk(){return this.AC}pl(){return this.Jg(this.vx)}setAutoCursorEnabledDuringAxisAnimation(t){return this._C=t,this}getAutoCursorEnabledDuringAxisAnimation(){return this._C}forEachAxis(t){return this.forEachAxisX(t),this.forEachAxisY(t),this}}e.ChartXYTitlePositionOptions=void 0,(bc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",bc.RightTop="right-top",bc.LeftTop="left-top",bc.CenterBottom="center-bottom",bc.RightBottom="right-bottom",bc.LeftBottom="left-bottom",bc.SeriesCenterTop="series-center-top",bc.SeriesRightTop="series-right-top",bc.SeriesLeftTop="series-left-top",bc.SeriesCenterBottom="series-center-bottom",bc.SeriesRightBottom="series-right-bottom",bc.SeriesLeftBottom="series-left-bottom";const Ac=e.ChartXYTitlePositionOptions.CenterTop,wc=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 pe(0,`Unexpected ChartXY title position selection ${t}`)},Dc=(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 pe(0,`Unexpected ChartXY title position selection ${t}`)},Tc=t=>t instanceof _a||t instanceof Xu||t instanceof tc||t instanceof nc||t instanceof Vu||t instanceof pu;class Ec{constructor(t,i,s,n,o,h,a,l,u){this.P=new r.Eventer,this.aT=new Map,this.Lm=new Map,this.lT=({series:t},e)=>{this.uT&&(e instanceof tc||e instanceof pu||e instanceof nc||e instanceof _a||e instanceof Xu||e instanceof Vu)&&this.uT(t,e)},this.cT=t=>{const e=t.map((t=>t.ns.type));if(1!==[...new Set(e)].length)throw new Error("All ZoomBandChart axes must be of the same type")},this.dT=(t,e,i)=>{0!==this.Lm.size&&void 0!==[...this.Lm.values()].find((({series:t})=>!0===t.getVisible()))||this.fT.dt(e,i,!1,!1,"zoomBandChart")},this.ef=t,this.gT=n,this.attachedAxes=Array.isArray(o)?o:[o],this.cT(this.attachedAxes);const c=this.attachedAxes[0].chart.oT(this.attachedAxes[0])||"x";this.pT=c,this.yu="x"===c?Fl:_l;const d=this.attachedAxes[0].onIntervalChange(this.dT);this.mT=()=>this.attachedAxes[0].offIntervalChange(d);const f=this.yu.toVec2("linear"===(g=this.attachedAxes[0].ns).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 m=f.x,p=f.y;this.yT=new Mc(t,i,s,bt,a,{...l,defaultAxisX:m,defaultAxisY:p},u).setTitle("Zoom Band Chart").setMouseInteractions(!1).setAutoCursorMode(e.AutoCursorModes.disabled),this.engine=this.yT.engine;const y=this.yT.getDefaultAxisX().setMouseInteractions(!1),x=this.yT.getDefaultAxisY().setMouseInteractions(!1);this.fT=this.yu.getWidth({x:y,y:x}).setScrollStrategy(Bi.fitting).setAnimationScroll(!1),this.ST(this.yu.getHeight({x:y,y:x})),this.fT.Cs(this.attachedAxes[0].ks()),this.band=this.fT.addBand(h),this.xT(this.band,this.attachedAxes);for(let t=0;t{t.chart.US(((t,e)=>{("x"===c?e.axisX:e.axisY)===this.attachedAxes[0]&&Tc(e)&&this.Xd(e)})),t.chart.$S(((t,e)=>{var i;if(this.Lm.has(e)){const t=null===(i=this.Lm.get(e))||void 0===i?void 0:i.series;t&&t.dispose()}}))}))}disposeSeries(t){const e=this.Lm.get(t);if(e){const{clearReferences:i}=e;i(),this.Lm.delete(t),e.series.dispose();const s=this.yu.getHeight({x:t.axisX,y:t.axisY}),r=this.aT.get(s);r&&0===r.Js().length&&r!==this.yu.getHeight({x:this.yT.getDefaultAxisX(),y:this.yT.getDefaultAxisY()})&&(this.aT.delete(s),r.dispose())}return this}setSeriesStyle(t){return this.uT=t,this.Lm.forEach(this.lT),this}getDefaultAxisX(){return this.yT.getDefaultAxisX()}getDefaultAxisY(){return this.yT.getDefaultAxisY()}ST(t){t.setTickStrategy(ki.Empty).setMouseInteractions(!1).setNibStyle(J).setStrokeStyle(J)}xT(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=gt.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=gt.performance.now();i=h,e[0].dt(s,o,!1,!0,"zoomBandChart"),requestAnimationFrame((()=>requestAnimationFrame((()=>{i!==h||(r=!1)}))))}))}Xd(t){var e;const i=this.yu.getHeight({x:t.axisX,y:t.axisY});let s=this.aT.get(i);s||(0===this.aT.size?s=this.yu.getHeight({x:this.yT.getDefaultAxisX(),y:this.yT.getDefaultAxisY()}):(s=this.yu.getHeight({x:this.yT.addAxisX.bind(this.yT),y:this.yT.addAxisY.bind(this.yT)})(),this.ST(s))),this.aT.set(i,s);const r=this.yu.getWidth({x:this.fT,y:s}),n=this.yu.getHeight({x:this.fT,y:s});let o,h;if(t instanceof tc){o=this.yT.addAreaRangeSeries({xAxis:r,yAxis:n});const e=o;e.add(t.Cv());const i=t.Tv(((t,i,s)=>e.add(i))),s=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.Iv(i),t.offVisibleStateChanged(s)}}else if(t instanceof pu){const e=t.KA;o=this.yT.addStepSeries({mode:e,xAxis:r,yAxis:n});const i=o;i.add(t.Cv());const s=t.Tv(((t,e,s)=>i.add(e))),a=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.Iv(s),t.offVisibleStateChanged(a)}}else if(t instanceof nc){const e={...t.sC,xAxis:void 0,yAxis:void 0},i=this.yT.addHeatmapGridSeries(e);o=i;const s=()=>{i.setWireframeStyle(t.getWireframeStyle()).setIntensityInterpolation(t.getIntensityInterpolation()).setFillStyle(t.getFillStyle())};s();const r=t.nC(s);t.rC(i);const n=t.lC(((t,e)=>{i.invalidateIntensityValues(e)})),a=t.onVisibleStateChanged(((t,e)=>{i.setVisible(e)}));h=()=>{t.oC(r),t.uC(n),t.offVisibleStateChanged(a)}}else{const i={};t instanceof yu&&(i.dataPattern=null===(e=t.Mh)||void 0===e?void 0:e.dataPattern);const r=this.yT.addLineSeries({...i,xAxis:this.yu.getWidth({x:this.fT,y:s}),yAxis:this.yu.getHeight({x:this.fT,y:s})});if(o=r,t instanceof Vu){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.Iv(i),t.offVisibleStateChanged(s)}}else{r.add(t.Cv());const e=t.Tv(((t,e)=>r.add(e))),i=t.onVisibleStateChanged(((t,e)=>{o.setVisible(e)}));h=()=>{t.Iv(e),t.offVisibleStateChanged(i)}}}t.onHighlight(((t=!0)=>{o.setHighlight(t)})),o.setMouseInteractions(!1),this.lT({series:o},t);const a=t.Fv((()=>{o.clear()})),l=h;h=()=>{t.Pv(a),l()},this.Lm.set(t,{series:o,clearReferences:h})}Cn(t){this.yT.Cn(t)}getMinimumSize(){return this.yT.getMinimumSize()}X(){return this.yT.X()}j(){return this.yT.j()}ru(){const t=Array.from(new Set(this.attachedAxes.map((t=>t.chart))).values());if("x"===this.pT){const e=t.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=0===t.Zf?t.vg():0})),Math.max(t,i)}),0),i=t.reduce(((t,e)=>{let i=0;return e.forEachAxisY((t=>{i+=100===t.Zf?t.vg():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.yT.setPadding({left:s,right:r+i})}else{const e=t.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=0===t.Zf?t.vg():0})),Math.max(t,i)}),0),i=t.reduce(((t,e)=>{let i=0;return e.forEachAxisX((t=>{i+=100===t.Zf?t.vg():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.yT.setPadding({bottom:s,top:r+i})}return this.yT.ru()}getTheme(){return this.yT.getTheme()}setTitle(t){return this.yT.setTitle(t),this}getTitle(){return this.yT.getTitle()}setTitleFillStyle(t){return this.yT.setTitleFillStyle(t),this}getTitleFillStyle(){return this.yT.getTitleFillStyle()}setTitleFont(t){return this.yT.setTitleFont(t),this}getTitleFont(){return this.yT.getTitleFont()}setTitleMargin(t){return this.yT.setTitleMargin(t),this}getTitleMargin(){return this.yT.getTitleMargin()}setPadding(t){return this.yT.setPadding(t),this}getPadding(){return this.yT.getPadding()}setBackgroundFillStyle(t){return this.yT.setBackgroundFillStyle(t),this}getBackgroundFillStyle(){return this.yT.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.yT.setBackgroundStrokeStyle(t),this}getBackgroundStrokeStyle(){return this.yT.getBackgroundStrokeStyle()}addUIElement(t,e){return this.yT.addUIElement(t,e)}addLegendBox(t,e){return this.yT.addLegendBox(t,e)}saveToFile(t,e,i){return this.yT.saveToFile(t,e,i),this}dispose(){return this.yT.dispose(),this.band.dispose(),this.aT.clear(),this.Lm.clear(),this.gT(this),this}onDispose(t){return this.yT.onDispose((()=>t(this)))}offDispose(t){return this.yT.offDispose(t)}}const Bc=(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{bT:()=>{const e=t.vT("dashboard ui",h+a);return a+=1,e},MT:()=>t.vT("dashboard legend",41e4),_T: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{Li:t,Xg:(e,i)=>{const s=h+i;return t.vT(e,s)},qy:(e,i)=>{const s=a+i;return t.vT(e,s)},Pp:(e,i)=>{const s=l+i;return t.vT(e,s)},Ky:(e,i,s)=>{const r=l+i;return t.AT(e,r,s)},nT:(e,i)=>{const s=u+i;return t.vT(e,s)},Eg:e=>{const i=c+d,s=t.vT(e,i);return d+=1,s},Vg:()=>t.vT("panel legend",400002+e),WS:()=>t.vT("panel cursor",500001+e)}}}};class kc{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 Ic={Ei:!1,zi:0,Vi:!1,Gi:0,Ni:!1,Hi:0,Wi:0,Fi:Bi.fitting};class Cc{constructor(t){this.wT=[],this.kT=t}CT(){let t=this.wT.find((t=>t.isFree));return t||(t={isFree:!1,shape:this.kT()},this.wT.push(t)),t.isFree=!1,t.shape}TT(){this.wT.forEach((t=>{t.isFree=!0}))}IT(){this.wT.filter((t=>t.isFree)).forEach((t=>{t.shape.dispose(),this.wT.splice(this.wT.indexOf(t),1)}))}}const Pc=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))},Lc=(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&&Uc(t,e,u,n,o,h),"spark-bar"===a&&Hc({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&Hc({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Wc(t,e,u,n,o,h),"spark-pie"===a&&Yc(t,e,u,n,o,h)},Rc=(t,e,i,s)=>({x:_c(t.x,e.x,i.x,s),y:Oc(t.y,e.y,i.y,s)}),Fc=(t,e,i,s)=>({position:_c(t.position,e.x,i.x,s),high:Oc(t.high,e.y,i.y,s),low:Oc(t.low,e.y,i.y,s)}),_c=(t,e,i,s)=>{const r=At(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Oc=(t,e,i,s)=>{const r=At(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},zc=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Vc(a,e,i,r,n,o,h),"axis-band"===a.type&&Nc(a,i,r,n,o,h),"constant-line"===a.type&&Gc(a,i,s,r,n,o,h)},Vc=(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=Rc(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.CT().qn().Yn(void 0!==u?u:e.PointShape.Circle).xs(d||0).q(c||5).ps(l||h.sparkPointChartFillStyle).Kn(f)},Nc=(t,e,i,s,r,n)=>{const{axis:o,start:h,end:a,fillStyle:l,strokeStyle:c}=t;let d=u(Ae,Me),f=u(Ae,Me);"x"===o&&(d=Rc({x:h,y:Ae},e,i,s),f=Rc({x:a,y:Me},e,i,s)),"y"===o&&(d=Rc({x:Ae,y:h},e,i,s),f=Rc({x:Me,y:a},e,i,s));const g=s[0],m=s[1],p=At(d.x,g.x,g.x+m.x),y=At(d.y,g.y,g.y+m.y),x=At(f.x,g.x,g.x+m.x),S=At(f.y,g.y,g.y+m.y);r.rect.CT().eo(p).ho(y).q(u(x-p,S-y)).ps(l||n.sparkChartBandFillStyle).$h(c||n.sparkChartBandStrokeStyle).$h(J)},Gc=(t,e,i,s,r,n,o)=>{const{axis:h,value:a,strokeStyle:l}=t,c=a||0,d=e.y,f=i.y,g=e.x,m=i.x,p=[];if("y"===h&&d<=c&&c<=f){const t=Rc(u(g,c),{x:g,y:d},s,r),e=Rc(u(m,c),{x:g,y:d},s,r);p.push([t,e])}if("x"===h&&g<=c&&c<=m){const t=Rc(u(c,d),{x:g,y:d},s,r),e=Rc(u(c,f),{x:g,y:d},s,r);p.push([t,e])}p.length>0&&n.line.CT().ea(l||o.sparkChartConstantLineStrokeStyle).la(p[0][0]).Ko(p[0][1])},Uc=(t,e,i,s,r,n)=>{const{strokeStyle:o,data:h,markers:a}=t,l=h.length;l>1e4&&r.Ph&>.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=Me,c=Ae,d=Me,f=Ae;for(let t=0;tRc(t,{x:u,y:d},g,i)));e.lineSet.CT().Ir(n).ea(o||s.sparkLineChartStrokeStyle).qn().Kn(m),a&&zc(a,m,{x:u,y:d},{x:c,y:f},g,i,e,s)},Hc=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,threshold:l,winFillStyle:u,lossFillStyle:c}=t,d=t.barSize||1,f=t.gap||1,g=t.winLoss,m=l||0,p=f/d*1;let y=Me,x=Ae;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)*p,y:g?2:Math.max(x,1e-5)};o.map(((t,e)=>{const s={x:1*(e+1)+e*p,y:g?t>=m?1:0:t},r=Rc({x:1*e+e*p,y:g?t>=m?0:-1:0},S,v,i),n=Rc(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.CT().Ir(n).Sn(t.position).no(t.height).ro(t.width).ps((i=t.value,g?(i>=m?u:c)||s.sparkBarChartFillStyle:h||s.sparkBarChartFillStyle)).$h(a||s.sparkBarChartStrokeStyle)}))},Wc=(t,e,i,s,r,n)=>{const{data:o,fillStyle:h,strokeStyle:a,markers:l}=t,u=o.length;u>1e4&&r.Ph&>.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=Me,f=Ae,g=Me,m=Ae;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=Rc(u(50,50),{x:0,y:0},{x:100,y:100},i),f=i[1],g=f.x<=f.y?f.x/2:f.y/2;let m=90;a.forEach(((t,i)=>{const r=t/c*360;e.arc.CT().Ir(n).Sn(d).qo(g).ta(0).Zo(m).Ko(m+r).ps(l[i]||ue(s.sparkPieChartFillStyle,i)).$h(h||s.sparkPieChartStrokeStyle),m+=r}))};var qc,Xc,$c;!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"}(Xc||(Xc={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}($c||($c={}));class jc extends Nr{constructor(t,e,i,s,r){super(),this.xl=!1,this.QA={x:0,y:0,height:20,width:20},this.FT={x:10,y:10},this.Lr=t,this.PT=r,this.DT=new pn(t,e,i,bt,s).setMouseInteractions(!0),this.BT=t.vc(e,Ws.Simple).ps(s.dataGridScrollBarButtonArrowFillStyle).$h(s.dataGridScrollBarButtonArrowStrokeStyle).setMouseInteractions(!1),this.jl(this),this.DT.onMouseEnter((t=>t.setHighlight(1))),this.DT.onMouseLeave((t=>t.setHighlight(0)))}LT(){switch(this.PT){case $c.Up:this.BT.lo([{x:this.QA.x,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y-this.FT.y/2},{x:this.QA.x-this.FT.x/2,y:this.QA.y-this.FT.y/2}]);break;case $c.Down:this.BT.lo([{x:this.QA.x-this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x,y:this.QA.y-this.FT.y/2}]);break;case $c.Left:this.BT.lo([{x:this.QA.x-this.FT.x/2,y:this.QA.y},{x:this.QA.x+this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y-this.FT.y/2}]);break;case $c.Right:this.BT.lo([{x:this.QA.x-this.FT.x/2,y:this.QA.y+this.FT.y/2},{x:this.QA.x+this.FT.x/2,y:this.QA.y},{x:this.QA.x-this.FT.x/2,y:this.QA.y-this.FT.y/2}])}}Sn(t){return this.QA.x=t.x,this.QA.y=t.y,this}xn(){return u(this.QA.x,this.QA.y)}q(t){return this.QA.height=t.x,this.QA.width=t.y,this}Et(){return{x:this.QA.height,y:this.QA.width}}onMouseDown(t){return this.DT.onMouseDown(t)}onMouseUp(t){return this.DT.onMouseUp(t)}setFillStyle(t){return this.DT.setFillStyle(t),this}getFillStyle(){return this.DT.getFillStyle()}setStrokeStyle(t){return this.DT.setStrokeStyle(t),this}getStrokeStyle(){return this.DT.getStrokeStyle()}ru(){return this.DT.ru(),this.LT(),this}Gs(){return this.DT.setSize(u(this.QA.height,this.QA.width)).setPosition(u(this.QA.x,this.QA.y)),this}setVisible(t){return this.DT.setVisible(t),this.BT.setVisible(t),this}dispose(){return this.DT.dispose(),this.BT.dispose(),this}setMouseInteractions(t){return this.DT.setMouseInteractions(t),this}getMouseInteractions(){return this.DT.getMouseInteractions()}onHighlight(t){return this.P.on("highlight",t)}offHighlight(t){return this.P.off(t)}getHighlight(){return this.DT.getHighlight()}setHighlight(t){return this.DT.setHighlight(me(t)),this.P.emit("highlight",Boolean(t)),this.Lr.Bi(),this}}const Zc=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Kc{constructor(t,i,s,n,o,h,a){this.Cc={x:0,y:0},this.QA={x:0,y:0,height:0,width:0},this.P=new r.Eventer,this.OT={min:u(0,0),max:u(0,0)},this.Yb=!1,this.Xb=!1,this.RT={x:0,y:0},this.Kl=void 0,this.ET=u(0,0),this.zT={x:0,y:0},this.VT=0,this.NT=15,this.jb=(t,i,s)=>{this.Yb=!0,this.gf.Bi();const r=this.GT.getDraggingMode(),n=this.GT.getDraggingMode()===e.UIDraggingModes.notDraggable?r:s||r;this.Kl=this.gf.Li.Ae(n===e.UIDraggingModes.notDraggable?e.MouseStyles.Restricted:n===e.UIDraggingModes.draggable?e.MouseStyles.Move:n===e.UIDraggingModes.onlyHorizontal?e.MouseStyles.Horizontal:e.MouseStyles.Vertical),this.HT&&clearInterval(this.HT)},this.Zb=()=>{this.Yb=!1,this.gf.Bi(),this.gf.Li.we(this.Kl)},this.Kb=t=>(this.Xb=!0,this.RT=nt(this.gf.Li.ke(t.x,t.y),this.gf.Li.ct,this.scale),!0),this.WT=(t,e)=>(this.UT(e),this.HT=setInterval((()=>this.UT(e)),300),!0),this.$T=()=>(clearInterval(this.HT),!0),this.qb=(t,i)=>{const s=this.GT.getDraggingMode();if(s!==e.UIDraggingModes.notDraggable){const r=i||s,n=nt(this.gf.Li.ke(t.x,t.y),this.gf.Li.ct,this.scale),o=u(r!==e.UIDraggingModes.onlyVertical?Zc(n.x,this.scale.x):this.QA.x,r!==e.UIDraggingModes.onlyHorizontal?Zc(n.y,this.scale.y):this.QA.y),h=u(o.x-this.RT.x,o.y-this.RT.y),a=u(this.GT.getPosition().x+h.x,this.GT.getPosition().y+h.y),l=this.YT(a),c={x:Math.abs(this.ET.x-l.x),y:Math.abs(this.ET.y-l.y)};return this.XT(c),this.zT.y>h.y&&(this.RT=n),this.ru(),!0}return!1},this.Jb=(t,e)=>{this.Xb=!1,Xt(e),this.gf.Bi()},this.gf=t,this.Fg=i,this.scale=n,this.contentScale=o,this.jT=a,this.ZT=new jc(t,s,n,h,a===qc.UpToDown?$c.Up:$c.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.KT=new jc(t,s,n,h,a===qc.UpToDown?$c.Down:$c.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.GT=new pn(t,s,n,bt,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.qT=new pn(i,s,n,bt,h).setFillStyle(h.dataGridScrollBarBackgroundFillStyle).setStrokeStyle(h.dataGridScrollBarBackgroundStrokeStyle).setMouseInteractions(!0),this.GT.onMouseEnter(this.jb),this.GT.onMouseLeave(this.Zb),this.GT.onMouseDragStart(((t,e)=>this.Kb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onMouseDrag(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onMouseDragStop(this.Jb),this.GT.onTouchStart(((t,e)=>this.Kb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onTouchMove(((t,e)=>this.qb(u(e.clientX,e.clientY))&&Xt(e))),this.GT.onTouchEnd(this.Jb),this.ZT.onMouseDown(((t,e)=>this.WT(t,e)&&Xt(e))),this.KT.onMouseDown(((t,e)=>this.WT(t,e)&&Xt(e))),this.ZT.onMouseUp(((t,e)=>this.$T()&&Xt(e))),this.KT.onMouseUp(((t,e)=>this.$T()&&Xt(e))),this.qT.onMouseWheel(((t,e)=>this.JT(e))),this.GT.onMouseWheel(((t,e)=>this.JT(e))),this.qT.onMouseDown(((t,e)=>this.WT(t,e)&&Xt(e))),this.qT.onMouseUp(((t,e)=>this.$T()&&Xt(e)))}QT(t){return this.QA=t,this}ro(t){return this.QA.width=t,this}kA(){return this.QA.width}tI(t){return this.ET=t,this}iI(t){return this.Cc=t,this}sI(){return this.Cc}eI(t){return this.NT=t,this}hI(){return this.jT}rI(t){let e;switch(this.jT){case qc.UpToDown:return e=t>0?Math.min(this.ET.y-this.OT.max.y,this.zT.y+t):Math.max(0,this.zT.y+t),e!==this.zT.y&&(this.XT({x:0,y:e}),this.ru(),!0);case qc.LeftToRight:return e=Math.min(this.OT.max.x-this.ET.x,this.zT.x+t),e!==this.zT.x&&(this.XT({y:0,x:e}),this.ru(),!0);default:return!1}}nI(t){let e;switch(this.jT){case qc.UpToDown:return e=Math.max(0,this.zT.y-t),e!==this.zT.y&&(this.XT({x:0,y:e}),this.ru(),!0);case qc.LeftToRight:return e=t>0?Math.max(0,this.zT.x-t):Math.min(this.OT.max.x-this.ET.x,this.zT.x-t),e!==this.zT.x&&(this.XT({x:e,y:0}),this.ru(),!0);default:return!0}}oI(t){switch(this.jT){case qc.UpToDown:return this.P.on("scrollY",t);case qc.LeftToRight:return this.P.on("scrollX",t)}return this.P.on("scrollY",t)}YT(t){switch(this.jT){case qc.UpToDown:if(t.y>this.OT.min.y)return u(t.x,this.OT.min.y);if(t.ythis.OT.max.x)return u(this.OT.max.x,t.y)}return t}JT(t){t.deltaY>0&&this.aI()&&Xt(t),t.deltaY<0&&this.lI()&&Xt(t)}UT(t){const e=nt(this.gf.Li.ke(t.clientX,t.clientY),this.gf.Li.ct,this.scale);let i;const s=this.GT.getPosition(),r=this.GT.getSize();this.uI(e,s,r)?clearInterval(this.HT):(i=this.jT===qc.UpToDown?u(0,e.y-s.y>0?this.NT:-this.NT):u(s.x-e.x>0?this.NT:-this.NT,0),(i.x>0||i.y>0)&&this.cI(0!==i.x?Math.abs(i.x):Math.abs(i.y)),(i.x<0||i.y<0)&&this.dI(0!==i.x?Math.abs(i.x):Math.abs(i.y)))}uI(t,e,i){return this.jT===qc.UpToDown?t.ye.y-i.y/2:t.x>e.x-i.x/2&&t.xthis.QA.height?Math.min(this.ET.y-this.OT.max.y,this.zT.y+t):0,e!==this.zT.y&&(this.XT({x:0,y:e}),this.ru(),!0)}case qc.LeftToRight:{const e=Math.min(this.OT.max.x-this.ET.x,this.zT.x+t);return e!==this.zT.x&&(this.XT({y:0,x:e}),this.ru(),!0)}default:return!1}}lI(){return this.cI(this.NT)}aI(){return this.dI(this.NT)}XT(t){if(t.x===this.zT.x&&t.y===this.zT.y)return;let e;switch(this.zT=t,this.jT){case qc.UpToDown:e=this.zT.y*this.VT*this.contentScale.yi().y,this.P.emit("scrollY",Xc.Vertical,e),this.gf.Li.Bi();break;case qc.LeftToRight:e=this.zT.x*this.VT*this.contentScale.yi().x,this.P.emit("scrollX",Xc.Horizontal,e)}}setVisible(t){return this.ZT.setVisible(t),this.KT.setVisible(t),this.qT.setVisible(t),this.GT.setVisible(t),this}dispose(){return this.ZT.dispose(),this.KT.dispose(),this.qT.dispose(),this.GT.dispose(),this.HT&&clearInterval(this.HT),this}Gs(){switch(this.gI(),this.pI(),this.jT){case qc.UpToDown:this.ZT.Sn({x:this.QA.x,y:this.QA.y+this.QA.height-this.ZT.Et().x/2}).q(u(this.QA.width,this.QA.width)).Gs(),this.KT.Sn({x:this.QA.x,y:this.QA.y+10}).q(u(this.QA.width,this.QA.width)).Gs(),this.qT.setSize({x:this.QA.width,y:this.QA.height-2*this.ZT.Et().x}).setPosition({x:this.QA.x,y:this.QA.y+this.KT.Et().y+this.qT.getSize().y/2}),this.GT.setSize(u(this.QA.width,this.mI())),this.ET={x:this.QA.x,y:this.ZT.xn().y-this.ZT.Et().y/2-this.GT.getSize().y/2},this.fI({min:{x:this.QA.x,y:this.ZT.xn().y-this.ZT.Et().y/2-this.GT.getSize().y/2},max:{x:this.QA.x,y:this.KT.xn().y+this.KT.Et().x/2+this.GT.getSize().y/2}});break;case qc.LeftToRight:this.ZT.Sn({x:this.QA.x,y:this.QA.y}).q(u(this.QA.height,this.QA.height)).Gs(),this.KT.Sn({x:this.QA.x+this.QA.width-this.KT.Et().x,y:this.QA.y}).q(u(this.QA.height,this.QA.height)).Gs(),this.qT.setSize({y:this.QA.height,x:this.QA.width-2*this.ZT.Et().y}).setPosition({x:this.QA.x+this.ZT.Et().x/2+this.qT.getSize().x/2,y:this.QA.y}),this.GT.setSize(u(this.mI(),this.QA.height)),this.ET={x:this.ZT.xn().x+this.ZT.Et().x/2+this.GT.getSize().x/2,y:this.QA.y},this.fI({min:{x:this.ZT.xn().x+this.ZT.Et().x/2+this.GT.getSize().x/2,y:this.QA.y},max:{x:this.KT.xn().x-this.KT.Et().x/2-this.GT.getSize().x/2,y:this.QA.y}})}return this.yI(),this}gI(){switch(this.jT){case qc.UpToDown:this.SI()||this.setVisible(!1),this.SI()&&this.setVisible(!0);break;case qc.LeftToRight:this.xI()||this.setVisible(!1),this.xI()&&this.setVisible(!0)}}pI(){switch(this.jT){case qc.UpToDown:this.SI()||this.XT({x:0,y:0});break;case qc.LeftToRight:this.xI()||this.XT({x:0,y:0})}}SI(){return this.Cc.x>this.QA.height}xI(){return this.Cc.y>this.QA.width}mI(){switch(this.jT){case qc.UpToDown:return this.QA.height*(this.QA.height-2*this.ZT.Et().x)/this.Cc.x;case qc.LeftToRight:return this.QA.width*(this.QA.width-2*this.ZT.Et().y)/this.Cc.y;default:return 0}}yI(){switch(this.jT){case qc.UpToDown:this.VT=(this.Cc.x-this.QA.height)/(this.OT.min.y-this.OT.max.y);break;case qc.LeftToRight:this.VT=(this.Cc.y-this.QA.width)/(this.OT.max.x-this.OT.min.x)}}ru(){switch(this.ZT.ru(),this.KT.ru(),this.qT.ru(),this.jT){case qc.UpToDown:this.GT.setPosition({x:this.QA.x,y:this.ZT.xn().y-this.ZT.Et().y/2-this.GT.getSize().y/2-this.zT.y}).ru();break;case qc.LeftToRight:this.GT.setPosition({y:this.QA.y,x:this.ZT.xn().x+this.ZT.Et().x/2+this.GT.getSize().x/2+this.zT.x}).ru()}return this}}class Jc{constructor(t,e,i,s,r,n,o){switch(this.gf=t,this.Fg=e,this.scale=s,this.contentScale=r,o){case Xc.Vertical:this.bI=this.vI(i,n,qc.UpToDown);break;case Xc.Horizontal:this.MI=this.vI(i,n,qc.LeftToRight);break;case Xc.Both:this.bI=this.vI(i,n,qc.UpToDown),this.MI=this.vI(i,n,qc.LeftToRight)}this._I=Fr(new Or(void 0,((t,e,i,s,r)=>{var n,o;0!==s.x&&(null===(n=this.MI)||void 0===n?void 0:n.nI(s.x))&&Xt(r),0!==s.y&&(null===(o=this.bI)||void 0===o?void 0:o.rI(s.y))&&Xt(r)})))}vI(t,e,i){return new Kc(this.gf,this.Fg,t,this.scale,this.contentScale,e,i)}kA(){return 20}iI(t){var e,i;return null===(e=this.bI)||void 0===e||e.iI(t),null===(i=this.MI)||void 0===i||i.iI(t),this}AI(t){var e;return null===(e=this.MI)||void 0===e||e.eI(t),this}wI(t){var e;return null===(e=this.bI)||void 0===e||e.eI(t),this}kI(t){const e=this.bI;return e&&e.JT(t),this}CI(t){return this._I.onTouchStart(this,t),this}TI(t){return this._I.onTouchMove(this,t),this}II(t){return this._I.onTouchEnd(this,t),this}onScroll(t){var e,i;return null===(e=this.MI)||void 0===e||e.oI(t),null===(i=this.bI)||void 0===i||i.oI(t),this}dispose(){var t,e;return null===(t=this.bI)||void 0===t||t.dispose(),null===(e=this.MI)||void 0===e||e.dispose(),this}ru(){var t,e;return null===(t=this.bI)||void 0===t||t.ru(),null===(e=this.MI)||void 0===e||e.ru(),this}Gs(){var t,e,i,s;const r=this.scale.x,n=this.scale.y;return null===(t=this.bI)||void 0===t||t.QT({x:r.getInnerEnd()-10,y:n.getInnerStart()+20,height:n.getInnerEnd()-20,width:20}),null===(e=this.MI)||void 0===e||e.QT({x:r.getInnerStart()+10,y:n.getInnerStart()+10,height:20,width:r.getInnerEnd()-20}),null===(i=this.bI)||void 0===i||i.Gs(),null===(s=this.MI)||void 0===s||s.Gs(),this}}const Qc=s.Record({width:void 0,height:void 0,FI:void 0,DI:bt,BI:bt});class td extends Qc{constructor(t,e,i,s){super({...s,FI:t,DI:e,BI:i})}dispose(){return this.BI(this),this}setWidth(t){const e=this.set("width",t);return this.DI(e),e}getWidth(){return this.get("width")}setHeight(t){const e=this.set("height",t);return this.DI(e),e}getHeight(){return this.get("height")}setSize(t,e){const i=this.withMutations((i=>{i.set("width",t).set("height",e)}));return this.DI(i),i}Et(){if(!this.FI)return{x:0,y:0};const t=this.FI.width,e=this.FI.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 ed;e.ImageFitMode=void 0,(ed=e.ImageFitMode||(e.ImageFitMode={}))[ed.Fill=0]="Fill",ed[ed.Fit=1]="Fit",ed[ed.Stretch=2]="Stretch",ed[ed.Center=3]="Center",ed[ed.Tile=4]="Tile";const id=s.Record({source:void 0,surroundingColor:A(0,0,0,0),sourceMissingColor:A(0,0,0,0),fitMode:e.ImageFitMode.Fill});class sd extends id{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 rd extends mo{constructor(t,e,i,s,r,n){super(t,e,i,e.Xg("dataGrid bg",0),e.Eg("dataGrid ui"),s,e.Li.hs.dataGridBackgroundFillStyle,e.Li.hs.dataGridBackgroundStrokeStyle,e.Li.hs.dataGridTitleFont,e.Li.hs.dataGridTitleFillStyle,n),this.LI=[],this.OI=[],this.RI=[],this.EI=new Map,this.zI=!0,this.VI=!0,this.NI=!0,this.GI=!0,this.HI=!0,this.WI=!0,this.UI=!0,this.$I=!0,this.YI=!0,this.XI=!0,this.jI=!0,this.ZI=!0,this.KI=!0,this.qI=!0,this.JI=!0,this.QI=!0,this.tF=new Set,this.iF=new Set,this.sF=!0,this.eF=!0,this.hF=(t,e)=>{t.borders=void 0===e?ld:{...t.borders,...e},this.rF(t),this.ZI=!0,this.Li.Bi()},this.rF=t=>{t.borders&&(!1===t.borders.top&&this.nF(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!1}:{...this.oF,bottom:!1}})),!1===t.borders.bottom&&this.nF(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!1}:{...this.oF,top:!1}})),!1===t.borders.left&&this.nF(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!1}:{...this.oF,right:!1}})),!1===t.borders.right&&this.nF(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!1}:{...this.oF,left:!1}})),!0===t.borders.top&&this.nF(t.column,t.row-1,(t=>{t.borders=t.borders?{...null==t?void 0:t.borders,bottom:!0}:{...this.oF,bottom:!0}})),!0===t.borders.bottom&&this.nF(t.column,t.row+1,(t=>{t.borders=t.borders?{...t.borders,top:!0}:{...this.oF,top:!0}})),!0===t.borders.left&&this.nF(t.column-1,t.row,(t=>{t.borders=t.borders?{...t.borders,right:!0}:{...this.oF,right:!0}})),!0===t.borders.right&&this.nF(t.column+1,t.row,(t=>{t.borders=t.borders?{...t.borders,left:!0}:{...this.oF,left:!0}})))},this.aF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseEnter,i,e)},this.lF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseLeave,i,e)},this.uF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseClick,i,e)},this.cF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDoubleClick,i,e)},this.dF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDown,i,e)},this.fF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseUp,i,e)},this.gF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseMove,i,e)},this.pF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDrag,i,e)},this.mF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDragStart,i,e)},this.yF=(t,e)=>{const i=this.EI.get(t);i&&this.P.emit(nd.cellMouseDragStop,i,e)},this.SF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellMouseWheel,i,e),!e.defaultPrevented&&this.sF&&this.xF.kI(e))},this.bF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellTouchStart,i,e),!e.defaultPrevented&&this.eF&&this.xF.CI(e))},this.vF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellTouchMove,i,e),!e.defaultPrevented&&this.eF&&this.xF.TI(e))},this.MF=(t,e)=>{const i=this.EI.get(t);i&&(this.P.emit(nd.cellTouchEnd,i,e),!e.defaultPrevented&&this.eF&&this.xF.II(e))},this.ef._h||this.ef.wh||this.Li.bh(2),this.Kg.fs("Data Grid"),this._F=i.d2({scaleXYConstructor:Ti}),this._F.x.jf=Ic,this.AF=i.d2({scaleXYConstructor:Ti}),this.wF={x:0,y:0},this.kF=this.hs.dataGridTextFont,this.CF=this.hs.dataGridTextFillStyle,this.oF={top:!0,bottom:!0,left:!0,right:!0},this.TF=this.hs.dataGridCellBackgroundFillStyle,this.IF=this.hs.dataGridBorderStrokeStyle,this.FF="left-center",this.PF={left:5,right:5,bottom:5,top:5},this.DF=e.qy("dataGrid grid bg",0),this.BF=e.qy("dataGrid cell bg",1),this.LF=e.Pp("dataGrid cell content",0),this.OF=e.Pp("dataGrid scrollbar bg",1),this.RF=e.Pp("dataGrid scrollbar fg",2),this.xF=this.EF(),this.onBackgroundMouseWheel(((t,e)=>{this.sF&&this.xF.kI(e)})),this.onBackgroundTouchStart(((t,e)=>{this.eF&&this.xF.CI(e)})),this.onBackgroundTouchMove(((t,e)=>{this.eF&&this.xF.TI(e)})),this.onBackgroundTouchEnd(((t,e)=>{this.eF&&this.xF.II(e)})),this.zF=this.DF.gc(this._F).ps(this.hs.dataGridBackgroundFillStyle).$h(J).setMouseInteractions(!1),this.VF=this.LF.Sg(this._F).setMouseInteractions(!1),this.NF=new Cc((()=>this.BF.gc(this._F).setMouseInteractions(!0).setMouseEnterEventHandler(this.aF).setMouseLeaveEventHandler(this.lF).setMouseClickEventHandler(this.uF).setMouseDoubleClickEventHandler(this.cF).setMouseDownEventHandler(this.dF).setMouseUpEventHandler(this.fF).setMouseMoveEventHandler(this.gF).setMouseDragEventHandler(this.pF).setMouseDragStartEventHandler(this.mF).setMouseDragStopEventHandler(this.yF).setMouseWheelEventHandler(this.SF).setTouchStartEventHandler(this.bF).setTouchMoveEventHandler(this.vF).setTouchEndEventHandler(this.MF))),this.GF=new Cc((()=>this.LF.gc(this._F).setMouseInteractions(!1))),this.HF=new Cc((()=>this.LF.ue(this._F).setMouseInteractions(!1)));const o=new Cc((()=>this.LF.Gp(this._F,{},[Bo.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),h=new Cc((()=>this.LF._u(this._F).setMouseInteractions(!1))),a=new Cc((()=>this.LF.Bm(this._F).setMouseInteractions(!1))),l=new Cc((()=>this.LF.gc(this._F).setMouseInteractions(!1))),u=new Cc((()=>this.LF.xk(this._F).setMouseInteractions(!1))),c=new Cc((()=>this.LF.kc(this._F).setMouseInteractions(!1)));this.WF={lineSet:o,line:h,pointSet:a,rect:l,junction:u,arc:c},this.UF=()=>{o.TT(),h.TT(),a.TT(),l.TT(),u.TT(),c.TT()},this.$F=()=>{this.NF.IT(),this.GF.IT(),this.HF.IT(),o.IT(),h.IT(),a.IT(),l.IT(),u.IT(),c.IT()},this.Yg(r,this.uiScale),this.onResize((()=>{this.zI=!0,this.Li.Bi(),this._F.q(this.pixelScale.Et()),this.AF.q(this.pixelScale.Et())})),this.YF=this.iu.lg([this.zF])}getMinimumSize(){return{x:200,y:200}}setAnimationsEnabled(t){return this}dd(){return[]}dispose(){return super.dispose(),this.DF.G(),this.BF.G(),this.LF.G(),this.OF.G(),this.RF.G(),co(this._F),co(this.AF),this.xF.dispose(),this}X(){return super.X(),this._F.X(),this.AF.X(),this}j(){return super.j(),this._F.j(),this.AF.j(),this}setBackgroundEffect(t){return this.YF.vs(t),this.Li.Bi(),this}getBackgroundEffect(){return this.YF._s()}setInteractionScrollOnWheel(t){return this.sF=t,this}getInteractionScrollOnWheel(){return this.sF}setInteractionPanOnTouch(t){return this.eF=t,this}getInteractionPanOnTouch(){return this.eF}onCellMouseEnter(t){return this.P.on(nd.cellMouseEnter,t)}offCellMouseEnter(t){return this.P.off(t)}onCellMouseLeave(t){return this.P.on(nd.cellMouseLeave,t)}offCellMouseLeave(t){return this.P.off(t)}onCellMouseClick(t){return this.P.on(nd.cellMouseClick,t)}offCellMouseClick(t){return this.P.off(t)}onCellMouseDoubleClick(t){return this.P.on(nd.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.P.off(t)}onCellMouseDown(t){return this.P.on(nd.cellMouseDown,t)}offCellMouseDown(t){return this.P.off(t)}onCellMouseUp(t){return this.P.on(nd.cellMouseUp,t)}offCellMouseUp(t){return this.P.off(t)}onCellMouseMove(t){return this.P.on(nd.cellMouseMove,t)}offCellMouseMove(t){return this.P.off(t)}onCellMouseDrag(t){return this.P.on(nd.cellMouseDrag,t)}offCellMouseDrag(t){return this.P.off(t)}onCellMouseDragStart(t){return this.P.on(nd.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.P.off(t)}onCellMouseDragStop(t){return this.P.on(nd.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.P.off(t)}onCellMouseWheel(t){return this.P.on(nd.cellMouseWheel,t)}offCellMouseWheel(t){return this.P.off(t)}onCellTouchStart(t){return this.P.on(nd.cellTouchStart,t)}offCellTouchStart(t){return this.P.off(t)}onCellTouchMove(t){return this.P.on(nd.cellTouchMove,t)}offCellTouchMove(t){return this.P.off(t)}onCellTouchEnd(t){return this.P.on(nd.cellTouchEnd,t)}offCellTouchEnd(t){return this.P.off(t)}setGridBackgroundFillStyle(t){return this.zF.ps(t),this.Li.Bi(),this}getGridBackgroundFillStyle(){return this.zF.gs()}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.OI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.OI.splice(this.OI.indexOf(i),1):(i.min=e,i.max=e),this.WI=!0,this.Li.Bi(),this}setRowHeight(t,e){let i=this.RI.find((e=>e.row===t));return i||(i={row:t,min:void 0,max:void 0},this.RI.push(i)),"object"==typeof e?(i.min=e.min,i.max=e.max):void 0===e?this.RI.splice(this.RI.indexOf(i),1):(i.min=e,i.max=e),this.WI=!0,this.Li.Bi(),this}setColumnPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.jF(t,(t=>this.ZF(t,e))),this}setRowPaddings(t,e){return"number"==typeof e&&(e=S(e,e,e,e)),this.KF(t,(t=>this.ZF(t,e))),this}setCellPadding(t,e,i){return"number"==typeof i&&(i=S(i,i,i,i)),this.nF(t,e,(t=>this.ZF(t,i))),this}setCellsPaddings(t){return"number"==typeof t&&(t=S(t,t,t,t)),this.PF={...this.PF,...t},this.qF((t=>this.ZF(t,this.PF))),this}setCellBorders(t,e,i){return this.nF(t,e,(t=>this.hF(t,i))),this}setRowBorders(t,e){return this.KF(t,(t=>this.hF(t,e))),this}setColumnBorders(t,e){return this.jF(t,(t=>this.hF(t,e))),this}setCellsBorders(t){return this.oF=void 0===t?ld:t,this.qF((t=>this.hF(t,this.oF))),this}setCellsBorderStrokeStyle(t){return this.IF="function"==typeof t?t(this.IF):t,this.qI=!0,this.Li.Bi(),this}setColumnTextFillStyle(t,e){return this.jF(t,(t=>this.JF(t,e))),this}setRowTextFillStyle(t,e){return this.KF(t,(t=>this.JF(t,e))),this}setCellTextFillStyle(t,e,i){return this.nF(t,e,(t=>this.JF(t,i))),this}setCellsTextFillStyle(t){return this.CF="function"==typeof t?t(this.CF):t,this.qF((t=>this.JF(t,this.CF))),this}setColumnTextFont(t,e){return this.jF(t,(t=>this.QF(t,e))),this}setRowTextFont(t,e){return this.KF(t,(t=>this.QF(t,e))),this}setCellTextFont(t,e,i){return this.nF(t,e,(t=>this.QF(t,i))),this}setCellsTextFont(t){return this.kF="function"==typeof t?t(this.kF):t,this.qF((t=>this.QF(t,this.kF))),this}setColumnContentAlignment(t,e){return this.jF(t,(t=>this.tP(t,e))),this}setRowContentAlignment(t,e){return this.KF(t,(t=>this.tP(t,e))),this}setCellContentAlignment(t,e,i){return this.nF(t,e,(t=>this.tP(t,i))),this}setCellsContentAlignment(t){return this.FF=t,this.qF((t=>this.tP(t,this.FF))),this}setCellBackgroundFillStyle(t,e,i){return this.nF(t,e,(t=>this.iP(t,i))),this}setColumnBackgroundFillStyle(t,e){return this.jF(t,(t=>this.iP(t,e))),this}setRowBackgroundFillStyle(t,e){return this.KF(t,(t=>this.iP(t,e))),this}setCellsBackgroundFillStyle(t){return this.TF="function"==typeof t?t(this.TF):t,this.qF((t=>this.iP(t,this.TF))),this}setCellHighlight(t,e,i){return this.nF(t,e,(t=>{t.highlight=me(i)})),this.KI=!0,this.Li.Bi(),this}setColumnHighlight(t,e){const i=me(e);return this.jF(t,(t=>{t.highlight=i})),this.KI=!0,this.Li.Bi(),this}setRowHighlight(t,e){const i=me(e);return this.KF(t,(t=>{t.highlight=i})),this.KI=!0,this.Li.Bi(),this}removeCell(t,e){return this.nF(t,e,(t=>this.LI.splice(this.LI.indexOf(t),1))),this.HI=!0,this.Li.Bi(),this}removeRow(t){return this.KF(t,(t=>this.LI.splice(this.LI.indexOf(t),1))),this.LI.filter((e=>e.row>t)).forEach((t=>{t.row-=1})),this.HI=!0,this.Li.Bi(),this}removeColumn(t){return this.jF(t,(t=>this.LI.splice(this.LI.indexOf(t),1))),this.LI.filter((e=>e.column>t)).forEach((t=>{t.column-=1})),this.HI=!0,this.Li.Bi(),this}removeCells(){return this.LI.splice(0),this.HI=!0,this.Li.Bi(),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)}ru(){super.ru(),po.ip(this.Kg,this.jg);const t=Math.round(this.IF.O()),e=t/2;let i=this.VI||this.NI||this.GI||this.HI||this.WI||this.UI||this.jI||this.ZI||this.qI||this.QI;if(i){this.LI.forEach((t=>{this.iF.add(t.column)})),this.LI.forEach((t=>{this.tF.add(t.row)})),this.HF.TT();const s=this.sP(e),r=this.eP(this.iF.size,s),n=this.hP(this.tF.size,s),o=r.reduce(Ie,0)+t,h=n.reduce(Ie,0)+t,a=new Array(r.length+1).fill(0).map(((t,e)=>r.reduce(((t,i,s)=>t+(sn.reduce(((t,i,s)=>t+(st===r[e])),e=this.rP.rowHeights.every(((t,e)=>t===n[e]));t&&e&&(i=!1)}this.rP={columnWidths:r,rowHeights:n,dataGridWidth:o,dataGridHeight:h,columnWidthsCumulative:a,rowHeightsCumulative:l,cellsContentSizes:s}}const s=i||this.NI||this.GI||this.HI||this.$I||this.YI||this.XI||this.ZI||this.KI||this.qI||this.zI||this.QI;if((s||this.JI)&&this.rP){const i=this.pixelScale.getInnerIntervalPixels(),r=po.tp(this.Kg,this.jg),n=[this.rn.left+e,this.rn.right+e],o=[this.rn.bottom+e,this.rn.top+r+e],h={x:i.x-n[0]-n[1],y:i.y-o[0]-o[1]},a=[this.rn.left,this.rn.right],l=[this.rn.bottom,this.rn.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.AF.ci(n).di(o).fi(0,h.x).gi(0,h.y),this.xF.iI({x:this.rP.dataGridHeight,y:this.rP.dataGridWidth}).Gs().ru();const d={x:Math.round(this.wF.x),y:Math.round(Math.min(0,this.wF.y))};this._F.ci(a).di(l).fi(d.x,u.x+d.x).gi(d.y,u.y+d.y),this.zF.Sn({x:c.x,y:c.y});const f={x:this._F.x.Bt(),y:this._F.y.Bt()+this.xF.kA(),width:this._F.x.Ot()+t-this.xF.kA(),height:this._F.y.Ot()+t};this.LF.Wy(f),this.BF.Wy(f),this.DF.Wy(f),s&&this.nP(c,this.rP,t)}this.$F(),this.zI=!1,this.VI=!1,this.NI=!1,this.GI=!1,this.HI=!1,this.WI=!1,this.UI=!1,this.$I=!1,this.YI=!1,this.XI=!1,this.jI=!1,this.ZI=!1,this.KI=!1,this.qI=!1,this.JI=!1,this.QI=!1}sP(t){const e=[],i={left:Math.ceil(t),right:Math.ceil(t),top:Math.ceil(t),bottom:Math.ceil(t)};for(const t of this.LI){const{content:s}=t,r={...this.PF,...t.padding};let n,o,h,a={x:0,y:0};if("string"==typeof s||"number"==typeof s){const e=String(s);n=this.HF.CT(),a=n.fs(e).Ss(t.textFont||this.kF).Gs().Ac()}if(Pc(s)&&(o=s,a={x:200,y:50}),s instanceof td){const t=this.Li.oP(s);t.aP()?(h=s,a=h.Et()):t.lP((()=>{this.QI=!0,this.Li.Bi()}))}if(n||o||h){r.top=Math.round(r.top),r.left=Math.round(r.left),r.right=Math.round(r.right),r.bottom=Math.round(r.bottom);const s={x:Math.round(a.x+r.left+r.right+i.left+i.right),y:Math.round(a.y+r.top+r.bottom+i.top+i.bottom)};e.push({cell:t,contentSize:s,text:n,sparkChart:o,icon:h,cellPadding:r,cellMargin:i})}}return e}nP(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.zF.q(c),this.VF.ea(this.IF),this.EI.clear(),this.NF.TT(),this.GF.TT(),this.UF();const d=[];for(const i of o){const{cell:r,text:n,sparkChart:o,icon:c,cellPadding:f,cellMargin:g}=i,m={column:r.column,row:r.row},p={x:t.x+a[r.column],y:t.y-u[r.row+r.rowSpan]},y={x:p.x+g.left,y:p.y+g.bottom},x={x:y.x+f.left,y:y.y+f.bottom},S={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:S.x-g.left-g.right,y:S.y-g.top-g.bottom},b={x:v.x-f.left-f.right,y:v.y-f.top-f.bottom};if(n){const t=ad(x,b,r.contentAlignment||this.FF);n.Sn(t[0]).kn({x:t[1],y:t[2]}).ps(this.uP(r.textFillStyle||this.CF,r.content,this.CF)).Ir(r.highlight)}const M=this.uP(r.backgroundFillStyle||this.TF,r.content);if(M!==F){const t=this.NF.CT();t.Sn(p).q(S).ps(M).$h(J).Ir(r.highlight),this.EI.set(t,m)}const A=r.borders||this.oF;if(A&&hd(p,S,A,s,d),o){const t=x,e=b;Lc(o,this.WF,this._F,t,e,this.hs,this.ef,r.highlight)}if(c){const t=c.Et(),i=ad(x,b,r.contentAlignment||this.FF);this.GF.CT().Sn({x:i[0].x+t.x*(-.5-i[1]/2),y:i[0].y+t.y*(-.5-i[2]/2)}).q(t).ps(new sd({source:c.FI,fitMode:e.ImageFitMode.Stretch})).$h(J).Ir(r.highlight)}}this.VF.qn();for(const t of d)this.VF.Kn(t[0],t[1])}eP(t,e){const i=new Array(t).fill(0);for(const t of this.iF.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.OI.find((e=>e.column===t)),n=r?At(s,void 0!==r.min?r.min:Ae,void 0!==r.max?r.max:Me):s;i[t]=n}return i}hP(t,e){const i=new Array(t).fill(0);for(const t of this.tF.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.RI.find((e=>e.row===t)),n=r?At(s,void 0!==r.min?r.min:Ae,void 0!==r.max?r.max:Me):s;i[t]=n}return i}uP(t,e,i){if(t instanceof G){try{const i=Number(e);return new z({color:t.getPalette().getColors(i)})}catch(t){}return i||F}return t}JF(t,e){t.textFillStyle="function"==typeof e?e(t.textFillStyle||this.CF):e,this.XI=!0,this.Li.Bi()}QF(t,e){t.textFont="function"==typeof e?e(t.textFont||this.kF):e,this.jI=!0,this.Li.Bi()}iP(t,e){t.backgroundFillStyle="function"==typeof e?e(t.backgroundFillStyle||this.TF):e,this.YI=!0,this.Li.Bi()}tP(t,e){t.contentAlignment=e,this.$I=!0,this.Li.Bi()}ZF(t,e){t.padding={...t.padding,...e},this.UI=!0,this.Li.Bi()}XF(t,e,i){let s=this.nF(t,e);s?s.content=i:(s={column:t,row:e,columnSpan:1,rowSpan:1,content:i,highlight:0},this.LI.push(s),this.GI=!0),"string"==typeof s.content||"number"==typeof s.content?this.VI=!0:this.NI=!0,this.Li.Bi()}qF(t){this.LI.forEach((e=>t(e)))}nF(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}jF(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)}KF(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)}EF(){return new Jc(this.RF,this.OF,this.AF,this.AF,this._F,this.hs,Xc.Both).onScroll(((t,e)=>{this.rP&&(t===Xc.Vertical&&(this.wF.y=-e),t===Xc.Horizontal&&(this.wF.x=e),this.JI=!0,this.Li.Bi())})).AI(50).wI(12)}}const nd={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 od;e.DataGridCellContentAlignmentOptions=void 0,(od=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",od.RightCenter="right-center",od.LeftCenter="left-center",od.RightTop="right-top",od.LeftTop="left-top",od.RightBottom="right-bottom",od.LeftBottom="left-bottom",od.CenterTop="center-top",od.CenterBottom="center-bottom";const hd=(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])},ad=(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 pe(0,`Unidentified DataGrid cell content alignment option: ${i}`)},ld={top:!1,bottom:!1,left:!1,right:!1},ud=(t,e)=>e?t.x:t.y,cd=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),dd=(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(ud(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&&ecd(t,h,n,e))).reduce(((t,e)=>Math.max(t,ud(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>ud(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))/ud(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class fd{constructor(t,e,i,s,n){this.ce=!1,this.LI=new Array,this.P=new r.Eventer,this.cP=[],this.Ag=[],this.dP=void 0,this.fP=!0,this.gP=!0,this.pP=!0,this.mP=([t,e])=>{this.uiScale.q(t,e),this.pixelScale.q(t,e).fi(0,this.uiScale.x.getCellSize()).gi(0,this.uiScale.y.getCellSize()),this.gP=!0,this.Li.Bi()},this.yP=[],this.SP=t=>{for(let e=0;e{const e=this.cP.indexOf(t);e>=0&&this.cP.splice(e,1)},this.Dg=t=>{const e=this.Ag.indexOf(t);e>=0&&this.Ag.splice(e,1)},this.bP=(t,e,i,s,r)=>{if(this.vP(e,i,s,r)){const n={panel:t,columnIndex:e,rowIndex:i,columnSpan:s,rowSpan:r};return this.LI.push(n),this.MP(n),this.fP=!0,t}throw new ht("Out of dashboard range.")},this._P=e.numberOfRows,this.AP=e.numberOfColumns,this.ef=t,this.wP=e,this.kP=s;const o=this.AP*this._P;this.CP={x:new kc(new Array(this.AP).fill(1)),y:new kc(new Array(this._P).fill(1))},this.hs=i.hs,this.TP=this.hs.dashboardSplitterStyle,this.Oi=void 0===e.disableAnimations||!e.disableAnimations,this.IP=Bc(i,o),this.FP=i.vT("dashboard splitters",400001),this.ov=()=>this.IP.bT(),this.zg=this.IP.MT(),this.iu=i.iu.su(this,{PP:{}}),this.iu.PP.vs(this.hs.effectsDashboardSplitters);const h=i.Et();this.uiScale=st.d2({scaleXYConstructor:Ti}).fi(0,100).gi(0,100).q(h),this.pixelScale=st.d2({scaleXYConstructor:Ti}).fi(0,this.uiScale.x.getCellSize()).gi(0,this.uiScale.y.getCellSize()).q(h),this.DP=i.BP.bind(i),this.LP=i.OP.bind(i),this.RP=i.EP.bind(i),this.zP=i.VP.bind(i),this.Nh=i.Nh.bind(i),this.Hh=i.Hh.bind(i),this.engine=i.Lg,this.Li=i.Og,i.cr(this.mP),i.Bi(),this.NP(),this.setAnimationsEnabled(this.Oi);const a=((t,e)=>({on:t.on.bind(t,"dashboard-resize"),off:t.off.bind(t)}))(this.P);this.createChartXY=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Mc(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createSpiderChart=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Rl(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPolarChart=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Ua(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPieChart=t=>{const e=gd(t,this.wP,this.Oi),i=e&&e.type?e.type:zo;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createGaugeChart=t=>{const e=gd(t,this.wP,this.Oi),i=e&&e.type?e.type:ll;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createFunnelChart=t=>{const e=gd(t,this.wP,this.Oi),i=e&&e.type?e.type:Ja;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createPyramidChart=t=>{const e=gd(t,this.wP,this.Oi),i=t&&t.type?t.type:yl;return this.bP(new i(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e.disableAnimations),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createUIPanel=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new fo(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createLegendBoxPanel=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new yh(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createZoomBandChart=t=>{const e=gd(t,this.wP,this.Oi),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return this.bP(new Ec(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,e.axis,i,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createMapChart=t=>{const e=gd(t,this.wP,this.Oi);return this.bP(new Xh(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,e,a),e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createChart3D=t=>{const e=gd(t,this.wP,this.Oi),i=new mh(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a,e);return this.bP(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)},this.createDataGrid=t=>{const e=gd(t,this.wP,this.Oi),i=new rd(this.ef,this.IP._T(this.GP(t.columnIndex,t.rowIndex)),this.HP(e,this.CP),this.SP,n,a);return this.bP(i,e.columnIndex,e.rowIndex,e.columnSpan,e.rowSpan)}}GP(t,e){return t+e*this.AP}HP(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.AP:this._P,"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.AP,y:this._P},e),d3:()=>new et({x:t.columnIndex,y:t.rowIndex},{x:t.columnSpan,y:t.rowSpan},{x:this.AP,y:this._P},e)}}setWidth(t){return t instanceof Array||(t=[t,t]),this.DP(t[0]),this.LP(t[1]),this}setHeight(t){return t instanceof Array||(t=[t,t]),this.RP(t[0]),this.zP(t[1]),this}getWidth(){return this.Nh()}getHeight(){return this.Hh()}setBackgroundFillStyle(t){return this.engine.setBackgroundFillStyle(t),this.FP.Bi(),this}getBackgroundFillStyle(){return this.engine.getBackgroundFillStyle()}setBackgroundStrokeStyle(t){return this.engine.setBackgroundStrokeStyle(t),this.FP.Bi(),this}getBackgroundStrokeStyle(){return this.engine.getBackgroundStrokeStyle()}getTheme(){return this.hs}setSplitterStyle(t){const e=this.TP;return this.TP="function"==typeof t?t(this.TP):t,this.WP(e),this}getSplitterStyle(){return this.TP}setSplitterEffect(t){return this.iu.PP.vs(t),this.Li.Bi(),this}getSplitterEffect(){return this.iu.PP._s()}setAnimationHighlight(t){return this.pP=t,this.yP.forEach((e=>this.Li.Vh.ve(e.line,t))),this}getAnimationHighlight(){return this.pP}WP(t){for(const t of this.yP)t.line.ea(this.TP);this.NP()}setColumnWidth(t,e){const i=this.CP.x.M();return t>=0&&t=e.length)throw new ht("Column index is out of dashboard range.");return e[t]}setRowHeight(t,e){const i=this.CP.y.M();return t>=0&&t=e.length)throw new ht("Row index is out of dashboard range.");return e[Math.abs(e.length-1-t)]}UP(t,e,i){if(i&&Math.abs(t.x)>0)this.$P(e,t.x);else{if(i||!(Math.abs(t.y)>0))return;this.YP(e,t.y)}this.P.emit("dashboard-resize");for(const t of this.LI)t.panel.j();this.Li.Bi()}YP(t,e){const i=dd(this.LI,this.CP.y.M(),t,e,this.pixelScale.Et(),!1);this.CP.y.S(i),this.gP=!0,this.Li.Bi()}$P(t,e){const i=dd(this.LI,this.CP.x.M(),t,e,this.pixelScale.Et(),!0);this.CP.x.S(i),this.gP=!0,this.Li.Bi()}XP(){this.yP.forEach((t=>t.line.dispose())),this.yP.length=0;for(let t=1;t<=this.AP-1;t+=1)for(let e=0;e<=this._P-1;e+=1)if(void 0!==this.LI.find((i=>Pe(e,i.rowIndex,i.rowIndex+i.rowSpan-1)&&(t===i.columnIndex||t===i.columnIndex+i.columnSpan)))){const i=Fr(new Or((()=>{this.jP(t)}),((e,i,s,r,n)=>{this.UP(r,t,!0),Xt(n)}),(()=>{this.ZP(t)}))),s=this.FP._u(this.pixelScale).ea(this.TP).setMouseEnterEventHandler((()=>{this.jP(t)})).setMouseLeaveEventHandler((()=>{this.ZP(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.UP(n,t,!0),Xt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.Li.Vh.Se(s,(t=>s.Ir(t)),{animationEnabled:this.pP}),this.yP.push({row:e,column:t,line:s,alignment:"vertical"})}for(let t=1;t<=this._P-1;t+=1)for(let e=0;e<=this.AP-1;e+=1)if(void 0!==this.LI.find((i=>Pe(e,i.columnIndex,i.columnIndex+i.columnSpan-1)&&(t===i.rowIndex||t===i.rowIndex+i.rowSpan)))){const i=Fr(new Or((()=>{this.KP(t)}),((e,i,s,r,n)=>{this.UP(r,t,!1),Xt(n)}),(()=>{this.qP(t)}))),s=this.FP._u(this.pixelScale).ea(this.TP).setMouseEnterEventHandler((()=>{this.KP(t)})).setMouseLeaveEventHandler((()=>{this.qP(t)})).setMouseDragEventHandler(((e,i,s,r,n)=>{this.UP(n,t,!1),Xt(i)})).setTouchStartEventHandler(i.onTouchStart).setTouchMoveEventHandler(i.onTouchMove).setTouchEndEventHandler(i.onTouchEnd);this.Li.Vh.Se(s,(t=>s.Ir(t)),{animationEnabled:this.pP}),this.yP.push({row:t,column:e,line:s,alignment:"horizontal"})}this.iu.PP.nc(this.yP.map((t=>t.line)))}JP(){const t=this.pixelScale.Et(),e=this.CP.x.M(),i=e.reduce(((t,e)=>t+e)),s=this.CP.y.M(),r=s.reduce(((t,e)=>t+e));this.yP.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.la(o).Ko(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.la(o).Ko(h)}}))}jP(t){this.yP.forEach((e=>{"vertical"===e.alignment&&e.column===t&&(this.Li.Vh.xe(e.line,1),this.FP.QP(e.line))})),this.dP=this.engine.setMouseStyle(e.MouseStyles.ResizeColumn),this.Li.Bi()}KP(t){this.yP.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&(this.Li.Vh.xe(e.line,1),this.FP.QP(e.line))})),this.dP=this.engine.setMouseStyle(e.MouseStyles.ResizeRow),this.Li.Bi()}ZP(t){this.yP.forEach((e=>{"vertical"===e.alignment&&e.column===t&&this.Li.Vh.xe(e.line,0)})),this.engine.restoreMouseStyle(this.dP),this.Li.Bi()}qP(t){this.yP.forEach((e=>{"horizontal"===e.alignment&&e.row===t&&this.Li.Vh.xe(e.line,0)})),this.engine.restoreMouseStyle(this.dP),this.Li.Bi()}setAnimationsEnabled(t){return this.Oi=t,this.getCells().filter((t=>t.panel instanceof mo)).forEach((e=>e.panel.setAnimationsEnabled(t))),this.setAnimationHighlight(this.Oi),this}getAnimationsEnabled(){return this.Oi}getCells(){return this.LI.slice()}dispose(){return this.ce||(this.LI.slice().forEach((t=>t.panel.dispose())),this.cP.slice().forEach((t=>t.dispose())),this.Ag.slice().forEach((t=>t.dispose())),this.ce=!0,this.kP(),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 ho(this.engine,t,e,i),this}tD(){this.fP&&(this.XP(),this.fP=!1,this.gP=!0),this.gP&&(this.JP(),this.gP=!1);for(const t of this.LI)t.panel.ru();return this.cP.forEach((t=>t.Gs())),this.cP.forEach((t=>t.ru())),this.Ag.forEach((t=>t.Gs())),this.Ag.forEach((t=>t.ru())),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}j(){for(const t of this.LI)t.panel.j();return this.pixelScale.x.j(),this.pixelScale.y.j(),this.uiScale.x.j(),this.uiScale.y.j(),this}addUIElement(t=Rn,e=this.uiScale){e=lo(e);const i=ao(t,this.ov(),this.uiScale,e,this.xP,this.hs);return this.cP.push(i),i}addLegendBox(t=qn,i=this.uiScale){i=lo(i);const s=ao(t,this.zg,this.uiScale,i,this.Dg,this.hs);return s.setDraggingMode(e.UIDraggingModes.notDraggable),this.Ag.push(s),s}vP(t,e,i,s){return e>=0&&t>=0&&e+s<=this._P&&t+i<=this.AP}MP(t){const e=this.TP,i=e===J?0:e.getThickness()/2,s={left:t.columnIndex>0?i:0,top:t.rowIndex0?i:0};t.panel.Cn(s)}NP(){this.uiScale.x.Dt([0,0]),this.uiScale.y.Dt([0,0]),this.pixelScale.x.Dt([0,0]),this.pixelScale.y.Dt([0,0]);for(const t of this.LI)this.MP(t);this.Li.Bi()}}const gd=(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},md="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",pd="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==",yd={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)=>yd.multiply(t,yd.translation(e,i,s)),xRotate:(t,e)=>yd.multiply(t,yd.xRotation(e)),yRotate:(t,e)=>yd.multiply(t,yd.yRotation(e)),zRotate:(t,e)=>yd.multiply(t,yd.zRotation(e)),scale:(t,e,i,s)=>yd.multiply(t,yd.scaling(e,i,s)),multiply(t,e){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],h=e[5],a=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],g=e[12],m=e[13],p=e[14],y=e[15],x=t[0],S=t[1],v=t[2],b=t[3],M=t[4],A=t[5],w=t[6],D=t[7],T=t[8],E=t[9],B=t[10],k=t[11],I=t[12],C=t[13],P=t[14],L=t[15],R=[];return R[0]=i*x+s*M+r*T+n*I,R[1]=i*S+s*A+r*E+n*C,R[2]=i*v+s*w+r*B+n*P,R[3]=i*b+s*D+r*k+n*L,R[4]=o*x+h*M+a*T+l*I,R[5]=o*S+h*A+a*E+l*C,R[6]=o*v+h*w+a*B+l*P,R[7]=o*b+h*D+a*k+l*L,R[8]=u*x+c*M+d*T+f*I,R[9]=u*S+c*A+d*E+f*C,R[10]=u*v+c*w+d*B+f*P,R[11]=u*b+c*D+d*k+f*L,R[12]=g*x+m*M+p*T+y*I,R[13]=g*S+m*A+p*E+y*C,R[14]=g*v+m*w+p*B+y*P,R[15]=g*b+m*D+p*k+y*L,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],m=t[13],p=t[14],y=t[15],x=d*y,S=p*f,v=a*y,b=p*l,M=a*f,A=d*l,w=r*y,D=p*n,T=r*f,E=d*n,B=r*l,k=a*n,I=u*m,C=g*c,P=o*m,L=g*h,R=o*c,F=u*h,_=i*m,O=g*s,z=i*c,V=u*s,N=i*h,G=o*s,U=x*h+b*c+M*m-(S*h+v*c+A*m),H=S*s+w*c+E*m-(x*s+D*c+T*m),W=v*s+D*h+B*m-(b*s+w*h+k*m),Y=A*s+T*h+k*c-(M*s+E*h+B*c),q=1/(i*U+o*H+u*W+g*Y);return e[0]=q*U,e[1]=q*H,e[2]=q*W,e[3]=q*Y,e[4]=q*(S*o+v*u+A*g-(x*o+b*u+M*g)),e[5]=q*(x*i+D*u+T*g-(S*i+w*u+E*g)),e[6]=q*(b*i+w*o+k*g-(v*i+D*o+B*g)),e[7]=q*(M*i+E*o+B*u-(A*i+T*o+k*u)),e[8]=q*(I*l+L*f+R*y-(C*l+P*f+F*y)),e[9]=q*(C*n+_*f+V*y-(I*n+O*f+z*y)),e[10]=q*(P*n+O*l+N*y-(L*n+_*l+G*y)),e[11]=q*(F*n+z*l+G*f-(R*n+V*l+N*f)),e[12]=q*(P*d+F*p+C*a-(R*p+I*a+L*d)),e[13]=q*(z*p+I*r+O*d-(_*d+V*p+C*r)),e[14]=q*(_*a+G*p+L*r-(N*p+P*r+O*a)),e[15]=q*(N*d+R*r+V*a-(z*a+G*d+F*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 xd{constructor(t){this.iD=t}}class Sd{constructor(){this.sD=new Array,this.eD=t=>(this.sD.push(t),t),this.hD=this.eD(new Map),this.rD=this.eD(new Map),this.nD=this.eD(new Map),this.oD=this.eD(new Map),this.aD=this.eD(new Map)}lD(){this.sD.forEach((t=>{t.forEach((t=>t.lD())),t.clear()}))}}class vd{constructor(t){this.uD=t,this.cD=new Map}dD(t){return!!this.cD.get(t)}M(t){const e=this.cD.get(t);return e&&e.textureInfo}Kn(t){if(t instanceof P){let e=this.cD.get(t);e&&(e={textureInfo:e.textureInfo,refs:e.refs+1},this.cD.set(t,e))}else t.textureInfo&&this.cD.set(t.lut,{textureInfo:t.textureInfo,refs:1});return this}vr(t){if(!t)return this;let e=this.cD.get(t);return e&&(e={textureInfo:e.textureInfo,refs:e.refs-1},0===e.refs?(this.uD.deleteTexture(e.textureInfo.texture),this.cD.delete(t)):this.cD.set(t,e)),this}fD(){this.cD.forEach((t=>{this.uD.deleteTexture(t.textureInfo.texture)})),this.cD.clear()}gD(t){const e=this.cD.get(t);return e?e.refs:void 0}Jc(){return this.cD.size}}const bd=t=>new vd(t);class Md{constructor(t,e){this.hn=t,this.Y=e,this.pD=!0,this.mD=null,this.yD=null}}class Ad{constructor(t){this.SD=!1,this.xD=1,this.bD=t,this.vD={hn:u(0,0),Y:u(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),pD:!0,mD:null,yD:null},this.MD=u(64,64),this._D=new Uint8ClampedArray(this.MD.x*this.MD.y*this.xD)}AD(t,e){if(!t.pD)return null;if(t.mD&&t.yD){const i=this.AD(t.mD,e);return null!==i?i:this.AD(t.yD,e)}const i=c(t.Y.x,t.Y.y);if(t.hn.x+t.Y.x>=Number.MAX_SAFE_INTEGER&&(i.x=this.MD.x-t.hn.x-1),t.hn.y+t.Y.y>=Number.MAX_SAFE_INTEGER&&(i.y=this.MD.y-t.hn.y-1),t.Y.x===e.x&&t.Y.y===e.y)return t.pD=!1,t;if(i.xt.Y.y)),h?(s=new Md(Ke(t.hn,{x:0,y:1}),u(t.Y.x,e.y)),r=new Md(Ke(t.hn,{x:0,y:e.y+1}),u(t.Y.x,t.Y.y-1-e.y))):(s=new Md(Ke(t.hn,{x:1,y:0}),u(e.x,t.Y.y)),r=new Md(Ke(t.hn,{x:e.x+1,y:0}),u(t.Y.x-1-e.x,t.Y.y))),t.mD=s,t.yD=r,this.AD(t.mD,e)}wD(t,e){const i={kD:!1,hn:null};let s=this.AD(this.vD,e);if(null===s)for(;null===s&&this.MD.xthis.bD||t.y>this.bD)return!1;const e=new Uint8ClampedArray(t.x*t.y*this.xD);for(let i=0;i{this.iD.RD(t)})),this.DD.clear(),this}ED(t,e){const i=this.PD.get(e);if(i)return i.get(t)}zD(t,e,i){let s=this.PD.get(e);if(s||(s=new Map,this.PD.set(e,s)),s.has(t.glyph))return Dd.Success;const r=this.BD.wD(i,t.size);if(!r||!r.hn)return Dd.Fail;r.kD&&this.VD();const n=this.BD.ID(r.FD);if(!n)return Dd.Fail;let o=this.DD.get(r.FD);if(!o){const t=this.iD.gl.createTexture();if(!t)throw new at("Failed to create texture for font!");o=t,this.DD.set(r.FD,t)}const h=r.hn,a=n.MD.x,l=n.MD.y,u=-t.offsetX,c=t.baseline-t.size.y,d=-t.offsetX+t.size.x,f=t.baseline,g=h.x/a,m=(h.y+t.size.y)/l,p=(h.x+t.size.x)/a,y=h.y/l,x=[g,m,p,m,g,y,g,y,p,m,p,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.FD,texture:o};s.set(t.glyph,v);const b=this.iD.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.MD.x,n.MD.y,0,b.LUMINANCE,b.UNSIGNED_BYTE,this.iD.ND?n._D:new Uint8Array(n._D)),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.kD?Dd.Resize:Dd.Success}VD(){this.PD.forEach((t=>{t.forEach(((e,i)=>{const s=this.BD.ID(e.packerId);if(!s)return;const r=e.origin,n=s.MD.x,o=s.MD.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 Bd=t=>(e,i)=>i%2?e:e+t;class kd{constructor(t){this.GD=new Map,this.HD=ae("font"),this.WD=new Map,this.UD=new Set,this.iD=t}OD(){return this.GD.forEach((t=>t.OD())),this.UD.clear(),this}$D(t){this.UD.add(t)}YD(t){this.UD.delete(t)}XD(t,e){const i=`${e.family} - ${e.weight} - ${e.style} - ${e.variant}`;let s=this.WD.get(i);s||(s=this.HD(),this.GD.set(s,new Ed(this.iD)),this.WD.set(i,s));const r=this.GD.get(s);if(!r)throw new at("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.Kr.o=!0})),t=-1,c=0,o=0,n=0,l.clear();continue}if(a===Dd.Fail)throw new at("Failed to create glyph");if(h=r.ED(i,d),!h)throw new at("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(Bd(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=m(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 Id 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 Cd=(...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},Pd="\nfloat roundUnsigned(float number) {\n return floor(number + 0.5);\n}",Ld="\nfloat linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}",Rd="\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 ",Fd="\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}",_d="\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 }",Od=" \nint modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}",zd="\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}",Vd={"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"},Nd={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 Gd{constructor(t){this.modifiers=[],this.modifiers=t}alter(t){const e=new Gd(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},Hd=t=>e=>e.replace("void main(void)",`${t}\nvoid main(void)`),Wd=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),Yd=(...t)=>e=>{for(let e=0;ei=>{for(let t=0;t{if(!a.includes(e))throw new Error(`ShaderAfter misusage (not found: "${e}", match: "${t}", result: "${a}")`)})),a},Xd=(...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},$d=(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 Xd(`\t${r} = ${s};`)(i)},jd=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e};class Zd{constructor(t,e,i,s,r){if(this.id=t,this.shader=i,this.gl=s,this.info=r,!e||!i)throw new lt(`Could not find ${this.KD()} ${this.qD()} shader source code.`);this.gl.shaderSource(i,e),this.gl.compileShader(i)}get src(){return""}KD(){return this.id.toString()}qD(){return this.gl.getShaderParameter(this.shader,this.gl.SHADER_TYPE)===this.gl.FRAGMENT_SHADER?"fragment":"vertex"}}class Kd extends Zd{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class Jd extends Zd{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class Qd{constructor(t,e,i,s=i.createProgram()){this.JD=new Map,this.QD=new Map,this.uD=i,this.tB=s,this.iB=`${t.KD()} vertex`,this.sB=`${e.KD()} 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""}eB(t){return de(0,(()=>fe()))}hB(t){const e=this.rB(t);if(void 0===e)throw this.eB(`Could not get ${t} uniform from ${this.iB} and ${this.sB} shaders.`);return e}rB(t){const e=this.JD.get(t);if(e)return e;const i=this.uD.getUniformLocation(this.tB,t);return i?(this.JD.set(t,i),i):void 0}nB(t){const e=this.oB(t);if(void 0===e)throw this.eB(`Could not get ${t} attribute from ${this.iB} and ${this.sB} shaders.`);return e}oB(t){const e=this.QD.get(t);if(e||0===e)return e;const i=this.uD.getAttribLocation(this.tB,t);return i>=0?(this.QD.set(t,i),i):void 0}G(){this.uD.deleteProgram(this.tB)}}const tf=(t,e,i)=>()=>{t.aB=e,i&&i()};class ef{constructor(t,e){if(this.lB=0,this.uB=0,this.cB=!1,this.aB=!1,this.dB=!1,this.fB=!1,this.gB=!1,this.pB=new Set,this.mB=new Set,this.FI=e,this.uD=t,this.yB=null,this.cB=e instanceof gt.HTMLVideoElement,this.FI instanceof gt.HTMLImageElement)this.FI.addEventListener("load",(()=>{this.fB=!0,this.SB()})),this.FI.addEventListener("error",(()=>{this.gB=!0})),this.FI.complete&&(this.fB=!0,this.SB());else if(this.FI instanceof gt.HTMLVideoElement){const t=this;this.FI.addEventListener("canplay",(function(){t.uB=this.videoHeight,t.lB=this.videoWidth,t.fB=!0,t.SB()}),!0),this.FI.addEventListener("play",tf(this,!0,(()=>this.SB()))),this.FI.addEventListener("playing",tf(this,!0,(()=>this.SB()))),this.FI.addEventListener("pause",tf(this,!1)),this.FI.addEventListener("ended",tf(this,!1)),this.FI.readyState>=1&&(this.lB=this.FI.videoWidth,this.uB=this.FI.videoHeight,this.aB=!this.FI.paused,this.fB=!0,this.SB())}else this.fB=!0,this.SB()}$D(t){0===this.mB.size&&this.fB&&this.SB(),this.mB.add(t)}YD(t){this.mB.delete(t),0===this.mB.size&&this.unbindResources()}xB(t){this.pB.add(t),this.dB&&(t(),this.bB(t))}bB(t){this.pB.delete(t)}SB(){if(this.gB||this.dB||!this.fB)return;const t=this.uD.gl;if(!this.yB&&this.FI&&t){this.yB=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.yB),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.FI,o=this.lB>0?this.lB:n.width,h=this.uB>0?this.uB: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.lB=o,this.uB=h,t.bindTexture(t.TEXTURE_2D,null)}this.dB=!0,this.pB&&this.pB.forEach((t=>{t(),this.bB(t)}))}Gs(){const t=this.uD.gl;if(!this.gB&&this.dB&&this.yB){const e=0,i=t.RGBA,s=t.RGBA,r=t.UNSIGNED_BYTE,n=this.FI;n&&(t.bindTexture(t.TEXTURE_2D,this.yB),t.texImage2D(t.TEXTURE_2D,e,i,s,r,n))}}vB(){return this.yB}unbindResources(){return this.dB&&(this.yB&&(this.uD.RD(this.yB),this.yB=null),this.dB=!1),this}}class sf extends Ds{constructor(t,e,i){super(t.Li,e,i),this.dm=!0,this.am={},this.lm=y(jo),this.Lr=t,this.ct=t.ct}MB(){var t;return this.lm.o&&this.lm.M().type!==(null===(t=this._B)||void 0===t?void 0:t.type)}Sm(t){return this.dm=t,this}AB(t){return this.am=t,this}}const rf=t=>[Ud("uniform float uLookupMin","uniform float uLookupMax","uniform sampler2D uLookupTexture","uniform float uLookupTextureHeightPx"),Hd(Pd),Yd(`float texCoordY = (${t} - uLookupMin) / (uLookupMax - uLookupMin)`,"texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))")],nf=[Ud("uniform sampler2D uMaskTexture"),Ud("varying vec2 vMaskTextureCoord"),qd("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],of=[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;"),qd("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)")],hf=t=>void 0!==t.find((t=>t.idVertex&&t.idVertex.includes("3D"))),af=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:[x|y|z]/)})),lf=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:value/)})),uf=(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(${pi(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(((t,...e)=>i=>{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})("gl_Position =",...f)),s},cf=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push(qd(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push(qd(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(qd(i,...t))}}return r},df={"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:${Cd(t)}`,idFragment:void 0,apply:e=>{const i="uniform"===t?"u":"a";return{vertexShaderModifiers:[Ud(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Xd(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture;let r,n=`Color:${Cd(t)}`;const o=[],h=[];if("uniform"===i)h.push(Ud("uniform vec4 uColor"),Yd("vec4 colorFragment = uColor"),...s?nf:[]);else if("attribute"===i)r="colorAttribute",o.push($d("attribute vec4 aColor","varying vec4 vColor")),h.push(Ud("varying vec4 vColor"),Yd("vec4 colorFragment = vColor"));else if("texture"===i)r="colorTexCoord",o.push($d("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($d("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($d("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push($d(e,"varying float vLookupValue"))}h.push(Ud("varying float vLookupValue"),...rf("vLookupValue"))}else if(Array.isArray(i)&&"gradient"===i[0]){n=`Color:${Cd(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(...wt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Hd(Ld),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?nf:[]):e instanceof Z&&(n=`Color:${Cd(t)}`,h.push(Ud("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Ud(...wt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Hd(Ld),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?nf:[]))}if(!0===s){const t="maskTexture";r=r?`${r} ${t}`:`Color:${t}`,o.push($d("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:${Cd(t)}`,o=[],h=[];if(o.push("phong"===i&&$d("normal","varying vec3 vNormal"),$d("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($d("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($d("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push($d(e,"varying float vLookupValue"))}h.push(Ud("varying float vLookupValue"),Ud("uniform float uLookupMin"),Ud("uniform float uLookupMax"),Ud("uniform float uLookupTextureHeightPx"),Ud("uniform sampler2D uLookupTexture"),Hd(Pd),Yd("float texCoordY = (vLookupValue - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"))}if(s){const t="wireframe";r=r?`${r},${t}`:t,o.push($d("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),h.push(Ud("varying vec3 vTriangleBary"),Ud("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Hd(zd),qd("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&h.push(...of),{idFeature:"ColorShaded3D",idVertex:r,idFragment:n,apply:t=>({fragmentShader:"FragmentShader",vertexShaderModifiers:o,fragmentShaderModifiers:h})}},VertexLocation:t=>({idFeature:"VertexLocation",idVertex:`VertexLocation:${Cd(t)}`,idFragment:void 0,apply:e=>{const i=[],s=hf(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(...uf(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),{vertexShaderModifiers:i}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",idVertex:`LineInstanced2D:${Cd(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"),...uf(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),qd("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"),...lf(e)?[Wd("attribute float aLookupValue"),Wd("vLookupValue = aLookupValue"),Ud("attribute float aLookupValueA"),Ud("attribute float aLookupValueB"),Xd("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],...af(e)?cf(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",idVertex:`LineInstanced3D:${Cd(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"),...uf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},hf(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),qd("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"),...af(e)?cf({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"),qd("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:${Cd(t)}`,apply:r=>({fragmentShader:"FragmentShader",fragmentShaderModifiers:[Ud("uniform sampler2D uLookupTexture","uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues","uniform float uLookupMax","uniform float uLookupMin","uniform float uLookupTextureHeightPx",Pd,"ubyte"===i&&Rd),"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"})`,"float texCoordY = (intensityP - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"):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 intensity = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`),"float texCoordY = (intensity - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))")]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",idVertex:`DrawToNormalTexture:${Cd(t)}`,idFragment:`DrawToNormalTexture:${Cd(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",Pd,Od,Fd,"ubyte"===r&&Rd),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:${Cd(t)}`,idFragment:`SurfaceGrid:${Cd(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",Pd,Od,Fd,"ubyte"===a&&Rd),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(...uf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push($d("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Hd(_d),Xd("vec4 normalAxisRGB = vec4(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Xd("vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Xd("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($d("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Ud("uniform sampler2D uLookupTexture","uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform float uLookupMax","uniform float uLookupMin","uniform float uLookupTextureHeightPx","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp",Pd,"ubyte"===l&&Rd),"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"})`,"float texCoordY = (intensityP - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"):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 intensity = sample0.x","float texCoordY = (intensity - uLookupMin) / (uLookupMax - uLookupMin)","texCoordY = (roundUnsigned(clamp(texCoordY, 0.0, 1.0) * uLookupTextureHeightPx) / uLookupTextureHeightPx) * (1.0 - (1.0 / uLookupTextureHeightPx)) + (0.5 / uLookupTextureHeightPx)","vec4 colorFragment = texture2D(uLookupTexture, vec2(0.5, texCoordY))"))):(d.push($d(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Ud("varying float vLookupValue"),...rf("vLookupValue"))):void 0===e&&f.push(Yd("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&f.push(...of),n&&(d.push(Ud("attribute vec3 aTriangleBary"),$d("aTriangleBary","varying vec3 vTriangleBary")),f.push(Ud("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Hd(zd),qd("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:${Cd(t)}`,idFragment:`DebugSurfaceGridNormals:${Cd(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",Pd,Od,Fd,"ubyte"===t.heightmapTextureType&&Rd,..."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?[Hd(_d)]:[],...uf({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),qd("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:[Xd("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"),qd("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"),qd("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"),qd("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:${Cd(t)}`,idFragment:`Glow1D:${Cd(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:[$d("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"),qd("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"])]}}})};class ff{constructor(t){this.KB=[],this.iD=t}qB(t,e){((t,e,i,s)=>{const r=t.ZD(),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.wB(),l=t.kB(),u=t.CB(),c=t.TB(),d=t.IB();t.FB("disabled"),t.Sm(!1),t.PB(!1);const f=e.DB();((t,e,i)=>{const s=t.gl,r=t.ZD();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.BB(0,0,n.x,n.y),e.forEach((e=>{let i;e instanceof Es?i=e.Lr.Qg():e instanceof sf&&(i=e.Lr.Hy()),i?t.LB(i.x*r,i.y*r,i.width*r,i.height*r):t.PB(!1),e.tD(2)})),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindTexture(s.TEXTURE_2D,null),t.PB(!1)})(t,s,f);let g=f;const m=n+o+5,p=((t,e,i,s)=>{const r=(t=>{const e=[];for(let i=0;iEe(r,t)));s=t>=0?e[t]:void 0,s&&(e.splice(t,1),r=Ne(r,s))}while(s);e.push(r)}return e})(e.map((t=>{const e=t instanceof Es||t instanceof sf?t.Lr.OB(t):we;if(ge(e))return we;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?we:r})).filter((t=>!ge(t)))),n=6*r.length,o=new Float32Array(4*n);let h=0;return r.forEach((t=>{const e=ti(t.min,s),i=ti(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.RB(o),vertexCount:n}})(t,s,{left:m+(h.x<0?-h.x:0),top:m+(h.y>0?h.y:0),right:m+(h.x>0?h.x:0),bottom:m+(h.y<0?-h.y:0)},e.EB()),y=e.DB(f,g),x=t.zB(df["2D"],df.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),df.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.BB(0,0,i.sizeDpr.x,i.sizeDpr.y),t.VB(s,((h,a,l,u)=>(t.$D(s),n&&n(h),t.WB(h("uIsHighlighted"),0).UB(h("uHighlightColorOffset"),E).WB(h("uRenderEffectMask"),0).HB(h("uTexture"),e.texture,0).GB(u("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GB(h("uScale"),i.uniforms.$B()).GB(h("uDisp"),i.uniforms.YB()).GB(h("uScaling"),[i.size.x,i.size.y]).GB(h("uTranslationAxis"),[0,0]).NB(r.vertexBuffer,void 0,{location:a("aPos"),size:2},{location:a("aTextureCoord"),size:2}).Op(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,p,((e,i,s,r)=>(t.GB(e("uOffsetPx"),[h.x,h.y]),!0))),g=y,t.PB(l),t.XB(d);const S=t.zB(df["2D"],df.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),df.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.Li.Et().x,y:t.Li.Et().y};t.BB(0,0,o.x*t.ZD(),o.y*t.ZD());const h=st.d2({scaleXYConstructor:Ti}).q(o).fi(0,o.x).gi(0,o.y),a=new pf;a.jB(h),t.VB(i,((h,l,u,c)=>(t.$D(i),r&&r(h),t.WB(h("uIsHighlighted"),0).UB(h("uHighlightColorOffset"),E).WB(h("uRenderEffectMask"),0).HB(h("uTexture"),e.texture,0).GB(c("uTextureSize"),[e.sizeDpr.x,e.sizeDpr.y]).GB(h("uScale"),a.$B()).GB(h("uDisp"),a.YB()).GB(h("uScaling"),[o.x,o.y]).GB(h("uTranslationAxis"),[0,0]).NB(s.vertexBuffer,void 0,{location:l("aPos"),size:2},{location:l("aTextureCoord"),size:2}).Op(n.TRIANGLES,s.vertexCount,0),!0)))})(t,f,S,p,((e,s,r,n)=>(t.HB(e("uTextureFirstGlowPass"),y.texture,1).UB(e("uGlowColor"),i.color),!0))),t.BB(a.x,a.y,a.width,a.height),t.FB(u),t.Sm(c),t.ZB(p.vertexBuffer)})(this.iD,this,e,t)}EB(){const t=this.iD.Li.Et();return{x:Math.ceil(t.x),y:Math.ceil(t.y)}}DB(...t){const e=this.KB,i=this.EB(),s={x:Math.ceil(i.x*this.iD.ZD()),y:Math.ceil(i.y*this.iD.ZD())},r=this.iD.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).fi(0,i.x).gi(0,i.y),n.uniforms.jB(n.scale)),n;const o=r.createTexture(),h=this.iD.JB(),a=this.iD.QB();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).fi(0,i.x).gi(0,i.y),u=new pf;u.jB(l);const c={size:i,sizeDpr:s,texture:o,frameBuffer:h,depthBuffer:a,scale:l,uniforms:u};return e.push(c),c}G(){[this.KB].forEach((t=>{t.forEach((t=>{this.iD.tL(t.depthBuffer),this.iD.iL(t.frameBuffer),this.iD.RD(t.texture)})),t.length=0}))}}class gf{constructor(t,i,s,r,n=!0){this.sL=new Sd,this.eL=new Map,this.hL=new Map,this.rL=[],this.nL=1,this.IS_MACHINE_LITTLE_ENDIAN=(()=>{const t=new Uint32Array([287454020]),e=new Uint8Array(t.buffer);return 68===e[0]||17!==e[0]&&(gt.console.error("Unidentified machine endianness. Some features might behave unexpectedly."),!0)})(),this.dm=!1,this.GB=(t,[e,i])=>(void 0===t||this.gl.uniform2f(t,e,i),this),this.oL=(t,[e,i])=>(void 0===t||this.gl.uniform2i(t,e,i),this),this.aL=(t,[e,i,s,r])=>(void 0===t||this.gl.uniform4f(t,e,i,s,r),this),this.lL=(t,[e,i,s])=>(void 0===t||this.gl.uniform3f(t,e,i,s),this),this.uL=(t,e)=>(void 0===t||this.gl.uniformMatrix3fv(t,!1,e),this),this.cL=(t,e)=>(void 0===t||this.gl.uniformMatrix4fv(t,!1,e),this),this.UB=(t,e)=>(void 0===t||this.gl.uniform4f(t,e.r,e.g,e.b,e.a),this),this.WB=(t,e)=>(void 0===t||this.gl.uniform1f(t,e),this),this.dL=(t,e)=>(this.gl.uniform1i(t,e),this),this.HB=(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 at("Could not bind a texture.")},this.fL=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.RB=(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 at("Could not create vertex buffer")},this.gL=(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 at("Could not create vertex buffer")},this.pL=(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.mL=(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.yL=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 at("Could not create vertex buffer")},this.SL=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 at("Could not create float buffer")},this.xL=(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.bL=(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.NB=(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.vL(s,e)}return this},this.ML=(...t)=>{const e=t.length;for(let i=0;i-1&&this.gl.disableVertexAttribArray(e)}return this},this._L=(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.AL=(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.wL=t=>(this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t),this),this.Op=(t,e,i=0)=>(e>0&&this.gl.drawArrays(t,i,e),this),this.kL=(t,e=this.gl.TRIANGLES,i=0,s=this.gl.UNSIGNED_SHORT)=>(t>0&&this.gl.drawElements(e,t,s,i),this),this.CL=(t,e,i,s)=>{if(s>0&&(this.gl2&&this.gl2.ctx.drawArraysInstanced(t,e,i,s),this.gl1)){if(!this.gl1.TL.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.TL.ANGLE_instanced_arrays.drawArraysInstancedANGLE(t,e,i,s)}return this},this.IL=(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.TL.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.TL.ANGLE_instanced_arrays.drawElementsInstancedANGLE(t,e,r,i,s)}return this},this.vL=(t,e)=>{if(t>-1&&(this.gl2&&this.gl2.ctx.vertexAttribDivisor(t,e),this.gl1)){if(!this.gl1.TL.ANGLE_instanced_arrays)return gt.console.warn("The browser does not support REQUIRED WebGL 1 extension: ANGLE_instanced_arrays.\nThis application will NOT work properly!"),this;this.gl1.TL.ANGLE_instanced_arrays.vertexAttribDivisorANGLE(t,e)}return this},this.FL=(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.kB();n&&this.PB(!1),t(),n&&this.PB(!0),this.gl.bindTexture(this.gl.TEXTURE_2D,null),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,null)},this.PL=(t,e,i)=>{const s=gt.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.qn=()=>(this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.gl.clear(this.gl.DEPTH_BUFFER_BIT),this),this.DL=t=>(this.gl.clearColor(t.r,t.g,t.b,t.a),this),this.$D=t=>(this.gl.useProgram(t.tB),this),this.BL=!1,this.LL=[],this.Li=t,this.ef=i,this.Li=t,this.gl=s.ctx,this.OL=s.antialias,this.RL=s.lineAntialias,n&&(this.XB(!0),this.EL());const o=[];if(this.TL={WEBGL_lose_context:this.gl.getExtension("WEBGL_lose_context")},Object.keys(this.TL).forEach((t=>{null===this.TL[t]&&o.push(t)})),"webgl2"===s.type)this.gl2={ctx:s.ctx},this.zL=!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.RL=!1),Object.keys(t).forEach((e=>{null===t[e]&&o.push(e)}));const e={OES_texture_float:this.gl.getExtension("OES_texture_float")};this.zL=!!e.OES_texture_float,this.gl1={ctx:s.ctx,TL:t,optional:e}}this.rL=o,this.LD=this.gl.getParameter(this.gl.MAX_TEXTURE_SIZE),this.ND=this.VL(),this.zB=(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,m,p,y,x;try{const t=gt.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",m=S.vertexShaderSrc,p=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 Id(`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 Id(`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 Id("No vertex shader template defined",s);if(!u)throw new Id("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)m=b.src,f="existing";else{f="new";const t=new Gd(c.vertexShader.modifiers).build(Vd[c.vertexShader.template]),{source:s,info:r}=o(t,"vertex");m=s,y=r,b=new Kd(v,s,e,r),i.set(v,b),n.vertexShaders+=1}const M=c.fragmentShader;let A;const w=M.id;if(A=s.get(w),A)p=A.src,g="existing";else{g="new";const t=Nd[M.template],i=new Gd([...M.modifiers]).build(t),{source:r,info:h}=o(i,"fragment",c.hints);p=r,x=h,A=new Jd(w,r,e,h),s.set(w,A),n.fragmentShaders+=1}const D=new Qd(b,A,e);return r.set(u.programID,D),n.programs+=1,n.totalMs+=gt.performance.now()-t,D}catch(t){throw de(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 gt.alert(t),new Error(t)}))}}})(this),this.NL=bd(this.gl),this.GL=new xf(this),this.jD=(t=>{const e=gt.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new at("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,m=0;const p=f.width;for(let t=0;t=0;t-=1){for(let e=0;e=t)return this.eO.buffer;this.eO&&(this.ZB(this.eO.buffer),this.eO=void 0);const e=t,i=new Float32Array(e);for(let t=0;ta)).catch((t=>{throw t})).finally((()=>{t.deleteBuffer(l),this.LL.splice(this.LL.indexOf(l),1)}))}lO(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)}}const mf=async(t,e,i,s,r,n,o)=>{const h=t.fenceSync(t.SYNC_GPU_COMMANDS_COMPLETE,0);return t.flush(),((t,e,i)=>{const s=void 0!==i.flags?i.flags:0,r=void 0!==i.retryTimeout?i.retryTimeout:10;return new Promise(((i,n)=>{const o=()=>{const h=t.clientWaitSync(e,s,0);return h===t.WAIT_FAILED?n(new Error(`WebGL Sync WAIT_FAILED ${t.getError()}`)):h!==t.TIMEOUT_EXPIRED?i(void 0):void gt.setTimeout(o,r)};gt.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 pf{jB(t){if(t instanceof Ti||t instanceof Ga){const e=t.jt();this.uO=e.x.scaling,this.cO=-e.x.displacement,this.dO=e.y.scaling,this.fO=-e.y.displacement,this.gO=e.x.highPrecisionOffset,this.pO=e.x.highPrecisionOffset-Math.fround(e.x.highPrecisionOffset),this.mO=e.y.highPrecisionOffset,this.yO=e.y.highPrecisionOffset-Math.fround(e.y.highPrecisionOffset)}else t instanceof Ei&&(this.MixedScaleXY=t.jt());return this}YB(){return[this.cO,this.fO]}$B(){return[this.uO,this.dO]}SO(){return[this.gO,this.mO]}xO(){return[this.pO,this.yO]}}class yf{constructor(){this.uO=0,this.dO=0,this.bO=0,this.cO=0,this.fO=0,this.vO=0}MO(t){return this.uO=t.st(),this.cO=t.getInnerStart()+.5*this.uO*t.et(),this}_O(t){return this.dO=t.st(),this.fO=t.getInnerStart()+.5*this.dO*t.et(),this}AO(t){return this.bO=t.st(),this.vO=t.getInnerStart()+.5*this.bO*t.et(),this}$B(){return[this.uO,this.dO,this.bO]}YB(){return[this.cO,this.fO,this.vO]}wO(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=yd.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class xf{constructor(t){this.iD=t}tD(t,e,i,s,r,n=0){const o=this.iD,h=void 0===s;if(!(s=s||o.JB()))throw new at("Could not bind a framebuffer.");const a=o.wB(),l=o.IB();o.XB(!1),o.FL((()=>{o.BB(0,0,i.x,i.y),t()}),s,e,n),h&&o.iL(s),this.iD.DL(r),this.iD.BB(a.x,a.y,a.width,a.height),o.XB(l)}}class Sf{constructor(t,e){this.kO=[],this.CO=[],this.uniform=t=>{const e=this.shader.hB(t);return this.CO.push({name:t,optional:!1}),e},this.uniformOptional=t=>{const e=this.shader.rB(t);return this.CO.push({name:t,optional:!0}),e},this.attribute=t=>{const e=this.shader.nB(t);return this.kO.push({name:t,location:e}),e},this.glUtils=t,this.shader=e}finish(t){for(const t of this.kO)this.glUtils.ML(t.location),this.glUtils.vL(t.location,0)}}class vf extends Es{constructor(t,e,i,s,r){super(t,e,i,s),this.TO=new Map,this.IO=t,this.FO=e,this.iD=t.PO(),this.DO=r,this.FO=e}OD(){return this}tD(t){if(!this.DO||0!==t||0===this.TO.size)return this;const e=Array.from(this.TO.values()).map((t=>t.BO.filter((t=>t.LO)).map((t=>t.de)).flat().filter((t=>void 0!==t)).filter((t=>t.getVisible())))).flat();if(0===e.length)return this;const i=this.DO;return this.iD.HL.qB(e,i),this}Gs(){return this}yt(){return 0}ft(){return 0}xt(){return 0}St(){return 0}co(){return 0}do(){return 0}su(t,e){const i={BO:[]},s=(t,e)=>{const s={de:t||[],LO:void 0===e||e};i.BO.push(s);const r={nc:t=>(s.de=t,r),vs:t=>(s.LO=t,r),_s:()=>s.LO};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={lg:s,...r};this.TO.set(t,i);const o=t.onDispose((()=>{this.TO.delete(t),t.offDispose(o)}));return n}}const bf=t=>{if(t instanceof Ti||t instanceof Ga)return t.Qt()?"linear-highPrecision":"linear";if(t instanceof Ei){const e={};return t.x instanceof gi&&(e.x={base:t.x.$t()}),t.y instanceof gi&&(e.y={base:t.y.$t()}),["logarithmic",e]}return"linear"};function Mf(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,m=d*s.y,p=c-g,y=d-m,x=g>p?[p,g]:[g,p],S=m>y?[y,m]:[m,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 Af(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 wf=(t,e,i)=>((t,e,i,s)=>{const r=[];let n=0;const o=Ze(e,i/2);let h,a,l,c,d=t[t.length-1],f=0;for(let i=0;i0&&(d=t[i-1]),mt(h,d)&&(d=Ke(h,Xe(Ze(Je(a,h),-1)))),mt(h,a)&&(a=Ke(h,Xe(Ze(Je(d,h),-1))));const s=ti(d,e),g=ti(h,e),m=ti(a,e),p=Xe(Je(g,s)),y=Xe(Je(m,g)),x=Ke(p,y),S=u(-x.y,x.x),v=u(-p.y,p.x),b=1/ii(S,v),M=je(S),A=Xe(Je(p,y)),w=Math.sign(ii(S,A))||1,D=Qe(S,Ze(o,b)),T=Qe(S,Ze(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(ii(p,S))||w,g=Qe(v,Ze(o,c)),m=Qe(l,Ze(o,c));1===w?(t=g,e=T,i=m,s=T):(t=D,e=g,i=D,s=m);const x=4*Le(d,h),M=4*Le(h,a);(b>x||b>M)&&(1===w?(t=g,e=m,i=m,s=g):(t=m,e=g,i=g,s=m));const A=Ke(h,t),E=Ke(h,e),B=Ke(h,i),k=Ke(h,s);r[n]=A,n+=1,r[n]=E,n+=1,r[n]=B,n+=1,r[n]=k,n+=1,f=4}else{const t=Ke(h,D),e=Ke(h,T);r[n]=t,n+=1,r[n]=e,n+=1,f=2}c=l,l=t[i]}return r[n]=r[0],n+=1,r[n]=r[1],n+=1,[r,f,[c,l]]})(t,e,i)[0];class Df extends Hs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.OO=we,this.RO=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO()}VO(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?al(this.qr.M(),this.Bo.M(),this.hi.M(),this.Lo.M()*l/100,this.Oo.M()*l/100,a)[0]:[this.qr.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.zo=u(t,e)}else{const t=Math.floor(d/2);this.zo=u(h[t].x,h[t].y)}this.Vo=h[1];const f=h.length-1;this.No=h[f],this.Ro.M()&&(h.shift(),c.shift());let g=!1;(this.qr.o||this.Bo.o||this.hi.o||this.Lo.o||this.Oo.o||this.Ro.o||this.Eo.o||s)&&(this.RO=m(u(this.xn().x-n,this.xn().y-o),u(this.xn().x+n,this.xn().y+o)),g=!0,this.qr.o=!1,this.Bo.o=!1,this.hi.o=!1,this.Lo.o=!1,this.Oo.o=!1,this.Ro.o=!1,this.Eo.o=!1);const p=this.Nr();(g||p)&&this.Vr!==F&&(this.Ro.M()?(this.GO&&this.iD.gl.deleteBuffer(this.GO),[this.HO,this.GO,this.WO,this.UO]=this.VO(h,c)):(this.GO&&this.iD.gl.deleteBuffer(this.GO),[this.HO,this.GO,this.WO,this.UO]=this.VO(h,void 0)),this.Vr instanceof $?this.$O=Mf(this.RO,this.ct,this.Vr.getPosition(),this.Vr.getExtent(),this.Vr.getShape(),this.iD.ZD()):this.Vr instanceof Z?this.YO=Af(this.RO,this.ct,this.Vr.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0));const y=this.Vr instanceof z&&this.Vr,x=this.Vr instanceof Z&&this.Vr,S=this.Vr instanceof $&&this.Vr,v=y||x||S;p&&(this.XO=v?this.iD.zB(df["2D"],df.Color({dataType:this.Vr instanceof $||this.Vr instanceof Z?["gradient",this.Vr]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.Ur(this.Vr));const b=this.$r;if(b instanceof tt&&(g||this.jr(b.getThickness())||s)){this.Ro.M()?360===i?(h.pop(),c.pop(),[this.jO,this.ZO]=this.NO(h,void 0,b.getThickness(),r),this.KO&&this.jO?this.iD.mL(this.KO,this.jO,!0):!this.KO&&this.jO?this.KO=this.iD.RB(this.jO,!0):this.KO&&!this.jO&&(this.iD.ZB(this.KO),this.KO=void 0),[this.qO,this.JO]=this.NO(c,void 0,b.getThickness(),r),this.QO&&this.qO?this.iD.mL(this.QO,this.qO,!0):!this.QO&&this.qO?this.QO=this.iD.RB(this.qO,!0):this.QO&&!this.qO&&(this.iD.ZB(this.QO),this.QO=void 0)):([this.jO,this.ZO]=this.NO(h,c,b.getThickness(),r),this.KO&&this.jO?this.iD.mL(this.KO,this.jO,!0):!this.KO&&this.jO?this.KO=this.iD.RB(this.jO,!0):this.KO&&!this.jO&&(this.iD.ZB(this.KO),this.KO=void 0),this.qO&&(this.QO&&this.iD.gl.deleteBuffer(this.QO),this.QO=void 0,this.JO=0)):(360===i&&(h.shift(),h.pop()),[this.jO,this.ZO]=this.NO(h,void 0,b.getThickness(),r),this.KO&&this.jO?this.iD.mL(this.KO,this.jO,!0):!this.KO&&this.jO?this.KO=this.iD.RB(this.jO,!0):this.KO&&!this.jO&&(this.iD.ZB(this.KO),this.KO=void 0));const t=b.getFillStyle();t instanceof $?this.tR=Mf(this.RO,this.ct,t.getPosition(),t.getExtent(),t.getShape(),this.iD.ZD()):t instanceof Z?this.iR=Af(this.RO,this.ct,t.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.sR=t===F?void 0:this.iD.zB(df["2D"],df.Color({dataType:t instanceof $||t instanceof Z?["gradient",t]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),this.Zr(b)}if(g){let t=1,e=1;b instanceof tt&&(t=b.getThickness()*r.x,e=b.getThickness()*r.y),this.OO=m(u(this.RO.min.x-t,this.RO.min.y-e),u(this.RO.max.x+t,this.RO.max.y+e))}this.eR=e&&v?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.hR=e&&this.$r!==J?this.hR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}return this}tD(t){if(this.Wr()){const e=1===t?this.eR:this.XO,i=this.Vr,s=this.GO;e&&s&&this.iD.$D(e).VB(e,((e,r,n,o)=>{if(this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(o("uScaleStart_highpart"),this.JD.SO()).GB(o("uScaleStart_lowpart"),this.JD.xO()).tO(n,s,this.ct.Qt(),void 0).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),1===t)this.iD.UB(e("uColor"),this.zO);else if(i instanceof z)this.iD.UB(e("uColor"),i.getColor());else if(i instanceof $){if(!this.$O)return!1;this.iD.KL(n,this.$O,i)}else if(i instanceof Z){if(!this.YO)return!1;this.iD.qL(n,this.YO,i)}return this.iD.Op(this.UO,this.WO),!0}));const r=this.$r;r instanceof tt&&(void 0!==this.KO&&this.rR(t,this.KO,this.ZO,r),void 0!==this.QO&&this.rR(t,this.QO,this.JO,r))}return this}rR(t,e,i,s){const r=1===t?this.hR:this.sR,n=s.getFillStyle();r&&this.iD.$D(r).VB(r,((r,o,h,a)=>{if(this.iD.GB(r("uScale"),this.JD.$B()).GB(r("uDisp"),this.JD.YB()).tO(h,e,this.ct.Qt(),void 0).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),1===t)this.iD.UB(r("uColor"),this.zO);else if(n instanceof z)this.iD.UB(r("uColor"),n.getColor());else if(n instanceof $){if(!this.tR)return!1;this.iD.KL(h,this.tR,n)}else if(n instanceof Z){if(!this.iR)return!1;this.iD.qL(h,this.iR,n)}const l=s.getThickness(),u=-1===l||1===l;return this.iD.Op(u?this.iD.gl.LINE_LOOP:this.iD.gl.TRIANGLE_STRIP,i),!0}))}OD(){return this.nR&&(this.iD.ZB(this.nR),this.nR=void 0),this.oR&&(this.iD.ZB(this.oR),this.oR=void 0),this.GO&&(this.iD.ZB(this.GO),this.GO=void 0),this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),this.QO&&(this.iD.ZB(this.QO),this.QO=void 0),this.XO=void 0,this.sR=void 0,this.eR=void 0,this.hR=void 0,this}yt(){return this.RO.max.x}ft(){return this.RO.min.x}xt(){return this.RO.max.y}St(){return this.RO.min.y}co(){return Se(this.$r)}do(){return Se(this.$r)}}class Tf{constructor(){this.first=0,this.second=1,this.third=2,this.fourth=3,this.fifth=4,this.sixth=5}aR(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}lR(){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}uR(){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}cR(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.lR(),this}dR(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.uR(),this}fR(t,e){e.next=!0,6*t>=e.buffer.length&&(e.buffer=Array(6*t));for(let i=0;i(new Tf).aR(t))(),Bf=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||Ef.lR(),n.push(t,e),r.push(Ef.first,Ef.second,Ef.third),h=void 0,o=void 0,r.push(Ef.third,Ef.fourth,Ef.second),a=Ef.third,Ef.uR(),l&&n.push(i,s),[o,h,a]),kf=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||Ef.lR(),o.push(t,e),r.push(Ef.first,Ef.second,Ef.third);const c=ui(t,i,e,s);return a=void 0,void 0!==c&&(void 0===a&&(a=c),o.push(a),n.push(Ef.third,Ef.fourth,Ef.fifth),l=Ef.fourth),Ef.uR(),u&&o.push(i,s),[h,a,l]},If=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||Ef.lR(),r.push(t,e),s.push(Ef.first,Ef.second,Ef.third),n=i,o=void 0,h=Ef.third,l?r.push(i):a=!0,[n,o,h,a]),Cf=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||Ef.lR(),Ef.lR()):a>0&&(Ef.lR(),u>0&&(u-=1)),n.push(t),r.push(Ef.first,Ef.second,Ef.third),a=Ef.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Pf=(t,e=0)=>{Ef.aR(e);const[i,s]=t,r=i.length,n=[],o=[],h=[];let a,l,u=e,c=0,d=i[c],f=s[c],g=i[c],m=s[c],p=!1,y=u>0?g.y!==m.y?2:1:0;if(r>1)for(;cm.y?d.y>f.y?[a,l,u]=Bf(g,m,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=kf(g,m,d,f,o,n,h,a,l,u,t):[a,l,u,p]=If(g,m,d,o,h,a,l,u,p,t):d.y===f.y?(a=g,p&&(h.push(g),p=!1,Ef.lR()),0===h.length&&u>0&&y>0&&(y-=1)):d.y>f.y?[a,l,u,y]=Cf(g,0,d,f,n,h,a,l,u,t,y):[a,l,u,y]=Cf(g,0,d,f,o,h,a,l,u,t,y)}return[h,new Uint16Array(n),new Uint16Array(o),u,y]};class Lf extends Us{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.pR=0,this.Pn=Array(),this.mR=0,this.yR=new Uint16Array(0),this.SR=new Uint16Array(0),this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO()}Gs(){const t=this.Hr(),e=this.pr.M(),i=this.Hn;if(this.Wr()){this.JD.jB(this.ct);const s=this.ct instanceof Ei==0,r=s?this.ct.yi():void 0,n=this.Ao(),o=this.ct.pi()||t,h=i||this.mo.o||o&&"disabled"!==n.type;if(h){if(this.pR=0,this.yR=new Uint16Array(0),this.SR=new Uint16Array(0),this.Pn.length=0,this.mR=0,this.yo>1){const[t,e,i,o]=Pf([s?n.packager(this.fo,r,.5):this.fo,s?n.packager(this.po,r,.5):this.po]);this.pR=o,this.yR=e,this.SR=i,this.Pn=t,this.mR=t.length}this.mo.o=!1}if(this.xo&&this.zn[0].length>1){const[t,e]=this.zn,i=t.length,[o,h,a,l,u]=Pf([s?n.packager(t,r,.5):t,s?n.packager(e,r,.5):e],this.pR);this.pR=l;const c=o.length;for(let t=u;t0||this.yo>0?1:u;s{if(this.iD.xL(n("aPos"),e).wL(r).WB(s("uIsHighlighted"),1===t||2===t?0:this.br).UB(s("uHighlightColorOffset"),this.Ar).WB(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(s("uScale"),this.JD.$B()).GB(s("uDisp"),this.JD.YB()):this.ct instanceof Ei&&this.iD.GB(h("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(h("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(h("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(h("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(s("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(s("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(s("uColor"),this.zO);else if(i instanceof z)this.iD.UB(s("uColor"),i.getColor());else if(i instanceof $){if(!this.kR)return!1;this.iD.KL(o,this.kR,i)}else if(i instanceof Z){if(!this.CR)return!1;this.iD.qL(o,this.CR,i)}else i instanceof G&&this.AR&&this.iD.HB(s("uLookupTexture"),this.AR.texture,0).WB(s("uLookupMin"),i.lut.min).WB(s("uLookupMax"),i.lut.max).WB(s("uLookupTextureHeightPx"),this.AR.textureHeight);return this.iD.kL(this.DR),!0}))}const r=1===t?this.eR:this.xR;if(r&&this.TR&&this.IR){const i=this.TR,s=this.IR;this.iD.$D(r).VB(r,((r,n,o,h)=>{if(this.iD.xL(n("aPos"),i).wL(s).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(r("uScale"),this.JD.$B()).GB(r("uDisp"),this.JD.YB()):this.ct instanceof Ei&&this.iD.GB(h("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(h("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(h("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(h("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(r("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(r("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(r("uColor"),this.zO);else if(e instanceof z)this.iD.UB(r("uColor"),e.getColor());else if(e instanceof $){if(!this.$O)return!1;this.iD.KL(o,this.$O,e)}else if(e instanceof Z){if(!this.YO)return!1;this.iD.qL(o,this.YO,e)}else e instanceof G&&this.bR&&this.iD.HB(r("uLookupTexture"),this.bR.texture,0).WB(r("uLookupMin"),e.lut.min).WB(r("uLookupMax"),e.lut.max).WB(r("uLookupTextureHeightPx"),this.bR.textureHeight);return this.iD.kL(this.FR),!0}))}}return this}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}Sb(t){this.Qn()>0&&this.Gs();const[e,i]=this.$n(),s=e.length>2&&e[1].x0&&this.Gs();const[e,i]=this.$n(),s=e.length;if(0===s)return;const r=this.vo?1:0,n=s-(this.Mo?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.BR;s+=1){const r=i-s*Math.PI/this.BR;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.sL.rD.get(e);return i||(i=new Rf(t,e),t.sL.rD.set(e,i),i)})(t,e>=50?8:e>=20?6:e>=7?4:e>=4?3:1===e?1:2),_f=(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.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+2)*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(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.vL(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.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,r*Float32Array.BYTES_PER_ELEMENT,(n+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i)}},Of=(t,e,i,s,r,n,o)=>{const h=t.PO(),{uniform:a,uniformOptional:l}=i,u=1/t.Mh.Dh,c=(r?Math.max(n,u):Math.max(n,0))+1;h.WB(a("uThicknessPixels"),c).WB(l("uAALimit"),1-(c-1)/c).GB(a("uRatioPxClip"),[2/t.Et().x,2/t.Et().y]),e.$D(i,s).Op(o)};class zf extends qs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.Rn=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.VR=this.iD.RL}Gs(){const t=this.Yr(),e=this.sa,i=e instanceof tt&&e,s=i&&i.getFillStyle(),r=s instanceof z&&s,n=s instanceof Z&&s,o=s instanceof $&&s,h=s instanceof G&&s,a=i,l=r||n||o||h&&["x","y"].includes(h.getLookUpProperty())&&h,c=this.ri(),d=this.ei(),f=this.pr.M(),g=this.pr.o,p=e.getThickness();if(this.JD.jB(this.ct),this.aa&&(this.NR&&this.iD.gl.deleteBuffer(this.NR),this.NR=this.iD.RB($t([c,d],this.ct.Qt())),this.Rn=m(u(c.x,c.y),u(d.x,d.y))),t||g){const t=this.Wr()&&a&&l&&a.getThickness()>0,e=n?["gradient",n]:o?["gradient",o]:h?["lookup",h.getLookUpProperty()]:"uniform";if(this.GR=t?{type:"triangulated",shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0}),this.VR?df.AliasedEdge():void 0),mousePickingShader:f?this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,geometry:Ff(this.iD,p),lineStyle:i,fillStyleSolid:r,fillStyleLinearGradient:n,fillStyleRadialGradient:o,fillStylePaletted:h}:void 0,h){if(h&&h.lut.isValid){const t=h.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}}else this.IO.NL.vr(this.WR),this.WR=void 0;this.eR=f&&t?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}return s instanceof $?this.tR=Mf(ks(this.Rn,{x:this.co(),y:this.do()},this.ct),this.ct,s.getPosition(),s.getExtent(),s.getShape(),this.iD.ZD()):s instanceof Z?this.iR=Af(ks(this.Rn,{x:this.co(),y:this.do()},this.ct),this.ct,s.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.oa(e),this.aa=!1,this.pr.o=!1,this}tD(t){var e;const i=1===t?this.eR:null===(e=this.GR)||void 0===e?void 0:e.shader;if(!i)return this;const s=this.NR;if(!s)return this;const r=this.GR;if(!r)return this;const{fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a,lineStyle:l}=r;return this.iD.$D(i).VB(i,((e,i,u,c)=>{if(this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(c("uScaleStart_highpart"),this.JD.SO()).GB(c("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(c("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(c("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(c("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(c("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(e("uColor"),this.zO);else if(n)this.iD.UB(e("uColor"),n.getColor());else if(h){if(!this.tR)return!1;this.iD.KL(u,this.tR,h)}else if(o){if(!this.iR)return!1;this.iD.qL(u,this.iR,o)}else if(a){if(!this.HR)return!1;this.iD.HB(e("uLookupTexture"),this.HR.texture,0).WB(e("uLookupMin"),a.lut.min).WB(e("uLookupMax"),a.lut.max).WB(e("uLookupTextureHeightPx"),this.HR.textureHeight)}return _f(this.ct.Qt(),this.iD,s,u,this.ct.Qt()?4:2,0),Of(this.IO,r.geometry,u,this.VR&&1!==t,1===t,l.getThickness(),1),!0})),this}dispose(){return super.dispose(),this.WR&&(this.IO.NL.vr(this.WR),this.WR=void 0),this.HR=void 0,this.GR=void 0,this.NR&&(this.iD.ZB(this.NR),this.NR=void 0),this}OD(){return this}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return Se(this.sa)}do(){return Se(this.sa)}}class Vf extends Xs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.Rn=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.VR=this.iD.RL,this.UR=t.Mh.Lh}Gs(){const t=this.Yr(),e=this.sa,i=this.ua,s=e instanceof tt&&e,r=s&&s.getFillStyle(),n=r instanceof z&&r,o=s,h=n,a=e.getThickness()>=0?e.getThickness():1;if(this.JD.jB(this.ct),this.aa&&(this.NR&&(this.iD.ZB(this.NR),this.NR=void 0),this.NR=this.iD.RB($t(i,this.ct.Qt())),this.Rn=ze(i)),t){const t=o&&h&&0!==a,e="uniform";this.GR=t?{type:"triangulated",shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0,snapToNearestPixel:this.UR}),this.VR?df.AliasedEdge():void 0),geometry:Ff(this.iD,a),lineStyle:s,fillStyleSolid:n}:void 0}return this.oa(e),this.aa=!1,this}tD(t){if(1===t)return this;const e=this.NR;if(!e)return this;const i=this.GR;if(!i)return this;const{fillStyleSolid:s,lineStyle:r,shader:n,geometry:o}=i;return this.iD.$D(n).VB(n,((i,n,h,a)=>(this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).GB(a("uScaleStart_highpart"),this.JD.SO()).GB(a("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(a("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(a("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(a("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(a("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(i("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(i("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),this.UR&&this.iD.GB(a("uViewportSizePx"),[this.Li.Et().x*this.iD.ZD(),this.Li.Et().y*this.iD.ZD()]),this.iD.UB(i("uColor"),s.getColor()).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),((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"),n=o("aLocationB_lowpart");h.vertexAttribPointer(t,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),e.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,2*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i),h.vertexAttribPointer(s,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(0+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(s,1),h.enableVertexAttribArray(s),h.vertexAttribPointer(n,2,h.FLOAT,!1,4*r*Float32Array.BYTES_PER_ELEMENT,(0+r+2)*Float32Array.BYTES_PER_ELEMENT),e.vL(n,1),h.enableVertexAttribArray(n)}else{const t=o("aLocationA"),i=o("aLocationB");h.vertexAttribPointer(t,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,0*Float32Array.BYTES_PER_ELEMENT),e.vL(t,1),h.enableVertexAttribArray(t),h.vertexAttribPointer(i,2,h.FLOAT,!1,2*r*Float32Array.BYTES_PER_ELEMENT,(0+r)*Float32Array.BYTES_PER_ELEMENT),e.vL(i,1),h.enableVertexAttribArray(i)}})(this.ct.Qt(),this.iD,e,h,this.ct.Qt()?4:2),Of(this.IO,o,h,this.VR,!1,r.getThickness(),this.ua.length/2),!0))),this}OD(){return this.NR&&(this.iD.ZB(this.NR),this.NR=void 0),this.GR=void 0,this}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return Se(this.sa)}do(){return Se(this.sa)}}class Nf{constructor(t,e){this.$R=!1,this.YR=!1,this.XR=!1,this.ct=t,this.jR=e,this.jR.kr("DataPattern",(t=>{"ProgressiveX"!==t.pattern&&"RegressiveX"!==t.pattern||(this.$R="x"),"ProgressiveY"!==t.pattern&&"RegressiveY"!==t.pattern||(this.$R="y"),"RegressiveX"!==t.pattern&&"RegressiveY"!==t.pattern||(this.YR=!0),!0===t.regularProgressiveStep&&(this.XR=!0)}))}calculateUserDataPointsProgressiveRange(t){if(0===t.length)throw new Error("calculateUserDataPointsProgressiveRange called with 0 data points");return{start:"x"===this.$R?t[0].x:t[0].y,end:"x"===this.$R?t[t.length-1].x:t[t.length-1].y}}calculateUserDataPointsBoundaries(t){return this.$R?"x"===this.$R?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.ZR=!0)}))}QR(t,e=!1){if(this.ZR||!this.$R||"linear"!==this.JR.type)return!1;!1===e&&this.tE&&(clearTimeout(this.tE),this.tE=void 0);const i="x"===this.$R?this.JR.scale.x.jf:this.JR.scale.y.jf;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.$R?r.x:r.y,"x"===this.$R?n.x:n.y,s),h=this.JR.scale,a=Math.abs("x"===this.$R?h.yi().x:h.yi().y),l=a/o,u=Math.floor(l*Gf),c=u*o,d=gt.performance.now(),f=!(d-i.Wi<500)&&(i.Ei?d-i.Hi<1e3:d-i.zi<2e3||i.Ni),g=s>2*this.KR.totalDataPointsAtTime;if(f&&!g)return this.tE=setTimeout((()=>this.iE(t)),1e3),!1;const m=u>=10,p=this.KR.enabled?this.KR.columnWidthAxis/a<1.5:void 0,y=this.KR.enabled&&u>this.KR.dataPointsPerColumn?u/this.KR.dataPointsPerColumn>=2:void 0;let x;!0===this.KR.enabled?p?y&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}):x=m?{enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s}:{enabled:!1,totalDataPointsAtTime:s}:m&&(x={enabled:!0,columnWidthAxis:c,dataPointsPerColumn:u,totalDataPointsAtTime:s});const S=!1===e;return x?(S&&(this.KR=x),!0):(S&&(this.KR={...this.KR,totalDataPointsAtTime:s}),!1)}AS(){this.sE=void 0,this.qR.length=0,this.tE&&(clearTimeout(this.tE),this.tE=void 0)}eE(t){if(0===t.length)return t;if(this.ZR||!this.$R||"linear"!==this.JR.type||!this.KR.enabled)return t;let e;e=this.qR.length>0?ie(this.qR,t,{canReturnB:!0}):t;const i=e.length,s=[];let r,n,o=void 0===this.sE,h=-1,a=-1,l=0,u=0;if("x"!==this.$R||this.YR)if("x"===this.$R&&this.YR){const t=this.KR.columnWidthAxis;let c=this.sE?this.sE.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.sE=s[c-1]),s}hE(t){if(this.$R&&"linear"===this.JR.type){const e="x"===this.$R?this.JR.scale.x.jf:this.JR.scale.y.jf;if(!e)throw new Error("CP helper has no information about Axis state.");if(e.Fi===Bi.progressive||e.Fi===Bi.regressive){const e=Math.abs("x"===this.$R?this.JR.scale.x.getInnerInterval():this.JR.scale.y.getInnerInterval());if(this.KR.enabled)return 2*e/this.KR.columnWidthAxis;const i=t.length,s=t[0],r=t[i-1];return e/this.calculateAvgStepBetweenDataPoints("x"===this.$R?s.x:s.y,"x"===this.$R?r.x:r.y,i)}}}rE(t,e,i){if(!this.$R)return e;const s=i.length;let r=Ms(i,t.min,this.$R,this.YR,0,s-1);void 0===r&&(r=this.YR?s-1:0);let n=Ms(i,t.max,this.$R,this.YR,0,s-1);return void 0===n&&(n=this.YR?0:s-1),1+Math.abs(n-r)}nE(){this.tE&&(clearTimeout(this.tE),this.tE=void 0)}iE(t){this.QR(t,!0)&&this.Bi()}}class Hf extends Nf{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 Wf{constructor(t,e,i){this.oE=e,this.aE=i,this.lE=t,this.uE=[]}cE(t,e,i,s){const r=t.length;if(0===r)return;let n=t,o=r,h=this.lE[this.lE.length-1];do{const t=this.lE.length;let r;h||(h=this.dE(e,o)),h&&0==h.allocatedCoordinatesCount-h.existingCoordinatesCount&&(h=void 0);let a=0;if(this.aE&&t>0&&(void 0===h||0===h.existingCoordinatesCount)){const e=this.lE[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.lE.push(s)}r>0&&(o>r?(n=n.slice(r),o=n.length):(n=[],o=0))}while(o>0);this.fE()}gE(t){const e=t,i=this.lE.indexOf(e);i>=0&&this.lE.splice(i,1),e.droppedTimestamp=gt.performance.now(),this.uE.push(e)}pE(){this.lE.slice().forEach((t=>this.gE(t)))}mE(){this.lE.forEach((t=>this.oE(t))),this.uE.forEach((t=>this.oE(t))),this.lE.length=0,this.uE.length=0}dE(t,e){const i=2*t/3,s=4*t/3,r=this.uE.findIndex((t=>t.allocatedCoordinatesCount>=i&&t.allocatedCoordinatesCount<=s));if(r>=0){const t=this.uE[r];return this.uE.splice(r,1),this.lE.push(t),t}}fE(){if(this.uE.length>5){const t=gt.performance.now();for(let e=0;e=1e4)&&(this.oE(i),this.uE.splice(e,1),e-=1)}}}}class Yf extends Nf{yE(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.SE(t,e.maxDataPointCount,r,n,a,l);if("minDataPointCount"in e)return this.xE(t,e.minDataPointCount,r,n,a,l);if("progressiveDataCleaningThreshold"in e)return this.bE(t,e.progressiveDataCleaningThreshold,r,n,a,l);throw new Error(`Unimplemented data cleaning configuration: ${JSON.stringify(e)}`)}SE(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}bE(t,e,i,s,r,n){if(void 0===e||!this.$R)return 0;let o=0;for(let h=0;hs:a.boundaries.min.y>n:"x"===this.$R?a.boundaries.max.xe:a.boundaries.min.y>e:"x"===this.$R?a.boundaries.max.x2))break;o+=1}return o}xE(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.$R){if(this.YR?"x"===this.$R?l.boundaries.min.x>s:l.boundaries.min.y>n:"x"===this.$R?l.boundaries.max.xs||l.boundaries.max.yn?o+=1:o=0;h+=l.existingDataPointsCount}return o}vE(t,e){const i=t.reduce(((t,e)=>Ne(t,e.boundaries)),we);if(e&&"progressiveDataCleaningThreshold"in e&&e.progressiveDataCleaningThreshold){const t=e.progressiveDataCleaningThreshold;"x"!==this.$R||this.YR?"x"===this.$R&&this.YR?i.max.x=Math.min(i.max.x,t):"y"!==this.$R||this.YR?"y"===this.$R&&this.YR&&(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 qf extends $s{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.JD=new pf,this.Sv=[],this.ME=new Hf(this.ct,this),this._E=new Uf(this.ct,this,(()=>this.Li.Bi())),this.AE=new Wf(this.Sv,(t=>t.coordsBuffer&&this.iD.ZB(t.coordsBuffer)),!0),this.wE=new Yf(this.ct,this),this.FO=e,this.EO=n,this.zO=o,this.Mh=h,this.GR={type:"none"},this.iD=t.PO(),this.IO=t,this.VR=this.iD.RL;const a=this.ct.Qt(),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;s$t(e,t))(a,l);this.kE={individualLookupValuesEnabled:l,attributesPerVertex:f,attributeOffsetCoordinateLowPrecision:u,attributeOffsetCoordinateHighPrecision:c,attributeOffsetLookUpValue:d,prepareRenderData:(t,e)=>g(t,this.sa.getFillStyle())}}Gs(){const t=this.Hn,e=this.sa,i=this.Yr(),s=this.zn,r=s.length,n=r>0,o=this.pr.M(),h=this.pr.o;n&&(this.ca=ie(this.ca,s,{canReturnB:!0}),this.En+=r);let a=this.da.o;const l=this.wE.yE(this.Sv,this.da.M());if(l>0){let t=0;for(let e=0;e{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.jointPointsCount=0,t.boundaries=we,t.lastDataPoint=void 0})),this.AE.pE(),u=this.ca);const c=this._E.eE(u),d=c.length;if(d>0){let t=this._E.hE(this.ca)||(this.kr("ApplicationType",(t=>"InternalUI"===t.type))?this.En:1e5);d/t>10&&(t=d/10),this.AE.cE(c,t,((t,e,i,s)=>{const r=this.ME.calculateUserDataPointsBoundaries(e);return{allocatedCoordinatesCount:t,existingDataPointsCount:this._E.rE(r,i,this.ca)-s,existingCoordinatesCount:i,jointPointsCount:s,boundaries:r,coordsBuffer:this.iD.gL(t*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i)),lastDataPoint:e[i-1]}}),((t,e,i,s)=>{const r=Ne(t.boundaries,this.ME.calculateUserDataPointsBoundaries(e)),n=this._E.rE(r,t.existingCoordinatesCount+i,this.ca)-(t.jointPointsCount+s);this.iD.pL(t.coordsBuffer,t.existingCoordinatesCount*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i)),t.jointPointsCount+=s,t.lastDataPoint=e[i-1],t.existingDataPointsCount=n,t.existingCoordinatesCount+=i,t.boundaries=r}))}a&&(this.Rn=this.wE.vE(this.Sv,this.da.M())),this.JD.jB(this.ct);const f=e instanceof tt&&e,g=f&&f.getThickness(),m=f&&f.getFillStyle(),p=m instanceof z&&m,y=m instanceof Z&&m,x=m instanceof $&&m,S=m instanceof G&&m,v=p||y||x||S,b=this.kE.individualLookupValuesEnabled;if(x?this.tR=Mf(this.Tr(),this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.iD.ZD()):y?this.iR=Af(this.Tr(),this.ct,y.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),i||h){if(S&&"value"===S.getLookUpProperty()&&!b){const t='LCJS misusage error: Series individualLookupValuesEnabled flag must be set if using PalettedFill with lookUpProperty="value" !';throw gt.alert(t),new Error(t)}if(v&&f&&!1!==g){const t=-1===g?"primitive":"triangulated",e=y?["gradient",y]:x?["gradient",x]:S?["lookup",S.getLookUpProperty()]:"uniform";this.GR="primitive"===t?{type:t,shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),mousePickingShader:o?this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,lineStyle:f,fillStyleSolid:p,fillStyleLinearGradient:y,fillStyleRadialGradient:x,fillStylePaletted:S}:"triangulated"===t?{type:t,shader:this.iD.zB(df["2D"],df.Color({dataType:e}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0}),this.VR?df.AliasedEdge():void 0),mousePickingShader:o?this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,geometry:Ff(this.iD,g),lineStyle:f,fillStyleSolid:p,fillStyleLinearGradient:y,fillStyleRadialGradient:x,fillStylePaletted:S}:{type:"none"}}else this.GR={type:"none"};if(S){if(S&&S.lut.isValid){const t=S.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}}else this.IO.NL.vr(this.WR),this.WR=void 0}return this.oa(e),this.Hn=!1,this.zn=[],this.pr.o=!1,this.da.o=!1,this}tD(t){const e=this.iD.gl,i=this.GR;if(!i||"none"===i.type)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const{lineStyle:r,fillStyleSolid:n,fillStyleLinearGradient:o,fillStyleRadialGradient:h,fillStylePaletted:a}=i;return this.iD.$D(s).VB(s,((s,l,u,c)=>{let d=!1;if(this.iD.WB(s("uIsHighlighted"),1===t||2===t?0:this.br).UB(s("uHighlightColorOffset"),this.Ar).WB(s("uRenderEffectMask"),2===t?1:0),this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(s("uScale"),this.JD.$B()).GB(s("uDisp"),this.JD.YB()).GB(c("uScaleStart_highpart"),this.JD.SO()).GB(c("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(c("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(c("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(c("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(c("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(s("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(s("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(s("uColor"),this.zO);else if(n)this.iD.UB(s("uColor"),n.getColor());else if(h){if(!this.tR)return!1;this.iD.KL(u,this.tR,h)}else if(o){if(!this.iR)return!1;this.iD.qL(u,this.iR,o)}else if(a){if(!this.HR)return!1;this.iD.HB(s("uLookupTexture"),this.HR.texture,0).WB(s("uLookupMin"),a.lut.min).WB(s("uLookupMax"),a.lut.max).WB(s("uLookupTextureHeightPx"),this.HR.textureHeight)}return this.ME.renderVisibleOnly(this.Sv,(s=>{const{coordsBuffer:n}=s;if(n){if(e.bindBuffer(e.ARRAY_BUFFER,n),"triangulated"===i.type)this.ct.Qt()||void 0===this.kE.attributeOffsetCoordinateLowPrecision?this.ct.Qt()&&void 0!==this.kE.attributeOffsetCoordinateHighPrecision&&_f(!0,this.iD,n,u,this.kE.attributesPerVertex,this.kE.attributeOffsetCoordinateHighPrecision):_f(!1,this.iD,n,u,this.kE.attributesPerVertex,this.kE.attributeOffsetCoordinateLowPrecision);else if(this.ct.Qt()||void 0===this.kE.attributeOffsetCoordinateLowPrecision){if(this.ct.Qt()&&void 0!==this.kE.attributeOffsetCoordinateHighPrecision){const t=l("aPos_highpart");e.vertexAttribPointer(t,2,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetCoordinateHighPrecision*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t);const i=l("aPos_lowpart");e.vertexAttribPointer(i,2,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kE.attributeOffsetCoordinateHighPrecision+2)*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(i)}}else{const t=l("aPos");e.vertexAttribPointer(t,2,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetCoordinateLowPrecision*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}if(a&&"value"===a.lookUpProperty&&void 0!==this.kE.attributeOffsetLookUpValue&&1!==t)if("triangulated"===i.type){const t=l("aLookupValueA");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(t,1),e.enableVertexAttribArray(t);const i=l("aLookupValueB");e.vertexAttribPointer(i,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,(this.kE.attributeOffsetLookUpValue+this.kE.attributesPerVertex)*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(i,1),e.enableVertexAttribArray(i)}else{const t=l("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),e.enableVertexAttribArray(t)}"triangulated"===i.type?Of(this.IO,i.geometry,u,this.VR&&1!==t,1===t,r.getThickness(),s.existingCoordinatesCount-1):this.iD.Op(e.LINE_STRIP,s.existingCoordinatesCount,0),d=!0}})),e.bindBuffer(e.ARRAY_BUFFER,null),d})),this}Kn(t,e){return Array.isArray(t)||(t=[t]),this.zn=ie(this.zn,t,{canReturnB:!0}),this.Rn=Ne(this.Rn,e||this.ME.calculateUserDataPointsBoundaries(t)),this}qn(){return super.qn(),this}dispose(){return super.dispose(),this._E.nE(),this.WR&&(this.IO.NL.vr(this.WR),this.WR=void 0),this.GR={type:"none"},this.HR=void 0,this}OD(){return this.AE.mE(),this}Sb(t){this.Qn()>0&&this.Gs();const e=this.$n(),i=xs(e,t,this.Gn,this.vo,this.Mo,this.ct,this.engine.ct,this.Rn,this.ME.$R,this.ME.YR);return void 0!==i?e[i]:void 0}WA(t){this.Qn()>0&&this.Gs();const e=this.$n(),i=e.length;if(0===i)return;const s=this.vo?1:0,r=i-(this.Mo?2:1);if(this.Gn===ps.Nearest){let s,r,n=Me;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 Xf(t,e)},jf=t=>{const e=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new Xf(t,e)},Zf=(t,e,i)=>{let s=e.sL.hD.get(t);return s||(s=i(e),e.sL.hD.set(t,s)),s};class Kf extends zs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.OO=m(c(Ae,Ae),c(Me,Me)),this.FE=[],this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO()}Gs(){const t=this.pr.M(),i=this.pr.o,s=this.zn,r=s.length,n=r>0,o=this.Dn.M(),h=this.Vr,a=this.size.M(),l=this.ct.pi(),c=this.size.o||this.Dn.o,d=this.Hn||s&&s.length>0,f=l||c;if(n){this.Pn=ie(this.Pn,s,{canReturnB:!0}),this.En+=r;const t=this.FE[this.FE.length-1];let e=t?{ni:t.ni,hi:t.hi,tA:{max:{x:t.tA.max.x,y:t.tA.max.y},min:{x:t.tA.min.x,y:t.tA.min.y}},PE:{max:{x:t.PE.max.x,y:t.PE.max.y},min:{x:t.PE.min.x,y:t.PE.min.y}}}:void 0,i=s.length;if(!e){const t={ni:0,hi:s.length>=1e3?1e3:s.length};t.tA=ze(s.slice(0,t.hi)),t.PE=ks(t.tA,{x:a,y:a},this.ct),this.FE[0]=t,e=t,i=s.length-(t.hi||0)}if(e&&i)if(e.hi-e.ni+i<1e3)e.hi+=e.hi-e.ni+i,e.tA=ze(s.slice(e.ni,e.hi)),e.PE=ks(e.tA,{x:a,y:a},this.ct),this.FE[this.FE.length-1]=e;else{if(e.hi-e.ni<1e3){const t={ni:e.ni,hi:e.ni+1e3};t.tA=ze(s.slice(t.ni,t.hi)),t.PE=ks(t.tA,{x:a,y:a},this.ct),this.FE[this.FE.length-1]=t}let t=e.hi;for(;tthis.Pn.length?this.Pn.length:t+1e3};e.tA=ze(s.slice(e.ni,e.hi)),e.PE=ks(e.tA,{x:a,y:a},this.ct),t=e.hi,this.FE[this.FE.length]=e}}}if(n||this.Hn){this.Rn=this.Nn?Ne(this.Rn,this.Nn):Ne(this.Rn,ze(this.Pn));const t=$t(this.Pn,this.ct.Qt());this.DE=this.En,this.BE=this.iD.RB(t)}if(this.JD.jB(this.ct),c||this.Nr()||i){const e=this.Bn.M()?"attribute":"uniform",i=a<=1&&df.PointSize(e),s=df.VertexLocation({offset:a>1?{dataType:e,sizeUnit:"px",symmetric:!0,rotation:(this.Ln.M()||this.sn.M()%360!=0)&&{dataType:this.Ln.M()?"attribute":"uniform"}}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0}),r=this.Vr instanceof z&&this.Vr,n=this.Vr instanceof $&&this.Vr,o=this.Vr instanceof Z&&this.Vr,h=this.Vr instanceof G&&this.Vr,l=this.Vr instanceof V&&this.Vr,u=r||n||o||h||l;this.tB=u?this.iD.zB(df["2D"],i,s,r?df.Color({dataType:"uniform"}):l?df.Color({dataType:"attribute"}):h?df.Color({dataType:["lookup",h.getLookUpProperty()]}):n?df.Color({dataType:["gradient",n]}):o?df.Color({dataType:["gradient",o]}):void 0):void 0,this.eR=t&&u?this.iD.zB(df["2D"],i,s,df.Color({dataType:"uniform"})):void 0}if(h!==F?f&&(this.LE&&(this.LE=void 0),a>1||h instanceof V?a<=1?this.zR=this.iD.gl.POINTS:o===e.PointShape.Triangle?(this.LE=Zf(e.PointShape.Triangle,this.iD,$f),this.zR=this.iD.gl.TRIANGLES):o===e.PointShape.Circle?(this.LE=Zf(e.PointShape.Circle,this.iD,(t=>((t,e)=>{const i=function(t=25){return al(u(0,0),0,360,.5,.5,t)[0]}(24);return new Xf(t,i)})(t))),this.zR=this.iD.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.LE=Zf(e.PointShape.Square,this.iD,jf),this.zR=this.iD.gl.TRIANGLES):this.zR=this.iD.gl.POINTS:this.zR=this.iD.gl.POINTS):this.LE&&(this.LE=void 0),d||this.Nr()){const t=this.Pn.length;if(h instanceof V&&this.DE&&this.DE>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=ni(this.sn.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 Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(o("uScaleStart_highpart"),this.JD.SO()).GB(o("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(o("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(o("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(o("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(o("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),this.iD.tO(n,i,this.ct.Qt(),this.LE?1:void 0).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).WB(o("uDevicePixelRatio"),this.iD.ZD()),this.LE){const t=r("aInstanceGeo");this.iD.xL(t,this.LE._D).vL(t,0)}if(1===t)this.iD.UB(e("uColor"),this.zO);else if(this.Vr instanceof z)this.iD.UB(e("uColor"),this.Vr.getColor());else if(this.Vr instanceof V&&this.OE){const t=r("aColor");this.iD._L(t,this.OE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}else if(this.Vr instanceof G&&this.HR){if("value"===this.Vr.getLookUpProperty()&&this.zE){const t=r("aLookupValue");this.iD.AL(t,this.zE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}this.iD.HB(e("uLookupTexture"),this.HR.texture,0).WB(e("uLookupMin"),this.Vr.lut.min).WB(e("uLookupMax"),this.Vr.lut.max).WB(e("uLookupTextureHeightPx"),this.HR.textureHeight)}else if(this.Vr instanceof $){if(!this.$O)return!1;this.iD.KL(n,this.$O,this.Vr)}else if(this.Vr instanceof Z){if(!this.YO)return!1;this.iD.qL(n,this.YO,this.Vr)}if(this.RE&&this.zR!==this.iD.gl.POINTS){const t=r("aOffsetPixels");this.iD.AL(t,this.RE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}else if(this.zR!==this.iD.gl.POINTS){const t=e("uOffsetPixels");this.iD.WB(t,this.size.M())}if(this.EE&&this.zR!==this.iD.gl.POINTS){const t=r("aRot");this.iD.xL(t,this.EE),this.zR!==this.iD.gl.POINTS&&this.iD.vL(t,1)}else if(this.zR!==this.iD.gl.POINTS&&this.sn.M()%360!=0){const t=ni(this.sn.M()),i=Math.sin(t),s=Math.cos(t);this.iD.GB(e("uRot"),[i,s])}if(this.zR===this.iD.gl.POINTS)this.iD.WB(e("uPointSize"),this.size.M());else{const t={x:2/this.Li.Et().x,y:2/this.Li.Et().y};this.iD.GB(e("uRatioPxClip"),[t.x,t.y])}let h=!1;return this.zR===this.iD.gl.POINTS?(this.iD.Op(this.zR,s),h=!0):this.LE&&(this.iD.CL(this.zR,0,this.LE.IE,s),h=!0),h})))}return this}jS(t){this.Qn()>0&&this.Gs();const e=this.$n(),i=xs(e,t,this.Gn,!1,!1,this.ct,this.Li.ct,this.Rn,void 0,void 0);return void 0!==i?e[i]:void 0}ps(t){return super.ps(t)}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return.5*this.size.M()}do(){return.5*this.size.M()}qn(){return super.qn(),this.FE=[],this}OD(){return this.BE&&(this.iD.ZB(this.BE),this.BE=void 0),this.LE&&(this.LE=void 0),this.OE&&(this.iD.gl.deleteBuffer(this.OE),this.OE=void 0),this.EE&&(this.iD.ZB(this.EE),this.EE=void 0),this.zE&&(this.iD.ZB(this.zE),this.zE=void 0),this}}class Jf extends Vs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.VE=we,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.FO=e}Gs(){super.Gs();const t=this.pr.M(),e=this.Nr(),i=this.qr.o||this.Y.o||this.sn.o||this.hn.o,s=this.$r,r=this.Yr(),n=s.getThickness(),o=this.jr(n),h=this.sn.M();this.JD.jB(this.ct);const a=this.ct.pi();if(i||a){const t=this.Y.M();this.Pn=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.qr.M(),t.x,t.y,h,this.hn.M()),this.GO&&this.iD.gl.deleteBuffer(this.GO);const e=$t(this.Pn,this.ct.Qt());this.GO=this.iD.RB(e),this.WO=this.Pn.length}this.VE=ze(this.Pn);const l=this.Vr instanceof z&&this.Vr,c=this.Vr instanceof $&&this.Vr,d=this.Vr instanceof Z&&this.Vr,f=this.Vr instanceof sd&&this.Vr,g=l||c||d||f;if(e&&(this.XO=g?this.iD.zB(df["2D"],l&&df.Color({dataType:"uniform"}),d&&df.Color({dataType:["gradient",d]}),c&&df.Color({dataType:["gradient",c]}),f&&df.Color({dataType:["image",f.getFitMode()]}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0),c?this.$O=Mf(this.Sr||this.VE,this.ct,c.getPosition(),c.getExtent(),c.getShape(),this.iD.ZD()):d?this.YO=Af(this.Sr||this.VE,this.ct,d.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0),f){const t=f.getSource();if((!this.NE||e)&&t){this.NE&&(this.NE.texture.YD(this),this.iD.ZB(this.NE.texCoordsBuffer));const e=this.iD.JL(t);e.$D(this),this.NE={texture:e,texCoordsBuffer:this.iD.RB([]),sourceMissingTexture:this.iD.XL(new Uint8Array(Object.values(f.getSourceMissingColor().toJS()).map((t=>255*t))),this.iD.gl.RGBA,!1,!0,{x:1,y:1},!1),textureReadyCallback:()=>{this.NE&&f&&(this.GE(),this.Li.Bi())}},e.xB(this.NE.textureReadyCallback),this.GE()}this.NE&&this.NE.texture.dB&&this.NE.texture.cB&&this.NE.texture.aB&&(this.NE.texture.Gs(),this.Li.Bi()),(a||i)&&this.NE&&this.NE.texture.dB&&this.GE()}else this.NE&&(this.NE.texture.YD(this),this.iD.ZB(this.NE.texCoordsBuffer),this.NE=void 0);if(i||o||a&&1!==n){if(1===n||-1===n)[this.jO,this.HE]=[this.Pn,void 0];else{const t=this.ct;[this.jO,this.HE]=t instanceof Ei?((t,e,i)=>{const s=t[0],r=t[1],n=t[2],o=t[3],h=e/2;return[[i.Si(s,r,h,-h),i.Si(r,s,-h,-h),i.Si(o,n,-h,-h),i.Si(n,o,h,-h),i.Si(s,r,-h,h),i.Si(r,s,h,h),i.Si(o,n,h,h),i.Si(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.Pn,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=Xe(qe(r,s)),l=Xe(qe(o,s)),c=ei(a),d=ei(l);return[[Ke(s,Ke(Ze(c,h.x),Ze(d,h.y))),Ke(r,Ke(Ze(a,h.x),Ze(d,h.y))),Ke(o,Ke(Ze(c,h.x),Ze(l,h.y))),Ke(n,Ke(Ze(a,h.x),Ze(l,h.y))),Ke(s,Ke(Ze(a,h.x),Ze(l,h.y))),Ke(r,Ke(Ze(c,h.x),Ze(l,h.y))),Ke(o,Ke(Ze(a,h.x),Ze(d,h.y))),Ke(n,Ke(Ze(c,h.x),Ze(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.Pn,t.yi(),n)}this.KO&&this.iD.gl.deleteBuffer(this.KO),this.RR&&this.iD.gl.deleteBuffer(this.RR),this.KO=this.iD.RB($t(this.jO,this.ct.Qt())),this.HE?(this.RR=this.iD.yL(new Uint16Array(this.HE)),this.ZO=this.HE.length):(this.RR=void 0,this.ZO=this.jO.length)}const m=s instanceof tt&&s,p=m&&m.getFillStyle(),y=p&&p instanceof Z&&p,x=p&&p instanceof $&&p,S=m,v=p&&p instanceof z&&p||y||x;return r&&(this.sR=S&&v?this.iD.zB(df["2D"],df.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0),x?this.tR=Mf(this.VE,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.iD.ZD()):y?this.iR=Af(this.VE,this.ct,y.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.eR=t&&g?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.hR=t&&this.$r!==J?this.hR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.Ur(this.Vr),this.Zr(s),this.qr.o=!1,this.sn.o=!1,this.Y.o=!1,this.hn.o=!1,this}GE(){if(this.NE&&this.Vr instanceof sd){const t=nt(this.xn(),this.ct,this.Li.ct),i=Je(nt(Ke(this.xn(),this.Et()),this.ct,this.Li.ct),t);this.NE.texCoordsBuffer&&this.iD.ZB(this.NE.texCoordsBuffer),this.NE.texCoordsBuffer=this.iD.RB(((t,i,s,r,n)=>{const o=Math.min(s/t,r/i),h=t*o,a=i*o,l=s/h,u=r/a,c=h/s,d=a/r;let f=0,g=1,m=0,p=1;switch(n){case e.ImageFitMode.Fill:u{if(this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(h("uScaleStart_highpart"),this.JD.SO()).GB(h("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(h("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(h("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(h("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(h("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize),1===t)this.iD.UB(e("uColor"),this.zO);else if(r instanceof z)this.iD.UB(e("uColor"),r.getColor());else if(r instanceof $){if(!this.$O)return!1;this.iD.KL(o,this.$O,r)}else if(r instanceof Z){if(!this.YO)return!1;this.iD.qL(o,this.YO,r)}else if(r instanceof sd){if(!this.NE)return!1;const t=this.NE&&this.NE.texture.vB();this.iD.UB(h("uColor"),r.getSurroundingColor()).HB(e("uColorTexture"),t||this.NE.sourceMissingTexture,0).NB(this.NE.texCoordsBuffer,void 0,{location:n("aTextureCoord"),size:2}).fL(r.fitMode)}return this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).tO(o,i,this.ct.Qt(),void 0).Op(this.iD.gl.TRIANGLE_FAN,s),!0})));const n=1===t?this.hR:this.sR,o=this.$r,h=this.KO;n&&h&&o instanceof tt&&(this.iD.$D(n),this.iD.VB(n,((e,i,s,r)=>{this.ct instanceof Ti||this.ct instanceof Ga?this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).GB(r("uScaleStart_highpart"),this.JD.SO()).GB(r("uScaleStart_lowpart"),this.JD.xO()):this.ct instanceof Ei&&this.iD.GB(r("uScaleStart"),this.JD.MixedScaleXY.uScaleStart).GB(r("uScaleStartLog"),this.JD.MixedScaleXY.uScaleStartLog).GB(r("uScaleInterval"),this.JD.MixedScaleXY.uScaleInterval).GB(r("uScaleIntervalLog"),this.JD.MixedScaleXY.uScaleIntervalLog).GB(e("uViewportStart"),this.JD.MixedScaleXY.uViewportStart).GB(e("uViewportSize"),this.JD.MixedScaleXY.uViewportSize);const n=o.getFillStyle();if(1===t)this.iD.UB(e("uColor"),this.zO);else if(n instanceof z)this.iD.UB(e("uColor"),n.getColor());else if(n instanceof $){if(!this.tR)return!1;this.iD.KL(s,this.tR,n)}else if(n instanceof Z){if(!this.iR)return!1;this.iD.qL(s,this.iR,n)}return this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).tO(s,h,this.ct.Qt(),void 0),this.RR?this.iD.wL(this.RR).kL(this.ZO):this.iD.Op(this.iD.gl.LINE_LOOP,this.ZO),!0})))}return this}OD(){return this.RR&&(this.iD.ZB(this.RR),this.RR=void 0),this.GO&&(this.iD.ZB(this.GO),this.GO=void 0),this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),this.NE&&(this.NE.texture.YD(this),this.NE.texture.bB(this.NE.textureReadyCallback),this.iD.RD(this.NE.sourceMissingTexture),this.iD.ZB(this.NE.texCoordsBuffer),this.NE=void 0),this.XO=void 0,this.sR=void 0,this.eR=void 0,this.hR=void 0,this}yt(){return Math.max(this.qr.M().x,this.qr.M().x+this.Y.M().x)}ft(){return Math.min(this.qr.M().x,this.qr.M().x+this.Y.M().x)}xt(){return Math.max(this.qr.M().y,this.qr.M().y+this.Y.M().y)}St(){return Math.min(this.qr.M().y,this.qr.M().y+this.Y.M().y)}co(){return Se(this.$r)}do(){return Se(this.$r)}}class Qf extends Gs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.JD=new pf,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.FO=e}jS(t){let e,i=Number.MAX_VALUE;for(const s of this.Pn){const r=Le(nt(s,this.ct,this.Li.ct),t);r=3,r=this.$r,n=this.Yr(),o=r.getThickness(),a=this.jr(o);this.JD.jB(this.ct),this.jv=this.ct.yi();const l=this.ct.pi();if(i&&(this.Rn=ze(this.Pn)),i&&(this.GO&&(this.iD.gl.deleteBuffer(this.GO),this.GO=void 0),s)){const t=$t(this.Pn,this.ct.Qt());this.GO=this.iD.RB(t),this.WE=new Uint16Array(h.default(t)),this.UE&&this.iD.gl.deleteBuffer(this.UE),this.UE=this.iD.yL(this.WE),this.WO=this.WE.length}const u=this.Vr instanceof z&&this.Vr,c=this.Vr instanceof G&&this.Vr,d=this.Vr instanceof $&&this.Vr,f=this.Vr instanceof Z&&this.Vr,g=u||c&&"value"!==c.getLookUpProperty()&&c||f||d;if(e){if(c){const t=c.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}else this.IO.NL.vr(this.WR),this.WR=void 0;this.XO=g?this.iD.zB(df["2D"],u&&df.Color({dataType:"uniform"}),f&&df.Color({dataType:["gradient",f]}),d&&df.Color({dataType:["gradient",d]}),c&&df.Color({dataType:["lookup",c.getLookUpProperty()]}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}if(d?this.$O=Mf(this.Sr||this.Rn,this.ct,d.getPosition(),d.getExtent(),d.getShape(),this.iD.ZD()):f?this.YO=Af(this.Sr||this.Rn,this.ct,f.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0),(i||a||l&&1!==o)&&(this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),s)){const t=1===o||-1===o?this.Pn:wf(this.Pn,this.jv,o);this.jO=$t(t,this.ct.Qt()),this.KO=this.iD.RB(this.jO,!0),this.ZO=t.length}const m=r instanceof tt&&r,p=m&&m.getFillStyle(),y=p&&p instanceof Z&&p,x=p&&p instanceof $&&p,S=m,v=p&&p instanceof z&&p||y||x;return n&&(this.sR=S&&v?this.iD.zB(df["2D"],df.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0),x?this.tR=Mf(this.Sr||this.Rn,this.ct,x.getPosition(),x.getExtent(),x.getShape(),this.iD.ZD()):y?this.iR=Af(this.Sr||this.Rn,this.ct,y.getAngle(!0),this.iD.ZD()):(this.tR=void 0,this.iR=void 0),this.eR=t&&g?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.hR=t&&this.$r!==J?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.ao=!1,this.Ur(this.Vr),this.Zr(r),this}tD(t){if(this.Wr()){const e=this.Vr,i=1===t?this.eR:this.XO,s=this.GO,r=this.WO;i&&s&&r&&this.iD.$D(i).VB(i,((i,r,n,o)=>{if(this.iD.GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).GB(o("uScaleStart_highpart"),this.JD.SO()).GB(o("uScaleStart_lowpart"),this.JD.xO()).tO(n,s,this.ct.Qt(),void 0).wL(this.UE).WB(i("uIsHighlighted"),1===t||2===t?0:this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),1===t)this.iD.UB(i("uColor"),this.zO);else if(e instanceof z)this.iD.UB(i("uColor"),e.getColor());else if(e instanceof $){if(!this.$O)return!1;this.iD.KL(n,this.$O,e)}else if(e instanceof Z){if(!this.YO)return!1;this.iD.qL(n,this.YO,e)}else e instanceof G&&this.HR&&this.iD.WB(i("uLookupMin"),e.lut.min).WB(i("uLookupMax"),e.lut.max).WB(i("uLookupTextureHeightPx"),this.HR.textureHeight).HB(i("uLookupTexture"),this.HR.texture,0);return this.iD.kL(this.WO),!0}));const n=1===t?this.hR:this.sR,o=this.$r,h=this.KO,a=this.ZO;n&&h&&a&&this.iD.$D(n).VB(n,((e,i,s,r)=>{this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).tO(s,h,this.ct.Qt(),void 0);const n=o.getFillStyle();if(1===t)this.iD.UB(e("uColor"),this.zO);else if(n instanceof z)this.iD.UB(e("uColor"),n.getColor());else if(n instanceof $){if(!this.tR)return!1;this.iD.KL(s,this.tR,n)}else if(n instanceof Z){if(!this.iR)return!1;this.iD.qL(s,this.iR,n)}const a=o.getThickness(),l=-1===a||1===a;return this.iD.Op(l?this.iD.gl.LINE_LOOP:this.iD.gl.TRIANGLE_STRIP,this.ZO),!0}))}return this}OD(){return this.UE&&(this.iD.ZB(this.UE),this.UE=void 0),this.GO&&(this.iD.ZB(this.GO),this.GO=void 0),this.KO&&(this.iD.ZB(this.KO),this.KO=void 0),this.XO=void 0,this.sR=void 0,this.eR=void 0,this.hR=void 0,this.HR=void 0,this}}const tg=(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},ig=(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(!Be(a,h))return;let l=r.get(t);l||(l={type:n.type,dataInvalidationRanges:[]},r.set(t,l));const u=ke(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.XL(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.XL(null,o.LUMINANCE,!1,!0,{x:e,y:i},!1,o.FLOAT):t.XL(null,o.RGBA,!1,!0,{x:e,y:i},!1,o.UNSIGNED_BYTE)},ng=(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 og extends Rs{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.$E=y("bilinear"),this.Ma=ls.lineStyle,this.engine=t,this.Rn=m({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.Mh={...n,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h}}Cy(t){return this.$E.S(t),this}Ty(){return this.$E.M()}_a(t){return this.Ma="function"==typeof t?t(this.Ma):t,this}Aa(){return this.Ma}}class hg extends og{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.JD=new pf,this.GR={},this.YE=[],this.XE=!1,this.Hn=!1,this.jE=tg,this.IO=t,this.FO=e,this.EO=o,this.zO=h,this.iD=t.PO(),this.FO=e;const a=Math.min(this.iD.LD,2048),l={x:Math.min(a,this.Mh.primaryDimensionVectorsCount),y:Math.min(a,this.Mh.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.Mh,l,this.jE),c=u.gridTiles.map((t=>{const e="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.primary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstVector.secondary}:{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.secondary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstVector.primary},i="columns"===this.Mh.dataOrder?{x:this.Mh.step.x*t.sizeHeatmapDataVectors.primary,y:this.Mh.step.y*t.sizeHeatmapDataVectors.secondary}:{x:this.Mh.step.x*t.sizeHeatmapDataVectors.secondary,y:this.Mh.step.y*t.sizeHeatmapDataVectors.primary},s="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+this.Mh.step.x*t.iFirstUniqueVector.primary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstUniqueVector.secondary}:{x:this.Mh.start.x+this.Mh.step.x*t.iFirstUniqueVector.secondary,y:this.Mh.start.y+this.Mh.step.y*t.iFirstUniqueVector.primary},r="columns"===this.Mh.dataOrder?{x:this.Mh.step.x*t.sizeUniqueHeatmapDataVectors.primary,y:this.Mh.step.y*t.sizeUniqueHeatmapDataVectors.secondary}:{x:this.Mh.step.x*t.sizeUniqueHeatmapDataVectors.secondary,y:this.Mh.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.ZE={gridTiles:c,gridTileSizes:d}}Gs(){const t=this.YE,e=this.Vr,i=this.Nr(),s=this.Ma,r=s!==this.Wa,n=e instanceof G&&e,o=e instanceof z&&e,h=n&&n.getPalette(),a=this.$E.o,l=this.$E.M(),u=this.Hn,c=this.pr.M();this.KE=this.KE||this.qE();const d=this.KE,f=ig(t,d,u?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));f.size>0&&(ng(this.iD,f,(t=>t.intensityData),(t=>t.intensityDataTexture)),this.XE=!0),this.JD.jB(this.ct);const g=this.GR;if((i||a)&&(h?(this.JE=this.IO.vR(h,this.QE,this.JE),this.QE=h):(this.JE=void 0,this.IO.NL.vr(this.QE),this.QE=void 0),g.tile=n&&this.JE?{renderMode:"paletted",fillStylePaletted:n,colorLookupTexture:this.JE,shader:this.iD.zB(df["2D"],df.ColorGrid2D({heatmapType:"intensity",interpolation:"bilinear"===l&&"bilinear",flipXY:"rows"===this.Mh.dataOrder,intensityTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN}),df.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:bf(this.ct),flipXY:"rows"===this.Mh.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:bf(this.ct),flipXY:"rows"===this.Mh.dataOrder,normalSource:void 0}))}:void 0),r){const t=s instanceof tt&&s,e=t&&t.getFillStyle(),i=e instanceof z&&e;g.wireframe=t&&i?-1===t.getThickness()?{renderMode:"primitive",shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Mh.dataOrder,axisWorldTranslation:bf(this.ct),normalSource:void 0})),fillStyleSolid:i}:{renderMode:"triangulated",shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Mh.dataOrder,axisWorldTranslation:bf(this.ct),normalSource:void 0})),geometry:Ff(this.iD,1),solidLine:t,fillStyleSolid:i}:void 0,g.wireframe?this.tz=this.tz||this.iz():this.tz&&(this.iD.ZB(this.tz.wireframeCoordinatesBuffer),this.tz=void 0)}return g.mousePicking=c?this.GR.mousePicking||{shader:this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:bf(this.ct),flipXY:"rows"===this.Mh.dataOrder,normalSource:void 0}))}:void 0,this.GR=g,this.Hn=!1,this.YE.length=0,this.Ur(e),this.Wa=s,this.$E.o=!1,this}qE(){const t=this.ZE.gridTiles.map((t=>{const e=rg(this.iD,t.sizeHeatmapDataVectors.secondary,t.sizeHeatmapDataVectors.primary);return{...t,intensityDataTexture:e}})),e=this.ZE.gridTileSizes.map((e=>({...e,tiles:t.filter((t=>t.sizeHeatmapDataVectors.primary===e.sizeHeatmapData.primary&&t.sizeHeatmapDataVectors.secondary===e.sizeHeatmapData.secondary))}))),i=this.iD.RB([0,0,1,0,0,1,1,1]),s=this.iD.gl.TRIANGLE_STRIP;return{gridTiles:t,gridTileSizes:e,rectangleLocationsBuffer:i,rectangleLocationsDrawMode:s,rectangleLocationsDrawLength:4}}iz(){const t=this.Mh.primaryDimensionVectorsCount+1+this.Mh.secondaryDimensionVectorsCount+1,e=new Float32Array(4*t);let i=0;for(let t=0;t{if(1===t)this.iD.UB(e("uColor"),this.zO);else if("solid"===i.renderMode){const{fillStyleSolid:t}=i;this.iD.UB(e("uColor"),t.getColor())}return this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).NB(s.rectangleLocationsBuffer,void 0,{location:r("aPos"),size:2}).GB(e("uScaling"),[this.Mh.step.x*this.Mh.columns,this.Mh.step.y*this.Mh.rows]).GB(e("uTranslationAxis"),[this.Mh.start.x,this.Mh.start.y]).Op(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),!0}));else if("paletted"===i.renderMode){const{colorLookupTexture:r,fillStylePaletted:n}=i;this.iD.VB(e,((i,o,h)=>{let l=!1;var u,c;return this.iD.$D(e).GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).HB(i("uLookupTexture"),r.texture,0).WB(i("uLookupMin"),n.getPalette().min).WB(i("uLookupMax"),n.getPalette().max).WB(i("uLookupTextureHeightPx"),r.textureHeight).NB(s.rectangleLocationsBuffer,void 0,{location:o("aPos"),size:2}).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),u=t=>{this.iD.GB(i("uTileDimensions"),["columns"===this.Mh.dataOrder?t.sizeHeatmapData.primary:t.sizeHeatmapData.secondary,"columns"===this.Mh.dataOrder?t.sizeHeatmapData.secondary:t.sizeHeatmapData.primary])},c=(t,e)=>{let r;const n=this.iD.ZD();if("bilinear"===this.$E.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.iD.aL(i("uTileBounds"),r).GB(i("uScaling"),[t.renderSizeAxis.x,t.renderSizeAxis.y]).GB(i("uTranslationAxis"),[t.startRenderLocationAxis.x,t.startRenderLocationAxis.y]).HB(i("uTileIntensityValues"),t.intensityDataTexture,1).Op(s.rectangleLocationsDrawMode,s.rectangleLocationsDrawLength),l=!0},s.gridTileSizes.forEach((t=>{u(t),t.tiles.forEach((t=>{c(t)}))})),l}))}}const n=this.tz,o=this.GR.wireframe,h=1===t||null==o?void 0:o.shader;if(n&&o&&h&&"primitive"===o.renderMode){const e=h,{fillStyleSolid:i}=o;this.iD.$D(e).VB(e,((e,s,r)=>((this.ct instanceof Ti||this.ct instanceof Ga)&&this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()),this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).UB(e("uColor"),i.getColor()).NB(n.wireframeCoordinatesBuffer,void 0,{location:s("aPos"),size:2}).GB(e("uScaling"),[this.Mh.step.x,this.Mh.step.y]).GB(e("uTranslationAxis"),[this.Mh.start.x,this.Mh.start.y]).Op(this.iD.gl.LINES,2*n.wireframeSegmentsLength),!0)))}else if(n&&o&&"triangulated"===o.renderMode){const{shader:e,geometry:i,solidLine:s,fillStyleSolid:r}=o;this.iD.$D(e).VB(e,((e,o,h)=>((this.ct instanceof Ti||this.ct instanceof Ga)&&this.iD.GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()),this.iD.WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0).UB(e("uColor"),r.getColor()).WB(e("uThicknessPixels"),s.getThickness()).GB(e("uRatioPxClip"),[2/this.Li.Et().x,2/this.Li.Et().y]).NB(n.wireframeCoordinatesBuffer,1,{location:o("aLocationA"),size:2},{location:o("aLocationB"),size:2}).GB(e("uScaling"),[this.Mh.step.x,this.Mh.step.y]).GB(e("uTranslationAxis"),[this.Mh.start.x,this.Mh.start.y]),i.$D(h,!1).Op(n.wireframeSegmentsLength),!0)))}return this}Iy(t){return this.YE.push(t),sg(this.ZE.gridTiles,t,(t=>(t.hasIntensityData=!0,t.intensityData))),this}qn(){return this.XE&&(this.ZE.gridTiles.forEach((t=>{t.intensityData.fill(0),t.hasIntensityData=!1})),this.Hn=!0,this.XE=!1),this}dispose(){super.dispose(),this.IO.NL.vr(this.QE),this.QE=void 0,this.JE=void 0;const t=this.KE;t&&(t.gridTiles.forEach((t=>{this.iD.RD(t.intensityDataTexture)})),t.gridTiles.length=0,t.gridTileSizes.forEach((t=>{})),t.gridTileSizes.length=0,this.iD.ZB(t.rectangleLocationsBuffer)),this.KE=void 0;const e=this.tz;return e&&this.iD.ZB(e.wireframeCoordinatesBuffer),this.tz=void 0,this.GR={},this}OD(){return this.dispose(),this}jS(t){const e=t,i="columns"===this.Mh.dataOrder?e.x:e.y,s="columns"===this.Mh.dataOrder?e.y:e.x,r="columns"===this.Mh.dataOrder?this.Mh.start.x:this.Mh.start.y,n="columns"===this.Mh.dataOrder?this.Mh.start.y:this.Mh.start.x;let o=(i-r)/("columns"===this.Mh.dataOrder?this.Mh.step.x:this.Mh.step.y),h=(s-n)/("columns"===this.Mh.dataOrder?this.Mh.step.y:this.Mh.step.x);o=Math.floor(At(o,0,this.Mh.primaryDimensionVectorsCount-1)),h=Math.floor(At(h,0,this.Mh.secondaryDimensionVectorsCount-1));const a=this.sz(o,h),l="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+(o+.5)*this.Mh.step.x,y:this.Mh.start.y+(h+.5)*this.Mh.step.y}:{x:this.Mh.start.x+(h+.5)*this.Mh.step.x,y:this.Mh.start.y+(o+.5)*this.Mh.step.y},u="columns"===this.Mh.dataOrder?o:h,c="columns"===this.Mh.dataOrder?h:o;return{x:l.x,y:l.y,column:u,row:c,cellValue:a}}aC(t){if(t.xthis.Rn.max.x||t.ythis.Rn.max.y)return;const e=t,i="columns"===this.Mh.dataOrder?e.x:e.y,s="columns"===this.Mh.dataOrder?e.y:e.x,r="columns"===this.Mh.dataOrder?this.Mh.start.x:this.Mh.start.y,n="columns"===this.Mh.dataOrder?this.Mh.start.y:this.Mh.start.x,o="columns"===this.Mh.dataOrder?this.Mh.step.x:this.Mh.step.y,h="columns"===this.Mh.dataOrder?this.Mh.step.y:this.Mh.step.x,a=At((i-r)/o-.5,0,this.Mh.primaryDimensionVectorsCount-1),l=At((s-n)/h-.5,0,this.Mh.secondaryDimensionVectorsCount-1),u=At(Math.ceil(a)-1,0,this.Mh.primaryDimensionVectorsCount-1),c=At(Math.ceil(l)-1,0,this.Mh.secondaryDimensionVectorsCount-1),d={point:{x:u,y:c},value:this.sz(u,c)},f={point:{x:u,y:c+1},value:this.sz(u,c+1)},g={point:{x:u+1,y:c},value:this.sz(u+1,c)},m={point:{x:u+1,y:c+1},value:this.sz(u+1,c+1)},p=aa({x:a,y:l},d,f,g,m);if(void 0===p)return;const y=At(Math.floor(a+.5),0,this.Mh.primaryDimensionVectorsCount-1),x=At(Math.floor(l+.5),0,this.Mh.secondaryDimensionVectorsCount-1),S="columns"===this.Mh.dataOrder?y:x,v="columns"===this.Mh.dataOrder?x:y,b=t;return{x:b.x,y:b.y,column:S,row:v,cellValue:p}}sz(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}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}rC(){const t=[];return this.ZE.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.Sv[0].boundaries.min.x:Me:this.Rn.min.y=this.Sv.length>0?this.Sv[0].boundaries.min.y:Me}return this.Sv.forEach((t=>t.shape.Gs())),this.da.o=!1,this}tD(t){return this.Sv.forEach((e=>e.shape.tD(t))),this}Ly(t){if(0===t.length)return this;let e=0;const i=this.hz.dataPerSegment,s=t.length;do{let r=this.Sv[this.Sv.length-1],n=r?i-(r.existingDataPointsCount+(r.hasJoint?1:0)):0,o=!1;if(!r||0===n){const t={columns:"columns"===this.Mh.scrollDimension?i:this.Mh.resolution,rows:"rows"===this.Mh.scrollDimension?i:this.Mh.resolution,heatmapDataType:this.Mh.heatmapDataType,dataOrder:this.Mh.scrollDimension,step:this.Mh.step,start:"columns"===this.Mh.scrollDimension?{x:this.Mh.start.x+this.Mh.step.x*this.ez,y:this.Mh.start.y}:{x:this.Mh.start.x,y:this.Mh.start.y+this.Mh.step.y*this.ez}};this.Sv.length>0&&(t.start="columns"===this.Mh.scrollDimension?{x:t.start.x-1*this.Mh.step.x,y:t.start.y}:{x:t.start.x,y:t.start.y-1*this.Mh.step.y},o=!0);const e=new hg(this.IO,this.FO,this.ct,bt,[],t,this.EO,this.zO).Cy(this.$E.M()).ps(this.Vr)._a(this.Ma);r={shape:e,existingDataPointsCount:0,existingCoordinatesCount:0,allocatedCoordinatesCount:i,dataStartIndex:this.ez,hasJoint:!1,boundaries:e.Rn},this.Sv.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.Mh.resolution};o&&(u.values.unshift(this.rz),u.lengthPrimary+=1,r.hasJoint=!0),r.shape.Iy(u),r.existingDataPointsCount+=a,r.existingCoordinatesCount+=a+(o?1:0),r.boundaries=r.shape.Rn,this.rz=l[l.length-1],this.ez+=a,e+=a}while(e{t.shape.dispose().OD()})),this.Sv.length=0,this.Rn=this.Mh.initialBoundaries,this.ez=0,this.rz=void 0,this}ps(t){return super.ps(t),this.Sv.forEach((t=>t.shape.ps(this.Vr))),this}_a(t){return super._a(t),this.Sv.forEach((t=>t.shape._a(this.Ma))),this}Cy(t){return super.Cy(t),this.Sv.forEach((e=>e.shape.Cy(t))),this}dispose(){return super.dispose(),this.Sv.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.Sv.forEach((e=>e.shape.setVisible(t))),this}OD(){return this.Sv.forEach((t=>t.shape.OD())),this}jS(t){const e=nt(t,this.ct,this.engine.ct),i=this.Sv.reduce(((i,s)=>{const r=s.shape.jS(t);if(r){const t=Re(nt(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.ez||"rows"===this.Mh.scrollDimension&&e>=this.ez)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}aC(t){const e=nt(t,this.ct,this.engine.ct),i=this.Sv.reduce(((i,s)=>{const r=s.shape.aC(t);if(r){const t=Re(nt(r,this.ct,this.engine.ct),e);if(void 0===i||t=this.ez||"rows"===this.Mh.scrollDimension&&e>=this.ez)return;return{x:i.result.x,y:i.result.y,column:t,row:e,cellValue:i.result.cellValue}}}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}co(){return 0}do(){return 0}Ir(t){return super.Ir(t),this.Sv.forEach((e=>e.shape.Ir(t))),this}}const ug={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)=>ug.multiply(t,ug.translation(e,i)),rotate:(t,e)=>ug.multiply(t,ug.rotation(e)),scale:(t,e,i)=>ug.multiply(t,ug.scaling(e,i)),multiply(t,e){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],h=t[5],a=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],g=e[3],m=e[4],p=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+m*n+p*a,g*s+m*o+p*l,g*r+m*h+p*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 cg extends Os{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.nz=[],this.JD=new pf,this.oz=[u(0,0),u(0,0),u(0,0),u(0,0)],this.az=m(u(0,0),u(0,0)),this.lz=m(u(0,0),u(0,0)),this.uz=u(0,0),this.cz=u(0,0),this.jv=u(0,0),this.dz=u(0,0),this.fz=0,this.IO=t,this.FO=e,this.EO=n,this.zO=o,this.iD=t.PO(),this.FO=e,this.UR=t.Mh.Lh}Gs(){const t=this.Wr(),e=this.Hr(),i=this.pr.M();if(t){const t=this.iD,s=this.iD.ZD();if(this.JD.jB(this.ct),this.en.o){this.gz&&this.gz.YD(this),this.font.S(es(this.en.M()));const t=this.font.M();this.gz=this.iD.ys(t.properties.family),this.gz.$D(this)}const r=this.font.o,n=r||this.Kr.o;if(n&&this.gz){const e=this.font.M();[this.pz,this.lz]=this.gz.XD(this.Kr.M(),e.properties),this.nz.forEach((e=>{e.texCoordBuff&&t.ZB(e.texCoordBuff),e.vertexBuff&&t.ZB(e.vertexBuff)})),this.nz=this.pz.map((e=>({texCoordBuff:t.RB(e.texCoords,!1),texture:e.texture,info:e}))),this.en.o=!1,this.font.o=!1,this.Kr.o=!1}const o=this.ct.pi()||e,h=this.qr.o||this.Qr.o||this.Jr.o||this.tn.o||this.rn.o||this._t.o||n||o,a=this.rn.M(),l=Ze(u(this.Qr.M()+1,this.Jr.M()+1),.5);if(h&&this.pz&&(this.uz=u(-(a.left*s+this.lz.max.x-this.lz.min.x+a.right*s)*l.x-this.lz.min.x+a.right*s,-(a.bottom*s+this.lz.max.y-this.lz.min.y+a.top*s)*l.y-this.lz.min.y+a.top*s)),(h||o||this.sn.o||this.Nr())&&this.Vr!==F){if(this.pz){const e=Ke(this.qr.M(),this.tn.M()),i=nt(e,this.ct,this.Li.ct),r=Ze(i,s);this.dz=r;const o=ni(this.sn.M());this.fz=o,n&&this.nz.forEach((e=>{const i=e.info;i&&(e.vertexBuffLen=i.vertices.length/2,e.vertexBuff?t.mL(e.vertexBuff,i.vertices,!0):e.vertexBuff=t.RB(i.vertices,!0))}));const h=this._t.M(),c=[Ke(Ye(u((this.lz.min.x+(-h.left-a.left)*s+this.uz.x)/s,(this.lz.max.y+(h.top+a.top)*s+this.uz.y)/s),this.hn,o),i),Ke(Ye(u((this.lz.max.x+(h.right+a.right)*s+this.uz.x)/s,(this.lz.max.y+(h.top+a.top)*s+this.uz.y)/s),this.hn,o),i),Ke(Ye(u((this.lz.max.x+(h.right+a.right)*s+this.uz.x)/s,(this.lz.min.y+(-h.bottom-a.bottom)*s+this.uz.y)/s),this.hn,o),i),Ke(Ye(u((this.lz.min.x+(-h.left-a.left)*s+this.uz.x)/s,(this.lz.min.y+(-h.bottom-a.bottom)*s+this.uz.y)/s),this.hn,o),i)];this.oz=[nt(c[0],this.Li.ct,this.ct),nt(c[1],this.Li.ct,this.ct),nt(c[2],this.Li.ct,this.ct),nt(c[3],this.Li.ct,this.ct)];const d=ze(c);this.cz=u(-(d.max.x-d.min.x)*s*l.x-d.min.x*s+this.dz.x,-(d.max.y-d.min.y)*s*l.y-d.min.y*s+this.dz.y),this.mz=Je(d.max,d.min);const f=ze(this.oz),g=this.ct.Yt(f.min,this.cz),m=this.ct.Yt(f.max,this.cz);this.az=ze([g,m])}this.Vr instanceof $?this.$O=Mf(this.az,this.ct,this.Vr.getPosition(),this.Vr.getExtent(),this.Vr.getShape(),this.iD.ZD()):this.Vr instanceof Z?this.YO=Af(this.az,this.ct,this.Vr.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0)}const c=this.Vr instanceof z&&this.Vr,d=this.Vr instanceof $&&this.Vr,f=this.Vr instanceof Z&&this.Vr,g=c||d||f;(this.Nr()||r)&&(this.tB=g?this.iD.zB(df["2D"],df.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.UR}),df.Color({dataType:d?["gradient",d]:f?["gradient",f]:"uniform",maskTexture:!0})):void 0),this.yz=i&&g?this.yz||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this.UR})):void 0,this.qr.o=!1,this.Qr.o=!1,this.Jr.o=!1,this.tn.o=!1,this.sn.o=!1,this.Ur(this.Vr)}return this.nn=t,this}tD(t){if(this.Wr()){const e=1===t?this.yz:this.tB;if(!e||0===this.nz.length)return this;const i=this.iD.gl.drawingBufferWidth,s=this.iD.gl.drawingBufferHeight;let r=ug.projection(i,s,-1);const n=ug.translation(this.uz.x,this.uz.y),o=ug.translation(this.cz.x,this.cz.y);r=ug.translate(r,this.dz.x,this.dz.y),r=ug.multiply(r,o),r=ug.rotate(r,this.fz),r=ug.multiply(r,n),1===t&&(r=ug.scale(r,this.lz.max.x,this.lz.max.y)),this.iD.$D(e).VB(e,((e,i,s,n)=>{if(this.iD.uL(e("uMatrix"),r).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),this.UR&&this.iD.GB(n("uViewportSizePx"),[this.Li.Et().x*this.iD.ZD(),this.Li.Et().y*this.iD.ZD()]),1===t)this.iD.UB(e("uColor"),this.zO);else if(this.Vr instanceof z)this.iD.UB(e("uColor"),this.Vr.getColor());else if(this.Vr instanceof $&&this.$O){this.iD.GB(e("uCenter"),this.$O.center).GB(e("uDistance"),this.$O.distance).aL(e("uBounds"),this.$O.bounds).WB(e("uAspect"),this.$O.aspectRatio);const t=this.Vr.getColorStops();for(let i=0;i{this.iD.xL(i("aPos"),t.vertexBuff).xL(i("aMaskTextureCoord"),t.texCoordBuff).HB(e("uMaskTexture"),t.texture,0).Op(this.iD.gl.TRIANGLES,t.vertexBuffLen)})),!0}))}return this}Mi(){return this.Wr()?this.oz:[]}Ac(){return this.Wr()&&this.mz?this.mz:u(0,0)}Et(){if(this.Wr()&&this.az){const t=this.az;return u(t.max.x-t.min.x,t.max.y-t.min.y)}return u(0,0)}OD(){return this.nz.forEach((t=>{t.texCoordBuff&&this.iD.ZB(t.texCoordBuff),t.vertexBuff&&this.iD.ZB(t.vertexBuff)})),this.nz=[],this.gz&&this.gz.YD(this),this}yt(){return this.az.max.x}ft(){return this.az.min.x}xt(){return this.az.max.y}St(){return this.az.min.y}co(){return 0}do(){return 0}}class dg{constructor(t,e,i){this.Sz=new Set,this.xz=t=>(this.Sz.add(t),t),this.bz=t=>(this.Sz.delete(t),t.OD(),this),this.Li=t,this.Br=e,this.vz=i}QP(t){this.Sz.delete(t)&&this.Sz.add(t)}G(){for(const t of this.Sz)t.OD().dispose();this.Li.Qe(this.Br)}Bi(){return this.Li.Bi(),this}Je(){return this.Br}}class fg extends dg{constructor(){super(...arguments),this.Mz=y(void 0),this.Or=!1}Wy(t){return this.Mz.S(t),this}Qg(){return this.Mz.M()}}class gg extends fg{constructor(t,e,i){super(t,e,i),this.IO=t,this.gl=t.PO(),this._z=this.Sz}OB(t){const e=t instanceof Bs&&t;if(!e)return we;const i=e.ft(),s=e.yt(),r=e.St(),n=e.xt();if(i===Me||s===Ae||r===Me||n===Ae)return we;const o=e.co(),h=e.do(),a=ks({min:{x:i,y:r},max:{x:s,y:n}},{x:o,y:h},e.ct),l={min:nt(a.min,e.ct,t.Li.ct),max:nt(a.max,e.ct,t.Li.ct)},u=this.Mz.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.xt.Er()-e.Er()));this.Sz.clear();for(const e of t)this.Sz.add(e)}for(const t of this.Sz)t.Gs();return this}tD(t,e){const i=this.Mz.M();if(i&&this.gl.LB(i.x*this.gl.ZD()*e,i.y*this.gl.ZD()*e,i.width*this.gl.ZD()*e,i.height*this.gl.ZD()*e),1!==t)for(const e of this.Sz)e.getVisible()&&e.tD(t);else for(const e of this.Sz)e.getMouseInteractions()&&e.getVisible()&&e.tD(t);return this.gl.PB(!1),this}}class mg extends xd{constructor(t){super(t)}}class pg extends mg{constructor(t){super(t),this.Tz="attribute";const{vertices:e,drawSize:i,drawMode:s}=yg(t.gl);this._D=t.RB(e),this.ER=i,this.zR=s}Op(t,e,i,s){return this.iD.NB(this._D,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}).CL(this.zR,0,this.ER,e),this}lD(){this.iD.ZB(this._D)}}const yg=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 xg extends mg{constructor(t,e){super(t),this.Tz="attribute",this.Iz=e;const{vertices:i,indices:s}=Sg();this._D=t.RB(i),this.RR=t.yL(s),this.ER=s.length,this.zR=t.gl.TRIANGLES}Op(t,e,i,s){return this.iD.NB(this._D,0,{location:t.attribute("aEdge"),size:3},{location:i?t.attribute("aNormal"):void 0,size:3},{location:t.attribute("aInstanceGeo"),size:3}).wL(this.RR).WB(t.uniform("uEdgeRoundness"),this.Iz/2).IL(this.zR,this.ER,0,e),this}lD(){this.iD.ZB(this._D),this.iD.ZB(this.RR)}Fz(t){return this.Iz=t,this}Pz(){return this.Iz}}const Sg=()=>{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=be.multiply(o,-1),l=be.multiply(h,-1),u=i;e[i]={thicknessDirection:be.addVec(t,o,h),edge:be.addVec(a,l),normal:t},i+=1;const c=i;e[i]={thicknessDirection:be.addVec(t,a,h),edge:be.addVec(o,l),normal:t},i+=1;const d=i;e[i]={thicknessDirection:be.addVec(t,a,l),edge:be.addVec(o,h),normal:t},i+=1;const f=i;e[i]={thicknessDirection:be.addVec(t,o,l),edge:be.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=be.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=be.normalize(be.lerp(t,n.direction,o)),a=Math.PI/2-be.angle(h,t),l=be.addVec(be.multiply(be.multiply(n.direction,-1),1-Math.cos(a)),be.multiply(be.multiply(t,-1),1-Math.sin(a)),be.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.sL.aD.get(e);return i||(i=void 0!==e&&e>0?new xg(t,At(e,0,1)):new pg(t),t.sL.aD.set(e,i),i)};class bg extends sf{ym(t){return this._B=this.lm.M(),this.lm.S(t),this}Py(t){return this.Dz=t,this}Dy(){return this.Dz}}class Mg extends bg{constructor(t,e,i,s,r){super(t,e,i),this.Bz=t,this.EO=s,this.zO=r,this.IO=t.IO,this.iD=this.IO.PO()}}class Ag extends Mg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Dz="cull-back",this.Rn=De,this.Lz={},this.Oz=[],this.Vr=ls.fillStyle,this.lm.S(Ko)}Gs(t){const e=this.Oz,i=this.Vr,s=i!==F,r=this.Rz,n=this.Nr()||this.Ez!==r,o=this.MB(),h=this.pr.M(),a=this.pr.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.zz||0;let r=s;for(const t of e){const e=t.id;void 0!==e&&void 0!==this.Lz[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.TE&&i.set(this.TE),this.TE=i,this.Vz=e,this.Nz=s*t}const d=i instanceof V?i.getFallbackColor():void 0;for(const i of e){const e=i.id,s=void 0!==e&&this.Lz[e],r=[i.xCenter,i.yCenter,i.zCenter,i.xSize,i.ySize,i.zSize,i.color?i.color.r:d?d.r:void 0,i.color?i.color.g:d?d.g:void 0,i.color?i.color.b:d?d.b:void 0,i.color?i.color.a:d?d.a:void 0,i.value];if(s){for(let e=0;e0){const e=m({x:Me,y:Me,z:Me},{x:Ae,y:Ae,z:Ae});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.Rn=e}this.zz=r,this.Oz.length=0}return this.Ur(i),this.Ez=r,this.lm.o=!1,this.pr.o=!1,this}tD(t){const e=1===t?this.yz:this.tB,i=this.Gz,s=this.OR,r=this.Vr,n=this.zz,o=this.lm.M();return e&&s&&void 0!==n&&this.iD.VB(e,((h,a,l)=>{let u=!1;const c=a("aPos"),d=a("aOffsetAxis");this.iD.$D(e).lL(h("uScale"),this.Bz.JD.$B()).lL(h("uDisp"),this.Bz.JD.YB()).cL(h("uViewProjectionMatrix"),this.Uz).WB(h("uIsHighlighted"),1===t||2===t?0:this.br).UB(h("uHighlightColorOffset"),this.Ar).WB(h("uRenderEffectMask"),2===t?1:0);const f={location:c,size:3},g={location:d,size:3},m={location:void 0,size:4},p={location:void 0,size:1};if(1!==t&&"phong"===o.type&&this.iD.lL(h("uCameraLoc"),this.$z).lL(h("uLightLoc"),this.Yz).WB(h("uAmbientReflection"),o.ambientReflection).WB(h("uSpecularReflection"),o.specularReflection).WB(h("uDiffuseReflection"),o.diffuseReflection).WB(h("uShininess"),o.shininess).UB(h("uLightColor"),o.specularColor).UB(h("uAmbientColor"),o.ambientColor),1===t)this.iD.UB(h("uColor"),this.zO);else if(r instanceof z)this.iD.UB(h("uColorDiffuse"),r.getColor());else if(r instanceof V){const t=a("aColor");m.location=t}else if(r instanceof G){const t=r.getLookUpProperty(),e=r.getPalette();"value"===t&&(p.location=a("aLookupValue")),this.iD.HB(h("uLookupTexture"),this.HR.texture,0).WB(h("uLookupMin"),e.min).WB(h("uLookupMax"),e.max).WB(h("uLookupTextureHeightPx"),this.HR.textureHeight)}return s&&(this.iD.NB(s,1,f,g,m,p),i.Op(l,n,"phong"===o.type&&1!==t,!1),u=!0),u})),this}OD(){return this.OR&&(this.iD.ZB(this.OR),this.OR=void 0),this.IO.NL.vr(this.WR),this.HR=void 0,this.WR=void 0,this.tB=void 0,this}Cm(t){this.Oz=ie(this.Oz,t,{canReturnB:!0})}ps(t){return this.Vr=Is(this.Vr,t),this}gs(){return this.Vr}wm(t){return this.Rz=void 0!==t&&t>0?At(t,0,1):void 0,this}Wz(){return this.Rz}yt(){return this.Rn.max.x}ft(){return this.Rn.min.x}xt(){return this.Rn.max.y}St(){return this.Rn.min.y}vm(){return this.Rn.max.z}Mm(){return this.Rn.min.z}co(){return 0}do(){return 0}_m(){return 0}Nr(){return Cs(this.Gr,this.Vr)}Ur(t){this.Gr=t}}class wg extends xd{constructor(t,e){super(t),this.Tz="custom",this.BR=e;const{vertices:i,drawSize:s}=this.LR();this.OR=t.RB(i),this.ER=s}$D(t){return this.iD.NB(this.OR,0,{location:t.attribute("aSegmentPosition"),size:1},{location:t.attribute("aPerpendHorizontal"),size:1},{location:t.attribute("aPerpendVertical"),size:1}),this}Op(t){return this.iD.CL(this.iD.gl.TRIANGLE_STRIP,0,this.ER,t),this}LR(){const t=this.BR,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}}lD(){this.iD.ZB(this.OR)}}const Dg=(t,e=16)=>{let i=t.sL.nD.get(e);return i||(i=new wg(t,e),t.sL.nD.set(e,i),i)};class Tg extends Mg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Dz="cull-back",this.Xz=De,this.ua=[],this.jz=!1,this.sa=ls.lineStyle,this.lm.S(jo)}Gs(t){const e=this.jz,i=this.sa,s=this.ra!==i,r=this.MB(),n=e;if(e){this.Zz&&(this.iD.ZB(this.Zz),this.Zz=void 0);const t=jt(this.ua);this.Zz=this.iD.RB(t)}if(n&&(this.Xz=Ve(this.ua)),s||r){const t=8,e=i instanceof tt&&i.getFillStyle(),s=1===i.getThickness()?"primitive":"instanced";this.GR=void 0,e instanceof z&&("primitive"===s?this.GR={type:s,shader:this.iD.zB(df["3D"],df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0}),df.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.GR={type:s,shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:"uniform",shadingStyle:this.lm.M().type}),df.LineInstanced3D({axisWorldTranslation:bf(this.ct)})),geometry:Dg(this.iD,t),fillStyle:e}))}return this.jz=!1,this.ra=i,this.lm.o=!1,this}tD(t){if(1===t)return this;const e=this.iD.gl,i=this.GR,s=this.Zz,r=this.sa,n=this.lm.M();if(i&&s&&r instanceof tt)switch(i.type){case"instanced":{const o=.5*this.Lr.nm(r.thickness),h=i.fillStyle.getColor(),a=i.shader,l=i.geometry;this.iD.VB(a,((i,r,u)=>{this.iD.$D(a).lL(i("uScale"),this.Bz.JD.$B()).lL(i("uDisp"),this.Bz.JD.YB()).cL(i("uViewProjectionMatrix"),this.Uz).UB(i("uColorDiffuse"),h).WB(i("uOffsetWU"),o).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),"phong"===n.type&&this.iD.lL(i("uCameraLoc"),this.$z).lL(i("uLightLoc"),this.Yz).WB(i("uAmbientReflection"),n.ambientReflection).WB(i("uSpecularReflection"),n.specularReflection).WB(i("uDiffuseReflection"),n.diffuseReflection).WB(i("uShininess"),n.shininess).UB(i("uLightColor"),n.specularColor).UB(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.iD.vL(c,1),e.enableVertexAttribArray(c),e.vertexAttribPointer(d,3,e.FLOAT,!1,6*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(d,1),e.enableVertexAttribArray(d),l.$D(u).Op(this.ua.length/2),!0}));break}case"primitive":{const n=r instanceof tt?r.getFillStyle():void 0,o=n&&n instanceof z?n.getColor():void 0;if(o){const r=i.shader;this.iD.VB(r,((i,n)=>(this.iD.$D(r).lL(i("uScale"),this.Bz.JD.$B()).lL(i("uDisp"),this.Bz.JD.YB()).cL(i("uViewProjectionMatrix"),this.Uz).UB(i("uColor"),o).WB(i("uIsHighlighted"),this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0).NB(s,void 0,{location:n("aPos"),size:3}).Op(e.LINES,this.ua.length),!0)))}break}}return this}Kn(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.iD.ef.Ph&&s>i.length&>.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}}lD(){this.iD.ZB(this.OR)}}const Bg=(t,e)=>{const i=Math.round(e);i<3&&de(0,bt);const s=i;let r=t.sL.oD.get(Array.from(t.sL.oD.keys()).find((t=>t.sectors===i&&t.stacks===s)));return r||(r=new Eg(t,i,s),t.sL.oD.set({sectors:i,stacks:s},r),r)};class kg extends Mg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.Dz="cull-back",this.Sv=[],this.GR={},this.AE=new Wf(this.Sv,(t=>t.vertexBuffer&&this.iD.ZB(t.vertexBuffer)),!0),this.ca=[],this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=De,this.Hn=!1,this.sa=ls.lineStyle,this.Tm=ls.pointStyle3D,this.lm.S(Ko),this.kE={attributesPerVertex:3,prepareRenderData:(t,e)=>jt(t)}}Gs(t){const e=this.Hn,i=this.zn,s=this.Vn,r=s>0,n=this.sa,o=n!==this.ra,h=this.Tm,a=h!==this.Jz,l=this.MB(),u=this.pr.o,c=this.pr.M();this.Nn&&(this.Rn=Ge(this.Rn,this.Nn),this.Nn=void 0),r&&(this.ca=ie(this.ca,i,{canReturnB:!0}),this.En+=s);let d=i,f=s;if(e&&(this.Sv.forEach((t=>{t.existingCoordinatesCount=0,t.existingDataPointsCount=0,t.boundaries=De})),this.AE.pE(),d=this.ca,f=this.En),f>0){const t=1e5,e=Math.floor(this.IO.Qz/(this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),i=this.kr("ApplicationType",(t=>"UserSeries"===t.type))?f:1e3,s=At(i,t,e);this.AE.cE(d,s,((t,e,i,s)=>({existingDataPointsCount:i-s,existingCoordinatesCount:i,allocatedCoordinatesCount:t,jointPointsCount:s,lastDataPoint:e[i-1],boundaries:De,vertexBuffer:this.iD.gL(t*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i))})),((t,e,i,s)=>{this.iD.pL(t.vertexBuffer,t.existingCoordinatesCount*this.kE.attributesPerVertex,this.kE.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 z&&i,r=i instanceof G&&i,o=s||r,a=h instanceof ji&&h.getSize(),l=h instanceof ji&&h.getFillStyle(),u=l instanceof z&&l,d=l instanceof G&&l,f=u||d,g=h instanceof ji&&h.getWireframeStyle(),m=g&&g instanceof tt&&g,p=m&&m.getFillStyle(),y=p&&p instanceof z&&p,x=n.getThickness()<0||1===n.getThickness()&&this.kr("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.iD.zB(df["3D"],df.Color({dataType:S}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),mousePicking:c?{shader:this.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0}))}:void 0}:"instanced"===x&&e&&o&&(t.lines={type:"instanced",lineStyleSolid:e,fillStyleSolid:s,fillStylePaletted:r,shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:S,shadingStyle:this.lm.M().type}),df.LineInstanced3D({axisWorldTranslation:bf(this.ct)})),geometry:Ig(this.iD,e.getThickness()),mousePicking:c?{shader:this.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.LineInstanced3D({axisWorldTranslation:bf(this.ct)}))}:void 0}),t.markers=void 0,f){const e=te(h.getShape(),{cube:()=>vg(this.iD),sphere:()=>Cg(this.iD,h)});t.markers={geometry:e,pointStyle:h,pointSizeNWU:"number"==typeof a&&a,pointSizeAxis:"object"==typeof a&&a,fillStyleSolid:u,fillStylePaletted:d,shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty()]:"uniform",shadingStyle:this.lm.M().type,wireframe:!1!==y}),df.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:bf(this.ct),normalSource:e.Tz})),mousePicking:c?{shader:this.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:bf(this.ct),normalSource:void 0}))}:void 0,wireframe:m&&y&&{thickness:m.getThickness(),fillStyleSolid:y}}}if(this.GR=t,r){if(r&&r.lut.isValid){const t=r.getPalette();this.tV=this.IO.vR(t,this.iV,this.tV),this.iV=t}}else this.IO.NL.vr(this.iV),this.iV=void 0;if(d){if(d&&d.lut.isValid){const t=d.getPalette();this.sV=this.IO.vR(t,this.eV,this.sV),this.eV=t}}else this.IO.NL.vr(this.eV),this.eV=void 0}return this.Hn=!1,this.zn=[],this.Vn=0,this.ra=n,this.Jz=h,this.lm.o=!1,this.pr.o=!1,this}tD(t){var e,i;const s=this.iD.gl,{lines:r,markers:n}=this.GR,o=this.lm.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.iD.VB(e,((r,h,u)=>{let c=!1;return this.iD.$D(e).lL(r("uScale"),this.Bz.JD.$B()).lL(r("uDisp"),this.Bz.JD.YB()).cL(r("uViewProjectionMatrix"),this.Uz).WB(r("uOffsetWU"),this.Lr.nm(n.getThickness())).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.iD.lL(r("uCameraLoc"),this.$z).lL(r("uLightLoc"),this.Yz).WB(r("uAmbientReflection"),o.ambientReflection).WB(r("uSpecularReflection"),o.specularReflection).WB(r("uDiffuseReflection"),o.diffuseReflection).WB(r("uShininess"),o.shininess).UB(r("uLightColor"),o.specularColor).UB(r("uAmbientColor"),o.ambientColor),1===t?this.iD.UB(r("uColor"),this.zO):a?this.iD.UB(r("uColorDiffuse"),a.getColor()):l&&this.tV&&this.iD.HB(r("uLookupTexture"),this.tV.texture,0).WB(r("uLookupMin"),l.lut.min).WB(r("uLookupMax"),l.lut.max).WB(r("uLookupTextureHeightPx"),this.tV.textureHeight),this.Sv.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.iD.vL(e,1),s.enableVertexAttribArray(e),s.vertexAttribPointer(r,3,s.FLOAT,!1,3*Float32Array.BYTES_PER_ELEMENT,3*Float32Array.BYTES_PER_ELEMENT),this.iD.vL(r,1),s.enableVertexAttribArray(r),i.$D(u).Op(t.existingCoordinatesCount-1),c=!0})),c}))}if(r&&h&&"primitive"===r.type){const e=h,{fillStyleSolid:i,fillStylePaletted:n}=r;this.iD.VB(e,((r,o)=>{let h=!1;return this.iD.$D(e).lL(r("uScale"),this.Bz.JD.$B()).lL(r("uDisp"),this.Bz.JD.YB()).cL(r("uViewProjectionMatrix"),this.Uz).WB(r("uIsHighlighted"),1===t||2===t?0:this.br).UB(r("uHighlightColorOffset"),this.Ar).WB(r("uRenderEffectMask"),2===t?1:0),1===t?this.iD.UB(r("uColor"),this.zO):i?this.iD.UB(r("uColor"),i.getColor()):n&&this.tV&&this.iD.HB(r("uLookupTexture"),this.tV.texture,0).WB(r("uLookupMin"),n.lut.min).WB(r("uLookupMax"),n.lut.max).WB(r("uLookupTextureHeightPx"),this.tV.textureHeight),this.Sv.forEach((t=>{this.iD.NB(t.vertexBuffer,void 0,{location:o("aPos"),size:3}).Op(s.LINE_STRIP,t.existingCoordinatesCount),h=!0})),h}))}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.iD.VB(e,((n,a,c,d)=>{let f=!1;return this.iD.$D(e).lL(n("uScale"),this.Bz.JD.$B()).lL(n("uDisp"),this.Bz.JD.YB()).cL(n("uViewProjectionMatrix"),this.Uz).WB(d("uRatioNwuWu"),this.Bz.hV()).WB(n("uIsHighlighted"),1===t||2===t?0:this.br).UB(n("uHighlightColorOffset"),this.Ar).WB(n("uRenderEffectMask"),2===t?1:0),1!==t&&"phong"===o.type&&this.iD.lL(n("uCameraLoc"),this.$z).lL(n("uLightLoc"),this.Yz).WB(n("uAmbientReflection"),o.ambientReflection).WB(n("uSpecularReflection"),o.specularReflection).WB(n("uDiffuseReflection"),o.diffuseReflection).WB(n("uShininess"),o.shininess).UB(n("uLightColor"),o.specularColor).UB(n("uAmbientColor"),o.ambientColor),1===t?this.iD.UB(n("uColor"),this.zO):s?this.iD.UB(n("uColorDiffuse"),s.getColor()):r&&this.sV&&this.iD.HB(n("uLookupTexture"),this.sV.texture,0).WB(n("uLookupMin"),r.lut.min).WB(n("uLookupMax"),r.lut.max).WB(n("uLookupTextureHeightPx"),this.sV.textureHeight),u&&1!==t&&this.iD.WB(n("uWireframeThickness"),u.thickness).UB(n("uWireframeColor"),u.fillStyleSolid.getColor()),!1!==h&&this.iD.lL(n("uOffsetAxis"),[h.x,h.y,h.z]),!1!==l&&this.iD.WB(n("uOffsetNWU"),l),this.Sv.forEach((e=>{this.iD.NB(e.vertexBuffer,1,{location:a("aPos"),size:3}),i.Op(c,e.existingCoordinatesCount,"phong"===o.type&&1!==t,Boolean(u)&&1!==t),f=!0})),f}))}return this}Kn(t,e){Array.isArray(t)||(t=[t]),this.zn=ie(this.zn,t,{canReturnB:!0}),this.Vn+=t.length;const i=e||Ve(t);return this.Nn=this.Nn?Ge(this.Nn,i):i,this}ea(t){return this.sa="function"==typeof t?t(this.sa):t,this}ha(){return this.sa}hm(t){return this.Tm="function"==typeof t?t(this.Tm):t,this}rV(){return this.Tm}yt(){return this.Nn?Math.max(this.Nn.max.x,this.Rn.max.x):this.Rn.max.x}ft(){return this.Nn?Math.min(this.Nn.min.x,this.Rn.min.x):this.Rn.min.x}xt(){return this.Nn?Math.max(this.Nn.max.y,this.Rn.max.y):this.Rn.max.y}St(){return this.Nn?Math.min(this.Nn.min.y,this.Rn.min.y):this.Rn.min.y}vm(){return this.Nn?Math.max(this.Nn.max.z,this.Rn.max.z):this.Rn.max.z}Mm(){return this.Nn?Math.min(this.Nn.min.z,this.Rn.min.z):this.Rn.min.z}co(){return Se(this.sa)}do(){return Se(this.sa)}_m(){return Se(this.sa)}$n(){return this.ca}Un(){return this.zn}Jn(){return this.En}Qn(){return this.Vn}qn(){return this.Hn=!0,this.ca.length=0,this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=void 0,this}dispose(){return super.dispose(),this.AE.mE(),this.GR={},this.iV&&(this.IO.NL.vr(this.iV),this.iV=void 0),this.tV=void 0,this.eV&&(this.IO.NL.vr(this.eV),this.eV=void 0),this.sV=void 0,this}OD(){return this.dispose(),this}}const Ig=(t,e)=>Dg(t,e>50?20:e>20?16:e>10?12:e>5?8:6),Cg=(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 Pg extends Mg{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Dz="cull-back",this.Sv=[],this.AE=new Wf(this.Sv,(t=>t.vertexBuffer&&this.iD.ZB(t.vertexBuffer)),!1),this.ca=[],this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=De,this.Hn=!1,this.Mh=n,this.Pm=ls.pointStyle3D,this.lm.S(Ko);const o=!0===(null==n?void 0:n.individualPointColorEnabled),h=!0===(null==n?void 0:n.individualPointSizeEnabled),a=!0===(null==n?void 0:n.individualLookupValuesEnabled),l=!0===(null==n?void 0:n.individualPointSizeAxisEnabled);let u,c,d,f,g=0;g+=3,o&&(u=g,g+=4),h&&(c=g,g+=1),a&&(d=g,g+=1),l&&(f=g,g+=3);const m=((t,e,i,s)=>t||e||i||s?!t||e||i||s?t||!e||i||s?t||e||!i||s?t||e||i||!s?(r,n,o)=>{const h=3+(t?4:0)+(e?1:0)+(i?1:0)+(s?3:0),a=r.length,l=new Float32Array(a*h);let u=0,c=u;for(let t=0;t((t,e)=>{const i=e&&e.getSize();let s={x:1,y:1,z:1};"object"==typeof i&&(s=i);const r=t.length,n=new Float32Array(6*r);let o=0;for(let e=0;e(t=>{const e=t.length,i=new Float32Array(4*e);for(let s=0,r=0;s((t,e)=>{const i=e&&e.getSize();let s=1;"number"==typeof i&&(s=i);const r=t.length,n=new Float32Array(4*r);for(let e=0,i=0;e((t,e)=>{const i=e&&e instanceof V&&e.getFallbackColor()||E,s=t.length,r=new Float32Array(7*s);for(let e=0,n=0;ejt(t))(o,h,a,l);this.kE={individualPointColorEnabled:o,individualPointSizeEnabled:h,individualLookupValuesEnabled:a,individualPointSizeAxisEnabled:l,attributesPerVertex:g,attributeOffsetCoordinate:0,attributeOffsetColor:u,attributeOffsetSize:c,attributeOffsetLookUpValue:d,attributeOffsetPointSize3D:f,prepareRenderData:(t,e)=>m(t,this.Pm,this.Pm.fillStyle)}}Gs(t){const e=this.Hn,i=this.zn,s=this.Vn,r=s>0,n=this.Pm,o=this.Pm!==this.nV,h=this.pr.M(),a=this.pr.o,l=this.MB();this.Nn&&(this.Rn=Ge(this.Rn,this.Nn),this.Nn=void 0),r&&(this.ca=ie(this.ca,i,{canReturnB:!0}),this.En+=s);let u=i,c=s;if(e&&(this.Sv.forEach((t=>{t.existingDataPointsCount=0,t.existingCoordinatesCount=0,t.boundaries=De})),this.AE.pE(),u=this.ca,c=this.En),c>0){const t=Math.floor(this.IO.Qz/(this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT)),e=At(c,1e5,t);this.AE.cE(u,e,((t,e,i)=>({existingDataPointsCount:i,existingCoordinatesCount:i,allocatedCoordinatesCount:t,boundaries:De,vertexBuffer:this.iD.gL(t*this.kE.attributesPerVertex,this.kE.prepareRenderData(e,i))})),((t,e,i)=>{this.iD.pL(t.vertexBuffer,t.existingCoordinatesCount*this.kE.attributesPerVertex,this.kE.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.kE.individualPointColorEnabled,r=this.kE.individualPointSizeEnabled,o=this.kE.individualPointSizeAxisEnabled,a=this.kE.individualLookupValuesEnabled,l=i instanceof z&&i,u=i instanceof V&&i,c=i instanceof G&&i,d=i===F&&F;if(u&&!s){const t="LCJS misusage error: Series individualPointColorEnabled flag must be set if using IndividualPointFill !";throw gt.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 gt.alert(t),new Error(t)}const f=n instanceof ji&&n,g=f&&f.getWireframeStyle(),m=g&&g instanceof tt&&g,p=m&&m.getFillStyle(),y=p&&p instanceof z&&p;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=te(n.getShape(),{cube:()=>vg(this.iD),sphere:()=>Lg(this.iD,n,r)});t={type:"instanced",shader:this.iD.zB(df["3D"],df.ColorShaded3D({dataType:i,shadingStyle:this.lm.M().type,wireframe:!1!==y}),df.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:bf(this.ct),normalSource:o.Tz})),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.iD.zB(df["3D"],df.Color({dataType:"uniform"}),df.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:bf(this.ct),normalSource:void 0})),geometry:o,wireframe:m&&y&&{thickness:m.getThickness()<0?1:m.getThickness(),fillStyleSolid:y}}}else n instanceof Ki&&"number"==typeof e&&(t={type:"primitive",shader:this.iD.zB(df["3D"],df.PointSize(f),df.Color({dataType:i}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:s,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,mousePickingShader:h&&this.iD.zB(df["3D"],df.PointSize(f),df.Color({dataType:"uniform"}),df.VertexLocation({axisWorldTranslation:bf(this.ct),normalSource:void 0}))})}if(this.GR=t,i instanceof G){const t=i.getPalette();this.JE=this.IO.vR(t,this.WR,this.JE),this.WR=t}else this.JE=void 0,this.IO.NL.vr(this.WR),this.WR=void 0}return this.Hn=!1,this.zn=[],this.Vn=0,this.nV=n,this.lm.o=!1,this}tD(t){const e=this.iD.gl,i=this.GR;if(!i)return this;const s=1===t?i.mousePickingShader:i.shader;if(!s)return this;const r=this.lm.M(),{fillStyleSolid:n,fillStylePalette:o,useIndividualPointSize:h}=i,a="instanced"===i.type&&i.useIndividualPointSize3D,l="instanced"===i.type&&i.wireframe;return this.iD.VB(s,((u,c,d,f)=>{let g=!1;if(this.iD.$D(s).lL(u("uScale"),this.Bz.JD.$B()).lL(u("uDisp"),this.Bz.JD.YB()).cL(u("uViewProjectionMatrix"),this.Uz).WB(u("uIsHighlighted"),1===t||2===t?0:this.br).UB(u("uHighlightColorOffset"),this.Ar).WB(u("uRenderEffectMask"),2===t?1:0),"instanced"===i.type){const{pointSizeAxis:t,pointSizeNWU:e}=i;!1!==t&&!1===a&&this.iD.lL(u("uOffsetAxis"),[t.x,t.y,t.z]),!1!==e&&!1===h&&this.iD.WB(u("uOffsetNWU"),e).WB(f("uRatioNwuWu"),this.Bz.hV())}else if("primitive"===i.type){const{pointSizePixels:t}=i;h||this.iD.WB(u("uPointSize"),t).WB(u("uDevicePixelRatio"),this.iD.ZD())}return 1===t?this.iD.UB(u("uColor"),this.zO):("instanced"===i.type?("phong"===r.type&&this.iD.lL(u("uCameraLoc"),this.$z).lL(u("uLightLoc"),this.Yz).WB(u("uAmbientReflection"),r.ambientReflection).WB(u("uSpecularReflection"),r.specularReflection).WB(u("uDiffuseReflection"),r.diffuseReflection).WB(u("uShininess"),r.shininess).UB(u("uLightColor"),r.specularColor).UB(u("uAmbientColor"),r.ambientColor),l&&this.iD.WB(u("uWireframeThickness"),l.thickness).UB(u("uWireframeColor"),l.fillStyleSolid.getColor()),n&&this.iD.UB(u("uColorDiffuse"),n.getColor()),i.fillStyleEmpty&&this.iD.UB(u("uColorDiffuse"),B)):"primitive"===i.type&&n&&this.iD.UB(u("uColor"),n.getColor()),o&&this.JE&&this.iD.HB(u("uLookupTexture"),this.JE.texture,0).WB(u("uLookupMin"),o.lut.min).WB(u("uLookupMax"),o.lut.max).WB(u("uLookupTextureHeightPx"),this.JE.textureHeight)),this.Sv.forEach(((s,n)=>{e.bindBuffer(e.ARRAY_BUFFER,s.vertexBuffer);const o=c("aPos");if(e.vertexAttribPointer(o,3,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetCoordinate*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(o,1),e.enableVertexAttribArray(o),i.fillStyleIndividual&&void 0!==this.kE.attributeOffsetColor&&1!==t){const t=c("aColor");e.vertexAttribPointer(t,4,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetColor*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}if(h&&void 0!==this.kE.attributeOffsetSize){"instanced"===i.type?this.iD.WB(f("uRatioNwuWu"),this.Bz.hV()):"primitive"===i.type&&this.iD.WB(u("uDevicePixelRatio"),this.iD.ZD());const t=c("instanced"===i.type?"aOffsetNWU":"aPointSize");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetSize*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}if(a&&void 0!==this.kE.attributeOffsetPointSize3D&&"instanced"===i.type){const t=c("aOffsetAxis");e.vertexAttribPointer(t,3,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetPointSize3D*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}if(i.fillStylePalette&&"value"===i.fillStylePalette.getLookUpProperty()&&void 0!==this.kE.attributeOffsetLookUpValue&&1!==t){const t=c("aLookupValue");e.vertexAttribPointer(t,1,e.FLOAT,!1,this.kE.attributesPerVertex*Float32Array.BYTES_PER_ELEMENT,this.kE.attributeOffsetLookUpValue*Float32Array.BYTES_PER_ELEMENT),"instanced"===i.type&&this.iD.vL(t,1),e.enableVertexAttribArray(t)}"instanced"===i.type?(i.geometry.Op(d,s.existingCoordinatesCount,"phong"===r.type&&1!==t,Boolean(l)&&1!==t),g=!0):"primitive"===i.type&&(this.iD.Op(e.POINTS,s.existingCoordinatesCount),g=!0)})),g})),this}Kn(t,e){Array.isArray(t)||(t=[t]),this.zn=ie(this.zn,t,{canReturnB:!0}),this.Vn+=t.length;const i=e||Ve(t);return this.Nn=this.Nn?Ge(this.Nn,i):i,this}Dm(t){return this.Pm="function"==typeof t?t(this.Pm):t,this}oV(){return this.Pm}yt(){return this.Nn?Math.max(this.Nn.max.x,this.Rn.max.x):this.Rn.max.x}ft(){return this.Nn?Math.min(this.Nn.min.x,this.Rn.min.x):this.Rn.min.x}xt(){return this.Nn?Math.max(this.Nn.max.y,this.Rn.max.y):this.Rn.max.y}St(){return this.Nn?Math.min(this.Nn.min.y,this.Rn.min.y):this.Rn.min.y}vm(){return this.Nn?Math.max(this.Nn.max.z,this.Rn.max.z):this.Rn.max.z}Mm(){return this.Nn?Math.min(this.Nn.min.z,this.Rn.min.z):this.Rn.min.z}co(){const t=this.Pm,e=t.getSize();return"number"==typeof e?t instanceof ji?e/2:t instanceof Ki?5:0:0}do(){return this.co()}_m(){return this.co()}$n(){return this.ca}Un(){return this.zn}Jn(){return this.En}Qn(){return this.Vn}qn(){return this.Hn=!0,this.ca.length=0,this.En=0,this.zn=[],this.Vn=0,this.Rn=De,this.Nn=void 0,this}dispose(){return super.dispose(),this.AE.mE(),this.IO.NL.vr(this.WR),this.WR=void 0,this.JE=void 0,this.GR=void 0,this}OD(){return this.dispose(),this}}const Lg=(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 Rg extends Mg{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Dz="disabled",this.Vr=ls.fillStyle,this.Ma=ls.lineStyle,this.$E=y("bilinear"),this.aV=[],this.lV=De,this.uV=void 0,this.GR={},this.cV=!1,this.lm.S(jo);const o="columns"===s.dataOrder?s.columns:s.rows,h="columns"===s.dataOrder?s.rows:s.columns;this.Mh={...s,primaryDimensionVectorsCount:o,secondaryDimensionVectorsCount:h},this.lV={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.dV=new Array(this.Mh.primaryDimensionVectorsCount).fill(void 0),this.eC=new hg(this.IO,t.IO.fV,t.Li.ct,bt,[],{...this.Mh,start:{x:0,y:0},step:{x:1,y:1}},-1,E)._a(J),this.eC.jE=eg;const a=this.eC.ZE.gridTiles.map((t=>{const e=t.sizeHeatmapDataVectors,i=t.sizeUniqueHeatmapDataVectors,s=t.iFirstVector,r=t.iFirstUniqueVector,n="columns"===this.Mh.dataOrder?{x:this.Mh.step.x*(t.sizeHeatmapDataVectors.primary-1),z:this.Mh.step.z*(t.sizeHeatmapDataVectors.secondary-1)}:{x:this.Mh.step.x*(t.sizeHeatmapDataVectors.secondary-1),z:this.Mh.step.z*(t.sizeHeatmapDataVectors.primary-1)},o="columns"===this.Mh.dataOrder?{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.primary,z:this.Mh.start.z+this.Mh.step.z*t.iFirstVector.secondary}:{x:this.Mh.start.x+this.Mh.step.x*t.iFirstVector.secondary,z:this.Mh.start.z+this.Mh.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.eC.ZE.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.gV={gridTiles:a,gridTileSizes:l,largestGridTileSize:u}}pV(t){this.mV=t,this.uV=void 0}yV(t){"columns"===this.Mh.dataOrder?(this.lV.min.x=Math.min(this.Mh.start.x,this.Mh.start.x+(this.Mh.columns-1)*this.Mh.step.x)+t,this.lV.max.x=Math.max(this.Mh.start.x,this.Mh.start.x+(this.Mh.columns-1)*this.Mh.step.x)+t):(this.lV.min.z=Math.min(this.Mh.start.z,this.Mh.start.z+(this.Mh.rows-1)*this.Mh.step.z)+t,this.lV.max.z=Math.max(this.Mh.start.z,this.Mh.start.z+(this.Mh.rows-1)*this.Mh.step.z)+t),this.SV=t}Gs(t){const e=this.aV,i=this.Vr,s=i instanceof z&&i,r=i instanceof G&&i,n=Cs(this.Gr,i),o=r&&r.getPalette(),h=this.Ma,a=h instanceof tt&&h,l=a&&a.getFillStyle(),u=l&&l instanceof z&&l,c=!1!==u,d=h!==this.Wa,f=this.$E.o,g=this.$E.M(),m=this.lm.M(),p=this.MB(),y=this.pr.M();this.eC.Gs();const x=this.eC.KE;if(!x)return this;this.xV=this.xV||this.bV(x);const S=this.xV;this.vV(S);const v=ig(e,S,void 0,(t=>t.sizeGeometryDataVectors));if(v.size>0&&(ng(this.iD,v,(t=>t.heightmapData),(t=>t.heightmapDataTexture)),this.cV=!0),"phong"===m.type&&(v.size>0||p)){const t=this.iD.gl,e=this.iD.zB(df["2D"],df.DrawToNormalTexture({flipXZ:"rows"===this.Mh.dataOrder,vertexIdSource:this.iD.hO(),normalTextureType:this.iD.gl2?"uint":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.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.iD.GL.tD((()=>{this.iD.VB(e,((r,n,h,a)=>(this.iD.$D(e).rO(h,o).GB(r("uTileDimensionsXZ"),["columns"===this.Mh.dataOrder?i.sizeHeatmapData.primary:i.sizeHeatmapData.secondary,"columns"===this.Mh.dataOrder?i.sizeHeatmapData.secondary:i.sizeHeatmapData.primary]).oL(r("uTileDimensions"),[i.sizeHeatmapData.primary,i.sizeHeatmapData.secondary]).GB(r("uTileStartLocationAxisXZ"),[s.startLocationAxis.x+("columns"===this.Mh.dataOrder&&this.SV||0),s.startLocationAxis.z+("rows"===this.Mh.dataOrder&&this.SV||0)]).GB(r("uTileSizeAxisXZ"),[s.sizeAxis.x,s.sizeAxis.z]).HB(r("uHeightmapTexture"),s.heightmapDataTexture,1).Op(t.POINTS,o),!0)))}),r,n,void 0,this.Li.Xe(),0)}))}))}const b=this.GR;if(n||d||f){o?(this.JE=this.IO.vR(o,this.QE,this.JE),this.QE=o):(this.JE=void 0,this.IO.NL.vr(this.QE),this.QE=void 0);const t=a&&u?{wireframeSolid:a,wireframeFillSolid:u}:void 0;s?b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"solid",fillStyleSolid:s},wireframe:t}:this.JE&&r&&"value"===r.getLookUpProperty()?b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:["lookup","value"],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"intensity",fillStylePaletted:r,colorLookupTexture:this.JE},wireframe:t}:this.JE&&r?b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:["lookup",r.getLookUpProperty()],interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:{fillMode:"xyz",fillStylePaletted:r,colorLookupTexture:this.JE},wireframe:t}:c&&(b.surface={shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:void 0,interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:m.type,wireframe:c,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN})),fill:void 0,wireframe:t})}return b.mousePicking=y?this.GR.mousePicking||{shader:this.iD.zB(df["3D"],df.SurfaceGrid({axisWorldTranslation:bf(this.ct),fillColor:"uniform",interpolation:"bilinear"===g&&"bilinear",flipXZ:"rows"===this.Mh.dataOrder,shadingStyle:"simple",wireframe:!1,instanceIdSource:this.iD.nO(),normalTextureType:this.iD.gl2?"uint":"ubyte",intensityTextureType:this.iD.zL?"float":"ubyte",heightmapTextureType:this.iD.zL?"float":"ubyte",littleEndian:this.iD.IS_MACHINE_LITTLE_ENDIAN}))}:void 0,this.GR=b,this.aV.length=0,this.Gr=i,this.Wa=h,this.lm.o=!1,this}bV(t){const e=this.gV.gridTiles.map((e=>{const i=rg(this.iD,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.gV.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.iD.RB([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.iD.gl.TRIANGLES;return{gridTiles:e,gridTileSizes:i,rectangleLocationsBuffer:s,rectangleLocationsDrawLength:6,rectangleLocationsDrawMode:r}}vV(t){var e;if("phong"===this.lm.M().type)for(let i=0;i{t.normalmapTexture&&(this.iD.RD(t.normalmapTexture),t.normalmapTexture=void 0)}))}tD(t){var e,i,s,r;const n=this.iD.gl,o=this.xV;if(!o)return this;const h=this.lm.M(),a=this.GR,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.iD.VB(l,((e,i,s,r)=>{let a=!1;if(this.iD.$D(l).oO(s,this.gV.largestGridTileSize.cells).lL(e("uScale"),this.Bz.JD.$B()).lL(e("uDisp"),this.Bz.JD.YB()).cL(e("uViewProjectionMatrix"),this.Uz).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),1!==t&&("phong"===h.type&&this.iD.lL(e("uCameraLoc"),this.$z).lL(e("uLightLoc"),this.Yz).WB(e("uAmbientReflection"),h.ambientReflection).WB(e("uSpecularReflection"),h.specularReflection).WB(e("uDiffuseReflection"),h.diffuseReflection).WB(e("uShininess"),h.shininess).UB(e("uLightColor"),h.specularColor).UB(e("uAmbientColor"),h.ambientColor),u)){const{wireframeFillSolid:t,wireframeSolid:i}=u,s=i.getThickness()<0?1:i.getThickness();this.iD.UB(e("uWireframeColor"),t.getColor()).WB(e("uWireframeThickness"),s)}return 1===t?this.iD.UB(e("uColorDiffuse"),this.zO):"solid"===(null==c?void 0:c.fillMode)&&this.iD.UB(e("uColorDiffuse"),c.fillStyleSolid.getColor()),o.gridTileSizes.forEach((s=>{this.iD.GB(e("uTileDimensionsXZ"),["columns"===this.Mh.dataOrder?s.sizeHeatmapData.primary:s.sizeHeatmapData.secondary,"columns"===this.Mh.dataOrder?s.sizeHeatmapData.secondary:s.sizeHeatmapData.primary]).oL(e("uTileDimensions"),[s.sizeHeatmapData.primary,s.sizeHeatmapData.secondary]),s.tiles.forEach((r=>{let h=0,l=(r.sizeHeatmapDataVectors.primary-1)*(r.sizeHeatmapDataVectors.secondary-1);if(this.mV){const t=this.mV.fill.iFirstPrimary,e=this.mV.fill.iFirstPrimary+this.mV.fill.amountPrimary-1,i=r.iFirstVector.primary,n=r.iFirstVector.primary+r.sizeHeatmapDataVectors.primary-1;if(i>e||nm(Math.max(t,i),Math.min(e,s)))(t,e,i,n);h=(o.min-r.iFirstVector.primary)*(s.sizeGeometryData.secondary-1),l=(o.max-o.min)*(s.sizeGeometryData.secondary-1)}if(!(h<0||l<=0)){if("intensity"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.iD.HB(e("uLookupTexture"),t.texture,1).WB(e("uLookupMin"),i.getPalette().min).WB(e("uLookupMax"),i.getPalette().max).WB(e("uLookupTextureHeightPx"),t.textureHeight).HB(e("uTileIntensityValues"),r.intensityDataTexture,2).aL(e("uTileBoundsAxisXZ"),[r.startLocationAxis.x+("columns"===this.Mh.dataOrder&&this.SV||0),r.startLocationAxis.z+("rows"===this.Mh.dataOrder&&this.SV||0),r.sizeAxis.x,r.sizeAxis.z])}if("xyz"===(null==c?void 0:c.fillMode)){const{colorLookupTexture:t,fillStylePaletted:i}=c;this.iD.HB(e("uLookupTexture"),t.texture,1).WB(e("uLookupMin"),i.getPalette().min).WB(e("uLookupMax"),i.getPalette().max).WB(e("uLookupTextureHeightPx"),t.textureHeight)}1!==t&&"phong"===this.lm.M().type&&r.normalmapTexture&&this.iD.HB(e("uNormalmapTexture"),r.normalmapTexture,3),this.iD.NB(o.rectangleLocationsBuffer,0,{location:i("aGeoCellOffset"),size:2},{location:u?i("aTriangleBary"):void 0,size:3}).dL(e("uBaseInstance"),h).GB(e("uTileStartLocationAxisXZ"),[r.startLocationAxis.x+("columns"===this.Mh.dataOrder&&this.SV||0),r.startLocationAxis.z+("rows"===this.Mh.dataOrder&&this.SV||0)]).GB(e("uTileSizeAxisXZ"),[r.sizeAxis.x,r.sizeAxis.z]).HB(e("uHeightmapTexture"),r.heightmapDataTexture,0).CL(o.rectangleLocationsDrawMode,0,o.rectangleLocationsDrawLength,l),a=!0,n.bindBuffer(n.ARRAY_BUFFER,null)}}))})),a})),this}dispose(){return super.dispose(),this.eC.dispose(),this.IO.NL.vr(this.QE),this.QE=void 0,this.JE=void 0,this.xV&&(this.xV.gridTileSizes.forEach((t=>{})),this.xV.gridTiles.forEach((t=>{this.iD.RD(t.heightmapDataTexture),t.normalmapTexture&&this.iD.RD(t.normalmapTexture)})),this.iD.ZB(this.xV.rectangleLocationsBuffer),this.xV=void 0),this.GR={},this}OD(){return this.dispose(),this.eC.OD(),this}Iy(t){return this.eC.Iy(t),this}Fy(t){this.aV.push(t),sg(this.gV.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.dV[n];if(e)i=ie.max?s:e.max;else{e={min:Me,max:Ae},this.dV[n]=e;for(let n=0;no?s:o,e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}}}})),this.uV={min:i,max:s},this.uV}}class Fg extends Mg{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Dz="disabled",this.ez=0,this.rz={};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.Mh={...s,initialBoundaries:o,scrollDimensionSize:"columns"===s.scrollDimension?s.columns:s.rows,staticDimensionSize:"columns"===s.scrollDimension?s.rows:s.columns},this.lV=o;const h=()=>({shape:new Rg(this.Bz,bt,this.Mr,{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.EO,this.zO).dispose(),hasData:!1});this.Sv=[h(),h()]}Gs(t){return this.Sv.forEach((e=>{e.shape.Gs(t)})),this}tD(t){return this.Sv.forEach((e=>{e.hasData&&(e.shape.Uz=this.Uz,e.shape.$z=this.$z,e.shape.Yz=this.Yz,e.shape.tD(t))})),this}qn(){return this.ez=0,this.rz={},this.lV=this.Mh.initialBoundaries,this.Sv.forEach((t=>{t.shape.dispose(),t.shape.cV=!1,t.hasData=!1})),this}Ly(t){var e;const i=this.Sv[0],s=this.Sv[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.ez/this.Mh.scrollDimensionSize)%this.Sv.length,o=this.Sv[e],h=this.ez%this.Mh.scrollDimensionSize,a=this.Mh.scrollDimensionSize-h,l=0===h,u=Math.min(a,r),c=h+u,d=h,f=d+1,g=n,m=n+u,p=this.ez>=this.Mh.scrollDimensionSize&&c<=this.Mh.scrollDimensionSize-1,y=l;if(l){const t="columns"===this.Mh.scrollDimension?this.Mh.start.x+(this.ez-1)*this.Mh.step.x:this.Mh.start.z+(this.ez-1)*this.Mh.step.z;o.shape.yV(t)}const x=p?0:1,S=c+(p?1:0);o.shape.pV({fill:{iFirstPrimary:x,amountPrimary:S},wireframe:{iFirstPrimary:x,amountPrimary:S,connectNext:!1}});const v=o===i?s:i,b=c+1,M=1+this.Mh.scrollDimensionSize-b;v.shape.pV({fill:{iFirstPrimary:b,amountPrimary:M},wireframe:{iFirstPrimary:b,amountPrimary:M-1,connectNext:!0}});const A={};if(t.heightMapValues){const e=t.heightMapValues.slice(g,m);let i=!1;y&&this.rz.yValues&&(i=!0,e.splice(0,0,this.rz.yValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Mh.staticDimensionSize,values:e,type:"y"};o.shape.Fy(s),o.hasData=!0,A.yValues=e[u-1]}if(t.intensityValues){const e=t.intensityValues.slice(g,m);let i=!1;y&&this.rz.intensityValues&&(i=!0,e.splice(0,0,this.rz.intensityValues));const s={startPrimary:i?d:f,startSecondary:0,lengthPrimary:e.length,lengthSecondary:this.Mh.staticDimensionSize,values:e,type:"intensity"};o.shape.Iy(s),o.hasData=!0,A.intensityValues=e[u-1]}this.ez+=u,n+=u,this.rz=A}while(ne.shape.Cy(t))),this}Ty(){return this.Sv[0].shape.Ty()}ps(t){return this.Sv.forEach((e=>e.shape.ps(t))),this}gs(){return this.Sv[0].shape.gs()}_a(t){return this.Sv.forEach((e=>e.shape._a(t))),this}Aa(){return this.Sv[0].shape.Aa()}OD(){return this.dispose(),this.Sv.forEach((t=>t.shape.OD())),this}dispose(){return super.dispose(),this.Sv.forEach((t=>t.shape.dispose())),this}setVisible(t){return super.setVisible(t),this.Sv.forEach((e=>e.shape.setVisible(t&&e.hasData))),this}ym(t){return super.ym(t),this.Sv.forEach((e=>e.shape.ym(t))),this}yt(){return this.lV.max.x}ft(){return this.lV.min.x}xt(){return Math.max(this.Sv[0].shape.xt(),this.Sv[1].shape.xt())}St(){return Math.min(this.Sv[0].shape.St(),this.Sv[1].shape.St())}vm(){return this.lV.max.z}Mm(){return this.lV.min.z}co(){return 0}do(){return 0}_m(){return 0}Ir(t){return super.Ir(t),this.Sv.forEach((e=>e.shape.Ir(t))),this}}class _g extends dg{constructor(t,e,i,s){super(t,e,i),this._V=45,this.AV=.1,this.wV=100,this.$z=f(0,0,1),this.kV=f(0,0,-1),this.CV=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],this.lm=new $o,this.ct=s}Hy(){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.Li.Et();return{x:n*h.x,y:o*h.y,width:s*h.x,height:r*h.y}}setCameraLocation(t){return this.$z=t,this}getCameraLocation(){return this.$z}setCameraDirection(t){return this.kV=be.normalize(t),this}getCameraDirection(){return this.kV}setLightLocation(t){return this.Yz=t,this}getLightLocation(){return this.Yz}TV(){return f(this.CV[0],this.CV[1],this.CV[2])}IV(){return f(this.CV[4],this.CV[5],this.CV[6])}}class Og extends _g{constructor(t,e,i,s){super(t,e,i,s),this.JD=new yf,this.FV=!0,this.IO=t,this.gl=t.PO(),this._z=this.Sz,this.PV=this.Li.cr((()=>{this.FV=!0})),this.DV=s.H((()=>{this.FV=!0}))}OB(t){const e=t.ft(),i=t.St(),s=t.Mm(),r=t.yt(),n=t.xt(),o=t.vm();if(e===Me||r===Ae||i===Me||n===Ae||s===Me||o===Ae)return we;const h=t.co(),a=t.do(),l=t._m(),u=Math.abs(t.Lr.nm(h)*t.ct.x.st()),c=Math.abs(t.Lr.nm(a)*t.ct.y.st()),d=Math.abs(t.Lr.nm(l)*t.ct.z.st()),f=e-u,g=r+u,m=i-c,p=n+c,y=s-d,x=o+d;let S;return[{x:f,y:m,z:y},{x:g,y:m,z:y},{x:f,y:p,z:y},{x:g,y:p,z:y},{x:f,y:m,z:x},{x:g,y:m,z:x},{x:f,y:p,z:x},{x:g,y:p,z:x}].map((e=>t.Lr.om(e))).forEach((t=>{if(!t)return;const e={min:t,max:t};S=S?Ne(S,{min:t,max:t}):e})),S||we}Az(t){const e=Array.from(this._z.values());for(let i=0;ife()));const{viewProjectionMatrix:s}=this.BV();this.LV();const r=[t.x,t.y,t.z],n=[e.x,e.y,e.z];return this.Sz.forEach((t=>{t.Uz=s,t.$z=r,t.Yz=n,t.Gs(i)})),this}BV(){if(!this.FV&&this.Uz)return{viewProjectionMatrix:this.Uz};const t=this.Hy(),e=t.width/t.height;this.EV=yd.projectionPerspective(this._V,e,this.AV,this.wV);const i=this.$z;this.CV[12]=i.x,this.CV[13]=i.y,this.CV[14]=i.z;const s=this.kV,r=f(0,1,0),n=be.multiply(s,-1),o=be.normalize(be.cross(r,n)),h=be.normalize(be.cross(n,o));this.CV[0]=o.x,this.CV[1]=o.y,this.CV[2]=o.z,this.CV[4]=h.x,this.CV[5]=h.y,this.CV[6]=h.z,this.CV[8]=n.x,this.CV[9]=n.y,this.CV[10]=n.z,this.zV=yd.inverse(this.CV);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,m=(a.y+l.y/2)/u.y,p=yd.multiply(yd.translation(ha(-1,1,g),ha(-1,1,m),0),yd.scaling(c,d,1));return this.Uz=yd.multiply(p,yd.multiply(this.EV,this.zV)),this.VV=yd.inverse(this.Uz),this.FV=!1,{viewProjectionMatrix:this.Uz}}LV(){this.JD.MO(this.ct.x),this.JD._O(this.ct.y),this.JD.AO(this.ct.z)}tD(t,e){const i=this.gl.ZD(),s=this.Hy(),r={x:s.x*i*e,y:s.y*i*e,width:s.width*i*e,height:s.height*i*e};return this.gl.LB(r.x,r.y,r.width,r.height),this.Sz.forEach((e=>{e.getVisible()&&(this.gl.FB(e.Dz),1!==t&&this.gl.Sm(e.dm),(1!==t||e.getMouseInteractions())&&e.tD(t))})),this.gl.FB("disabled"),this.gl.Sm(!1),this.gl.PB(!1),this}setCameraLocation(t){return this.$z.x===t.x&&this.$z.y===t.y&&this.$z.z===t.z||(this.FV=!0),super.setCameraLocation(t),this}setCameraDirection(t){return this.kV.x===t.x&&this.kV.y===t.y&&this.kV.z===t.z||(this.FV=!0),super.setCameraDirection(t),this}G(){super.G(),this.Li.dr(this.PV),this.ct.W(this.DV)}Bm(t){const e=this.IO.wz();return this.xz(new Pg(this,this.bz,[],e,this.IO.kz(e),t))}Gp(t){const e=this.IO.wz();return this.xz(new kg(this,this.bz,t,e,this.IO.kz(e)))}km(){const t=this.IO.wz();return this.xz(new Ag(this,this.bz,[],t,this.IO.kz(t)))}Sg(){const t=this.IO.wz();return this.xz(new Tg(this,this.bz,[],t,this.IO.kz(t)))}ky(t){const e=this.IO.wz();return this.xz(new Rg(this,this.bz,[],t,e,this.IO.kz(e)))}By(t){const e=this.IO.wz();return this.xz(new Fg(this,this.bz,[],t,e,this.IO.kz(e)))}}const zg=(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=Dt(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=Dt(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}},Vg={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=m(c(Me,Me),c(Ae,Ae));let u=0,d=1,f=2,g=3,p=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=m(c(Me,Me),c(Ae,Ae));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=Dt(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=Dt(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.ma.o=!1,this.ya.o=!1}const t=this.WV,e=this.GV,s=this.Ra;if(o){this.Rn=we;for(const e of t)zg(s,this.va,e,Vg,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.RB(e.vbo),s.ibo=i.yL(e.ibo),s.length=e.length,s.lengthWireframe=e.lengthWireframe,this.Rn=Ne(this.Rn,e.boundary)}this.ba=!1}}if(this.Nr()){s instanceof G||(this.IO.NL.vr(this.WR),this.WR=void 0),this.tB=s===F?void 0:i.zB(df["2D"],df.VertexLocation({translation:"grid"===this.NV?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0}),s instanceof z?df.Color({dataType:"uniform"}):s instanceof V?df.Color({dataType:"attribute"}):s instanceof G?df.Color({dataType:["lookup",s.getLookUpProperty()]}):s instanceof $||s instanceof Z?df.Color({dataType:["gradient",s]}):void 0);const t=this.Ma;this.$V=t instanceof z?i.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({translation:"grid"===this.NV?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0,this.Ur(s),this.Wa=this.Ma}const h=this.WV,a=this.GV,l=this.za;if(s instanceof G&&s.lut.isValid){if(this.xa){for(const t of h)Ng(l,this.va,t,Vg);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.SL(s.intensities)}this.xa=!1}const t=s.getPalette();this.HR=this.IO.vR(t,this.WR,this.HR),this.WR=t}else if(s instanceof V&&(this.YV&&i.iL(this.YV),this.Sa)){for(const t of h)Gg(l,s.color,this.va,t,Vg);let t=0;for(const e of a){e.colors&&i.gl.deleteBuffer(e.colors);const s=h[t];t+=1,e.colors=i.SL(s.colors)}this.Sa=!1}s instanceof $?this.$O=Mf(this.Tr(),this.ct,s.getPosition(),s.getExtent(),s.getShape(),this.iD.ZD()):s instanceof Z?this.YO=Af(this.Tr(),this.ct,s.getAngle(!0),this.iD.ZD()):(this.$O=void 0,this.YO=void 0),this.eR=e?this.eR||this.iD.zB(df["2D"],df.Color({dataType:"uniform"}),df.VertexLocation({translation:"grid"===this.NV?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:bf(this.ct),normalSource:void 0})):void 0}return this}tD(t){const e=this.za&&this.Ra;if(this.Wr()&&e){const e=1===t?this.eR:this.tB;if(e){const i=this.Vr,s=i instanceof z&&i,r=i instanceof G&&i,n=i instanceof V&&i,o=i instanceof $&&i,h=i instanceof Z&&i;this.iD.VB(e,((i,a,l)=>{let u=!1;this.iD.$D(e).GB(i("uScale"),this.JD.$B()).GB(i("uDisp"),this.JD.YB()).WB(i("uIsHighlighted"),1===t||2===t?0:this.br).UB(i("uHighlightColorOffset"),this.Ar).WB(i("uRenderEffectMask"),2===t?1:0),"grid"===this.NV&&this.iD.GB(i("uTranslationAxis"),[this.ni.x,this.ni.y]),1===t?this.iD.UB(i("uColor"),this.zO):s?this.iD.UB(i("uColor"),s.getColor()):r&&r.lut.isValid&&this.HR?this.iD.WB(i("uLookupMin"),r.lut.min).WB(i("uLookupMax"),r.lut.max).HB(i("uLookupTexture"),this.HR.texture,0).WB(i("uLookupTextureHeightPx"),this.HR.textureHeight):o?this.iD.KL(l,this.$O,o):h&&this.iD.qL(l,this.YO,h);for(const{vbo:e,ibo:i,colors:s,intensities:o,length:h}of this.GV)this.iD.xL(a("aPos"),e).wL(i),1!==t&&(r&&"value"===r.getLookUpProperty()&&this.iD.AL(a("aLookupValue"),o),n&&this.iD._L(a("aColor"),s)),this.iD.kL(h),u=!0;return u}))}const i=1===t?void 0:this.$V;if(i){const e=this.Ma,s=e instanceof z&&e;this.iD.VB(i,((e,r,n)=>{let o=!1;this.iD.$D(i).GB(e("uScale"),this.JD.$B()).GB(e("uDisp"),this.JD.YB()).WB(e("uIsHighlighted"),1===t||2===t?0:this.br).UB(e("uHighlightColorOffset"),this.Ar).WB(e("uRenderEffectMask"),2===t?1:0),"grid"===this.NV&&this.iD.GB(e("uTranslationAxis"),[this.ni.x,this.ni.y]),s&&this.iD.UB(e("uColor"),s.getColor());for(const{vbo:t,ibo:e,lengthWireframe:i}of this.GV)this.iD.xL(r("aPos"),t).wL(e).kL(i,this.iD.gl.LINES),o=!0;return o}))}}return this}XV(t,e){if(this.pr.M()&&this.Rn&&this.Ra){const n="grid"===this.NV?this.ni:{x:0,y:0},o=Je(nt({x:t,y:e},this.Li.ct,this.ct),n);if(i=o,s=this.Rn.min,r=this.Rn.max,!(i.x>r.x||i.y>r.y||i.x0){for(const e of this.GV){const{vbo:i,ibo:s,colors:r,intensities:n}=e||{};i&&(t.ZB(i),e.vbo=void 0),s&&(t.ZB(s),e.ibo=void 0),r&&(t.ZB(r),e.colors=void 0),n&&(t.ZB(n),e.intensities=void 0)}this.GV.length=0}}OD(){return this.UV(),this.YV&&(this.iD.iL(this.YV),this.YV=void 0),this.IO.NL.vr(this.WR),this.HR=void 0,this}Pa(t,e){return this.NV="mesh",super.Pa(t,e)}yt(){return"grid"===this.NV?this.Rn.max.x+this.ni.x:this.Rn.max.x}ft(){return"grid"===this.NV?this.Rn.min.x+this.ni.x:this.Rn.min.x}xt(){return"grid"===this.NV?this.Rn.max.y+this.ni.y:this.Rn.max.y}St(){return"grid"===this.NV?this.Rn.min.y+this.ni.y:this.Rn.min.y}co(){return 0}do(){return 0}}class Hg extends us{constructor(t,e,i=gf){var s,r,n;super(t,e),this.Y=c(1,1),this.jV=!1,this.ZV=0,this.KV=!0,this.qV=0,this.Qz=8388608,this.Bi=(t=!1)=>(t&&(this.jV=!0),void 0===this.Re&&(this.Re=gt.requestAnimationFrame(this.JV)),this),this.JV=t=>{const e=t-this.ZV;e>=this.Rh||-1===this.Rh?(this.ZV=t,this.jV=!1,this.Ee&&this.Ee(),this.Re=void 0,-1!==this.Rh&&(this.Re=this.jV?gt.requestAnimationFrame(this.JV):void 0),this.Vh.Gs(e),this.Ze(),this.Ke(),this.ze&&this.ze()):this.Re=gt.requestAnimationFrame(this.JV)},this.QV=new Map,this.PO=()=>this.iD,this.tN=()=>{var t,e,i;const s=this.xh(),r=this.KV,n=gt.performance.now(),o=null===(t=this.iN)||void 0===t?void 0:t.sN.reduce(((t,e)=>t?e.eN&&t.eN&&e.eN>t.eN?e:t:e),void 0),h=null==o?void 0:o.eN,a=null===(e=this.dh)||void 0===e?void 0:e.timeStamp,l=null===(i=this.rr)||void 0===i?void 0:i.timeStamp;return r?(this.Bi(!0),!1):void 0===o||(void 0===o||!o.hN)&&(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.rN=()=>{var t,e;this.nN=void 0;const i=null===(e=null===(t=this.iN)||void 0===t?void 0:t.oN)||void 0===e?void 0:e.aN;void 0===i||i>=this.qV||this.lN()},this.Ke=()=>{const t=this.iD.gl,e=gt.performance.now(),i=this.Y,s=i.x>0&&i.y>0;if(this.Ye.o&&this.iD.DL(this.Ye.M()),this.iD.qn(),t.resize&&s&&t.resize(i.x*this.iD.ZD(),i.y*this.iD.ZD()),this.iD.BB(0,0,i.x*this.iD.ZD(),i.y*this.iD.ZD()),this.uN.width=i.x*this.iD.ZD(),this.uN.height=i.y*this.iD.ZD(),s)for(const t of this.Be.values())t.tD(0,1);return this.Mh.Bh&&s&&(this.nN&&(gt.clearTimeout(this.nN),this.nN=void 0),this.tN()?this.lN():this.nN=gt.setTimeout(this.rN,500)),this.X(),this.Pe(),this.ih&&this.th(this.ih),this.KV=!1,this.qV=e,this},this.Ze=()=>{const t=this.Y;if(0===t.x||0===t.y)return this;this.Uh.q(t);for(const t of this.Be.values())t.Gs();return this.X(),this},this.cN=1,this.uN=gt.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.uN.getContext("webgl2",o);t&&(h=new i(this,this.Mh,{type:"webgl2",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.hs.isDark))}if(!h&&"webgl2"!==(null===(r=null==t?void 0:t.webgl)||void 0===r?void 0:r.version)){const t=this.uN.getContext("webgl",o)||this.uN.getContext("experimental-webgl",o);h=new i(this,this.Mh,{type:"webgl1",ctx:t,antialias:o.antialias,lineAntialias:o.lineAntialias},this.hs.isDark)}if(!h)throw new at("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.iD=h,this.NL=bd(this.iD.gl);const a=this.iD.rL;if(a.length>0){const t=gt.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=gt.document.createElement("button");e.innerText="X",e.addEventListener("click",(()=>{t.parentElement&&t.parentElement.removeChild(t)})),this._e.appendChild(t),t.appendChild(e),!1!==this.Mh.Ph&>.console.warn("LightningChart JS - Following WebGL extensions could not be loaded:",a.join(", "))}let l=1;if(t&&t.devicePixelRatio)l=!0===t.devicePixelRatio?gt.devicePixelRatio||1:t.devicePixelRatio||1;else{const t=gt.document.head.querySelector('meta[name="viewport"]');t&&t.content.includes("width=device-width")&&(l=gt.devicePixelRatio||1)}this.iD.YL(l),this.uN.style.position="absolute",this.uN.style.top="0",this.uN.style.left="0",this.uN.style.right="0",this.uN.style.bottom="0",this.uN.style.width="100%",this.uN.style.height="100%",this.uN.style.boxSizing="content-box",this._e.appendChild(this.uN);const u=t?t.width:void 0,d=t?t.height:void 0;this.Gh=this.dN(u),this.Wh=this.dN(d),this.fN(this.Gh,this.Wh),this.fV=this.vT("engine offscreen",1e6),this.gN=this.vT("engine bg",0);const f="function"==typeof this.hs.lcjsBackgroundFillStyle?this.hs.lcjsBackgroundFillStyle(this.Mh.Fh):this.hs.lcjsBackgroundFillStyle;this.Uh=this.gN.gc(this.ct).ps(f).$h(this.hs.lcjsBackgroundStrokeStyle).setMouseInteractions(!1).Sn({x:0,y:0});const g=this.vT("engine effects",200001).Cz(this.hs.effect);this.iu=g,this.Ue(),this.Pe(),this.Lg=rs(this),this.Og={hs:this.hs,Vh:this.Vh,Bi:t=>this.Bi(t),xh:()=>this.xh(),oP:t=>this.oP(t),Mh:this.Mh,bh:t=>this.bh(t),iu:this.iu};const m=()=>{this.G()};gt.addEventListener("unload",m),this.Ve.push((()=>{gt.removeEventListener("unload",m)}))}get pN(){return this.Be}De(t,e){let i=this.QV.get(t);if(!i){const e=this.iD.JL(t),s=new Set,r=t=>{s.add(t)},n=i=>{s.delete(i)&&0===s.size&&(e.unbindResources(),this.QV.delete(t))},o=[];i={imageTexture:e,instances:s,handleNewInstance:r,handleInstanceDisposed:n,sharedEngineReference:{aP:()=>e.dB,lP:t=>{e.dB?t():o.push(t)}}},this.QV.set(t,i),e.$D(this),e.xB((()=>{o.forEach((t=>{t()})),o.length=0}))}const s=new td(t,i.handleNewInstance,i.handleInstanceDisposed,e);return i.handleNewInstance(s),s}oP(t){const e=Array.from(this.QV.values()).find((e=>e.instances.has(t)));if(!e)throw de(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}sh(t,e){var i,s;const r=null===(i=this.iN)||void 0===i?void 0:i.oN;if(!r)return;const n=this.ke(e.x,e.y),o=Math.round(n.x*this.iD.ZD()),h=Math.round(n.y*this.iD.ZD());return null===(s=[[-1,-1],[-1,0],[-1,1],[0,1],[1,1],[1,0],[1,-1],[0,-1],[0,0]].map((t=>this.mN(r,o+t[0]/r.yN,h+t[1]/r.yN))).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}:t}),void 0))||void 0===s?void 0:s.entity}mN(t,e,i){const s=Math.round(e*t.yN),r=Math.round(i*t.yN);if(s<0||s>=t.Y.x||r<0||r>=t.Y.y)return;const n=4*(s+r*t.Y.x),o=t.SN[n+0],h=t.SN[n+1],a=t.SN[n+2],l=t.SN[n+3];return void 0!==o&&void 0!==h&&void 0!==a&&void 0!==l?this.xN(o,h,a,l):void 0}Te(t,e){return(t=>{const e=t.split(",")[0].split(":")[1].split(";")[0],i=gt.atob(t.split(",")[1]),s=new Uint8Array(i.length);for(let t=0;t{})),!(i instanceof gg))throw new Error("Unexpected Engine Layer error");return i}return this.qe(new gg(this,e,t))}AT(t,e,i){const s=this.Zh(e);if(s){if(de(0,(()=>{})),!(s instanceof Og))throw new Error("Unexpected Engine Layer error");return s}return this.qe(new Og(this,e,t,i))}Et(){return this.Y}dN(t){return t instanceof Array||(t=[t,t]),t}We(){return this.uN}lN(){var t;const e=this.iD.gl,i=gt.performance.now(),s=this.xh(),r=this.Mh.Dh,n={x:Math.ceil(this.Y.x*this.iD.ZD()*r),y:Math.ceil(this.Y.y*this.iD.ZD()*r)};this.iN||(this.iN={yN:r,bN:n,sN:[],oN:void 0});let o=this.iN.sN.find((t=>!t.hN)),h=!1;o||(h=!0,o={hN:!1,Y:n,vN:e.createTexture(),MN:this.iD.JB(),_N:this.iD.QB(),AN:new Uint8Array,eN:void 0},this.iN.sN.push(o));const a=o;(h||a.Y.x!==n.x||a.Y.y!==n.y)&&(e.bindTexture(e.TEXTURE_2D,a.vN),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.MN),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a.vN,0),e.bindRenderbuffer(e.RENDERBUFFER,a._N),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.x,n.y),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,a._N),a.AN=new Uint8Array(n.x*n.y*4),a.Y=n),a.hN=!0,a.eN=i,e.bindFramebuffer(e.FRAMEBUFFER,a.MN),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.iD.BB(0,0,n.x,n.y);for(const t of this.Be.values())t.tD(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.iD.gl2)||void 0===t?void 0:t.ctx,u=()=>{if(this.iN){const t=this.iN.oN;if(t&&t.aN>i)return;this.iN.oN={aN:i,yN:r,Y:n,SN:a.AN,wN:s}}};l?this.iD.aO(l,a.MN,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.AN).then((()=>{this.ce||(a.hN=!1,u())})).catch((t=>{this.ce||(a.hN=!1,gt.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.iD.lO(a.MN,0,0,n.x,n.y,e.RGBA,e.UNSIGNED_BYTE,a.AN),a.hN=!1,u())}Ue(t){const e=this.Y.x,i=this.Y.y,s=t||{x:this._e.offsetWidth,y:this._e.offsetHeight};s.x===e&&s.y===i||(this.Y=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.Y.x,this.Y.y]))}G(){super.G(),this.nN&&(gt.clearTimeout(this.nN),this.nN=void 0),this.uN.width=1,this.uN.height=1,this.uN&&(this._e.removeChild(this.uN),this.uN=void 0,this._e=void 0),this.NL.fD(),Array.from(this.iD.eL.values()).forEach((t=>{t.OD()})),Array.from(this.iD.hL.values()).forEach((t=>{t.unbindResources()})),this.iD.hL.clear(),this.iD.sL.lD(),this.iD.HL.G(),this.iD.ZB(this.iD.WL),this.iD.ZB(this.iD.UL),this.iD.eO&&(this.iD.ZB(this.iD.eO.buffer),this.iD.eO=void 0),this.iN&&(this.iN.sN.forEach((t=>{this.iD.tL(t._N),this.iD.iL(t.MN),this.iD.RD(t.vN)})),this.iN=void 0),this.iD.LL.forEach((t=>this.iD.ZB(t))),this.QV.clear(),this.iD.iO(),this.iD.gl=void 0}vR(t,e,i){const s=this.NL;let r=i;if(s.dD(t))t!==e&&(s.vr(e),r=s.M(t),s.Kn(t));else{r={};const e={x:1,y:this.iD.LD};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 Ug(this,this.fV,i,(()=>{}),[],-1,E);n.ps(new V({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}).Pa(((e,i,s)=>({x:s.x,y:t.steps[e].value}))).Ia((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}).Pa(((e,s,r)=>({x:r.x,y:et.steps[e].color)),r.texture=this.iD.XL(null,this.iD.gl.RGBA,!1,!t.interpolate,e,!1),this.iD.GL.tD((()=>{n.Gs(),n.tD(0)}),r.texture,e,void 0,this.Ye.M()),s.Kn({lut:t,textureInfo:r})}return r}wz(){const t=this.cN;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.cN=1),this.cN+=1,t}kz(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)}xN(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.pN.values()){const e=t.Az(r);if(e)return{entity:e.entity,entityIndex:e.index,layerIndex:t.Je()}}}}var Wg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},Yg={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.SB(t||0,e||10,i||"be"))}var n;"object"==typeof Yg?Yg.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.SB=function(t,e,s){if("number"==typeof t)return this.kN(t,e,s);if("object"==typeof t)return this.CN(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.TN(t,r):this.IN(t,e,r),"-"===t[0]&&(this.negative=1),this.FN(),"le"===s&&this.CN(this.toArray(),e,s)},r.prototype.kN=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.CN(this.toArray(),e,s)},r.prototype.CN=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.FN()},r.prototype.TN=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.FN()},r.prototype.IN=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.ON()},r.prototype.ON=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.FN()}r.prototype.toString=function(t,e){var s;if(e=0|e||1,16===(t=t||10)||"hex"===t){s="";for(var r=0,n=0,o=0;o>>24-r&16777215)||o!==this.length-1?u[6-a.length]+a+s:a+s,(r+=2)>=26&&(r-=26,o--)}for(0!==n&&(s=n.toString(16)+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}if(t===(0|t)&&t>=2&&t<=36){var l=c[t],f=d[t];s="";var g=this.clone();for(g.negative=0;!g.isZero();){var m=g.modrn(f).toString(t);s=(g=g.idivn(f)).isZero()?m+s:u[l-m.length]+m+s}for(this.isZero()&&(s="0"+s);s.length%e!=0;)s="0"+s;return 0!==this.negative&&(s="-"+s),s}i(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},r.prototype.toJSON=function(){return this.toString(16,2)},n&&(r.prototype.toBuffer=function(t,e){return this.toArrayLike(n,t,e)}),r.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},r.prototype.toArrayLike=function(t,e,s){this.FN();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.RN=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.zN=function(t){return 32-Math.clz32(t)}:r.prototype.zN=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.VN=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.zN(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.LN(e),s>0&&e--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-s),this.FN()},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.LN(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.ON()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this.ON();var i,s,r=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,s=t):(i=t,s=this);for(var n=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==n&&o>26,this.words[o]=67108863&e;if(0===n&&o>>13,f=0|o[1],g=8191&f,m=f>>>13,p=0|o[2],y=8191&p,x=p>>>13,S=0|o[3],v=8191&S,b=S>>>13,M=0|o[4],A=8191&M,w=M>>>13,D=0|o[5],T=8191&D,E=D>>>13,B=0|o[6],k=8191&B,I=B>>>13,C=0|o[7],P=8191&C,L=C>>>13,R=0|o[8],F=8191&R,_=R>>>13,O=0|o[9],z=8191&O,V=O>>>13,N=0|h[0],G=8191&N,U=N>>>13,H=0|h[1],W=8191&H,Y=H>>>13,q=0|h[2],X=8191&q,$=q>>>13,j=0|h[3],Z=8191&j,K=j>>>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,mt=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,U))+Math.imul(d,G)|0))<<13)|0;l=((n=Math.imul(d,U))+(r>>>13)|0)+(pt>>>26)|0,pt&=67108863,s=Math.imul(g,G),r=(r=Math.imul(g,U))+Math.imul(m,G)|0,n=Math.imul(m,U);var yt=(l+(s=s+Math.imul(c,W)|0)|0)+((8191&(r=(r=r+Math.imul(c,Y)|0)+Math.imul(d,W)|0))<<13)|0;l=((n=n+Math.imul(d,Y)|0)+(r>>>13)|0)+(yt>>>26)|0,yt&=67108863,s=Math.imul(y,G),r=(r=Math.imul(y,U))+Math.imul(x,G)|0,n=Math.imul(x,U),s=s+Math.imul(g,W)|0,r=(r=r+Math.imul(g,Y)|0)+Math.imul(m,W)|0,n=n+Math.imul(m,Y)|0;var xt=(l+(s=s+Math.imul(c,X)|0)|0)+((8191&(r=(r=r+Math.imul(c,$)|0)+Math.imul(d,X)|0))<<13)|0;l=((n=n+Math.imul(d,$)|0)+(r>>>13)|0)+(xt>>>26)|0,xt&=67108863,s=Math.imul(v,G),r=(r=Math.imul(v,U))+Math.imul(b,G)|0,n=Math.imul(b,U),s=s+Math.imul(y,W)|0,r=(r=r+Math.imul(y,Y)|0)+Math.imul(x,W)|0,n=n+Math.imul(x,Y)|0,s=s+Math.imul(g,X)|0,r=(r=r+Math.imul(g,$)|0)+Math.imul(m,X)|0,n=n+Math.imul(m,$)|0;var St=(l+(s=s+Math.imul(c,Z)|0)|0)+((8191&(r=(r=r+Math.imul(c,K)|0)+Math.imul(d,Z)|0))<<13)|0;l=((n=n+Math.imul(d,K)|0)+(r>>>13)|0)+(St>>>26)|0,St&=67108863,s=Math.imul(A,G),r=(r=Math.imul(A,U))+Math.imul(w,G)|0,n=Math.imul(w,U),s=s+Math.imul(v,W)|0,r=(r=r+Math.imul(v,Y)|0)+Math.imul(b,W)|0,n=n+Math.imul(b,Y)|0,s=s+Math.imul(y,X)|0,r=(r=r+Math.imul(y,$)|0)+Math.imul(x,X)|0,n=n+Math.imul(x,$)|0,s=s+Math.imul(g,Z)|0,r=(r=r+Math.imul(g,K)|0)+Math.imul(m,Z)|0,n=n+Math.imul(m,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(T,G),r=(r=Math.imul(T,U))+Math.imul(E,G)|0,n=Math.imul(E,U),s=s+Math.imul(A,W)|0,r=(r=r+Math.imul(A,Y)|0)+Math.imul(w,W)|0,n=n+Math.imul(w,Y)|0,s=s+Math.imul(v,X)|0,r=(r=r+Math.imul(v,$)|0)+Math.imul(b,X)|0,n=n+Math.imul(b,$)|0,s=s+Math.imul(y,Z)|0,r=(r=r+Math.imul(y,K)|0)+Math.imul(x,Z)|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(m,Q)|0,n=n+Math.imul(m,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(k,G),r=(r=Math.imul(k,U))+Math.imul(I,G)|0,n=Math.imul(I,U),s=s+Math.imul(T,W)|0,r=(r=r+Math.imul(T,Y)|0)+Math.imul(E,W)|0,n=n+Math.imul(E,Y)|0,s=s+Math.imul(A,X)|0,r=(r=r+Math.imul(A,$)|0)+Math.imul(w,X)|0,n=n+Math.imul(w,$)|0,s=s+Math.imul(v,Z)|0,r=(r=r+Math.imul(v,K)|0)+Math.imul(b,Z)|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(m,it)|0,n=n+Math.imul(m,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(P,G),r=(r=Math.imul(P,U))+Math.imul(L,G)|0,n=Math.imul(L,U),s=s+Math.imul(k,W)|0,r=(r=r+Math.imul(k,Y)|0)+Math.imul(I,W)|0,n=n+Math.imul(I,Y)|0,s=s+Math.imul(T,X)|0,r=(r=r+Math.imul(T,$)|0)+Math.imul(E,X)|0,n=n+Math.imul(E,$)|0,s=s+Math.imul(A,Z)|0,r=(r=r+Math.imul(A,K)|0)+Math.imul(w,Z)|0,n=n+Math.imul(w,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(m,nt)|0,n=n+Math.imul(m,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(F,G),r=(r=Math.imul(F,U))+Math.imul(_,G)|0,n=Math.imul(_,U),s=s+Math.imul(P,W)|0,r=(r=r+Math.imul(P,Y)|0)+Math.imul(L,W)|0,n=n+Math.imul(L,Y)|0,s=s+Math.imul(k,X)|0,r=(r=r+Math.imul(k,$)|0)+Math.imul(I,X)|0,n=n+Math.imul(I,$)|0,s=s+Math.imul(T,Z)|0,r=(r=r+Math.imul(T,K)|0)+Math.imul(E,Z)|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(w,Q)|0,n=n+Math.imul(w,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(m,at)|0,n=n+Math.imul(m,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(z,G),r=(r=Math.imul(z,U))+Math.imul(V,G)|0,n=Math.imul(V,U),s=s+Math.imul(F,W)|0,r=(r=r+Math.imul(F,Y)|0)+Math.imul(_,W)|0,n=n+Math.imul(_,Y)|0,s=s+Math.imul(P,X)|0,r=(r=r+Math.imul(P,$)|0)+Math.imul(L,X)|0,n=n+Math.imul(L,$)|0,s=s+Math.imul(k,Z)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(I,Z)|0,n=n+Math.imul(I,K)|0,s=s+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,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(w,it)|0,n=n+Math.imul(w,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(m,ct)|0,n=n+Math.imul(m,dt)|0;var Dt=(l+(s=s+Math.imul(c,gt)|0)|0)+((8191&(r=(r=r+Math.imul(c,mt)|0)+Math.imul(d,gt)|0))<<13)|0;l=((n=n+Math.imul(d,mt)|0)+(r>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,s=Math.imul(z,W),r=(r=Math.imul(z,Y))+Math.imul(V,W)|0,n=Math.imul(V,Y),s=s+Math.imul(F,X)|0,r=(r=r+Math.imul(F,$)|0)+Math.imul(_,X)|0,n=n+Math.imul(_,$)|0,s=s+Math.imul(P,Z)|0,r=(r=r+Math.imul(P,K)|0)+Math.imul(L,Z)|0,n=n+Math.imul(L,K)|0,s=s+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,tt)|0)+Math.imul(I,Q)|0,n=n+Math.imul(I,tt)|0,s=s+Math.imul(T,it)|0,r=(r=r+Math.imul(T,st)|0)+Math.imul(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(w,nt)|0,n=n+Math.imul(w,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 Tt=(l+(s=s+Math.imul(g,gt)|0)|0)+((8191&(r=(r=r+Math.imul(g,mt)|0)+Math.imul(m,gt)|0))<<13)|0;l=((n=n+Math.imul(m,mt)|0)+(r>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,s=Math.imul(z,X),r=(r=Math.imul(z,$))+Math.imul(V,X)|0,n=Math.imul(V,$),s=s+Math.imul(F,Z)|0,r=(r=r+Math.imul(F,K)|0)+Math.imul(_,Z)|0,n=n+Math.imul(_,K)|0,s=s+Math.imul(P,Q)|0,r=(r=r+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,n=n+Math.imul(L,tt)|0,s=s+Math.imul(k,it)|0,r=(r=r+Math.imul(k,st)|0)+Math.imul(I,it)|0,n=n+Math.imul(I,st)|0,s=s+Math.imul(T,nt)|0,r=(r=r+Math.imul(T,ot)|0)+Math.imul(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(w,at)|0,n=n+Math.imul(w,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,mt)|0)+Math.imul(x,gt)|0))<<13)|0;l=((n=n+Math.imul(x,mt)|0)+(r>>>13)|0)+(Et>>>26)|0,Et&=67108863,s=Math.imul(z,Z),r=(r=Math.imul(z,K))+Math.imul(V,Z)|0,n=Math.imul(V,K),s=s+Math.imul(F,Q)|0,r=(r=r+Math.imul(F,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(L,it)|0,n=n+Math.imul(L,st)|0,s=s+Math.imul(k,nt)|0,r=(r=r+Math.imul(k,ot)|0)+Math.imul(I,nt)|0,n=n+Math.imul(I,ot)|0,s=s+Math.imul(T,at)|0,r=(r=r+Math.imul(T,lt)|0)+Math.imul(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(w,ct)|0,n=n+Math.imul(w,dt)|0;var Bt=(l+(s=s+Math.imul(v,gt)|0)|0)+((8191&(r=(r=r+Math.imul(v,mt)|0)+Math.imul(b,gt)|0))<<13)|0;l=((n=n+Math.imul(b,mt)|0)+(r>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,s=Math.imul(z,Q),r=(r=Math.imul(z,tt))+Math.imul(V,Q)|0,n=Math.imul(V,tt),s=s+Math.imul(F,it)|0,r=(r=r+Math.imul(F,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(L,nt)|0,n=n+Math.imul(L,ot)|0,s=s+Math.imul(k,at)|0,r=(r=r+Math.imul(k,lt)|0)+Math.imul(I,at)|0,n=n+Math.imul(I,lt)|0,s=s+Math.imul(T,ct)|0,r=(r=r+Math.imul(T,dt)|0)+Math.imul(E,ct)|0,n=n+Math.imul(E,dt)|0;var kt=(l+(s=s+Math.imul(A,gt)|0)|0)+((8191&(r=(r=r+Math.imul(A,mt)|0)+Math.imul(w,gt)|0))<<13)|0;l=((n=n+Math.imul(w,mt)|0)+(r>>>13)|0)+(kt>>>26)|0,kt&=67108863,s=Math.imul(z,it),r=(r=Math.imul(z,st))+Math.imul(V,it)|0,n=Math.imul(V,st),s=s+Math.imul(F,nt)|0,r=(r=r+Math.imul(F,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(L,at)|0,n=n+Math.imul(L,lt)|0,s=s+Math.imul(k,ct)|0,r=(r=r+Math.imul(k,dt)|0)+Math.imul(I,ct)|0,n=n+Math.imul(I,dt)|0;var It=(l+(s=s+Math.imul(T,gt)|0)|0)+((8191&(r=(r=r+Math.imul(T,mt)|0)+Math.imul(E,gt)|0))<<13)|0;l=((n=n+Math.imul(E,mt)|0)+(r>>>13)|0)+(It>>>26)|0,It&=67108863,s=Math.imul(z,nt),r=(r=Math.imul(z,ot))+Math.imul(V,nt)|0,n=Math.imul(V,ot),s=s+Math.imul(F,at)|0,r=(r=r+Math.imul(F,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(L,ct)|0,n=n+Math.imul(L,dt)|0;var Ct=(l+(s=s+Math.imul(k,gt)|0)|0)+((8191&(r=(r=r+Math.imul(k,mt)|0)+Math.imul(I,gt)|0))<<13)|0;l=((n=n+Math.imul(I,mt)|0)+(r>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,s=Math.imul(z,at),r=(r=Math.imul(z,lt))+Math.imul(V,at)|0,n=Math.imul(V,lt),s=s+Math.imul(F,ct)|0,r=(r=r+Math.imul(F,dt)|0)+Math.imul(_,ct)|0,n=n+Math.imul(_,dt)|0;var Pt=(l+(s=s+Math.imul(P,gt)|0)|0)+((8191&(r=(r=r+Math.imul(P,mt)|0)+Math.imul(L,gt)|0))<<13)|0;l=((n=n+Math.imul(L,mt)|0)+(r>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,s=Math.imul(z,ct),r=(r=Math.imul(z,dt))+Math.imul(V,ct)|0,n=Math.imul(V,dt);var Lt=(l+(s=s+Math.imul(F,gt)|0)|0)+((8191&(r=(r=r+Math.imul(F,mt)|0)+Math.imul(_,gt)|0))<<13)|0;l=((n=n+Math.imul(_,mt)|0)+(r>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Rt=(l+(s=Math.imul(z,gt))|0)+((8191&(r=(r=Math.imul(z,mt))+Math.imul(V,gt)|0))<<13)|0;return l=((n=Math.imul(V,mt))+(r>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,a[0]=pt,a[1]=yt,a[2]=xt,a[3]=St,a[4]=vt,a[5]=bt,a[6]=Mt,a[7]=At,a[8]=wt,a[9]=Dt,a[10]=Tt,a[11]=Et,a[12]=Bt,a[13]=kt,a[14]=It,a[15]=Ct,a[16]=Pt,a[17]=Lt,a[18]=Rt,0!==l&&(a[19]=l,i.length++),i};function m(t,e,i){i.negative=e.negative^t.negative,i.length=t.length+e.length;for(var s=0,r=0,n=0;n>>26)|0)>>>26,o&=67108863}i.words[n]=h,s=o,o=r}return 0!==s?i.words[n]=s:i.length--,i.FN()}function p(t,e,i){return m(t,e,i)}Math.imul||(g=f),r.prototype.mulTo=function(t,e){var i=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):i<63?f(this,t,e):i<1024?m(this,t,e):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.FN()},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.FN();for(i(-1===h),h=0,r=0;r>26,this.words[r]=67108863&n;return this.negative=1,this.FN()},r.prototype.GN=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.zN(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.NN(n,d,c);0!==s.negative;)d--,s.negative=0,s.NN(n,1,c),s.isZero()||(s.negative^=1);h&&(h.words[c]=d)}return h&&h.FN(),s.FN(),"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.GN(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.FN(),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,m=1;0==(s.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(s.iushrn(g);g-- >0;)(h.isOdd()||a.isOdd())&&(h.iadd(u),a.isub(c)),h.iushrn(1),a.iushrn(1);e.cmp(s)>=0?(e.isub(s),n.isub(h),o.isub(a)):(s.isub(e),h.isub(n),a.isub(o))}return{a:h,b:a,gcd:s.iushln(l)}},r.prototype.HN=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.FN(),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).WN(t)},r.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype.WN=function(t){return this.red=t,this},r.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this.WN(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.UN(this,t),this.red.mul(this,t)},r.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red.UN(this,t),this.red.imul(this,t)},r.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red.$N(this),this.red.sqr(this)},r.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red.$N(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red.$N(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red.$N(this),this.red.invm(this)},r.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red.$N(this),this.red.neg(this)},r.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red.$N(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.YN()}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.XN(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.HN(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.YN=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.FN(),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.XN=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.$N=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},A.prototype.UN=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).WN(this):(a(t,t.umod(this.m).WN(this)),t)},A.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t).WN(this)},A.prototype.add=function(t,e){this.UN(t,e);var i=t.add(e);return i.cmp(this.m)>=0&&i.isub(this.m),i.WN(this)},A.prototype.iadd=function(t,e){this.UN(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.UN(t,e);var i=t.sub(e);return i.cmpn(0)<0&&i.iadd(this.m),i.WN(this)},A.prototype.isub=function(t,e){this.UN(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.$N(t),this.imod(t.ushln(e))},A.prototype.imul=function(t,e){return this.UN(t,e),this.imod(t.imul(e))},A.prototype.mul=function(t,e){return this.UN(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 m=f,p=0;0!==m.cmp(h);p++)m=m.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.WN(this)},w.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new r(0).WN(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.WN(this)},w.prototype.invm=function(t){return this.imod(t.HN(this.m).mul(this.r2)).WN(this)}}(0,Wg);var qg=Yg.exports;function Xg(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 $g=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},jg=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 Zg{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.jN=new Array(4),this.ZN=new Array(4),this.KN=new Array(4),this.qN=new Array(4),this.JN=this.n?this.n.bitLength():0;const i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this.QN=!0,this.redN=this.n.toRed(this.red))}tG(t,e){const i=t.iG(),s=$g(e,1,this.JN);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}hG(t,e,i,s,r){const n=this.jN,o=this.ZN,h=this.KN;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]=$g(i[s],n[s],this.JN),h[r]=$g(i[r],n[r],this.JN),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=jg(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)}iG(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.dG(i),{beta:e,lambda:i,basis:s}}cG(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()]}dG(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),m=new qg(0),p=new qg(1),y=0;for(;0!==c.cmpn(0);){const t=d.div(c);l=d.sub(t.mul(c)),u=m.sub(t.mul(f));const o=p.sub(t.mul(g));if(!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,m=f,f=u,p=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}]}fG(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 Qg(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)}gG(t,e,i){const s=this.lG,r=this.uG;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.oG(t)?this.curve.tG(this,t):this.curve.endo?this.curve.gG([this],[t]):this.curve.sG(this,t)}mulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.gG(s,r):this.curve.hG(1,s,r,2)}jmulAdd(t,e,i){const s=[this,e],r=[t,i];return this.curve.endo?this.curve.gG(s,r,!0):this.curve.hG(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 tm extends Kg{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 tm(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 em{constructor(t){this.curve=new Jg(t),this.g=this.curve.g,this.n=this.curve.n}}const im={};var sm;im.PresetCurve=em,sm={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(im,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new em(sm);return Object.defineProperty(im,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class rm{constructor(t,e){this.ec=t,this.priv=null,this.pub=null,e.pub&&this.SG(e.pub,e.pubEnc)}static fromPublic(t,e,i){return e instanceof rm?e:new rm(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}SG(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 nm(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 om{constructor(){this.place=0}}class hm{constructor(t,e){if(t instanceof hm)return t;this.xG(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)}xG(t,e){t=Xg(t,e);const i=new om;if(48!==t[i.place++])return!1;const s=nm(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=nm(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=nm(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 am{constructor(t){if(!(this instanceof am))return new am(t);"string"==typeof t&&(t=im[t]),t instanceof im.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 rm.fromPublic(this,t,e)}bG(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.bG(new qg(t,16)),i=this.keyFromPublic(i,s);const r=(e=new hm(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.QN){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 lm,um={exports:{}};um.exports=(lm=lm||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!==Wg&&Wg.crypto&&(i=Wg.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.ww=new a.init,this.vG=0},MG:function(t){"string"==typeof t&&(t=d.parse(t)),this.ww.concat(t),this.vG+=t.sigBytes},_G:function(e){var i,s=this.ww,r=s.words,n=s.sigBytes,o=this.blockSize,h=n/(4*o),l=(h=e?t.ceil(h):t.max((0|h)-this.AG,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],y=(p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10;l[f]=m+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},CG:function(){var t=this.ww,i=t.words,s=8*this.vG,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._G(),this.FG},clone:function(){var t=n.clone.call(this);return t.FG=this.FG.clone(),t}});i.SHA256=n.TG(u),i.HmacSHA256=n.IG(u)}(Math),t.SHA256}(um.exports),mm={exports:{}}.exports=function(t){return i=(e=t).lib.WordArray,s=e.algo,r=s.SHA256,n=s.SHA224=r.extend({kG:function(){this.FG=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},CG:function(){var t=r.CG.call(this);return t.sigBytes-=4,t}}),e.SHA224=r.TG(n),e.HmacSHA224=r.IG(n),t.SHA224;var e,i,s,r,n}(um.exports),pm={exports:{}}.exports=um.exports.enc.Hex,ym={exports:{}}.exports=um.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.PG;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.PG,r=this.DG;if(!r){r=this.DG=[];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)},PG:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},t.enc.Base64;var e,i}(um.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({kG:function(){this.FG=new r.init([1732584193,4023233417,2562383102,271733878])},wG: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.FG.words,o=t[e+0],a=t[e+1],f=t[e+2],g=t[e+3],m=t[e+4],p=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],w=t[e+13],D=t[e+14],T=t[e+15],E=n[0],B=n[1],k=n[2],I=n[3];E=l(E,B,k,I,o,7,h[0]),I=l(I,E,B,k,a,12,h[1]),k=l(k,I,E,B,f,17,h[2]),B=l(B,k,I,E,g,22,h[3]),E=l(E,B,k,I,m,7,h[4]),I=l(I,E,B,k,p,12,h[5]),k=l(k,I,E,B,y,17,h[6]),B=l(B,k,I,E,x,22,h[7]),E=l(E,B,k,I,S,7,h[8]),I=l(I,E,B,k,v,12,h[9]),k=l(k,I,E,B,b,17,h[10]),B=l(B,k,I,E,M,22,h[11]),E=l(E,B,k,I,A,7,h[12]),I=l(I,E,B,k,w,12,h[13]),k=l(k,I,E,B,D,17,h[14]),E=u(E,B=l(B,k,I,E,T,22,h[15]),k,I,a,5,h[16]),I=u(I,E,B,k,y,9,h[17]),k=u(k,I,E,B,M,14,h[18]),B=u(B,k,I,E,o,20,h[19]),E=u(E,B,k,I,p,5,h[20]),I=u(I,E,B,k,b,9,h[21]),k=u(k,I,E,B,T,14,h[22]),B=u(B,k,I,E,m,20,h[23]),E=u(E,B,k,I,v,5,h[24]),I=u(I,E,B,k,D,9,h[25]),k=u(k,I,E,B,g,14,h[26]),B=u(B,k,I,E,S,20,h[27]),E=u(E,B,k,I,w,5,h[28]),I=u(I,E,B,k,f,9,h[29]),k=u(k,I,E,B,x,14,h[30]),E=c(E,B=u(B,k,I,E,A,20,h[31]),k,I,p,4,h[32]),I=c(I,E,B,k,S,11,h[33]),k=c(k,I,E,B,M,16,h[34]),B=c(B,k,I,E,D,23,h[35]),E=c(E,B,k,I,a,4,h[36]),I=c(I,E,B,k,m,11,h[37]),k=c(k,I,E,B,x,16,h[38]),B=c(B,k,I,E,b,23,h[39]),E=c(E,B,k,I,w,4,h[40]),I=c(I,E,B,k,o,11,h[41]),k=c(k,I,E,B,g,16,h[42]),B=c(B,k,I,E,y,23,h[43]),E=c(E,B,k,I,v,4,h[44]),I=c(I,E,B,k,A,11,h[45]),k=c(k,I,E,B,T,16,h[46]),E=d(E,B=c(B,k,I,E,f,23,h[47]),k,I,o,6,h[48]),I=d(I,E,B,k,x,10,h[49]),k=d(k,I,E,B,D,15,h[50]),B=d(B,k,I,E,p,21,h[51]),E=d(E,B,k,I,A,6,h[52]),I=d(I,E,B,k,g,10,h[53]),k=d(k,I,E,B,b,15,h[54]),B=d(B,k,I,E,a,21,h[55]),E=d(E,B,k,I,S,6,h[56]),I=d(I,E,B,k,T,10,h[57]),k=d(k,I,E,B,y,15,h[58]),B=d(B,k,I,E,w,21,h[59]),E=d(E,B,k,I,m,6,h[60]),I=d(I,E,B,k,M,10,h[61]),k=d(k,I,E,B,f,15,h[62]),B=d(B,k,I,E,v,21,h[63]),n[0]=n[0]+E|0,n[1]=n[1]+B|0,n[2]=n[2]+k|0,n[3]=n[3]+I|0},CG:function(){var t=this.ww,i=t.words,s=8*this.vG,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._G();for(var h=this.FG,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.FG=this.FG.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.TG(a),i.HmacMD5=n.IG(a)})(Math),t.MD5}(um.exports),function(t){return i=(e=t).lib,s=i.WordArray,r=i.Hasher,n=e.algo,o=[],h=n.SHA1=r.extend({kG:function(){this.FG=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},wG:function(t,e){for(var i=this.FG.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},CG:function(){var t=this.ww,e=t.words,i=8*this.vG,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._G(),this.FG},clone:function(){var t=r.clone.call(this);return t.FG=this.FG.clone(),t}}),e.SHA1=r.TG(h),e.HmacSHA1=r.IG(h),t.SHA1;var e,i,s,r,n,o,h}(um.exports),dm=(cm=um.exports).lib.Base,fm=cm.enc.Utf8,cm.algo.HMAC=dm.extend({init:function(t,e){t=this.BG=new t.init,"string"==typeof e&&(e=fm.parse(e));var i=t.blockSize,s=4*i;e.sigBytes>s&&(e=t.finalize(e)),e.clamp();for(var r=this.LG=e.clone(),n=this.OG=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.VG==this.EG?t=s.createEncryptor:(t=s.createDecryptor,this.AG=1),this.UG&&this.UG.$G==t?this.UG.init(this,i&&i.words):(this.UG=t.call(s,this,i&&i.words),this.UG.$G=t)},wG:function(t,e){this.UG.processBlock(t,e)},CG:function(){var t,e=this.cfg.padding;return this.VG==this.EG?(e.pad(this.ww,this.blockSize),t=this._G(!0)):(t=this._G(!0),e.unpad(t)),t},blockSize:4});var m=s.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),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),m.create({ciphertext:i,salt:e})}},y=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 m.create({ciphertext:n,key:i,iv:o.iv,algorithm:t,mode:o.mode,padding:o.padding,blockSize:t.blockSize,formatter:s.format})},decrypt:function(t,e,i,s){return s=this.cfg.extend(s),e=this.YG(e,s.format),t.createDecryptor(i,s).finalize(e.ciphertext)},YG:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),x=(i.kdf={}).OpenSSL={execute:function(t,e,i,s){s||(s=n.random(8));var r=l.create({keySize:e+i}).compute(t,s),o=n.create(r.words.slice(e),4*i);return r.sigBytes=4*e,m.create({key:r,iv:o,salt:s})}},S=s.PasswordBasedCipher=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.YG(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)}})}()}(um.exports);var xm={exports:{}}.exports=function(t){return function(){var e=t,i=e.lib.BlockCipher,s=e.algo,r=[],n=[],o=[],h=[],a=[],l=[],u=[],c=[],d=[],f=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var i=0,s=0;for(e=0;e<256;e++){var g=s^s<<1^s<<2^s<<3^s<<4;g=g>>>8^255&g^99,r[i]=g,n[g]=i;var m=t[i],p=t[m],y=t[p],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*p^257*m^16843008*i,u[g]=x<<24|x>>>8,c[g]=x<<16|x>>>16,d[g]=x<<8|x>>>24,f[g]=x,i?(i=m^t[t[t[y^m]]],s^=t[t[s]]):i=s=1}}();var g=[0,1,2,4,8,16,32,64,128,27,54],m=s.AES=i.extend({kG:function(){if(!this.XG||this.jG!==this.NG){for(var t=this.jG=this.NG,e=t.words,i=t.sigBytes/4,s=4*((this.XG=i+6)+1),n=this.ZG=[],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.KG=[],a=0;a>>24]]^c[r[l>>>16&255]]^d[r[l>>>8&255]]^f[r[255&l]]}}},encryptBlock:function(t,e){this.qG(t,e,this.ZG,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.qG(t,e,this.KG,u,c,d,f,n),i=t[e+1],t[e+1]=t[e+3],t[e+3]=i},qG:function(t,e,i,s,r,n,o,h){for(var a=this.XG,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++],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=m,u=p,c=y,d=x}m=(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++],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]=m,t[e+1]=p,t[e+2]=y,t[e+3]=x},keySize:8});e.AES=i.TG(m)}(),t.AES}(um.exports),Sm={exports:{}}.exports=function(t){return t.mode.CTR=(i=(e=t.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,e){var i=this.GG,s=i.blockSize,r=this.HG,n=this.JG;r&&(n=this.JG=r.slice(0),this.HG=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}(um.exports),bm={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(um.exports);const Mm={"-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=="]},Am=gt,wm=(...t)=>t.slice(1).reduce(((e,i)=>e+Am.atob(Mm[t[0]][i].toString())),"");let Dm,Tm,Em=!1,Bm=new Uint8Array([34]);class km{set e(t){Dm=t}get e(){Tm={_h:!1,Ah:!1,wh:!1,kh:!1,Ch:!1,Th:!1};const t=Bm.length>=1?Bm[0]:void 0;return void 0!==t&&(Tm._h=!!(1&t),Tm.Ah=!!(2&t),Tm.wh=!!(4&t),Tm.kh=!!(8&t),Tm.Ch=!!(16&t),Tm.Th=!!(32&t)),Tm.Th}}let Im=!1;const Cm=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Pm=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")}`},Lm=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Rm=t=>{const e={},i=t.split("-");if(3!==i.length)throw new Error(wm(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 Om(d,f)?e:null},Fm=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(Cm(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(Lm(h)s[e]===t)))return;break}case"0002":if(!Rm(t))throw new Error(wm(0,0,1,7,1,12,5));return;default:throw new Error(wm(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}throw new Error(wm(0,0,1,2,1,7,1,12,5))},_m=t=>{if(!t)throw new Error(wm(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5));const e=(t[wm(-1,9)]||t[wm(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Am[wm(-1,6)][wm(-1,7)])>-1)return!0;const i=e.filter((t=>t.indexOf("*")>-1));if(Um(Am[wm(-1,6)][wm(-1,7)],i))return!0;const s=t[wm(-1,8)]||t[wm(-1,38)];if(""!==s&&null!=s){if(Um(Am[wm(-1,6)][wm(-1,7)],[s]))return!1;if(s===Am[wm(-1,6)][wm(-1,7)])return!1}throw new Error(wm(0,14,1,20,5))},Om=(t,e)=>{const i=new am("secp256k1").keyFromPublic(wm(-4,0),"hex"),s=mm(t).toString();return i.verify(s,e)},zm=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(!Om(r,n))throw new Error(wm(0,21,1,2,1,7,1,12,5));const o=pm.parse(r);i=xm.decrypt({ciphertext:pm.parse(s)},o,{mode:Sm,padding:bm,iv:pm.parse("00000000000000000000000000000001")}).toString(ym)}catch(t){throw new Error(wm(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(wm(0,21,1,2,1,7,1,12,5))}if(void 0===e[wm(-1,5)]||null===e[wm(-1,4)]||!e[wm(-1,9)])throw new Error(wm(0,21,1,2,1,7,1,12,5));const s=parseInt(wm(-3,0),10)||Number(parseInt(wm(-3,0),10));if(e[wm(-1,5)]{const e=Rm(t);if(!e)throw new Error(wm(0,0,1,7,1,12,5));let i,s="";try{const t=e.QG.slice(e.tH,e.tH+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(wm(0,39,1,40,1,41,5));const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!Om(`${s}-${r}`,n))throw new Error(wm(0,21,1,2,1,7,1,12,5));const o=Uint8Array.from(Cm(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(wm(-3,0),10)||Number(parseInt(wm(-3,0),10))))throw new Error(wm(0,21,1,2,1,3,1,4,5));const a=Int32Array.from(Cm(s,8)),l=gm(e[wm(-1,31)]).toString(pm),u=Int32Array.from(Cm(l,8)),c=gm(e[wm(-1,32)]).toString(pm),d=Int32Array.from(Cm(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t)))throw new Error(wm(0,21,1,2,1,7,1,12,5))})(t,e);break;case"0002":((t,e)=>{if(!e)throw new Error(wm(0,39,1,40,1,41,5));const i=Rm(t);if(!i)throw new Error(wm(0,0,1,7,1,12,5));const s=i.QG.slice(i.tH,i.QG.length),r=new DataView(s.buffer),n=new Int32Array(8);for(let t=0;tu[e]===t)))throw new Error(wm(0,21,1,2,1,7,1,12,5))})(t,e);break;default:throw new Error(wm(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}},Nm=(t,e,i=!0)=>{let s;Im=!1,e instanceof us?(s=e._e,e.G()):"container"in e&&(s="string"==typeof e.container?gt.document.getElementById(e.container):e.container);const r=!!s&&(s===gt.document.body||gt.document.body.contains(s)),n=s&&r?s:document.body,o=gt.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?wm(0,0,1,2,1,23,1,24,25,1):"")+h.charAt(0).toUpperCase()+h.substr(1);const a=gt.document.createElement("p1");o.append(a),a.innerHTML=h,a.style.color="red"},Gm=(t,e,i)=>{e?(t[wm(-1,17)](wm(-1,19),i),t[wm(-1,17)](wm(-1,20),i),t[wm(-1,17)](wm(-1,21),i),t[wm(-1,17)](wm(-1,22),i)):(t[wm(-1,18)](wm(-1,19),i),t[wm(-1,18)](wm(-1,20),i),t[wm(-1,18)](wm(-1,21),i),t[wm(-1,18)](wm(-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)}))},Hm=t=>{const i=()=>{};let s,r,n;if(new gt.Image instanceof gt.HTMLImageElement){const t=new gt.Image;t.src=pd,r=new sd({source:t,fitMode:e.ImageFitMode.Stretch});const i=new gt.Image;i.src=md,n=new sd({source:i,fitMode:e.ImageFitMode.Stretch})}else if(gt.lcjs_setup){const t=new gt.Image;t.src=pd;const i=gt.lcjs_setup(t.naturalWidth,t.naturalHeight);i.getContext("2d").drawImage(t,0,0),r=new sd({source:i,fitMode:e.ImageFitMode.Stretch}),n=r}else r=new z({color:w("#f00")}),n=r;const o=e=>{const i=e.ct.yi();if(e.Kc&&(e.iH&&(n?e.Kc.ps(n):gt.requestAnimationFrame((()=>o(e)))),e.iH||(r?e.Kc.ps(r):gt.requestAnimationFrame((()=>o(e))))),e.Kc){const t=(e.iH,150),s=(e.iH,32),r=e.ct.x.getInnerEnd()-(3+t)*i.x,n=e.ct.y.getInnerStart()+3*i.y;e.Kc.Sn({x:r,y:n}).q({x:t*i.x,y:s*i.y})}!1===e.iH&&(6530!==pd.length&&Nm(wm(0,36,1,38,5),t,!1),"W"!==pd[3361]&&Nm(wm(0,36,1,38,5),t,!1)),!0===e.iH&&(8542!==md.length&&Nm(wm(0,36,1,38,5),t,!1),"2"!==md[571]&&Nm(wm(0,36,1,38,5),t,!1)),s&&s.Bi()};return s=t.vT("logo",Number.MAX_SAFE_INTEGER),n=>{const h={ct:n,iH:!1};let a,l;return h.sH=()=>{a=gt.setTimeout((()=>{l=t.Ae(e.MouseStyles.Point),void 0!==h.Kc&&(h.Kc.setMouseClickEventHandler(Wm),h.Kc.setTouchEndEventHandler(Wm)),h.iH=!0,o(h)}),3e3)},h.eH=()=>{gt.clearTimeout(a),t.we(l),void 0!==h.Kc&&(h.Kc.setMouseClickEventHandler(i),h.Kc.setTouchEndEventHandler(i)),h.iH=!1,o(h)},(t=>{t.Kc&&t.Kc.dispose(),s&&(t.Kc=s.gc(t.ct).ps(r).setMouseInteractions(!0).setMouseClickEventHandler(i).setTouchEndEventHandler(i).$h(J),t.sH&&t.Kc.setMouseEnterEventHandler(t.sH),t.eH&&t.Kc.setMouseLeaveEventHandler(t.eH),o(t))})(h),{Gs:()=>o(h),G:()=>(t=>{t.Kc&&(t.Kc.dispose(),t.Kc=void 0,t.sH=()=>{},t.eH=()=>{})})(h)}}},Wm=()=>gt.open("https://lightningchart.com/lightningchart-js/"),Ym=s.Record({color:A(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class qm extends Ym{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 Xm=s.Record({gridStrokeLength:1,gridStrokeStyle:new tt,tickLength:7,tickStyle:new tt,tickPadding:0,labelFont:new Yi,labelFillStyle:new z,labelPadding:0,labelAlignment:0,labelRotation:0});class $m extends Xm{}class jm extends $m{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 Zm=Object.assign(Object.create(new class extends $m{}),{}),Km=(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},Jm=(t,e,i,...s)=>Km(-1,t,e,i,s),Qm=(t,e,i,...s)=>Km(-1,t,e,i,s),tp=(t,e,i,...s)=>Km(0,t,e,i,s),ep=(t,e,...i)=>Km(1,t,e,void 0,i),ip=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},sp=[{label:"MilliSecond100",unit:100,irregular:!1,greatTicks:void 0,majorTicks:{fitFunction:Oi({ignore:"first"},2,5)},minorTicks:{amount:4,fitFunction:Oi(void 0,2)}},{label:"Second",unit:1e3,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Oi({ignore:"first"},5,10,15,30)},minorTicks:{amount:4,fitFunction:Oi(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Oi({ignore:"first"},5,10,15,30)},minorTicks:{amount:12,fitFunction:Oi(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Oi({ignore:"first"},3,6,12)},minorTicks:{amount:8,fitFunction:Oi(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:Jm("day",1,(t=>0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"hours","minutes","seconds","millis")},majorTicks:{fitFunction:Oi({ignore:"last"},2,4)},minorTicks:{amount:7,fitFunction:Oi({ignore:"last"},2,3)}},{label:"Week",unit:6048e5,irregular:!0,getPrevKeyValue:ip(-1),getNextKeyValueIncludingRef:ip(0),getNextKeyValue:ip(1),greatTicks:!0,majorTicks:{fitFunction:Oi(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:Qm("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:tp("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:ep("monthIndex",1,"day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Oi(void 0,2,3)},minorTicks:{fitFunction:Oi(void 0,2,4,6)}},{label:"Year",unit:31536e6,irregular:!0,getPrevKeyValue:Qm("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:tp("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:ep("year",1,"monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Oi({ignore:"first"},2,5)},minorTicks:{fitFunction:Oi(void 0,2,5)}},{label:"Decade",unit:31536e7,irregular:!0,getPrevKeyValue:Qm("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:tp("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:ep("year",10,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:Oi(void 0,2,4)},minorTicks:{fitFunction:Oi(void 0,2,5)}},{label:"Century",unit:316224e7,irregular:!0,getPrevKeyValue:Qm("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:tp("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:ep("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:Qm("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:tp("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:ep("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],rp=(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=rp("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(sp.indexOf(o)<=sp.findIndex((t=>"Hour"===t.label)))return"left"===e?[h]:[];let u;if(!0===o.irregular)u=_i(i,s,o.getPrevKeyValue(t),o.getNextKeyValue(t));else{const e=o.greatTicks.getReferenceKeyValue(t)(i);u=Fi(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||Pe(c,a,l)?[h]:[c]:void 0!==c&&Pe(c,a,l)?[c]:[l]},op=(t,e)=>(i,s,r,n)=>{const o=rp(t,r,n);let h;if(void 0===o)return[];if("great"===t&&void 0!==o.greatTicks)if(!0===o.irregular)h=_i(i,s,o.getPrevKeyValue(e),o.getNextKeyValue(e));else{const t=o.greatTicks.getReferenceKeyValue(e)(i);h=Fi(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 sp[sp.indexOf(t)+1]})(o);if(void 0===t)return[];h=Ri(i,s,t.unit/o.minorTicks.amount,1)}}return h},hp=t=>(e,i,s,r,n,o)=>{const h=rp(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},ap=s.Record({locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new jm,majorTickStyle:new jm,minorTickStyle:new jm,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 lp extends ap{ws(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>sp.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]},`;gt.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=rp(t,u?l:a,u?a:l);if(void 0===c)return r(h);if("great"===t){let t;t=!1===Mt(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[sp.indexOf(c)];return void 0===f?"":"function"==typeof f?f(h,o,this.locale):f.format(h)},o=[],h=[{_i:"Great ticks (directive)",xg:0,bi:!0,pe:op("great",e),me:void 0},{_i:"Major ticks",xg:1,Ws:this.majorTickStyle,Ns:n("major"),pe:op("major",e),Ji:{Xs:hp("major")},me:void 0}];this.greatTickStyle!==Zm&&(o.push({_i:"Great ticks (left)",Ws:this.greatTickStyle.setLabelAlignment(-1),Ns:n("great","left"),pe:np(e,"left"),xi:!0,Ks:!1}),o.push({_i:"Great ticks (right)",Ws:this.greatTickStyle.setLabelAlignment(1),Ns:n("great","right"),pe:np(e,"right"),xi:!0,Ks:!1})),this.minorTickStyle!==Zm&&h.push({_i:"Minor ticks",xg:2,Ws:this.minorTickStyle,Ns:n("minor"),pe:op("minor",e),Ji:{Xs:hp("minor"),Qi:(t,e,i,s,r,n)=>{const o=rp("minor",r,n);return!o||"Week"!==o.label}},me:void 0});const a=this.cursorFormatter;return{Ai:o,wi:h,vi: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)} `},Ts:1e3,Is: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!==Zm?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!==Zm?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 up=(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 Fi(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,Ri(i,s,o,h)},cp=(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,dp=Oi(void 0,2,5),fp=(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,gp=(t,e)=>{const i=mi(t),s=pi(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),pe:Li,xi:!0,Ks:!0}),o.push({_i:"Major ticks",xg:0,Ws:this.majorTickStyle,Ns:void 0===e?s:(t,i,r)=>s(e+t,i,r),pe:"logarithmic"===t.type?gp(t.base,!0):up(0,!0),Ji:"logarithmic"===t.type?void 0:{Xs:cp},me:void 0}),this.minorTickStyle!==Zm&&o.push({_i:"Minor ticks",xg:1,Ws:this.minorTickStyle,Ns:void 0===e?r:(t,i,s)=>r(e+t,i,s),pe:"logarithmic"===t.type?gp(t.base,!1):up(1,!1),Ji:"logarithmic"===t.type?{Xs:fp}:{Xs:dp},me:50});const h=this.cursorFormatter?this.cursorFormatter:bi.Numeric;return{Ai:n,wi:o,vi:void 0===e?h:(t,i,s)=>h(e+t,i,s),Ts:1e-9,Is: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!==Zm?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!==Zm?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 yp=s.Record({cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new jm,minorTickStyle:new jm}),xp=(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"},Sp={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}${le(s,2)}:${le(r,2)}:${le(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}${le(s,2)}:${le(r,2)}:${le(n,2)}.${le(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}${le(s,2)}:${le(r,2)}:${le(n,2)}.${le(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}${le(s,2)}:${le(r,2)}:${le(n,2)}.${le(o,3)}${h}`}},vp={MajorHours12:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>{const r=432e5;return t=Math.floor(t/(4*r))*r*4,Fi(t,e,r,void 0,1e6)},fitKeyValues:Oi({ignore:"first"},2,4)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,36e5,1e6),fitKeyValues:Oi({},2,3,4,6)},defaultValueFormatter:Sp.hhmmss},MajorHours:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>{const r=36e5;return t=Math.floor(t/(12*r))*r*12,Fi(t,e,r,void 0,1e6)},fitKeyValues:Oi({ignore:"first"},2,6,12)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,3e5,1e6),fitKeyValues:Oi({},2,4,6)},defaultValueFormatter:Sp.hhmmss},MajorMinutes15:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>(t=36e5*Math.floor(t/36e5),Fi(t,e,9e5,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,6e4,1e6),fitKeyValues:Oi({},3,5)},defaultValueFormatter:Sp.hhmmss},MajorMinutes:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>(t=6e4*Math.floor(t/6e5)*10,Fi(t,e,6e4,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,5e3,1e6),fitKeyValues:Oi({},2,3,4,6)},defaultValueFormatter:Sp.hhmmss},MajorSeconds15:{major:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>(t=15e3*Math.floor(t/6e4)*4,Fi(t,e,15e3,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,4)},minor:{format:Sp.hhmmss,getKeyValues:(t,e,i,s)=>Ri(t,e,1e3,1e6),fitKeyValues:Oi({},3,5)},defaultValueFormatter:Sp.hhmmss},MajorSeconds:{major:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=1e3*Math.floor(t/1e4)*10,Fi(t,e,1e3,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>Ri(t,e,100,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmm},MajorMilliseconds100:{major:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=100*Math.floor(t/1e3)*10,Fi(t,e,100,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>Ri(t,e,10,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmm},MajorMilliseconds10:{major:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>(t=10*Math.floor(t/100)*10,Fi(t,e,10,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmm,getKeyValues:(t,e,i,s)=>Ri(t,e,1,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmm},MajorMilliseconds:{major:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=1*Math.floor(t/10)*10,Fi(t,e,1,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Ri(t,e,.1,1e6),fitKeyValues:Oi({},2)},defaultValueFormatter:Sp.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.1*Math.floor(t/1)*10,Fi(t,e,.1,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Ri(t,e,.01,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>(t=.01*Math.floor(t/.1)*10,Fi(t,e,.01,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>Ri(t,e,.001,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmmuuu},MajorMicroseconds:{major:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>(t=.001*Math.floor(t/.01)*10,Fi(t,e,.001,void 0,1e6)),fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Ri(t,e,100*1e-6,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>{const r=100*1e-6;return t=Math.floor(t/.001)*r*10,Fi(t,e,r,void 0,1e6)},fitKeyValues:Oi({ignore:"first"},2,5)},minor:{format:Sp.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>Ri(t,e,10*1e-6,1e6),fitKeyValues:Oi({},2,3,5)},defaultValueFormatter:Sp.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 bp extends yp{ws(t){const e=this.timeOrigin||0,i=[{_i:"Major ticks",xg:0,Ws:this.majorTickStyle,Ns:(t,i,s)=>{const r=xp(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,vp[r].major.format)(t+e,i,s)},pe:(t,e,i,s)=>{const r=xp(i,s);return(0,vp[r].major.getKeyValues)(t,e,i,s)},Ji:{Xs:(t,e,i,s,r,n)=>{const o=xp(r,n),h=vp[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},me:void 0}];return this.minorTickStyle instanceof jm&&i.push({_i:"Minor ticks",xg:1,Ws:this.minorTickStyle,Ns:(t,i,s)=>{const r=xp(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,vp[r].minor.format)(t+e,i,s)},pe:(t,e,i,s)=>{const r=xp(i,s);return(0,vp[r].minor.getKeyValues)(t,e,i,s)},Ji:{Xs:(t,e,i,s,r,n)=>{const o=xp(r,n),h=vp[o].minor.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},me:void 0}),{Ai:[],wi:i,vi:this.cursorFormatter||((t,i,s)=>{const r=xp(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return vp[r].defaultValueFormatter(t+e,i,s)}),Ts:1e-4,Is: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!==Zm?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 Mp={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"}},Ap={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"}},wp={"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"}},Dp={"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"}},Tp={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"}},Ep={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"}},Bp={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"}},kp={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"}},Ip={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"}},Cp={World:Ep,USA:Bp,NorthAmerica:kp,SouthAmerica:Ip,Canada:Dp,Europe:Tp,Asia:Ap,Africa:Mp,Australia:wp},Pp={Solid:ll},Lp={warm:t=>e=>D(60/(t-1)*e,.8,.8),cold:t=>e=>D(60/(t-1)*e+180,.8,.8),fullSpectrum:t=>e=>D(360/t*e,.8,.8),reverseSpectrum:t=>e=>D(360/t*(t-e),.8,.8),flatUI:t=>e=>D(360/t*e+8,.8,.8-.15/t*e),arction:t=>e=>{const i=1-.2/t*e;return D(360/t*e+51,i,i)},arctionWarm:t=>e=>{const i=t-1,s=1-.2/i*e;return D(46-46/i*e+4,s,s)},sunset:t=>e=>{const i=[170,320];return D(e%2?i[0]:i[1],.8,.5+.5/(t-1)*e)},dynamic:t=>e=>{const i=e%2,s=[234,346];return D(i?s[0]:s[1],i?.3:.9,.5+.5/(t-1)*e)},magenta:t=>e=>{const i=[.9,.6];return D(354,e%2?i[0]:i[1],.5+.5/(t-1)*e)},greyscale:t=>e=>D(0,0,.25+.5/(t-1)*e),frozen:t=>e=>{const i=[.8,.6];return D(160+80/(t-1)*e,.6,e%2?i[0]:i[1])},retro:t=>e=>{const i=[6,183];return D(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),D(i,.9,.8)},custom:(t,e)=>i=>{const s=.25+.5/(t-1)*i;if(!e)return D(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=>D(t+(e-t)/r*n,i,s),auroraBorealis:t=>e=>Rp([{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=>Rp([{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=>Rp([{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=>Rp([{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=>Rp([{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=>Rp([{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)},Rp=(t,e,i)=>{const s=_p(e,i),[r,n]=Op(s,t),o=Fp(t[r]),h=Fp(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:ha(o.h,h.h,a),s:ha(o.s,h.s,a),v:ha(o.v,h.v,a)};return D(l.h,l.s,l.v)},Fp=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},Op=(t,e)=>{if(e.length<2)throw new Error("Invalid palette size");for(let i=0;i{const i=(t=>{const e=new z({color:t.uiStrokeColorContrastHigh}),i=new z({color:t.uiStrokeColorContrastMedium}),s=new z({color:t.uiStrokeColorContrastLow}),r=new Yi({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 z({color:t.dataHighlightOverlayColor}),f=new tt({thickness:2,fillStyle:t.legendBackgroundBorderFillStyle}),g=t.dataColorPalette.map((t=>new z({color:t.stroke}))),m=t=>g[t%g.length],p=g.map((t=>new tt({thickness:2,fillStyle:t}))),y=t=>p[t%p.length],x=t.dataColorPalette.map((t=>new z({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 Z({angle:180,stops:[{color:se(e,A(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:se(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 Z({angle:180,stops:[{color:se(e,A(255,255,255,e.getA()),.3),offset:0},{color:e,offset:.5},{color:se(e,A(0,0,0,e.getA()),.3),offset:1}]})})),w=t=>M[t%M.length],D=t.dataColorPaletteInverted.map((t=>new z({color:t.border}))).map((t=>new tt({thickness:2,fillStyle:t}))),T=t=>D[t%D.length],E=new z({color:t.dataColorPositive}),B=new z({color:t.dataColorNegative}),k=new tt({thickness:1,fillStyle:new z({color:t.dataStrokeColorContrastHigh.setA(50)})}),I=new tt({thickness:2,fillStyle:t.axisLineFillStyle}),C=J,P=new z({color:A(0,0,0,1)}),L=new tt({thickness:1,fillStyle:t.axisGridMajorFillStyle}),R=new tt({thickness:1,fillStyle:t.axisTickMajorFillStyle}),_=h,O=t.axisLabelMajorFillStyle,V=new tt({thickness:1,fillStyle:t.axisGridMajorFillStyle}),N=new tt({thickness:1,fillStyle:t.axisTickMajorFillStyle}),G=h,U=t.axisLabelMajorFillStyle,H=new tt({thickness:1,fillStyle:t.axisGridMinorFillStyle}),W=new tt({thickness:1,fillStyle:t.axisTickMinorFillStyle}),Y=a,q=t.axisLabelMinorFillStyle,X=Zm,$=new jm({gridStrokeStyle:L,tickStyle:R,tickLength:50,tickPadding:-14,labelFont:_,labelPadding:0,labelFillStyle:O}),j=new jm({gridStrokeStyle:V,tickStyle:N,tickLength:7,tickPadding:0,labelFont:G,labelPadding:0,labelFillStyle:U}),K=new jm({gridStrokeStyle:H,tickStyle:W,tickLength:4,tickPadding:5,labelFont:Y,labelPadding:0,labelFillStyle:q}),Q=new pp({extremeTickStyle:X,majorTickStyle:j,minorTickStyle:K}),et=new lp({greatTickStyle:$,majorTickStyle:j,minorTickStyle:K}),it=new bp({majorTickStyle:j,minorTickStyle:K}),st=new z({color:t.dataHighlightOverlayColor}),rt=new tt({thickness:1,fillStyle:i}),nt=new tt({thickness:2,fillStyle:i}),ot=t=>new Ji.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=ne(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:m,pointSeriesFillStyle:m,ellipseSeriesFillStyle:m,ellipseSeriesStrokeStyle:y,polygonSeriesFillStyle:m,polygonSeriesStrokeStyle:y,rectangleSeriesFillStyle:m,rectangleSeriesStrokeStyle:J,segmentSeriesStrokeStyle:y,boxSeriesBodyFillStyle:m(0),boxSeriesBodyStrokeStyle:J,boxSeriesStrokeStyle:new tt({thickness:1,fillStyle:g[0]}),boxSeriesMedianStrokeStyle:new tt({thickness:1,fillStyle:new z({color:A(0,0,0)})}),ohlcCandleBodyFillStylePositive:E,ohlcCandleBodyFillStyleNegative:B,ohlcCandleBodyStrokeStylePositive:J,ohlcCandleBodyStrokeStyleNegative:J,ohlcCandleStrokeStyle:new tt({thickness:1,fillStyle:new z({color:t.uiStrokeColorContrastHigh})}),ohlcBarStrokeStylePositive:new tt({thickness:2,fillStyle:E}),ohlcBarStrokeStyleNegative:new tt({thickness:2,fillStyle:B}),heatmapGridSeriesFillStyle:m,heatmapGridSeriesWireframeStyle:k,heatmapScrollingGridSeriesFillStyle:m,heatmapScrollingGridSeriesWireframeStyle:k,areaRangeSeriesFillStyle:b,areaRangeSeriesStrokeStyle:S,areaRangeSeriesFillStyleInverted:w,areaRangeSeriesStrokeStyleInverted:T,areaSeriesBipolarHighFillStyle:b,areaSeriesBipolarHighStrokeStyle:S,areaSeriesBipolarLowFillStyle:w,areaSeriesBipolarLowStrokeStyle:T,areaSeriesPositiveFillStyle:b,areaSeriesPositiveStrokeStyle:S,areaSeriesNegativeFillStyle:w,areaSeriesNegativeStrokeStyle:T,xAxisTitleFont:o,xAxisTitleFillStyle:t.axisTitleFillStyle,xAxisStrokeStyle:I,xAxisNibStyle:C,xAxisOverlayStyle:P,xAxisZoomingBandFillStyle:d,xAxisZoomingBandStrokeStyle:J,xAxisNumericTicks:Q,xAxisDateTimeTicks:et,xAxisTimeTicks:it,yAxisTitleFont:o,yAxisTitleFillStyle:t.axisTitleFillStyle,yAxisStrokeStyle:I,yAxisNibStyle:C,yAxisOverlayStyle:P,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:I,xAxis3DNumericTicks:Q,xAxis3DDateTimeTicks:et,xAxis3DTimeTicks:it,yAxis3DTitleFont:o,yAxis3DTitleFillStyle:t.axisTitleFillStyle,yAxis3DStrokeStyle:I,yAxis3DNumericTicks:Q,yAxis3DDateTimeTicks:et,yAxis3DTimeTicks:it,zAxis3DTitleFont:o,zAxis3DTitleFillStyle:t.axisTitleFillStyle,zAxis3DStrokeStyle:I,zAxis3DNumericTicks:Q,zAxis3DDateTimeTicks:et,zAxis3DTimeTicks:it,lineSeries3DStrokeStyle:y,pointLineSeries3DStrokeStyle:y,pointLineSeries3DPointStyle:ot,pointSeries3DPointStyle:ot,pointCloudSeries3DPointStyle:t=>new Ji.Pixelated({size:5,fillStyle:g[t%g.length]}),surfaceGridSeries3DFillStyle:m,surfaceGridSeries3DWireframeStyle:k,surfaceScrollingGridSeries3DFillStyle:m,surfaceScrollingGridSeries3DWireframeStyle:k,boxSeries3DFillStyle:m,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:I,polarAmplitudeAxisNumericTicks:Q,polarAmplitudeAxisDateTimeTicks:et,polarAmplitudeAxisTimeTicks:it,polarRadialAxisTitleFont:o,polarRadialAxisTitleFillStyle:t.axisTitleFillStyle,polarRadialAxisStrokeStyle:I,polarRadialAxisTickStyle:j,polarLineSeriesStrokeStyle:y,polarPointLineSeriesFillStyle:m,polarPointLineSeriesStrokeStyle:y,polarPointSeriesFillStyle:m,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 z({color:t.dataStrokeColorContrastMedium})}),mapChartOutlierRegionFillStyle:F,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 z({color:t.uiBackgroundColor}),dataGridBorderStrokeStyle:new tt({thickness:.4,fillStyle:new z({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:m(0),sparkBarChartFillStyle:m(0),sparkBarChartStrokeStyle:S(0),sparkAreaChartFillStyle:b(0),sparkAreaChartStrokeStyle:S(0),sparkPieChartFillStyle:m,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:m,pieChartBackgroundFillStyle:t.panelBackgroundFillStyle,pieChartBackgroundStrokeStyle:J,pieChartTitleFont:n,pieChartTitleFillStyle:t.titleFillStyle,pieChartSliceFillStylePalette:m,pieChartSliceStrokeStyle:ut,pieChartSliceLabelFont:u,pieChartSliceLabelFillStyle:t.uiTextFillStyle,pieChartConnectorStrokeStyle:dt,funnelChartBackgroundFillStyle:t.panelBackgroundFillStyle,funnelChartBackgroundStrokeStyle:J,funnelChartTitleFont:n,funnelChartTitleFillStyle:t.titleFillStyle,funnelChartSliceFillStylePalette:m,funnelChartSliceStrokeStyle:ut,funnelChartSliceLabelFont:u,funnelChartSliceLabelFillStyle:t.uiTextFillStyle,funnelChartConnectorStrokeStyle:dt,pyramidChartBackgroundFillStyle:t.panelBackgroundFillStyle,pyramidChartBackgroundStrokeStyle:J,pyramidChartTitleFont:n,pyramidChartTitleFillStyle:t.titleFillStyle,pyramidChartSliceFillStylePalette:m,pyramidChartSliceStrokeStyle:ut,pyramidChartSliceLabelFont:u,pyramidChartSliceLabelFillStyle:t.uiTextFillStyle,pyramidChartConnectorStrokeStyle:dt,gaugeChartBackgroundFillStyle:t.panelBackgroundFillStyle,gaugeChartBackgroundStrokeStyle:J,gaugeChartTitleFont:n,gaugeChartTitleFillStyle:t.titleFillStyle,gaugeChartEmptyGaugeFillStyle:new z({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:F,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}},Vp=(t,e)=>{const i=new Image;i.crossOrigin="*";const s=`${t}/themes/${e}`;return i.addEventListener("error",(e=>{ve(t,s,"Theme with asset",{shouldCrash:!1})})),i.src=s,i},Np=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:se(e[s%e.length].stroke,A(255,255,255),.5);return new $({stops:[{color:se(r,A(255,255,255),.5*i).setA(100),offset:0},{color:r.setA(100),offset:.5},{color:se(r,A(30,30,30),.5*i).setA(100),offset:1}]})},Gp=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:se(e[s%e.length].stroke,A(255,255,255),.2);return new $({stops:[{color:se(r,A(255,255,255),.2*i),offset:0},{color:r,offset:.5},{color:se(r,A(0,0,0),.2*i),offset:1}]})},Up=(t,e,i)=>s=>{const r=!0===t?e[s%e.length].stroke:se(e[s%e.length].stroke,A(255,255,255),.2);return new Z({angle:90,stops:[{color:se(r,A(255,255,255),.5*i),offset:0},{color:r,offset:.35},{color:se(r,A(30,30,30),.5*i),offset:1}]})},Hp=(t,e,i)=>i=>{const s=!0===t?e[i%e.length].stroke:se(e[i%e.length].stroke,A(255,255,255),.3);return new Z({angle:90,stops:[{color:se(s,A(255,255,255),.5),offset:0},{color:s,offset:.35},{color:se(s,A(30,30,30),.5),offset:1}]})},Wp=(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:se(r,A(255,255,255),.5*s),offset:0},{color:r,offset:.5},{color:!0===t?r:se(r,A(0,0,0),.5*s),offset:1}]})},Yp=xe((()=>{const t=A(255,255,255),i=new z({color:t}),s=!0,r=new qm({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 z({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 z({color:A(255,255,220)}),u=new z({color:A(255,255,166)}),c=new z({color:A(255,255,220)}),d=new z({color:A(255,255,220,130)}),f=new z({color:A(255,255,200)}),g=f,m=g,p=new Z({angle:45,stops:[{offset:0,color:A(230,230,230)},{offset:1,color:A(150,150,150)}]}),y=new z({color:A(220,220,220)}),x=new z({color:A(200,200,200,50)}),S=new z({color:A(200,200,200,150)}),v=new z({color:A(200,200,200,20)}),b=new z({color:A(150,150,150)}),M=new Z({angle:0,stops:[{offset:0,color:A(10,10,10,220)},{offset:1,color:A(30,30,30,220)}]}),w=i,D=A(255,255,200),T=M,E=w,B=A(20,20,20),k=A(0,0,0),I=t,C=A(150,150,150),P=A(50,50,50),L=A(50,50,50),R=A(100,100,100),F=A(200,200,200),_=[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)}))),O=t.setA(20),V=A(176,255,157,255),N=A(255,112,76,255),G={mapChartFillStyle:new Z({angle:135,stops:[{color:A(255,255,91,255),offset:0},{color:A(255,155,91,255),offset:1}]}),spiderSeriesFillStyle:Np(s,_,.5),pieChartSliceFillStylePalette:Gp(s,_,1),funnelChartSliceFillStylePalette:Up(s,_,1),pyramidChartSliceFillStylePalette:Up(s,_,1),rectangleSeriesFillStyle:Hp(s,_),gaugeChartGaugeFillStyle:Wp(s,_,1)},U=new z({color:A(176,255,157,255)}),H=new z({color:A(255,146,146,255)}),W=new z({color:A(176,255,157,255)}),Y=new z({color:A(230,63,63,255)}),q=new z({color:A(176,255,157,120)}),X=new z({color:A(229,63,63,180)}),j=new z({color:A(27,37,36,255)}),K=new z({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 z({color:A(148,148,198,255)}),rt=q.getColor().setA(255),nt=A(100,100,100);return zp({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:m,axisLineFillStyle:p,axisTickMajorFillStyle:y,axisGridMajorFillStyle:x,axisTickMinorFillStyle:S,axisGridMinorFillStyle:v,cursorGridFillStyle:b,legendBackgroundFillStyle:M,legendBackgroundBorderFillStyle:w,legendButtonDefaultColor:D,resultTableBackgroundFillStyle:T,resultTableBackgroundBorderFillStyle:E,uiBackgroundColor:B,uiBackgroundBorderColor:k,uiStrokeColorContrastHigh:I,uiStrokeColorContrastMedium:C,uiStrokeColorContrastLow:P,dataStrokeColorContrastHigh:L,dataStrokeColorContrastMedium:R,dataStrokeColorContrastLow:F,dataColorPalette:_,dataColorPaletteInverted:[{area:A(190,50,50,100),border:A(210,80,80)}],dataHighlightOverlayColor:O,dataColorPositive:V,dataColorNegative:N,overrideThemeProperties:G},{positiveTextFillStyle:U,negativeTextFillStyle:H,positiveFillStyle:W,negativeFillStyle:Y,positiveAreaFillStyle:q,negativeAreaFillStyle:X,positiveBackgroundFillStyle:j,negativeBackgroundFillStyle:K,badGoodColorPalette:J,coldHotColorPalette:Q,intensityColorPalette:tt,spectrogramColorPalette:et,bollingerFillStyle:it,bollingerBorderFillStyle:st,highlightPointColor:t,highlightDataGridColor:rt,unfocusedDataColor:nt})})),qp=xe((()=>{const t=A(255,255,255),i=new z({color:t}),s=!0,r=new qm({spread:0,blur:9,offset:{x:0,y:0},color:A(105,255,236,40)}),n=new z({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 z({color:A(0,5,8,150)}),a=i,l=i,u=i,c=new z({color:A(255,255,220,130)}),d=i,f=i,g=f,m=new z({color:A(20,224,250,255)}),p=i,y=new z({color:A(61,94,110,100)}),x=new z({color:A(61,94,110,255)}),S=new z({color:A(61,94,110,40)}),v=i,b=new z({color:A(0,18,23,255)}),M=i,w=t,D=new z({color:A(0,17,22,240)}),T=i,E=A(0,38,48,220),B=A(0,0,0),k=t,I=A(150,150,150),C=A(19,78,93),P=A(50,50,50),L=A(0,36,48),R=A(200,200,200),F=[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)}))),_=t.setA(50),O=A(3,217,194,255),V=A(230,63,63,255),N={mapChartFillStyle:new Z({angle:135,stops:[{color:A(118,248,231,255),offset:0},{color:A(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Np(s,F,1),pieChartSliceFillStylePalette:Gp(s,F,1),funnelChartSliceFillStylePalette:Up(s,F,1),pyramidChartSliceFillStylePalette:Up(s,F,1),rectangleSeriesFillStyle:Hp(s,F),gaugeChartGaugeFillStyle:Wp(s,F,1)},G=new z({color:A(45,253,253,255)}),U=new z({color:A(255,146,146,255)}),H=new z({color:A(45,253,253,255)}),W=new z({color:A(230,63,63,255)}),Y=new z({color:A(1,190,164,120)}),q=new z({color:A(229,63,63,180)}),X=new z({color:A(1,53,57,255)}),j=new z({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 z({color:A(122,103,254,255)}),st=Y.getColor().setA(255),rt=A(15,83,83);return zp({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new sd({source:Vp(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:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:D,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:E,uiBackgroundBorderColor:B,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:C,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:R,dataColorPalette:F,dataColorPaletteInverted:[{area:A(170,60,210,100),border:A(210,100,250)}],dataHighlightOverlayColor:_,dataColorPositive:O,dataColorNegative:V,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:Y,negativeAreaFillStyle:q,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),Xp=xe((()=>{const t=!1,i=new qm({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 z({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 z({color:A(33,43,49)}),a=new z({color:A(33,43,49)}),l=new z({color:A(33,43,49)}),u=new z({color:A(33,43,49,150)}),c=new z({color:A(33,43,49)}),d=c,f=d,g=new Z({angle:45,stops:[{offset:0,color:A(225,225,225)},{offset:1,color:A(225,225,225)}]}),m=new z({color:A(168,186,199,255)}),p=new z({color:A(168,186,199,120)}),y=new z({color:A(168,186,199,40)}),x=new z({color:A(168,186,199,40)}),S=new z({color:A(128,146,159,255)}),v=new Z({angle:0,stops:[{offset:0,color:A(255,255,255,240)},{offset:1,color:A(255,255,255,240)}]}),b=new z({color:A(168,186,199)}),M=A(255,255,200),w=new z({color:A(255,255,255,240)}),D=new z({color:A(128,146,159,255)}),T=A(255,255,255,255),E=A(168,168,199,255),B=A(168,186,199,255),k=A(168,186,199,255),I=A(168,186,199,255),C=A(168,186,199,255),P=A(100,100,100),L=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)}))),F=A(150,150,150,80),_=A(46,182,120,255),O=A(255,66,66,255),V=new tt({thickness:2,fillStyle:new z({color:A(168,186,199,255)})}),N={mapChartFillStyle:new Z({angle:-45,stops:[{color:A(2,181,213,255),offset:0},{color:A(175,243,255,255),offset:1}]}),spiderSeriesFillStyle:Np(t,R,.8),pieChartSliceFillStylePalette:Gp(t,R,.8),funnelChartSliceFillStylePalette:Up(t,R,.5),pyramidChartSliceFillStylePalette:Up(t,R,.5),rectangleSeriesFillStyle:Hp(t,R),gaugeChartGaugeFillStyle:Wp(t,R,.8),chartXYSeriesBackgroundStrokeStyle:V,chart3DSeriesBackgroundStrokeStyle:V,polarChartSeriesBackgroundStrokeStyle:V,spiderChartSeriesBackgroundStrokeStyle:V,dataGridTextFillStyle:new z({color:A(0,88,64,255)})},G=new z({color:A(4,146,108,255)}),U=new z({color:A(240,39,39,255)}),H=new z({color:A(28,181,140,255)}),W=new z({color:A(230,88,88,255)}),Y=new z({color:A(28,181,140,180)}),q=new z({color:A(230,88,88,180)}),X=new z({color:A(229,243,228)}),j=new z({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 z({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=Y.getColor().setA(255),nt=A(150,150,150);return zp({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:m,axisGridMajorFillStyle:p,axisTickMinorFillStyle:y,axisGridMinorFillStyle:x,cursorGridFillStyle:S,legendBackgroundFillStyle:v,legendBackgroundBorderFillStyle:b,legendButtonDefaultColor:M,resultTableBackgroundFillStyle:w,resultTableBackgroundBorderFillStyle:D,uiBackgroundColor:T,uiBackgroundBorderColor:E,uiStrokeColorContrastHigh:B,uiStrokeColorContrastMedium:k,uiStrokeColorContrastLow:I,dataStrokeColorContrastHigh:C,dataStrokeColorContrastMedium:P,dataStrokeColorContrastLow:L,dataColorPalette:R,dataColorPaletteInverted:[{area:A(190,50,50,100),border:A(210,80,80)}],dataHighlightOverlayColor:F,dataColorPositive:_,dataColorNegative:O,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:Y,negativeAreaFillStyle:q,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:et,bollingerFillStyle:st,bollingerBorderFillStyle:it,highlightPointColor:A(0,0,0),highlightDataGridColor:rt,unfocusedDataColor:nt})})),$p=xe((()=>{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 z({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 z({color:A(1,61,53)}),h=new z({color:A(1,61,53)}),a=new z({color:A(1,61,53)}),l=new z({color:A(1,61,53,150)}),u=new z({color:A(1,61,53)}),c=u,d=c,f=new Z({angle:45,stops:[{offset:0,color:A(225,225,225)},{offset:1,color:A(225,225,225)}]}),g=new z({color:A(188,211,186,255)}),m=new z({color:A(188,211,186,150)}),p=new z({color:A(188,211,186,50)}),y=new z({color:A(188,211,186,50)}),x=new z({color:A(104,148,111,255)}),S=new Z({angle:0,stops:[{offset:0,color:A(255,255,255,240)},{offset:1,color:A(255,255,255,240)}]}),v=new z({color:A(104,148,111)}),b=A(255,255,200),M=new z({color:A(255,255,255,240)}),w=new z({color:A(104,148,111,255)}),D=A(255,255,255,255),T=A(179,201,183,255),E=A(188,211,186,255),B=A(188,211,186,255),k=A(188,211,186,255),I=A(188,211,186,255),C=A(100,100,100),P=A(200,200,200),L=[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),F=A(46,182,84,255),_=A(232,96,96,255),O=new tt({thickness:2,fillStyle:new z({color:A(188,211,186,255)})}),V={mapChartFillStyle:new Z({angle:-45,stops:[{color:A(118,160,121,255),offset:0},{color:A(174,227,178,255),offset:1}]}),spiderSeriesFillStyle:Np(t,L,.8),pieChartSliceFillStylePalette:Gp(t,L,.8),pyramidChartSliceFillStylePalette:Up(t,L,.5),funnelChartSliceFillStylePalette:Up(t,L,.5),rectangleSeriesFillStyle:Hp(t,L),gaugeChartGaugeFillStyle:Wp(t,L,.8),chartXYSeriesBackgroundStrokeStyle:O,chart3DSeriesBackgroundStrokeStyle:O,polarChartSeriesBackgroundStrokeStyle:O,spiderChartSeriesBackgroundStrokeStyle:O,dataGridTextFillStyle:new z({color:A(77,66,21,255)})},N=new z({color:A(93,151,97,255)}),G=new z({color:A(178,99,99,255)}),U=new z({color:A(138,195,142,255)}),H=new z({color:A(178,99,99,255)}),W=new z({color:A(138,195,142,180)}),Y=new z({color:A(178,99,99,180)}),q=new z({color:A(224,240,237)}),X=new z({color:A(251,227,227)}),j=[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 z({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=W.getColor().setA(255),rt=A(150,150,150);return zp({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:m,axisTickMinorFillStyle:p,axisGridMinorFillStyle:y,cursorGridFillStyle:x,legendBackgroundFillStyle:S,legendBackgroundBorderFillStyle:v,legendButtonDefaultColor:b,resultTableBackgroundFillStyle:M,resultTableBackgroundBorderFillStyle:w,uiBackgroundColor:D,uiBackgroundBorderColor:T,uiStrokeColorContrastHigh:E,uiStrokeColorContrastMedium:B,uiStrokeColorContrastLow:k,dataStrokeColorContrastHigh:I,dataStrokeColorContrastMedium:C,dataStrokeColorContrastLow:P,dataColorPalette:L,dataColorPaletteInverted:[{area:A(210,70,70,100),border:A(200,110,110)}],dataHighlightOverlayColor:R,dataColorPositive:F,dataColorNegative:_,overrideThemeProperties:V},{positiveTextFillStyle:N,negativeTextFillStyle:G,positiveFillStyle:U,negativeFillStyle:H,positiveAreaFillStyle:W,negativeAreaFillStyle:Y,positiveBackgroundFillStyle:q,negativeBackgroundFillStyle:X,badGoodColorPalette:j,coldHotColorPalette:K,intensityColorPalette:J,spectrogramColorPalette:Q,bollingerFillStyle:it,bollingerBorderFillStyle:et,highlightPointColor:A(0,0,0),highlightDataGridColor:st,unfocusedDataColor:rt})})),jp=xe((()=>{const t=A(255,255,255),i=new z({color:t}),s=!0,r=new qm({spread:1,blur:9,offset:{x:0,y:0},color:A(255,255,255,30)}),n=new z({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 z({color:A(0,5,8,150)}),a=i,l=i,u=i,c=new z({color:A(255,255,220,130)}),d=i,f=i,g=f,m=new Z({angle:45,stops:[{offset:0,color:A(241,133,255,255)},{offset:1,color:A(115,207,238,255)}]}),p=i,y=new z({color:A(61,94,110,100)}),x=new z({color:A(61,94,110,255)}),S=new z({color:A(61,94,110,40)}),v=i,b=new z({color:A(0,18,23,255)}),M=i,w=A(115,207,238,255),D=new z({color:A(0,17,22,240)}),T=i,E=A(0,38,48,255),B=A(0,0,0),k=t,I=A(150,150,150),C=A(19,57,93),P=A(50,50,50),L=A(0,17,48),R=A(200,200,200),F=[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)}))),_=t.setA(50),O=A(3,217,194,255),V=A(243,21,110,255),N={mapChartFillStyle:new Z({angle:135,stops:[{color:A(118,248,231,255),offset:0},{color:A(45,177,255,255),offset:1}]}),spiderSeriesFillStyle:Np(s,F,.5),pieChartSliceFillStylePalette:Gp(s,F,2),funnelChartSliceFillStylePalette:Up(s,F,1),pyramidChartSliceFillStylePalette:Up(s,F,1),rectangleSeriesFillStyle:Hp(s,F),gaugeChartGaugeFillStyle:Wp(s,F,1)},G=new z({color:A(20,211,237,255)}),U=new z({color:A(253,145,178,255)}),H=new z({color:A(20,211,237,255)}),W=new z({color:A(239,68,121,255)}),Y=new z({color:A(20,211,237,120)}),q=new z({color:A(239,68,121,180)}),X=new z({color:A(1,53,57,255)}),j=new z({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 z({color:A(237,73,252,255)}),st=Y.getColor().setA(255),rt=A(8,70,100);return zp({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new sd({source:Vp(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:m,axisTickMajorFillStyle:p,axisGridMajorFillStyle:y,axisTickMinorFillStyle:x,axisGridMinorFillStyle:S,cursorGridFillStyle:v,legendBackgroundFillStyle:b,legendBackgroundBorderFillStyle:M,legendButtonDefaultColor:w,resultTableBackgroundFillStyle:D,resultTableBackgroundBorderFillStyle:T,uiBackgroundColor:E,uiBackgroundBorderColor:B,uiStrokeColorContrastHigh:k,uiStrokeColorContrastMedium:I,uiStrokeColorContrastLow:C,dataStrokeColorContrastHigh:P,dataStrokeColorContrastMedium:L,dataStrokeColorContrastLow:R,dataColorPalette:F,dataColorPaletteInverted:[{area:A(41,130,255,100),border:A(45,110,240)}],dataHighlightOverlayColor:_,dataColorPositive:O,dataColorNegative:V,overrideThemeProperties:N},{positiveTextFillStyle:G,negativeTextFillStyle:U,positiveFillStyle:H,negativeFillStyle:W,positiveAreaFillStyle:Y,negativeAreaFillStyle:q,positiveBackgroundFillStyle:X,negativeBackgroundFillStyle:j,badGoodColorPalette:K,coldHotColorPalette:J,intensityColorPalette:Q,spectrogramColorPalette:tt,bollingerFillStyle:et,bollingerBorderFillStyle:it,highlightPointColor:t,highlightDataGridColor:st,unfocusedDataColor:rt})})),Zp={};Object.defineProperty(Zp,"darkGold",{get:Yp,enumerable:!0}),Object.defineProperty(Zp,"turquoiseHexagon",{get:qp,enumerable:!0}),Object.defineProperty(Zp,"light",{get:Xp,enumerable:!0}),Object.defineProperty(Zp,"lightNature",{get:$p,enumerable:!0}),Object.defineProperty(Zp,"cyberSpace",{get:jp,enumerable:!0});const Kp=Zp,Jp=Kp.darkGold,Qp=(t,e,i)=>s=>{const r={theme:Jp,...i,...s},n=t(r),o=e?Hm(n):void 0,h=new fd(n.Mh,s,n,n.G.bind(n),o);return n.jh((()=>h.tD())).Xh((()=>h.X())).Bi(),h},ty=(t,e)=>{t.jh((()=>{e.ru()})).Xh((()=>e.X())).Bi()},ey=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new fo(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o);return ty(n,h),h},iy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Mc(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s);return ty(n,h),h},sy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Rl(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s);return ty(n,h),h},ry=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Ua(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s);return ty(n,h),h},ny=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:zo)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return ty(n,h),h},oy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:ll)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return ty(n,h),h},hy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:Ja)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return ty(n,h),h},ay=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new(s&&s.type?s.type:yl)(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,!(!s||!s.disableAnimations));return ty(n,h),h},ly=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new Xh(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,s,void 0);return ty(n,h),h},uy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new mh(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0,s);return ty(n,h),h},cy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||Jp},n=t(r),o=e?Hm(n):void 0,h=new rd(n.Mh,Bc(n,1)._T(0),st,n.G.bind(n),o,void 0);return ty(n,h),h};let dy;const fy={None:ln,Rectangle:pn,Circle:yn,Diamond:xn,Pointer:Sn},gy={Rectangle:pn,Circle:yn,Diamond:xn},my={XY:wa},py={XY:Aa,Spider:Rh,Map:_h,Polar:Rh},yy={None:un,UIRectangle:pn,UICircle:yn,UIDiamond:xn};e.Animation=H,e.AnimationEasings=U,e.Animator=W,e.AreaRangeSeries=tc,e.AreaSeries=Xu,e.AreaSeriesBipolar=Ku,e.AreaSeriesMonopolar=$u,e.AreaSeriesNegative=Zu,e.AreaSeriesPositive=ju,e.AreaSeriesTypes=Ju,e.AutoCursor2DBuilder=Ih,e.AutoCursorBuilders=py,e.AutoCursorXYBuilder=ba,e.AutoFitStrategies=Mh,e.AutoFitStrategy=Sh,e.Axis=no,e.Axis3D=Yo,e.AxisScrollStrategies=Bi,e.AxisTickStrategies=ki,e.Band=Jr,e.BasicSeries=_a,e.BorderedPicture=dn,e.BoxAndWhiskers=ql,e.BoxFigure=Yl,e.BoxSeries=Wu,e.BoxSeries3D=th,e.Button=_n,e.Chart=mo,e.Chart3D=mh,e.ChartComponent=Zr,e.ChartMarker=Ea,e.ChartMarker2D=class extends Ea{constructor(t,e,i,s,r,n){super(t,e,i,s.VS(t,e,i,n),r,n)}},e.ChartMarkerXY=ka,e.ChartWithCursor=qh,e.ChartWithSeries=ah,e.ChartXY=Mc,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")?w(t):w((t=>{const e=T[t.toLowerCase()];if(e)return e;throw new Error(`Unknown color code: ${t}`)})(t))}catch(t){}return console.warn(`ColorCSS parsing error: ${t}`),w("#fff")},e.ColorHEX=w,e.ColorHSV=D,e.ColorPalettes=Lp,e.ColorRGBA=A,e.ColorShadingStyles=Jo,e.ConstantLine=Qr,e.CursorBuilder=kh,e.CursorBuilderXY=va,e.CustomTick=Xr,e.CustomizableFigure=Hl,e.Dashboard=fd,e.DataGrid=rd,e.DateTimeTickStrategy=lp,e.EllipseFigure=wu,e.EllipseSeries=Du,e.EmptyFill=R,e.EmptyPointMarker=un,e.EmptyUIElement=an,e.Figure=Gl,e.FigureSeries=Ul,e.FontSettings=Yi,e.FormattingFunctions=bi,e.FunnelChart=ja,e.FunnelChartTypes=tl,e.FunnelChartWithLabelsInsideSlices=Qa,e.FunnelChartWithLabelsOnSides=Ja,e.FunnelSlice=Wa,e.GaugeChart=sl,e.GaugeChartTypes=Pp,e.GaugeSlice=nl,e.GenericAxis=Ni,e.GlowEffect=qm,e.HeatmapGridSeries=rc,e.HeatmapGridSeriesIntensityValues=nc,e.HeatmapScrollingGridSeries=oc,e.HeatmapScrollingGridSeriesIntensityValues=hc,e.Highlighter=Kr,e.Icon=td,e.ImageFill=sd,e.IndividualPointFill=V,e.LUT=P,e.LegendBoxBuilders=eo,e.LineAndPointSeries3D=eh,e.LineSeries=yu,e.LineSeries3D=ih,e.LinearGradientFill=Z,e.LinearGradientFillPalette=(t,e,i,s)=>{const r=t(e+1,s);return t=>new Z({stops:[{offset:0,color:r(t).getDarker()},{offset:.5,color:r(t)},{offset:1,color:r(t).getDarker()}],angle:i||90})},e.MapChart=Xh,e.MapRegions=Cp,e.MapRegionsAfrica=Mp,e.MapRegionsAsia=Ap,e.MapRegionsAustralia=wp,e.MapRegionsCanada=Dp,e.MapRegionsEurope=Tp,e.MapRegionsNorthAmerica=kp,e.MapRegionsSouthAmerica=Ip,e.MapRegionsUSA=Bp,e.MapRegionsWorld=Ep,e.MapTypes=zh,e.MarkerBuilders=my,e.NumericTickStrategy=pp,e.OHLCBar=jl,e.OHLCCandleStick=$l,e.OHLCFigure=Xl,e.OHLCFigures=Zl,e.OHLCSeries=Vu,e.OHLCSeriesTraditional=Nu,e.OHLCSeriesTypes=Uu,e.OHLCSeriesWithAutomaticPacking=Gu,e.OnScreenMenu=ic,e.OnScreenMenuAnimationsButton=Sr,e.OnScreenMenuButton=cr,e.OnScreenMenuControlBase=Ks,e.OnScreenMenuCustomButton=br,e.OnScreenMenuOsmToggleButton=Mr,e.OnScreenMenuToggleButton=dr,e.OnScreenMenuZoomInButton=fr,e.OnScreenMenuZoomInXButton=gr,e.OnScreenMenuZoomInYButton=mr,e.OnScreenMenuZoomOutButton=pr,e.OnScreenMenuZoomOutXButton=yr,e.OnScreenMenuZoomOutYButton=xr,e.OnScreenMenuZoomToFitButton=vr,e.PalettedFill=G,e.Panel=uo,e.PhongShadingStyle=Zo,e.Picture=cn,e.PieChart=Eo,e.PieChartTypes=No,e.PieChartWithLabelsInsideSlices=Vo,e.PieChartWithLabelsOnSides=zo,e.PieSlice=Mo,e.PixelatedPoints3D=Ki,e.PointCloudSeries3D=oh,e.PointLineSeries=eu,e.PointLineSeries3D=sh,e.PointMarkers=yy,e.PointSeries=ec,e.PointSeries3D=nh,e.PointSeriesTypes3D=hh,e.PointStyle3D=Ji,e.PolarAreaSeries=Va,e.PolarAreaSeriesInterior=Na,e.PolarAxis=Zh,e.PolarAxisAmplitude=Jh,e.PolarAxisTick=Kh,e.PolarChart=Ua,e.PolarLineSeries=fa,e.PolarPointLineSeries=ga,e.PolarPointSeries=ma,e.PolarPolygon=pa,e.PolarPolygonSeries=za,e.PolarSector=sa,e.PolarSeries=na,e.PolygonFigure=vu,e.PolygonSeries=bu,e.PyramidChart=gl,e.PyramidChartTypes=Sl,e.PyramidChartWithLabelsInsideSlices=xl,e.PyramidChartWithLabelsOnSides=yl,e.PyramidSlice=ul,e.RadialGauge=rl,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=Yu,e.RectangleFigure=xu,e.RectangleSeries=Su,e.SegmentFigure=Mu,e.SegmentSeries=Au,e.Series2D=ra,e.Series3D=Qo,e.SeriesMarkerXY=Ia,e.SeriesXY=Ca,e.SimpleFigureSeries=Wl,e.SimpleShadingStyle=$o,e.Slice=vo,e.SliceLabelFormatters=So,e.SliceSorters=xo,e.SolidFill=z,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new z({color:s(t)})},e.SolidGauge=ll,e.SolidGaugeSlice=ol,e.SolidLine=tt,e.SpiderAxis=wl,e.SpiderChart=Rl,e.SpiderSeries=Tl,e.SplineSeries=ru,e.StaticCursor2DBuilder=Ch,e.StaticCursorXYBuilder=Ma,e.StepSeries=pu,e.SurfaceGridSeries3D=fh,e.SurfaceScrollingGridSeries3D=gh,e.TableContentBuilder=Ah,e.Themes=Kp,e.Tick=io,e.TickStyle=$m,e.TimeFormattingFunctions=Sp,e.TimeTickStrategy=bp,e.TriangulatedPoints3D=ji,e.UIBackgrounds=fy,e.UIButtonPictures=gy,e.UICircle=yn,e.UIColumnGrid=class extends Mn{constructor(){super(...arguments),this.Oc=[]}addColumn(){return this.addElement(En,void 0)}getColumn(t,e=!1){return e&&this.Oc.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Oc[t]}},e.UIDiamond=xn,e.UIElementBuilders=to,e.UIElementColumn=An,e.UIElementLine=bn,e.UIElementRow=Mn,e.UIElementWithBackground=Yr,e.UIEmptyBackground=ln,e.UILabel=gn,e.UILayoutBuilders=ph,e.UILayoutGap=vn,e.UILegendBoxPanel=yh,e.UIObject=Nr,e.UIOrigins=wr,e.UIPanel=fo,e.UIPointer=Sn,e.UIPolygon=fn,e.UIRectangle=pn,e.UIRowGrid=Dn,e.VisibleFill=O,e.VisibleTicks=jm,e.ZoomBandChart=Ec,e.defaultOsmBackgroundColor=Pr,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=F,e.emptyLine=J,e.emptyPoints3D=Xi,e.emptyTick=Zm,e.formatLongitudeLatitude=jh,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 km;return n.e=i||"",dy||(dy=(t=>{let e,i,s=!1,r=!1,n=!1,o=!1,h="";try{if(Dm){const e=(t=>{if(!Dm)return;const e=Dm.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";default:return}})();if("0001"===e){Bm=new Uint8Array([2]);const e=(t=>{if(!Dm)return;const e=Dm.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();1===e?(n=!zm(Dm),s=!0):2===e?(Vm(Dm,t),r=!0):(Im=!0,Fm(Dm),o=!0)}else{if("0002"!==e)throw new Error(wm(0,0,1,7,1,12,5));{const e=(t=>{if(!Dm)return;const e=Dm.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)Im=!0,Fm(Dm),o=!0;else if(189===e)n=!zm(Dm),s=!0;else{if(159!==e)throw new Error(wm(0,0,1,7,1,12,5));Vm(Dm,t),r=!0}}}}else Em=!0}catch(t){t instanceof Error&&(e=t)}try{o&&(i=Am[wm(-1,34)][wm(-1,35)](wm(-1,39))||void 0)}catch(t){Am.console.error(t)}let a=!1;if(i){const t=i.split("-");if(2===t.length&&Om(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||Em||s||r||a),u=(()=>{const t=new(Am[wm(-1,0)]);return t.open(wm(0,26),wm(-2,0)),t.setRequestHeader(wm(-1,24),wm(-1,25)),t.withCredentials=!0,t})();if(l){let t;try{t=parseInt(Dm?Dm.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="";Dm=Dm||"";const a=wm(-4,0);for(let t=0;t{if(e)throw Nm(e.message,t),e;const s={bh:t=>{const e=`${wm(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${(t=>{switch(t){case 1:return wm(0,48,49);case 0:return wm(0,48,50);case 2:return wm(0,51);case 3:return wm(0,52,48);case 4:return wm(0,53,48);case 5:return wm(0,54,48);case 6:return wm(0,55,48);case 7:return wm(0,56,48);case 8:return wm(0,57,48);case 9:return wm(0,58,48)}return pe(0,"")})(t)}`;throw Nm(e,r,!1),new Error(e)},...Tm},r=new Hg(t,s),o=t=>{if("error"===(null==t?void 0:t.type)&&i){const t=i.split("-");if(2===t.length&&Om(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return Im=!1,void Gm(u,!1,a)}}if(u.readyState===Am[wm(-1,0)].DONE){if(200!==u.status){let e="";try{e=t&&"loadend"!==t.type?wm(0,0,1,23,1,32,1,24,5):JSON.parse(u[wm(-1,23)]).message,Gm(u,!1,a)}catch(t){console.error(t)}throw Nm(e,r),new Error(wm(0,0,1,2,1,7,1,12,5)+e)}{const t=JSON.parse(u[wm(-1,23)]);if(!Om(h+wm(-3,0),t.h)){const t=wm(0,0,1,27,1,28,1,29,1,30,1,31,5);throw Nm(t,r),new Error(t)}Am[wm(-1,34)][wm(-1,36)](wm(-1,39),t.t),Am[wm(-1,34)][wm(-1,36)](wm(-1,33),t.s),Im=!1}}},a=t=>{o(t)};return Gm(u,!0,a),l?setTimeout((()=>{if(Im){let t=!0;if(i){const e=i.split("-");if(2===e.length&&Om(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&Nm(wm(0,25,1,23,1,32,1,24,5),r)}}),1e4):Gm(u,!1,a),n?(t=>{let e;Im=!1;const i=t.Et(),s=()=>{e&&(t.Qe(e.Je()),e=void 0),e=t.vT("deployment test"),e.ue(t.ct).fs(wm(0,34,1,33)).Sn({x:i.x/2,y:i.y/2}).un(50).xs(13).ps(new z({color:A(128,128,128,100)})).an("Arial").dn(500).setMouseInteractions(!1),t.Ze().Ke()};t.cr((()=>{s()})),setTimeout(s,0),setInterval((()=>{e&&e.Je()({Dashboard:Qp(t,e,i),ChartXY:iy(t,e,i),Spider:sy(t,e,i),Polar:ry(t,e,i),Pie:ny(t,e,i),UIPanel:ey(t,e,i),Gauge:oy(t,e,i),Funnel:hy(t,e,i),Pyramid:ay(t,e,i),Chart3D:uy(t,e,i),Map:ly(t,e,i),DataGrid:cy(t,e,i)}))(dy,n.e,r)},e.onScreenMenuControlBaseHeight=Er,e.onScreenMenuControlBaseWidth=Br,e.onScreenMenuControlOpacity=kr,e.onScreenMenuDefaultButtonShape=Cr,e.onScreenMenuSpriteURL=Ir,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=ho,e.synchronizeAxisIntervals=ot,e.translatePoint=nt,e.translatePoint3D=(t,e,i)=>{if("axes"===e.id&&"world"===i.id)return e.chart.Jp.OV(t);if("world"===e.id&&"axes"===i.id)return e.chart.Jp.RV(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=Dr,e.transparentLine=Tr,e.vec3Utils=be,e.xDimensionStrategy=Fl,e.yDimensionStrategy=_l}}]); \ No newline at end of file diff --git a/js/vendor.d5b823ef9298b75f3c38.bundle.js b/js/vendor.d5b823ef9298b75f3c38.bundle.js new file mode 100644 index 0000000..73430b0 --- /dev/null +++ b/js/vendor.d5b823ef9298b75f3c38.bundle.js @@ -0,0 +1,2 @@ +/*! For license information please see vendor.d5b823ef9298b75f3c38.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,e)=>{if(e.has(t))return e.get(t);const i=Ve(t.Pi.Fi());return e.set(t,i),i},Ni=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 Wi{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,Vi(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=Ni(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=Ni(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=Ui(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=Vi(l,r);h.find((t=>Ie(c,Vi(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 Hi{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 Ui=(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=Xi(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)),ji=s.Record({size:14,family:"Arial",weight:"normal",style:"normal",variant:!1});class Yi extends ji{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 $i=new Yi,Zi=new class{},qi=s.Record({shape:"sphere",size:10,fillStyle:new L,wireframeStyle:J});class Ki 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")}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 Ji=s.Record({size:5,fillStyle:new L});class Qi extends Ji{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 ts={Triangulated:Ki,Pixelated:Qi};class es{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 is=new Map,ss=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=is.get(o);return h||(h=((t,e)=>({font:t,properties:e}))(o,{size:e,family:i,style:r,variant:n,weight:s}),is.set(o,h)),h};var rs,ns;!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"}(rs||(rs={})),function(t){t[t.touchStart=0]="touchStart",t[t.touchMove=1]="touchMove",t[t.touchEnd=2]="touchEnd"}(ns||(ns={}));const os=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)}),hs=[];let as;const ls=()=>{if(void 0!==as){const t=mt.getComputedStyle(mt.document.body),e=Number(t.getPropertyValue("margin-top").replace("px",""))+Number(t.getPropertyValue("margin-bottom").replace("px",""));as.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===as){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),as=t,mt.addEventListener("resize",ls)}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",as.appendChild(this.Be),ls(),hs.push(this.Ne),this.Ze.push((()=>{as&&as.removeChild(this.Be),hs.includes(this.Ne)&&hs.splice(hs.indexOf(this.Ne),1),0===hs.length&&as&&(mt.document.body.removeChild(as),as=void 0,mt.removeEventListener("resize",ls))}))}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(rs.wheel),this.Be.oncontextmenu=this.Xh(rs.contextmenu),this.Be.onclick=this.Xh(rs.click),this.Be.ondblclick=this.Xh(rs.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(rs.mouseDown),this.jh(ns.touchStart)),this.Be.onpointermove=h(this.dh,this.jh(ns.touchMove)),this.Be.onpointerup=h(this.Xh(rs.mouseUp),this.jh(ns.touchEnd)),this.Be.onpointercancel=h(),this.Be.onpointerout=h(),this.Be.onpointerleave=h(this.wh,this.jh(ns.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 es(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===rs.contextmenu&&Zt(e);const i=this.Re(e.clientX,e.clientY),s=this.gh(e,{x:e.clientX,y:e.clientY});if(t===rs.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===rs.click?s.entity.lr:t===rs.dbclick?s.entity.cr:t===rs.mouseDown?s.entity.ur:t===rs.wheel?s.entity.dr:t===rs.contextmenu?s.entity.gr:void 0;if(i&&i(s.entity,e,s.collectionMember),t===rs.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===ns.touchMove?this.yr.entity.br:t===ns.touchEnd?this.yr.entity.vr:t===ns.touchStart?this.yr.entity.Mr:void 0;s&&s(this.yr.entity,e,this.yr.collectionMember),t===ns.touchEnd&&0===i&&(this.yr.entity.Sh=!1,this.yr=void 0)}else if(t===ns.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 fs=(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?xs.Nearest:"nearest-x"===t?xs.NearestX:"nearest-y"===t?xs.NearestY:void 0;return void 0!==e?e:xs.NearestX},vs=(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===xs.Nearest)return bs(t,e,n,o,c,d);if(i===xs.NearestX||i===xs.NearestY){if("boolean"==typeof l&&("x"===a&&i===xs.NearestX||"y"===a&&i===xs.NearestY))return ks(t,nt(e,o,n),a,l,c,d);if(i===xs.NearestX)return Ms(t,nt(e,o,n),h,c,d);if(i===xs.NearestY)return As(t,nt(e,o,n),h,c,d)}},bs=(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=Ds,Ds+=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:Ts}zr(t){return this.Fr=t,this}Vr(){return this.Fr}Nr(t){return this.Br=t,this}Gr(){return this.Br}}const Ts=p(u(0,0),u(0,0));class Is extends Es{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 Cs extends Is{constructor(t,e,i,s,r){super(t,e,s,r),this.Xr=!0,this.ut=i}}const Ps=(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))},Os=(t,e)=>"function"==typeof e?e(t):e,Fs=(t,e)=>!t||t!==e,Rs=(t,e)=>t===B&&e!==B,Bs=t=>t!==B;class zs extends Cs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.jr=cs.fillStyle,this.Wi=t}As(t){return this.jr=Os(this.jr,t),this}_s(){return this.jr}Zr(){return Fs(this.Kr,this.jr)}qr(){return Rs(this.Kr,this.jr)}Jr(){return Bs(this.jr)}Qr(t){this.Kr=t}}class _s extends zs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.tn=cs.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 Ls extends zs{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 Gs extends zs{constructor(t,e,i,s,r,n=y(cs.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($i),this.gn=u(0,0),this.Pt=y(x(1,1,1,1)),this.pn=y(S(4,4,4,4)),this.font=y(cs.font),this.mn=!1,this.font=n}Jr(){return Bs(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 Yi?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 Vs extends Ls{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=xs.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 Ns extends _s{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 Ws extends _s{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 Hs extends Ws{}class Us extends zs{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 Xs extends _s{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 js;!function(t){t[t.Complex=0]="Complex",t[t.Simple=1]="Simple"}(js||(js={}));class Ys extends Cs{constructor(t,e,i,s,r){super(t,e,i,s,r),this.ca=cs.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 $s extends Ys{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 Zs extends Ys{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 qs extends Ys{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=xs.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 Ks extends zs{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=Os(this.Fa,t),this}Da(){return this.Fa}S(t){return Js.S(this,t,((t,e)=>({x:t,y:e}))),this}Ba(){return Js.Ba(this)}Oa(){return Js.Oa(this)}Tn(){return Js.Tn(this)}ao(){return Js.ao(this)}La(t,e,i){return Js.La(this,t,e,i),this}Ra(t,e,i){return Js.Ra(this,t,e,i),this}Ea(t,e){return Js.Ea(this,t,e),this}za(t,e){return Js.za(this,t,e),this}Va(t,e){return Js.Va(this,t,e),this}no(){return Js.no(this,((t,e)=>({x:t,y:e}))),this}Na(){return Js.Na(this)}Ga(){return Js.Ga(this)}Wa(){return Js.Wa(this)}oo(){return Js.oo(this)}qr(){return Js.qr(this)}Jr(){return Js.Jr(this)}Ha(){return this.Ua}$a(){return this.Ya}}const Js={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)),Js.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))),Js.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=>Rs(t.Kr,t.jr)||Rs(t.qa,t.Fa),Jr:t=>Bs(t.jr)||Bs(t.Fa)};class Qs{constructor(t,e){this.Nh=t,this.Ja=e,this.Qa=e.rows*Ir,this.tl=e.columns*Cr}}var tr,er;e.OnScreenMenuButtonType=void 0,(tr=e.OnScreenMenuButtonType||(e.OnScreenMenuButtonType={}))[tr.ZoomIn=0]="ZoomIn",tr[tr.ZoomInX=1]="ZoomInX",tr[tr.ZoomInY=2]="ZoomInY",tr[tr.ZoomOut=3]="ZoomOut",tr[tr.ZoomOutX=4]="ZoomOutX",tr[tr.ZoomOutY=5]="ZoomOutY",tr[tr.ZoomToFit=6]="ZoomToFit",tr[tr.ToggleAnimations=7]="ToggleAnimations",e.OnScreenMenuButtonShape=void 0,(er=e.OnScreenMenuButtonShape||(e.OnScreenMenuButtonShape={}))[er.Circle=0]="Circle",er[er.Rectangle=1]="Rectangle",er[er.RoundedRectangle=2]="RoundedRectangle";const ir={x:-43,y:0},sr={x:-65,y:0},rr={x:-86,y:0},nr={x:-107,y:-1},or={x:-128,y:-3},hr={x:-150,y:0},ar={x:-171,y:0},lr={x:-276,y:0},ur={x:-298,y:0},cr={x:0,y:0},dr={x:-21,y:0};class fr extends Qs{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||Pr,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}/${Or})`,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 gr extends fr{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}/${Or})`,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 pr extends fr{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(),ir)}onClick(){const t=this.rl._l();t&&this.rl.zoom(t,{x:-1,y:-1})}}class mr extends fr{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(){const t=this.rl._l();t&&this.rl.zoom(t,{x:-1,y:0})}}class yr extends fr{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:0,y:-1})}}class xr extends fr{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 Sr extends fr{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 vr extends fr{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 br extends gr{constructor(t,e,i){super(t,i,{rows:1,columns:1},e),this.rl=e;const s=this.rl.getTheme();this.pl=lr,this.ml=ur,this.nl(s.onScreenMenuBackgroundColor.toRGBAString(),this.pl)}onToggledStateAction(){this.rl.setAnimationsEnabled(!1)}onInitialStateAction(){this.rl.setAnimationsEnabled(!0)}}class Mr extends fr{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(){this.rl.forEachAxis((t=>{t.fit(!0)}))}}class Ar extends fr{constructor(t,e,i){super(t,e.shape||Fr,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 kr extends gr{constructor(t,e,i,s){super(t,e,{rows:1,columns:1},i),this.rl=i,this.wl=s,this.pl=dr,this.ml=cr,this.nl(Rr,this.pl)}vl(){this.Ml(this.pl),this.il.style.backgroundColor=Rr,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 wr;e.MouseStyles=void 0,(wr=e.MouseStyles||(e.MouseStyles={})).Move="move",wr.ResizeColumn="col-resize",wr.ResizeRow="row-resize",wr.Horizontal="ew-resize",wr.Vertical="ns-resize",wr.NorthWest="nw-resize",wr.NorthEast="ne-resize",wr.Copy="copy",wr.CrossHair="crosshair",wr.Default="default",wr.Help="help",wr.Restricted="not-allowed",wr.None="none",wr.Point="pointer",wr.Text="text",wr.Wait="wait",wr.ZoomIn="zoom-in",wr.ZoomOut="zoom-out";const Dr={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)},Er=new L({color:A(255,255,255,0)}),Tr=new tt({thickness:1,fillStyle:Er}),Ir=60,Cr=60,Pr="1.0",Or="osm/osm-sprite-transparent.png",Fr=e.OnScreenMenuButtonShape.Circle,Rr="#363636";var Br;e.OSMPosition=void 0,(Br=e.OSMPosition||(e.OSMPosition={}))[Br.TopRight=0]="TopRight",Br[Br.TopLeft=1]="TopLeft",Br[Br.BottomLeft=2]="BottomLeft",Br[Br.BottomRight=3]="BottomRight";const zr=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)}}},Gr=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=zr(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 Wr{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 Cs?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 Hr=(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)}},Ur=(t,e,i,s,r)=>{Hr(t,r,e)},Xr=(t,e,i,s,r)=>{Hr(t,s,r)};class jr extends Wr{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=Nr,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(Ur);const n=_r(new Gr(At,Xr,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 Yr extends jr{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 $r=t=>"setBackground"in t;class Zr extends Wr{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 Yi,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 qr extends Zr{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 Kr;e.HighlightModes=void 0,(Kr=e.HighlightModes||(e.HighlightModes={}))[Kr.noHighlighting=0]="noHighlighting",Kr[Kr.onHover=1]="onHover",Kr[Kr.onHoverIndividual=2]="onHoverIndividual";class Jr{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 Qr extends Jr{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 tn extends Qr{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=_r(new Gr(s,r));this.onTouchStart(n.onTouchStart),this.onTouchMove(n.onTouchMove),this.onTouchEnd(n.onTouchEnd)}}class en extends Qr{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=_r(new Gr(void 0,((e,i,s,r,n)=>t(n,r))));this.onTouchStart(i.onTouchStart),this.onTouchMove(i.onTouchMove),this.onTouchEnd(i.onTouchEnd)}}const sn=(t,e)=>t.setTextFillStyle(e.uiTextFillStyle).setTextFont(e.uiTextFont),rn=(t,e)=>(ae(t.setButtonOffSize(e.uiButtonSize).setButtonOnSize(e.uiButtonSize),e,{fill:e.uiButtonFillStyle}),t),nn=(t,e,i)=>{i&&$r(t)&&t.setBackground((t=>t.setFillStyle(e.uiBackgroundFillStyle).setStrokeStyle(e.uiBackgroundStrokeStyle))).setEffect(!0)},on={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}},hn={background:void 0,setBackground(t){return{...this,background:t}}},an={Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,s,r),r);return nn(o,r,n),o}},ln={Lc(t,e,i,s,r,n){const o=this.applyStylers(new this.uiElement(t,e,i,this.background,s,r),r);return nn(o,r,n),o}};class un extends jr{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 cn extends un{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 dn extends cn{constructor(){super(...arguments),this.setSize=this.yc.bind(this)}}class fn extends jr{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 gn extends fn{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 pn extends gn{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.Hr=t,this.Gn=this.Hr.Iu(this.renderingScale,js.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 mn extends fn{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 yn={...on,...an,uiElement:mn};class xn extends gn{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 Sn extends gn{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 vn extends pn{constructor(t,e,i,s,r){super(t,e,i,js.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 bn extends pn{constructor(t,i,s,r,n){super(t,i,s,js.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 Mn extends un{setSize(t){return this.setContentSize(t),this.Hr.Gi(),this}}class An extends Yr{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 Mn)),0),s=i>0?(this.size.x-this.Uu)/i:0;return this.Hu.reduce(((e,i)=>i instanceof Mn?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 Mn)),0),s=i>0?(this.size.y-this.Uu)/i:0;return this.Hu.reduce(((e,i)=>i instanceof Mn?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},Fn=On("Text",[]),Rn={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()}},Bn={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()}},zn={...on,...hn,background:xn,Lc(t,e,i,s,r,n){const o=new kn(t,e,i,this.background,s,r),h=o.addElement(yn,void 0),a=Object.assign(o,Pn,{setTextLabel:h},Fn,{stylableTexts:[h]});return nn(a,r,n),this.applyStylers(a,r)}}.addStyler(sn),_n={...on,...hn,background:bn,Lc(t,i,s,r,n,o){const h=new kn(t,i,s,this.background,r,n),a=h.addElement(yn,void 0),l=h.getBackground(),u=Object.assign(h,Pn,{setTextLabel:a},Fn,{stylableTexts:[a]},Bn,{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))),nn(u,n,o),this.applyStylers(u,n)}};class Ln extends jr{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 Gn={...on,uiElement:Ln,pictureOff:Sn,pictureOn:Sn,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 nn(o,r,n),o}},Vn={...on,...hn,background:xn,buttonBuilder:Gn,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 kn(t,i,s,this.background,r,n),a=h.addElement(In);a.addGap();const l=a.addElement(this.buttonBuilder);a.addGap();const u=h.addElement(In);u.addGap();const c=u.addElement(yn);u.addGap(),h.addGap();const d=Object.assign(h,Pn,{setTextLabel:c},Fn,{stylableTexts:[c]},Rn,{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}),nn(d,n,o),this.applyStylers(d,n)}}.addStyler(sn).addStyler(rn);class Nn extends jr{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=Un(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=Un(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 Wn={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()}},Hn={...on,...hn,background:xn,alignment:"horizontal",setAlignment(t){return{...this,alignment:t}},Lc(t,e,i,s,r,n){const o=new wn(t,e,i,this.background,s,r),h=o.addElement({Lc:()=>new Nn(t,e,i,At,r,this.alignment)}),a=Object.assign(o,Fn,{stylableTexts:[h]},Wn,{lutElement:h});return nn(a,r,n),this.applyStylers(a,r)}}.addStyler(sn),Un=(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 Nn(t,i,s,At,n,this.alignment)});"vertical"===this.alignment&&d.setMargin({left:n.uiButtonSize+6});const f=Object.assign(o,Pn,{setTextLabel:c},Fn,{stylableTexts:[c,d]},On("LUTText",[d]),Rn,{button:l},Wn,{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(sn).addStyler(rn),jn={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 yo?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?Xn.setAlignment(this.alignment):Vn);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 yo)).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}},Yn={alignment:"vertical",layoutBuilder:In,setAlignment(t){return{...this,alignment:t,layoutBuilder:"horizontal"===t?Cn:In}},getAlignment(){return this.alignment},titleBuilder:zn,styleTitle(t){return{...this,titleBuilder:this.titleBuilder.addStyler(t)}},entryStylers:[],styleEntries(t){return{...this,entryStylers:[...this.entryStylers,t]}}},$n={...on,...hn,...Yn,background:xn,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,jn,{alignment:this.alignment,entryStylers:this.entryStylers,legendBoxDisposed:()=>o.xe});h.entries=[];const a=h.addElement("horizontal"===this.alignment?In:Cn),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}),nn(h,r,n),this.applyStylers(h,r)}}.addStyler(((t,e)=>t.setPadding(5)));class Zn extends jr{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 qn={...on,Lc(t,e,i,s,r,n){const o=new Zn(t,e,i,s,r);return nn(o,r,n),this.applyStylers(o,r)}}.addStyler(sn),Kn=qn.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)))),Jn=qn.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)))),Qn=Vn.addStyler((t=>t.onSwitch(((e,i)=>!0===i?setTimeout((()=>t.setOn(!1)),300):void 0)))),to=$n.setAlignment("horizontal"),eo=$n.setAlignment("vertical"),io={TextBox:zn,CheckBox:Vn,ButtonBox:Qn,PointableTextBox:_n,AxisTickMajor:Kn,AxisTickMinor:Jn,LUTRange:Hn},so={HorizontalLegendBox:to,VerticalLegendBox:eo};class ro extends Hi{constructor(t,e,i,s,r,n,o){super(t,e,i,s,o),this._d=r,this.Ad=n}}const no=(t,e,i)=>wt(t+.1*(e-t)+.5*i.getPixelSize()*Math.sign(e-t),t,e),oo=(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 ho extends Wi{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=_r(new Gr(this.kf,this.Cf,this.Tf,1),new Vr(this.If,this.Ff,this.Pf),new Lr(this.hf)),M=_r(new Gr(this.Yf,this.Xf,this.Zf)),A=_r(new Gr(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 tn(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 en(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 ro(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?no(t,e,this.ut):oo(t,e,this.ut)}Ag(t,e){return e instanceof wi?no:oo}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||io.AxisTickMajor;const i=new qr(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 ao=(t,e)=>t instanceof mi||e instanceof mi?(new Ii).yi(t,e):(new Ti).yi(t,e),lo=(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)}},uo=(t,i,s,r,n,o)=>{const h=t.Lc(i,s,r,n,o,!0);return h.setDraggingMode(e.UIDraggingModes.draggable),h},co=t=>{if(t instanceof Ei)return t;const e=t.x instanceof ho?t.x.ut:t.x.x,i=t.y instanceof ho?t.y.ut:t.y.y;return ao(e,i)};class fo{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=zn,e=this.uiScale){e=co(e);const i=this.Hg();return this.Kg(uo(t,i,this.uiScale,e,this.zg(i),this.fs))}addLegendBox(t=$n,i=this.uiScale){i=co(i);const s=this.qg(uo(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(Dr.RightCenter).setPosition({x:100,y:50}):s.setOrigin(Dr.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(),go(this.uiScale),go(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 lo(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 po extends fo{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 mo=x(10,10,10,10);class yo extends fo{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,i,s,r,n,o,l),this.ip={},this.pn=mo,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 xo={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 So;e.SliceLabelIndices=void 0,(So=e.SliceLabelIndices||(e.SliceLabelIndices={}))[So.LabelsInsideSlices=0]="LabelsInsideSlices",So[So.LabelsOnSides=1]="LabelsOnSides";const vo={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},bo={Name:t=>`${t.getName()}`,NamePlusValue:t=>`${t.getName()}: ${Math.round(t.getAnimatedValue())}`,NamePlusRelativeValue:(t,e)=>`${t.getName()}: ${(100*e).toFixed(2)}%`};class Mo extends Jr{constructor(){super(...arguments),this.Su="Slice",this.u=0}}const Ao=(t,e)=>{Zt(e),t.setExploded(!t.getExploded())};class ko extends Mo{}class wo extends ko{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(Ao),this.onTouchEnd(Ao)}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)),Eo=(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(To);const h=_r(new Lr(To));this.onBackgroundTouchStart(h.onTouchStart),this.onBackgroundTouchMove(h.onTouchMove),this.onBackgroundTouchEnd(h.onTouchEnd),o&&this.setAnimationsEnabled(!1)}addSlice(t,e){const i=new wo(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(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.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 Co={UserSeries:{type:"ApplicationType",args:{type:"UserSeries"}},InternalUI:{type:"ApplicationType",args:{type:"InternalUI"}}},Po=(...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 Oo;!function(t){t[t.TopRight=0]="TopRight",t[t.TopLeft=1]="TopLeft",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(Oo||(Oo={}));const Fo=(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=Do(h,i,s+n+o),c=oi(a.Tn().y,l,i);return[l,c,u(a.Tn().x-e*(n+a.$t().x),c.y)]},Bo=(...t)=>e=>{const i=(t=>{let e=.5*(t.Mp.qo()+t.Mp.ui());for(e%=360;e<0;)e+=360;return e<=90?Oo.TopRight:e<180?Oo.TopLeft:e<270?Oo.BottomLeft:Oo.BottomRight})(e);return t.includes(i)},zo=Bo(Oo.BottomLeft,Oo.TopLeft),_o=Bo(Oo.BottomRight,Oo.TopRight),Lo=Bo(Oo.TopLeft,Oo.TopRight),Go=Bo(Oo.BottomLeft,Oo.BottomRight);class Vo extends Io{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.Wp=bo.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)}}},Uo={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)}}},Xo={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)}}},jo=t=>{if(t instanceof tt){const e=t.getThickness(),i=t.getFillStyle();if(i instanceof L)return 1===e?Zi:new Ki({size:e,fillStyle:i,shape:"sphere"})}return Zi};class Yo{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 $o{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 Zo{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 qo extends Wi{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([Co.InternalUI]).ua(l).Pm(jo(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 Zo((()=>this.Cm.ye(this.Tm))),this.Bm=new $o((()=>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 Yo((()=>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(jo(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 Ko(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 Jo(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===Xo?(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===Ho}isY(){return this.ds===Uo}isZ(){return this.ds===Xo}}class Ko extends Hi{constructor(t,e,i,s,r,n){super(t,e,i,s,n),this._d=r}}const Jo=(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 Qo{constructor(){this.type="simple"}}const th=new Qo;class eh{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 ih=new eh,sh={Simple:Qo,Phong:eh};class rh extends Jr{constructor(t,e,i,s,r){super(t,e,s,r),this.Nm=ih,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 nh extends rh{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 hh extends oh{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=cs.pointStyle3D,this.hS(this.ca),this.Gn=this.km.Kp([Co.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 ts.Triangulated({shape:"sphere",fillStyle:t.getFillStyle(),size:t.getThickness()});this.eS=e}}class ah extends oh{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([Co.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 lh extends rh{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 uh extends lh{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 ch extends lh{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 dh={Triangulated:uh,Pixelated:ch};class fh extends yo{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 gh=Ae.normalize({x:-.5610788649579117,y:-.35242840511865414,z:-1.1349149375849081});class ph{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:gh,location:Ae.multiply(gh,-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 mh(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):yh(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):yh(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=th;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=th;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 vh extends fh{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 qo(this,Ho,this.Ay.x,this.fs,this.km,this.by,this.pixelScale,!1,this.cc),y:new qo(this,Uo,this.Ay.y,this.fs,this.km,this.by,this.pixelScale,!1,this.cc),z:new qo(this,Xo,this.Ay.z,this.fs,this.km,this.by,this.pixelScale,!1,this.cc)},this.Ty=this.km.Kp([Co.InternalUI]).setMouseInteractions(!1),this.setBoundingBoxStrokeStyle(this.fs.chart3DBoundingBoxStrokeStyle),this.mS=this.xy.Iu(this.engine.scale,js.Simple).As(this.fs.chart3DSeriesBackgroundFillStyle).ir(J).setMouseInteractions(!0),this.SS=this.xy.Iu(this.engine.scale,js.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 ph(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=_r(new Vr(((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 Gr((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||uh)(this,this.uS,this.km,this.fs,this.Wi.cc,t);return this.yS(e),e}addLineSeries(t){const e=new hh(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 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}addSurfaceGridSeries(t){const e=new xh(this,this.uS,this.km,t,this.fs,this.Wi.cc);return this.yS(e),e}addSurfaceScrollingGridSeries(t){const e=new Sh(this,this.uS,this.km,t,this.fs,this.Wi.cc);return this.yS(e),e}addBoxSeries(t){const e=new nh(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(jo(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(xo.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 bh={Column:In,Row:Cn};class Mh extends po{constructor(t,e,i,s,r,n){super(t,e,i,s,r,n),this.Ly=new Map,this.Ry=this.addUIElement(bh.Row).setPosition({x:0,y:100}).setOrigin(Dr.LeftTop).setBackground((t=>t.setFillStyle(B).setStrokeStyle(J)))}add(t,e){return(t instanceof yo?[t]:t instanceof md?t.getCells().filter((t=>t.panel instanceof yo)).map((t=>t.panel)):[]).forEach((t=>{const i=this.Ry.addElement(so.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 Ah{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 kh{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 wh extends kh{constructor(){super(...arguments),this.gn=this.jy(new Ah((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 Dh extends kh{constructor(t,e,i,s){super(t,e),this.Zy=this.jy(new Ah((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 wh(t,e),FontSize:(t=5,e=5)=>(i,s)=>new Dh(i,s,t,e)};class Th{constructor(){this.Jy=[]}addRow(...t){return this.Jy.push(t),this}}class Ih extends Th{Lc(){const t=this.Jy;return this.Jy=[],t}Qy(){return this.Jy.length=0,this}}class Ch extends En{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(yn,void 0);else{const e=h[n];e instanceof Mn?(r.getMembers()[n].dispose(),t=r.addElement(yn,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 mn&&(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=Eh.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 Oh extends Ph{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 Fh extends Ph{setPosition(t){return this.an=t,this.lx.setPosition(t),this.Wy.setPosition(t),this.Hr.Gi(),this}}class Rh{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 Bh extends Rh{constructor(){super(...arguments),this.xx=(t,e,i,s)=>this.yx(new Oh(t,e,i,this.nx,this.ox,s),s),this.addStyler=t=>new Bh(this.nx,this.ox,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Bh(t,this.ox,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Bh(this.nx,t,this.Sx.map((t=>t)))}}class zh extends Rh{constructor(){super(...arguments),this.bx=(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)))}}const _h=t=>t.setPointMarker((t=>t.setSize(u(5,5)).setOrigin(u(0,0)))).setResultTable((t=>t.setEffect(!0).setOrigin(u(-1,-1)).setMargin(5))),Lh=(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 Bh(xn,xn,[_h]);const Gh=new Bh(xn,bn,[_h,t=>t.setPointMarkerVisible(!1).setResultTable((t=>t.setOrigin(u(0,-1)).setMargin(0).setBackground((t=>{t instanceof bn&&t.setDirection(e.UIDirections.Down).setPointerLength(10).setPointerAngle(60)}))))]),Vh=Gh;new zh(vn,xn,[Lh,t=>t.setResultTableVisible(!1)]);const Nh=new zh(dn,xn,[Lh,t=>t.setResultTable((t=>t.setOrigin(Dr.LeftBottom)))]),Wh=(t,e,i,s,r)=>({location:t,scale:e,resultTableContent:i,series:s,fillStyle:r}),Hh={World:"World",USA:"USA",NorthAmerica:"NorthAmerica",SouthAmerica:"SouthAmerica",Canada:"Canada",Europe:"Europe",Asia:"Asia",Africa:"Africa",Australia:"Australia"},Uh=(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(),Xh=(t,e)=>{let i=e.geometry;return i=jh(t,e,i),i=Yh(t,e,i),i},jh=(t,e,i)=>{if(t===Hh.Asia){const t=[];for(let e=0;e{const s=e.name.toLowerCase();let r;if(t===Hh.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 Jh extends yo{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=Qh,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+xo.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,Nh);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,Hh.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===Hh.World)i="countries_world.json";else if(t===Hh.NorthAmerica)i="countries_northAmerica.json";else if(t===Hh.SouthAmerica)i="countries_southAmerica.json";else if(t===Hh.Africa)i="countries_africa.json";else if(t===Hh.Europe)i="countries_europe.json";else if(t===Hh.Asia)i="countries_asia.json";else if(t===Hh.USA)i="states_usa.json";else if(t===Hh.Canada)i="territoriesProvinces_canada.json";else{if(t!==Hh.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=$h[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===Hh.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=Zh[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(),xo.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 Ih,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(),go(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 Qh=(t,e,i,s,r,n)=>(t.addRow(`${e.name}`).addRow(ta(s,r)),void 0!==i&&t.addRow(`Region value: ${i.toFixed(1)}`),t),ta=(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 ea extends Wi{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 ia(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 ia extends ro{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 sa extends ea{constructor(t,e,i,s,r,n,o,h,a){super(t,ra,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 no(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 ra={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 na extends ea{constructor(t,e,i,s,r,n,o,h){super(t,ha,e,i,s,r,n,o,h),this.Cb=90,this.Tb=12,this.Ib=oa,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:oa,Rs:void 0,Es:void 0})}}const oa=(t,e,i)=>(180*t/Math.PI).toFixed(0),ha={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 aa extends Jr{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 la extends Jr{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 ua extends la{constructor(t,e,i,s,r,n){super(e,i,r,n),this.Rx=ca,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 ca=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Angle:","",Math.round(i).toString()).addRow("Amplitude","",r(s)),da=(t,e,i)=>t*(1-i)+e*i,fa=(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=da(i.value,r.value,n),c=da(e.value,s.value,h);return da(c,u,l)},ga=(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},pa=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},ma=t=>t.slice().map((t=>t.angle>=0&&t.angle<=360?t:{...t,angle:t.angle%360})),ya=(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:da(r.start,r.end,s/n)}};class xa extends ua{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,[Co.UserSeries]).ua(this.ca).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.$b)}setData(t){return this.Wb=ma(t),this.Hb=!0,this.Gb=pa(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}=ya(i,this.scale);return Wh(i,this.scale,this.Rx(new Ih,this,s,r,this.rl.getAmplitudeAxis().formatValue).Lc(),this,this.ca.getFillStyle())}gc(){if(this.Hb||this.scale.jb()){const t=ga(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 Sa extends ua{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,[Co.UserSeries]).ua(this.ca).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.$b),this.qb=t.aS(r).As(this.jr).so(this.Kb).q(this.Zb).zr(this.getHighlight()).Jn(xs.Nearest),this.gu(this.qb)}setData(t){return this.Wb=ma(t),this.Hb=!0,this.Gb=pa(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 Vs?e.Ix(t):e.Xb(t);if(!i)return;const{angle:s,amplitude:r}=ya(i,this.scale);return Wh(i,this.scale,this.Rx(new Ih,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=ga(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 va extends ua{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(xs.Nearest),this.gu(this.qb)}setData(t){return this.Wb=ma(t),this.Hb=!0,this.Gb=pa(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}=ya(i,this.scale);return Wh(i,this.scale,this.Rx(new Ih,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=ga(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 ba{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 Ma=(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 Aa extends Fh{constructor(t,e,i,s,r,n,o,h,a){super(t,e,ao(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=Ma(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=Ma(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 ka extends Oh{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=Ma(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 wa extends Rh{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 Da extends wa{constructor(){super(...arguments),this.xx=(t,e,i,s)=>this.yx(new ka(t,e,i,this.nx,this.ox,this.lv,this.cv,s),s),this.addStyler=t=>new Da(this.nx,this.ox,this.lv,this.cv,this.Sx.map((t=>t)).concat(t)),this.setPointMarker=t=>new Da(t,this.ox,this.lv,this.cv,this.Sx.map((t=>t))),this.setResultTableBackground=t=>new Da(this.nx,t,this.lv,this.cv,this.Sx.map((t=>t)))}}class Ea extends wa{constructor(){super(...arguments),this.bx=(t,e,i,s,r)=>this.yx(new Aa(t,e,i,s,this.nx,this.ox,this.lv,this.cv,r),r),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)))}}const Ta=new Da(xn,xn,io.PointableTextBox,io.PointableTextBox,[(t,e)=>{_h(t),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ia=new Ea(vn,xn,io.PointableTextBox,io.PointableTextBox,[(t,e)=>{Lh(t,e),t.setTickMarkerX((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerXTextFont).setTextFillStyle(e.cursorTickMarkerXTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerXBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerXBackgroundStrokeStyle)))})),t.setTickMarkerY((t=>{t.setEffect(!0).setTextFont(e.cursorTickMarkerYTextFont).setTextFillStyle(e.cursorTickMarkerYTextFillStyle),$r(t)&&t.setBackground((t=>t.setFillStyle(e.cursorTickMarkerYBackgroundFillStyle).setStrokeStyle(e.cursorTickMarkerYBackgroundStrokeStyle)))}))}]),Ca=(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}},Pa=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class Oa{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?Pa(r.x,this.scale.x):this.an.x,s!==e.UIDraggingModes.onlyHorizontal?Pa(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 Ca(this.bv,this.Mv,this._v)?this.Kx.setPointMarkerVisible(!0):this.Kx.setPointMarkerVisible(!1),t&&Ca(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 Fa extends Oa{constructor(t,i,s,r,n,o,h){super(t,i,ao(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&&Ca(this.Dv,this.Mv,this._v)?this.Kx.setTickMarkerXVisible(!0):this.Kx.setTickMarkerXVisible(!1),this.Ui&&t&&Ca(this.Bv,this.Mv,this._v)?this.Kx.setTickMarkerYVisible(!0):this.Kx.setTickMarkerYVisible(!1),this.Kx.setGridStrokeXStyle(this.Ui&&t&&Ca(this.Fv,this.Mv,this._v)?this.gridStrokeStyleX:J),this.Kx.setGridStrokeYStyle(this.Ui&&t&&Ca(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 Ra extends Fa{}class Ba extends Ra{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 za extends la{constructor(t,e,i,s,r,n,o,h,a,l){super(t,e,a,l),this.Lv=[],this.addMarker=(t=Ia)=>{const e=new Ba(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=ao(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 Na extends za{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=Va,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 La(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 Wa=(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 ba(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(ga(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:ma(e.tv);e.dM=i;const s=!e.Jb&&e.uM?e.uM:pa(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=Wa(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}=ya(s,this.scale);return{location:s,scale:this.scale,resultTableContent:this.Rx(new Ih,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,js.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 Ua extends ua{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 Xa extends Ua{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r,n,o),this.pM=this.Hr.Iu(this.scale,js.Simple).zr(this.getHighlight()),this.gu(this.pM)}gc(){if(this.Hb||this.scale.jb()){const t=this.Wb,e=!0===this.Ub?ga(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 Ya extends Kh{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:ja}),this.onResize(this.kM),this.hp.Ms("Polar 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.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 sa(this,this.ub,this.fs,!(!o||!0!==o.disableAnimations),this.FM,this.DM,this.BM,this.cc,this.TM),this.LM=new na(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 xa(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 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}addPointLineSeries(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}addAreaSeries(t){const e=new Xa(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 Ha(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 aa(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(),xo.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=xo.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($a,$a)}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 $a=300;class Za extends Mo{}class qa extends Za{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,js.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},Qa=(t,i,s,r,n,o=0,h=e.FunnelSliceModes.VariableHeight,a)=>{i=Ja(i,r.x),s=Ja(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 tl extends yo{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=vo.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 qa(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(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.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 el=(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}}},il=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 sl extends tl{constructor(){super(...arguments),this.Wp=bo.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=_r();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 ll extends al{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 ul extends Mo{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 cl extends ul{onValueChange(t){return this.t_(t)}onIntervalChange(t){return this.i_(t)}}class dl extends cl{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 gl extends ll{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 dl(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(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.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]=fl(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 pl extends Mo{}class ml extends pl{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,js.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},xl=(t,i,s,r,n,o=0,h=e.PyramidSliceModes.VariableHeight,a)=>{i=yl(i,r.x),s=yl(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 Sl extends yo{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=vo.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 ml(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(),xo.lp(this.hp,this.ip),super.Jg();const t=xo.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 vl=(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}}},bl=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 Ml extends Sl{constructor(){super(...arguments),this.Wp=bo.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),El=(t,e,i,s,r,n,o,h)=>{if(0===e)return t.paddingX=h,t.alignmentX=-1,t};var Tl;e.SpiderWebMode=void 0,(Tl=e.SpiderWebMode||(e.SpiderWebMode={}))[Tl.Normal=0]="Normal",Tl[Tl.Circle=1]="Circle";class Il{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,[Co.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 Cl=(t,e,i,s,r)=>t.addRow(e.getName()).addRow("Axis:","",s).addRow("Value:","",r(i));class Pl extends la{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=Cl,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,js.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},Fl=t=>Ve(t.F_.Fi()),Rl=t=>Ve(t.Fi()),Bl=(t,i,s,r)=>t.aa(0).Cn(s).ea(90).ha(-270).la(i===e.SpiderWebMode.Circle?void 0:r.length),zl={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},_l={alignmentX:0,alignmentY:0,paddingX:0,paddingY:0},Ll=()=>{_l.alignmentX=0,_l.alignmentY=0,_l.paddingX=0,_l.paddingY=0};class Gl extends Kh{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_=El,this.K_=Dl,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=Ol(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=_r(new Gr(((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,Gh);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 Il(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 Pl(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(),xo.lp(this.hp,this.ip);const t=this.Cy.length,e=xo.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];Bl(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 Vl={getWidth:t=>t.x,getHeight:t=>t.y,toVec2:(t,e)=>({x:t,y:e}),toPoint:(t,e)=>u(t,e)},Nl={getWidth:t=>t.y,getHeight:t=>t.x,toVec2:(t,e)=>({x:e,y:t}),toPoint:(t,e)=>u(e,t)},Wl={defaultDragMouseStyle:e.MouseStyles.Horizontal,getTitleTextRotation:()=>0,ae:t=>t.getXMin(),le:t=>t.getXMax(),ue:t=>t.Jp().x},Hl={defaultDragMouseStyle:e.MouseStyles.Vertical,getTitleTextRotation:t=>90*t,ae:t=>t.getYMin(),le:t=>t.getYMax(),ue:t=>t.Jp().y},Ul={...Vl,...Wl},Xl={...Nl,...Hl};class jl extends Wr{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 $l extends jl{}class Zl extends Yl{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 Ih,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)},nu=(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 La(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(Ss(t)))),this.uw.forEach((e=>e.Jn(Ss(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;_a(t,e,this.tM,this.dw),_a(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(Ss(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,[Co.UserSeries,...this.xw]).xt(t,e).setMouseInteractions(this.Nc).ua(this.ca).Jn(Ss(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?Wa(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):Wa(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 qs?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 Wh(t,this.scale,this.Rx(new Ih,this,t.x,t.y,t).Lc(),this,i||r)}}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}}const hu=(t,e)=>t.Qn().length>=e?t.Qn().slice(-e):Array.prototype.concat(t.io(),t.Qn()).slice(-e),au=(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 lu extends ou{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=hu(s,3),r=Array.prototype.concat(i,t),n=nu(r,32);au(this.Xv[e-1],n,32),this.fw(n.slice(66))}else if(r<5){const s=this.uw[e-2],r=hu(s,3),n=Array.prototype.concat(r,i,t),o=nu(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=hu(s,4),o=Array.prototype.concat(n,t),h=nu(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=hu(s,3),i=Array.prototype.concat(e,t),r=nu(i,32);au(this.Xv[0],r,32),this.fw(r.slice(66))}else if(r+t.length>1){const e=Array.prototype.concat(i,t),s=nu(e,32);n.no().xt(s).Zs()}else n.xt(t)}}else{const e=t.length>0?nu(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;_a(t,i,Math.ceil(this.tM/this.cw),this.Mw)}solveNearestFromScreen(t,e=this.aw){if(e)return super.solveNearestFromScreen(t,e);const i=Wa(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 Wh(t,this.scale,this.Rx(new Ih,this,t.x,t.y,t).Lc(),this,i[1]._s())}}}class uu{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}},du=s.Record({Ao:{type:"disabled",packager:(t,e,i)=>t.slice()}});class fu extends du{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},pu=(t,e)=>{const i=e.Ct();return t?Math.max(i,t):i};class mu extends fu{_w(t,e){return Math.abs(t.x-e.x)}getYMax(t=[],e){return t.reduce(pu,e?e.max.y:void 0)}getYMin(t=[],e){return t.reduce(gu,e?e.min.y:void 0)}}const yu=(t,e)=>{const i=e.At();return t?Math.min(i,t):i},xu=(t,e)=>{const i=e.wt();return t?Math.max(i,t):i};class Su extends fu{_w(t,e){return Math.abs(t.y-e.y)}getXMax(t=[],e){return t.reduce(xu,e?e.max.x:void 0)}getXMin(t=[],e){return t.reduce(yu,e?e.min.x:void 0)}}const vu={horizontalProgressive:new class extends mu{constructor(){super({Ao:fs()}),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",fs(cu(t)))}},horizontalRegressive:new class extends mu{constructor(){super({Ao:gs()}),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",gs(cu(t)))}},verticalProgressive:new class extends Su{constructor(){super({Ao:ps()}),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",ps(cu(t)))}},verticalRegressive:new class extends Su{constructor(){super({Ao:ms()}),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",ms(cu(t)))}},freeform:new uu};class bu extends ou{constructor(t,e,i,s,r,n,o,h,a,l,c,d,f,g){super(t,e,i,s,r,n,o,h,vu.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;_a(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=su([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(su(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 Mu extends Na{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(Ss(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,[Co.UserSeries,...this.xw]).ua(this.ca).va(this.ba).Jn(Ss(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=Wa(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 Wh(t,this.scale,this.Rx(new Ih,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 Au extends $l{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 ku extends Zl{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 Au(this.Hr,this.scale,At,At,this.fs,this.Pw).dispose()}Vv(t){}add(t){const e=new Au(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}class wu extends $l{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,js.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 Du extends Zl{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 wu(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 wu(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}class Eu extends $l{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 Tu extends Zl{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 Eu(this.Hr,this.scale,At,At,this.fs,this.Pw).dispose()}Vv(t){}add(t){const e=new Eu(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}class Iu extends $l{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 Cu extends Zl{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 Iu(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 Iu(this.Hr,this.scale,this.AA,this.FA,this.fs,this.Pw).setDimensions(t);return this.CA(e),e}}function Pu(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 Fu(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 Fu,i=e,s=e,o=new Fu,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 Fu,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 Fu,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 Bu{constructor(t,e){this.key=t,this.value=e}equals(t){return Ou(this.key,t.key)&&Ou(this.value,t.value)}compare(t){return Pu(this.key,t.key)}}class zu{constructor(t,e=Ou,i=Pu){this.length=0,this.contentEquals=e,this.contentCompare=i,this.store=new Ru(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 Bu(t,void 0));return e?e.value.value:void 0}S(t,e){const i=new Bu(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 Bu(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 Bu(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 Bu(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 Bu(t,void 0))}Xw(t){return this.store.Xw(new Bu(t,void 0))}jw(t){return this.store.jw(new Bu(t,void 0))}Zw(t){return this.store.Zw(new Bu(t,void 0))}}const _u={minGapNew:1.75,minGapSplit:2,maxGapFuse:1.5},Lu=(t,e)=>Math.min(t,e[3]),Gu=(t,e)=>Math.max(t,e[2]),Vu=(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]},Nu=(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},Wu=(t,e)=>{if(t.length>0)return e>0?t[t.length-1]:t[0]},Hu=(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 Uu extends Yl{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 zu,this.IA=p(c(ke,ke),c(we,we)),this.ik=0,this.sk=5,this.ek=_u,this.ba=void 0,this.hk=void 0,this.rk=void 0,this.nk=!0,this.Gc=e.HighlightModes.onHover,this.Rx=Hu,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?_u: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=Wu(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 Ih,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 Ih,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 Xu extends Uu{add(t){if(t.length>0){if(Array.isArray(t[0])){const e=t;for(let t=0;t0&&this.getVisible()}}class ju extends Uu{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(Ga(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=Vu(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 Zu extends Zl{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=$u,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 qu extends za{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;_a(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;_a(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;_a(t,i,this.tM,this.Ek),_a(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,[Co.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 Wh(t,this.scale,this.Rx(new Ih,this,t.x,t.y,e.y).Lc(),this,s[1]._s())}}solveNearestFromScreen(t,e=this.aw){return this.Ix(t,!1,e)}}const Ku=(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 Ju extends qu{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=Ku,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(Ga(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 Qu extends Ju{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 La(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 ec 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=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 La(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 ic extends Ju{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:da(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 sc={Positive:tc,Negative:ec,Bipolar:ic},rc=(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 nc 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),this.Su="Area Range Series",this.Rx=rc;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 Wh(t,this.scale,this.Rx(new Ih,this,t.x,t.y,t).Lc(),this,s)}}solveNearestFromScreen(t){return this.Ix(t,!1)}setCursorResultTableFormatter(t){return super.setCursorResultTableFormatter(t)}}class hc{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||Fr,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 kr(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 lc extends za{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=ac,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?Wh(n,this.scale,this.Rx(new Ih,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 uc extends lc{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=ac}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 cc extends za{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=ac,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?Wh(n,this.scale,this.Rx(new Ih,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 dc extends cc{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=ac}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)})))),gc=(t,e)=>{const i=t.indexOf(e);-1!==i&&t.splice(i,1)},pc=u(10,10);var mc;e.AxisPosition=void 0,(mc=e.AxisPosition||(e.AxisPosition={}))[mc.Top=0]="Top",mc[mc.Bottom=1]="Bottom",mc[mc.Left=2]="Left",mc[mc.Right=3]="Right";const yc=new Set([e.AxisPosition.Top,e.AxisPosition.Bottom,e.AxisPosition.Left,e.AxisPosition.Right]),xc=t=>t.de(),Sc=t=>t.setStopped(!0),vc=t=>t.getChartInteractionFitByDrag()?t.fit(!0).setStopped(!1):void 0,bc=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}},Mc=(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 Ac,kc,wc;!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"}(Ac||(Ac={})),function(t){t[t.plotting=0]="plotting",t[t.highlightersAbove=1]="highlightersAbove",t[t.fg=2]="fg"}(kc||(kc={}));class Dc extends Kh{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=Ec,this.zv=0,this.fT=fc(this.UC,this.HC),this.gT=fc(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)?gc(this.UC,t):this.HC.includes(t)?gc(this.HC,t):this.$C.includes(t)?gc(this.$C,t):this.YC.includes(t)&&gc(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();Mc(e,i);const s=t&&t.baseline?t.baseline:0,r=new(t&&t.type?t.type:sc.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();Mc(e,i);const s=new nc(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",Ac.seriesBackground),this.BT=[Ac.gridLine0,Ac.gridLine1,Ac.gridLine2].map((t=>i.ky(`chartXY gridline #${t}`,t))),this.qf=i.ky("chartXY highlighters below",Ac.highlightersBelow),this.Zx=i.Vp("chartXY plotting",kc.plotting),this.Jf=i.Vp("chartXY highlighters above",kc.highlightersAbove),this.vf=i.Vp("chartXY fg",kc.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,Ta);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=_r(new Gr(this.FT,this.PT,this.DT,1),new Vr(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(Tc(this.dT||Ec),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+=pc.x,t.y+=pc.y,t}getSeries(){return this.lS}addChartMarkerXY(t=Ia,e,i){const s=this.Hg(),r=new Ra(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}=bc(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 ho(this.qf,this.BT,this.vf,this.sp,this.qf,this.Jf,this.Wi.cc,s,this.WC.y,Ul,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}=bc(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 ho(this.qf,this.BT,this.vf,this.sp,this.qf,this.Jf,this.Wi.cc,s,this.WC.x,Xl,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())),go(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):yc;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||Ec;let n,o=v(Tc(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}=Ic(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(xc);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(vc)}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(Sc),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(Sc),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,(wc=e.ChartXYTitlePositionOptions||(e.ChartXYTitlePositionOptions={})).CenterTop="center-top",wc.RightTop="right-top",wc.LeftTop="left-top",wc.CenterBottom="center-bottom",wc.RightBottom="right-bottom",wc.LeftBottom="left-bottom",wc.SeriesCenterTop="series-center-top",wc.SeriesRightTop="series-right-top",wc.SeriesLeftTop="series-left-top",wc.SeriesCenterBottom="series-center-bottom",wc.SeriesRightBottom="series-right-bottom",wc.SeriesLeftBottom="series-left-bottom";const Ec=e.ChartXYTitlePositionOptions.CenterTop,Tc=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}`)},Ic=(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}`)},Cc=t=>t instanceof Na||t instanceof Ju||t instanceof nc||t instanceof uc||t instanceof Uu||t instanceof bu;class Pc{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 nc||e instanceof bu||e instanceof uc||e instanceof Na||e instanceof Ju||e instanceof Uu)&&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?Vl:Nl;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 Dc(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]&&Cc(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 nc){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 bu){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 uc){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 Mu&&(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 Uu){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 Oc=(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 Fc{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 Rc={$i:!1,Yi:0,Xi:!1,Zi:0,ji:!1,Ki:0,qi:0,zi:Ci.fitting},Bc=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))},zc=(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&&Xc(t,e,u,n,o,h),"spark-bar"===a&&jc({...t,winLoss:!1},e,u,n,o,h),"spark-win-loss"===a&&jc({...t,winLoss:!0},e,u,n,o,h),"spark-area"===a&&Yc(t,e,u,n,o,h),"spark-pie"===a&&$c(t,e,u,n,o,h)},_c=(t,e,i,s)=>({x:Gc(t.x,e.x,i.x,s),y:Vc(t.y,e.y,i.y,s)}),Lc=(t,e,i,s)=>({position:Gc(t.position,e.x,i.x,s),high:Vc(t.high,e.y,i.y,s),low:Vc(t.low,e.y,i.y,s)}),Gc=(t,e,i,s)=>{const r=wt(t,e,e+i);return s[0].x+s[1].x*(r-e)/i},Vc=(t,e,i,s)=>{const r=wt(t,e,e+i);return s[0].y+s[1].y*(r-e)/i},Nc=(t,e,i,s,r,n,o,h)=>{for(const a of t)"point"===a.type&&Wc(a,e,i,r,n,o,h),"axis-band"===a.type&&Hc(a,i,r,n,o,h),"constant-line"===a.type&&Uc(a,i,s,r,n,o,h)},Wc=(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=_c(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)},Hc=(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=_c({x:h,y:we},e,i,s),f=_c({x:a,y:ke},e,i,s)),"y"===o&&(d=_c({x:we,y:h},e,i,s),f=_c({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)},Uc=(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=_c(u(g,c),{x:g,y:d},s,r),e=_c(u(p,c),{x:g,y:d},s,r);m.push([t,e])}if("x"===h&&g<=c&&c<=p){const t=_c(u(c,d),{x:g,y:d},s,r),e=_c(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])},Xc=(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;t_c(t,{x:u,y:d},g,i)));e.lineSet.add().zr(n).ua(o||s.sparkLineChartStrokeStyle).no().xt(p),a&&Nc(a,p,{x:u,y:d},{x:c,y:f},g,i,e,s)},jc=(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=_c({x:1*e+e*m,y:g?t>=p?0:-1:0},S,v,i),n=_c(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)}))},Yc=(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=_c(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 Zc,qc,Kc;!function(t){t[t.UpToDown=0]="UpToDown",t[t.LeftToRight=1]="LeftToRight"}(Zc||(Zc={})),function(t){t[t.Vertical=0]="Vertical",t[t.Horizontal=1]="Horizontal",t[t.Both=2]="Both"}(qc||(qc={})),function(t){t[t.Up=0]="Up",t[t.Down=1]="Down",t[t.Left=2]="Left",t[t.Right=3]="Right"}(Kc||(Kc={}));class Jc extends Wr{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 xn(t,e,i,At,s).setMouseInteractions(!0),this.iI=t.Iu(e,js.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 Kc.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 Kc.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 Kc.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 Kc.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 Qc=(t,e)=>Math.min(Math.max(t,e.getInnerStart()),e.getInnerEnd());class td{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?Qc(n.x,this.scale.x):this.Iw.x,r!==e.UIDraggingModes.onlyHorizontal?Qc(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 Jc(t,s,n,h,a===Zc.UpToDown?Kc.Up:Kc.Left).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.yI=new Jc(t,s,n,h,a===Zc.UpToDown?Kc.Down:Kc.Right).setStrokeStyle(h.dataGridScrollBarButtonStrokeStyle).setFillStyle(h.dataGridScrollBarButtonFillStyle),this.lI=new xn(t,s,n,At,h).setFillStyle(h.dataGridScrollBarFillStyle).setStrokeStyle(h.dataGridScrollBarStrokeStyle).setMouseInteractions(!0).setDraggingMode(a===Zc.UpToDown?e.UIDraggingModes.onlyVertical:a===Zc.LeftToRight?e.UIDraggingModes.onlyHorizontal:e.UIDraggingModes.notDraggable),this.xI=new xn(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 Zc.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 Zc.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 Zc.UpToDown:return e=Math.max(0,this.nI.y-t),e!==this.nI.y&&(this.pI({x:0,y:e}),this.gc(),!0);case Zc.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 Zc.UpToDown:return this.P.on("scrollY",t);case Zc.LeftToRight:return this.P.on("scrollX",t)}return this.P.on("scrollY",t)}gI(t){switch(this.mI){case Zc.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===Zc.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===Zc.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 Zc.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 Zc.UpToDown:e=this.nI.y*this.oI*this.contentScale.wi().y,this.P.emit("scrollY",qc.Vertical,e),this.vf.Wi.Gi();break;case Zc.LeftToRight:e=this.nI.x*this.oI*this.contentScale.wi().x,this.P.emit("scrollX",qc.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 Zc.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 Zc.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 Zc.UpToDown:this.GI()||this.setVisible(!1),this.GI()&&this.setVisible(!0);break;case Zc.LeftToRight:this.WI()||this.setVisible(!1),this.WI()&&this.setVisible(!0)}}zI(){switch(this.mI){case Zc.UpToDown:this.GI()||this.pI({x:0,y:0});break;case Zc.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 Zc.UpToDown:return this.Iw.height*(this.Iw.height-2*this.SI.$t().x)/this.Lu.x;case Zc.LeftToRight:return this.Iw.width*(this.Iw.width-2*this.SI.$t().y)/this.Lu.y;default:return 0}}NI(){switch(this.mI){case Zc.UpToDown:this.oI=(this.Lu.x-this.Iw.height)/(this.eI.min.y-this.eI.max.y);break;case Zc.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 Zc.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 Zc.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 ed{constructor(t,e,i,s,r,n,o){switch(this.vf=t,this.Eg=e,this.scale=s,this.contentScale=r,o){case qc.Vertical:this.HI=this.UI(i,n,Zc.UpToDown);break;case qc.Horizontal:this.$I=this.UI(i,n,Zc.LeftToRight);break;case qc.Both:this.HI=this.UI(i,n,Zc.UpToDown),this.$I=this.UI(i,n,Zc.LeftToRight)}this.YI=_r(new Gr(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 td(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 id=s.Record({width:void 0,height:void 0,QI:void 0,tF:At,iF:At});class sd extends id{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 rd;e.ImageFitMode=void 0,(rd=e.ImageFitMode||(e.ImageFitMode={}))[rd.Fill=0]="Fill",rd[rd.Fit=1]="Fit",rd[rd.Stretch=2]="Stretch",rd[rd.Center=3]="Center",rd[rd.Tile=4]="Tile";const nd=s.Record({source:void 0,surroundingColor:A(0,0,0,0),sourceMissingColor:A(0,0,0,0),fitMode:e.ImageFitMode.Fill});class od extends nd{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 hd extends yo{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?dd:{...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(ad.cellMouseEnter,i,e)},this.PF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseLeave,i,e)},this.DF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseClick,i,e)},this.BF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseDoubleClick,i,e)},this.OF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseDown,i,e)},this.LF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseUp,i,e)},this.RF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseMove,i,e)},this.EF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseDrag,i,e)},this.zF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseDragStart,i,e)},this.VF=(t,e)=>{const i=this.rF.get(t);i&&this.P.emit(ad.cellMouseDragStop,i,e)},this.NF=(t,e)=>{const i=this.rF.get(t);i&&(this.P.emit(ad.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(ad.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(ad.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(ad.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=Rc,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 Zo((()=>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 Zo((()=>this.sP._u(this.$F).setMouseInteractions(!1))),this.cP=new Zo((()=>this.sP.ye(this.$F).setMouseInteractions(!1))),this.uP=new Zo((()=>this.sP.Kp(this.$F,{},[Co.InternalUI,{type:"DataPattern",args:{pattern:"ProgressiveX"}}]).setMouseInteractions(!1))),this.dP=new Zo((()=>this.sP.Bc(this.$F).setMouseInteractions(!1))),this.fP=new Zo((()=>this.sP.aS(this.$F).setMouseInteractions(!1))),this.gP=new Zo((()=>this.sP._u(this.$F).setMouseInteractions(!1))),this.pP=new Zo((()=>this.sP.jk(this.$F).setMouseInteractions(!1))),this.mP=new Zo((()=>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(),go(this.$F),go(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(ad.cellMouseEnter,t)}offCellMouseEnter(t){return this.P.off(t)}onCellMouseLeave(t){return this.P.on(ad.cellMouseLeave,t)}offCellMouseLeave(t){return this.P.off(t)}onCellMouseClick(t){return this.P.on(ad.cellMouseClick,t)}offCellMouseClick(t){return this.P.off(t)}onCellMouseDoubleClick(t){return this.P.on(ad.cellMouseDoubleClick,t)}offCellMouseDoubleClick(t){return this.P.off(t)}onCellMouseDown(t){return this.P.on(ad.cellMouseDown,t)}offCellMouseDown(t){return this.P.off(t)}onCellMouseUp(t){return this.P.on(ad.cellMouseUp,t)}offCellMouseUp(t){return this.P.off(t)}onCellMouseMove(t){return this.P.on(ad.cellMouseMove,t)}offCellMouseMove(t){return this.P.off(t)}onCellMouseDrag(t){return this.P.on(ad.cellMouseDrag,t)}offCellMouseDrag(t){return this.P.off(t)}onCellMouseDragStart(t){return this.P.on(ad.cellMouseDragStart,t)}offCellMouseDragStart(t){return this.P.off(t)}onCellMouseDragStop(t){return this.P.on(ad.cellMouseDragStop,t)}offCellMouseDragStop(t){return this.P.off(t)}onCellMouseWheel(t){return this.P.on(ad.cellMouseWheel,t)}offCellMouseWheel(t){return this.P.off(t)}onCellTouchStart(t){return this.P.on(ad.cellTouchStart,t)}offCellTouchStart(t){return this.P.off(t)}onCellTouchMove(t){return this.P.on(ad.cellTouchMove,t)}offCellTouchMove(t){return this.P.off(t)}onCellTouchEnd(t){return this.P.on(ad.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?dd: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(),xo.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=xo.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(Bc(r)&&(h=r,l={x:200,y:50}),r instanceof sd){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=cd(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&&ud(y,v,k,s,f),o){const t=S,e=M;zc(o,d,this.$F,t,e,this.fs,this.uf,r.highlight)}if(c){const t=c.$t(),i=cd(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 od({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 ed(this.hP,this.eP,this.YF,this.YF,this.$F,this.fs,qc.Both).onScroll(((t,e)=>{this.FP&&(t===qc.Vertical&&(this.XF.y=-e),t===qc.Horizontal&&(this.XF.x=e),this.bF=!0,this.Wi.Gi())})).XI(50).jI(12)}}const ad={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 ld;e.DataGridCellContentAlignmentOptions=void 0,(ld=e.DataGridCellContentAlignmentOptions||(e.DataGridCellContentAlignmentOptions={})).Center="center",ld.RightCenter="right-center",ld.LeftCenter="left-center",ld.RightTop="right-top",ld.LeftTop="left-top",ld.RightBottom="right-bottom",ld.LeftBottom="left-bottom",ld.CenterTop="center-top",ld.CenterBottom="center-bottom";const ud=(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])},cd=(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}`)},dd={top:!1,bottom:!1,left:!1,right:!1},fd=(t,e)=>e?t.x:t.y,gd=(t,e,i,s)=>1===e&&s===(i?t.columnIndex:t.rowIndex)||-1===e&&s===(i?t.columnIndex+t.columnSpan:t.rowIndex+t.rowSpan),pd=(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(fd(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&&egd(t,h,n,e))).reduce(((t,e)=>Math.max(t,fd(e.panel.getMinimumSize()||{x:0,y:0},n))),20),o=a[e-1];if(1===h&&c>fd(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))/fd(r,n)));return f.push(1-f.reduce(((t,e)=>t+e),0)),f};class md{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 Fc(new Array(this.ZP).fill(1)),y:new Fc(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=Oc(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=yd(t,this.KP,this.Hi);return this.$P(new Dc(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=yd(t,this.KP,this.Hi);return this.$P(new Gl(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=yd(t,this.KP,this.Hi);return this.$P(new Ya(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=yd(t,this.KP,this.Hi),i=e&&e.type?e.type:Vo;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=yd(t,this.KP,this.Hi),i=e&&e.type?e.type:gl;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=yd(t,this.KP,this.Hi),i=e&&e.type?e.type:sl;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=yd(t,this.KP,this.Hi),i=t&&t.type?t.type:Ml;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=yd(t,this.KP,this.Hi);return this.$P(new po(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=yd(t,this.KP,this.Hi);return this.$P(new Mh(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=yd(t,this.KP,this.Hi),i=void 0===e.bandAboveSeries||e.bandAboveSeries;return this.$P(new Pc(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=yd(t,this.KP,this.Hi);return this.$P(new Jh(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=yd(t,this.KP,this.Hi),i=new vh(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=yd(t,this.KP,this.Hi),i=new hd(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=pd(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=pd(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=_r(new Gr((()=>{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=_r(new Gr((()=>{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 yo)).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 lo(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=zn,e=this.uiScale){e=co(e);const i=uo(t,this.Rv(),this.uiScale,e,this.UP,this.fs);return this.RP.push(i),i}addLegendBox(t=$n,i=this.uiScale){i=co(i);const s=uo(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 yd=(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},xd="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",Sd="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==",vd={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)=>vd.multiply(t,vd.translation(e,i,s)),xRotate:(t,e)=>vd.multiply(t,vd.xRotation(e)),yRotate:(t,e)=>vd.multiply(t,vd.yRotation(e)),zRotate:(t,e)=>vd.multiply(t,vd.zRotation(e)),scale:(t,e,i,s)=>vd.multiply(t,vd.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 bd{constructor(t){this.kD=t}}class Md{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 Ad{constructor(t,e){this.gn=t,this.Y=e,this.LD=!0,this.RD=null,this.ED=null}}class kd{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 Ad(Qe(t.gn,{x:0,y:1}),u(t.Y.x,e.y)),r=new Ad(Qe(t.gn,{x:0,y:e.y+1}),u(t.Y.x,t.Y.y-1-e.y))):(s=new Ad(Qe(t.gn,{x:1,y:0}),u(e.x,t.Y.y)),r=new Ad(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 Dd.Success;const r=this.QD.$D(i,t.size);if(!r||!r.gn)return Dd.Fail;r.YD&&this.rB();const n=this.QD.ZD(r.KD);if(!n)return Dd.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?Dd.Resize:Dd.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 Id=t=>(e,i)=>i%2?e:e+t;class Cd{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 Td(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===Dd.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(Id(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 Pd 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 Od=(...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},Fd="\nfloat roundUnsigned(float number) {\n return floor(number + 0.5);\n}",Rd="\nfloat linearStep(float step0, float step1, float step) {\n return clamp((step - step0) / (step1 - step0), 0.0, 1.0);\n}",Bd="\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 ",zd="\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}",_d="\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 }",Ld=" \nint modulus(int a, int b) {\n return (a)-((a)/(b))*(b);\n}",Gd="\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}",Vd={"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"},Nd={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 Wd{constructor(t){this.modifiers=[],this.modifiers=t}alter(t){const e=new Wd(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 Hd=(...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},Ud=t=>e=>e.replace("void main(void)",`${t}\nvoid main(void)`),Xd=t=>e=>(t=t.endsWith(";")?t:`${t};`,e.replace(t,"")),jd=(...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},$d=(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},Zd=(...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},qd=(t,e)=>i=>{let s,r;if(t.includes("uniform")||t.includes("attribute")){const e=t.endsWith(";")?t:`${t};`;i=Hd(e)(i),s=t.split(" ")[2].replace(";","")}else s=t;if(e.includes(" ")){const t=e.endsWith(";")?e:`${e};`;i=Hd(t)(i),r=e.split(" ")[2].replace(";","")}else r=e;return Zd(`\t${r} = ${s};`)(i)},Kd=(...t)=>e=>{t=t.reverse();for(const i of t)e=i+e;return e};class Jd{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 Qd extends Jd{constructor(t,e,i,s){super(t,e,i.createShader(i.VERTEX_SHADER),i,s)}}class tf extends Jd{constructor(t,e,i,s){super(t,e,i.createShader(i.FRAGMENT_SHADER),i,s)}}class ef{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 sf=(t,e,i)=>()=>{t.TB=e,i&&i()};class rf{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",sf(this,!0,(()=>this.zB()))),this.QI.addEventListener("playing",sf(this,!0,(()=>this.zB()))),this.QI.addEventListener("pause",sf(this,!1)),this.QI.addEventListener("ended",sf(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 nf extends Es{constructor(t,e,i){super(t.Wi,e,i),this.Wm=!0,this.Vm={},this.Nm=y(th),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 of=t=>[Hd("uniform float uLookupMin","uniform float uLookupMax","uniform sampler2D uLookupTexture","uniform float uLookupTextureHeightPx","uniform vec4 uFallbackColor"),Ud(Fd),Yd("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 }`)],hf=[Hd("uniform sampler2D uMaskTexture"),Hd("varying vec2 vMaskTextureCoord"),$d("antiAliasFactor =","vec4 maskTextureSample = texture2D(uMaskTexture, vMaskTextureCoord)","antiAliasFactor = maskTextureSample.r")],af=[Hd("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;"),$d("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)")],lf=t=>void 0!==t.find((t=>t.idVertex&&t.idVertex.includes("3D"))),uf=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:[x|y|z]/)})),cf=t=>void 0!==t.find((t=>{var e;return null===(e=t.idVertex)||void 0===e?void 0:e.match(/lookup:value/)})),df=(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(Hd("attribute vec3 aNormal"),jd("vec3 normal = aNormal")),"linear-highPrecision"!==n)i.forEach((t=>{void 0!==t.attributeNameAxisCoord&&(!0!==c?s.push(jd(`${r} ${t.variableNameAxisCoord} = ${t.attributeNameAxisCoord}`)):s.push(jd(`${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(jd(`${r} ${t.variableNameAxisCoord}_highpart = ${t.attributeNameAxisCoord}_highpart`),jd(`${r} ${t.variableNameAxisCoord}_lowpart = ${t.attributeNameAxisCoord}_lowpart`))}))}if(a&&a.rotation){const t=a.rotation.dataType,e=("uniform"===t?"u":"a")+"Rot";s.push(Hd(`${t} vec2 ${e}`));const i="aInstanceGeo";s.push(jd(`vec2 rotatedGeo = vec2(${i}.x * ${e}.y + ${i}.y * ${e}.x, ${i}.y * ${e}.y - ${i}.x * ${e}.x)`))}if(a&&s.push(Hd(`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(Hd(`${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(Hd(`${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(Hd(`${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(Hd(`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(Hd(`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(Hd("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(Hd(`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(Hd(...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(Hd("uniform vec2 uRatioPxClip"));const t=("attribute"===a.dataType?"a":"u")+"OffsetPixels",e=!0===a.symmetric?"float":r;s.push(Hd(`${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(Hd(`${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(Hd("uniform float uRatioNwuWu"));const t=("attribute"===a.dataType?"a":"u")+"OffsetNWU",n=!0===a.symmetric?"float":r;s.push(Hd(`${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(Hd("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(Yd("gl_Position =",...f)),s},ff=(t,e,i,s)=>{const r=[],n=t.axisWorldTranslation,o=e?"vec3":"vec2";if("linear"===n)r.push($d(i,`${o} ${s} = ${i} * uScale + uDisp`));else if("linear-highPrecision"===n)r.push($d(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($d(i,...t))}}return r},gf={"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:${Od(t)}`,idFragment:void 0,apply:e=>{const i="uniform"===t?"u":"a";return{vertexShaderModifiers:[Hd(`${t} float ${i}PointSize`,"uniform float uDevicePixelRatio"),Zd(`gl_PointSize = ${i}PointSize * uDevicePixelRatio`)]}}}),Color:t=>{const i=t&&t.dataType,s=t&&t.maskTexture;let r,n=`Color:${Od(t)}`;const o=[],h=[];if("uniform"===i)h.push(Hd("uniform vec4 uColor"),jd("vec4 colorFragment = uColor"),...s?hf:[]);else if("attribute"===i)r="colorAttribute",o.push(qd("attribute vec4 aColor","varying vec4 vColor")),h.push(Hd("varying vec4 vColor"),jd("vec4 colorFragment = vColor"));else if("texture"===i)r="colorTexCoord",o.push(qd("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),h.push(Hd("varying vec2 vTextureCoord"),Hd("uniform sampler2D uColorTexture"),Hd("uniform vec4 uColor"),jd("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(qd("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")),i[1]===e.ImageFitMode.Tile?h.push(Hd("uniform sampler2D uColorTexture"),Hd("varying vec2 vTextureCoord"),jd("vec4 colorFragment = texture2D(uColorTexture, vTextureCoord);")):h.push(Hd("uniform sampler2D uColorTexture"),Hd("varying vec2 vTextureCoord"),Hd("uniform vec4 uColor"),jd("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(qd("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push(qd(e,"varying float vLookupValue"))}h.push(Hd("varying float vLookupValue"),...of("vLookupValue"))}else if(Array.isArray(i)&&"gradient"===i[0]){n=`Color:${Od(t)}`;const e=i[1],r=e.getColorStops();e instanceof $?h.push(Hd("uniform vec4 uBounds","uniform vec2 uCenter","uniform vec2 uDistance","uniform float uAspect"),Hd(...Dt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Ud(Rd),jd("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?hf:[]):e instanceof q&&(n=`Color:${Od(t)}`,h.push(Hd("uniform vec4 uBounds","uniform vec2 uStartPoint","uniform vec2 uEndPoint"),Hd(...Dt(r.map(((t,e)=>[`uniform vec4 color_${e}`,`uniform float stop_${e}`])))),Ud(Rd),jd("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?hf:[]))}if(!0===s){const t="maskTexture";r=r?`${r} ${t}`:`Color:${t}`,o.push(qd("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:${Od(t)}`,o=[],h=[];if(o.push("phong"===i&&qd("normal","varying vec3 vNormal"),qd("posWorld","varying vec3 vPosWorld")),"uniform"===e)h.push(Hd("uniform vec4 uColorDiffuse"),jd("vec4 colorFragment = uColorDiffuse"));else if("attribute"===e)r="per-vertex-color",o.push(qd("attribute vec4 aColor","varying vec4 vColor")),h.push(Hd("varying vec4 vColor"),jd("vec4 colorFragment = vColor"));else if(Array.isArray(e)){const t=e[1];if("value"===t)r="lookup:value",o.push(qd("attribute float aLookupValue","varying float vLookupValue"));else{const e=`posAxis.${t}`;r=`lookup:${t}`,o.push(qd(e,"varying float vLookupValue"))}h.push(Hd("varying float vLookupValue"),...of("vLookupValue"))}if(s){const t="wireframe";r=r?`${r},${t}`:t,o.push(qd("attribute vec3 aTriangleBary","varying vec3 vTriangleBary")),h.push(Hd("varying vec3 vTriangleBary"),Hd("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Ud(Gd),$d("colorFragment =","float edge = computeScreenSpaceWireframe(vTriangleBary, uWireframeThickness)","colorFragment = mix(colorFragment, uWireframeColor, edge)"))}return"phong"===i&&h.push(...af),{idFeature:"ColorShaded3D",idVertex:r,idFragment:n,apply:t=>({fragmentShader:"FragmentShader",vertexShaderModifiers:o,fragmentShaderModifiers:h})}},VertexLocation:t=>({idFeature:"VertexLocation",idVertex:`VertexLocation:${Od(t)}`,idFragment:void 0,apply:e=>{const i=[],s=lf(e),r=s?"vec3":"vec2";if("linear-highPrecision"!==t.axisWorldTranslation)!0!==t.splitPosAttribute?i.push(Hd(`attribute ${r} aPos`)):i.push(Hd("attribute float aPosX"),Hd("attribute float aPosY"),s&&Hd("attribute float aPosZ"));else{if(!0===t.splitPosAttribute)throw new Error("splitPosAttribute: true not supported with axisWorldTranslation: linear-highPrecision");i.push(Hd(`attribute ${r} aPos_highpart`),Hd(`attribute ${r} aPos_lowpart`))}return i.push(...df(t,s,{attributeNameAxisCoord:"aPos",variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),{vertexShaderModifiers:i}}}),LineInstanced2D:t=>({idFeature:"LineInstanced2D",idVertex:`LineInstanced2D:${Od(t)}`,idFragment:void 0,apply:e=>({vertexShaderModifiers:[Hd("uniform float uThicknessPixels"),Hd("uniform vec2 uRatioPxClip"),"linear-highPrecision"!==t.axisWorldTranslation&&Hd("attribute vec2 aLocationA"),"linear-highPrecision"!==t.axisWorldTranslation&&Hd("attribute vec2 aLocationB"),"linear-highPrecision"===t.axisWorldTranslation&&Hd("attribute vec2 aLocationA_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&Hd("attribute vec2 aLocationB_highpart"),"linear-highPrecision"===t.axisWorldTranslation&&Hd("attribute vec2 aLocationA_lowpart"),"linear-highPrecision"===t.axisWorldTranslation&&Hd("attribute vec2 aLocationB_lowpart"),Hd("attribute vec2 aSegmentPosition"),Hd("attribute float aSegmentSide"),...df(t,!1,{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),$d("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"),...cf(e)?[Xd("attribute float aLookupValue"),Xd("vLookupValue = aLookupValue"),Hd("attribute float aLookupValueA"),Hd("attribute float aLookupValueB"),Zd("vLookupValue = mix(aLookupValueA, aLookupValueB, aSegmentSide)")]:[],...uf(e)?ff(t,!1,"posWorld","posAxis"):[]]})}),LineInstanced3D:t=>({idFeature:"LineInstanced3D",idVertex:`LineInstanced3D:${Od(t)}`,idFragment:void 0,apply:e=>({defaultFragmentShader:"FragmentShader",vertexShaderModifiers:[Hd("uniform float uOffsetWU"),Hd("attribute vec3 aLocationA"),Hd("attribute vec3 aLocationB"),Hd("attribute float aSegmentPosition"),Hd("attribute float aPerpendHorizontal"),Hd("attribute float aPerpendVertical"),...df({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},lf(e),{attributeNameAxisCoord:"aLocationA",variableNameAxisCoord:"locationA",variableNameWorldCoord:"worldA"},{attributeNameAxisCoord:"aLocationB",variableNameAxisCoord:"locationB",variableNameWorldCoord:"worldB"}),$d("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"),...uf(e)?ff({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,"posWorld","posAxis"):[]]})}),RoundedEdges3D:{idFeature:"RoundedEdges3D",idVertex:"RoundedEdges3D",idFragment:void 0,apply:t=>({vertexShaderModifiers:[Hd("attribute vec3 aEdge"),Hd("uniform float uEdgeRoundness"),$d("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:${Od(t)}`,apply:r=>({fragmentShader:"FragmentShader",fragmentShaderModifiers:[Hd("uniform vec4 uTileBounds","uniform vec2 uTileDimensions","uniform sampler2D uTileIntensityValues","ubyte"===i&&Bd),"bilinear"===t.interpolation?jd("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"})`):jd("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 intensity = "+("float"===i?"sample0.x":`decodeUbyteRGBAEncodedFloat(sample0, ${s})`)),...of("intensityP")]})}},DrawToNormalTexture:t=>{const e=t.flipXZ,i=t.vertexIdSource,s=t.normalTextureType,r=t.heightmapTextureType,n=t.littleEndian;return{idFeature:"DrawToNormalTexture",idVertex:`DrawToNormalTexture:${Od(t)}`,idFragment:`DrawToNormalTexture:${Od(t)}`,apply:t=>{const o=[],h=[];return o.push(Hd("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&&Fd,Ld,zd,"ubyte"===r&&Bd),jd(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(Hd("uint"===s?"flat varying uvec3 vNormalRGB":"varying vec3 vNormalRGB"),jd("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:${Od(t)}`,idFragment:`SurfaceGrid:${Od(t)}`,apply:c=>{const d=[],f=[];return d.push(Hd("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&&Fd,Ld,zd,"ubyte"===a&&Bd),jd(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(...df({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"})),"phong"===r&&d.push(qd("posWorld","varying vec3 vPosWorld"),..."uint"===h?[Ud(_d),Zd("vec4 normalAxisRGB = vec4(pickTexelUnsigned(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))) / float(-1u)")]:[Zd("vec4 normalAxisRGB = pickTexel(uNormalmapTexture, vec2(iCell.y, iCell.x), vec2(uTileDimensionsMinus1.y, uTileDimensionsMinus1.x))")],Zd("vec3 normalAxis = (normalAxisRGB.rgb * 2.0) - 1.0","vNormal = normalize(normalAxis * uScale)"),Hd("varying vec3 vNormal",..."uint"===h?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"])),f.push(Hd("varying vec3 vTriangleBary")),"uniform"===e?f.push(Hd("uniform vec4 uColorDiffuse"),jd("vec4 colorFragment = uColorDiffuse")):Array.isArray(e)&&"lookup"===e[0]?"value"===e[1]?(d.push(qd("posAxis.xz","varying vec2 vVertexLocationAxisXZ")),f.push(Hd("uniform vec4 uTileBoundsAxisXZ","uniform vec2 uTileDimensionsXZ","varying vec2 vVertexLocationAxisXZ","uniform sampler2D uTileIntensityValues","uniform mat4 uViewProjectionMatrix","uniform vec3 uScale","uniform vec3 uDisp","ubyte"===l&&Bd),"bilinear"===i?jd("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"})`):jd("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"),...of("intensityP"))):(d.push(qd(`posAxis.${e[1]}`,"varying float vLookupValue")),f.push(Hd("varying float vLookupValue"),...of("vLookupValue"))):void 0===e&&f.push(jd("vec4 colorFragment = vec4(0.0, 0.0, 0.0, 0.0)")),"phong"===r&&f.push(...af),n&&(d.push(Hd("attribute vec3 aTriangleBary"),qd("aTriangleBary","varying vec3 vTriangleBary")),f.push(Hd("uniform vec4 uWireframeColor","uniform float uWireframeThickness"),Ud(Gd),$d("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:${Od(t)}`,idFragment:`DebugSurfaceGridNormals:${Od(t)}`,apply:e=>({vertexShaderModifiers:[Hd("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",Fd,Ld,zd,"ubyte"===t.heightmapTextureType&&Bd,..."uint"===t.normalTextureType?["uniform usampler2D uNormalmapTexture"]:["uniform sampler2D uNormalmapTexture"]),jd(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?[Ud(_d)]:[],...df({axisWorldTranslation:t.axisWorldTranslation,normalSource:"custom"},!0,{attributeNameAxisCoord:void 0,variableNameAxisCoord:"posAxis",variableNameWorldCoord:"posWorld"}),$d("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:[Zd("gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0)")]})}),OffsetTowardsCamera:()=>({idFeature:"OffsetTowardsCamera",idVertex:"OffsetTowardsCamera",idFragment:void 0,apply:t=>({vertexShaderModifiers:[Hd("uniform vec3 uCameraLoc"),$d("posWorld =","posWorld = posWorld + normalize(uCameraLoc) * 0.0025")]})}),AliasedEdge:{idFeature:"AliasedEdge",idVertex:"AliasedEdge",idFragment:"AliasedEdge",apply:t=>({vertexShaderModifiers:[Hd("attribute float aSegmentInside"),Hd("varying float vSegmentInside"),Hd("varying float vSegmentSide"),$d("gl_Position = ","\n vSegmentInside = aSegmentInside;\n vSegmentSide = aSegmentSide;\n ")],fragmentShaderModifiers:[Kd("#extension GL_OES_standard_derivatives : enable"),Hd("uniform float uAALimit"),Hd("varying float vSegmentInside"),Hd("varying float vSegmentSide"),$d("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:${Od(t)}`,idFragment:`Glow1D:${Od(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:[qd("attribute vec2 aTextureCoord","varying vec2 vTextureCoord")],fragmentShader:"FragmentShader",fragmentShaderModifiers:[Hd("uniform sampler2D uTexture"),Hd("varying vec2 vTextureCoord"),Hd("uniform vec2 uTextureSize"),r&&Hd("uniform vec2 uOffsetPx"),!r&&Hd("uniform sampler2D uTextureFirstGlowPass"),!r&&Hd("uniform vec4 uGlowColor"),$d("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:[Hd("uniform vec4 uColor"),jd("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:[qd("attribute vec4 aColor","varying vec4 vColor")],fragmentShaderModifiers:[Hd("varying vec4 vColor"),jd("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:[qd("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:[Hd("attribute vec2 aLengthSoFar"),Hd("varying float vLengthSoFar"),Hd("uniform vec2 uStippleCount"),Zd("\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Hd("uniform sampler2D uStippleTexture"),Hd("uniform float uStippleScale"),Hd("varying float vLengthSoFar"),"webgl1"===e&&Hd("uniform float uStippleTextureWidthLimiter"),$d("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:[Hd("attribute vec2 aLengthSoFarA"),Hd("attribute vec2 aLengthSoFarB"),Hd("varying float vLengthSoFar"),Hd("uniform vec2 uStippleCount"),Zd("\n vec2 aLengthSoFar = mix(aLengthSoFarA, aLengthSoFarB, aSegmentSide);\n vec2 len = (((aLengthSoFar) / uScale) / 2.0) * uStippleCount;\n vLengthSoFar = len.x + len.y;\n ")],fragmentShaderModifiers:[Hd("uniform sampler2D uStippleTexture"),Hd("uniform float uStippleScale"),Hd("varying float vLengthSoFar"),"webgl1"===e&&Hd("uniform float uStippleTextureWidthLimiter"),$d("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 pf{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 Is?i=e.Hr.op():e instanceof nf&&(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 Is||t instanceof nf?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(gf["2D"],gf.Glow1D({spreadPx:n,blurPx:o,firstPass:!0}),gf.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(gf["2D"],gf.Glow1D({spreadPx:n,blurPx:o,firstPass:!1}),gf.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 xf;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 xf;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 mf{constructor(t,i,s,r,n=!0){this.MO=new Md,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 Pd(`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 Pd(`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 Pd("No vertex shader template defined",s);if(!u)throw new Pd("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 Wd(c.vertexShader.modifiers).build(Vd[c.vertexShader.template]),{source:s,info:r}=o(t,"vertex");p=s,y=r,b=new Qd(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=Nd[M.template],i=new Wd([...M.modifiers]).build(t),{source:r,info:h}=o(i,"fragment",c.hints);m=r,x=h,A=new tf(k,r,e,h),s.set(k,A),n.fragmentShaders+=1}const w=new ef(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 vf(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 xf{gO(t){if(t instanceof Ti||t instanceof ja){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 Sf{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=vd.multiply(s,[n.x,n.y,r,1]);return f(o[0],o[1],o[2])}}class vf{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 bf{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 Mf extends Is{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 Af=t=>{if(t instanceof Ti||t instanceof ja)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 kf(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 wf(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 Df=(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 Ef extends Xs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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?fl(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=kf(this.lR,this.ut,this.jr.getPosition(),this.jr.getExtent(),this.jr.getShape(),this.kD.pB()):this.jr instanceof q?this.xR=wf(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(gf["2D"],gf.Color({dataType:this.jr instanceof $||this.jr instanceof q?["gradient",this.jr]:"uniform"}),gf.VertexLocation({axisWorldTranslation:Af(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=kf(this.lR,this.ut,t.getPosition(),t.getExtent(),t.getShape(),this.kD.pB()):t instanceof q?this.TR=wf(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(gf["2D"],gf.Color({dataType:t instanceof $||t instanceof q?["gradient",t]:"uniform"}),gf.VertexLocation({axisWorldTranslation:Af(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(gf["2D"],gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0,this.PR=e&&this.tn!==J?this.PR||this.kD.hO(gf["2D"],gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(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 Tf{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 Tf).LR(t))(),Cf=(t,e,i,s,r,n,o,h,a,l)=>(void 0===h&&void 0===o||If.RR(),n.push(t,e),r.push(If.first,If.second,If.third),h=void 0,o=void 0,r.push(If.third,If.fourth,If.second),a=If.third,If.ER(),l&&n.push(i,s),[o,h,a]),Pf=(t,e,i,s,r,n,o,h,a,l,u)=>{void 0===a&&void 0===h||If.RR(),o.push(t,e),r.push(If.first,If.second,If.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(If.third,If.fourth,If.fifth),l=If.fourth),If.ER(),u&&o.push(i,s),[h,a,l]},Of=(t,e,i,s,r,n,o,h,a,l)=>(void 0===o&&void 0===n||If.RR(),r.push(t,e),s.push(If.first,If.second,If.third),n=i,o=void 0,h=If.third,l?r.push(i):a=!0,[n,o,h,a]),Ff=(t,e,i,s,r,n,o,h,a,l,u)=>(0!==n.length?(void 0===h&&void 0===o||If.RR(),If.RR()):a>0&&(If.RR(),u>0&&(u-=1)),n.push(t),r.push(If.first,If.second,If.third),a=If.second,o=t,h=void 0,l&&n.push(i,s),[o,h,a,u]),Rf=(t,e=0)=>{If.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]=Cf(g,p,d,f,n,h,a,l,u,t):d.yf.y?[a,l,u]=Pf(g,p,d,f,o,n,h,a,l,u,t):[a,l,u,m]=Of(g,p,d,o,h,a,l,u,m,t):d.y===f.y?(a=g,m&&(h.push(g),m=!1,If.RR()),0===h.length&&u>0&&y>0&&(y-=1)):d.y>f.y?[a,l,u,y]=Ff(g,0,d,f,n,h,a,l,u,t,y):[a,l,u,y]=Ff(g,0,d,f,o,h,a,l,u,t,y)}return[h,new Uint16Array(n),new Uint16Array(o),u,y]};class Bf extends Us{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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]=Rf([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]=Rf([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 ja?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 ja?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 Gf(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),Nf={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)}},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("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 Hf extends $s{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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 Lf&&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(gf["2D"],gf.Color({dataType:e}),gf.LineInstanced2D({axisWorldTranslation:Af(this.ut),normalSource:void 0}),this.mE?gf.AliasedEdge:void 0,s&&gf.StippleTextureInstanced),mousePickingShader:g?this.kD.hO(gf["2D"],gf.MousePicking,gf.LineInstanced2D({axisWorldTranslation:Af(this.ut),normalSource:void 0}),s&&gf.StippleTextureInstanced):void 0,geometry:Vf(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=kf(Ps(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=wf(Ps(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 ja?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;Nf.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 Nf.dE(this.ut.oi(),this.kD,s,c,this.ut.oi()?4:2,0),Nf.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 Uf extends Zs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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 Lf&&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(gf["2D"],gf.Color({dataType:e}),gf.LineInstanced2D({axisWorldTranslation:Af(this.ut),normalSource:void 0,snapToNearestPixel:this._E}),this.mE?gf.AliasedEdge:void 0,r&&gf.StippleTextureInstanced),geometry:Vf(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 ja?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;Nf.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 Nf.gE(this.ut.oi(),this.kD,e,a,this.ut.oi()?4:2,0),Nf.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 Xf{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*jf),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=ks(i,t.min,this.AE,this.wE,0,s-1);void 0===r&&(r=this.wE?s-1:0);let n=ks(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 $f extends Xf{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 Zf{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 qf extends Xf{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 Kf extends qs{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r),this.yB=new xf,this.Xv=[],this.iz=new $f(this.ut,this),this.sz=new Yf(this.ut,this,(()=>this.Wi.Gi())),this.ez=new Zf(this.Xv,(t=>{t.coordsBuffer&&this.kD.pO(t.coordsBuffer),t.vE&&this.kD.pO(t.vE)}),!0),this.hz=new qf(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 Lf&&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=kf(this.Er(),this.ut,p.getPosition(),p.getExtent(),p.getShape(),this.kD.pB()):g?this.TR=wf(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(gf["2D"],gf.Color({dataType:e}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0}),l&&gf.StippleTexture),mousePickingShader:o?this.kD.hO(gf["2D"],gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0}),l&&gf.StippleTexture):void 0,lineStyleSolid:a,lineStyleDashed:l,fillStyleSolid:f,fillStyleLinearGradient:g,fillStyleRadialGradient:p,fillStylePaletted:m}:"triangulated"===t?{type:t,shader:this.kD.hO(gf["2D"],gf.Color({dataType:e}),gf.LineInstanced2D({axisWorldTranslation:Af(this.ut),normalSource:void 0}),this.mE?gf.AliasedEdge:void 0,l&&gf.StippleTextureInstanced),mousePickingShader:o?this.kD.hO(gf["2D"],gf.MousePicking,gf.LineInstanced2D({axisWorldTranslation:Af(this.ut),normalSource:void 0}),l&&gf.StippleTextureInstanced):void 0,geometry:Vf(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 ja?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?Nf.dE:Wf.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?Nf.fE(this.kD,u,n.vE,l("aLengthSoFarA"),l("aLengthSoFarB"),2,0):Wf.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;Nf.wD(this.iR,i.geometry,u,this.mE&&1!==t,1===t,e,n.existingCoordinatesCount-1)}else Wf.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=vs(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===xs.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 Jf(t,e)},tg=t=>{const e=[u(-.5,-.5),u(-.5,.5),u(.5,-.5),u(.5,-.5),u(-.5,.5),u(.5,.5)];return new Jf(t,e)},eg=(t,e,i)=>{let s=e.MO.ID.get(t);return s||(s=i(e),e.MO.ID.set(t,s)),s};class ig extends Vs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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&&gf.PointSize(e),s=gf.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:Af(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(gf["2D"],i,s,r?gf.Color({dataType:"uniform"}):l?gf.Color({dataType:"attribute"}):h?gf.Color({dataType:["lookup",h.getLookUpProperty()]}):n?gf.Color({dataType:["gradient",n]}):o?gf.Color({dataType:["gradient",o]}):void 0):void 0,this.FR=t&&u?this.kD.hO(gf["2D"],i,s,gf.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=eg(e.PointShape.Triangle,this.kD,Qf),this.uE=this.kD.gl.TRIANGLES):o===e.PointShape.Circle?(this.pz=eg(e.PointShape.Circle,this.kD,(t=>((t,e)=>{const i=function(t=25){return fl(u(0,0),0,360,.5,.5,t)[0]}(24);return new Jf(t,i)})(t))),this.uE=this.kD.gl.TRIANGLE_FAN):o===e.PointShape.Square?(this.pz=eg(e.PointShape.Square,this.kD,tg),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 ja?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=vs(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 sg extends _s{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.yE={fill:void 0,border:void 0},this.yB=new xf,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 Nf.dE(this.ut.oi(),this.kD,n,u,this.ut.oi()?4:2,0),Nf.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 rg extends Ns{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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 od&&this.jr,g=l||c||d||f;if(e&&(this.bR=g?this.kD.hO(gf["2D"],l&&gf.Color({dataType:"uniform"}),d&&gf.Color({dataType:["gradient",d]}),c&&gf.Color({dataType:["gradient",c]}),f&&gf.Color({dataType:["image",f.getFitMode()]}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0),c?this.yR=kf(this.Ir||this.Rz,this.ut,c.getPosition(),c.getExtent(),c.getShape(),this.kD.pB()):d?this.xR=wf(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(gf["2D"],gf.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0),x?this.CR=kf(this.Rz,this.ut,x.getPosition(),x.getExtent(),x.getShape(),this.kD.pB()):y?this.TR=wf(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(gf["2D"],gf.Color({dataType:"uniform"}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0,this.PR=t&&this.tn!==J?this.PR||this.kD.hO(gf["2D"],gf.Color({dataType:"uniform"}),gf.VertexLocation({axisWorldTranslation:Af(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 od){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 ja?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 od){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 ja?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 ng extends Hs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.yB=new xf,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(gf["2D"],u&&gf.Color({dataType:"uniform"}),f&&gf.Color({dataType:["gradient",f]}),d&&gf.Color({dataType:["gradient",d]}),c&&gf.Color({dataType:["lookup",c.getLookUpProperty()]}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0}if(d?this.yR=kf(this.Ir||this.$n,this.ut,d.getPosition(),d.getExtent(),d.getShape(),this.kD.pB()):f?this.xR=wf(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:Df(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(gf["2D"],gf.Color({dataType:x?["gradient",x]:y?["gradient",y]:"uniform"}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0),x?this.CR=kf(this.Ir||this.$n,this.ut,x.getPosition(),x.getExtent(),x.getShape(),this.kD.pB()):y?this.TR=wf(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(gf["2D"],gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})):void 0,this.PR=t&&this.tn!==J?this.FR||this.kD.hO(gf["2D"],gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(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 og=(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},ag=(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)},cg=(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 dg extends zs{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.Wz=y("bilinear"),this.Fa=cs.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 fg extends dg{constructor(t,e,i,s,r,n,o,h){super(t,e,i,s,r,n),this.yB=new xf,this.yE={},this.Uz=[],this.$z=!1,this.qn=!1,this.Yz=og,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=ag(t,d,u?"intensity":void 0,(t=>t.sizeHeatmapDataVectors));f.size>0&&(cg(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(gf["2D"],gf.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}),gf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Af(this.ut),flipXY:"rows"===this.Dh.dataOrder,normalSource:void 0}))}:o?{renderMode:"solid",fillStyleSolid:o,shader:this.kD.hO(gf["2D"],gf.Color({dataType:"uniform"}),gf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Af(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(gf["2D"],gf.Color({dataType:"uniform"}),gf.VertexLocation({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Dh.dataOrder,axisWorldTranslation:Af(this.ut),normalSource:void 0})),fillStyleSolid:i}:{renderMode:"triangulated",shader:this.kD.hO(gf["2D"],gf.Color({dataType:"uniform"}),gf.LineInstanced2D({translation:{dataType:"uniform",sizeUnit:"axis"},scaling:{dataType:"uniform"},flipXY:"rows"===this.Dh.dataOrder,axisWorldTranslation:Af(this.ut),normalSource:void 0})),geometry:Vf(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(gf["2D"],gf.MousePicking,gf.VertexLocation({scaling:{dataType:"uniform"},translation:{dataType:"uniform",sizeUnit:"axis"},axisWorldTranslation:Af(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=ug(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 ja)&&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 ja)&&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),lg(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=fa({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 fg(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 mg={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)=>mg.multiply(t,mg.translation(e,i)),rotate:(t,e)=>mg.multiply(t,mg.rotation(e)),scale:(t,e,i)=>mg.multiply(t,mg.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 yg extends Gs{constructor(t,e,i,s,r,n,o){super(t,e,i,s,r),this.hV=[],this.yB=new xf,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(ss(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=kf(this.nV,this.ut,this.jr.getPosition(),this.jr.getExtent(),this.jr.getShape(),this.kD.pB()):this.jr instanceof q?this.xR=wf(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(gf["2D"],gf.VertexLocation({axisWorldTranslation:"matrix",normalSource:void 0,snapToNearestPixel:this._E}),gf.Color({dataType:d?["gradient",d]:f?["gradient",f]:"uniform",maskTexture:!0})):void 0),this.pV=i&&g?this.pV||this.kD.hO(gf["2D"],gf.MousePicking,gf.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=mg.projection(i,s,-1);const n=mg.translation(this.aV.x,this.aV.y),o=mg.translation(this.lV.x,this.lV.y);r=mg.translate(r,this.cV.x,this.cV.y),r=mg.multiply(r,o),r=mg.rotate(r,this.uV),r=mg.multiply(r,n),1===t&&(r=mg.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 xg{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 Sg extends xg{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 vg extends Sg{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 Cs&&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=Ps({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 rg(this.iR,this,t,this.yV,[],e,this.iR.AV(e)))}jk(t){const e=this.iR._V();return this.SV(new Bf(this.iR,this,t,this.yV,[],e,this.iR.AV(e)))}Ou(t){const e=this.iR._V();return this.SV(new Ef(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 pg(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 fg(this.iR,this,t,this.yV,e,i,s,this.iR.AV(s)))}wV(t){return this.SV(new Mf(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 bg extends bd{constructor(t){super(t)}}class Mg extends bg{constructor(t){super(t),this.kV="attribute";const{vertices:e,drawSize:i,drawMode:s}=Ag(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 Ag=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 kg extends bg{constructor(t,e){super(t),this.kV="attribute",this.CV=e;const{vertices:i,indices:s}=wg();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 wg=()=>{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 kg(t,wt(e,0,1)):new Mg(t),t.MO.BD.set(e,i),i)};class Eg extends nf{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 Tg extends Eg{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 Ig extends Tg{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=cs.fillStyle,this.Nm.S(ih)}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=Os(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 Fs(this.Kr,this.jr)}Qr(t){this.Kr=t}}class Cg extends bd{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 Pg=(t,e=16)=>{let i=t.MO.PD.get(e);return i||(i=new Cg(t,e),t.MO.PD.set(e,i),i)};class Og extends Tg{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=cs.lineStyle,this.Nm.S(th)}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(gf["3D"],gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0}),gf.Color({dataType:"uniform"})),fillStyle:e}:"instanced"===s&&(this.yE={type:s,shader:this.kD.hO(gf["3D"],gf.ColorShaded3D({dataType:"uniform",shadingStyle:this.Nm.M().type}),gf.LineInstanced3D({axisWorldTranslation:Af(this.ut)})),geometry:Pg(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 Rg=(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 Fg(t,i,s),t.MO.DD.set({sectors:i,stacks:s},r),r)};class Bg extends Tg{constructor(t,e,i,s,r){super(t,e,i,s,r),this.FV="cull-back",this.Xv=[],this.yE={},this.ez=new Zf(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=cs.lineStyle,this.eS=cs.pointStyle3D,this.Nm.S(ih),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 Ki&&h.getSize(),l=h instanceof Ki&&h.getFillStyle(),u=l instanceof L&&l,d=l instanceof N&&l,f=u||d,g=h instanceof Ki&&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(gf["3D"],gf.Color({dataType:S}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})),mousePicking:c?{shader:this.kD.hO(gf["3D"],gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(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(gf["3D"],gf.ColorShaded3D({dataType:S,shadingStyle:this.Nm.M().type}),gf.LineInstanced3D({axisWorldTranslation:Af(this.ut)})),geometry:zg(this.kD,e.getThickness()),mousePicking:c?{shader:this.kD.hO(gf["3D"],gf.MousePicking,gf.LineInstanced3D({axisWorldTranslation:Af(this.ut)}))}:void 0}),t.markers=void 0,f){const e=ie(h.getShape(),{cube:()=>Dg(this.kD),sphere:()=>_g(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(gf["3D"],gf.ColorShaded3D({dataType:d?["lookup",d.getLookUpProperty()]:"uniform",shadingStyle:this.Nm.M().type,wireframe:!1!==y}),gf.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:Af(this.ut),normalSource:e.kV})),mousePicking:c?{shader:this.kD.hO(gf["3D"],gf.MousePicking,gf.VertexLocation({offset:{dataType:"uniform",sizeUnit:"number"==typeof a?"nwu":"axis",symmetric:"number"==typeof a,halved:!0},axisWorldTranslation:Af(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 zg=(t,e)=>Pg(t,e>50?20:e>20?16:e>10?12:e>5?8:6),_g=(t,e)=>{const i=e.getSize();return Rg(t,"number"==typeof i?i>50?20:i>20?16:i>10?12:i>5?8:6:20)};class Lg extends Tg{constructor(t,e,i,s,r,n){super(t,e,i,s,r),this.FV="cull-back",this.Xv=[],this.ez=new Zf(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=cs.pointStyle3D,this.Nm.S(ih);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 Ki&&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 Ki){const o=ie(n.getShape(),{cube:()=>Dg(this.kD),sphere:()=>Gg(this.kD,n,r)});t={type:"instanced",shader:this.kD.hO(gf["3D"],gf.ColorShaded3D({dataType:i,shadingStyle:this.Nm.M().type,wireframe:!1!==y}),gf.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Af(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(gf["3D"],gf.MousePicking,gf.VertexLocation({offset:{dataType:f,sizeUnit:"number"==typeof e?"nwu":"axis",halved:!0,symmetric:"number"==typeof e},axisWorldTranslation:Af(this.ut),normalSource:void 0})),geometry:o,wireframe:p&&y&&{thickness:p.getThickness()<0?1:p.getThickness(),fillStyleSolid:y}}}else n instanceof Qi&&"number"==typeof e&&(t={type:"primitive",shader:this.kD.hO(gf["3D"],gf.PointSize(f),gf.Color({dataType:i}),gf.VertexLocation({axisWorldTranslation:Af(this.ut),normalSource:void 0})),pointStyle:n,pointSizePixels:e,useIndividualPointSize:s,fillStyleSolid:l,fillStyleIndividual:u,fillStylePalette:c,mousePickingShader:h&&this.kD.hO(gf["3D"],gf.PointSize(f),gf.MousePicking,gf.VertexLocation({axisWorldTranslation:Af(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 Ki?e/2:t instanceof Qi?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 Gg=(t,e,i)=>{const s=e.getSize();return Rg(t,"number"==typeof s?i||s>=50?20:s>=10?10:s>=3?5:3:32)};class Vg extends Tg{constructor(t,e,i,s,r,n){super(t,e,i,r,n),this.FV="disabled",this.jr=cs.fillStyle,this.Fa=cs.lineStyle,this.Wz=y("bilinear"),this.rN=[],this.nN=Ee,this.oN=void 0,this.yE={},this.aN=!1,this.Nm.S(th);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 fg(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=hg;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=Fs(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=ag(e,S,void 0,(t=>t.sizeGeometryDataVectors));if(v.size>0&&(cg(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(gf["2D"],gf.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(gf["3D"],gf.SurfaceGrid({axisWorldTranslation:Af(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(gf["3D"],gf.SurfaceGrid({axisWorldTranslation:Af(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(gf["3D"],gf.SurfaceGrid({axisWorldTranslation:Af(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(gf["3D"],gf.SurfaceGrid({axisWorldTranslation:Af(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(gf["3D"],gf.SurfaceGrid({axisWorldTranslation:Af(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=ug(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),lg(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 Ng extends Tg{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 Vg(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 Wg extends xg{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 Qo,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 Hg extends Wg{constructor(t,e,i,s){super(t,e,i,s),this.yB=new Sf,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=vd.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=vd.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=vd.multiply(vd.translation(da(-1,1,g),da(-1,1,p),0),vd.scaling(c,d,1));return this.GV=vd.multiply(m,vd.multiply(this.LN,this.RN)),this.EN=vd.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 Lg(this,this.yV,[],e,this.iR.AV(e),t))}Kp(t){const e=this.iR._V();return this.SV(new Bg(this,this.yV,t,e,this.iR.AV(e)))}iS(){const t=this.iR._V();return this.SV(new Ig(this,this.yV,[],t,this.iR.AV(t)))}wg(){const t=this.iR._V();return this.SV(new Og(this,this.yV,[],t,this.iR.AV(t)))}KS(t){const e=this.iR._V();return this.SV(new Vg(this,this.yV,[],t,e,this.iR.AV(e)))}ey(t){const e=this.iR._V();return this.SV(new Ng(this,this.yV,[],t,e,this.iR.AV(e)))}}const Ug=(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}},Xg={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)Ug(s,this.Ia,e,Xg,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(gf["2D"],gf.VertexLocation({translation:"grid"===this.zN?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Af(this.ut),normalSource:void 0}),s instanceof L?gf.Color({dataType:"uniform"}):s instanceof G?gf.Color({dataType:"attribute"}):s instanceof N?gf.Color({dataType:["lookup",s.getLookUpProperty()]}):s instanceof $||s instanceof q?gf.Color({dataType:["gradient",s]}):void 0);const t=this.Fa;this.HN=t instanceof L?i.hO(gf["2D"],gf.Color({dataType:"uniform"}),gf.VertexLocation({translation:"grid"===this.zN?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Af(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)jg(l,this.Ia,t,Xg);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)Yg(l,s.color,this.Ia,t,Xg);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=kf(this.Er(),this.ut,s.getPosition(),s.getExtent(),s.getShape(),this.kD.pB()):s instanceof q?this.xR=wf(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(gf["2D"],gf.MousePicking,gf.VertexLocation({translation:"grid"===this.zN?{dataType:"uniform",sizeUnit:"axis"}:void 0,axisWorldTranslation:Af(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 Zg extends ds{constructor(t,e,i=mf){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=os(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 sd(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 vg))throw new Error("Unexpected Engine Layer error");return i}return this.ah(new vg(this,e,t))}qT(t,e,i){const s=this.rr(e);if(s){if(ge(0,(()=>{})),!(s instanceof Hg))throw new Error("Unexpected Engine Layer error");return s}return this.ah(new Hg(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 $g(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 qg="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==i.g?i.g:"undefined"!=typeof self?self:{},Kg={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 Kg?Kg.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,qg);var Jg=Kg.exports;function Qg(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 tp=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},ep=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 ip{constructor(t,e){this.type=t,this.p=new Jg(e.p,16),this.red=e.prime?Jg.red(e.prime):Jg.mont(this.p),this.zero=new Jg(0).toRed(this.red),this.one=new Jg(1).toRed(this.red),this.two=new Jg(2).toRed(this.red),this.n=e.n&&new Jg(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=tp(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]=tp(i[s],n[s],this.ZG),h[r]=tp(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=ep(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 Jg(t.a,16),b:new Jg(t.b,16)}))):this.lW(i),{beta:e,lambda:i,basis:s}}aW(t){const e=t===this.p?this.red:Jg.mont(t),i=new Jg(2).toRed(e).redInvm(),s=i.redNeg(),r=new Jg(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 Jg(1),g=new Jg(0),p=new Jg(0),m=new Jg(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 np(this,t,e,i)}pointFromX(t,e){(t=new Jg(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 Jg(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 op extends sp{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 Jg(0)):(this.x=new Jg(e,16),this.y=new Jg(i,16),this.z=new Jg(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 op(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 hp{constructor(t){this.curve=new rp(t),this.g=this.curve.g,this.n=this.curve.n}}const ap={};var lp;ap.PresetCurve=hp,lp={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(ap,"secp256k1",{configurable:!0,enumerable:!0,get(){const t=new hp(lp);return Object.defineProperty(ap,"secp256k1",{configurable:!0,enumerable:!0,value:t}),t}});class up{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 up?e:new up(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 cp(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 dp{constructor(){this.place=0}}class fp{constructor(t,e){if(t instanceof fp)return t;this.mW(t,e)||(this.r=new Jg(t.r,16),this.s=new Jg(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}mW(t,e){t=Qg(t,e);const i=new dp;if(48!==t[i.place++])return!1;const s=cp(t,i);if(!1===s)return!1;if(s+i.place!==t.length)return!1;if(2!==t[i.place++])return!1;const r=cp(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=cp(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 Jg(n),this.s=new Jg(h),this.recoveryParam=null,!0}}class gp{constructor(t){if(!(this instanceof gp))return new gp(t);"string"==typeof t&&(t=ap[t]),t instanceof ap.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 up.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 Jg(t,16)),i=this.keyFromPublic(i,s);const r=(e=new fp(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 pp,mp={exports:{}};mp.exports=(pp=pp||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!==qg&&qg.crypto&&(i=qg.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}(mp.exports),bp={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}(mp.exports),Mp={exports:{}}.exports=mp.exports.enc.Hex,Ap={exports:{}}.exports=mp.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}(mp.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}(mp.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}(mp.exports),xp=(yp=mp.exports).lib.Base,Sp=yp.enc.Utf8,yp.algo.HMAC=xp.extend({init:function(t,e){t=this.PW=new t.init,"string"==typeof e&&(e=Sp.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)}})}()}(mp.exports);var kp={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}(mp.exports),wp={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}(mp.exports),Ep={exports:{}}.exports=function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}(mp.exports);const Tp={"-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=="]},Ip=mt,Cp=(...t)=>t.slice(1).reduce(((e,i)=>e+Ip.atob(Tp[t[0]][i].toString())),"");let Pp,Op,Fp=!1,Rp=new Uint8Array([34]);class Bp{set e(t){Pp=t}get e(){Op={Bh:!1,Oh:!1,Lh:!1,Rh:!1,Eh:!1,zh:!1};const t=Rp.length>=1?Rp[0]:void 0;return void 0!==t&&(Op.Bh=!!(1&t),Op.Oh=!!(2&t),Op.Lh=!!(4&t),Op.Rh=!!(8&t),Op.Eh=!!(16&t),Op.zh=!!(32&t)),Op.zh}}let zp=!1;const _p=(t,e)=>{const i=new RegExp(`.{${e}}`,"g");return(t.match(i)||[]).map((t=>parseInt(t,16)))},Lp=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")}`},Gp=t=>t.getFullYear().toString()+(t.getMonth()+1).toString().padStart(2,"0")+t.getDate().toString().padStart(2,"0"),Vp=t=>{const e={},i=t.split("-");if(3!==i.length)throw new Error(Cp(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 Hp(d,f)?e:null},Np=t=>{const e=t.slice(0,4);let i=t.slice(5);switch(e){case"0001":{i=i.replace(/-/g,"");const t=Uint8Array.from(_p(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(Gp(h)s[e]===t)))return;break}case"0002":if(!Vp(t))throw new Error(Cp(0,0,1,7,1,12,5));return;default:throw new Error(Cp(0,0,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}throw new Error(Cp(0,0,1,2,1,7,1,12,5))},Wp=t=>{if(!t)throw new Error(Cp(0,14,1,15,1,16,1,17,1,19,1,18,1,2,5));const e=(t[Cp(-1,9)]||t[Cp(-1,37)]).map((t=>(t||"").trim()));if(e.indexOf(Ip[Cp(-1,6)][Cp(-1,7)])>-1)return!0;const i=e.filter((t=>t.indexOf("*")>-1));if($p(Ip[Cp(-1,6)][Cp(-1,7)],i))return!0;const s=t[Cp(-1,8)]||t[Cp(-1,38)];if(""!==s&&null!=s){if($p(Ip[Cp(-1,6)][Cp(-1,7)],[s]))return!1;if(s===Ip[Cp(-1,6)][Cp(-1,7)])return!1}throw new Error(Cp(0,14,1,20,5))},Hp=(t,e)=>{const i=new gp("secp256k1").keyFromPublic(Cp(-4,0),"hex"),s=bp(t).toString();return i.verify(s,e)},Up=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(!Hp(r,n))throw new Error(Cp(0,21,1,2,1,7,1,12,5));const o=Mp.parse(r);i=kp.decrypt({ciphertext:Mp.parse(s)},o,{mode:wp,padding:Ep,iv:Mp.parse("00000000000000000000000000000001")}).toString(Ap)}catch(t){throw new Error(Cp(0,21,1,2,1,7,1,12,5))}try{e=JSON.parse(i)}catch(t){throw new Error(Cp(0,21,1,2,1,7,1,12,5))}if(void 0===e[Cp(-1,5)]||null===e[Cp(-1,4)]||!e[Cp(-1,9)])throw new Error(Cp(0,21,1,2,1,7,1,12,5));const s=parseInt(Cp(-3,0),10)||Number(parseInt(Cp(-3,0),10));if(e[Cp(-1,5)]{const e=Vp(t);if(!e)throw new Error(Cp(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(Cp(0,39,1,40,1,41,5));const i=t.split("-"),s=i[1].slice(1),r=i[2],n=i[3];if(!Hp(`${s}-${r}`,n))throw new Error(Cp(0,21,1,2,1,7,1,12,5));const o=Uint8Array.from(_p(r,2));let h=0;for(let t=o.length-1;t>0;t-=1)h+=o[t]*2**(8*t);if(h<(parseInt(Cp(-3,0),10)||Number(parseInt(Cp(-3,0),10))))throw new Error(Cp(0,21,1,2,1,3,1,4,5));const a=Int32Array.from(_p(s,8)),l=vp(e[Cp(-1,31)]).toString(Mp),u=Int32Array.from(_p(l,8)),c=vp(e[Cp(-1,32)]).toString(Mp),d=Int32Array.from(_p(c,8)),f=new Int32Array(u.length);for(let t=0;tf[e]===t)))throw new Error(Cp(0,21,1,2,1,7,1,12,5))})(t,e);break;case"0002":((t,e)=>{if(!e)throw new Error(Cp(0,39,1,40,1,41,5));const i=Vp(t);if(!i)throw new Error(Cp(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(Cp(0,21,1,2,1,7,1,12,5))})(t,e);break;default:throw new Error(Cp(0,21,1,2,1,6,1,7,1,8,1,9,1,11,1,10,5))}},jp=(t,e,i=!0)=>{let s;zp=!1,e instanceof ds?(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?Cp(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"},Yp=(t,e,i)=>{e?(t[Cp(-1,17)](Cp(-1,19),i),t[Cp(-1,17)](Cp(-1,20),i),t[Cp(-1,17)](Cp(-1,21),i),t[Cp(-1,17)](Cp(-1,22),i)):(t[Cp(-1,18)](Cp(-1,19),i),t[Cp(-1,18)](Cp(-1,20),i),t[Cp(-1,18)](Cp(-1,21),i),t[Cp(-1,18)](Cp(-1,22),i))},$p=(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)}))},Zp=t=>{const i=()=>{};let s,r,n;if(new mt.Image instanceof mt.HTMLImageElement){const t=new mt.Image;t.src=Sd,r=new od({source:t,fitMode:e.ImageFitMode.Stretch});const i=new mt.Image;i.src=xd,n=new od({source:i,fitMode:e.ImageFitMode.Stretch})}else if(mt.lcjs_setup){const t=new mt.Image;t.src=Sd;const i=mt.lcjs_setup(t.naturalWidth,t.naturalHeight);i.getContext("2d").drawImage(t,0,0),r=new od({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"!==Sd[3361]&&jp(Cp(0,36,1,38,5),t,!1),!0===e.JW&&"2"!==xd[571]&&jp(Cp(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(qp),h.rd.setTouchEndEventHandler(qp)),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)}}},qp=()=>mt.open("https://lightningchart.com/lightningchart-js/"),Kp=s.Record({color:A(255,255,255,50),spread:1,blur:4,offset:{x:0,y:0}});class Jp extends Kp{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 Qp=s.Record({gridStrokeLength:1,gridStrokeStyle:new tt,tickLength:7,tickStyle:new tt,tickPadding:0,labelFont:new Yi,labelFillStyle:new L,labelPadding:0,labelAlignment:0,labelRotation:0});class tm extends Qp{}class em extends tm{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 im=Object.assign(Object.create(new class extends tm{}),{}),sm=(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},rm=(t,e,i,...s)=>sm(-1,t,e,i,s),nm=(t,e,i,...s)=>sm(-1,t,e,i,s),om=(t,e,i,...s)=>sm(0,t,e,i,s),hm=(t,e,...i)=>sm(1,t,e,void 0,i),am=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},lm=[{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:rm("seconds",1,(t=>0===t.millis),"millis")},majorTicks:{fitFunction:Gi({ignore:"first"},5,10,15,30)},minorTicks:{amount:4,fitFunction:Gi(void 0,2)}},{label:"Minute",unit:6e4,irregular:!1,greatTicks:{getReferenceKeyValue:rm("minutes",1,(t=>0===t.seconds&&0===t.millis),"seconds","millis")},majorTicks:{fitFunction:Gi({ignore:"first"},5,10,15,30)},minorTicks:{amount:12,fitFunction:Gi(void 0,3,6)}},{label:"Hour",unit:36e5,irregular:!1,greatTicks:{getReferenceKeyValue:rm("hours",1,(t=>0===t.minutes&&0===t.seconds&&0===t.millis),"minutes","seconds","millis")},majorTicks:{fitFunction:Gi({ignore:"first"},3,6,12)},minorTicks:{amount:8,fitFunction:Gi(void 0,2,4)}},{label:"Day",unit:864e5,irregular:!1,greatTicks:{getReferenceKeyValue:rm("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:am(-1),getNextKeyValueIncludingRef:am(0),getNextKeyValue:am(1),greatTicks:!0,majorTicks:{fitFunction:Gi(void 0,2)},minorTicks:{fitFunction:void 0}},{label:"Month",unit:2592e6,irregular:!0,getPrevKeyValue:nm("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValueIncludingRef:om("monthIndex",1,(t=>1===t.day&&0===t.hours&&0===t.minutes&&0===t.seconds&&0===t.millis),"day","hours","minutes","seconds","millis"),getNextKeyValue:hm("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:nm("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: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"),getNextKeyValue:hm("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:nm("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: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"),getNextKeyValue:hm("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:nm("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: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"),getNextKeyValue:hm("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:nm("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: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"),getNextKeyValue:hm("year",1e3,"year","monthIndex","day","hours","minutes","seconds","millis"),greatTicks:!0,majorTicks:{fitFunction:void 0},minorTicks:void 0}],um=(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=um("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(lm.indexOf(o)<=lm.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]},dm=(t,e)=>(i,s,r,n)=>{const o=um(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 lm[lm.indexOf(t)+1]})(o);if(void 0===t)return[];h=zi(i,s,t.unit/o.minorTicks.amount,1)}}return h},fm=t=>(e,i,s,r,n,o)=>{const h=um(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},gm=s.Record({locale:void 0,dateOrigin:void 0,cursorFormatter:void 0,greatTickStyle:new em,majorTickStyle:new em,minorTickStyle:new em,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 pm extends gm{Bs(t){const e=void 0!==this.dateOrigin?this.dateOrigin.getTime():0,i=t=>lm.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=um(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[lm.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:dm("great",e),Ae:void 0},{Pi:"Major ticks",kg:1,qs:this.majorTickStyle,js:n("major"),_e:dm("major",e),os:{ie:fm("major")},Ae:void 0}];this.greatTickStyle!==im&&(o.push({Pi:"Great ticks (left)",qs:this.greatTickStyle.setLabelAlignment(-1),js:n("great","left"),_e:cm(e,"left"),Ci:!0,he:!1}),o.push({Pi:"Great ticks (right)",qs:this.greatTickStyle.setLabelAlignment(1),js:n("great","right"),_e:cm(e,"right"),Ci:!0,he:!1})),this.minorTickStyle!==im&&h.push({Pi:"Minor ticks",kg:2,qs:this.minorTickStyle,js:n("minor"),_e:dm("minor",e),os:{ie:fm("minor"),ls:(t,e,i,s,r,n)=>{const o=um("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!==im?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!==im?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 mm=(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)},ym=(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,xm=Gi(void 0,2,5),Sm=(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,vm=(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?vm(t.base,!0):mm(0,!0),os:"logarithmic"===t.type?void 0:{ie:ym},Ae:void 0}),this.minorTickStyle!==im&&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?vm(t.base,!1):mm(1,!1),os:"logarithmic"===t.type?{ie:Sm}:{ie:xm},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!==im?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!==im?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 Am=s.Record({cursorFormatter:void 0,timeOrigin:void 0,majorTickStyle:new em,minorTickStyle:new em}),km=(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"},wm={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}`}},Dm={MajorHours12:{major:{format:wm.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:wm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,36e5,1e6),fitKeyValues:Gi({},2,3,4,6)},defaultValueFormatter:wm.hhmmss},MajorHours:{major:{format:wm.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:wm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,3e5,1e6),fitKeyValues:Gi({},2,4,6)},defaultValueFormatter:wm.hhmmss},MajorMinutes15:{major:{format:wm.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:wm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,6e4,1e6),fitKeyValues:Gi({},3,5)},defaultValueFormatter:wm.hhmmss},MajorMinutes:{major:{format:wm.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:wm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,5e3,1e6),fitKeyValues:Gi({},2,3,4,6)},defaultValueFormatter:wm.hhmmss},MajorSeconds15:{major:{format:wm.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:wm.hhmmss,getKeyValues:(t,e,i,s)=>zi(t,e,1e3,1e6),fitKeyValues:Gi({},3,5)},defaultValueFormatter:wm.hhmmss},MajorSeconds:{major:{format:wm.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:wm.hhmmssmmm,getKeyValues:(t,e,i,s)=>zi(t,e,100,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.hhmmssmmm},MajorMilliseconds100:{major:{format:wm.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:wm.hhmmssmmm,getKeyValues:(t,e,i,s)=>zi(t,e,10,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.hhmmssmmm},MajorMilliseconds10:{major:{format:wm.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:wm.hhmmssmmm,getKeyValues:(t,e,i,s)=>zi(t,e,1,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.hhmmssmmm},MajorMilliseconds:{major:{format:wm.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:wm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>zi(t,e,.1,1e6),fitKeyValues:Gi({},2)},defaultValueFormatter:wm.hhmmssmmmuuu},MajorMicroseconds100:{major:{format:wm.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:wm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>zi(t,e,.01,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.hhmmssmmmuuu},MajorMicroseconds10:{major:{format:wm.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:wm.hhmmssmmmuuu,getKeyValues:(t,e,i,s)=>zi(t,e,.001,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.hhmmssmmmuuu},MajorMicroseconds:{major:{format:wm.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:wm.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>zi(t,e,100*1e-6,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.hhmmssmmmuuunnn},MajorNanoseconds100:{major:{format:wm.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:wm.hhmmssmmmuuunnn,getKeyValues:(t,e,i,s)=>zi(t,e,10*1e-6,1e6),fitKeyValues:Gi({},2,3,5)},defaultValueFormatter:wm.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 Em extends Am{Bs(t){const e=this.timeOrigin||0,i=[{Pi:"Major ticks",kg:0,qs:this.majorTickStyle,js:(t,i,s)=>{const r=km(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Dm[r].major.format)(t+e,i,s)},_e:(t,e,i,s)=>{const r=km(i,s);return(0,Dm[r].major.getKeyValues)(t,e,i,s)},os:{ie:(t,e,i,s,r,n)=>{const o=km(r,n),h=Dm[o].major.fitKeyValues;if(h)return h(t,e,i,s,r,n)}},Ae:void 0}];return this.minorTickStyle instanceof em&&i.push({Pi:"Minor ticks",kg:1,qs:this.minorTickStyle,js:(t,i,s)=>{const r=km(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return(0,Dm[r].minor.format)(t+e,i,s)},_e:(t,e,i,s)=>{const r=km(i,s);return(0,Dm[r].minor.getKeyValues)(t,e,i,s)},os:{ie:(t,e,i,s,r,n)=>{const o=km(r,n),h=Dm[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=km(Math.min(i.getInnerStart(),i.getInnerEnd()),Math.max(i.getInnerStart(),i.getInnerEnd()));return Dm[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!==im?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 Tm={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"}},Im={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"}},Cm={"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"}},Om={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"}},Fm={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"}},Rm={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"}},zm={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"}},_m={World:Fm,USA:Rm,NorthAmerica:Bm,SouthAmerica:zm,Canada:Pm,Europe:Om,Asia:Im,Africa:Tm,Australia:Cm},Lm={Solid:gl},Gm={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=>Vm([{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=>Vm([{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=>Vm([{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=>Vm([{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=>Vm([{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=>Vm([{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)},Vm=(t,e,i)=>{const s=Wm(e,i),[r,n]=Hm(s,t),o=Nm(t[r]),h=Nm(t[n]),a=0!==o.value?(h.value-s)/o.value:0,l={value:a,h:da(o.h,h.h,a),s:da(o.s,h.s,a),v:da(o.v,h.v,a)};return w(l.h,l.s,l.v)},Nm=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},Hm=(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 Yi({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=im,$=new em({gridStrokeStyle:F,tickStyle:R,tickLength:50,tickPadding:-14,labelFont:z,labelPadding:0,labelFillStyle:_}),Z=new em({gridStrokeStyle:G,tickStyle:V,tickLength:7,tickPadding:0,labelFont:N,labelPadding:0,labelFillStyle:W}),K=new em({gridStrokeStyle:H,tickStyle:U,tickLength:4,tickPadding:5,labelFont:X,labelPadding:0,labelFillStyle:j}),Q=new Mm({extremeTickStyle:Y,majorTickStyle:Z,minorTickStyle:K}),et=new pm({greatTickStyle:$,majorTickStyle:Z,minorTickStyle:K}),it=new Em({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 ts.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 ts.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}},Xm=(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},jm=(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}]})},Ym=(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}]})},$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 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}]})},Zm=(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}]})},qm=(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}]})},Km=ve((()=>{const t=A(255,255,255),i=new L({color:t}),s=!0,r=new Jp({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:jm(s,z,.5),pieChartSliceFillStylePalette:Ym(s,z,1),funnelChartSliceFillStylePalette:$m(s,z,1),pyramidChartSliceFillStylePalette:$m(s,z,1),rectangleSeriesFillStyle:Zm(s,z),gaugeChartGaugeFillStyle:qm(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 Um({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})})),Jm=ve((()=>{const t=A(255,255,255),i=new L({color:t}),s=!0,r=new Jp({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:jm(s,B,1),pieChartSliceFillStylePalette:Ym(s,B,1),funnelChartSliceFillStylePalette:$m(s,B,1),pyramidChartSliceFillStylePalette:$m(s,B,1),rectangleSeriesFillStyle:Zm(s,B),gaugeChartGaugeFillStyle:qm(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 Um({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!1,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new od({source:Xm(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})})),Qm=ve((()=>{const t=!1,i=new Jp({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:jm(t,R,.8),pieChartSliceFillStylePalette:Ym(t,R,.8),funnelChartSliceFillStylePalette:$m(t,R,.5),pyramidChartSliceFillStylePalette:$m(t,R,.5),rectangleSeriesFillStyle:Zm(t,R),gaugeChartGaugeFillStyle:qm(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 Um({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})})),ty=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:jm(t,F,.8),pieChartSliceFillStylePalette:Ym(t,F,.8),pyramidChartSliceFillStylePalette:$m(t,F,.5),funnelChartSliceFillStylePalette:$m(t,F,.5),rectangleSeriesFillStyle:Zm(t,F),gaugeChartGaugeFillStyle:qm(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 Um({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})})),ey=ve((()=>{const t=A(255,255,255),i=new L({color:t}),s=!0,r=new Jp({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:jm(s,B,.5),pieChartSliceFillStylePalette:Ym(s,B,2),funnelChartSliceFillStylePalette:$m(s,B,1),pyramidChartSliceFillStylePalette:$m(s,B,1),rectangleSeriesFillStyle:Zm(s,B),gaugeChartGaugeFillStyle:qm(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 Um({isDark:s,highlightColorOffset:A(60,60,60,60),highlightColorOffsetAxisOverlay:A(255,255,255,40),effect:r,effectsText:!0,effectsDashboardSplitters:!0,lcjsBackgroundFillStyle:t=>new od({source:Xm(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})})),iy={};Object.defineProperty(iy,"darkGold",{get:Km,enumerable:!0}),Object.defineProperty(iy,"turquoiseHexagon",{get:Jm,enumerable:!0}),Object.defineProperty(iy,"light",{get:Qm,enumerable:!0}),Object.defineProperty(iy,"lightNature",{get:ty,enumerable:!0}),Object.defineProperty(iy,"cyberSpace",{get:ey,enumerable:!0});const sy=iy,ry=sy.darkGold,ny=(t,e,i)=>s=>{const r={theme:ry,...i,...s},n=t(r),o=e?Zp(n):void 0,h=new md(n.Dh,s,n,n.G.bind(n),o);return n.hr((()=>h.wD())).er((()=>h.X())).Gi(),h},oy=(t,e)=>{t.hr((()=>{e.gc()})).er((()=>e.X())).Gi()},hy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new po(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o);return oy(n,h),h},ay=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new Dc(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,s);return oy(n,h),h},ly=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new Gl(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,s);return oy(n,h),h},uy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new Ya(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,s);return oy(n,h),h},cy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new(s&&s.type?s.type:Vo)(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return oy(n,h),h},dy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new(s&&s.type?s.type:gl)(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return oy(n,h),h},fy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new(s&&s.type?s.type:sl)(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,void 0,s&&s.disableAnimations);return oy(n,h),h},gy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new(s&&s.type?s.type:Ml)(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,void 0,!(!s||!s.disableAnimations));return oy(n,h),h},py=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new Jh(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,s,void 0);return oy(n,h),h},my=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new vh(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,void 0,s);return oy(n,h),h},yy=(t,e,i)=>s=>{const r={...i,...s,theme:(null==s?void 0:s.theme)||ry},n=t(r),o=e?Zp(n):void 0,h=new hd(n.Dh,Oc(n,1).KT(0),st,n.G.bind(n),o,void 0);return oy(n,h),h};let xy;const Sy={None:cn,Rectangle:xn,Circle:Sn,Diamond:vn,Pointer:bn},vy={Rectangle:xn,Circle:Sn,Diamond:vn},by={XY:Ia},My={XY:Ta,Spider:Gh,Map:Nh,Polar:Gh},Ay={None:dn,UIRectangle:xn,UICircle:Sn,UIDiamond:vn};e.Animation=H,e.AnimationEasings=W,e.Animator=U,e.AreaRangeSeries=nc,e.AreaSeries=Ju,e.AreaSeriesBipolar=ic,e.AreaSeriesMonopolar=Qu,e.AreaSeriesNegative=ec,e.AreaSeriesPositive=tc,e.AreaSeriesTypes=sc,e.AutoCursor2DBuilder=Bh,e.AutoCursorBuilders=My,e.AutoCursorXYBuilder=Da,e.AutoFitStrategies=Eh,e.AutoFitStrategy=kh,e.Axis=ho,e.Axis3D=qo,e.AxisScrollStrategies=Ci,e.AxisTickStrategies=Pi,e.Band=tn,e.BasicSeries=Na,e.BorderedPicture=gn,e.BoxAndWhiskers=Kl,e.BoxFigure=ql,e.BoxSeries=Zu,e.BoxSeries3D=nh,e.Button=Ln,e.Chart=yo,e.Chart3D=vh,e.ChartComponent=Jr,e.ChartMarker=Oa,e.ChartMarker2D=class extends Oa{constructor(t,e,i,s,r,n){super(t,e,i,s.bx(t,e,i,n),r,n)}},e.ChartMarkerXY=Ra,e.ChartWithCursor=Kh,e.ChartWithSeries=fh,e.ChartXY=Dc,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=Gm,e.ColorRGBA=A,e.ColorShadingStyles=sh,e.ConstantLine=en,e.CursorBuilder=Rh,e.CursorBuilderXY=wa,e.CustomTick=Zr,e.CustomizableFigure=$l,e.Dashboard=md,e.DashedLine=Lf,e.DataGrid=hd,e.DateTimeTickStrategy=pm,e.EllipseFigure=Iu,e.EllipseSeries=Cu,e.EmptyFill=R,e.EmptyPointMarker=dn,e.EmptyUIElement=un,e.Figure=jl,e.FigureSeries=Yl,e.FontSettings=Yi,e.FormattingFunctions=Ai,e.FunnelChart=tl,e.FunnelChartTypes=nl,e.FunnelChartWithLabelsInsideSlices=rl,e.FunnelChartWithLabelsOnSides=sl,e.FunnelSlice=Za,e.GaugeChart=al,e.GaugeChartTypes=Lm,e.GaugeSlice=ul,e.GenericAxis=Wi,e.GlowEffect=Jp,e.HeatmapGridSeries=lc,e.HeatmapGridSeriesIntensityValues=uc,e.HeatmapScrollingGridSeries=cc,e.HeatmapScrollingGridSeriesIntensityValues=dc,e.Highlighter=Qr,e.Icon=sd,e.ImageFill=od,e.IndividualPointFill=G,e.LUT=O,e.LegendBoxBuilders=so,e.LineAndPointSeries3D=oh,e.LineSeries=Mu,e.LineSeries3D=hh,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=Jh,e.MapRegions=_m,e.MapRegionsAfrica=Tm,e.MapRegionsAsia=Im,e.MapRegionsAustralia=Cm,e.MapRegionsCanada=Pm,e.MapRegionsEurope=Om,e.MapRegionsNorthAmerica=Bm,e.MapRegionsSouthAmerica=zm,e.MapRegionsUSA=Rm,e.MapRegionsWorld=Fm,e.MapTypes=Hh,e.MarkerBuilders=by,e.NumericTickStrategy=Mm,e.OHLCBar=tu,e.OHLCCandleStick=Ql,e.OHLCFigure=Jl,e.OHLCFigures=eu,e.OHLCSeries=Uu,e.OHLCSeriesTraditional=Xu,e.OHLCSeriesTypes=Yu,e.OHLCSeriesWithAutomaticPacking=ju,e.OnScreenMenu=hc,e.OnScreenMenuAnimationsButton=br,e.OnScreenMenuButton=fr,e.OnScreenMenuControlBase=Qs,e.OnScreenMenuCustomButton=Ar,e.OnScreenMenuOsmToggleButton=kr,e.OnScreenMenuToggleButton=gr,e.OnScreenMenuZoomInButton=pr,e.OnScreenMenuZoomInXButton=mr,e.OnScreenMenuZoomInYButton=yr,e.OnScreenMenuZoomOutButton=xr,e.OnScreenMenuZoomOutXButton=Sr,e.OnScreenMenuZoomOutYButton=vr,e.OnScreenMenuZoomToFitButton=Mr,e.PalettedFill=N,e.Panel=fo,e.PhongShadingStyle=eh,e.Picture=fn,e.PieChart=Io,e.PieChartTypes=Wo,e.PieChartWithLabelsInsideSlices=No,e.PieChartWithLabelsOnSides=Vo,e.PieSlice=ko,e.PixelatedPoints3D=Qi,e.PointCloudSeries3D=ch,e.PointLineSeries=ou,e.PointLineSeries3D=ah,e.PointMarkers=Ay,e.PointSeries=oc,e.PointSeries3D=uh,e.PointSeriesTypes3D=dh,e.PointStyle3D=ts,e.PolarAreaSeries=Ua,e.PolarAreaSeriesInterior=Xa,e.PolarAxis=ea,e.PolarAxisAmplitude=sa,e.PolarAxisTick=ia,e.PolarChart=Ya,e.PolarLineSeries=xa,e.PolarPointLineSeries=Sa,e.PolarPointSeries=va,e.PolarPolygon=ba,e.PolarPolygonSeries=Ha,e.PolarSector=aa,e.PolarSeries=ua,e.PolygonFigure=wu,e.PolygonSeries=Du,e.PyramidChart=Sl,e.PyramidChartTypes=kl,e.PyramidChartWithLabelsInsideSlices=Al,e.PyramidChartWithLabelsOnSides=Ml,e.PyramidSlice=pl,e.RadialGauge=ll,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=qu,e.RectangleFigure=Au,e.RectangleSeries=ku,e.SegmentFigure=Eu,e.SegmentSeries=Tu,e.Series2D=la,e.Series3D=rh,e.SeriesMarkerXY=Ba,e.SeriesXY=za,e.SimpleFigureSeries=Zl,e.SimpleShadingStyle=Qo,e.Slice=Mo,e.SliceLabelFormatters=bo,e.SliceSorters=vo,e.SolidFill=L,e.SolidFillPalette=(t,e,i)=>{const s=t(e,i);return t=>new L({color:s(t)})},e.SolidGauge=gl,e.SolidGaugeSlice=cl,e.SolidLine=tt,e.SpiderAxis=Il,e.SpiderChart=Gl,e.SpiderSeries=Pl,e.SplineSeries=lu,e.StaticCursor2DBuilder=zh,e.StaticCursorXYBuilder=Ea,e.StepSeries=bu,e.StipplePatterns=zf,e.SurfaceGridSeries3D=xh,e.SurfaceScrollingGridSeries3D=Sh,e.TableContentBuilder=Th,e.Themes=sy,e.Tick=ro,e.TickStyle=tm,e.TimeFormattingFunctions=wm,e.TimeTickStrategy=Em,e.TriangulatedPoints3D=Ki,e.UIBackgrounds=Sy,e.UIButtonPictures=vy,e.UICircle=Sn,e.UIColumnGrid=class extends kn{constructor(){super(...arguments),this.Hu=[]}addColumn(){return this.addElement(In,void 0)}getColumn(t,e=!1){return e&&this.Hu.length<=t?(this.addColumn(),this.getColumn(t,!0)):this.Hu[t]}},e.UIDiamond=vn,e.UIElementBuilders=io,e.UIElementColumn=wn,e.UIElementLine=An,e.UIElementRow=kn,e.UIElementWithBackground=Yr,e.UIEmptyBackground=cn,e.UILabel=mn,e.UILayoutBuilders=bh,e.UILayoutGap=Mn,e.UILegendBoxPanel=Mh,e.UIObject=Wr,e.UIOrigins=Dr,e.UIPanel=po,e.UIPointer=bn,e.UIPolygon=pn,e.UIRectangle=xn,e.UIRowGrid=En,e.VisibleFill=_,e.VisibleTicks=em,e.ZoomBandChart=Pc,e.defaultOsmBackgroundColor=Rr,e.disableThemeEffects=t=>({...t,effect:void 0}),e.emptyFill=B,e.emptyLine=J,e.emptyPoints3D=Zi,e.emptyTick=im,e.formatLongitudeLatitude=ta,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 Bp;return n.e=i||"",xy||(xy=(t=>{let e,i,s=!1,r=!1,n=!1,o=!1,h="";try{if(Pp){const e=(t=>{if(!Pp)return;const e=Pp.split("-");if(e.length>0)switch(e[0]){case"0001":return"0001";case"0002":return"0002";default:return}})();if("0001"===e){Rp=new Uint8Array([2]);const e=(t=>{if(!Pp)return;const e=Pp.split("-");return 4===e.length?e[1].startsWith("m")?2:1:0})();1===e?(n=!Up(Pp),s=!0):2===e?(Xp(Pp,t),r=!0):(zp=!0,Np(Pp),o=!0)}else{if("0002"!==e)throw new Error(Cp(0,0,1,7,1,12,5));{const e=(t=>{if(!Pp)return;const e=Pp.split("-");return e.length>=2?Uint8Array.from(atob(e[1]),(t=>t.charCodeAt(0)))[0]:void 0})();if(104===e)zp=!0,Np(Pp),o=!0;else if(189===e)n=!Up(Pp),s=!0;else{if(159!==e)throw new Error(Cp(0,0,1,7,1,12,5));Xp(Pp,t),r=!0}}}}else Fp=!0}catch(t){t instanceof Error&&(e=t)}try{o&&(i=Ip[Cp(-1,34)][Cp(-1,35)](Cp(-1,39))||void 0)}catch(t){Ip.console.error(t)}let a=!1;if(i){const t=i.split("-");if(2===t.length&&Hp(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||Fp||s||r||a),u=(()=>{const t=new(Ip[Cp(-1,0)]);return t.open(Cp(0,26),Cp(-2,0)),t.setRequestHeader(Cp(-1,24),Cp(-1,25)),t.withCredentials=!0,t})();if(l){let t;try{t=parseInt(Pp?Pp.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="";Pp=Pp||"";const a=Cp(-4,0);for(let t=0;t{if(e)throw jp(e.message,t),e;const s={Ph:t=>{const e=`${Cp(0,40,1,42,1,43,1,44,1,45,1,46,1,47,1)}${(t=>{switch(t){case 1:return Cp(0,48,49);case 0:return Cp(0,48,50);case 2:return Cp(0,51);case 3:return Cp(0,52,48);case 4:return Cp(0,53,48);case 5:return Cp(0,54,48);case 6:return Cp(0,55,48);case 7:return Cp(0,56,48);case 8:return Cp(0,57,48);case 9:return Cp(0,58,48)}return xe(0,"")})(t)}`;throw jp(e,r,!1),new Error(e)},...Op},r=new Zg(t,s),o=t=>{if("error"===(null==t?void 0:t.type)&&i){const t=i.split("-");if(2===t.length&&Hp(t[0],t[1])){const[,e]=t[0].split(":").map((t=>Number(t)));if(e+9e5>Date.now())return zp=!1,void Yp(u,!1,a)}}if(u.readyState===Ip[Cp(-1,0)].DONE){if(200!==u.status){let e="";try{e=t&&"loadend"!==t.type?Cp(0,0,1,23,1,32,1,24,5):JSON.parse(u[Cp(-1,23)]).message,Yp(u,!1,a)}catch(t){console.error(t)}throw jp(e,r),new Error(Cp(0,0,1,2,1,7,1,12,5)+e)}{const t=JSON.parse(u[Cp(-1,23)]);if(!Hp(h+Cp(-3,0),t.h)){const t=Cp(0,0,1,27,1,28,1,29,1,30,1,31,5);throw jp(t,r),new Error(t)}Ip[Cp(-1,34)][Cp(-1,36)](Cp(-1,39),t.t),Ip[Cp(-1,34)][Cp(-1,36)](Cp(-1,33),t.s),zp=!1}}},a=t=>{o(t)};return Yp(u,!0,a),l?setTimeout((()=>{if(zp){let t=!0;if(i){const e=i.split("-");if(2===e.length&&Hp(e[0],e[1])){const[,i]=e[0].split(":").map((t=>Number(t)));i+9e5>Date.now()&&(t=!1)}}t&&jp(Cp(0,25,1,23,1,32,1,24,5),r)}}),1e4):Yp(u,!1,a),n?(t=>{let e;zp=!1;const i=t.$t(),s=()=>{e&&(t.uh(e.lh()),e=void 0),e=t.jT("deployment test"),e.ye(t.ut).Ms(Cp(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:ny(t,e,i),ChartXY:ay(t,e,i),Spider:ly(t,e,i),Polar:uy(t,e,i),Pie:cy(t,e,i),UIPanel:hy(t,e,i),Gauge:dy(t,e,i),Funnel:fy(t,e,i),Pyramid:gy(t,e,i),Chart3D:my(t,e,i),Map:py(t,e,i),DataGrid:yy(t,e,i)}))(xy,n.e,r)},e.onScreenMenuControlBaseHeight=Ir,e.onScreenMenuControlBaseWidth=Cr,e.onScreenMenuControlOpacity=Pr,e.onScreenMenuDefaultButtonShape=Fr,e.onScreenMenuSpriteURL=Or,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=lo,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=Er,e.transparentLine=Tr,e.vec3Utils=Ae,e.xDimensionStrategy=Vl,e.yDimensionStrategy=Nl}}]); \ No newline at end of file diff --git a/js/vendor.ba735447f654cc2bc66a.bundle.js.LICENSE.txt b/js/vendor.d5b823ef9298b75f3c38.bundle.js.LICENSE.txt similarity index 100% rename from js/vendor.ba735447f654cc2bc66a.bundle.js.LICENSE.txt rename to js/vendor.d5b823ef9298b75f3c38.bundle.js.LICENSE.txt