@eclipse-scout/chart 23.1.19 → 23.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/d.ts/chart/AbstractChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/Chart.d.ts +1 -1
- package/dist/d.ts/chart/Chart.d.ts.map +1 -1
- package/dist/d.ts/chart/ChartJsRenderer.d.ts +8 -8
- package/dist/d.ts/chart/ChartJsRenderer.d.ts.map +1 -1
- package/dist/d.ts/chart/VennChartRenderer.d.ts.map +1 -1
- package/dist/d.ts/table/controls/ChartTableControl.d.ts +1 -0
- package/dist/d.ts/table/controls/ChartTableControl.d.ts.map +1 -1
- package/dist/eclipse-scout-chart-7bef43c691398f0f5930.min.js +3 -0
- package/dist/eclipse-scout-chart-7bef43c691398f0f5930.min.js.map +1 -0
- package/dist/eclipse-scout-chart-theme-dark.css +1 -1
- package/dist/eclipse-scout-chart-theme-dark.css.map +1 -1
- package/dist/eclipse-scout-chart-theme.css +1 -1
- package/dist/eclipse-scout-chart-theme.css.map +1 -1
- package/dist/eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js +3 -0
- package/dist/eclipse-scout-chart.esm-cf2a1f4f475648b72788.min.js.map +1 -0
- package/dist/eclipse-scout-chart.esm.js +88 -40
- package/dist/eclipse-scout-chart.esm.js.map +1 -1
- package/dist/eclipse-scout-chart.js +90 -40
- package/dist/eclipse-scout-chart.js.map +1 -1
- package/dist/file-list +4 -4
- package/package.json +6 -6
- package/src/chart/AbstractChartRenderer.ts +2 -2
- package/src/chart/Chart.ts +1 -1
- package/src/chart/ChartJsRenderer.ts +81 -39
- package/src/chart/FulfillmentChartRenderer.ts +3 -3
- package/src/chart/SalesfunnelChartRenderer.ts +3 -3
- package/src/chart/VennChartRenderer.ts +4 -3
- package/src/table/controls/ChartTableControl.ts +9 -4
- package/dist/eclipse-scout-chart-c0371fbf62b6717784f4.min.js +0 -3
- package/dist/eclipse-scout-chart-c0371fbf62b6717784f4.min.js.map +0 -1
- package/dist/eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js +0 -3
- package/dist/eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js.map +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import*as R from"@eclipse-scout/core";import*as Pe from"chart.js";import"chart.js/auto";import*as je from"chartjs-plugin-datalabels";var M={};M.n=n=>{var e=n&&n.__esModule?()=>n.default:()=>n;return M.d(e,{a:e}),e},M.d=(n,e)=>{for(var t in e)M.o(e,t)&&!M.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},M.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e),M.r=n=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})};var S={};M.r(S),M.d(S,{AbstractChartRenderer:()=>ne,AbstractSvgChartRenderer:()=>D,Chart:()=>u,ChartAdapter:()=>Ee,ChartField:()=>Ie,ChartFieldAdapter:()=>we,ChartFieldTile:()=>He,ChartFieldTileAdapter:()=>Ne,ChartJsRenderer:()=>X,ChartLayout:()=>be,ChartTableControl:()=>Q,ChartTableControlAdapter:()=>Fe,ChartTableControlLayout:()=>Re,ChartTableUserFilter:()=>z,FulfillmentChartRenderer:()=>xe,SalesfunnelChartRenderer:()=>Te,SpeedoChartRenderer:()=>x,VennAsync3Calculator:()=>Ae,VennChartRenderer:()=>Be,VennCircle:()=>W,VennCircleHelper:()=>ve,chartJsDateAdapter:()=>ye,default:()=>Ge});var le={};M.r(le),M.d(le,{AbstractChartRenderer:()=>ne,AbstractSvgChartRenderer:()=>D,Chart:()=>u,ChartAdapter:()=>Ee,ChartField:()=>Ie,ChartFieldAdapter:()=>we,ChartFieldTile:()=>He,ChartFieldTileAdapter:()=>Ne,ChartJsRenderer:()=>X,ChartLayout:()=>be,ChartTableControl:()=>Q,ChartTableControlAdapter:()=>Fe,ChartTableControlLayout:()=>Re,ChartTableUserFilter:()=>z,FulfillmentChartRenderer:()=>xe,SalesfunnelChartRenderer:()=>Te,SpeedoChartRenderer:()=>x,VennAsync3Calculator:()=>Ae,VennChartRenderer:()=>Be,VennCircle:()=>W,VennCircleHelper:()=>ve,chartJsDateAdapter:()=>ye,default:()=>Ge});var Ue=n=>{var e={};return M.d(e,n),e},sr=n=>()=>n;const o=Ue({AbstractLayout:()=>R.AbstractLayout,DateColumn:()=>R.DateColumn,DateFormat:()=>R.DateFormat,FormField:()=>R.FormField,FormFieldAdapter:()=>R.FormFieldAdapter,FormFieldTile:()=>R.FormFieldTile,FormFieldTileAdapter:()=>R.FormFieldTileAdapter,HtmlComponent:()=>R.HtmlComponent,Icon:()=>R.Icon,ModelAdapter:()=>R.ModelAdapter,NumberColumn:()=>R.NumberColumn,ObjectFactory:()=>R.ObjectFactory,Point:()=>R.Point,RoundingMode:()=>R.RoundingMode,TableControl:()=>R.TableControl,TableControlAdapter:()=>R.TableControlAdapter,TableMatrix:()=>R.TableMatrix,TableUserFilter:()=>R.TableUserFilter,Tooltip:()=>R.Tooltip,Widget:()=>R.Widget,arrays:()=>R.arrays,colorSchemes:()=>R.colorSchemes,dates:()=>R.dates,graphics:()=>R.graphics,icons:()=>R.icons,numbers:()=>R.numbers,objects:()=>R.objects,scout:()=>R.scout,scrollbars:()=>R.scrollbars,strings:()=>R.strings,styles:()=>R.styles,tooltips:()=>R.tooltips}),We=require("jquery");var C=M.n(We);function I(n,e,t){return e=ze(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ze(n){var e=Xe(n,"string");return typeof e=="symbol"?e:String(e)}function Xe(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class u extends o.Widget{constructor(){super(),I(this,"data",void 0),I(this,"config",void 0),I(this,"checkedItems",void 0),I(this,"chartRenderer",void 0),I(this,"_updatedOnce",void 0),I(this,"_updateChartTimeoutId",void 0),I(this,"_updateChartOpts",void 0),I(this,"_updateChartOptsWhileNotAttached",void 0),this.$container=null,this.data=null,this.config=null,this.checkedItems=[],this.chartRenderer=null,this._updateChartTimeoutId=null,this._updateChartOpts=null,this._updateChartOptsWhileNotAttached=[],this._updatedOnce=!1}_init(e){super._init(e),this.setConfig(this.config),this._setData(this.data)}_render(){this.$container=this.$parent.appendDiv("chart"),this.htmlComp=o.HtmlComponent.install(this.$container,this.session),this.htmlComp.setLayout(new be(this))}_renderProperties(){super._renderProperties(),this._renderClickable(),this._renderCheckable(),this._renderChartType(),this._renderColorScheme(),this.updateChart({requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT})}_renderOnAttach(){super._renderOnAttach(),this._updateChartOptsWhileNotAttached.splice(0).forEach(e=>this.updateChart(C().extend(!0,{},e,{debounce:!0})))}_remove(){this.chartRenderer&&this.chartRenderer.remove(!1),this.$container.remove(),this.$container=null}setData(e){this.setProperty("data",e),this.setCheckedItems(this.checkedItems)}_setData(e){e&&(e=C().extend({axes:[]},e)),this._setProperty("data",e)}_renderData(){this.updateChart({requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT,onlyUpdateData:!0})}setConfig(e){let t={type:u.Type.PIE,options:{autoColor:!0,colorScheme:o.colorSchemes.ColorSchemeId.DEFAULT,transparent:!1,maxSegments:5,adjustGridMaxMin:!0,clickable:!1,checkable:!1,animation:{duration:u.DEFAULT_ANIMATION_DURATION},plugins:{datalabels:{display:!1},tooltip:{enabled:!0},legend:{display:!0,clickable:!1,position:u.Position.RIGHT}}}};if(e=C().extend(!0,{},t,e),e.options.colorScheme=o.colorSchemes.ensureColorScheme(e.options.colorScheme),o.objects.equalsRecursive(this.config,e))return;let r=C().extend(!0,{},this.config);e.data?r.data=e.data:delete r.data;let a=(i,s,l)=>{if(!(!i||!s||!l)){if(!i.options||!i.options[l]){s.options&&delete s.options[l],s.options&&o.objects.isEmpty(s.options.scales)&&!(i.options&&i.options.scales)&&delete s.options.scales,o.objects.isEmpty(s.options)&&!i.options&&delete s.options;return}s.options[l]=i.options[l]}};if(a(e,r,"xLabelMap"),a(e,r,"yLabelMap"),o.objects.equalsRecursive(r,e)){this._setProperty("config",e),this.rendered&&this._renderConfig(!0),this.setCheckedItems(this.checkedItems);return}this.rendered&&this.config&&this.config.type&&this.$container.removeClass(this.config.type+"-chart"),this.setProperty("config",e),this.setCheckedItems(this.checkedItems),this._updateChartRenderer()}_renderConfig(e){this._renderClickable(),this._renderCheckable(),this._renderChartType(),this._renderColorScheme(),this.updateChart({requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT,onlyUpdateData:e})}setCheckedItems(e){this.setProperty("checkedItems",o.arrays.ensure(this._filterCheckedItems(e)))}_filterCheckedItems(e){if(!Array.isArray(e))return e;let t=[];this.data&&this.data.chartValueGroups?this.data.chartValueGroups.forEach(a=>t.push(a.values.length)):this.config&&this.config.data&&this.config.data.datasets.forEach(a=>t.push(a.data.length));let r=e.filter(a=>t[a.datasetIndex]&&a.dataIndex<t[a.datasetIndex]);return r.length<e.length?r:e}_renderCheckedItems(){this.chartRenderer&&this.chartRenderer.renderCheckedItems()}_renderEnabled(){this.updateChart()}_renderClickable(){this.$container.toggleClass("clickable",this.config.options.clickable)}_renderCheckable(){this.$container.toggleClass("checkable",this.config.options.checkable)}_renderChartType(){this.$container.addClass(this.config.type+"-chart")}_renderColorScheme(){o.colorSchemes.toggleColorSchemeClasses(this.$container,this.config.options.colorScheme)}updateChart(e){e=e||{},e.onlyUpdateData=e.onlyUpdateData&&this.chartRenderer&&this.chartRenderer.isDataUpdatable(),e.enforceRerender=!e.onlyUpdateData&&!e.onlyRefresh,this._updateChartTimeoutId&&(clearTimeout(this._updateChartTimeoutId),this._updateChartOpts&&(e.requestAnimation=e.requestAnimation||this._updateChartOpts.requestAnimation,e.onlyUpdateData=e.onlyUpdateData||this._updateChartOpts.onlyUpdateData,e.onlyRefresh=e.onlyRefresh||this._updateChartOpts.onlyRefresh,e.enforceRerender=e.enforceRerender||this._updateChartOpts.enforceRerender),this._updateChartTimeoutId=null,this._updateChartOpts=null);let t=a.bind(this);e.debounce===!0||typeof e.debounce=="number"?(this._updateChartOpts=e,typeof e.debounce=="number"?this._updateChartTimeoutId=setTimeout(t,e.debounce):this._updateChartTimeoutId=setTimeout(t)):t();function a(){if(this._updateChartTimeoutId=null,this._updateChartOpts=null,!this.$container||!this.$container.isAttached()){this._updateChartOptsWhileNotAttached.push(e);return}this._updatedOnce=!0,this.chartRenderer&&(e.enforceRerender?this.chartRenderer.remove(this.chartRenderer.shouldAnimateRemoveOnUpdate(e),i=>{this.removing||i||(this.chartRenderer.render(e.requestAnimation),this.trigger("chartRender"))}):e.onlyUpdateData?this.chartRenderer.updateData(e.requestAnimation):e.onlyRefresh&&this.chartRenderer.refresh())}}_resolveChartRenderer(){switch(this.config.type){case u.Type.FULFILLMENT:return new xe(this);case u.Type.SPEEDO:return new x(this);case u.Type.SALESFUNNEL:return new Te(this);case u.Type.VENN:return new Be(this);case u.Type.BAR:case u.Type.BAR_HORIZONTAL:case u.Type.LINE:case u.Type.COMBO_BAR_LINE:case u.Type.PIE:case u.Type.DOUGHNUT:case u.Type.POLAR_AREA:case u.Type.RADAR:case u.Type.BUBBLE:case u.Type.SCATTER:return new X(this)}return null}_updateChartRenderer(){this.chartRenderer&&this.chartRenderer.remove(),this.setProperty("chartRenderer",this._resolveChartRenderer())}handleValueClick(e,t){if(this.config.options.checkable){let r=[...this.checkedItems],a=r.filter(i=>i.datasetIndex===e.datasetIndex&&i.dataIndex===e.dataIndex)[0];a?o.arrays.remove(r,a):r.push(e),this.setCheckedItems(r)}this.trigger("valueClick",{data:e,originalEvent:t})}}I(u,"Type",{PIE:"pie",LINE:"line",BAR:"bar",BAR_HORIZONTAL:"horizontalBar",COMBO_BAR_LINE:"comboBarLine",FULFILLMENT:"fulfillment",SPEEDO:"speedo",SALESFUNNEL:"salesfunnel",VENN:"venn",DOUGHNUT:"doughnut",POLAR_AREA:"polarArea",RADAR:"radar",BUBBLE:"bubble",SCATTER:"scatter"}),I(u,"Position",{TOP:"top",BOTTOM:"bottom",LEFT:"left",RIGHT:"right",CENTER:"center"}),I(u,"DEFAULT_ANIMATION_DURATION",600),I(u,"DEFAULT_DEBOUNCE_TIMEOUT",100);class Ee extends o.ModelAdapter{_onWidgetValueClick(e){this._send("valueClick",e.data)}_onWidgetEvent(e){e.type==="valueClick"?this._onWidgetValueClick(e):super._onWidgetEvent(e)}}function Ye(n,e,t){return e=Je(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Je(n){var e=qe(n,"string");return typeof e=="symbol"?e:String(e)}function qe(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class be extends o.AbstractLayout{constructor(e){super(),Ye(this,"chart",void 0),this.chart=e}layout(e){let t={requestAnimation:!0,debounce:u.DEFAULT_DEBOUNCE_TIMEOUT,onlyUpdateData:!0};(!this.chart.session.ready||this.chart._updatedOnce)&&(t.requestAnimation=!1),this.chart.session.ready||(t.debounce=!1),this.chart.updateChart(t)}}function te(n,e,t){return e=Ke(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ke(n){var e=Ze(n,"string");return typeof e=="symbol"?e:String(e)}function Ze(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ne{constructor(e){te(this,"chart",void 0),te(this,"session",void 0),te(this,"rendering",void 0),te(this,"rendered",void 0),te(this,"animationDuration",void 0),te(this,"firstOpaqueBackgroundColor",void 0),this.chart=e,this.session=e.session,this.rendering=!1,this.rendered=!1,this.animationDuration=0,this.firstOpaqueBackgroundColor=""}validate(){return this._validateChartData()?this._validate():!1}_validateChartData(){let e=this.chart&&this.chart.data;if(!e||!e.chartValueGroups||e.chartValueGroups.length===0)return!1;let t,r=0;for(t=0;t<e.chartValueGroups.length;t++){let a=e.chartValueGroups[t];if(!a.values)return!1;if(t===0)r=a.values.length;else if(a.values.length!==r)return!1;if(!this.chart.config.options.autoColor&&!a.colorHexValue&&!a.cssClass)return!1}for(t=0;t<e.axes.length;t++)if(e.axes[t].length!==r)return!1;return!0}_validate(){return!0}render(e){this.animationDuration=e?this.chart.config.options.animation.duration:0,!(!this.validate()||!this.chart.rendered)&&(this.rendering=!0,this._render(),this.rendering=!1,this.rendered=!0)}_render(){}renderCheckedItems(){this.rendered&&this._renderCheckedItems()}_renderCheckedItems(){}updateData(e){if(!this.rendered){this.render(e);return}this.animationDuration=e?this.chart.config.options.animation.duration:0,!(!this.validate()||!this.isDataUpdatable())&&this._updateData()}_updateData(){}isDataUpdatable(){return!1}refresh(){this.rendered&&this.remove(!1),this.render(!1)}remove(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1?arguments[1]:void 0;this.animationDuration=e&&this.chart.config.options.animation.duration,this.animationDuration&&this.rendered?this._removeAnimated(t):this._remove(t)}_remove(e){this.rendered=!1,e&&e()}_removeAnimated(e){this._remove(e)}shouldAnimateRemoveOnUpdate(e){return e.requestAnimation}}function w(n,e,t){return e=Qe(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qe(n){var e=et(n,"string");return typeof e=="symbol"?e:String(e)}function et(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class D extends ne{constructor(e){super(e),w(this,"chartBox",void 0),w(this,"clipId",void 0),w(this,"maskId",void 0),w(this,"suppressLegendBox",void 0),w(this,"height",void 0),w(this,"width",void 0),w(this,"chartAnimationStopping",void 0),w(this,"$svg",void 0),this.chartBox=null,this.clipId="Clip-"+o.ObjectFactory.get().createUniqueId(),this.maskId="Mask-"+o.ObjectFactory.get().createUniqueId(),this.suppressLegendBox=!1}_render(){this.$svg||(this.$svg=this.chart.$container.appendSVG("svg","chart-svg")),this.firstOpaqueBackgroundColor=o.styles.getFirstOpaqueBackgroundColor(this.$svg),this.height=this.$svg.height(),this.width=this.$svg.width(),this._initChartBox(),this._useFontSizeBig()?this.$svg.addClass(D.FONT_SIZE_BIG):this._useFontSizeMiddle()?this.$svg.addClass(D.FONT_SIZE_MIDDLE):this._useFontSizeSmall()?this.$svg.addClass(D.FONT_SIZE_SMALL):this._useFontSizeSmallest()&&this.$svg.addClass(D.FONT_SIZE_SMALLEST),this.$svg.isAttached()&&this._renderInternal()}_renderInternal(){}_useFontSizeBig(){return!1}_useFontSizeMiddle(){return!1}_useFontSizeSmall(){return!1}_useFontSizeSmallest(){return!1}remove(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1?arguments[1]:void 0;this.rendered&&!this.chartAnimationStopping&&(this.chartAnimationStopping=!0,this.$svg.children().stop(!0,!1),this.chartAnimationStopping=!1),super.remove(e,t)}_remove(e){this.rendered&&(this.$svg.children().stop(!0,!1),this.rendered&&(this.$svg.remove(),this.$svg=null)),this.rendered=!1,e&&e(this.chartAnimationStopping)}_createClickObject(e,t){return{xIndex:e,dataIndex:e,datasetIndex:t}}_measureText(e,t){let r=this.$svg.appendSVG("text",t).attr("x",0).attr("y",0).attr("visibility","hidden").text(e),a;try{a=r[0].getBBox()}catch{return{height:0,width:0}}return r.remove(),a}_renderLine(e,t,r,a,i){let s=this.$svg.appendSVG("line",i).attr("x1",e).attr("y1",t).attr("x2",r).attr("y2",a);return this.animationDuration&&s.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0),s}_renderLineLabel(e,t,r,a,i){let s=this.$svg.appendSVG("text",a||"line-label").attr("x",e).attr("y",t).text(r);if(i){s.attr("mask","url(#"+this.maskId+")");let l=this.$svg.appendSVG("text",a?a+" background":"line-label-background").attr("x",e).attr("y",t).attr("clip-path","url(#"+this.clipId+")").text(r);s.data("$background",l),this.animationDuration&&l.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}return this.animationDuration&&s.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0),s}_initChartBox(){this.chartBox={width:this.width,height:this.height,xOffset:0,yOffset:0,mX:function(){return this.xOffset+this.width/2},mY:function(){return this.yOffset+this.height/2}}}_createAnimationObjectWithTabIndexRemoval(e,t){return{step:function(r,a){try{e.bind(this)(r,a)}catch(i){throw C()(this).stop(!0,!1),i}},duration:t||u.DEFAULT_ANIMATION_DURATION,complete:function(){C()(this).removeAttr("tabindex")}}}_addClipping(e){let t=this.$svg.appendSVG("clipPath");t[0].id=this.clipId;let r=this.$svg.appendSVG("mask");r.appendSVG("rect").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("fill","white"),r[0].id=this.maskId,this.chart.$container.find("."+e).each(function(a){this.id="ClipMask-"+o.ObjectFactory.get().createUniqueId(),t.appendSVG("use").attrXLINK("href","#"+this.id),r.appendSVG("use").attrXLINK("href","#"+this.id)})}_renderWireLegend(e,t,r,a){if(!this.chart.config.options.plugins.tooltip.enabled)return{detachFunc:()=>{},attachFunc:()=>{},removeFunc:()=>{}};let i={},s=5,l,d=0,h=17,c=h;a&&(l=this.$svg.appendSVG("rect","wire-legend-background-box").attr("opacity","1"));let p=t,f,m=0,y=0;if(p.h===-1?y=p.x2-2*s:y=this.width-p.x2-2*s,Array.isArray(e))for(let g=0;g<e.length;g++){let T=e.length-g-1,v=p.y2+p.v*s-h*T-s*T,B=this._renderLineLabel(p.x2+s,v,o.strings.truncateText(e[g],y,this._measureText.bind(this)),"",a);B.addClass(r),m=Math.max(m,B[0].getComputedTextLength()),g===0?f=B:f.data("lines")?f.data("lines").push(B):f.data("lines",[B])}else f=this._renderLineLabel(p.x2+s,p.y2+p.v*s,o.strings.truncateText(e,y,this._measureText.bind(this)),"",a),f.addClass(r),m=f[0].getComputedTextLength();if(d=m+2*s,t.autoPosition&&(p=t.posFunc.call(this,d,c),f.attr("x",p.x2+s),f.attr("y",p.y2+p.v*s)),p.h===-1?(f.attr("x",p.x2-s-m),f.css("text-anchor","left"),f.data("lines")&&f.data("lines").forEach(g=>{g.attr("x",p.x2-s-m),g.css("text-anchor","left")})):(f.attr("x",p.x2+s),f.css("text-anchor","right"),f.data("lines")&&f.data("lines").forEach(g=>{g.attr("x",p.x2+s),g.css("text-anchor","right")})),p.v===1)f.data("lines")&&f.data("lines").forEach((g,T)=>{g.attr("y",p.x2-s-m);let v=1+T;g.attr("y",p.y2+p.v*s+h*v+s*(v+1))}),f.attr("dy","0.7em");else if(f.data("lines")){let g=f.data("lines").length;f.attr("y",p.y2+p.v*s-h*g-s*g),f.data("lines").forEach((T,v)=>{g=f.data("lines").length-1-v,T.attr("y",p.y2+p.v*s-h*g-s*g)})}f.add(f.data("lines")).each((g,T)=>{let v=C()(T),B=v.data("$background");B&&(B.attr("x",v.attr("x")),B.attr("y",v.attr("y")),B.css("text-anchor",v.css("text-anchor")),B.attr("dy",v.attr("dy")))});let _=[];p.x1>0&&p.y1>0&&(_.push(this._renderLine(p.x1,p.y1,p.x2,p.y2,"label-line")),_.push(this._renderLine(p.x2,p.y2,p.x2+p.h*(m+2*s),p.y2,"label-line"))),f.data("wires",_);let b=this.$svg;return i.detachFunc=()=>{f.data("wires").forEach(g=>{g.detach()}),f.data("lines")&&f.data("lines").forEach(g=>{g.data("$background")&&b.append(g.data("$background")),g.detach()}),f.data("$background")&&f.data("$background").remove(),f.detach()},i.attachFunc=()=>{b.append(f),f.data("$background")&&b.append(f.data("$background")),b.append(f.data("wires")),f.data("lines")&&f.data("lines").forEach(g=>{b.append(g),g.data("$background")&&b.append(g.data("$background"))})},i.removeFunc=()=>{f.data("wires").forEach(g=>{g.remove()}),f.data("lines")&&f.data("lines").forEach(g=>{g.data("$background")&&g.data("$background").remove(),g().remove()}),f.data("$background")&&f.data("$background").remove(),f.remove()},i.$field=f,i}}w(D,"FONT_SIZE_SMALLEST","smallestFont"),w(D,"FONT_SIZE_SMALL","smallFont"),w(D,"FONT_SIZE_MIDDLE","middleFont"),w(D,"FONT_SIZE_BIG","bigFont");const ye={getAdapter(n){return{formats:()=>tt(n.locale),parse:(e,t)=>o.objects.isNullOrUndefined(e)?null:e instanceof Date?e.getTime():o.objects.isString(e)?o.objects.isString(t)&&o.strings.hasText(t)?(e=new o.DateFormat(n.locale,t).parse(e),e instanceof Date?e.getTime():null):(e=o.dates.parseJsonDate(e),e instanceof Date?e.getTime():null):null,format:(e,t)=>{if(t==="quarter")throw new Error('The time unit "quarter" is not supported for formatting.');return o.dates.format(new Date(e),n.locale,t)},add:(e,t,r)=>{let a=new Date(e);switch(r){case"millisecond":return o.dates.shiftTime(a,0,0,0,t).getTime();case"second":return o.dates.shiftTime(a,0,0,t,0).getTime();case"minute":return o.dates.shiftTime(a,0,t,0,0).getTime();case"hour":return o.dates.shiftTime(a,t,0,0,0).getTime();case"day":return o.dates.shift(a,0,0,t).getTime();case"week":return o.dates.shift(a,0,0,t*7).getTime();case"month":return o.dates.shift(a,0,t,0).getTime();case"quarter":return o.dates.shift(a,0,t*3,0).getTime();case"year":return o.dates.shift(a,t,0,0).getTime();default:return e}},diff:(e,t,r)=>{switch(r){case"millisecond":return e-t;case"second":return(e-t)/1e3;case"minute":return(e-t)/1e3/60;case"hour":return(e-t)/1e3/60/60;case"day":return o.dates.compareDays(new Date(e),new Date(t));case"week":return o.dates.compareDays(new Date(e),new Date(t))/7;case"month":return o.dates.compareMonths(new Date(e),new Date(t));case"quarter":return o.dates.compareMonths(new Date(e),new Date(t))/3;case"year":return new Date(e).getFullYear()-new Date(t).getFullYear();default:return 0}},startOf:(e,t,r)=>{let a=new Date(e);switch(t){case"second":return a.setMilliseconds(0);case"minute":return a.setSeconds(0,0);case"hour":return a.setMinutes(0,0,0);case"day":return a.setHours(0,0,0,0);case"week":return o.dates.firstDayOfWeek(a,0).getTime();case"isoWeek":return o.dates.firstDayOfWeek(a,r).getTime();case"month":return o.dates.trunc(a).setDate(0);case"quarter":return o.dates.trunc(a).setMonth(a.getMonth()%4,1);case"year":return o.dates.trunc(a).setMonth(0,1);default:return e}},endOf:(e,t)=>{let r=new Date(e);switch(t){case"second":return r.setMilliseconds(999);case"minute":return r.setSeconds(59,999);case"hour":return r.setMinutes(59,59,999);case"day":return r.setHours(23,59,59,999);case"week":{r.setHours(23,59,59,999);let a=o.dates.firstDayOfWeek(r,0);return a.setDate(a.getDate()+7)}case"month":return r.setHours(23,59,59,999),r.setDate(Me(r.getMonth(),r.getFullYear()));case"quarter":{r.setHours(23,59,59,999);let a=r.getMonth()%4+2;return r.setMonth(a,Me(a,r.getFullYear()))}case"year":return r.setHours(23,59,59,999),r.setMonth(11,31);default:return e}}}}};function tt(n){return{datetime:n.dateFormatPatternDefault+" "+n.timeFormatPatternDefault,millisecond:"HH:mm:ss.SSS",second:"HH:mm:ss",minute:n.timeFormatPatternDefault,hour:n.timeFormatPatternDefault,day:n.dateFormatPatternDefault,week:"ww",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"}}function Me(n,e){return n in[3,5,8,10]?30:n===1?o.dates.isLeapYear(e)?29:28:31}var rt=n=>{var e={};return M.d(e,n),e},lr=n=>()=>n;const k=rt({Chart:()=>Pe.Chart,_adapters:()=>Pe._adapters});var at=n=>{var e={};return M.d(e,n),e},nr=n=>()=>n;const or=at({});var it=n=>{var e={};return M.d(e,n),e},hr=n=>()=>n;const Ce=it({default:()=>je.default});function A(n,e,t){return e=st(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function st(n){var e=lt(n,"string");return typeof e=="symbol"?e:String(e)}function lt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}k.Chart.register(Ce.default),C().extend(!0,k.Chart.defaults,{maintainAspectRatio:!1,elements:{line:{borderWidth:2},point:{radius:0,hitRadius:10,hoverRadius:7,hoverBorderWidth:2},arc:{borderWidth:1},bar:{borderWidth:1,borderSkipped:""}},plugins:{legend:{labels:{usePointStyle:!0,boxHeight:7}}}}),C().extend(!0,k.Chart.overrides,{line:{elements:{point:{borderWidth:2}}},scatter:{elements:{point:{radius:3}}}});let De=!1;const nt=(1+Math.sqrt(5))/2;class X extends ne{constructor(e){super(e),A(this,"chartJs",void 0),A(this,"onlyIntegers",void 0),A(this,"maxXAxesTicksHeight",void 0),A(this,"numSupportedColors",void 0),A(this,"colorSchemeCssClass",void 0),A(this,"minRadialChartDatalabelSpace",void 0),A(this,"resetDatasetAfterHover",void 0),A(this,"legendHoverDatasets",void 0),A(this,"removing",void 0),A(this,"$canvas",void 0),A(this,"_labelFormatter",void 0),A(this,"_xLabelFormatter",void 0),A(this,"_yLabelFormatter",void 0),A(this,"_xAxisFitter",void 0),A(this,"_yAxisFitter",void 0),A(this,"_radialChartDatalabelsDisplayHandler",void 0),A(this,"_radialChartDatalabelsFormatter",void 0),A(this,"_datalabelsFormatter",void 0),A(this,"_datalabelBackgroundColorHandler",void 0),A(this,"_legendLabelGenerator",void 0),A(this,"_clickHandler",void 0),A(this,"_hoverHandler",void 0),A(this,"_pointerHoverHandler",void 0),A(this,"_legendClickHandler",void 0),A(this,"_legendHoverHandler",void 0),A(this,"_legendPointerHoverHandler",void 0),A(this,"_legendLeaveHandler",void 0),A(this,"_legendPointerLeaveHandler",void 0),A(this,"_resizeHandler",void 0),A(this,"_tooltipTitleGenerator",void 0),A(this,"_tooltipItemsGenerator",void 0),A(this,"_tooltipLabelGenerator",void 0),A(this,"_tooltipLabelValueGenerator",void 0),A(this,"_tooltipLabelColorGenerator",void 0),A(this,"_tooltipRenderer",void 0),A(this,"_tooltip",void 0),A(this,"_tooltipTimeoutId",void 0),A(this,"_updatingDatalabels",void 0),this.chartJs=null,this.onlyIntegers=!0,this.maxXAxesTicksHeight=75,this.numSupportedColors=6,this.colorSchemeCssClass="",this.minRadialChartDatalabelSpace=25,this._labelFormatter=this._formatLabel.bind(this),this._xLabelFormatter=this._formatXLabel.bind(this),this._yLabelFormatter=this._formatYLabel.bind(this),this._xAxisFitter=this._fitXAxis.bind(this),this._yAxisFitter=this._fitYAxis.bind(this),this._radialChartDatalabelsDisplayHandler=this._displayDatalabelsOnRadialChart.bind(this),this._radialChartDatalabelsFormatter=this._formatDatalabelsOnRadialChart.bind(this),this._datalabelsFormatter=this._formatDatalabels.bind(this),this._datalabelBackgroundColorHandler=this._getBackgroundColorOfDataset.bind(this),this._legendLabelGenerator=this._generateLegendLabels.bind(this),this.resetDatasetAfterHover=!1,this._clickHandler=this._onClick.bind(this),this._hoverHandler=this._onHover.bind(this),this._pointerHoverHandler=this._onHoverPointer.bind(this),this.legendHoverDatasets=[],this._legendClickHandler=this._onLegendClick.bind(this),this._legendHoverHandler=this._onLegendHover.bind(this),this._legendPointerHoverHandler=this._onLegendHoverPointer.bind(this),this._legendLeaveHandler=this._onLegendLeave.bind(this),this._legendPointerLeaveHandler=this._onLegendLeavePointer.bind(this),this._resizeHandler=this._onResize.bind(this),this._tooltipTitleGenerator=this._generateTooltipTitle.bind(this),this._tooltipItemsGenerator=this._generateTooltipItems.bind(this),this._tooltipLabelGenerator=this._generateTooltipLabel.bind(this),this._tooltipLabelValueGenerator=this._generateTooltipLabelValue.bind(this),this._tooltipLabelColorGenerator=this._generateTooltipLabelColor.bind(this),this._tooltipRenderer=this._renderTooltip.bind(this),this._tooltip=null,this._tooltipTimeoutId=null}_validateChartData(){let e=!0,t=this.chart&&this.chart.data;if((!t||!t.chartValueGroups||t.chartValueGroups.length===0||!t.axes)&&(e=!1),e&&o.scout.isOneOf(this.chart.config.type,u.Type.POLAR_AREA,u.Type.RADAR)){let i,s=0;for(i=0;i<t.chartValueGroups.length;i++){let l=t.chartValueGroups[i];l.values||(e=!1),i===0?s=l.values.length:l.values.length!==s&&(e=!1)}for(i=0;i<t.axes.length;i++)t.axes[i].length!==s&&(e=!1)}if(e)return!0;let r=!0,a=this.chart&&this.chart.config;if((!a||!a.data||!a.data.datasets||a.data.datasets.length===0)&&(r=!1),r&&o.scout.isOneOf(a.type,u.Type.POLAR_AREA,u.Type.RADAR)){let i,s=0;for(i=0;i<a.data.datasets.length;i++){let l=a.data.datasets[i];l.data||(r=!1),i===0?s=l.data.length:l.data.length!==s&&(r=!1)}}return r}_render(){this.$canvas||(this.$canvas=this.chart.$container.appendElement("<canvas>")),this.firstOpaqueBackgroundColor=o.styles.getFirstOpaqueBackgroundColor(this.$canvas),De||(k.Chart.defaults.font.family=this.$canvas.css("font-family"),k._adapters._date.override(ye.getAdapter(this.chart.session)),De=!0);let e=C().extend(!0,{},this.chart.config);this._adjustConfig(e),this._renderChart(e,!0)}_renderChart(e,t){this.chartJs&&this.chartJs.destroy(),e=C().extend(!0,{},e,{options:{animation:{}}},e),e.options.animation.duration=t?this.animationDuration:0,this.chartJs=new k.Chart(this.$canvas[0].getContext("2d"),e),this._adjustSize(this.chartJs.config,this.chartJs.chartArea),this.chartJs.update()}_updateData(){if(!this.chartJs)return;let e=C().extend(!0,{},this.chart.config);this._adjustConfig(e);let t=this.chartJs.config.data,r=e.data,a=(h,c,p,f)=>{if(!h||!c||!p)return;if(!c[p]){let _=h[p];(_||f)&&(c[p]=_);return}if(!h[p]){if(f){c[p]=void 0;return}if(Array.isArray(c[p])){c[p].splice(0,c[p].length);return}c[p]=void 0;return}if(!Array.isArray(h[p])||!Array.isArray(c[p])){c[p]=h[p];return}for(let _=0;_<Math.min(h[p].length,c[p].length);_++)c[p][_]=h[p][_];let m=c[p].length,y=h[p].length;m>y?c[p].splice(y,m-y):m<y&&c[p].push(...h[p].splice(m))},i=(h,c)=>o.arrays.find(h,p=>p.datasetId===c),s=(h,c)=>o.arrays.findIndex(h,p=>p.datasetId===c);if(t&&r){a(r,t,"labels"),t.datasets||(t.datasets=[]),r.datasets||(r.datasets=[]),r.datasets.every(h=>o.objects.isNullOrUndefined(h.datasetId))&&(r.datasets.forEach((h,c)=>{h.datasetId=""+c}),t.datasets.forEach((h,c)=>{h.datasetId=""+c})),t.datasets.forEach(h=>{let c=i(r.datasets,h.datasetId);c&&(h.label=c.label,h.type=c.type,a(c,h,"data"),a(c,h,"backgroundColor",!0),a(c,h,"borderColor",!0),a(c,h,"hoverBackgroundColor",!0),a(c,h,"hoverBorderColor",!0),a(c,h,"legendColor",!0),a(c,h,"pointBackgroundColor",!0),a(c,h,"pointHoverBackgroundColor",!0),a(c,h,"pointBorderColor",!0),a(c,h,"pointHoverBorderColor",!0),a(c,h,"uncheckedBackgroundColor",!0),a(c,h,"uncheckedHoverBackgroundColor",!0),a(c,h,"checkedBackgroundColor",!0),a(c,h,"checkedHoverBackgroundColor",!0),a(c,h,"uncheckedPointBackgroundColor",!0),a(c,h,"uncheckedPointHoverBackgroundColor",!0),a(c,h,"checkedPointBackgroundColor",!0),a(c,h,"checkedPointHoverBackgroundColor",!0),a(c,h,"lineTension",!0),a(c,h,"pointRadius",!0),a(c,h,"uncheckedPointRadius",!0),a(c,h,"checkedPointRadius",!0),this._adjustDatasetBorderWidths(h))});for(let h=t.datasets.length-1;h>=0;h--){let c=t.datasets[h].datasetId;(o.objects.isNullOrUndefined(c)||s(r.datasets,c)===-1)&&t.datasets.splice(h,1)}t.datasets.sort((h,c)=>s(r.datasets,h.datasetId)-s(r.datasets,c.datasetId)),r.datasets.forEach((h,c)=>{let p=t.datasets[c];p&&p.datasetId&&h.datasetId===p.datasetId||t.datasets.splice(c,0,h)})}else this.chartJs.config.data=r;a(e.options,this.chartJs.config.options,"xLabelMap",!0),a(e.options,this.chartJs.config.options,"yLabelMap",!0),C().extend(!0,this.chartJs.config,{options:{animation:{duration:this.animationDuration}}});let l=this.chartJs.config.options.scales||{};[l.x||{},l.y||{},l.yDiffType||{},l.r||{}].forEach(h=>{(h.ticks||{}).stepSize=void 0}),this.chartJs.update(),this._adjustSize(this.chartJs.config,this.chartJs.chartArea),this.chartJs.update()}isDataUpdatable(){return!0}refresh(){this.chartJs?this.chartJs.update():super.refresh()}_renderCheckedItems(){this.chartJs&&this._checkItems(this.chartJs.config)&&this.chartJs.update()}_checkItems(e){if(!e||!e.data)return!1;let t=(a,i,s)=>{if(Array.isArray(a)&&Array.isArray(i)){let l=0;return o.arrays.ensure(s).filter(d=>!isNaN(d)&&d<Math.min(a.length,i.length)).forEach(d=>{a[d]!==i[d]&&(a[d]=i[d],l++)}),l}return 0},r=0;return e.data.datasets.forEach((a,i)=>{let s=this.chart.checkedItems.filter(d=>d.datasetIndex===i).map(d=>d.dataIndex),l=o.arrays.init(a.data.length,null).map((d,h)=>h);o.arrays.removeAll(l,s),r=r+t(a.backgroundColor,a.checkedBackgroundColor,s)+t(a.hoverBackgroundColor,a.checkedHoverBackgroundColor,s)+t(a.pointBackgroundColor,a.checkedPointBackgroundColor,s)+t(a.pointHoverBackgroundColor,a.checkedPointHoverBackgroundColor,s)+t(a.pointRadius,a.checkedPointRadius,s)+t(a.backgroundColor,a.uncheckedBackgroundColor,l)+t(a.hoverBackgroundColor,a.uncheckedHoverBackgroundColor,l)+t(a.pointBackgroundColor,a.uncheckedPointBackgroundColor,l)+t(a.pointHoverBackgroundColor,a.uncheckedPointHoverBackgroundColor,l)+t(a.pointRadius,a.uncheckedPointRadius,l),this._adjustDatasetBorderWidths(a)}),0<r}stopAnimations(){this.chartJs&&this.chartJs.stop()}_adjustConfig(e){!e||!e.type||(this._adjustType(e),this.chart.data&&this._computeDatasets(this.chart.data,e),this._adjustData(e),this._adjustTooltip(e),this._adjustGrid(e),this._adjustPlugins(e),this._adjustColors(e),this._adjustClickHandler(e),this._adjustResizeHandler(e))}_adjustType(e){if(e.type===u.Type.COMBO_BAR_LINE){e.type=u.Type.BAR;let t=(e.options||{}).scaleLabelByTypeMap;t&&(t[u.Type.BAR]=t[u.Type.COMBO_BAR_LINE])}else this._isHorizontalBar(e)&&(e.type=u.Type.BAR,e.options=C().extend(!0,{},e.options,{indexAxis:"y"}))}_computeDatasets(e,t){let r=[],a=[],i=(l,d)=>{C().isEmptyObject(d)||(t.options[l]=d)};(e.axes[0]||[]).forEach(l=>r.push(l.label));let s=this._isHorizontalBar(t);i(s?"yLabelMap":"xLabelMap",this._computeLabelMap(e.axes[0])),i(s?"xLabelMap":"yLabelMap",this._computeLabelMap(e.axes[1])),e.chartValueGroups.forEach(l=>a.push({type:l.type,label:l.groupName,data:C().extend(!0,[],l.values)})),t.data={labels:r,datasets:a}}_isHorizontalBar(e){return e&&(e.type===u.Type.BAR_HORIZONTAL||e.type===u.Type.BAR&&e.options&&e.options.indexAxis==="y")}_computeLabelMap(e){let t={};return(e||[]).forEach((r,a)=>{t[a]=r.label}),t}_adjustData(e){!e||!e.data||!e.type||(this._adjustBarBorderWidth(e),this._adjustMaxSegments(e),this._adjustBubbleRadii(e),this._adjustOnlyIntegers(e))}_adjustBarBorderWidth(e){!e||!e.data||!e.type||!o.scout.isOneOf(e.type,u.Type.BAR)||e.data.datasets.forEach(t=>{(t.type||u.Type.BAR)===u.Type.BAR&&(t.borderWidth=t.borderWidth||1,t.hoverBorderWidth=t.hoverBorderWidth||2,this._adjustDatasetBorderWidths(t))})}_adjustDatasetBorderWidths(e){this._adjustDatasetBorderWidth(e),this._adjustDatasetBorderWidth(e,!0)}_adjustDatasetBorderWidth(e,t){if(!e)return;let r=t?"hoverBorderWidth":"borderWidth",a=t?"hoverBorderWidthBackup":"borderWidthBackup",i=t?"hoverBackgroundColor":"backgroundColor",s=t?"hoverBorderColor":"borderColor";if(e[a]&&(e[r]=e[a],delete e[a]),!e[r]||o.objects.isFunction(e[r]))return;let l=Array.isArray(e[r]),d=Array.isArray(e[i]),h=Array.isArray(e[s]);if(!(l||d||h)&&e[i]===e[s]){e[a]=e[r],e[r]=0;return}let p=(e.data||[]).length;l?e[r].length<p&&e[r].push(...o.arrays.init(p-e[r].length,e[r][0])):e[r]=o.arrays.init(p,e[r]);let f=e[r],m=f.length,y=o.arrays.init(m,null);for(let _=0;_<m;_++){let b=d?e[i][_]:e[i],g=h?e[s][_]:e[s];y[_]=f[_],b===g&&(f[_]=0)}o.arrays.equals(f,y)||(e[a]=y)}_adjustMaxSegments(e){if(!e||!e.data||!e.type||!o.scout.isOneOf(e.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.RADAR))return;let t=e.options.maxSegments;if(!(t&&e.data.datasets.length&&t<e.data.datasets[0].data.length))return;e.data.datasets.forEach(a=>{let i=a.data.slice(0,t);i[t-1]=a.data.slice(t-1,a.data.length).reduce((s,l)=>s+l,0),a.data=i});let r=e.data.labels.slice(0,t);r[t-1]=this.chart.session.text("ui.OtherValues"),e.data.labels=r,e.data.maxSegmentsExceeded=!0}_isMaxSegmentsExceeded(e,t){return!o.scout.isOneOf(e.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.RADAR)||e.options.otherSegmentClickable||!e.data.maxSegmentsExceeded||!e.options.maxSegments?!1:e.options.maxSegments-1<=t}_adjustBubbleRadii(e){!e||!e.data||!e.type||e.type!==u.Type.BUBBLE||e.data.datasets.forEach(t=>t.data.forEach(r=>{isNaN(r.r)||(r.z=Math.pow(r.r,2)),r.r=1}))}_adjustOnlyIntegers(e){this.onlyIntegers=!0,!(!e||!e.data||!e.type)&&(o.scout.isOneOf(e.type,u.Type.BUBBLE,u.Type.SCATTER)?this.onlyIntegers=e.data.datasets.every(t=>t.data.every(r=>o.numbers.isInteger(r.x)&&o.numbers.isInteger(r.y))):this.onlyIntegers=e.data.datasets.every(t=>t.data.every(r=>o.numbers.isInteger(r))))}_adjustTooltip(e){if(!e)return;e.options=C().extend(!0,{},{plugins:{tooltip:{callbacks:{title:this._tooltipTitleGenerator,items:this._tooltipItemsGenerator,label:this._tooltipLabelGenerator,labelValue:this._tooltipLabelValueGenerator,labelColor:this._tooltipLabelColorGenerator}}}},e.options);let t=e.options.plugins.tooltip;!t.enabled||(t.enabled=!1,t.external=this._tooltipRenderer)}_generateTooltipTitle(e){if(!e||!e.length)return"";let t=e[0],r=t.chart,a=r.config,i=t.dataset,s=[];if(o.scout.isOneOf(a.type,u.Type.BUBBLE)){let l=a.options.scales.x,d=a.options.scales.y,h=this._getAxisLabels(a),c=l.ticks.callback(i.data[t.dataIndex].x,null,null);c&&s.push(this._createTooltipAttribute(h.x,o.strings.encode(c),!0));let p=d.ticks.callback(i.data[t.dataIndex].y,null,null);p&&s.push(this._createTooltipAttribute(h.y,o.strings.encode(p),!0))}else if(!o.scout.isOneOf(a.type,u.Type.SCATTER)){let l=r.data.labels[t.dataIndex];s.push(this._createTooltipAttribute(a.options.reformatLabels?this._formatLabel(l):l,"",!0))}return s}_getAxisLabels(e){let t=e.options.scales.x.title.text,r=e.options.scales.y.title.text;return t=this._resolveAxisLabel(t,X.ARROW_LEFT_RIGHT),r=this._resolveAxisLabel(r," "+X.ARROW_UP_DOWN+" "),{x:t,y:r}}_resolveAxisLabel(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return o.objects.isFunction(e)&&(e=e(),e=o.objects.isString(e)?e:""),e?o.strings.encode(e):t}_generateTooltipItems(e,t,r,a){if(!e||!e.length)return"";let i=e[0],s=i.chart,l=s.config,d=!1,h=!1,c="";if(e.forEach(p=>{let{label:f,labelValue:m,labelColor:y}=this._getItemDetails(p,t,r,a);if(o.scout.isOneOf(l.type,u.Type.SCATTER)){let{x:_,y:b}=m;d||(d=o.objects.isString(_)),h||(h=o.objects.isString(b)),c+=this._createTooltipScatterAttribute(f,_,b,!1,y)}else c+=this._createTooltipAttribute(f,m,!1,y)}),o.scout.isOneOf(l.type,u.Type.SCATTER)){let p="<table><tbody>",f=this._getAxisLabels(l);p+=this._createTooltipScatterAttribute("",d?f.x:"",h?f.y:"",!0);let m="</tbody></table>";c=o.strings.box(p,c,m)}return c}_getItemDetails(e,t,r,a){let i,s,l;return o.objects.isFunction(t)&&(i=t(e),i=o.objects.isString(i)?i:""),o.objects.isFunction(r)&&(s=r(e),s=o.objects.isString(s)||o.objects.isPlainObject(s)?s:""),o.objects.isFunction(a)&&(l=a(e),l=o.objects.isPlainObject(l)&&l.backgroundColor||""),{label:i,labelValue:s,labelColor:l}}_generateTooltipLabel(e){return o.strings.encode(e.dataset.label)}_generateTooltipLabelValue(e){let t=e.chart.config,r=e.dataset;return t.type===u.Type.BUBBLE?o.strings.encode(this._formatLabel(r.data[e.dataIndex].z)):t.type===u.Type.SCATTER?{x:o.strings.encode(this._formatLabel(r.data[e.dataIndex].x)),y:o.strings.encode(this._formatLabel(r.data[e.dataIndex].y))}:o.strings.encode(this._formatLabel(r.data[e.dataIndex]))}_generateTooltipLabelColor(e){let t=e.chart.config,r=e.dataset,a,i,s,l;o.scout.isOneOf(r.type||t.type,u.Type.LINE,u.Type.BAR,u.Type.BAR_HORIZONTAL,u.Type.RADAR,u.Type.BUBBLE,u.Type.SCATTER)&&(s=r.borderColor,a=r.legendColor,l=e.datasetIndex),o.scout.isOneOf(t.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(a=Array.isArray(r.legendColor)?r.legendColor[e.dataIndex]:r.legendColor,i=Array.isArray(r.backgroundColor)?r.backgroundColor[e.dataIndex]:r.backgroundColor,i=this._adjustColorOpacity(i,1),l=e.dataIndex),o.objects.isFunction(a)&&(a=a.call(e.chart,l));let d=a||i||s;if(!d||o.objects.isFunction(d)){let h;k.Chart.overrides[t.type]&&k.Chart.overrides[t.type].plugins&&k.Chart.overrides[t.type].plugins.tooltip&&k.Chart.overrides[t.type].plugins.tooltip.callbacks&&(h=k.Chart.overrides[t.type].plugins.tooltip.callbacks.labelColor),d=(h||k.Chart.defaults.plugins.tooltip.callbacks.labelColor).call(e.chart,e).backgroundColor}return{backgroundColor:d}}_createTooltipAttribute(e,t,r,a){return'<div class="'+(r?"attribute title":"attribute")+'">'+(a?'<div class="color" style="background-color:'+a+'"></div>':"")+(e?"<label>"+e+"</label>":"")+(t?'<div class="value">'+t+"</div>":"")+"</div>"}_createTooltipScatterAttribute(e,t,r,a,i){return'<tr class="'+(a?"attribute title":"attribute")+'"><td class="color-cell">'+(i?'<div class="color" style="background-color:'+i+'"></div>':"")+'</td><td class="label">'+e+"</td>"+(t?'<td class="value">'+t+"</td>":"")+(r?'<td class="value">'+r+"</td>":"")+"</tr>"}_renderTooltip(e){if(e.tooltip.opacity===0||e.tooltip.dataPoints.length<1){this._tooltipTimeoutId&&(clearTimeout(this._tooltipTimeoutId),this._tooltipTimeoutId=void 0),this._tooltip&&(this._tooltip.destroy(),this._tooltip=null);return}!!this._tooltip?this._renderTooltipLater(e):(clearTimeout(this._tooltipTimeoutId),this._tooltipTimeoutId=setTimeout(()=>this._renderTooltipLater(e),o.tooltips.DEFAULT_TOOLTIP_DELAY))}_renderTooltipLater(e){if(!this.rendered||this.removing)return;let t=e.tooltip,r=t.dataPoints;if(r.length<1)return;let a=r[0];if(!a.chart.getDatasetMeta(a.datasetIndex).data[a.dataIndex])return;this._tooltip&&(this._tooltip.destroy(),this._tooltip=null);let s=t.options||{},l=s.callbacks||{},d=l.title,h=l.items,c=l.label,p=l.labelValue,f=l.labelColor,m="";o.objects.isFunction(d)&&(m+=o.arrays.ensure(d(r)).join("")),o.objects.isFunction(h)&&(m+=o.arrays.ensure(h(r,c,p,f)).join(""));let y=this._computeTooltipPositionAndOffset(a),_=new o.Point(t.caretX+y.offsetX,t.caretY+y.offsetY);this._tooltip=o.scout.create({objectType:o.Tooltip,parent:this.chart,$anchor:this.$canvas,text:m,htmlEnabled:!0,cssClass:o.strings.join(" ","chart-tooltip",s.cssClass),tooltipPosition:y.tooltipPosition,tooltipDirection:y.tooltipDirection,originProducer:v=>{const B=o.graphics.offsetBounds(v);return B.height=y.height,B},offsetProducer:v=>_}),this._tooltip.render(),this._tooltip.$container.css("pointer-events","none");let b=!1,g=(s.titleFont||{}).family;g&&(this._tooltip.$container.css("--chart-tooltip-font-family",g),b=!0);let T=0;this._tooltip.$container.find("label").each((v,B)=>{T=Math.max(T,o.graphics.prefSize(C()(B)).width)}),T>0&&(this._tooltip.$container.css("--chart-tooltip-label-width",Math.min(T,120)+"px"),b=!0),b&&this._tooltip.position()}_computeTooltipPositionAndOffset(e){let t="top",r="right",a=0,i=0,s=0,l=e.chart,d=e.datasetIndex,h=e.dataIndex,c=l.config,p=c.data.datasets,f=p[d],m=f.data[h];if(this._isHorizontalBar(c))o.objects.isPlainObject(m)&&o.objects.isArray(m.x)&&m.x.length===2?r=(m.x[0]+m.x[1])/2<0?"left":"right":r=m<0?"left":"right";else if((f.type||c.type)===u.Type.BAR)t=m<0?"bottom":"top";else if(o.scout.isOneOf(c.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)){let y=l.getDatasetMeta(d).data[h].getProps(["startAngle","endAngle"]),_=y.startAngle,b=y.endAngle,g=(_+b)/2;t=0<=g&&g<Math.PI?"bottom":"top",r=-Math.PI/2<=g&&g<Math.PI/2?"right":"left"}else if(c.type===u.Type.RADAR){let _=l.getDatasetMeta(d).data[h].getProps(["angle"]).angle;t=0<=_&&_<Math.PI?"bottom":"top",r=-Math.PI/2<=_&&_<Math.PI/2?"right":"left"}else if(o.scout.isOneOf(c.type,u.Type.BUBBLE,u.Type.SCATTER)){let y=l.getDatasetMeta(d).data[h],_=l.chartArea,b=_.left+_.width/2;r=y.x<b?"left":"right"}if(this._isHorizontalBar(c)){let y=l.getDatasetMeta(d).data[h].getProps(["height","width"]);s=y.height;let _=y.width,b=_/(nt+1);i=-s/2,a=r==="left"?b:-b}else if(o.scout.isOneOf(c.type,u.Type.LINE,u.Type.BUBBLE,u.Type.SCATTER,u.Type.RADAR)||f.type===u.Type.LINE){let _=l.getDatasetMeta(d).data[h].options,b=_.hoverRadius+_.hoverBorderWidth;c.type===u.Type.BUBBLE&&(b+=m.r),s=2*b,i=-b}else if(o.scout.isOneOf(c.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)){let y=l.getDatasetMeta(d).data[h].getProps(["startAngle","endAngle","innerRadius","outerRadius"]),_=y.startAngle,b=y.endAngle,g=(_+b)/2,T=y.innerRadius,v=y.outerRadius,B=(v-T)/2;a=B*Math.cos(g),i=B*Math.sin(g)}return{tooltipPosition:t,tooltipDirection:r,offsetX:a,offsetY:i,height:s}}_adjustGrid(e){!e||(e.options=C().extend(!0,{},e.options),this._adjustScalesR(e),this._adjustScalesXY(e))}_adjustScalesR(e){if(!e||!e.type||!e.options)return;o.scout.isOneOf(e.type,u.Type.POLAR_AREA,u.Type.RADAR)&&(e.options=C().extend(!0,{},{scales:{r:{}}},e.options));let t=e.options,r=t?t.scales:{};r&&r.r&&(r.r=C().extend(!0,{},{minSpaceBetweenTicks:35,beginAtZero:!0,angleLines:{display:!1},ticks:{callback:this._labelFormatter},pointLabels:{font:{size:k.Chart.defaults.font.size}}},r.r))}_adjustScalesXY(e){!e||!e.type||!e.options||(o.scout.isOneOf(e.type,u.Type.BAR,u.Type.LINE,u.Type.BUBBLE)?e.options=C().extend(!0,{},{scales:{x:{minSpaceBetweenTicks:150},y:{minSpaceBetweenTicks:35}}},e.options):o.scout.isOneOf(e.type,u.Type.SCATTER)&&(e.options=C().extend(!0,{},{scales:{x:{minSpaceBetweenTicks:35,ticks:{padding:10}},y:{minSpaceBetweenTicks:35,ticks:{padding:10}}}},e.options)),this._adjustXAxis(e),this._adjustYAxis(e))}_adjustXAxis(e){if(!e||!e.type||!e.options||!e.options.scales||!e.options.scales.x)return;let t=e.type,r=e.options.scales;this._isHorizontalBar(e)||o.scout.isOneOf(t,u.Type.BUBBLE,u.Type.SCATTER)?r.x=C().extend(!0,{},{beginAtZero:this._isHorizontalBar(e),offset:t===u.Type.BUBBLE,grid:{drawBorder:!1,drawTicks:!1},ticks:{padding:5}},r.x):r.x=C().extend(!0,{},{offset:!0,grid:{display:!1,drawBorder:!1}},r.x),(this._isHorizontalBar(e)||o.scout.isOneOf(t,u.Type.BUBBLE,u.Type.SCATTER)||e.options.reformatLabels)&&(r.x=C().extend(!0,{},{ticks:{callback:this._xLabelFormatter}},r.x)),r.x.afterCalculateLabelRotation=this._xAxisFitter}_adjustYAxis(e){if(!e||!e.type||!e.options||!e.options.scales||!e.options.scales.y)return;let t=e.type,r=e.options.scales;this._isHorizontalBar(e)?r.y=C().extend(!0,{},{grid:{display:!1,drawBorder:!1}},r.y):r.y=C().extend(!0,{},{beginAtZero:!o.scout.isOneOf(t,u.Type.BUBBLE,u.Type.SCATTER),grid:{drawBorder:!1,drawTicks:!1},ticks:{padding:5}},r.y),(!this._isHorizontalBar(e)||e.options.reformatLabels)&&(r.y=C().extend(!0,{},{ticks:{callback:this._yLabelFormatter}},r.y)),r.y.afterFit=this._yAxisFitter}_adjustPlugins(e){this._adjustPluginsDatalabels(e)}_adjustPluginsDatalabels(e){if(!e||!e.type||!e.options||!e.options.plugins||!e.options.plugins.datalabels||!e.options.plugins.datalabels.display)return;let t=e.options.plugins;if(o.scout.isOneOf(e.type,u.Type.PIE,u.Type.DOUGHNUT)){t.datalabels=C().extend(!0,{},{formatter:this._radialChartDatalabelsFormatter},t.datalabels),t.datalabels.display=this._radialChartDatalabelsDisplayHandler,this._updatingDatalabels=!1;let r=e.options.animation||{},a=r.onProgress,i=r.onComplete,s=d=>{if(this._updatingDatalabels)return;this._updatingDatalabels=!0;let h=d.chart,c=h.getSortedVisibleDatasetMetas(),p=[...h.getActiveElements()],f=[];c.forEach((m,y)=>{m.data.forEach((_,b)=>{let g=o.arrays.findIndex(p,T=>T.datasetIndex===y&&T.index===b);g>0?p.splice(g,1):f.push({datasetIndex:y,index:b,element:_})})}),h["$"+Ce.default.id]._actives=f,Ce.default.afterEvent(h,null,null),this._updatingDatalabels=!1},l=(d,h)=>{s(d),h&&h(d)};e.options.animation=C().extend(!0,{},e.options.animation,{onProgress:d=>l(d,a),onComplete:d=>l(d,i)})}else o.scout.isOneOf(e.type,u.Type.BAR,u.Type.LINE,u.Type.POLAR_AREA,u.Type.RADAR,u.Type.BUBBLE)?(t.datalabels=C().extend(!0,{},{backgroundColor:this._datalabelBackgroundColorHandler,borderRadius:3},t.datalabels),t.datalabels.display="auto"):o.scout.isOneOf(e.type,u.Type.SCATTER)&&(t.datalabels=C().extend(!0,{},{backgroundColor:this._datalabelBackgroundColorHandler,borderRadius:3,anchor:"end",align:"top",offset:3},t.datalabels),t.datalabels.display="auto");if(e.options.reformatLabels){let r=a=>(i,s)=>{let l=a.call(s.chart,i,s);return this._formatLabel(l)};e.data&&e.data.datasets.forEach(i=>{i.datalabels&&i.datalabels.formatter&&(i.datalabels.formatter=r(i.datalabels.formatter))}),t.datalabels.formatter&&(t.datalabels.formatter=r(t.datalabels.formatter))}t.datalabels=C().extend(!0,{},{formatter:this._datalabelsFormatter},t.datalabels)}_formatLabel(e){return this._formatLabelMap(e,null,this._getNumberFormatter())}_getNumberFormatter(){if(this.chartJs&&this.chartJs.config&&this.chartJs.config.options)return this.chartJs.config.options.numberFormatter}_formatXLabel(e){return this._formatLabelMap(e,this._getXLabelMap(),this._getNumberFormatter())}_formatYLabel(e){return this._formatLabelMap(e,this._getYLabelMap(),this._getNumberFormatter())}_getXLabelMap(){return this._getLabelMap("xLabelMap")}_getYLabelMap(){return this._getLabelMap("yLabelMap")}_getLabelMap(e){if(this.chartJs&&this.chartJs.config&&this.chartJs.config.options)return this.chartJs.config.options[e]}_formatLabelMap(e,t,r){return t?t[e]:isNaN(e)||typeof e=="string"?""+e:r?r(e,this._formatNumberLabel.bind(this)):this._formatNumberLabel(e)}_formatNumberLabel(e){if(isNaN(e))return""+e;let t=Math.abs(e),r="";if(t>=1e6){t=t/1e6,r=" "+this.chart.session.text("ui.Mio");let a=[this.chart.session.text("ui.Mrd"),this.chart.session.text("ui.Bio"),this.chart.session.text("ui.Brd"),this.chart.session.text("ui.Tri"),this.chart.session.text("ui.Trd")];for(let i=0;i<a.length&&t>=1e3;i++)t=t/1e3,r=" "+a[i]}return this.session.locale.decimalFormat.format(Math.sign(e)*t)+r}_fitXAxis(e){if(!e||e.labelRotation===0)return;let t=this.maxXAxesTicksHeight,r=k.Chart.defaults.font,a=k.Chart.defaults.scale.ticks,i=a.font||{},s,l;if(this.chartJs){let f=this.chartJs.chartArea,m=Math.abs(f.top-f.bottom);t=Math.min(t,m/3)}e.options&&e.options.ticks&&(l=e.options.ticks.maxRotation,s=(e.options.ticks.font||{}).size),l=l||a.maxRotation,s=s||i.size||r.size,isNaN(e.labelRotation)&&(e.labelRotation=l),e.height=isNaN(e.height)?t:Math.min(e.height,t);let d=e.labelRotation,h=(t-s*Math.sin((90-d)/180*Math.PI))/Math.sin(d/180*Math.PI);if(((e._labelSizes||{}).widest||{}).width>h){let f=e.ctx.measureText.bind(e.ctx);e.ticks.forEach(m=>{m.label=o.strings.truncateText(m.label,h,f)}),e._labelSizes=void 0}}_fitYAxis(e){if(!e)return;let t=0,r=0;if(e.options&&e.options.ticks&&(t=e.options.ticks.padding||0),e.options&&e.options.grid&&(r=e.options.grid.tickLength||0),((e._labelSizes||{}).widest||{}).width>e.maxWidth-t){let s=e.maxWidth-t-r,l=e.ctx.measureText.bind(e.ctx);e.ticks.forEach(d=>{d.label=o.strings.truncateText(d.label,s,l)})}}_displayDatalabelsOnRadialChart(e){let t=e.chart.getDatasetMeta(e.datasetIndex).data[e.dataIndex].getProps(["startAngle","endAngle","innerRadius","outerRadius"]),r=(t.outerRadius+t.innerRadius)/2,a=Math.min(t.endAngle-t.startAngle,Math.PI)/2,i=Math.abs(Math.sin(a))*r,s=i*2,l=t.outerRadius-t.innerRadius;return Math.min(s,l)>this.minRadialChartDatalabelSpace}_formatDatalabelsOnRadialChart(e,t){let r=this._computeSumOfVisibleElements(t),a=t.dataset,i=0,s=[];for(let l=0;l<t.dataIndex+1;l++){let d=a.data[l]/r*100-i,h=Math.round(d);i=h-d,s.push(h+"%")}return s[t.dataIndex]}_computeSumOfVisibleElements(e){let t=e.dataset,r=e.chart,a=0;for(let i=0;i<t.data.length;i++)r.getDataVisibility(i)&&(a+=t.data[i]);return a}_formatDatalabels(e,t){let r=t.chart.config;return r.type===u.Type.BUBBLE?this._formatLabel(e.z):r.type===u.Type.SCATTER?o.strings.join(" / ",this._formatLabel(e.x),this._formatLabel(e.y)):this._formatLabel(e)}_getBackgroundColorOfDataset(e){return e.dataset.backgroundColor}_adjustColors(e){this._adjustColorSchemeCssClass(e),this._adjustDatasetColors(e),this._adjustLegendColors(e),this._adjustScalesRColors(e),this._adjustScalesXYColors(e),this._adjustPluginColors(e)}_adjustColorSchemeCssClass(e){!e||!e.options||(this.colorSchemeCssClass=o.colorSchemes.getCssClasses(e.options.colorScheme).join(" "))}_adjustDatasetColors(e){if(!e||!e.data||!e.type)return;let t=e.data,r=e.type,a=e.options&&e.options.autoColor,i=e.options&&e.options.checkable,s=a&&o.scout.isOneOf(r,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA),l={backgroundColors:[],borderColors:[],hoverBackgroundColors:[],hoverBorderColors:[],checkedBackgroundColors:[],checkedHoverBackgroundColors:[],legendColors:[],pointHoverColors:[]};l=C().extend(!0,l,this._computeDatasetColors(e,s)),t.datasets.forEach((d,h)=>{let c=s?l.backgroundColors:l.backgroundColors[h],p=s?l.borderColors:l.borderColors[h],f=s?l.hoverBackgroundColors:l.hoverBackgroundColors[h],m=s?l.hoverBorderColors:l.hoverBorderColors[h],y=s?l.legendColors:l.legendColors[h],_=s?l.pointHoverColors:l.legendColors[h],b=(g,T)=>{typeof d[g]!="function"&&T&&T.length&&(d[g]=Array.isArray(T)?[...T]:T)};if(b("backgroundColor",c),b("borderColor",p),b("hoverBackgroundColor",f),b("hoverBorderColor",m),b("legendColor",y),(o.scout.isOneOf(r,u.Type.LINE,u.Type.RADAR)||r===u.Type.BAR&&d.type===u.Type.LINE)&&(b("pointHoverBackgroundColor",_),b("pointBorderColor",this.firstOpaqueBackgroundColor),b("pointHoverBorderColor",this.firstOpaqueBackgroundColor)),i){let g=d.data.length;if(o.scout.isOneOf(r,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.BUBBLE,u.Type.SCATTER)||r===u.Type.BAR&&(d.type||u.Type.BAR)===u.Type.BAR){let T=s?l.backgroundColors:o.arrays.init(g,l.backgroundColors[h]),v=s?l.hoverBackgroundColors:o.arrays.init(g,l.hoverBackgroundColors[h]),B=s?l.checkedBackgroundColors:o.arrays.init(g,l.checkedBackgroundColors[h]),V=s?l.checkedHoverBackgroundColors:o.arrays.init(g,l.checkedHoverBackgroundColors[h]);b("uncheckedBackgroundColor",T),b("uncheckedHoverBackgroundColor",v),b("checkedBackgroundColor",B),b("checkedHoverBackgroundColor",V),b("backgroundColor",d.uncheckedBackgroundColor),b("hoverBackgroundColor",d.uncheckedHoverBackgroundColor)}else if(o.scout.isOneOf(r,u.Type.LINE,u.Type.RADAR)||r===u.Type.BAR&&d.type===u.Type.LINE){let T=o.arrays.init(g,_),v=o.arrays.init(g,_),B=o.arrays.init(g,p),V=o.arrays.init(g,m||p);b("uncheckedPointBackgroundColor",T),b("uncheckedPointHoverBackgroundColor",v),b("checkedPointBackgroundColor",B),b("checkedPointHoverBackgroundColor",V),b("pointBackgroundColor",d.uncheckedPointBackgroundColor),b("pointHoverBackgroundColor",d.uncheckedPointHoverBackgroundColor);let re=o.arrays.init(g,((e.options.elements||{}).point||{}).radius||k.Chart.defaults.elements.point.radius),ae=o.arrays.init(g,(((e.options.elements||{}).point||{}).hoverRadius||k.Chart.defaults.elements.point.hoverRadius)-1);b("uncheckedPointRadius",re),b("checkedPointRadius",ae),b("pointRadius",d.uncheckedPointRadius)}}this._adjustDatasetBorderWidths(d)}),i&&this._checkItems(e)}_computeDatasetColors(e,t){if(!e||!e.data||!e.type)return{};let r=e.data,a=e.type,i={};if(e.options&&e.options.autoColor)i=this._computeDatasetColorsAutoColor(e,t);else if(i=this._computeDatasetColorsChartValueGroups(e,t),o.scout.isOneOf(a,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)){let s=this._computeBorderColor(a,0);i.borderColors=o.arrays.init(r.datasets.length,s),i.hoverBorderColors=i.borderColors}return i}_computeDatasetColorsAutoColor(e,t){if(!e||!e.data||!e.type||!e.options||!e.options.autoColor)return{};let r=e.data,a=e.type,i=e.options&&e.options.checkable,s=e.options&&e.options.transparent,l={backgroundColors:[],borderColors:[],hoverBackgroundColors:[],hoverBorderColors:[],checkedBackgroundColors:[],checkedHoverBackgroundColors:[],legendColors:[],pointHoverColors:[]},d=[];return t?d=o.arrays.init(r.datasets.length&&r.datasets[0].data.length||0,a):r.datasets.forEach(h=>d.push(h.type||a)),d.forEach((h,c)=>{l.backgroundColors.push(this._computeBackgroundColor(h,c,i||s)),l.borderColors.push(this._computeBorderColor(h,c)),l.hoverBackgroundColors.push(this._computeHoverBackgroundColor(h,c,i||s)),l.hoverBorderColors.push(this._computeHoverBorderColor(h,c)),l.checkedBackgroundColors.push(this._computeCheckedBackgroundColor(h,c,i)),l.checkedHoverBackgroundColors.push(this._computeCheckedHoverBackgroundColor(h,c,i)),l.legendColors.push(this._computeLegendColor(h,c)),l.pointHoverColors.push(this._computePointHoverColor(h,c))}),l}_computeBackgroundColor(e,t,r){return o.styles.get([this.colorSchemeCssClass,e+"-chart"+(r?" checkable":""),"elements","color"+t%this.numSupportedColors],"fill").fill}_computeBorderColor(e,t){let r;return o.scout.isOneOf(e,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(r={stroke:this.firstOpaqueBackgroundColor}),o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","stroke-color"+t%this.numSupportedColors],"stroke",r).stroke}_computeHoverBackgroundColor(e,t,r){return o.styles.get([this.colorSchemeCssClass,e+"-chart"+(r?" checkable":""),"elements","color"+t%this.numSupportedColors+" hover"],"fill").fill}_computeHoverBorderColor(e,t){let r;return o.scout.isOneOf(e,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(r={stroke:this.firstOpaqueBackgroundColor}),o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","stroke-color"+t%this.numSupportedColors+" hover"],"stroke",r).stroke}_computeCheckedBackgroundColor(e,t,r){return o.styles.get([this.colorSchemeCssClass,e+"-chart"+(r?" checkable":""),"elements","color"+t%this.numSupportedColors+" checked"],"fill").fill}_computeCheckedHoverBackgroundColor(e,t,r){return o.styles.get([this.colorSchemeCssClass,e+"-chart"+(r?" checkable":""),"elements","color"+t%this.numSupportedColors+" hover checked"],"fill").fill}_computeLegendColor(e,t){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","color"+t%this.numSupportedColors+" legend"],"fill").fill}_computePointHoverColor(e,t){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","color"+t%this.numSupportedColors+" point hover"],"fill").fill}_computeDatasetColorsChartValueGroups(e,t){if(!e||!e.type||!this.chart.data)return{};let r=e.type,a=e.options&&e.options.checkable,i=e.options&&e.options.transparent,s={backgroundColors:[],borderColors:[],hoverBackgroundColors:[],hoverBorderColors:[],checkedBackgroundColors:[],checkedHoverBackgroundColors:[],legendColors:[],pointHoverColors:[]};return this.chart.data.chartValueGroups.forEach(l=>{let d=o.styles.hexToRgb(l.colorHexValue),h=(B,V)=>this._adjustColorOpacity(o.styles.darkerColor(d,V),B),c=1,p=1,f=.1,m=.1,y=.2,_=.35,b=1,g=0,T=1,v=.1;o.scout.isOneOf(r,u.Type.PIE,u.Type.DOUGHNUT)?(y=.7,_=.85,g=.1,v=0):r===u.Type.POLAR_AREA?(c=.7,p=.85,y=.7,_=.85,g=.1,v=0):o.scout.isOneOf(l.type||r,u.Type.LINE,u.Type.RADAR)?(c=.2,p=.35,f=0,m=0,b=.2,T=.35,v=0):o.scout.isOneOf(r,u.Type.BUBBLE,u.Type.SCATTER)&&(c=.2,p=.35,f=0),s.backgroundColors.push(h(a||i?y:c,0)),s.borderColors.push(h(1,0)),s.hoverBackgroundColors.push(h(a||i?_:p,a||i?0:f)),s.hoverBorderColors.push(h(1,m)),s.checkedBackgroundColors.push(h(b,g)),s.checkedHoverBackgroundColors.push(h(T,v)),s.legendColors.push(h(1,0)),s.pointHoverColors.push(h(1,0))}),s.datalabelColor=this._computeDatalabelColor(r),s}_adjustColorOpacity(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return!e||typeof e=="function"?e:e.indexOf("rgb")===0?this._adjustRgbColorOpacity(e,t):e.indexOf("#")===0?this._adjustHexColorOpacity(e,t):e}_adjustRgbColorOpacity(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;if(!e||e.indexOf("rgb")!==0)return e;let r=o.styles.rgb(e);return r.alpha=t,"rgba("+r.red+", "+r.green+", "+r.blue+", "+r.alpha+")"}_adjustHexColorOpacity(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return!e||e.indexOf("#")!==0||!(e.length===4||e.length===5||e.length===7||e.length===9)?e:this._adjustRgbColorOpacity(o.styles.hexToRgb(e),t)}_adjustLegendColors(e){!e||!e.type||!e.options||(e.options=C().extend(!0,{},e.options,{plugins:{legend:{labels:{color:this._computeLabelColor(e.type),generateLabels:this._legendLabelGenerator}}}}))}_computeLabelColor(e){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","label"],"fill").fill}_generateLegendLabels(e){let t=e.config,r;k.Chart.overrides[t.type]&&k.Chart.overrides[t.type].plugins&&k.Chart.overrides[t.type].plugins.legend&&k.Chart.overrides[t.type].plugins.legend.labels&&(r=k.Chart.overrides[t.type].plugins.legend.labels.generateLabels);let i=(r||k.Chart.defaults.plugins.legend.labels.generateLabels).call(e,e);if(this.removing)return i;let s=t.data,l=e.ctx.measureText.bind(e.ctx),d=e.legend,h=d.getProps(["width","maxWidth"]),c=((d||{}).options||{}).labels||{},p=c.boxWidth||0,f=c.padding||0,m;return o.scout.isOneOf(t.options.plugins.legend.position,u.Position.LEFT,u.Position.RIGHT)?((h.maxWidth||d.width)&&(m=Math.max((h.maxWidth||d.width)-p-2*f,0)),m=Math.min(250,m||0,this.$canvas.cssWidth()/3)):m=Math.min(250,this.$canvas.cssWidth()*2/3),i.forEach((y,_)=>{y.text=o.strings.truncateText(y.text,m,l);let b=s.datasets[_],g,T,v;b&&o.scout.isOneOf(b.type||t.type,u.Type.LINE,u.Type.BAR,u.Type.RADAR,u.Type.BUBBLE,u.Type.SCATTER)?(g=b.legendColor,T=this._adjustColorOpacity(b.borderColor,1)):s.datasets.length&&o.scout.isOneOf(t.type,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(b=s.datasets[0],g=Array.isArray(b.legendColor)?b.legendColor[_]:b.legendColor,v=Array.isArray(b.backgroundColor)?b.backgroundColor[_]:b.backgroundColor,v=this._adjustColorOpacity(v,1)),o.objects.isFunction(g)&&(g=g.call(e,_));let B=g||v||T;o.objects.isFunction(B)||(y.fillStyle=B,y.strokeStyle=B)}),i}_adjustScalesRColors(e){if(!e||!e.type||!e.options||!e.options.scales||!e.options.scales.r)return;let t=this._computeLabelColor(e.type),r=this._computeLabelBackdropColor(e.type),a=this._computeGridColor(e.type),i=this._computeScaleTicksColor(e.type);e.options.scales.r.ticks=C().extend(!0,{},e.options.scales.r.ticks,{color:i,backdropColor:r}),e.options.scales.r.pointLabels=C().extend(!0,{},e.options.scales.r.pointLabels,{color:t}),e.options.scales.r.grid=C().extend(!0,{},e.options.scales.r.grid,{color:a})}_computeLabelBackdropColor(e){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","label-backdrop"],"fill",{fill:this.firstOpaqueBackgroundColor}).fill}_computeGridColor(e){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","grid"],"fill").fill}_computeScaleTicksColor(e){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","scale-ticks"],"fill").fill}_adjustScalesXYColors(e){if(!e||!e.type||!e.options||!e.options.scales)return;let t=[];if(e.options.scales.x&&t.push(e.options.scales.x),e.options.scales.y&&t.push(e.options.scales.y),!t.length)return;let r=this._computeLabelColor(e.type),a=this._computeGridColor(e.type),i=this._computeAxisLabelColor(e.type);t.forEach(s=>{s.grid=C().extend(!0,{},s.grid,{color:a}),s.ticks=C().extend(!0,{},s.ticks,{color:r}),s.title=C().extend(!0,{},s.title,{color:i})})}_computeAxisLabelColor(e){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","axis-label"],"fill").fill}_adjustPluginColors(e){!e||!e.type||!e.options||!e.options.plugins||this._adjustPluginsDatalabelColors(e)}_adjustPluginsDatalabelColors(e){!e||!e.type||!e.options||!e.options.plugins||!e.options.plugins.datalabels||(e.options.plugins.datalabels=C().extend(!0,{},e.options.plugins.datalabels,{color:this._computeDatalabelColor(e.type)}))}_computeDatalabelColor(e){return o.styles.get([this.colorSchemeCssClass,e+"-chart","elements","datalabel"],"fill").fill}_adjustClickHandler(e){if(!e||!e.options||(e.options.clickable?(e.options.onClick=this._clickHandler,e.options.onHover=this._pointerHoverHandler):e.options.onHover=this._hoverHandler,!e.options.plugins||!e.options.plugins.legend))return;let t=e.options.plugins.legend;t.clickable?(t.onClick=this._legendClickHandler,t.onHover=this._legendPointerHoverHandler,t.onLeave=this._legendPointerLeaveHandler):(t.onClick=r=>r.native.stopPropagation(),t.onHover=this._legendHoverHandler,t.onLeave=this._legendLeaveHandler)}_onClick(e,t){if(!t.length)return;let r=this._selectRelevantItem(t);if(this._isMaxSegmentsExceeded(this.chartJs.config,r.index))return;let a=r.index,i=r.datasetIndex,s={datasetIndex:i,dataIndex:a};if(o.scout.isOneOf(this.chartJs.config.type,u.Type.BUBBLE,u.Type.SCATTER)){let l=this.chartJs.config.data.datasets[i].data[a];s.xIndex=l.x,s.yIndex=l.y}else s.xIndex=a;this.chart.handleValueClick(s,e.native)}_selectRelevantItem(e){let t=this.chartJs.config.data.datasets,r=e[0];return this.chartJs.config.type===u.Type.BUBBLE&&e.forEach(a=>{t[a.datasetIndex].data[a.index].z<=t[r.datasetIndex].data[r.index].z&&(r=a)}),r}_onHover(e,t){if(!this.chartJs.config||!this.chartJs.config.type)return;let r=this.chartJs.config,a=r.type;if(!o.scout.isOneOf(a,u.Type.LINE,u.Type.BAR,u.Type.RADAR))return;let i=!1;this.resetDatasetAfterHover&&(this._restoreBackgroundColor(),this.resetDatasetAfterHover=!1,i=!0),t.forEach(s=>{let l=r.data.datasets[s.datasetIndex];o.scout.isOneOf(l.type||a,u.Type.LINE,u.Type.RADAR)&&(this._setHoverBackgroundColor(l),this.resetDatasetAfterHover=!0,i=!0)}),i&&this.chartJs.update()}_onHoverPointer(e,t){this._onHover(e,t),!(!this.rendered||this.removing)&&(t.length&&!this._isMaxSegmentsExceeded(this.chartJs.config,t[0].index)?this.$canvas.css("cursor","pointer"):this.$canvas.css("cursor","default"))}_onLegendClick(e,t,r){if(!this.chartJs.config||!this.chartJs.config.type)return;let a=this.chartJs.config.type,i;k.Chart.overrides[a]&&k.Chart.overrides[a].plugins&&k.Chart.overrides[a].plugins.legend&&(i=k.Chart.overrides[a].plugins.legend.onClick),(i||k.Chart.defaults.plugins.legend.onClick).call(this.chartJs,e,t,r),this._onLegendLeave(e,t,r),this._onLegendHoverPointer(e,t,r)}_onLegendHover(e,t,r){let a=t.datasetIndex,i=this.chartJs.config,s=i.type;if(o.scout.isOneOf(s,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(a=t.index),this.legendHoverDatasets.indexOf(a)>-1)return;let l=i.data.datasets[a];((l?l.type:null)||s)===u.Type.LINE&&(this._setHoverBackgroundColor(l),this.chartJs.update()),this._updateHoverStyle(a,!0),this.chartJs.render(),this.legendHoverDatasets.push(a)}_onLegendHoverPointer(e,t,r){this._onLegendHover(e,t,r),!(!this.rendered||this.removing)&&this.$canvas.css("cursor","pointer")}_onLegendLeave(e,t,r){let a=t.datasetIndex,i=this.chartJs.config,s=i.type;if(o.scout.isOneOf(s,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)&&(a=t.index),this.legendHoverDatasets.indexOf(a)<0)return;let l=i.data.datasets[a];((l?l.type:null)||s)===u.Type.LINE&&(this._restoreBackgroundColor(l),this.chartJs.update()),this._updateHoverStyle(a,!1),this.chartJs.render(),this.legendHoverDatasets.splice(this.legendHoverDatasets.indexOf(a),1)}_setHoverBackgroundColor(e){!e||(e.backgroundColorBackup=e.backgroundColor,e.backgroundColor=e.hoverBackgroundColor,this._adjustDatasetBorderWidths(e))}_restoreBackgroundColor(e){e?(e.backgroundColor=e.backgroundColorBackup||e.backgroundColor,delete e.backgroundColorBackup,this._adjustDatasetBorderWidths(e)):this.chartJs.config.data.datasets.forEach(t=>this._restoreBackgroundColor(t))}_onLegendLeavePointer(e,t,r){this._onLegendLeave(e,t,r),!(!this.rendered||this.removing)&&this.$canvas.css("cursor","default")}_updateHoverStyle(e,t){let r=this.chartJs.config,a=r.type,i,s=[],l=r.data.datasets,d=l?l[e]:null,h=d?d.type:null;o.scout.isOneOf(a,u.Type.LINE,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA,u.Type.SCATTER)||h===u.Type.LINE?i="point":i="dataset",o.scout.isOneOf(a,u.Type.PIE,u.Type.DOUGHNUT,u.Type.POLAR_AREA)?this.chartJs.getSortedVisibleDatasetMetas().forEach((c,p)=>s.push({element:c.data[e],datasetIndex:p,index:e})):this.chartJs.getDatasetMeta(e).data.forEach((c,p)=>s.push({element:c,datasetIndex:e,index:p})),s&&s.length&&this.chartJs.updateHoverStyle(s,i,t)}_adjustResizeHandler(e){!e||!e.options||e.options.handleResize&&(e.options.onResize=this._resizeHandler)}_onResize(e,t){e.update(),this._adjustSize(e.config,e.chartArea)}_adjustSize(e,t){this._adjustBubbleSizes(e,t),this._adjustGridMaxMin(e,t)}_adjustBubbleSizes(e,t){if(e.type!==u.Type.BUBBLE)return;let r=e.data.datasets;r.forEach(p=>p.data.forEach(f=>{isNaN(f.z)||(f.r=Math.sqrt(f.z))}));let a=this._computeMaxMinValue(e,r,"r",!0),i=a.maxValue,s=a.minValue,l=1,d=0,h=(e.options||{}).bubble?e.options.bubble.sizeOfLargestBubble:0,c=(e.options||{}).bubble?e.options.bubble.minBubbleSize:0;if(h){let p=Math.abs(t.right-t.left),f=Math.abs(t.top-t.bottom);h=Math.min(h,Math.floor(Math.min(p,f)/6)),i===0?d=h:c&&h>c&&s/i<c/h?(l=(h-c)/(i-s),d=c-l*s):l=h/i}else c&&c>s&&(s===0?d=c:l=c/s);r.forEach(p=>p.data.forEach(f=>{o.objects.isNullOrUndefined(f.r)||(f.r=f.r*l+d)}))}_computeMaxMinValue(e,t,r,a,i,s,l){if(!t)return;let d,h;if(e.type===u.Type.SCATTER&&r==="r")d=0,h=0;else for(let m=0;m<t.length;m++)for(let y=0;y<t[m].data.length;y++){let _;r?_=t[m].data[y][r]:_=t[m].data[y],isNaN(d)?d=_:d=Math.max(_,d),isNaN(h)?h=_:h=Math.min(_,h)}isNaN(d)&&(d=0),isNaN(h)&&(h=0);let c=0,p=d,f=h;if(a||(i&&Math.sign(h)===Math.sign(d)&&(c=Math.floor(h)),p=this._calculateBoundary(d-c,Math.ceil,Math.floor),f=this._calculateBoundary(h-c,Math.floor,Math.ceil)),s&&l&&l>2*s){let m=(d-h)/(l-2*s),y=m*s;p=Math.max(p,d-c+y),f=Math.min(f,h-c-y)}return a?{maxValue:p,minValue:f}:{maxValue:p+c,minValue:f+c}}_calculateBoundary(e,t,r){let a=t,i=!1;return e<0&&(i=!0,e=e*-1,a=r),e=this._calculateBoundaryPositive(e,a),i&&(e=e*-1),e}_calculateBoundaryPositive(e,t){if(!(e>0)||!t)return e;let r=Math.floor(Math.log(e)/Math.LN10);return r<0?e=t(e*Math.pow(10,Math.abs(r))/5)*5/Math.pow(10,Math.abs(r)):e=t(e/(5*Math.pow(10,r-1)))*5*Math.pow(10,r-1),e}_adjustGridMaxMin(e,t){if(!e||!e.type||!e.options||!e.options.adjustGridMaxMin||!e.options.scales||!t)return;let r=e.type;if(!o.scout.isOneOf(r,u.Type.BAR,u.Type.LINE,u.Type.POLAR_AREA,u.Type.RADAR,u.Type.BUBBLE,u.Type.SCATTER))return;let a=e.options.scales,i=a.x,s=a.y,l=a.r,d=i?i.minSpaceBetweenTicks:1,h=s?s.minSpaceBetweenTicks:1;l&&(d=l.minSpaceBetweenTicks,h=l.minSpaceBetweenTicks);let c=Math.abs(t.right-t.left),p=Math.abs(t.top-t.bottom),f=Math.max(Math.floor(c/d)+1,3),m=Math.max(Math.floor(p/h)+1,3),y=this._computeYBoundaries(e,p),_=y.yBoundary,b=y.yBoundaryDiffType;if(l){this._adjustAxisMaxMin(l,Math.ceil(Math.min(f,m)/2),_);return}if(b?(this._adjustAxisMaxMin(s,m,_),this._adjustAxisMaxMin(a.yDiffType,m,b)):this._isHorizontalBar(e)?this._adjustAxisMaxMin(i,f,_):this._adjustAxisMaxMin(s,m,_),!o.scout.isOneOf(r,u.Type.BUBBLE,u.Type.SCATTER))return;let g=this._computeXBoundaryPointElement(e,c);this._adjustAxisMaxMin(i,f,g)}_computeBoundaryPointElement(e,t,r){if(!e||!e.type||!o.scout.isOneOf(e.type,u.Type.BUBBLE,u.Type.SCATTER)||!e.data||!e.options||!e.options.scales||!(t==="x"||t==="y")||!r)return;let a=e.data.datasets,i=e.options.scales[t],s=i&&i.offset,l=e.options[t+"LabelMap"],d,h=this._computeMaxMinValue(e,a,"r",!0).maxValue,c=h;return e.options.elements&&e.options.elements.point&&e.options.elements.point.hoverRadius&&(c=c+e.options.elements.point.hoverRadius),s?d=this._computeMaxMinValue(e,a,t,l,!0):d=this._computeMaxMinValue(e,a,t,l,!0,c,r),l&&(d.maxValue=Math.ceil(d.maxValue),d.minValue=Math.floor(d.minValue)),d}_computeXBoundaryPointElement(e,t){return this._computeBoundaryPointElement(e,"x",t)}_computeYBoundaryPointElement(e,t){return this._computeBoundaryPointElement(e,"y",t)}_computeYBoundaries(e,t){if(!e||!e.type)return{};let r=e.type,a,i;if(o.scout.isOneOf(r,u.Type.BUBBLE,u.Type.SCATTER))a=this._computeYBoundaryPointElement(e,t);else{let s=[],l=[];if(e.data&&e.data.datasets&&e.data.datasets.forEach(d=>{d.type&&d.type!==r?l.push(d):s.push(d)}),a=this._computeMaxMinValue(e,s),s.length&&l.length){i=this._computeMaxMinValue(e,l);let d=a.maxValue-a.minValue,h=i.maxValue-i.minValue;d&&h&&(d/h>10||h/d>10)&&this._adjustYAxisDiffType(e,s,l)}}return{yBoundary:a,yBoundaryDiffType:i}}_adjustYAxisDiffType(e,t,r){if(!e||!e.type||!t||!t.length||!r||!r.length||!e.options||!e.options.scales||!e.options.scales.y||e.options.scales.yDiffType)return;let a=e.type,i=e.options,s=i.scales,l=s.y,d=C().extend(!0,{},l);s.yDiffType=d,e.data&&e.data.datasets&&e.data.datasets.length&&e.data.datasets[0].type&&e.data.datasets[0].type!==a?(d.position=u.Position.LEFT,l.position=u.Position.RIGHT,l.grid.drawOnChartArea=!1):(l.position=u.Position.LEFT,d.position=u.Position.RIGHT,d.grid.drawOnChartArea=!1),l.grid.drawBorder=!0,l.grid.drawTicks=!0,d.grid.drawBorder=!0,d.grid.drawTicks=!0;let h=t[0].type||a,c=r[0].type||a,p=this.chart.session.text("ui."+h),f=this.chart.session.text("ui."+c),m=i.scaleLabelByTypeMap?i.scaleLabelByTypeMap[h]:null,y=i.scaleLabelByTypeMap?i.scaleLabelByTypeMap[c]:null;l.title.display=!0,l.title.text=m?m+" ("+p+")":p,d.title.display=!0,d.title.text=y?y+" ("+f+")":f,t.forEach(_=>{_.yAxisID="y"}),r.forEach(_=>{_.yAxisID="yDiffType"})}_adjustAxisMaxMin(e,t,r){if(!e)return;let a=1;e.ticks=C().extend(!0,{},e.ticks,{maxTicksLimit:t}),r&&(e.suggestedMax=r.maxValue,e.suggestedMin=r.minValue,a=(r.maxValue-r.minValue)/(t-1)),e.ticks.stepSize=this.onlyIntegers&&a<1?1:void 0}_remove(e){this.rendered&&!this.removing&&(this.removing=!0,this.chartJs.destroy(),this.chartJs=null,this.$canvas.remove(),this.$canvas=null),super._remove(e),this.removing=!1}}A(X,"ARROW_LEFT_RIGHT","↔"),A(X,"ARROW_UP_DOWN","↕");function oe(n,e,t){return e=ot(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ot(n){var e=ht(n,"string");return typeof e=="symbol"?e:String(e)}function ht(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class xe extends D{constructor(e){super(e),oe(this,"animationTriggered",void 0),oe(this,"segmentSelectorForAnimation",void 0),oe(this,"r",void 0),oe(this,"fullR",void 0),this.animationTriggered=!1,this.segmentSelectorForAnimation=".fulfillment-chart",this.suppressLegendBox=!0;let t={options:{fulfillment:{startValue:void 0}}};e.config=C().extend(!0,{},t,e.config)}_validate(){let e=this.chart.data.chartValueGroups;return!(e.length!==2||e[0].values.length!==1||e[1].values.length!==1)}_renderInternal(){let e=this.chart.data,t=e.chartValueGroups[0].values[0],r=e.chartValueGroups[1].values[0];this.fullR=Math.min(this.chartBox.height,this.chartBox.width)/2-2,this._renderInnerCircle(),this._renderPercentage(t,r)}_renderPercentage(e,t){let r="fulfillment-chart",a=this.chart.data.chartValueGroups[0].colorHexValue,i=this.chart.data.chartValueGroups[0].cssClass;this.chart.config.options.autoColor?r+=" auto-color":i&&(r+=" "+i);let s=o.scout.nvl(this.chart.config.options.fulfillment.startValue,0),l=0,d=0;t&&(l=Math.min(e/t,.999999),d=Math.min(s/t,.999999)),this.r=this.fullR;let h=this,c=function(b,g){let T=C()(this),v=T.data("animation-start"),B=T.data("animation-end");T.attr("d",h.pathSegment(v*g.pos,d+(B-d)*g.pos))},p=this.$svg.appendSVG("path",r).data("animation-start",0).data("animation-end",l),f=this.fullR/8*6.7;this._renderCirclePath("fulfillment-chart-inner-circle-transparent","InnerCircle3",f).css("fill",this.firstOpaqueBackgroundColor);let y=t?Math.round(e/t*100):0,_=this.$svg.appendSVG("text","fulfillment-chart-label ").attr("x",this.chartBox.mX()).attr("y",this.chartBox.mY()).css("font-size",this.fullR/2+"px").attr("dy","0.3em").attrXLINK("href","#InnerCircle").text(y+"%");this.chart.config.options.clickable&&p.on("click",this._createClickObject(null,null),b=>this.chart.handleValueClick(b.data)),!this.chart.config.options.autoColor&&!i&&p.attr("fill",a),this.animationDuration?(p.attr("d",this.pathSegment(0,d)).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(c,this.animationDuration)),_.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)):p.attr("d",this.pathSegment(0,l))}pathSegment(e,t){let r=e*2*Math.PI,a=t*2*Math.PI,i="";return i+="M"+(this.chartBox.mX()+this.r*Math.sin(r))+","+(this.chartBox.mY()-this.r*Math.cos(r)),i+="A"+this.r+", "+this.r,i+=t-e<.5?" 0 0,1 ":" 0 1,1 ",i+=this.chartBox.mX()+this.r*Math.sin(a)+","+(this.chartBox.mY()-this.r*Math.cos(a)),i+="L"+this.chartBox.mX()+","+this.chartBox.mY()+"Z",i}_renderCirclePath(e,t,r){let a=this.chart.data.chartValueGroups[0].cssClass,i=this.chart.data.chartValueGroups[1].colorHexValue;this.chart.config.options.autoColor?e+=" auto-color":a&&(e+=" "+a);let s=r*2,l=this.$svg.appendSVG("path",e).attr("id",t).attr("d","M "+this.chartBox.mX()+" "+this.chartBox.mY()+" m 0, "+-r+" a "+r+","+r+" 0 1, 1 0,"+s+" a "+r+","+r+" 0 1, 1 0,"+-s);return!this.chart.config.options.autoColor&&!a&&l.attr("fill",i).attr("stroke",i),l}_renderInnerCircle(){let e=this.fullR/8*7.5,t=this.fullR/8*7.2;this._renderCirclePath("fulfillment-chart-inner-circle","InnerCircle",e),this._renderCirclePath("fulfillment-chart-inner-circle-transparent","InnerCircle2",t).css("fill",this.firstOpaqueBackgroundColor)}shouldAnimateRemoveOnUpdate(e){let t=o.objects.optProperty(this.chart,"config","options","fulfillment","startValue");return o.objects.isNullOrUndefined(t)?super.shouldAnimateRemoveOnUpdate(e):!1}_removeAnimated(e){if(this.animationTriggered)return;let t=this,r=function(a,i){let s=C()(this),l=s.data("animation-start"),d=s.data("animation-end");s.attr("d",t.pathSegment(l*(1-i.pos),d*(1-i.pos)))};this.animationTriggered=!0,this.$svg.children(this.segmentSelectorForAnimation).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r)).promise().done(()=>{this._remove(e),this.animationTriggered=!1})}}function O(n,e,t){return e=dt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function dt(n){var e=ut(n,"string");return typeof e=="symbol"?e:String(e)}function ut(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class x extends D{constructor(e){super(e),O(this,"segmentSelectorForAnimation",void 0),O(this,"r",void 0),O(this,"scaleWeight",void 0),O(this,"my",void 0),O(this,"parts",void 0),O(this,"numSegmentsPerPart",void 0),O(this,"segmentWidth",void 0),O(this,"widthOfSegmentWithGap",void 0),O(this,"animationTriggered",void 0),O(this,"$filledParts",void 0),O(this,"$pointer",void 0),this.segmentSelectorForAnimation=".pointer",this.suppressLegendBox=!0;let t={options:{speedo:{greenAreaPosition:void 0}}};e.config=$.extend(!0,{},t,e.config)}_validate(){let e=this.chart.data,t=this.chart.config;return!(!e||!t||e.axes.length>0||e.chartValueGroups.length!==1||e.chartValueGroups[0].values.length!==3||t.options.speedo.greenAreaPosition===void 0)}_renderInternal(){let e=this.chart.data,t=e.chartValueGroups[0].values[0],r=e.chartValueGroups[0].values[2],a=e.chartValueGroups[0].values[1];this.r=Math.min(this.chartBox.height,this.chartBox.width/2)*.7,this.scaleWeight=this.r*.27,this.my=this.chartBox.yOffset+this.chartBox.height-(this.chartBox.height-this.r*1.12)/2,this.parts=this.chart.config.options.speedo.greenAreaPosition===x.Position.CENTER?x.NUM_PARTS_GREEN_CENTER:x.NUM_PARTS_GREEN_EDGE,this.numSegmentsPerPart=this.parts===x.NUM_PARTS_GREEN_CENTER?5:8,this.$filledParts=[];let i=this.parts*this.numSegmentsPerPart,s=i-1;this.segmentWidth=(x.ARC_RANGE-s*x.SEGMENT_GAP)/i,this.widthOfSegmentWithGap=this.segmentWidth+x.SEGMENT_GAP;let l=this._getValuePercentage(a,t,r),d=this._getSegmentToPointAt(l,i),h=this._getPercentageValueOfSegment(d%this.numSegmentsPerPart,this._getPartForValue(l));for(let c=0;c<this.parts;c++)this._renderCirclePart(c);this._renderPointer(h),this._renderLegend(t,a,r,e.chartValueGroups[0].groupName),this.$svg.addClass("speedo-chart-svg"),this.chart.config.options.clickable&&this.$svg.on("click",this._createClickObject(null,null),c=>this.chart.handleValueClick(c.data))}_getValuePercentage(e,t,r){return this._limitValue((e-t)/(r-t),1)}_getSegmentToPointAt(e,t){return this._limitValue(Math.floor(e*t),t-1)}_limitValue(e,t){return e=Math.max(e,0),e=Math.min(e,t),e}_getPercentageValueOfSegment(e,t){let r=this._calcSegmentPos(e,t),a=r.from-x.ARC_MIN+(r.to-r.from)/2;return this._limitValue(a/x.ARC_RANGE,1)}_renderPointer(e){if(this.$pointer=this.$svg.appendSVG("path","pointer").attr("d",this._pathPointer(0)).attr("data-end",e).attr("stroke-width",this.scaleWeight/6+"px").attr("fill","none"),this.animationDuration){let t=this,r=function(a,i){let s=this.getAttribute("data-end")*i.pos;t._updatePointer(s),t._updatePartsFill(s)};this.$pointer.animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r,this.animationDuration))}else this._updatePointer(e),this._updatePartsFill(e)}_renderSegment(e,t,r){return this.$svg.appendSVG("path","speedo-chart-arc "+r).attr("id","ArcAxisWide"+this.chart.id).attr("fill","none").attr("stroke-width",this.scaleWeight+"px").attr("d",this._pathSegment(e,t))}_renderCirclePart(e){let t=this._getColorForPart(e);for(let r=0;r<this.numSegmentsPerPart;r++){let a=this._calcSegmentPos(r,e);this._renderSegment(a.from,a.to,t)}this.$filledParts.push(this._renderSegment(x.ARC_MIN,x.ARC_MIN,t))}_renderLegend(e,t,r,a){let i=this.scaleWeight*.8,s=5,l=this.my+s,d=l+i*.8,h={x1:null,x2:this.chartBox.mX()-s,y1:null,y2:l,v:-1,h:1},c=e?this._formatValue(e):0,p=t?this._formatValue(t):""+0,f=r?this._formatValue(r):0;if(this.chart.config.options.plugins.tooltip.enabled){let m=this.$svg.appendSVG("text","line-label line-chart-wire-label").attr("x",this.chartBox.mX()-this.r).attr("y",d).text(c).attr("style","font-size: "+i+"px; text-anchor: middle"),y=this.$svg.appendSVG("text","line-label line-chart-wire-label").attr("x",this.chartBox.mX()+this.r).attr("y",d).text(f).attr("style","font-size: "+i+"px; text-anchor: middle"),_=function(){this.$svg.append(m),this.$svg.append(y)}.bind(this),b=()=>{m.detach(),y.detach()};b(),this.$svg.on("mouseenter",_).on("mouseleave",b)}this.chart.config.options.plugins.legend.display&&this._renderLineLabel(h.x2+s,h.y2+h.v*s,p,"",!1).addClass("speedo-chart-label").attr("style","font-size: "+this.scaleWeight*1.55+"px;")}_getPartForValue(e){let t=Math.floor(e*this.parts);return this._limitValue(t,this.parts-1)}_formatValue(e){if(e<x.TEN_THOUSAND)return this.session.locale.decimalFormat.format(e);if(e<x.ONE_MILLION)return Math.floor(e/x.ONE_THOUSAND)+"k";let t=e/x.ONE_MILLION;return t=o.numbers.round(t,o.RoundingMode.HALF_UP,2),this.session.locale.decimalFormat.format(t)+"M"}_updatePointer(e){this.$pointer.attr("d",this._pathPointer(e)).removeClass("red yellow light-green dark-green").addClass(this._getColorForPart(this._getPartForValue(e)))}_updatePartsFill(e){let t,r;for(let a=0;a<this.$filledParts.length;a++)t=this._calcSegmentPos(0,a).from,(a+1)/this.parts<e?r=this._calcSegmentPos(this.numSegmentsPerPart-1,a).to:a/this.parts>e?(t=x.ARC_MIN,r=x.ARC_MIN):r=x.ARC_RANGE*e-x.ARC_MAX,this.$filledParts[a].attr("d",this._pathSegment(t,r))}_calcSegmentPos(e,t){let r={from:0,to:0},a=e+t*this.numSegmentsPerPart;return r.from=a*this.widthOfSegmentWithGap-x.ARC_MAX,r.to=r.from+this.segmentWidth,r}_getColorForPart(e){switch(this.chart.config.options.speedo.greenAreaPosition){case x.Position.LEFT:if(e===0)return"dark-green";if(e===1)return"light-green";if(e===2)return"yellow";if(e===3)return"red";break;case x.Position.RIGHT:if(e===0)return"red";if(e===1)return"yellow";if(e===2)return"light-green";if(e===3)return"dark-green";break;case x.Position.CENTER:if(e===0)return"red";if(e===1)return"yellow";if(e===2)return"light-green";if(e===3)return"dark-green";if(e===4)return"light-green";if(e===5)return"yellow";if(e===6)return"red";break;default:break}}_pathSegment(e,t){let r=e*2*Math.PI,a=t*2*Math.PI,i="";return i+="M "+(this.chartBox.mX()+this.r*Math.sin(r))+" "+(this.my-this.r*Math.cos(r))+" ",i+="A "+this.r+" "+this.r+" ",i+="0 "+(t-e<.5?"0":"1")+" 1 ",i+=this.chartBox.mX()+this.r*Math.sin(a)+" "+(this.my-this.r*Math.cos(a)),i}_pathPointer(e){let r=(x.ARC_RANGE*e-x.ARC_MAX)*2*Math.PI,a=this.r-1.4*this.scaleWeight,i=this.r+1.37*this.scaleWeight,s="";return s+="M "+(this.chartBox.mX()+i*Math.sin(r))+" "+(this.my-i*Math.cos(r))+" ",s+="L "+(this.chartBox.mX()+a*Math.sin(r))+" "+(this.my-a*Math.cos(r))+" ",s+="Z",s}_removeAnimated(e){if(this.animationTriggered)return;let t=this,r=function(a,i){let s=this.getAttribute("data-end")*(1-i.pos);t._updatePointer(s),t._updatePartsFill(s)};this.animationTriggered=!0,this.$svg.children(this.segmentSelectorForAnimation).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r)).promise().done(()=>{this._remove(e),this.animationTriggered=!1})}}O(x,"Position",{LEFT:"left",CENTER:"center",RIGHT:"right"}),O(x,"NUM_PARTS_GREEN_CENTER",7),O(x,"NUM_PARTS_GREEN_EDGE",4),O(x,"ONE_THOUSAND",1e3),O(x,"TEN_THOUSAND",1e4),O(x,"ONE_MILLION",1e6),O(x,"ARC_MIN",-.25),O(x,"ARC_MAX",.25),O(x,"ARC_RANGE",x.ARC_MAX-x.ARC_MIN),O(x,"SEGMENT_GAP",.0103);function H(n,e,t){return e=ct(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ct(n){var e=pt(n,"string");return typeof e=="symbol"?e:String(e)}function pt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Te extends D{constructor(e){super(e),H(this,"segmentSelectorForAnimation",void 0),H(this,"widthThresholdMedium",void 0),H(this,"widthThresholdSmall",void 0),H(this,"barDeltaPercentage",void 0),H(this,"lastBarAdditionalPercentage",void 0),H(this,"lastBarMinWidthPercentage",void 0),H(this,"paddingBetweenLabel",void 0),H(this,"dataAnalyzeResult",void 0),H(this,"barHeight",void 0),H(this,"barAreaWidth",void 0),H(this,"centerX",void 0),H(this,"animationTriggered",void 0),this.segmentSelectorForAnimation=".salesfunnel-chart-bar",this.widthThresholdMedium=400,this.widthThresholdSmall=200,this.barDeltaPercentage=.95,this.lastBarAdditionalPercentage=.7,this.lastBarMinWidthPercentage=.4,this.suppressLegendBox=!0;let t={options:{salesfunnel:{normalized:void 0,calcConversionRate:void 0}}};e.config=C().extend(!0,{},t,e.config)}_validate(){let e=this.chart.data,t=this.chart.config;return!(!e||!t||e.axes.length!==e.chartValueGroups.length||e.chartValueGroups.length===0||e.chartValueGroups[0].values.length===0||t.options.salesfunnel.normalized===void 0||t.options.salesfunnel.calcConversionRate===void 0)}_renderInternal(){let e=this.chart.data,t=e.chartValueGroups.length,r=this._dynamicConversionRateWidth();this.paddingBetweenLabel=20,this.dataAnalyzeResult=this._analyzeData(e.chartValueGroups),this.barHeight=this.chartBox.height/t,this.barAreaWidth=this.chartBox.width-this.dataAnalyzeResult.maxLengthFirstValueRow-this.paddingBetweenLabel*this.dataAnalyzeResult.labelCount-this.dataAnalyzeResult.maxLengthSecondValueRow-r,this.centerX=this.barAreaWidth/2,this.chart.config.options.salesfunnel.normalized?this._renderBarsNormalized(e.chartValueGroups):this._renderBarsAccordingToValues(e.chartValueGroups),this._addClipping("salesfunnel-chart-bar")}_renderBarsNormalized(e){let t=e.length,r=this.barAreaWidth+this.dataAnalyzeResult.maxLengthFirstValueRow+this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel*(this.dataAnalyzeResult.labelCount+1),a=this.barAreaWidth*(1-this.barDeltaPercentage),s=this.barAreaWidth*this.lastBarMinWidthPercentage/this.lastBarAdditionalPercentage;a=Math.min(a,(this.barAreaWidth-s)/(t-1));for(let l=0;l<t;l++){let d=this.barAreaWidth-l*a,h=e[l].groupName,c=this.barAreaWidth-(l+1)*a,p=l*this.barHeight,f={xStart:this.centerX,yStart:p,rect:!0,width:d,widthBottom:c,cssClass:"salesfunnel-chart-bar",fill:e[l].colorHexValue,label:e[l].groupName,clickObject:this._createClickObject(null,l)};this.chart.config.options.autoColor?f.cssClass+=" auto-color color0":this.chart.data.chartValueGroups[l].cssClass&&(f.cssClass+=" "+this.chart.data.chartValueGroups[l].cssClass),l===t-1&&(f.width=f.width*this.lastBarAdditionalPercentage,f.widthBottom=f.widthBottom*this.lastBarAdditionalPercentage),this._renderPolygon(f),this._renderLabel(e[l].values[0],!1,l),this._renderBarLabel(h,l,f.widthBottom);let m=this.dataAnalyzeResult.maxLengthFirstValueRow+this.paddingBetweenLabel;e[l].values.length>1&&(this._renderLabel(e[l].values[1],!0,l),m+=this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel),l>0&&(this._renderLabelSeparatorLine(p,m),this.chart.config.options.salesfunnel.calcConversionRate&&this._renderConversionRate(l,r,this._calcConversionRate(e[l-1].values[0],e[l].values[0])))}}_renderLabel(e,t,r){if(e===null)return;let a=r*this.barHeight+this.barHeight/2,i=this.dataAnalyzeResult.maxLengthFirstValueRow+(t?this.dataAnalyzeResult.maxLengthSecondValueRow:0),s=t?2:1,l=this.barAreaWidth+i+s*this.paddingBetweenLabel,d=this._dynamicCssClass("salesfunnel-label"),h=this.$svg.appendSVG("text",d).attr("x",l).attr("y",a).text(this.session.locale.decimalFormat.format(e));if(this.animationDuration&&h.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0),this.chart.config.options.plugins.tooltip.enabled&&this.chart.data.axes.length>0){let c=this.chart.data.axes[r][t?1:0].label,p=this._measureText(""+e,d);this._renderWireLabels(c,h,l-p.width/2,a-p.height)}}_renderWireLabels(e,t,r,a){let i={x1:r,x2:r-10,y1:a,y2:a-10,v:-1,h:-1},s=(c,p)=>(i.y2-p<0&&(i.v=1,i.y1=i.y1+p*1.5,i.y2=i.y1+10),i);i.autoPosition=!0,i.posFunc=s;let l=this._renderWireLegend(e,i,"line-chart-wire-label",!0),d=l.attachFunc.bind(l),h=l.detachFunc.bind(l);l.detachFunc(),t.on("mouseenter",d).on("mouseleave",h)}_renderBarLabel(e,t,r){let a=t*this.barHeight+this.barHeight/2,i=this.centerX,s=this._dynamicCssClass("salesfunnel-bar-label");this._renderLineLabel(i,a,e,s,!0)}_renderConversionRate(e,t,r){if(r===void 0)return;let a=e*this.barHeight,i=this._dynamicCssClass("salesfunnel-conversionrate-label"),s=this.$svg.appendSVG("text",i).attr("x",t).attr("y",a).text("↓ "+r+"%");this.animationDuration&&s.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}_renderPolygon(e){let t=this,r=this._calcPolygonPoints(!0,this.animationDuration?0:1,e.xStart,e.yStart,e.width,e.widthBottom,this.barHeight-1),a=this.$svg.appendSVG("polygon",e.cssClass,"",e.id).attr("points",r).data("xStart",e.xStart).data("yStart",e.yStart).data("widthBar",e.width).data("widthBottom",e.widthBottom).data("heightBar",this.barHeight);!this.chart.config.options.autoColor&&e.fill&&a.attr("fill",e.fill),a.css("stroke",this.firstOpaqueBackgroundColor);let i=function(s,l){let d=C()(this),h=d.data("xStart"),c=d.data("yStart"),p=d.data("widthBar"),f=d.data("heightBar"),m=d.data("widthBottom");d.attr("points",t._calcPolygonPoints(!0,l.pos,h,c,p,m,f))};return this.animationDuration&&a.animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(i,this.animationDuration)),this.chart.config.options.clickable&&a.on("click",e.clickObject,s=>this.chart.handleValueClick(s.data)),e.fill&&a.attr("fill",e.fill),a}_calcPolygonPoints(e,t,r,a,i,s,l){let d=0,h=0;return e?(d=i/2*t,h=s/2*t):(d=i/2-i/2*t,h=s/2-s/2*t),o.strings.join(" ",r-d+","+a,r+d+","+a,r+h+","+(a+l),r-h+","+(a+l))}_renderBarsAccordingToValues(e){let t=this.dataAnalyzeResult.maxValue?this.barAreaWidth*.8/this.dataAnalyzeResult.maxValue:0,r=this.barAreaWidth+this.dataAnalyzeResult.maxLengthFirstValueRow+this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel*this.dataAnalyzeResult.labelCount+2*this.paddingBetweenLabel,a=e.length;for(let i=0;i<a;i++){let s=e[i].values[0]*t+this.barAreaWidth*.2,l=e[i].groupName,d=i*this.barHeight,h={xStart:this.centerX,yStart:d,rect:!0,width:s,widthBottom:s,cssClass:"salesfunnel-chart-bar",fill:e[i].colorHexValue,label:e[i].groupName,clickObject:this._createClickObject(null,i)};this.chart.config.options.autoColor?h.cssClass+=" auto-color color0":this.chart.data.chartValueGroups[i].cssClass&&(h.cssClass+=" "+this.chart.data.chartValueGroups[i].cssClass),this._renderPolygon(h),this._renderLabel(e[i].values[0],!1,i),this._renderBarLabel(l,i,h.widthBottom);let c=this.dataAnalyzeResult.maxLengthFirstValueRow+this.paddingBetweenLabel;e[i].values.length>1&&(this._renderLabel(e[i].values[1],!0,i),c+=this.dataAnalyzeResult.maxLengthSecondValueRow+this.paddingBetweenLabel),i>0&&(this._renderLabelSeparatorLine(d,c),this.chart.config.options.salesfunnel.calcConversionRate&&this._renderConversionRate(i,r,this._calcConversionRate(e[i-1].values[0],e[i].values[0])))}}_renderLabelSeparatorLine(e,t){let r=this.$svg.appendSVG("line","label-separator").attr("x1",this.barAreaWidth+this.paddingBetweenLabel).attr("y1",e).attr("x2",this.barAreaWidth+t).attr("y2",e);this.animationDuration&&r.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}_calcConversionRate(e,t){if(!(o.objects.isNullOrUndefined(e)||o.objects.isNullOrUndefined(t)||e===0))return Math.round(t/e*100)}_analyzeData(e){let t={labelCount:0,maxValue:null,maxLengthFirstValueRow:0,maxLengthSecondValueRow:0},r=this._dynamicCssClass("salesfunnel-label");for(let a=0;a<e.length;a++){let i=e[a];t.labelCount=Math.max(t.labelCount,i.values.length),i.values.length>0&&i.values[0]&&(t.maxValue===null?t.maxValue=i.values[0]:t.maxValue=Math.max(t.maxValue,i.values[0]),t.maxLengthFirstValueRow=Math.max(t.maxLengthFirstValueRow,this._measureText(this.session.locale.decimalFormat.format(i.values[0]),r).width)),i.values.length>1&&i.values[1]&&(t.maxLengthSecondValueRow=Math.max(t.maxLengthSecondValueRow,this._measureText(this.session.locale.decimalFormat.format(i.values[1]),r).width))}return t}_removeAnimated(e){if(this.animationTriggered)return;this.animationTriggered=!0;let t=this,r=function(a,i){let s=C()(this),l=s.data("xStart"),d=s.data("yStart"),h=s.data("widthBar"),c=s.data("heightBar"),p=s.data("widthBottom");s.attr("points",t._calcPolygonPoints(!1,i.pos,l,d,h,p,c))};this.$svg.children(this.segmentSelectorForAnimation).animate({tabIndex:0},this._createAnimationObjectWithTabIndexRemoval(r)).promise().done(()=>{this._remove(e),this.animationTriggered=!1})}_dynamicCssClass(e){let t="";return this.chartBox.width<=this.widthThresholdSmall?t="small":this.chartBox.width<=this.widthThresholdMedium&&(t="medium"),o.strings.join(" ",e,t)}_dynamicConversionRateWidth(){return this.chart.config.options.salesfunnel.calcConversionRate?this.chartBox.width<=this.widthThresholdSmall?60:this.chartBox.width<=this.widthThresholdMedium?80:100:0}}function P(n,e,t){return e=ft(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ft(n){var e=mt(n,"string");return typeof e=="symbol"?e:String(e)}function mt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ae{constructor(e,t,r,a,i,s,l,d,h,c,p,f,m,y){P(this,"helper",void 0),P(this,"venn1",void 0),P(this,"venn2",void 0),P(this,"venn3",void 0),P(this,"u",void 0),P(this,"v",void 0),P(this,"w",void 0),P(this,"uv",void 0),P(this,"uw",void 0),P(this,"vw",void 0),P(this,"uvw",void 0),P(this,"maxD",void 0),P(this,"dStep",void 0),P(this,"rStep",void 0),P(this,"alphaStep",void 0),P(this,"alphaBest",void 0),P(this,"dBest",void 0),P(this,"rBest",void 0),P(this,"errorBest",void 0),P(this,"callback",void 0),P(this,"cancelled",void 0),i===0&&d===0&&h===0&&p===0&&(i=1),s===0&&d===0&&c===0&&p===0&&(s=1),l===0&&h===0&&c===0&&p===0&&(l=1),this.helper=e,this.venn1=t,this.venn2=r,this.venn3=a,this.u=i,this.v=s,this.w=l,this.uv=d,this.uw=h,this.vw=c,this.uvw=p,this.maxD=this.venn1.r+2*this.venn2.r+2*this.venn1.r+this.helper.distR,this.dStep=this.maxD/30,this.rStep=a.r/4,this.alphaStep=Math.PI/30,this.alphaBest=0,this.dBest=0,this.rBest=0,this.errorBest=0,this.callback=null,this.cancelled=!1}start(e){this.callback=e,setTimeout(this._next.bind(this,0))}cancel(){this.cancelled=!0}_end(){this.venn3.x=this.venn1.x+this.dBest*Math.cos(this.alphaBest),this.venn3.y=this.venn1.y-this.dBest*Math.sin(this.alphaBest),this.venn3.r=this.rBest,this.callback()}_next(e){this.cancelled||this._iteration(e),!this.cancelled&&(e+=this.alphaStep,e<Math.PI?setTimeout(this._next.bind(this,e)):this._end())}_iteration(e){let t=this.maxD,r=this.dStep,a=this.helper.minR,i=this.rStep,s=this.helper.total,l=this.venn1.x,d=this.venn1.y,h=this.venn1.r,c=this.venn2.x,p=this.venn2.y,f=this.venn2.r,m=this.venn3.r,y=this.u,_=this.v,b=this.w,g=this.uv,T=this.uw,v=this.vw,B=this.uvw,V=this.alphaBest,re=this.dBest,ae=this.rBest,de=this.errorBest;for(let ee=0;ee<t;ee+=r){let ie=l+ee*Math.cos(e),se=d-ee*Math.sin(e);for(let N=Math.max(a,m*.75);N<=m*1.25;N+=i){let ke=Math.min(l-h,c-f,ie-N),Le=Math.max(l+h,c+f,ie+N),Se=Math.min(d-h,p-f,se-N),Oe=Math.max(d+h,p+f,se+N),Ve=(Le-ke)/100,$e=(Oe-Se)/100,ue=0,ce=0,pe=0,fe=0,me=0,ge=0,_e=0;for(let j=ke;j<Le;j+=Ve)for(let U=Se;U<Oe;U+=$e){let J=(j-l)*(j-l)+(U-d)*(U-d)<h*h,q=(j-c)*(j-c)+(U-p)*(U-p)<f*f,K=(j-ie)*(j-ie)+(U-se)*(U-se)<N*N;J&&q&&K?_e++:J&&q&&!K?fe++:J&&!q&&!K?ue++:!J&&q&&!K?ce++:J&&!q&&K?me++:!J&&q&&K?ge++:!J&&!q&&K&&pe++}let Y=ue+ce+pe+fe+me+ge+_e,F=ee/t;F+=this._error(B,s,_e,Y),F+=this._error(g,s,fe,Y),F+=this._error(T,s,me,Y),F+=this._error(v,s,ge,Y),F+=this._error(y,s,ue,Y),F+=this._error(_,s,ce,Y),F+=this._error(b,s,pe,Y),(e===0||F<de)&&(V=e,re=ee,ae=N,de=F)}}this.alphaBest=V,this.dBest=re,this.rBest=ae,this.errorBest=de}_error(e,t,r,a){return e===0&&r!==0||e!==0&&r===0?1e3:Math.abs(e/t-r/a)*100}}function he(n,e,t){return e=gt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gt(n){var e=_t(n,"string");return typeof e=="symbol"?e:String(e)}function _t(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class ve{constructor(e,t,r,a){he(this,"distR",void 0),he(this,"maxR",void 0),he(this,"minR",void 0),he(this,"total",void 0),this.distR=e,this.maxR=t,this.minR=r,this.total=a}findBalance2(e,t){let r=(e.r*e.x+t.r*t.x)/(e.r+t.r),a=(e.r*e.y+t.r*t.y)/(e.r+t.r);e.x=e.x-r,t.x=t.x-r,e.y=e.y-a,t.y=t.y-a}findBalance3(e,t,r){let a=(e.r*e.x+t.r*t.x+r.r*r.x)/(e.r+t.r+r.r),i=(e.r*e.y+t.r*t.y+r.r*r.y)/(e.r+t.r+r.r);e.x=e.x-a,t.x=t.x-a,r.x=r.x-a,e.y=e.y-i,t.y=t.y-i,r.y=r.y-i}calcR(e,t){return e===-1?this.maxR*t:Math.max(this.minR,Math.sqrt(e/this.total)*this.maxR*t)}calcD(e,t,r,a,i,s){let l;if(i===0)l=e.r+t.r+this.distR*2;else if(r===0&&a===0)l=0;else if(r===0)l=Math.max(0,t.r-e.r-this.distR),l<1.5*this.distR&&s&&(l=1.5*this.distR,e.r=t.r-l);else if(a===0)l=Math.max(0,e.r-t.r-this.distR),l<1.5*this.distR&&s&&(l=1.5*this.distR,t.r=e.r-l);else{let d=Math.min(e.r,t.r),h=Math.max(e.r,t.r);l=2*(Math.min(r,a)/(Math.min(r,a)+i))*d-d+h,l=Math.max(3*this.distR,l),l=Math.min(d+h-3*this.distR,l),l=Math.max(h-d+3*this.distR,l)}return l}}function E(n,e,t){return e=bt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function bt(n){var e=yt(n,"string");return typeof e=="symbol"?e:String(e)}function yt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Be extends D{constructor(e){super(e),E(this,"animationTriggered",void 0),E(this,"data",void 0),E(this,"centerX",void 0),E(this,"centerY",void 0),E(this,"numberOfCircles",void 0),E(this,"readyToDraw",void 0),E(this,"wasCircle",void 0),E(this,"vennCircleHelper",void 0),E(this,"async3Calculator",void 0),E(this,"vennNumber1",void 0),E(this,"vennReal1",void 0),E(this,"vennNumber2",void 0),E(this,"vennReal2",void 0),E(this,"vennNumber3",void 0),E(this,"vennReal3",void 0),E(this,"$v1",void 0),E(this,"$v2",void 0),E(this,"$v3",void 0),this.animationTriggered=!1,this.suppressLegendBox=!0;let t={options:{venn:{numberOfCircles:void 0}}};e.config=C().extend(!0,{},t,e.config)}_validate(){let e=this.chart.data;return!(!e||e.axes.length!==0||e.chartValueGroups.length===0||e.chartValueGroups[0].values.length===0)}_renderInternal(){if(this.centerX=this.width/2,this.centerY=this.height/2,this.centerX===0||this.centerY===0)return;this.data=this.chart.data.chartValueGroups,this.numberOfCircles=this.chart.config.options.venn.numberOfCircles;let e=10,t=Math.min(this.centerX,this.centerY),r=t/15,a=this.data.reduce((s,l)=>s+l.values[0],1);this.vennCircleHelper=new ve(e,t,r,a),this.numberOfCircles>0&&(this.$v1=this._createCircle(0,this.data[0].colorHexValue,this.data[0].cssClass),this.vennNumber1=new W(this.$v1),this.vennReal1=new W(this.$v1)),this.numberOfCircles>1&&(this.$v2=this._createCircle(1,this.data[1].colorHexValue,this.data[1].cssClass),this.vennNumber2=new W(this.$v2),this.vennReal2=new W(this.$v2)),this.numberOfCircles>2&&(this.$v3=this._createCircle(2,this.data[2].colorHexValue,this.data[2].cssClass),this.vennNumber3=new W(this.$v3),this.vennReal3=new W(this.$v3));let i=function(){this.readyToDraw=!0,this.$svg.isAttached()&&(this.readyToDraw=!1,this._draw(!0,!0))}.bind(this);this.readyToDraw=!1,this.numberOfCircles===1?(this._calc1(this.vennNumber1),this._calc1(this.vennReal1),i()):this.numberOfCircles===2?(this._calc2(this.vennNumber1,this.vennNumber2,!1),this._calc2(this.vennReal1,this.vennReal2,!0),i()):this.numberOfCircles===3&&this._calc3(this.vennNumber1,this.vennNumber2,this.vennNumber3,!1,()=>{(this.rendering||this.rendered)&&this._calc3(this.vennReal1,this.vennReal2,this.vennReal3,!0,i)})}remove(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=arguments.length>1?arguments[1]:void 0;this._cancelAsync3Calculator(),super.remove(e,t)}_calc1(e){let t=this.data[0].values[0];t>0?e.r=this.vennCircleHelper.calcR(t,.8):e.r=this.vennCircleHelper.calcR(t,0),e.x=0,e.y=0,e.setLegend(this.data[0].groupName,1,-1),e.addLabel(t,e.x,e.y)}_calc2(e,t,r){let a=this.data[0].values[0],i=this.data[1].values[0],s=this.data[2].values[0],l;r?(e.r=this.vennCircleHelper.calcR(a+s,.8),t.r=this.vennCircleHelper.calcR(i+s,.8),l=this.vennCircleHelper.calcD(e,t,a,i,s,!0),e.x=0,t.x=l):(e.r=t.r=this.vennCircleHelper.calcR(-1,.7),e.x=-e.r*.6,t.x=t.r*.6),e.y=0,t.y=0,this.vennCircleHelper.findBalance2(e,t),e.setLegend(this.data[0].groupName,-1,-1),t.setLegend(this.data[1].groupName,1,-1),r?s===0?(e.addLabel(a,e.x,e.y),t.addLabel(i,t.x,t.y)):a===0&&i===0?e.addLabel(s,e.x,e.y):a===0?(t.addLabel(s,e.x,e.y),t.addLabel(i,t.x-(l-t.r-e.r)/2,t.y),e.legendR=t.r-l):i===0?(e.addLabel(s,t.x,t.y),e.addLabel(a,e.x+(l-t.r-e.r)/2,e.y),t.legendR=e.r-l):(e.addLabel(a,e.x+(l-t.r-e.r)/2,e.y),e.addLabel(i,t.x-(l-t.r-e.r)/2,t.y),t.addLabel(s,e.x+e.r+(l-t.r-e.r)/2,e.y)):(e.addLabel(a,-e.r*.9,0),e.addLabel(i,e.r*.9,0),t.addLabel(s,0,0))}_calc3(e,t,r,a,i){let s=this.data[0].values[0],l=this.data[1].values[0],d=this.data[2].values[0],h=this.data[3].values[0],c=this.data[4].values[0],p=this.data[5].values[0],f=this.data[6].values[0],m,y,_;a?(e.r=this.vennCircleHelper.calcR(s+h+c+f,.55),t.r=this.vennCircleHelper.calcR(l+h+p+f,.55),r.r=this.vennCircleHelper.calcR(d+c+p+f,.55),m=this.vennCircleHelper.calcD(e,t,s+c,l+p,h+f,!0),y=this.vennCircleHelper.calcD(e,r,s+h,d+p,h+f,!1),_=this.vennCircleHelper.calcD(t,r,l+h,d+c,h+f,!1),e.x=0,t.x=m,r.x=y,e.y=0,t.y=0,r.y=0,this._cancelAsync3Calculator(),this.async3Calculator=new Ae(this.vennCircleHelper,e,t,r,s,l,d,h,c,p,f,m,y,_),this.async3Calculator.start(()=>{this.async3Calculator=null,this.vennCircleHelper.findBalance3(e,t,r),e.setLegend(this.data[0].groupName,-1,1),t.setLegend(this.data[1].groupName,1,1),r.setLegend(this.data[2].groupName,1,-1),i()})):(e.r=t.r=r.r=this.vennCircleHelper.calcR(-1,.55),e.x=-e.r*.73,t.x=t.r*.73,r.x=0,e.y=e.r*.58,t.y=t.r*.58,r.y=-r.r*.58,e.setLegend(this.data[0].groupName,-1,1),t.setLegend(this.data[1].groupName,1,1),r.setLegend(this.data[2].groupName,1,-1),e.addLabel(s,-e.r,e.r*.76),t.addLabel(l,e.r,e.r*.76),r.addLabel(d,0,-e.r*.82),e.addLabel(h,0,e.r*.76),e.addLabel(c,-e.r*.49,-e.r*.05),t.addLabel(p,e.r*.49,-e.r*.05),e.addLabel(f,0,e.r*.22),i())}_cancelAsync3Calculator(){this.async3Calculator&&(this.async3Calculator.cancel(),this.async3Calculator=null)}_draw(e,t){if(!this.rendered&&!this.rendering||this.animationTriggered)return;this.animationTriggered=!0;let r=this;this.$svg.children(".venn-legend, .venn-label, .venn-axis-white, .label-line").stop().animateSVG("opacity",1,0,null,!0).promise().done(function(){this.remove(),r.animationTriggered=!1});let a=[];this.numberOfCircles>0&&a.push(t?this.vennReal1:this.vennNumber1),this.numberOfCircles>1&&a.push(t?this.vennReal2:this.vennNumber2),this.numberOfCircles>2&&a.push(t?this.vennReal3:this.vennNumber3);for(let i=0;i<a.length;i++){let s=a[i];this._updateVenn(s,e);for(let l=0;l<s.labels.length;l++){let d=s.labels[l];this._drawLabel(d.text,d.x,d.y,e)}}}_createCircle(e,t,r){let a=this.$svg.appendSVG("circle","venn-circle").attr("cx",this.centerX).attr("cy",this.centerY).attr("r",0).on("mouseenter",{showReal:!1},this._show.bind(this)).on("mouseleave",{showReal:!0},this._show.bind(this));return this.chart.config.options.autoColor?a.addClass("auto-color color0"):r?a.addClass(r):a.attr("fill",t),this.chart.config.options.clickable&&a.on("click",this._createClickObject(null,e),i=>this.chart.handleValueClick(i.data)),a}_updateVenn(e,t){e.$circle.animateSVG("cx",this.centerX+e.x,t?this.animationDuration:0,null,!0).animateSVG("cy",this.centerY+e.y,t?this.animationDuration:0,null,!0).animateSVG("r",e.r,t?this.animationDuration:0,null,!0);let r=this.vennCircleHelper.minR,a=this.centerX+e.x+e.legendH*Math.sin(Math.PI/5)*e.r,i=this.centerY+e.y+e.legendV*Math.cos(Math.PI/5)*e.r,s=this.centerX+e.x+e.legendH*Math.sin(Math.PI/5)*(e.legendR+r*1.5),l=this.centerY+e.y+e.legendV*Math.cos(Math.PI/5)*(e.legendR+r*1.5),d={x1:a,x2:s,y1:i,y2:l,v:e.legendV,h:e.legendH};this._renderWireLegend(e.legend,d,"venn-legend")}_drawLabel(e,t,r,a){let i=this.$svg.appendSVG("text","venn-label").attr("x",this.centerX+t).attr("y",this.centerY+r).text(e);a&&this.animationDuration&&i.attr("opacity",0).animateSVG("opacity",1,this.animationDuration,null,!0)}_show(e){if(this.numberOfCircles===1)return;let t=e.type==="mouseenter"?e.target:e.relatedTarget,r=t&&C()(t).hasClass("venn-circle");this.wasCircle&&r||(this.wasCircle=r,this._draw(!0,e.data.showReal))}}function G(n,e,t){return e=Ct(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ct(n){var e=xt(n,"string");return typeof e=="symbol"?e:String(e)}function xt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class W{constructor(e){G(this,"labels",void 0),G(this,"$circle",void 0),G(this,"x",void 0),G(this,"y",void 0),G(this,"r",void 0),G(this,"legend",void 0),G(this,"legendR",void 0),G(this,"legendH",void 0),G(this,"legendV",void 0),this.$circle=e,this.labels=[]}setLegend(e,t,r,a){this.legend=e,this.legendH=t,this.legendV=r,this.legendR=a||this.r}addLabel(e,t,r){this.labels.push({text:e,x:t,y:r})}}function Tt(n,e,t){return e=At(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function At(n){var e=vt(n,"string");return typeof e=="symbol"?e:String(e)}function vt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Ie extends o.FormField{constructor(){super(),Tt(this,"chart",void 0),this._addWidgetProperties(["chart"]),this.chart=null}_render(){this.addContainer(this.$parent,"chart-field"),this.addLabel(),this.addMandatoryIndicator(),this.addStatus(),this._renderChart()}_renderChart(){this.chart&&(this.chart.render(),this.addField(this.chart.$container))}_removeChart(){this.chart.remove(),this._removeField()}}class we extends o.FormFieldAdapter{}function Bt(n,e,t){return e=Rt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Rt(n){var e=kt(n,"string");return typeof e=="symbol"?e:String(e)}function kt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class He extends o.FormFieldTile{constructor(){super(),Bt(this,"_chartConfigChangeHandler",void 0),this._chartConfigChangeHandler=this._onChartConfigChange.bind(this)}_renderColorScheme(){super._renderColorScheme(),this._updateChartColorScheme()}_updateChartColorScheme(){let e=$.extend(!0,{},this.tileWidget.chart.config,{options:{colorScheme:this.colorScheme}});this.tileWidget.chart.setConfig(e)}_onChartConfigChange(e){this._updateChartColorScheme()}_setTileWidget(e){this.tileWidget&&this.tileWidget.chart.off("propertyChange:config",this._chartConfigChangeHandler),super._setTileWidget(e),this.tileWidget.chart.on("propertyChange:config",this._chartConfigChangeHandler)}}class Ne extends o.FormFieldTileAdapter{}function L(n,e,t){return e=Lt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Lt(n){var e=St(n,"string");return typeof e=="symbol"?e:String(e)}function St(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Q extends o.TableControl{constructor(){super(),L(this,"chartAggregation",void 0),L(this,"chartGroup1",void 0),L(this,"chartGroup2",void 0),L(this,"chartType",void 0),L(this,"oldChartType",void 0),L(this,"chart",void 0),L(this,"chartColorScheme",void 0),L(this,"xAxis",void 0),L(this,"yAxis",void 0),L(this,"dateGroup",void 0),L(this,"$chartSelect",void 0),L(this,"$axisSelectContainer",void 0),L(this,"$xAxisSelect",void 0),L(this,"$yAxisSelect",void 0),L(this,"$dataSelect",void 0),L(this,"_chartTypeMap",void 0),L(this,"_aggregationMap",void 0),L(this,"_chartGroup1Map",void 0),L(this,"_chartGroup2Map",void 0),L(this,"_tableUpdatedHandler",void 0),L(this,"_tableColumnStructureChangedHandler",void 0),L(this,"_chartValueClickedHandler",void 0),L(this,"_filterResetListener",void 0),L(this,"_tableUpdatedTimeOutId",void 0),this.tooltipText="${textKey:ui.Chart}",this.chartAggregation={modifier:o.TableMatrix.NumberGroup.COUNT},this.chartType=u.Type.BAR,this.oldChartType=null,this.chart=null,this.chartColorScheme="chart-table-control",this.$chartSelect=null,this.$xAxisSelect=null,this.$yAxisSelect=null,this.$dataSelect=null,this.xAxis=null,this.yAxis=null,this.dateGroup=null,this._tableUpdatedHandler=this._onTableUpdated.bind(this),this._tableColumnStructureChangedHandler=this._onTableColumnStructureChanged.bind(this),this._chartValueClickedHandler=this._onChartValueClick.bind(this)}_init(e){super._init(e),this.table.on("columnStructureChanged",this._tableColumnStructureChangedHandler),this.chart=o.scout.create(u,{parent:this})}_destroy(){this.table.off("columnStructureChanged",this._tableColumnStructureChangedHandler),super._destroy()}_computeEnabled(e,t){return!this._hasColumns()&&!this.selected?!1:super._computeEnabled(e,t)}_renderChart(){this.chart&&(this.chart.render(this.$contentContainer),this.chart.$container.addClass(this.denseClass))}_createLayout(){return new Re(this)}_renderChartType(){this._selectChartType(),this.$yAxisSelect.toggleClass("hide",this.chartType!==u.Type.BUBBLE),this.$yAxisSelect.toggleClass("animated",o.scout.isOneOf(u.Type.BUBBLE,this.chartType,this.oldChartType)&&!!this.oldChartType),this.$yAxisSelect.data("scroll-shadow").setVisible(!1),this.$yAxisSelect.oneAnimationEnd(()=>{o.scrollbars.update(this.$yAxisSelect),this.$yAxisSelect.data("scroll-shadow").setVisible(!0),this.$yAxisSelect.removeClass("animated")}),this.contentRendered&&this.chart.$container.animateAVCSD("opacity",0,()=>{this.chart.$container.css("opacity",1),this._drawChart()})}_selectChartType(){o.objects.values(this._chartTypeMap).forEach(e=>{e.removeClass("selected")}),this._chartTypeMap[this.chartType].addClass("selected")}_renderChartGroup1(){this._renderChartGroup(1)}_renderChartGroup2(){this._renderChartGroup(2)}_renderChartGroup(e){if(!this._hasColumns())return;let t="chartGroup"+e,r="_"+t+"Map",a=this[t];if(a){let i=this[r][a.id];if(i.siblings(".select-axis").animateAVCSD("height",30),i.selectOne("selected"),a.modifier>0){let s=a.modifier^Q.DATE_GROUP_FLAG;i.animateAVCSD("height",42),i.children(".select-axis-group").text(this.dateGroup[s][1])}this.contentRendered&&this._drawChart()}}_renderChartAggregation(){let e=this._aggregationMap[this.chartAggregation.id||"all"];e&&(e.selectOne(),e.removeClass("data-sum").removeClass("data-avg"),e.addClass(this._getAggregationCssClass()),this.contentRendered&&this._drawChart())}_getAggregationCssClass(){switch(this.chartAggregation.modifier){case o.TableMatrix.NumberGroup.COUNT:return"data-count";case o.TableMatrix.NumberGroup.SUM:return"data-sum";case o.TableMatrix.NumberGroup.AVG:return"data-avg";default:return null}}_renderChartSelect(e,t,r){let a=o.scout.create(o.Icon,{parent:this,iconDesc:r,cssClass:e});a.render(this.$chartSelect),this.$contentContainer.one("remove",()=>a.destroy());let i=a.$container;i.toggleClass("disabled",!this.enabledComputed||!this._hasColumns()).data("chartType",t),this.enabledComputed&&this._hasColumns()&&i.on("click",this._onClickChartType.bind(this)),this._chartTypeMap[t]=i}_renderChartSelectContainer(){this.$chartSelect=this.$contentContainer.appendDiv("chart-select"),this._chartTypeMap={};let e=this._getSupportedChartTypes();o.scout.isOneOf(u.Type.BAR,e)&&this._renderChartSelect("chart-bar",u.Type.BAR,o.icons.DIAGRAM_BARS_VERTICAL),o.scout.isOneOf(u.Type.BAR_HORIZONTAL,e)&&this._renderChartSelect("chart-stacked",u.Type.BAR_HORIZONTAL,o.icons.DIAGRAM_BARS_HORIZONTAL),o.scout.isOneOf(u.Type.LINE,e)&&this._renderChartSelect("chart-line",u.Type.LINE,o.icons.DIAGRAM_LINE),o.scout.isOneOf(u.Type.PIE,e)&&this._renderChartSelect("chart-pie",u.Type.PIE,o.icons.DIAGRAM_PIE),o.scout.isOneOf(u.Type.BUBBLE,e)&&this._renderChartSelect("chart-bubble",u.Type.BUBBLE,o.icons.DIAGRAM_SCATTER)}_getSupportedChartTypes(){return[u.Type.BAR,u.Type.BAR_HORIZONTAL,u.Type.LINE,u.Type.PIE,u.Type.BUBBLE]}_onClickChartType(e){let t=C()(e.currentTarget),r=t.data("chartType");this.setChartType(r)}_onClickChartGroup(e){let t=C()(e.currentTarget),r=t.parent().data("groupId"),a=t.data("column"),i=t.data("modifier");if(!t.isEnabled())return;let s=t.isSelected()?this._nextDateModifier(i):i;t.data("modifier",s);let l={id:a?a.id:null,modifier:s};this._setChartGroup(r,l)}_onClickAggregation(e){let t=C()(e.currentTarget),r=t.data("modifier"),a=t.isSelected()?this._nextModifier(r):r;t.data("modifier",a);let i=t.data("column"),s={id:i?i.id:null,modifier:a};this._setChartAggregation(s)}_nextDateModifier(e){switch(e){case o.TableMatrix.DateGroup.DATE:return o.TableMatrix.DateGroup.MONTH;case o.TableMatrix.DateGroup.MONTH:return o.TableMatrix.DateGroup.WEEKDAY;case o.TableMatrix.DateGroup.WEEKDAY:return o.TableMatrix.DateGroup.YEAR;case o.TableMatrix.DateGroup.YEAR:return o.TableMatrix.DateGroup.DATE;default:return e}}_nextModifier(e){switch(e){case o.TableMatrix.NumberGroup.SUM:return o.TableMatrix.NumberGroup.AVG;case o.TableMatrix.NumberGroup.AVG:return o.TableMatrix.NumberGroup.SUM;default:return e}}_setChartAggregation(e){e!==this.chartAggregation&&(this._setProperty("chartAggregation",e),this.contentRendered&&this._renderChartAggregation())}_setChartGroup1(e){this._setChartGroup(1,e)}_setChartGroup2(e){this._setChartGroup(2,e)}_setChartGroup(e,t){let r="chartGroup"+e;this._changeProperty(r,t)}_changeProperty(e,t){t!==this[e]&&(this._setProperty(e,t),this.contentRendered&&this["_render"+e.charAt(0).toUpperCase()+e.slice(1)]())}setChartType(e){this.oldChartType=this.chartType,this.setProperty("chartType",e)}_hasColumns(){return this.table.columns.length!==0}_axisCount(e,t){let r;for(let a=0;a<e.length;a++)if(r=e[a][0],r===t)return e[a][1];return 0}_plainAxisText(e,t){return e.headerHtmlEnabled?o.strings.plainText(t).replace(/\n/g," "):t}_renderContent(e){this.$contentContainer=e.appendDiv("chart-container"),this._installScrollbars(),this._renderChartSelectContainer(),this.dateGroup=[[o.TableMatrix.DateGroup.YEAR,this.session.text("ui.groupedByYear")],[o.TableMatrix.DateGroup.MONTH,this.session.text("ui.groupedByMonth")],[o.TableMatrix.DateGroup.WEEKDAY,this.session.text("ui.groupedByWeekday")],[o.TableMatrix.DateGroup.DATE,this.session.text("ui.groupedByDate")]],this._filterResetListener=this.table.on("filterReset",r=>{this.chart&&this.chart.setCheckedItems([])}),this._addListeners(),this._renderAxisSelectorsContainer();let t=this._renderAxisSelectors();this._renderChart(),this._initializeSelection(t),this._renderChartParts(),this._drawChart()}_addListeners(){this.table.on("rowsInserted",this._tableUpdatedHandler),this.table.on("rowsDeleted",this._tableUpdatedHandler),this.table.on("allRowsDeleted",this._tableUpdatedHandler),this.chart.on("valueClick",this._chartValueClickedHandler)}_renderAxisSelectorsContainer(){this.$axisSelectContainer=this.$contentContainer.appendDiv("axis-select-container")}_renderAxisSelectors(){this.$xAxisSelect=this.$axisSelectContainer.appendDiv("xaxis-select").data("groupId",1),o.scrollbars.install(this.$xAxisSelect,{parent:this,session:this.session,axis:"y"}),this.$yAxisSelect=this.$axisSelectContainer.appendDiv("yaxis-select").data("groupId",2),o.scrollbars.install(this.$yAxisSelect,{parent:this,session:this.session,axis:"y"}),this._chartGroup1Map={},this._chartGroup2Map={};let e=new o.TableMatrix(this.table,this.session),t=e.columnCount(!1);t.sort((l,d)=>Math.abs(l[1]-8)-Math.abs(d[1]-8));let r,a,i=0,s=e.columns(!1);for(let l=0;l<s.length;l++){let d,h,c,p=s[l];p instanceof o.DateColumn?a=!0:(r=this._axisCount(t,p),a=r<=Q.MAX_AXIS_COUNT),d=this._axisContentForColumn(p),h=this.$contentContainer.makeDiv("select-axis",this._plainAxisText(p,d.text)).data("column",p).setEnabled(a),a||(this.chartGroup1&&this.chartGroup1.id===p.id&&(this.chartGroup1=null,this.chartGroup2=null),this.chartGroup2&&this.chartGroup2.id===p.id&&(this.chartGroup2=null)),d.icon&&h.addClass(d.icon.appendCssClass("font-icon")),p instanceof o.DateColumn&&h.data("modifier",o.TableMatrix.DateGroup.YEAR).appendDiv("select-axis-group",this.dateGroup[0][1]),a?(h.on("click",this._onClickChartGroup.bind(this)),o.tooltips.installForEllipsis(h,{parent:this})):o.tooltips.install(h,{parent:this,text:this.session.text("ui.TooMuchData")}),i++,c=h.clone(!0),this._chartGroup1Map[p.id]=h,this._chartGroup2Map[p.id]=c,this.$xAxisSelect.append(h),this.$yAxisSelect.append(c)}if(this._aggregationMap={},this._hasColumns()){this.$dataSelect=this.$axisSelectContainer.appendDiv("data-select"),o.scrollbars.install(this.$dataSelect,{parent:this,session:this.session,axis:"y"});let l=this.session.text("ui.Count");this._aggregationMap.all=this.$dataSelect.appendDiv("select-data data-count",l).data("column",null).data("modifier",o.TableMatrix.NumberGroup.COUNT);for(let d=0;d<s.length;d++){let h=s[d],c=d+1;if(h instanceof o.NumberColumn){let p;o.strings.hasText(h.text)?p=this._plainAxisText(h,h.text):o.strings.hasText(h.headerTooltipText)?p=h.headerTooltipText:p="["+c+"]",this._aggregationMap[h.id]=this.$dataSelect.appendDiv("select-data data-sum",p).data("column",h).data("modifier",o.TableMatrix.NumberGroup.SUM)}}C()(".select-data",this.$contentContainer).on("click",this._onClickAggregation.bind(this))}return t}_initializeSelection(e){let t;this.chartType||this.setChartType(u.Type.BAR),(!this.chartAggregation||!this._aggregationMap[this.chartAggregation.id])&&this._setChartAggregation({id:null,modifier:o.TableMatrix.NumberGroup.COUNT}),(!this.chartGroup1||!this.chartGroup1.id||!this._chartGroup1Map[this.chartGroup1.id])&&(t=this.$xAxisSelect.children(":not(.disabled)"),this._setDefaultSelectionForGroup(1,e,t,0)),(!this.chartGroup2||!this.chartGroup2.id||!this._chartGroup2Map[this.chartGroup2.id])&&(t=this.$yAxisSelect.children(":not(.disabled)"),this._setDefaultSelectionForGroup(2,e,t,1))}_setDefaultSelectionForGroup(e,t,r,a){let i=this._getDefaultSelectedColumn(t,r,a);i&&this._setChartGroup(e,this._getDefaultChartGroup(i))}_getDefaultSelectedColumn(e,t,r){let a=0,i,s;for(let l=0;l<e.length&&a<=r;l++)i=e[l][0],this._existsInAxisColumns(t,i)&&(s=i,a++);return s}_existsInAxisColumns(e,t){for(let r=0;r<e.length;r++)if(e.eq(r).data("column")===t)return!0;return!1}_getDefaultChartGroup(e){let t;return e instanceof o.DateColumn&&(t=256),{id:e.id,modifier:t}}_renderChartParts(){this._renderChartType(),this._renderChartAggregation(),this._renderChartGroup1(),this._renderChartGroup2()}_drawChart(){if(!this._hasColumns()){this._hideChart();return}let e=this._calculateValues();if(e&&e.length)this.chart.setVisible(!0);else{this._hideChart();return}let t={type:this.chartType,options:{handleResize:!0,colorScheme:this.chartColorScheme,maxSegments:5,plugins:{legend:{display:!1}}}},r=[];t.data=this._computeData(r,e),this._adjustFont(t,r),this._adjustConfig(t),this.chart.setConfig(t);let a=this._computeCheckedItems(t.data.datasets[0].deterministicKeys);this.chart.setCheckedItems(a)}_hideChart(){this.chart.setConfig({type:this.chartType}),this.chart.setVisible(!1)}_getDatasetLabel(){let e=this._aggregationMap[this.chartAggregation.id||"all"];return(e?e.text():null)||this.session.text("ui.Value")}_calculateValues(){let e=new o.TableMatrix(this.table,this.session),t=this.chartAggregation.id?this._aggregationMap[this.chartAggregation.id].data("column"):-1;if(e.addData(t,this.chartAggregation.modifier),this.chartGroup1){let r=this._chartGroup1Map[this.chartGroup1.id].data("column");this.xAxis=e.addAxis(r,this.chartGroup1.modifier)}if(this.chartType===u.Type.BUBBLE&&this.chartGroup2){let r=this._chartGroup2Map[this.chartGroup2.id].data("column");this.yAxis=e.addAxis(r,this.chartGroup2.modifier)}else this.yAxis=null;if(!(e.isEmpty()||!e.isMatrixValid()))return e.calculate()}_getXAxis(){return this.xAxis}_getYAxis(){return this.yAxis}_computeData(e,t){let r={datasets:[{label:this._getDatasetLabel()}]};if(!t)return r;e=e||[];let a=[];if(this.chartType===u.Type.BUBBLE)a=this._computeBubbleData(e,t);else{let l=this._getXAxis();for(let d=0;d<l.length;d++){let h,c=l[d];l.column instanceof o.NumberColumn?h=c:h=this._handleIconLabel(l.format(c),l,e),a.push({value:t.getValue([c])[0],label:h,deterministicKey:l.keyToDeterministicKey(c)})}}let i=r.datasets[0],s=[];return i.data=[],i.deterministicKeys=[],a.forEach(l=>{i.data.push(l.value),i.deterministicKeys.push(l.deterministicKey),o.objects.isNullOrUndefined(l.label)||s.push(l.label)}),s.length&&(r.labels=s),r}_computeBubbleData(e,t){if(!t)return[];e=e||[];let r=this._getXAxis(),a=this._getYAxis(),i=[];for(let s=0;s<r.length;s++){let l=r[s],d=l;this._handleIconLabel(r.format(l),r,e),!(r.column instanceof o.NumberColumn)&&d===null&&(d=r.max),r.column instanceof o.DateColumn&&(d=d-r.min);for(let h=0;h<a.length;h++){let c=a[h],p=c,f=t.getValue([l,c]);this._handleIconLabel(a.format(c),a,e),f&&f.length&&(!(a.column instanceof o.NumberColumn)&&p===null&&(p=a.max),a.column instanceof o.DateColumn&&(p=p-a.min),i.push({value:{x:d,y:p,z:f[0]},deterministicKey:[r.keyToDeterministicKey(l),a.keyToDeterministicKey(c)]}))}}return i}_handleIconLabel(e,t,r){if(t&&t.textIsIcon){let a=o.icons.parseIconId(e);if(a&&a.isFontIcon())return r.push(...a.appendCssClass("font-icon").split(" ")),a.iconCharacter}return e}_adjustFont(e,t){if(!(!e||!t)&&(t=t.filter((r,a,i)=>i.indexOf(r)===a),t.length)){let r=o.styles.get(t,"font-family").fontFamily;this.chartType!==u.Type.PIE&&(e.options=C().extend(!0,{},e.options,{scales:{x:{ticks:{font:{family:r}}},y:{ticks:{font:{family:r}}}}})),e.options=C().extend(!0,{},e.options,{plugins:{tooltip:{titleFont:{family:r}}}}),e.options=C().extend(!0,{},e.options,{plugins:{datalabels:{font:{family:r}}}})}}_adjustLabels(e){if(!e)return;let t=this._getXAxis(),r=this._getYAxis();this.chartType===u.Type.BUBBLE?(t.column instanceof o.NumberColumn||(e.options=C().extend(!0,{},e.options,{scales:{x:{ticks:{callback:a=>this._formatLabel(a,t)}}}})),r.column instanceof o.NumberColumn||(e.options=C().extend(!0,{},e.options,{scales:{y:{ticks:{callback:a=>this._formatLabel(a,r)}}}}))):t.column instanceof o.NumberColumn&&(e.options=C().extend(!0,{},e.options,{reformatLabels:!0}))}_formatLabel(e,t){if(t){if(t.column instanceof o.DateColumn&&(e=e+t.min,e!==parseInt(""+e)||t.length<2&&(e<t.min||e>t.max)))return null;if(t.indexOf(null)!==-1){if(e===t.max)e=null;else if(e>t.max)return null}if(e=t.format(e),t.textIsIcon){let r=o.icons.parseIconId(e);r&&r.isFontIcon()&&(e=r.iconCharacter)}}return""+e}_adjustConfig(e){!e||(this._adjustLabels(e),this._adjustClickable(e),this.chartType===u.Type.BUBBLE?this._adjustBubble(e):this.chartType===u.Type.PIE?this._adjustPie(e):this._adjustScales(e))}_adjustClickable(e){!e||this._isChartClickable()&&(e.options=C().extend(!0,{},e.options,{clickable:!0,checkable:!0,otherSegmentClickable:!0}))}_isChartClickable(){return!0}_adjustBubble(e){!e||this.chartType!==u.Type.BUBBLE||(e.options.bubble=C().extend(!0,{},e.options.bubble,{sizeOfLargestBubble:25,minBubbleSize:5}))}_adjustPie(e){if(!e||this.chartType!==u.Type.PIE)return;e.data.datasets[0].datalabels={labels:{index:{display:"auto",color:o.styles.get([this.chartColorScheme,this.chartType+"-chart","elements","label"],"fill").fill,formatter:(r,a)=>a.chart.data.labels[a.dataIndex],anchor:"end",align:"end",clamp:!0,offset:10,padding:4},labels:{}}},e.options=C().extend(!0,{},e.options,{plugins:{datalabels:{display:!0}}});let t=this.chart.$container.cssMarginTop()-this.chart.$container.cssMarginBottom();e.options=C().extend(!0,{},e.options,{layout:{padding:{top:30+(Math.sign(t)<0?Math.abs(t):0),bottom:30+(Math.sign(t)>0?t:0)}}})}_adjustScales(e){!e||(e.options=C().extend(!0,{},e.options,{scales:{x:{beginAtZero:!0},y:{beginAtZero:!0}}}))}_computeCheckedItems(e){if(!e)return[];let t=this._getXAxis(),r=this._getYAxis(),a=this.table.getFilter(z.TYPE),i=[],s=[];a&&(a.xAxis||{}).column===(t||{}).column&&(a.yAxis||{}).column===(r||{}).column&&(i=a.filters),e.forEach((h,c)=>{i.filter(p=>Array.isArray(p.deterministicKey)&&Array.isArray(h)?o.arrays.equals(p.deterministicKey,h):p.deterministicKey===h).length&&s.push(c)});let l=0;if(this.chartType===u.Type.PIE){let h=this.chart.config.options.maxSegments,c=o.arrays.init(e.length-h,null).map((p,f)=>f+h);o.arrays.containsAll(s,c)||o.arrays.remove(s,h-1),o.arrays.removeAll(s,c),l=1}let d=[];return s.length&&s.forEach(h=>{d.push({datasetIndex:l,dataIndex:h})}),d}_onChartValueClick(){let e=[];if(this.chart&&this.chart.config.data){let t=this.chart.config.options.maxSegments,r=this.chart.config.data.datasets[0],a=s=>({deterministicKey:r.deterministicKeys[s]});this.chartType===u.Type.PIE&&(a=s=>(s=parseInt(""+s),t&&t===s+1?o.arrays.init(r.deterministicKeys.length-s,null).map((l,d)=>({deterministicKey:r.deterministicKeys[d+s]})):{deterministicKey:r.deterministicKeys[s]})),this.chart.checkedItems.filter(s=>s.datasetIndex===0).map(s=>s.dataIndex).forEach(s=>{o.arrays.pushAll(e,a(s))})}if(e.length){let t=o.scout.create(z,{session:this.session,table:this.table,text:this.tooltipText,xAxis:this._getXAxis(),yAxis:this._getYAxis(),filters:e});this.table.addFilter(t)}else this.table.removeFilterByKey(z.TYPE)}_axisContentForColumn(e){let t=e.text;if(o.strings.hasText(t))return{text:t};if(e.headerIconId){let r=o.icons.parseIconId(e.headerIconId);if(r.isFontIcon())return{text:r.iconCharacter,icon:r}}return e.headerTooltipText?{text:e.headerTooltipText}:{text:"["+(this.table.visibleColumns().indexOf(e)+1)+"]"}}_removeContent(){this._removeScrollbars(),this.$contentContainer.remove(),this.chart.remove(),this.table.events.removeListener(this._filterResetListener),this._removeListeners(),this.oldChartType=null,this.recomputeEnabled()}_removeScrollbars(){this.$xAxisSelect.each((e,t)=>{o.tooltips.uninstall(C()(t))}),o.scrollbars.uninstall(this.$xAxisSelect,this.session),this.$yAxisSelect.each((e,t)=>{o.tooltips.uninstall(C()(t))}),o.scrollbars.uninstall(this.$yAxisSelect,this.session),o.scrollbars.uninstall(this.$dataSelect,this.session),this._uninstallScrollbars()}_removeListeners(){this.table.off("rowsInserted",this._tableUpdatedHandler),this.table.off("rowsDeleted",this._tableUpdatedHandler),this.table.off("allRowsDeleted",this._tableUpdatedHandler),this.chart.off("valueClick",this._chartValueClickedHandler)}_onTableUpdated(e){this._tableUpdatedTimeOutId||(this._tableUpdatedTimeOutId=setTimeout(()=>{this._tableUpdatedTimeOutId=null,this.rendered&&(this._setChartGroup1(null),this._setChartGroup2(null),this.removeContent(),this.renderContent())}))}_onTableColumnStructureChanged(){this.recomputeEnabled(),this.contentRendered&&this.selected&&this._onTableUpdated()}}L(Q,"DATE_GROUP_FLAG",256),L(Q,"MAX_AXIS_COUNT",100);function Z(n,e,t){return e=Ot(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Ot(n){var e=Pt(n,"string");return typeof e=="symbol"?e:String(e)}function Pt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class z extends o.TableUserFilter{constructor(){super(),Z(this,"text",void 0),Z(this,"xAxis",void 0),Z(this,"yAxis",void 0),Z(this,"filters",void 0),Z(this,"columnIdX",void 0),Z(this,"columnIdY",void 0),this.filterType=z.TYPE,this.text=null,this.xAxis=null,this.yAxis=null,this.filters=[],this.columnIdX=null,this.columnIdY=null}createLabel(){return this.text}createFilterAddedEventData(){let e=super.createFilterAddedEventData();return e.text=this.text,e.filters=this.filters,e.columnIdX=this.xAxis&&this.xAxis.column?this.xAxis.column.id:null,e.columnIdY=this.yAxis&&this.yAxis.column?this.yAxis.column.id:null,e}calculate(){let e=new o.TableMatrix(this.table,this.session),t=this.table.columnById(this.columnIdX),r=t.createFilter().axisGroup();if(this.xAxis=e.addAxis(t,r),this.columnIdY){let a=this.table.columnById(this.columnIdY),i=a.createFilter().axisGroup();this.yAxis=e.addAxis(a,i)}e.calculate()}accept(e){this.xAxis||this.calculate();let t=this.xAxis.column.cellValueOrTextForCalculation(e),r=this.xAxis.normDeterministic(t);if(!this.yAxis)return this.filters.filter(i=>i.deterministicKey===r).length>0;t=this.yAxis.column.cellValueOrTextForCalculation(e);let a=this.yAxis.normDeterministic(t);return this.filters.filter(i=>o.arrays.equals(i.deterministicKey,[r,a])).length>0}}Z(z,"TYPE","CHART");class Fe extends o.TableControlAdapter{constructor(){super(),this._addRemoteProperties(["chartType","chartAggregation","chartGroup1","chartGroup2"])}}function Et(n,e,t){return e=Mt(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Mt(n){var e=Dt(n,"string");return typeof e=="symbol"?e:String(e)}function Dt(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class Re extends o.AbstractLayout{constructor(e){super(),Et(this,"control",void 0),this.control=e}layout(e){!this.control.contentRendered||(o.scrollbars.update(this.control.$contentContainer),o.scrollbars.update(this.control.$xAxisSelect),o.scrollbars.update(this.control.$yAxisSelect),o.scrollbars.update(this.control.$dataSelect))}}const Ge=le;o.ObjectFactory.get().registerNamespace("scout",le);var It=S.AbstractChartRenderer,wt=S.AbstractSvgChartRenderer,Ht=S.Chart,Nt=S.ChartAdapter,Ft=S.ChartField,Gt=S.ChartFieldAdapter,Vt=S.ChartFieldTile,$t=S.ChartFieldTileAdapter,jt=S.ChartJsRenderer,Ut=S.ChartLayout,Wt=S.ChartTableControl,zt=S.ChartTableControlAdapter,Xt=S.ChartTableControlLayout,Yt=S.ChartTableUserFilter,Jt=S.FulfillmentChartRenderer,qt=S.SalesfunnelChartRenderer,Kt=S.SpeedoChartRenderer,Zt=S.VennAsync3Calculator,Qt=S.VennChartRenderer,er=S.VennCircle,tr=S.VennCircleHelper,rr=S.chartJsDateAdapter,ar=S.default;export{It as AbstractChartRenderer,wt as AbstractSvgChartRenderer,Ht as Chart,Nt as ChartAdapter,Ft as ChartField,Gt as ChartFieldAdapter,Vt as ChartFieldTile,$t as ChartFieldTileAdapter,jt as ChartJsRenderer,Ut as ChartLayout,Wt as ChartTableControl,zt as ChartTableControlAdapter,Xt as ChartTableControlLayout,Yt as ChartTableUserFilter,Jt as FulfillmentChartRenderer,qt as SalesfunnelChartRenderer,Kt as SpeedoChartRenderer,Zt as VennAsync3Calculator,Qt as VennChartRenderer,er as VennCircle,tr as VennCircleHelper,rr as chartJsDateAdapter,ar as default};
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=eclipse-scout-chart.esm-a918cb3af9403c83adfe.min.js.map
|