pace-chart-lib 1.0.79 → 1.0.80

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.
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".highlight{fill-opacity:1!important;stroke-opacity:1;transition:fill-opacity .25s ease-out}.unhighlight{fill-opacity:.08!important;stroke-opacity:.08;transition:fill-opacity .25s ease-in}")),document.head.appendChild(t)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- (function(We,Te){typeof exports=="object"&&typeof module<"u"?Te(exports,require("react"),require("d3"),require("d3-svg-annotation"),require("d3-cloud"),require("venn.js"),require("d3-sankey"),require("d3-org-chart"),require("chart.js"),require("chartjs-plugin-datalabels")):typeof define=="function"&&define.amd?define(["exports","react","d3","d3-svg-annotation","d3-cloud","venn.js","d3-sankey","d3-org-chart","chart.js","chartjs-plugin-datalabels"],Te):(We=typeof globalThis<"u"?globalThis:We||self,Te(We["pace-chart-lib"]={},We.React,We.d3,We.d3Annotation,We.d3Cloud,We.venn,We.d3Sankey,We.OrgChart,We.Chart,We.ChartDataLabels))})(this,(function(We,Te,ii,cl,dl,yl,ul,hl,ft,xl){"use strict";function li(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const T=li(ii),dt=li(cl),pl=li(yl),Ti=li(ul);var ri={exports:{}},_a={};/**
2
+ (function(Je,Me){typeof exports=="object"&&typeof module<"u"?Me(exports,require("react"),require("d3"),require("d3-svg-annotation"),require("d3-cloud"),require("venn.js"),require("d3-sankey"),require("d3-org-chart"),require("chart.js"),require("chartjs-plugin-datalabels")):typeof define=="function"&&define.amd?define(["exports","react","d3","d3-svg-annotation","d3-cloud","venn.js","d3-sankey","d3-org-chart","chart.js","chartjs-plugin-datalabels"],Me):(Je=typeof globalThis<"u"?globalThis:Je||self,Me(Je["pace-chart-lib"]={},Je.React,Je.d3,Je.d3Annotation,Je.d3Cloud,Je.venn,Je.d3Sankey,Je.OrgChart,Je.Chart,Je.ChartDataLabels))})(this,(function(Je,Me,oi,bl,gl,Al,Ll,ml,kt,fl){"use strict";function ci(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const v=ci(oi),xt=ci(bl),Tl=ci(Al),wi=ci(Ll);var di={exports:{}},qa={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */var vi;function bl(){if(vi)return _a;vi=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(o,h,n){var l=null;if(n!==void 0&&(l=""+n),h.key!==void 0&&(l=""+h.key),"key"in h){n={};for(var s in h)s!=="key"&&(n[s]=h[s])}else n=h;return h=n.ref,{$$typeof:t,type:o,key:l,ref:h!==void 0?h:null,props:n}}return _a.Fragment=e,_a.jsx=r,_a.jsxs=r,_a}var ja={};/**
10
+ */var Di;function vl(){if(Di)return qa;Di=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(c,x,n){var l=null;if(n!==void 0&&(l=""+n),x.key!==void 0&&(l=""+x.key),"key"in x){n={};for(var s in x)s!=="key"&&(n[s]=x[s])}else n=x;return x=n.ref,{$$typeof:t,type:c,key:l,ref:x!==void 0?x:null,props:n}}return qa.Fragment=e,qa.jsx=r,qa.jsxs=r,qa}var Ka={};/**
11
11
  * @license React
12
12
  * react-jsx-runtime.development.js
13
13
  *
@@ -15,15 +15,15 @@
15
15
  *
16
16
  * This source code is licensed under the MIT license found in the
17
17
  * LICENSE file in the root directory of this source tree.
18
- */var ki;function gl(){return ki||(ki=1,process.env.NODE_ENV!=="production"&&(function(){function t(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===se?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case g:return"Fragment";case D:return"Profiler";case H:return"StrictMode";case U:return"Suspense";case V:return"SuspenseList";case X:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case _:return"Portal";case K:return(p.displayName||"Context")+".Provider";case j:return(p._context.displayName||"Context")+".Consumer";case J:var C=p.render;return p=p.displayName,p||(p=C.displayName||C.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case N:return C=p.displayName||null,C!==null?C:t(p.type)||"Memo";case $:C=p._payload,p=p._init;try{return t(p(C))}catch{}}return null}function e(p){return""+p}function r(p){try{e(p);var C=!1}catch{C=!0}if(C){C=console;var c=C.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return c.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),e(p)}}function o(p){if(p===g)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===$)return"<...>";try{var C=t(p);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function h(){var p=re.A;return p===null?null:p.getOwner()}function n(){return Error("react-stack-top-frame")}function l(p){if(oe.call(p,"key")){var C=Object.getOwnPropertyDescriptor(p,"key").get;if(C&&C.isReactWarning)return!1}return p.key!==void 0}function s(p,C){function c(){pe||(pe=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",C))}c.isReactWarning=!0,Object.defineProperty(p,"key",{get:c,configurable:!0})}function x(){var p=t(this.type);return ue[p]||(ue[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function L(p,C,c,d,i,y,f,a){return c=y.ref,p={$$typeof:b,type:p,key:C,props:y,_owner:i},(c!==void 0?c:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:x}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:f}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function A(p,C,c,d,i,y,f,a){var m=C.children;if(m!==void 0)if(d)if(he(m)){for(d=0;d<m.length;d++)u(m[d]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(m);if(oe.call(C,"key")){m=t(p);var P=Object.keys(C).filter(function(Q){return Q!=="key"});d=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",w[m+d]||(P=0<P.length?"{"+P.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ */var Vi;function kl(){return Vi||(Vi=1,process.env.NODE_ENV!=="production"&&(function(){function t(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===ce?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case A:return"Fragment";case g:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case D:return"SuspenseList";case Z:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case _:return"Portal";case U:return(h.displayName||"Context")+".Provider";case B:return(h._context.displayName||"Context")+".Consumer";case W:var k=h.render;return h=h.displayName,h||(h=k.displayName||k.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case V:return k=h.displayName||null,k!==null?k:t(h.type)||"Memo";case $:k=h._payload,h=h._init;try{return t(h(k))}catch{}}return null}function e(h){return""+h}function r(h){try{e(h);var k=!1}catch{k=!0}if(k){k=console;var o=k.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return o.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),e(h)}}function c(h){if(h===A)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===$)return"<...>";try{var k=t(h);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function x(){var h=ne.A;return h===null?null:h.getOwner()}function n(){return Error("react-stack-top-frame")}function l(h){if(ae.call(h,"key")){var k=Object.getOwnPropertyDescriptor(h,"key").get;if(k&&k.isReactWarning)return!1}return h.key!==void 0}function s(h,k){function o(){be||(be=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}o.isReactWarning=!0,Object.defineProperty(h,"key",{get:o,configurable:!0})}function p(){var h=t(this.type);return pe[h]||(pe[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function f(h,k,o,d,i,y,T,a){return o=y.ref,h={$$typeof:b,type:h,key:k,props:y,_owner:i},(o!==void 0?o:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:p}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function L(h,k,o,d,i,y,T,a){var m=k.children;if(m!==void 0)if(d)if(ue(m)){for(d=0;d<m.length;d++)u(m[d]);Object.freeze&&Object.freeze(m)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(m);if(ae.call(k,"key")){m=t(h);var N=Object.keys(k).filter(function(K){return K!=="key"});d=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",M[m+d]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
19
19
  let props = %s;
20
20
  <%s {...props} />
21
21
  React keys must be passed directly to JSX without using spread:
22
22
  let props = %s;
23
- <%s key={someKey} {...props} />`,d,m,P,m),w[m+d]=!0)}if(m=null,c!==void 0&&(r(c),m=""+c),l(C)&&(r(C.key),m=""+C.key),"key"in C){c={};for(var ie in C)ie!=="key"&&(c[ie]=C[ie])}else c=C;return m&&s(c,typeof p=="function"?p.displayName||p.name||"Unknown":p),L(p,m,y,i,h(),c,f,a)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===b&&p._store&&(p._store.validated=1)}var S=Te,b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),K=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),se=Symbol.for("react.client.reference"),re=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=Object.prototype.hasOwnProperty,he=Array.isArray,Le=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(p){return p()}};var pe,ue={},O=S["react-stack-bottom-frame"].bind(S,n)(),q=Le(o(n)),w={};ja.Fragment=g,ja.jsx=function(p,C,c,d,i){var y=1e4>re.recentlyCreatedOwnerStacks++;return A(p,C,c,!1,d,i,y?Error("react-stack-top-frame"):O,y?Le(o(p)):q)},ja.jsxs=function(p,C,c,d,i){var y=1e4>re.recentlyCreatedOwnerStacks++;return A(p,C,c,!0,d,i,y?Error("react-stack-top-frame"):O,y?Le(o(p)):q)}})()),ja}var Ci;function Al(){return Ci||(Ci=1,process.env.NODE_ENV==="production"?ri.exports=bl():ri.exports=gl()),ri.exports}var $e=Al();function be(t,e,r){console.error(t,e,r)}var nt=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(nt||{}),Et=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))(Et||{}),yt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(yt||{}),sa=(t=>(t.butt="butt",t.round="round",t.square="square",t))(sa||{}),at=(t=>(t.primary="Primary",t.secondary="Secondary",t))(at||{}),Vt=(t=>(t.visible="visible",t.hidden="hidden",t))(Vt||{});const ba="20,10,5,5,5,10",Ll={1:"",2:T.curveLinear,3:T.curveStep},ml={1:dt.annotationLabel,2:dt.annotationLabel,3:dt.annotationCallout,4:dt.annotationCalloutElbow,5:dt.annotationCalloutCurve};var Be=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(Be||{}),Ja=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(Ja||{}),ha=(t=>(t.percentage=",.0%",t.general="",t.scientific=".2n",t.currency_USD=".2$",t.currency_CAD=".2c",t.currency_EUR=".2ē",t.currency_CHF=".2ch",t.currency_UK=".2£",t.currency_INR=".2₹",t.commaSeparated=",",t))(ha||{}),ni=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(ni||{}),$t=(t=>(t.start="1",t.middle="2",t.end="3",t))($t||{}),va=(t=>(t.top="1",t.bottom="2",t))(va||{});const ga={none:"1",discrete:"2",colorTheme:"3"},Wt={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var Za=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(Za||{});const fl={singleColor:"2",multiColor:"1"},ne={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Fa=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Fa||{}),wa=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(wa||{});const Yt={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var De=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(De||{});const qe="Calibri";var pi=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(pi||{}),Aa=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(Aa||{});const Xe={easeLinear:T.easeLinear,easeCubicIn:T.easeCubicIn,easeCubicOut:T.easeCubicOut,easeCubicInOut:T.easeCubicInOut,easeBounceOut:T.easeBounceOut,easeElasticOut:T.easeElasticOut,easeBackOut:T.easeBackOut},Mi={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:De.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:De.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:qe,chartTitleFontStyle:[],chartTitleColor:De.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:De.black,xAxisColorInverted:De.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:qe,xAxisLabelFontStyle:[],xAxisLabelColor:De.black,xAxisNumberFormat:"MMM-YY",xAxisQuarterFormat:"Long",xAxisDisplayUnits:"None",xAxisDisplayUnitsLabel:!1,xAxisLabelRotation:90,xAxisDateFormat:"DD-MM-YYYY",xAxisLabelDecimalPrecision:"2",xAxisLabelText:"",xAxisLabelDynamicText:"",xAxisLabelHTML:"",xAxisPosition:"0",xAxisBackgroundColor:"",xAxisIntervalsVisibility:!1,xAxisMinText:"",xAxisMaxText:"",xAxisIntervalText:"",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:qe,xAxisTitleFontStyle:[],xAxisTitleColor:De.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:De.transparent,yAxisColorInverted:De.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:qe,yAxisLabelFontStyle:[],yAxisLabelColor:De.black,yAxisNumberFormat:",",yAxisDisplayUnits:"Auto",yAxisLabelRotation:90,yAxisDisplayUnitsLabel:!1,yAxisDateFormat:"DD-MM-YYYY",yAxisLabelDecimalPrecision:"0",yAxisLabelText:"",yAxisLabelDynamicText:"",yAxisLabelHTML:"",yAxisPosition:"0",yAxisBackgroundColor:"",yAxisIntervalsVisibility:!1,yAxisMinText:"",yAxisMaxText:"",yAxisIntervalText:"",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:qe,yAxisTitleFontStyle:[],yAxisTitleColor:De.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:De.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:qe,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:De.black,secondaryYAxisNumberFormat:",",secondaryYAxisDisplayUnits:"None",secondaryYAxisDisplayUnitsLabel:!1,secondaryYAxisSyncWithPrimaryLabel:!1,secondaryYAxisDateFormat:"DD-MM-YYYY",secondaryYAxisLabelDecimalPrecision:"2",secondaryYAxisBackgroundColor:"#e5e5e5",secondaryYAxisIntervalsVisibility:!1,secondaryYAxisMinText:"",secondaryYAxisMaxText:"",secondaryYAxisIntervalText:""},secondaryYAxisTitle:{secondaryYAxisTitleVisibility:!0,secondaryYAxisTitleFontSize:"11",secondaryYAxisTitleFontFamily:qe,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:De.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:qe,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:qe,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:qe,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:De.black,vennLabelColor:De.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:De.black},plotArea:{plotAreaColor:De.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:De.black,plotAreaGapWidth:"50",plotAreaSeriesWidth:"50",plotAreaBarWidth:"50",gridLinesVisibility:!0,gridLinesHorizontal:!0,gridLinesVertical:!1,ticksHeight:"100",ticksWidth:"100",gridLinesColor:"#ccc",xCoordinate:"None",yCoordinate:"None",dataLabels:!0,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsforMaps:!1,dataLabelPosition:"1",dataLabelSize:"12",dataLabelValueColor:De.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:De.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:qe,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:De.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:qe,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:De.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:De.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:De.black,opacity:"0.5",plotAreaCalculatedHigh:"#00FF00",plotAreaCalculatedLow:"#FF0000",plotAreaDataLabel:"1",plotAreaDisplayUnits:"None",plotAreaHideLineAndMarkers:!0,dataLabelsOptions:"1",xscaleposition:"1",yscaleposition:"1",numberOfBubbles:!1,totalAlias:!1,totalAliasText:"",refLineBorderThickness:"1",refLineBorderColor:De.black,flipPyramid:!1,opacityforProgressScale:"0.2",opacityforProgressGoal:"1",lineStyle:"Solid",lineWidth:"2",fitChart:!0,scaleFactor:"5",rotation:"0",intersectionLabelVisibility:!1,intersectionValueVisibility:!1,dataLabelsCoordinates:[],hideInsignificantValue:!1,sortBy:"default",chartDirection:"right",plotAreaRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},heatMap:{showHeatMap:!1,heatMapMinColor:"#FF0000",heatMapMaxColor:"#7cfc00"},marker:{markerVisibility:!0,markerSize:"1",markerShape:"Circle",lineWidth:"1.5",markerColor:De.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:De.black,annotationFontSize:"9",annotationFontFamily:qe,annotationFontStyle:[],annotationDecimalPrecision:"2",annotationDisplayUnits:"None",annotationBoxVisibility:[],annotationHideZeroValues:!0,annotationShowHiddenValues:!0,annotationSetLabelColor:"1",annotationRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},total:{totalVisibility:!1,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsCoordinates:[],totalNumberFormat:",",totalColor:De.black,totalFontSize:"9",totalFontFamily:qe,totalFontStyle:[],totalConnectorType:"None",totalDecimalPrecision:"2",totalPosition:"1",totalAlignment:"1",totalHideZeroValues:!0,totalDisplayUnits:"None",editTotalTextToggle:!1,editTotalText:"Total",showTotalLabel:!0},toolTip:{toolTipVisibility:!0,toolTipTheme:"Light",toolTipNumberFormat:",",toolTipNumberFormatProgress:",.0%",toolTipDecimalPrecision:"2",toolTipLabelText:"",toolTipDisplayUnits:"None",toolTipLabelDynamicText:""},nodes:{nodesColor:"#d9d7d7",nodesSingleColor:!1,nodesFillOpacity:"1",spacing:"15",sankeyNodeWidth:"10",sankeyChartType:"Left",curviness:"0.5",nodesBorderVisibility:!0,nodesBorderThickness:"1",nodesBorderColor:De.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:qe,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:De.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:De.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:qe,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:De.black,nodesDisplayUnits:"None",percentageVisibility:!1,nodesLabelOverflow:!0},links:{linksColor:"Source",linksFillOpacity:"0.5"},bins:{binsGapWidth:"0",binsFillOpacity:"0.5",binsCalculation:"Automatic",binsCalculationValue:"3",binsBorderVisibility:!1,binsBorderThickness:"1",binsBorderColor:De.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:qe,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:De.black,connectorFontColor:De.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:De.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:qe,footerNoteFontStyle:[],footerNoteFontColor:De.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:De.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:De.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:qe,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:De.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:qe,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:De.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:qe,textSpacing:"5",textRotation:90},colorScale:{showColor:"1",startColor:"#c1d8f3",endColor:"#4c6ba5",division1:"#c1d8f3",division2:"#b3cbed",division3:"#a4bfe8",division4:"#96b2e2",division5:"#88a6dc",division6:"#7999d7",division7:"#6b8dd1",division8:"#5c80cb",division9:"#4e74c6",division10:"#4c6ba5"},customScaling:{warningTextDummyNode:!1,customScalingtoggle:!1,division1:"#b3b3b3",share1:"",division2:"#b3b3b3",share2:"",division3:"#b3b3b3",share3:"",division4:"#b3b3b3",share4:"",division5:"#b3b3b3",share5:"",division6:"#b3b3b3",share6:"",division7:"#b3b3b3",share7:"",division8:"#b3b3b3",share8:"",division9:"#b3b3b3",share9:"",division10:"#b3b3b3",share10:""},colorScaleForMaps:{defaultColor:"#808080",showColorForMaps:"1",startColorForMaps:"#c1d8f3",endColorForMaps:"#4c6ba5"},pointerValue:{showPointerValue:!1,pointerValueNumberFormat:",",pointerValueDecimalPrecision:"2",connectorKPIforSpeedometer:"1",kpiAlias:!1,kpiAliasText:"",pointerValueDisplayUnits:"None",pointerValueFontSize:"11",pointerValueFontFamily:qe,pointerValueFontStyle:[],pointerValueColor:De.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:De.black,bubbleBorderColor:De.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:De.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:De.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:qe,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:De.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:qe,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:De.black,dataTableAxisLabel:!0,dataTableLegends:!0,disableLegendIcon:!0,legendsWrapText:!1},dataTableOuterBorder:{borderButtonVisibility:!0,lineStyle:"solid",lineColor:"#d9d9d9",lineWidth:"1"},dataTableInnerBorder:{verticalBorderLineButton:!0,verticalBorderLineStyle:"solid",verticalBorderLineColor:"#d9d9d9",verticalBorderLineWidth:"1",horizontalBorderLineButton:!0,horizontalBorderLineStyle:"solid",horizontalBorderLineColor:"#d9d9d9",horizontalBorderLineWidth:"1"},chartPadding:{paddingArrayLTRB:[0,0,0,0]},statisticalTest:{zTest:!1,runZTest:[],zTestInputData:[]},cjsOptions:{cjsTension:0,cjsBorderRadius:0},animation:{animationEnabled:!1,animationDuration:1500,animationEffect:"easeCubicOut"}},Ht={top:0,right:0,bottom:0,left:0};var le=(t=>(t.WaterfallChart="WaterfallChart",t.StackLineChart="StackLineChart",t.NormalizedStackLineChart="NormalizedStackLineChart",t.LineChart="LineChart",t.ColumnChart="ColumnChart",t.StackColumnChart="StackColumnChart",t.AreaChart="AreaChart",t.PieChart="PieChart",t.SankeyChart="SankeyChart",t.DonutChart="DonutChart",t.HorizontalBarChart="HorizontalBarChart",t.StackAreaChart="StackAreaChart",t.NormalizedStackAreaChart="NormalizedStackAreaChart",t.Treemap="Treemap",t.StackHorizontalBarChart="StackHorizontalBarChart",t.NormalizedStackColumnChart="NormalizedStackColumnChart",t.NormalizedStackHorizontalBarChart="NormalizedStackHorizontalBarChart",t.ScatterChart="ScatterChart",t.CustomColumnChart="CustomColumnChart",t.customBarChart="CustomBarChart",t.ColumnHistogramChart="ColumnHistogramChart",t.HorizontalHistogramChart="HorizontalHistogramChart",t.Maps="Maps",t.TornadoChart="TornadoChart",t.PieofPie="PieofPie",t.WordCloud="WordCloud",t.BubbleChart="BubbleChart",t.VennChart="VennChart",t.Speedometer="Speedometer",t.LayeredColumnChart="LayeredColumnChart",t.LayeredHorizontalBarChart="LayeredHorizontalBarChart",t.OrganizationChart="OrganizationChart",t.PyramidChart="PyramidChart",t.ProgressChart="ProgressChart",t.RadialBarChart="RadialBarChart",t.CombinationLine="CombinationLine",t.CombinationArea="CombinationArea",t.CombinationStackArea="CombinationStackArea",t.TornadoDefaultEntry="defaultEntry",t.DotPlot="DotPlot",t))(le||{});const si={1:"",2:T.curveLinear,3:T.curveStep},Tl=[le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart],Si=[le.PieChart,le.PieofPie,le.DonutChart,le.PyramidChart,le.OrganizationChart,le.VennChart,le.ProgressChart,le.Maps,le.WordCloud,le.SankeyChart,le.Speedometer,le.RadialBarChart];function wt(t,e,r,o,h){var n=document.createElement("div");n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.fontSize=e==null?"":e+"px",n.style.fontFamily=r??"",n.style.margin="0",n.style.padding="1px",n.style.border="none",h?(n.style.width=h+"px",n.style.whiteSpace="normal",n.style.overflowWrap="break-word"):n.style.whiteSpace="nowrap",n.innerHTML=t,document.body.appendChild(n);var l=n.getBoundingClientRect(),s=l.width,x=l.height;return o!=null?(n.style.transform=`rotate(${o}deg)`,l=n.getBoundingClientRect(),n.remove(),[s,x,l.width,l.height]):(n.remove(),[l.width,l.height])}function vl(t,e){let r=t.dataTableProperties&&t.dataTableProperties.dataTable,o=r?e*7<50?50:e*7>100?100:e*7:0;return r&&o<30&&(o=30),o}function bi(t,e,r,o,h,n,l,s,x,L,A,u,S){let b=n.dataTableProperties&&n.dataTableProperties.dataTable&&n.xAxisLabel.xAxisPosition=="0"&&!S,_=!1;//!formatOptions.plotArea.fitChart;
24
- let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+10,J=u?gt(n.xAxisLabel.xAxisNumberFormat,s).map(p=>p):s,U=J?J[0]+"":"",V=U.length;J&&J.forEach(p=>{p=p+"";let C=p.trim()?.length||0;C>V&&(V=C,U=p.trim())});let N=wt(U,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),$=N[0]+5,X=N[3]+10,se;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?se=n.xAxisLabel.maxXAxisLabelWidth:se=X<H*.15?X:H*.15:se=X;let re=n.xAxisTitle.xAxisTitleVisibility?n.xAxisTitle.xAxisDynamicTitleText.length!==0?wt(n.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:wt(n.xAxisTitle.xAxisTitleText,"13",qe)[1]:b?5:0;re=re>H*.1?H*.1:re;let oe=b?0:n.xAxisLabel.xAxisLabelVisibility?se:0,he=n.yAxisTitle.yAxisTitleVisibility?n.yAxisTitle.yAxisDynamicTitleText.length!==0?wt(n.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:wt(n.yAxisTitle.yAxisTitleText,"13",qe)[1]:0;he=he>g*.1?g*.1:he;const Le=r*1.1,pe=h*1.1;let ue=n.yAxisLabel.yAxisLabelVisibility?Di(Le,pe,n,!1,A)+5:vl(n,T.max(l,p=>p?.length||0)||0)+10,O=n.secondaryYAxisLabel.secondaryYAxisLabelVisibility?Di(o,x,n,!0,A):0,q=n.secondaryYAxisTitle.secondaryYAxisTitleVisibility?n.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?wt(n.secondaryYAxisTitle.secondaryYAxisTitleHTML,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:wt(n.secondaryYAxisTitle.secondaryYAxisTitleText,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;q=q>g*.1?g*.1:q;let w=n.chartTitle.chartTitleVisibility?n.chartTitle.dynamicTitleText.length!==0?wt(n.chartTitle.chartTitleHTML,void 0,void 0)[1]:wt(n.chartTitle.chartTitleText,"16",qe)[1]:0;return w=w>H*.1?H*.1:w,{width:g,height:H,isChartScrollable:_,legendMargin:K,dimensionHeightWidthArray:N,actualDimesionWidth:$,maxDimensionWidth:X,xTitle:re,xLabel:oe,yTitle:he,yLabel:ue,secondaryYLabel:O,secondaryAxisTitleWidth:q,chartTitleHeight:w}}function kl(t,e,r,o,h,n,l,s,x,L,A,u,S,b){try{const _=b??bi(t,e,r,o,h,n,l,s,x,L,A,u,S),g=S?_.xTitle+_.xLabel:_.yTitle+_.yLabel,H=n.legends.legendPosition,D=n.legends.legendVisibility,j=n.xAxisLabel.xAxisPosition=="1"&&S;let K=0,J=0;const U=L&&!S?_.secondaryYLabel+_.secondaryAxisTitleWidth:0;switch(H){case Be.none:case Be.none:J=15+U,K=g+5;break;case Be.top:J=j?g+5:15+U,K=j?5+U+_.xTitle:g+5;break;case Be.right:J=j?g+5+_.legendMargin:_.legendMargin+U+20,K=j?5+U+_.xTitle+_.legendMargin:g+5;break;case Be.bottom:J=j?g+5:15+U,K=j?5+U+_.xTitle:g+5;break;case Be.left:K=_.legendMargin+g+33,J=15+U;break;default:J=15+U,K=g+5}const V=n.chartPadding?.paddingArrayLTRB;return V&&(K+=V[0],J+=V[2]),n.dataTableProperties&&n.dataTableProperties.dataTable&&A&&!S&&(K=K+35),{left:K,right:J,yLabel:_.yLabel,yTitle:_.yTitle,xLabel:_.xLabel,xTitle:_.xTitle,dimensionHeightWidthArray:_.dimensionHeightWidthArray,chartTitleHeight:_.chartTitleHeight,legendMargin:_.legendMargin,secondaryYLabel:_.secondaryYLabel,secondaryAxisTitleWidth:_.secondaryAxisTitleWidth}}catch(_){throw _}}function Cl(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{const g=b??bi(t,e,r,o,h,n,l,s,x,L,A,u,S),D=n.legends.legendVisibility?n.legends.legendPosition:Be.none,j=_&&!S?12:0,K=S?g.yTitle+g.yLabel:g.xTitle+g.xLabel;let J=0,U=0;switch(D){case Be.none:J=g.chartTitleHeight+5,U=K+5+j;break;case Be.top:J=35+g.chartTitleHeight,U=K+j;break;case Be.right:J=g.chartTitleHeight+5,U=K+5+j;break;case Be.bottom:U=30+K+j,J=g.chartTitleHeight+5;break;case Be.left:J=g.chartTitleHeight+5,U=K+5+j;break;default:J=g.chartTitleHeight+5,U=K+5+j}n.xAxisLabel.xAxisPosition&&!S&&n.xAxisLabel.xAxisPosition=="1"&&(U=U-g.xLabel,J=J+g.xLabel),A&&!S&&(J=J+12);const V=L&&S?g.secondaryYLabel+g.secondaryAxisTitleWidth:0;V&&(J=J+V);const N=n.chartPadding?.paddingArrayLTRB;return N&&(J+=N[1],U+=N[3]),{top:J,bottom:U,chartTitleHeight:g.chartTitleHeight,xAxisRelatedMargin:K,xLabel:g.xLabel,xTitle:g.xTitle}}catch(g){throw g}}function Tt(t,e,r,o,h,n,l,s,x,L,A,u,S,b){try{const _=bi(t,e,r,o,h,n,l,s,x,L,A,u,S),g=kl(t,e,r,o,h,n,l,s,x,L,A,u,S,_),H=Cl(t,e,r,o,h,n,l,s,x,L,A,u,S,_,!0);let D,j=t-g.left-g.right,K=e-H.top-H.bottom,J,U=!1;({visibleBars:D,columnWidth:J,scrollbarVisible:U}=zl(S?K:j,n,b));const V={top:H.top,bottom:H.bottom,left:g.left,right:g.right};if(S){const N=A?30:0;V.right=V.right+N}return n.connector.connectorVisibility!="2"&&b?.chartType==le.StackColumnChart&&(V.top=V.top+20),n.connector.connectorVisibility!="2"&&b?.chartType==le.StackHorizontalBarChart&&(V.right=V.top+20),{margin:V,yLabel:g.yLabel,xLabel:g.xLabel,yTitle:g.yTitle,xTitle:g.xTitle,dimensionHeightWidthArray:g.dimensionHeightWidthArray,chartTitleHeight:g.chartTitleHeight,legendMargin:g.legendMargin,secondaryYLabel:g.secondaryYLabel,secondaryAxisTitleWidth:g.secondaryAxisTitleWidth,visibleBars:D,columnWidth:J,scrollbarVisible:U}}catch(_){throw _}}function vt(t,e,r,o){t.attr("viewBox","0 0 "+e+" "+r);const{chartAreaColor:h,chartAreaBorder:n}=o.chartArea;if(t.style("background-color",h),n){const l=o.chartArea.chartAreaBorderColor,s=o.chartArea.chartAreaBorderThickness,x=o.chartArea.chartAreaBorderStyle.toString(),L=x==="1"?"solid":x==="2"?"dashed":"dotted";t.style("outline",`${s}px ${L} ${l}`).style("outline-offset",`-${s}px`)}else t.style("outline","none").style("outline-offset",null)}const kt=(t,e)=>{let r=T.select(t.current);r.selectAll("*").remove();let o=Fi(Mi,e),h=t.current.getBoundingClientRect(),n=h.width,l=h.height;return{formatOptions:o,svg:r,width:n,height:l}},Qt=(t,e,r)=>{if(!t.dataTableProperties.dataTable)return{formatOptions:t};let o=!1;return e.forEach(h=>{h?.properties?.showInDataTable==!0&&(o=!0)}),r.forEach(h=>{h?.properties?.showInDataTable==!0&&(o=!0)}),o||(t.dataTableProperties.dataTable=!1),{formatOptions:t}};function Fi(t,e){if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const o=t[r],h=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!h||n===void 0){e[r]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const l=wi(o),s=wi(n);l&&s&&Fi(o,n)}),e}function wi(t){return Object.prototype.toString.call(t)==="[object Object]"}function Nt(t,e,r,o,h){parseFloat(t.yAxisLabel.yAxisIntervalText);let n=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText),s=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText),x=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText);if(parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText),t.yAxisLabel.yAxisIntervalsVisibility){t.xAxisLabel.xAxisPosition=="2"&&(t.xAxisLabel.xAxisPosition="0"),l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let K=t.yAxisLabel.yAxisMaxText;n=String(K).length>0?parseFloat(K):r,n&&(r=n),parseFloat(t.yAxisLabel.yAxisIntervalText)<r&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else n=void 0,l=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<h&&(x=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),s=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):h,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(s=void 0,x=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){s=void 0,x=void 0;const K=n!==void 0&&!Number.isNaN(n)?n:r,J=Math.max(K,h);r=J,h=J,n!==void 0&&!Number.isNaN(n)&&(n=J)}let L=e?_e(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=r?_e(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=o?_e(o,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=h?_e(h,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=n?_e(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,_=l?_e(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,g=s?_e(s,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,H=x?_e(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,D=L<A||L===A?r:e;if(l){let K=_<A?r:l;D=D<K?K:D}if(n){let K=b>L?n:e;D=D<K?K:D}n&&l&&(D=b>_?n:l);let j=u<S?h:o;if(x){let K=H<S?h:x;j=j<K?K:j}if(s){let K=g>S?s:h;j=j<K?K:j}return s&&x&&(j=g>H?s:x),{maxNumberForPrimaryAxis:D,maxNumberForSecondaryAxis:j,customYaxisMaxValue:r,secondaryCustomYaxisMaxValue:h}}function _e(t,e,r,o,h){try{let n,l="",s=o,x;if(e==="Auto")return Ml(t);switch(e!=Ja.none&&(e==Ja.thousands&&(n=1e3,l="K"),e==Ja.millions&&(n=1e6,l="M"),e==Ja.billions&&(n=1e9,l="B"),t=t/n),h&&t<0&&(t=-t),r){case ha.percentage:return x=`.${s}%`,T.format(x)(t);case ha.general:return x=`.${s}f`,T.format(x)(t)+l;case ha.scientific:let L=Number(s);return x=`.${L==0?1:(L+1).toString()}n`,T.format(x)(t)+l;case ha.currency_USD:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"$"+T.format(x)(t)+l;case ha.currency_CAD:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"C$"+T.format(x)(t)+l;case ha.currency_EUR:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"€"+T.format(x)(t)+l;case ha.currency_CHF:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"CHF"+T.format(x)(t)+l;case ha.currency_UK:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"£"+T.format(x)(t)+l;case ha.currency_INR:if(x=`,.${s}f`,t<0){const A=Math.abs(t);return"-$"+T.format(x)(A)+l}return"₹"+T.format(x)(t)+l;case ha.commaSeparated:return x=`,.${s}f`,T.format(x)(t)+l;default:return x=".2f",T.format(x)(t)+l}}catch(n){throw n}}function Ml(t){if(t==null||isNaN(t))return"-";const e=Math.abs(t);if(e>=1e9)return T.format(".2s")(t).replace("G","B");if(e>=1e6)return T.format(".2s")(t);if(e>=1e3)return T.format(".2s")(t);if(e>=1){const r=T.format(".2f")(t);return+r===Math.floor(t)?T.format(".0f")(t):r}else return e>=.01?T.format(".2f")(t):e>0?T.format(".2e")(t):"0"}function Di(t,e,r,o,h){try{{let n,l,s=o?r.secondaryYAxisLabel.secondaryYAxisDisplayUnits:r.yAxisLabel.yAxisDisplayUnits,x=o?r.secondaryYAxisLabel.secondaryYAxisNumberFormat:r.yAxisLabel.yAxisNumberFormat,L=o?r.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:r.yAxisLabel.yAxisLabelDecimalPrecision,A=o?r.secondaryYAxisLabel.secondaryYAxisLabelFontSize:r.yAxisLabel.yAxisLabelFontSize,u=o?r.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:r.yAxisLabel.yAxisLabelFontFamily;if(s!="None")return n=_e(Math.floor(t)||Math.floor(e),s,x,L??"2").toString(),l=wt(n,A,u)[0],l<30?30:l+5;try{return n=_e(Math.floor(t)||Math.floor(e),s,x,L??"2").toString(),h&&(n="-100%"),l=wt(n,A,u)[0],l<30?30:l+5}catch{}}}catch(n){throw n}}function Ct(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){throw r}}function mt(t,e,r,o,h,n,l){try{let s=l??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",s+"-clip").append("rect").attr("width",o).attr("height",r>0?h-r:h),t.append("rect").attr("width",o).attr("height",r>0?h-r:h).attr("stroke",e.plotArea.plotAreaBorder&&!Si.includes(n)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==De.white&&!Si.includes(n)?e.plotArea.plotAreaColor:"none")}catch(s){throw s}}function Sl(t,e){const r=t.yPosition,o=t.yPosition+t.height,h=e.yPosition,n=e.yPosition+e.height;return r<n&&o>h}function st(t,e,r,o,h,n,l,s,x){try{let L=o.yAxisLabel.yAxisIntervalsVisibility,A=!1,u=L?parseFloat(o.yAxisLabel.yAxisIntervalText):void 0,S=[],b;if(h.chartType===le.TornadoChart){const g=Math.max(Math.abs(e),Math.abs(t)),H=l||g,D=n||e;if(u&&u>0){for(let j=D;j<=H+1e-6;j+=u)S.push(parseFloat(j.toFixed(6)));b=S.length}else{A=!0;const j=6,J=(H-D)/j;for(let U=0;U<=j;U++){const V=D+U*J;S.push(parseFloat(V.toFixed(6)))}b=s?x/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:A}}if(!l&&t>0){const H=(t-e)*.05;t=t+H}if(u&&u!==0&&u!==void 0){let g=n||n==0?n:e,H=l||l==0?l:t;g<0?b=Math.floor((H-g)/u):b=Math.floor(H/u);let D=18;(l||l==0)&&(t=l);let j=n||n==0?n:e<0?Math.round(e):0;if(S.push(j),b>100){let K="Tick count cannot exceed more than 100.";g<0?u=(H-j)/100:u=H/100}if(b=b<100?b:100,b>D)for(let K=0;K<parseInt(b)&&(j+=u,parseFloat(j.toFixed(5))<=t);K++)S.push(j);else for(let K=0;K<D&&(j+=u,j<=t);K++)S.push(j)}else{A=!0;let g=wt((l||h.yMaxLeft).toString(),o.yAxisLabel.yAxisLabelFontSize,o.yAxisLabel.yAxisLabelFontFamily,0);S=Vi(n||h.yMinLeft,t,s?x:r,s?g[1]:g[0]),b=s?x/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:A}}catch(L){throw L}}function Vi(t,e,r,o=80){const h=e-t;if(!isFinite(h)||Math.abs(h)<1e-12)return[Number(t.toFixed(12))];const n=h<10?10:Math.max(2,Math.floor(r/o)),l=h/n,s=Math.pow(10,Math.floor(Math.log10(l))),x=[1,1.5,2,2.5,5,10];let L=x.map(_=>_*s).find(_=>Math.ceil(h/_)<=n);L||(L=x.at(-1)*s);const A=Math.floor(t/L)*L,u=Math.ceil(e/L)*L,S=Math.round((u-A)/L),b=new Array(S+1);for(let _=0;_<=S;_++)b[_]=Number((A+_*L).toFixed(12));return b}function Gt(t,e,r,o,h,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==De.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(h);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==De.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(l){throw l}}function oi(t,e,r,o,h,n,l){let s=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${l},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==De.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const x=t.append("g").call(h).attr("transform",`translate(${l},0)`);x.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==De.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").attr("visibility",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),x.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",e.secondaryYAxisLabel.secondaryYAxisWidth),x.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",e.plotArea.fitChart?"1":"0").append("text").attr("transform","rotate(90)").attr("text-anchor","start").attr("class","DisplayUnit").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor).style("font-size",parseFloat(e.secondaryYAxisLabel.secondaryYAxisLabelFontSize)*.8).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle).attr("visibility",e.secondaryYAxisLabel.secondaryYAxisDisplayUnitsLabel==!1?"hidden":"visible").text("("+e.secondaryYAxisLabel.secondaryYAxisDisplayUnits+")")}function Lt(t,e){try{let r=[],o=e/30<t.length?Math.round(e/30):t.length;if(o>=t.length)return r=t,r;let h=Math.round(t.length/o);(t.length-1)%h!=0&&(t.length-1)%(h+1)==0&&(h=h+1),r.push(t[0]);let n;for(let l=1;l<t.length-1;l++){const s=l*h;if(s>t.length)break;r.push(t[s]),n=s}if(!r.includes(t[t.length-1])){let l=n>=Math.round(t.length-t.length*.02);r.push(t[t.length-1])}return r=r.filter(l=>l)}catch(r){throw r}}function qt(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{let g=e.chartType!==le.ColumnHistogramChart?Lt(b,u):[],H=[],D=s[3]+10;e.chartType!=le.ColumnHistogramChart?H=A?gt(o.xAxisLabel.xAxisNumberFormat,g.map(O=>O)).map(O=>O):g:g.forEach(O=>{H.push(e.formattedDimensionListMap.get(O))});let j=!o.plotArea.fitChart&&(e.chartType==le.AreaChart||e.chartType==le.StackAreaChart||e.chartType==le.NormalizedStackAreaChart);t||(t=t);let K=o.xAxisLabel.xAxisLabelFontStyle,J="rotate("+-o.xAxisLabel.xAxisLabelRotation+")";o.dataTableProperties&&o.dataTableProperties.dataTable&&Tl.includes(e.chartType)&&o.xAxisLabel.xAxisPosition!="1"&&(o.xAxisLabel.xAxisLabelVisibility=!1);let U=o.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const V=t.append("g").attr("id","x-axis");V.append("rect").attr("transform",`translate(1,${U==="0"?h>0?S-h:S:U==="1"?-r:n(0)})`).attr("height",r).attr("width",u).attr("fill",o.xAxisLabel.xAxisLabelVisibility&&o.xAxisLabel.xAxisBackgroundColor?o.xAxisLabel.xAxisBackgroundColor!==De.white?o.xAxisLabel.xAxisBackgroundColor:"none":o.chartArea.chartAreaColor);const N=V.append("g").attr("transform",`translate(0,${U=="0"?h>0?S-h:S:U=="1"?0:n(0)})`).call(l);let $=U==="1"?"5":"0",X;o.xAxisLabel.labelTextWrap?o.xAxisLabel.multiLineLabelWrap?X=o.xAxisLabel.maxXAxisLabelWidth:X=D<x*.15?D:x*.15:X=o.xAxisLabel.xAxisLabelRotation==0?L:D;const se=typeof _.step=="function"?_.step():L,re=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,oe=Math.floor(se/re),he=o.xAxisLabel.xAxisLabelRotation==0;let Le=N.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(X)).style("height",se+"px").attr("transform",(O,q)=>`rotate(${U==="1"?-o.xAxisLabel.xAxisLabelRotation:o.xAxisLabel.xAxisLabelRotation!=0?180-o.xAxisLabel.xAxisLabelRotation:0}) translate (${o.xAxisLabel.xAxisLabelRotation!=0?$+`, -${q==0&&j?15:se/2}`:-X/2+" , "+(U==="1"?"-15":"8")})`);he||Le.style("overflow","visible"),Ni()==="safari"&&Le.attr("width",o.xAxisLabel.labelTextWrap?D<x*.125?D:x*.125:r).attr("height","20px");let ue=Le.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",he?"center":"end").style("align-items",he?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Ni()==="safari"||U==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&ue.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&ue.style("-webkit-line-clamp",oe.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),ue.style("text-align",o.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",o.xAxisLabel.xAxisLabelFontFamily).style("color",o.xAxisLabel.xAxisLabelColor).style("font-size",o.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",K.includes("Italic")?"Italic":"").style("text-decoration",K.includes("Underline")?"Underline":"").style("font-weight",K.includes("Bold")?"Bold":"").style("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===le.ColumnHistogramChart?ue.attr("title",(O,q)=>_e(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((O,q)=>_e(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)):ue.attr("title",(O,q)=>(""+H[q]).trim()).html((O,q)=>(""+H[q]).trim()),N.selectAll("text").style("visibility",(o.xAxisLabel.xAxisLabelVisibility,"hidden")),N.selectAll("line").style("stroke",o.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility||o.plotArea.gridLinesVertical?"visible":"hidden"),N.select(".domain").style("stroke",o.xAxisLabel.xAxisColor).attr("stroke-width",o.xAxisLabel.xAxisWidth?o.xAxisLabel.xAxisWidth:o.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(g){throw g}}function Ni(){let t="";try{const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1:t="edge";break;case(e.indexOf("opr")>-1&&!!window.opr):t="opera";break;case(e.indexOf("chrome")>-1&&!!window.chrome):t="chrome";break;case e.indexOf("trident")>-1:t="ie";break;case e.indexOf("firefox")>-1:t="firefox";break;case(e.indexOf("safari")>-1||e.indexOf("applewebkit")>-1):t="safari";break;default:t="other";break}}catch(e){throw e}finally{return t}}const Pi={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},Fl=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const r=Math.floor(e-25569),o=new Date(r*86400*1e3);return Number.isNaN(o.getTime())?null:{day:o.getUTCDate(),month:o.getUTCMonth(),year:o.getUTCFullYear()}},wl=t=>String(t%100).padStart(2,"0"),Dl=(t,e,r,o)=>{const h=Pi.short[e],n=Pi.long[e],l=String(t).padStart(2,"0"),s=String(e+1).padStart(2,"0"),x=wl(r),L=String(r);switch(o){case"Month":return n;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${L}`;case"Year":return L;case"Default":return`${l}-${h}-${L}`;case"DD-MM-YYYY":return`${l}-${s}-${L}`;case"MM-DD-YYYY":return`${s}-${l}-${L}`;case"DD-MM":return`${l}-${s}`;case"YYYY-MM-DD":return`${L}-${s}-${l}`;case"YYYY-MM":return`${L}-${s}`;case"YYYY":return L;case"MM-YYYY":return`${s}-${L}`;case"MMM-YY":return`${h}-${x}`;case"YY-MMM":return`${x}-${h}`;case"MMMM-YY":return`${n}-${x}`;case"MMMM-YYYY":return`${n}-${L}`;case"DD-MMM":return`${l}-${h}`;case"DD-MMM-YY":return`${l}-${h}-${x}`;case"DD-MMM-YYYY":return`${l}-${h}-${L}`;default:return`${l}-${h}-${L}`}},gt=(t,e)=>{try{return e.map(r=>{const o=Fl(r);if(!o)return r;const{day:h,month:n,year:l}=o;return Dl(h,n,l,t)})}catch(r){throw r}};function za(t,e,r){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let o=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(r).enter().filter(n=>n.isVisible).append("g").attr("class","seriesLabels").attr("transform",n=>`translate(${n.xPosition}, ${n.yPosition})`).append("foreignObject").attr("width",n=>n.width).attr("height",n=>n.height).append("xhtml:div").style("display","flex").style("align-items","center").style("justify-content","center").style("width","100%").style("height","100%").append("xhtml:div").style("width","fit-content").style("height","100%").style("padding-left","5px").style("padding-right","5px").style("border-radius","4px").style("background-color",t.seriesLabel.seriesLabelBackgroundColor).style("font-size",t.seriesLabel.seriesLabelFontSize+"px").style("font-family",t.seriesLabel.seriesLabelFontFamily).style("font-style",o.includes("Italic")?"italic":"").style("text-decoration",o.includes("Underline")?"underline":"").style("font-weight",o.includes("Bold")?"bold":"").style("color","black").text(n=>n.seriesValue)}}function Vl(t,e,r,o,h,n){const l=r.xAxisLabel.xAxisPosition!="1"?e.left-20-h:5;return t?`rotate(-90) translate(-${e.top+o},${l})`:`translate(${e.left},${e.top+o+(r?.xAxisLabel?.xAxisPosition=="1"?0:t?n:h)})`}function Mt(t,e,r,o,h,n,l,s,x,L,A){try{let u=r.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",Vl(e,o,t,A,h,x)).attr("class","xAxisTitle").attr("width",e?A:L).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):u.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){throw u}}function St(t,e,r,o,h,n,l,s,x,L,A){try{let u=r>0?t-r:t,S=h.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",o?n.left:`-${n.top+u}`).attr("y",o?n.top+u+s:n.left-l-s).attr("class","yAxisTitle").attr("transform",o?"":"rotate(-90)").attr("width",o?x:u).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?S.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):S.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),h}catch(u){throw u}}function Ut(t,e,r,o,h,n,l,s,x,L=!1){let A=t.append("foreignObject").attr("visibility",e&&o.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",L?`${r.left}`:`-${r.top+(h>0?n-h:n)}`).attr("y",L?`${r.top-s-x-2}`:`${r.left+l+s-2}`).attr("class","yAxisTitleSecondary").attr("transform",L?"rotate(0)":"rotate(-90)").attr("width",L?l:h>0?n-h:n).attr("height",x+"px");o.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?A.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleHTML?o.secondaryYAxisTitle.secondaryYAxisTitleHTML:o.secondaryYAxisTitle.secondaryYAxisTitleText):A.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",o.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",o.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",o.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleText)}function Ft(t,e,r,o){let h=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r-4).attr("height",o+"px");const n=x=>{const L=document.createElement("div");return L.innerHTML=x,L.textContent||L.innerText||""},s=!!e.chartTitle.chartTitleHTML?n(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?h.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):h.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow","hidden").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",e.chartTitle.chartTitleFontFamily).attr("title",e.chartTitle.chartTitleText).html(e.chartTitle.chartTitleText)}function Ot(t){if(t.line.interpolationType=="1")return T.curveLinear;if(t.line.interpolationType=="2"&&t.line.smoothType=="1")return T.curveMonotoneX;if(t.line.interpolationType=="2"&&t.line.smoothType=="2")return T.curveCardinal.tension(parseFloat(t.line.cardinalTension));if(t.line.interpolationType=="3"&&t.line.stepPosition=="1")return T.curveStepBefore;if(t.line.interpolationType=="3"&&t.line.stepPosition=="2")return T.curveStep;if(t.line.interpolationType=="3"&&t.line.stepPosition=="3")return T.curveStepAfter}function Nl(t){const e=t.indexOf(" - ");return e==-1?pi.default:t.slice(e+3)}const La=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function $a(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Rt(t,e,r){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:o,minVal:h,maxVal:n}=e.annotation.annotationRangeFilter;return t.filter(l=>{const s=r(l);switch(o){case"lt":return s<=n;case"gt":return s>=h;case"in":return s>=h&&s<=n;case"not-in":return s<h||s>n;default:return!0}})}function Da(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J,U,V,N){try{const $=L===le.TornadoChart;let X=new Map,se=x.annotation.annotationType??"1",re=x.annotation.annotationPosition.toString()!="4"?x.annotation.annotationPosition:null,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const he=x.annotation.connectorType?.toLowerCase()==="curve";if(x.annotation.annotationVisibility){let Le=[se=="1"?"connector":""],pe=[],ue=n.annotation(),O=x.annotation.connectorType,q=x.annotation.annotationVisibility,w=x.annotation.annotationFontStyle,p=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates)),C=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";p=gi(p,x,L);let c=[],d=[];switch(p.length!=0&&p.forEach(a=>{a.dx=a.dx*u/a.width,a.dy=a.dy*A/a.height,a.width=u,a.height=A}),q){case"2":t.forEach(a=>{a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"3":t.forEach(a=>{a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"4":t.forEach(a=>{a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})}),t.forEach(a=>{a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(m=>{m.data[a]&&pe.push({Dimension:m.data[a].dimension,Measure:m.data[a].value,Legend:m.data[a].legend,LabelPosition:re||m.properties.annotationPosition,Labelcolor:m.properties[oe],hoverText:La(m,N),Axis:m.properties.axis,LegendUniqueId:m.properties.legendUniqueId})});break;case"5":break;case"6":t.forEach(a=>{switch(a.properties.annotation.toString()){case"1":for(let P=0;P<t[0].data.length;P++)a.data[P]&&pe.push({Dimension:a.data[P].dimension,Measure:a.data[P].value,Legend:a.data[P].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"2":break;case"3":a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"4":a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"5":a.data[0]&&pe.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId}),a.data[a.data.length-1]&&pe.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:re||a.properties.annotationPosition,Labelcolor:a.properties[oe],hoverText:La(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;pe.forEach((a,m)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;pe.forEach((a,m)=>{let P={note:{label:a.Measure>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":_e(L===le.TornadoChart?Math.abs(a.Measure):a.Measure,x.annotation.annotationDisplayUnits||x.plotArea.plotAreaDisplayUnits,x.annotation.annotationNumberFormat,x.annotation.annotationDecimalPrecision),align:V&&L!==le.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":L===le.TornadoChart?"end":"middle"},data:V?{y:$?Nl(a.Legend):a.Dimension,x:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure}:{x:a.Dimension,y:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure},dx:0,dy:0,connector:{end:C,curve:si[x.annotation.connectorCurve],points:he?$a(0,0):[[0,0],[0,0]]},disable:Le,subject:{height:15,width:15},color:a.Labelcolor,type:ci(n,parseFloat(se)),height:A,width:u};if(V){let ie=a.Axis===at.primary?r:o;(Lt(b,_).includes(a.Dimension)||L===le.TornadoChart)&&!l.includes(a.Legend)&&ie(a.Measure)<=S&&ie(a.Measure)>=0&&c.push(P)}else Lt(b,S).includes(a.Dimension)&&!l.includes(a.Legend)&&(a.Axis==at.primary?r(a.Measure)<=_&&r(a.Measure)>=0:o(a.Measure)<=_&&o(a.Measure)>=0)&&c.push(P)}),x.annotation.annotationHideZeroValues&&(c=c.filter(a=>V?a.data.x.measure!==0:a.data.y.measure!==0)),c=Rt(c,x,a=>V?a.data.x.measure:a.data.y.measure),p.length===0?(p=c,X=new Map(p.map(a=>[a.data.legendUniqueId,{measure:V?a.data.x.measure:a.data.y.measure,dimension:V?a.data.y:a.data.x,legendUniqueId:a.data.legendUniqueId,dx:a.dx,dy:a.dy,connectorPoints:a.connector?.points||[],isVisible:a.data.isVisible??!0,width:a.width,height:a.height}]))):X=new Map(p.map(a=>[a.legendUniqueId,a])),c.forEach(a=>{const m=a.data.legendUniqueId;if(p.length!=0){const P=X.get(m);P&&(a.dx=P.dx,a.dy=P.dy,a.data.isVisible=P.isVisible??!0,P?.connectorPoints&&P.connectorPoints.length>=(he?3:2)?a.connector.points=P.connectorPoints:a.connector.points=he?$a(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),ue.editMode(x.annotation.annotationDraggable&&J).accessors({x:function(a){if(V){let m=a.x.axis===at.primary?r:o,P=a.x.axis;return Ii(x,a.x.measure?a.x.measure:0,a.position,m,y,void 0,L,U,P)}else if(L===le.ColumnChart){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=j(m);return P!=null?e(a.x)+P-(K-j.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==at.primary)return Xa(a.y.measure,parseFloat(a.position),r,y,a.prevValue,L);if(V){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=j&&L!==le.DotPlot?j(m):0;return $?j(a.y)+j.bandwidth()/2:j?e(a.y)+P-(K-j.bandwidth())/2-5:e(a.y)-5}else return Xa(a.y.measure,parseFloat(a.position),o,y,a.prevValue,L)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,p.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(f.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","block"),m.data.isVisible=!0)})),d.forEach(m=>{(m.data?.legendUniqueId==a.data.legendUniqueId||m.legendUniqueId==a.data.legendUniqueId)&&(m.dx=a._dx*u/m.width,m.dy=a._dy*A/m.height,m.connectorPoints=a.connector?.points?.map(P=>[...P])||[])}),D){const m=d.map(P=>({legendUniqueId:P.data?.legendUniqueId||P.legendUniqueId,dx:P.dx,dy:P.dy,connectorPoints:P.connectorPoints||[],isVisible:(P.data?.isVisible||P.isVisible)??!0,width:P.width,height:P.height}));D(m)}f.selectAll(".connector").attr("hoverId",m=>m.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),f.selectAll(`.connector-${C}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),f.selectAll(".note-line").attr("hoverId",m=>m.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]).filter(m=>m._dx==0&&m._dy==0).remove(),f.selectAll(".annotation-note-label").filter(m=>m.data&&m.data.isVisible).style("display","block")}).on("noteclick",function(a){x.annotation.annotationDraggable&&J&&(a.data.isVisible=!1,p.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(f.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","none"),m.data.isVisible=!1)}),f.selectAll(".annotation-note-label").filter(m=>m.data&&!m.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>r.invert(a.y)}).notePadding(0).annotations(d),x.plotArea.fitChart&&H.selectAll(".annotation-group").remove();let f=Li(H,x,h,w,ue,C,V);if(x.animation?.animationEnabled){const a=x.animation.animationDuration,m=Xe[x.animation.animationEffect],P=ue.accessors(),ie=L===le.LineChart,Q=L===le.DotPlot,Ae=(ge,we=0)=>{const fe=P.x(ge.data),ae=P.y(ge.data);return`translate(${fe+we}, ${ae})`};if(Q)f.selectAll(".annotation").attr("opacity",0).attr("transform",ge=>Ae(ge,-15)).transition().duration(a).ease(m).attr("opacity",1).attr("transform",ge=>Ae(ge));else if(ie){const ge=e.range?e.range():[0,1],we=Math.min(ge[0],ge[1]),fe=Math.max(ge[0],ge[1])-we,ae=(ke,ce=100)=>{for(let me=0;me<=ce;me++){const Ve=me/ce;if((m??T.easeLinear)(Ve)>=ke)return Ve}return 1};f.selectAll(".annotation").attr("opacity",0).each(function(ke){const ce=P.x(ke.data)??we,me=fe>0?Math.max(0,Math.min(1,(ce-we)/fe)):0,Ve=ae(me)*a;T.select(this).transition().delay(Ve).duration(0).attr("opacity",1)})}else f.selectAll(".annotation").attr("transform",function(ge){if(V){const we=r?r(0):0,fe=P.y(ge.data);return`translate(${we}, ${fe})`}else{const we=P.x(ge.data),fe=ge.data?.y?.axis===at.primary?r:o??r,ae=fe?fe(0):0;return`translate(${we}, ${ae})`}}).transition().duration(a).ease(m).attr("transform",function(ge){const we=P.x(ge.data),fe=P.y(ge.data);return`translate(${we}, ${fe})`})}}}catch($){throw $}}function Pl(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J,U){try{let V=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let N=[V=="1"?"connector":""],$=[],X=new Map,se=n.annotation(),re=u.annotation.connectorType,oe=u.annotation.annotationVisibility,he=u.annotation.annotationFontStyle,Le=[],pe=[],ue=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const O=u.annotation.connectorType?.toLowerCase()==="curve";let q=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));q=gi(q,u,le.CustomColumnChart);let w=[],p=[];q.length!=0&&q.forEach(i=>{i.dx=i.dx*b/i.width,i.dy=i.dy*S/i.height,i.width=b,i.height=S});for(let i=0;i<t.length;i++)t.forEach(y=>{y.properties.type&&y.properties.type!=le.ColumnChart&&!pe.includes(y.properties.type)&&pe.push(y.properties.type)});switch(oe){case"2":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(f=>$.push(f[0]));break;case le.StackAreaChart:s.forEach(f=>$.push(f[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case le.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"4":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(f=>$.push(f[0]));break;case le.StackAreaChart:s.forEach(f=>$.push(f[0]));break}}),t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case le.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:i.data.forEach(a=>$.push({...a,alias:i.properties?.alias}));break;case le.StackColumnChart:let y=l.findIndex(a=>a.key===i.properties.legend);y!==-1&&l[y].forEach(a=>$.push(a));break;case le.StackAreaChart:let f=s.findIndex(a=>a.key===i.properties.legend);f!==-1&&s[f].forEach(a=>$.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let f=i.properties.annotation.toString();switch(i.properties.type){case le.ColumnChart:switch(f){case"1":for(let P=0;P<t[y].data.length;P++)$.push(i.data[P]);break;case"2":break;case"3":$.push(i.data[0]);break;case"4":$.push(i.data[i.data.length-1]);break;case"5":$.push(i.data[0]),$.push(i.data[i.data.length-1]);break}break;case le.AreaChart:case le.LineChart:switch(f){case"1":for(let P=0;P<t[y].data.length;P++)$.push({dimension:i.data[P].dimension,value:i.data[P].value,legend:i.data[P].legend,labelPosition:i.data[P].labelPosition,labelColor:i.data[P].labelColor,axis:i.data[P].axis,type:i.properties.type,alias:i.properties?.alias});break;case"2":break;case"3":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias});break;case"4":$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break;case"5":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias}),$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break}break;case le.StackColumnChart:const a=l.findIndex(P=>P.key===i.properties.legend);a!==-1&&l[a].forEach((P,ie)=>{switch(String(l[a].individualAnnotationVisibility)){case"1":$.push(l[a][ie]);break;case"2":break;case"3":let Q=l[a][0];$.find(fe=>fe.key==Q.key)||$.push(Q);break;case"4":let Ae=l[a][l[0].length-1];$.find(fe=>fe.key==Ae.key)||$.push(Ae);break;case"5":let ge=l[a][0],we=l[a][l[0].length-1];if(!$.find(fe=>fe.key==ge.key||fe.key==we.key)){$.push(l[a][0]),$.push(l[a][l[0].length-1]);break}}});break;case le.StackAreaChart:const m=s.findIndex(P=>P.key===i.properties.legend);m!=-1&&s[m].forEach((P,ie)=>{switch(String(s[m].individualAnnotationVisibility)){case"1":$.push(s[m][ie]);break;case"2":break;case"3":let Q=s[m][0];$.find(fe=>fe.key==Q.key)||$.push(Q);break;case"4":let Ae=s[m][s[0].length-1];$.find(fe=>fe.key==Ae.key)||$.push(Ae);break;case"5":let ge=s[m][0],we=s[m][s[0].length-1];if(!$.find(fe=>fe.key==ge.key||fe.key==we.key)){$.push(ge),$.push(we);break}}});break}});break}let C=0;$.forEach((i,y)=>{C<i.value&&(C=i.value)});let c=C*.1;$.forEach((i,y)=>{let f={note:{label:i.value||i.value==0?i.value>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":_e(i.value,u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":_e(i[1]-i[0],u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision),align:"middle"},data:{x:i.dimension&&i.legend?{dimension:i.dimension,legend:i.legend,type:i.type,axis:i.axis||i.data.axis}:{dimension:i.data.dimension,legend:i.key,type:i.data.type,stacklegend:i.data.legend,axis:i.data.axis},y:i.value||i.value==0?i.value:i.data.type!=le.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0],prevValue:i[0]>=0?i[0]:i[1],position:parseInt(i.labelPosition)?parseInt(i.labelPosition):parseInt(i.data.labelPosition),type:i.type,currentLegend:i.legend?.includes("~$~")?i.legend.split("~$~")[1]:i.key?.includes("~$~")?i.key.split("~$~")[1]:i.legend??i.key,isVisible:!0,hoverId:i?.alias?.replaceAll(" ","-"),legendUniqueId:i.legendUniqueId+"~$~"+(i.dimension??i.data.dimension)+"~$~"+(i.value||i.value==0?i.value:i.data.type!=le.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:ue,curve:si[u.annotation.connectorCurve],points:O?$a(0,0):[[0,0],[0,0]]},disable:N,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:ci(n,parseFloat(V)),height:S,width:b};i.legend&&i.dimension?!x.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==at.primary?r(i.value)<=H&&r(i.value)>=0:o(i.value)<=H&&o(i.value)>=0)&&w.push(f):!x.includes(i.key)&&(i.data.axis==at.primary?r(i[1])<=H&&r(i[1])>=0:o(i[1])<=H&&o(i[1])>=0)&&w.push(f)}),u.annotation.annotationHideZeroValues&&(w=w.filter(i=>i.data.y!==0)),w=Rt(w,u,i=>i.data.y),q.length===0?(q=w,X=new Map(q.map(i=>[i.data.legendUniqueId,{measure:i.data.y,dimension:i.data.x.dimension,legendUniqueId:i.data.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connector?.points||[],isVisible:i.data.isVisible??!0,width:i.width,height:i.height}]))):X=new Map(q.map(i=>[i.legendUniqueId,i])),w.forEach(i=>{const y=i.data.legendUniqueId;if(q.length!=0){const f=X.get(y);f&&(i.dx=f.dx,i.dy=f.dy,i.data.isVisible=f.isVisible??!0,f?.connectorPoints&&f.connectorPoints.length>=(O?3:2)?i.connector.points=f.connectorPoints:i.connector.points=O?$a(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&p.push(i)}),se.editMode(u.annotation.annotationDraggable&&U).accessors({x:function(i){const y=i.x.type||i.type;if(pe.includes(y))switch(y){case le.StackColumnChart:return e(i.x.dimension)+J(i.x.stacklegend)-(A-J.bandwidth())/2;case le.StackAreaChart:case le.LineChart:case le.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const f=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+J(f)-(A-J.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==at.primary?Xa(i.y,parseFloat(i.position),r,c,i.prevValue,y):Xa(i.y,parseFloat(i.position),o,c,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,q.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(f=>f.data.x.dimension==i.data.x.dimension&&f.data.x.legend==i.data.x.legend&&f.data.x.type==i.data.x.type&&f.data.prevValue==i.data.prevValue).attr("display","block"),y.data.isVisible=!0)})),p.forEach(y=>{(y.data?.legendUniqueId==i.data.legendUniqueId||y.legendUniqueId==i.data.legendUniqueId)&&(y.dx=i._dx*b/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(f=>[...f])||[])}),K){const y=p.map(f=>({legendUniqueId:f.data?.legendUniqueId||f.legendUniqueId,dx:f.dx,dy:f.dy,connectorPoints:f.connector.points||f.connectorPoints||[],isVisible:(f.data?.isVisible||f.isVisible)??!0,width:f.width,height:f.height}));K(y)}d.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[u.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${ue}`).attr("fill",u.annotation.connectorColor||"#ccc").style("stroke",u.annotation.connectorColor||"#ccc"),d.selectAll(".note-line").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[u.annotation.connectorStyle.toLowerCase()]).filter(y=>y._dx==0&&y._dy==0).remove(),d.selectAll(".annotation-note-label").filter(y=>y.data&&y.data.isVisible).style("display","block")}).on("noteclick",function(i){u.annotation.annotationDraggable&&U&&(i.data.isVisible=!1,q.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(f=>f.data.x.dimension==i.data.x.dimension&&f.data.x.legend==i.data.x.legend&&f.data.x.type==i.data.x.type&&f.data.prevValue==i.data.prevValue).attr("display","none"),y.data.isVisible=!1)}),d.selectAll(".annotation-note-label").filter(y=>y.data&&!y.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==at.primary?r.invert(i.y):o.invert(i.y)}).notePadding(0).annotations(p),u.plotArea.fitChart||j.selectAll(".annotation-group").remove();let d=Li(j,u,h,he,se,ue,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=Xe[u.animation.animationEffect],f=se.accessors();d.selectAll(".annotation").attr("transform",function(a){const m=f.x(a.data),P=a.data.type||a.type,Q=(a.data?.x?.axis||a.data?.axis)===at.primary?r:o;let Ae;return P===le.StackColumnChart||P===le.StackAreaChart?Ae=Q(a.data.prevValue??0):Ae=Q(0),`translate(${m}, ${Ae})`}).transition().duration(i).ease(y).attr("transform",function(a){const m=f.x(a.data),P=f.y(a.data);return`translate(${m}, ${P})`})}}}catch(V){throw V}}const gi=(t,e,r)=>{try{let o=[le.PieChart,le.DonutChart].includes(r)?"plotArea":"annotation";return t=e[o].annotationDraggable&&!!1?t??[]:[],t}catch(o){throw o}},ci=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},Xa=(t,e,r,o,h,n)=>{try{let l=[le.LineChart,le.StackLineChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.NormalizedStackLineChart,le.StackAreaChart];switch(h||(h=0),e){case 1:let s;switch(n){case le.LineChart:case le.HorizontalBarChart:case le.ColumnChart:case le.AreaChart:case le.StackAreaChart:s=t<0?r(t)+7:r(t)-15;break;case le.StackHorizontalBarChart:case le.NormalizedStackLineChart:case le.StackLineChart:case le.NormalizedStackAreaChart:case le.StackAreaChart:case le.StackColumnChart:s=t<0?r(t)+5:r(t)-15;break;case le.TornadoChart:s=r(t)+r.bandwidth()/2;break;default:s=t<0?r(h)+5:r(t)-15}return s;case 2:return l.includes(n)?r(t):t===0?n==="stack"?"":r(0)-15:r(h+(t-h)/2);case 3:return l.includes(n)?t===-1||t<0?r(t)-10:r(t)+10:n.includes("stack")?t===-1&&h===0?r(0)+10:t===1&&h!==0?r(h)-10:h<0?r(h)+10:h===0&&t<0?r(0)+10:h===0&&t>0?r(0)-10:r(h)-10:t<0?r(0)+10:r(0)-10}}catch(l){throw l}},ea=(t,e,r,o,h,n)=>{try{const l=n?.DataTableData??[];let s=[],x=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){t.dataTableProperties.dataTableAxisLabel?x=Ai(h[0],void 0,t):x=0;const L=[...o,...l];t.xAxisLabel.xAxisLabelVisibility=!1;const u=!t.dataTableProperties.disableLegendIcon?35:0;let S=e+r-u;L.forEach((b,_)=>{if(b?.properties?.showInDataTable??!0){let g={data:b.data.filter(H=>h.includes(H.dimension)),properties:{legend:b.properties.alias,color:b.properties.color,markerColor:b.properties.markerColor,markerShape:b.properties.markerShape,lineStyle:b.properties.lineStyle,height:Ai(b.properties.alias.includes("~$~")?b.properties.alias.split("~$~")[1]:b.properties.alias,S,t)}};x+=g.properties.height,s.push(g)}})}else x=0,s=[];return s.length==0&&(x=0,s=[],t.dataTableProperties.dataTable=!1),{dataTable:s,dataTableHeight:x}}catch{}},Ai=(t,e,r)=>{try{let o=20,h=wt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily)[0];return o=wt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily,void 0,h>e&&!r.dataTableProperties.legendsWrapText?e:void 0)[1],o}catch(o){throw o}};function ta(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J,U){try{let V=function(f,a,m,P){a===0&&f.append("foreignObject").attr("x",-J.left).attr("y",he).attr("class","blankClass").attr("width",J.left).attr("height",y).append("xhtml:div").style("width",J.left).style("height",`${y}px`).style("border-width",O?`0px 0px ${N.dataTableAxisLabel?w:0}px 0px`:"0px 0px 0px 0px").style("border-style",O?`solid ${p} ${p} solid`:"solid solid solid solid").style("border-color",O?`black ${q} ${q} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const Q=f.append("foreignObject").attr("x",-J.left).attr("y",he+ue).attr("width",J.left).attr("height",P).append("xhtml:div").style("display","flex").style("justify-content","center").style("align-items","center").attr("class","parentClass").style("flex-wrap","wrap").style("flex-direction","row").style("pointer-events","auto").style("width",oe).style("height",`${P}px`).style("padding-left",N.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>ka(S,a,void 0,X,se,"width")).style("border-style",()=>ka(S,a,void 0,X,se,"style")).style("border-color",()=>ka(S,a,void 0,X,se,"color"));if(!N.disableLegendIcon)switch(u){case le.ColumnChart:case le.StackColumnChart:case le.NormalizedStackColumnChart:Q.append("xhtml:div").style("height","10px").style("width","15px").style("background",m.properties.color).style("border-radius","1px");break;case le.LineChart:case le.StackLineChart:case le.NormalizedStackLineChart:Bi(m,Q,S);break;case le.AreaChart:case le.StackAreaChart:case le.NormalizedStackAreaChart:Wi(m,Q,S);break}const Ae=m.properties.legend,ge=S?.legends?.legendColorMode=="1"?m?.properties?.color:S?.legends?.legendSelectedUnicolor,we=Q.append("xhtml:div").style("max-width",oe).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(d).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",ge??"black").style("width",N.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",Ae).text(Ae);N.legendsWrapText&&we.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const N=S.dataTableProperties,$=N.dataTableFontStyle,X=g.length,se=o.length,re=D[0]?D[0]:0,oe=typeof l.step=="function"?l.step():h,he=U-A,Le=2;let pe=20,ue=0;const O=S.dataTableOuterBorder.borderButtonVisibility,q=S.dataTableOuterBorder.lineColor,w=S.dataTableOuterBorder.lineWidth,p=S.dataTableOuterBorder.lineStyle,C=f=>f===0?oe+Le+re/2:f===X-1?oe+Le-re/2:oe,c=f=>_e(u.includes("100stack")?f.TooltipMeasure/f.TotalMeasure:f.TooltipMeasure||f.value,N.dataTableDisplayUnits,N.dataTableNumberFormat,N.dataTableDecimalPrecision),d=f=>f.style("font-size",N.dataTableFontSize+"px").style("font-family",N.dataTableFontFamily).style("font-style",$.includes("Italic")?"Italic":"").style("text-decoration",$.includes("Underline")?"Underline":"").style("font-weight",$.includes("Bold")?"Bold":"");T.selectAll("#dataTableG"+K).remove();const i=r.append("g").attr("id","dataTableG"+K);let y=0;N.dataTableAxisLabel&&(y=Ai(g[0],void 0,S),pe=y),o.forEach((f,a)=>{ue+=!N.dataTableAxisLabel&&a===0?0:pe,pe=f.properties.height,N.dataTableLegends&&V(i,a,f,pe);const m=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+K+" .foreignObject").data(()=>f.data).enter().filter(P=>l(P.dimension)).append("g").attr("fill",De.transparent).attr("transform",(P,ie)=>`translate(${ie===0?0:l(P.dimension)-oe/2},0)`);a===0&&N.dataTableAxisLabel&&m.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",he).attr("id",(P,ie)=>ie).attr("width",(P,ie)=>C(ie)).attr("height",`${y}px`).append("xhtml:div").style("width",(P,ie)=>C(ie)).style("height",`${y}px`).style("border-width",(P,ie)=>ka(S,ie,void 0,X,se,"width","colHeaders")).style("border-style",(P,ie)=>ka(S,ie,void 0,X,se,"style","colHeaders")).style("border-color",(P,ie)=>ka(S,ie,void 0,X,se,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(d).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",P=>j.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)).text(P=>j.get(Array.isArray(P.dimension)?P.dimension[0]:P.dimension)),m.append("foreignObject").attr("x",0).attr("y",he+ue).attr("width",(P,ie)=>C(ie)).attr("height",pe).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(P,ie)=>C(ie)).style("height",`${pe}px`).style("line-height",`${pe}px`).style("border-width",(P,ie)=>ka(S,a,ie,X,se,"width")).style("border-style",(P,ie)=>ka(S,a,ie,X,se,"style")).style("border-color",(P,ie)=>ka(S,a,ie,X,se,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(d).style("color",N.dataTableLabelColor).attr("title",P=>c(P)).text(P=>c(P))})}catch(V){throw V}}function ka(t,e,r,o,h,n,l){try{const s=t.dataTableOuterBorder,x=t.dataTableInnerBorder,L=s.borderButtonVisibility,A=x.horizontalBorderLineButton,u=x.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,b={w:s.lineWidth,s:s.lineStyle,c:s.lineColor},_={w:x.horizontalBorderLineWidth,s:x.horizontalBorderLineStyle,c:x.horizontalBorderLineColor},g={w:x.verticalBorderLineWidth,s:x.verticalBorderLineStyle,c:x.verticalBorderLineColor},H={w:"0",s:"solid",c:"black"},D=L?b:H,j=A?_:H,K=u?g:H,J=o-1,U=h-1;let V=H,N=H,$=H,X=H;switch(l?(V=D,$=j,X=e===0?D:H,N=e===J?D:K):r===void 0?(X=D,N=H,V=e===0&&!S?D:H,$=e===U?D:j):(V=e===0&&!S?D:H,$=e===U?D:j,X=r===0?K:H,N=r===J?D:K),n){case"width":return`${V.w}px ${N.w}px ${$.w}px ${X.w}px`;case"style":return`${V.s} ${N.s} ${$.s} ${X.s}`;case"color":return`${V.c} ${N.c} ${$.c} ${X.c}`}}catch(s){throw s}}function pt(t,e,r){let o=[];for(let h=0;h<t.length;h++){const n=t[h];let l={},s=0,x=0,L=0;for(let A=0;A<e.length;A++){let u=e[A].data.find(S=>S.dimension===t[h])?.value||0;l[e[A].properties.legend]=u,s=s+(r?Math.abs(u):u),x+=u>0?u:0,L+=u}l.total=s,l.dimension=n,l.absoluteTotal=x,l.displayTotal=L,o.push(l)}return o}function aa(t,e,r,o,h,n,l,s){try{let x=r.seriesLabel.seriesLabelApplySeries,L=r.seriesLabel.seriesLabelPosition,A=[],u=o[0].legend,S=wt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily);return o.forEach(b=>{let _=!1;if(x=="1"?_=!0:_=b.properties.seriesLabelVisibility,_){let g={},H=L=="Right"?b.data[b.data.length-1]:b.data[0],D=s?H.value>0?H[1]:H[0]:H.value;b.properties.axis==at.primary||!h?g.yPosition=e(D):n&&h&&(g.yPosition=h(D)),(g.yPosition<0||g.yPosition>l)&&(_=!1),g.yPosition=g.yPosition-S[1]/2,g.isVisible=_,g.seriesValue=b.properties.alias,g.height=S[1],g.width=S[0];let j=!1;A.length>0&&A.some(K=>{j||(j=Sl(K,g))}),_&&!j&&A.push(g)}else return}),u="",A.forEach(b=>{b.seriesValue.length>u.length&&(u=b.seriesValue)}),S=wt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,A.forEach(b=>{b.height=S[1],b.width=S[0],b.xPosition=L=="Right"?t+(n?10:0)-S[0]:5}),{labelArray:A,heightWidth:S}}catch(x){throw x}}function Va(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H,D,j,K,J){try{let U=x.annotation.annotationType??"1";if(x.annotation.annotationVisibility){let V=[U=="1"?"connector":""],N=[],$=new Map,X=n.annotation(),se=x.annotation.connectorType,re=x.annotation.annotationVisibility,oe=x?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",he=x.annotation.annotationFontStyle,Le=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None";const pe=x.annotation.connectorType?.toLowerCase()==="curve";let ue=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates));ue=gi(ue,x,L);let O=[],q=[];switch(ue.length!=0&&ue.forEach(c=>{c.dx=c.dx*u/c.width,c.dy=c.dy*A/c.height,c.width=u,c.height=A}),re){case"2":t.forEach(c=>N.push(c[0]));break;case"3":t.forEach(c=>N.push(c[c.length-1]));break;case"4":t.forEach(c=>N.push(c[0])),t.forEach(c=>N.push(c[c.length-1]));break;case"1":for(let c=0;c<t[0].length;c++)t.forEach(d=>N.push(d[c]));break;case"5":break;case"6":t.forEach(c=>{switch(c[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)N.push(c[i]);break;case"2":break;case"3":N.push(c[0]);break;case"4":N.push(c[t[0].length-1]);break;case"5":N.push(c[0]),N.push(c[t[0].length-1]);break}});break}let w=0;N.forEach((c,d)=>{w<c.Measure&&(w=c.Measure)});let p=w*.1;x.annotation.annotationHideZeroValues&&(N=N.filter(c=>(c[1]<0&&c[0]<0?c[0]-c[1]:c[1]===0&&c[0]<0?c[1]+c[0]:c[1]-c[0])!==0)),N.forEach((c,d)=>{let i={note:{label:c[1]-c[0]>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(c[1]-c[0]/1e9)+"B":_e(c[1]<0&&c[0]<0?c[0]-c[1]:c[1]===0&&c[0]<0?c[1]+c[0]:c[1]-c[0],x.annotation.annotationDisplayUnits||x.plotArea.plotAreaDisplayUnits,x.annotation.annotationNumberFormat,x.annotation.annotationDecimalPrecision),align:J?c.data.labelPosition==2?"middle":"start":"middle"},data:J?{y:c.data.dimension,x:c[1]>0?c[1]:c[0],prevValue:c[0]>=0?c[0]:c[1],position:x.annotation.annotationPosition=="4"?c.data.labelPosition:JSON.parse(x.annotation.annotationPosition),currentLegend:c.key.includes("~$~")?c.key.split("~$~")[1]:c.key,isVisible:!0,hoverId:c.properties.alias?Wa(c.properties.alias):Wa(c.key),legendUniqueId:c.properties.legendUniqueId+"~$~"+c.data.dimension+"~$~"+(c.key.includes("~$~")?c.key.split("~$~")[1]:c.key)+"~$~"+(c[1]>0?c[1]:c[0])}:{x:c.data.dimension,y:c[1]>0?c[1]:c[0],prevValue:c[0]>=0?c[0]:c[1],position:x.annotation.annotationPosition=="4"?c.data.labelPosition:JSON.parse(x.annotation.annotationPosition),currentLegend:c.key.includes("~$~")?c.key.split("~$~")[1]:c.key,isVisible:!0,hoverId:c.properties?.alias?Wa(c.properties.alias):Wa(c.key),legendUniqueId:c.properties.legendUniqueId+"~$~"+c.data.dimension+"~$~"+(c.key.includes("~$~")?c.key.split("~$~")[1]:c.key)+"~$~"+(c[1]>0?c[1]:c[0])},dx:0,dy:0,connector:{end:Le,curve:si[x.annotation.connectorCurve],points:pe?$a(0,0):[[0,0],[0,0]]},disable:V,subject:{height:15,width:15},color:c.properties&&c.properties[oe]?c.properties[oe]:c.data.labelColor,type:ci(n,parseFloat(U)),height:A,width:u};b.includes(c.data.dimension)&&Il(_,S,J,c,r)&&O.push(i)}),O=Rt(O,x,c=>J?c.data.x-c.data.prevValue:c.data.y-c.data.prevValue),ue.length===0?(ue=O,$=new Map(ue.map(c=>[c.data.legendUniqueId,{measure:J?c.data.x:c.data.y,dimension:J?c.data.y:c.data.x,legendUniqueId:c.data.legendUniqueId,dx:c.dx,dy:c.dy,connectorPoints:c.connector?.points||[],isVisible:c.data.isVisible??!0,width:c.width,height:c.height}]))):$=new Map(ue.map(c=>[c.legendUniqueId,c])),O.forEach(c=>{const d=c.data.legendUniqueId;if(ue.length!=0){const i=$.get(d);i&&(c.dx=i.dx,c.dy=i.dy,c.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(pe?3:2)?c.connector.points=i.connectorPoints:c.connector.points=pe?$a(c.dx,c.dy):[[0,0],[0,0]])}q.push(c)}),X.editMode(x.annotation.annotationDraggable&&K).accessors({x:function(c){return J?Ii(x,c.x,parseFloat(c.position),r,p,c.prevValue,L):e(c.x)+e.bandwidth()/2},y:function(c){return J?e(c.y)+e.bandwidth()/2:Xa(c.y,parseFloat(c.position),r,p,c.prevValue,L)}}).on("dragend",function(c){if(c.data.isVisible||(c.data.isVisible=!0,ue.forEach(d=>{d.data.x==c.data.x&&d.data.y==c.data.y&&(C.selectAll(".annotation-note-label").filter(i=>i.data.x==c.data.x&&i.data.y==c.data.y).attr("display","block"),d.data.isVisible=!0)})),q.forEach(d=>{(d.data?.legendUniqueId==c.data.legendUniqueId||d.legendUniqueId==c.data.legendUniqueId)&&(d.dx=c._dx*u/d.width,d.dy=c._dy*A/d.height,d.connectorPoints=c.connector?.points?.map(i=>[...i])||[])}),D){const d=q.map(i=>({legendUniqueId:i.data?.legendUniqueId||i.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connectorPoints||[],isVisible:(i.data?.isVisible||i.isVisible)??!0,width:i.width,height:i.height}));D(d)}C.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]),C.selectAll(`.connector-${Le}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),C.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[x.annotation.connectorStyle.toLowerCase()]).filter(d=>d._dx==0&&d._dy==0).remove(),C.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block")}).on("noteclick",function(c){x.annotation.annotationDraggable&&K&&(c.data.isVisible=!1,ue.forEach(d=>{d.data.x==c.data.x&&d.data.y==c.data.y&&(C.selectAll(".annotation-note-label").filter(i=>i.data.x==c.data.x&&i.data.y==c.data.y).attr("display","none"),d.data.isVisible=!1)}),C.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"))}).accessorsInverse({x:c=>e.invert(c.x),y:c=>r.invert(c.y)}).notePadding(0).annotations(q),H.selectAll(".annotation-group").remove();let C=Li(H,x,h,he,X,Le,J);if(x.animation?.animationEnabled){const c=x.animation.animationDuration,d=Xe[x.animation.animationEffect],i=X.accessors();if(L===le.StackLineChart||L===le.NormalizedStackLineChart){const f=e.range?e.range():[0,1],a=Math.min(f[0],f[1]),m=Math.max(f[0],f[1])-a,P=(ie,Q=100)=>{for(let Ae=0;Ae<=Q;Ae++){const ge=Ae/Q;if((d??T.easeLinear)(ge)>=ie)return ge}return 1};C.selectAll(".annotation").attr("opacity",0).each(function(ie){const Q=i.x(ie.data)??a,Ae=m>0?Math.max(0,Math.min(1,(Q-a)/m)):0,ge=P(Ae)*c;T.select(this).transition().delay(ge).duration(0).attr("opacity",1)})}else C.selectAll(".annotation").attr("transform",function(f){if(J){const a=r?r(0):0,m=i.y(f.data);return`translate(${a}, ${m})`}else{const a=i.x(f.data),m=r?r(0):0;return`translate(${a}, ${m})`}}).transition().duration(c).ease(d).attr("transform",function(f){const a=i.x(f.data),m=i.y(f.data);return`translate(${a}, ${m})`})}}}catch(U){throw U}}function Il(t,e,r,o,h){const n=h(o[1]>0?o[1]:o[0]);return r?n>=0&&n<=e:n<=t&&n>=0}const Li=(t,e,r,o,h,n,l)=>{t.selectAll(".annotation-group").remove();let s=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(h);return s.selectAll("rect").style("visibility","hidden"),s.selectAll(".annotation-subject").remove(),s.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.annotation.connectorStyle.toLowerCase()]).style("visibility",x=>(l?parseFloat(x.data.x)==0:parseFloat(x.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(`.connector-${n}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",x=>(l?parseFloat(x.data.x)==0:parseFloat(x.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.annotation.connectorStyle.toLowerCase()]).filter(x=>x._dx==0&&x._dy==0).remove(),s.selectAll(".connector-end").filter(x=>x.connector.end=="dot"&&x._dx==0&&x._dy==0).remove(),s.selectAll(".annotation-note-label").filter(x=>x.data&&!x.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&s.selectAll(".annotation-note-content").attr("transform",function(){const L=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(L)return`translate(${l?0:parseFloat(L[1])}, 0)`}),s.selectAll("text").style("text-anchor",x=>l&&x.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==De.white?e.annotation.annotationColor:"none"),s.selectAll("tspan").attr("hoverId",x=>x.data.hoverId?x.data.hoverId:x.data.currentLegend.replaceAll(" ","-")).style("visibility",x=>parseFloat(x.data.y)==0&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s},Ya=(t,e,r,o,h,n)=>{try{let l=t.yAxisLabel.yAxisLabelFontStyle,s="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${o})`).attr("height",r+10).attr("width",h).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==De.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const x=e.append("g").call(n).attr("transform",`translate(0,${o})`);x.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),x.selectAll("text").style("text-anchor",s=="rotate(0)"?"middle":"end").attr("dx",s=="rotate(0)"?".2em":"-.1em").attr("dy",s=="rotate(0)"?"1em":".15em").attr("transform",s).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==De.white?t.yAxisLabel.yAxisLabelColor:"none").style("font-size",t.yAxisLabel.yAxisLabelFontSize).style("font-family",t.yAxisLabel.yAxisLabelFontFamily).style("font-style",t.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),x.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.yAxisLabel.yAxisColor).attr("stroke-width",t.yAxisLabel.yAxisWidth?t.yAxisLabel.yAxisWidth:t.plotArea.plotAreaBorderThickness)}catch(l){throw l}};function El(t,e,r,o,h,n,l,s){return t?`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
25
- translate(${-(o(h*.01)+n)} ,${-s/2})`:`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
26
- translate(${r.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-n},${-s/2}`:-l/2+" ,2"})`}const Ua=(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_,g,H)=>{try{const D=A===le.TornadoChart;let j=t.xAxisLabel.xAxisLabelFontStyle,K=parseInt(t.xAxisLabel.xAxisPosition),J=Lt(L,o),U=u?gt(t.xAxisLabel.xAxisNumberFormat,J.map(ue=>ue)).map(ue=>ue):J;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let V;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?V=t.xAxisLabel.maxXAxisLabelWidth:V=r;let N=g.step();const $=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,X=Math.floor(N/$),se=t.xAxisLabel.xAxisLabelRotation==0;let re=e.append("rect").attr("id","yAxisRect").attr("transform",A===le.TornadoChart?`translate(${-V-1},0)`:`translate(${K===0?-V-5:K===1?h:s(0)+(-V-5)},0)`).attr("height",o).attr("width",A===le.TornadoChart?V:V+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==De.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const oe=e.append("g").attr("id","yAxisG").attr("transform",D?`translate(${s(0)},0)`:`translate(${K===0?0:K===1?h:s(0)},0)`).call(n);let pe=oe.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",V).attr("height",N+"px").attr("transform",El(D,K,t,s,x,V,r,N)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",se?"center":"start").style("align-items",se?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("text-align",t.xAxisLabel.xAxisLabelRotation==0?"center":"start").style("user-select","none").style("margin",0);if((t.xAxisLabel.labelTextWrap&&!t.xAxisLabel.multiLineLabelWrap||!t.xAxisLabel.labelTextWrap)&&pe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&pe.style("-webkit-line-clamp",X.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),pe.style("padding",0).style("font-family",t.xAxisLabel.xAxisLabelFontFamily).style("font-style",t.xAxisLabel.xAxisLabelFontStyle).style("color",t.xAxisLabel.xAxisLabelColor).style("font-size",t.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",j.includes("Italic")?"Italic":"").style("text-decoration",j.includes("Underline")?"Underline":"").style("font-weight",j.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(ue,O)=>U[O]).html((ue,O)=>U[O]),A===le.TornadoChart){if(l){const ue=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);ue.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),ue.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),ue.selectAll("text").style("visibility","hidden")}oe.selectAll("text").style("visibility","hidden")}else oe.selectAll("text").style("visibility","hidden");oe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),oe.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(D){throw D}},Ii=(t,e,r,o,h,n,l,s,x)=>{try{n=n??0;const L=_e(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,l===le.TornadoChart),A=String(L).length,u=o(e),S=o(n),b=o(0),_=l??"",g=_.includes("stack"),H=_==="100%stackBar";switch(r){case 1:return H?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||s&&x==="positive"?u-A*5:u+5;case 2:return e===0?g?"":b+15:o(n+(e-n)/2);case 3:return g?n<0?S-A*5:n===0&&e<0?b-A*5:n===0&&e>0?b+10:S+10:e<0?b-A*5:b+10;default:return u}}catch(L){throw L}},Rl=(t,e,r,o,h)=>{try{let n=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-r})`).attr("height",r).attr("width",h).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==De.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const l=e.append("g").call(o).attr("transform","translate(0,0)");l.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),l.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==De.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),l.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(n){throw n}},mi=(t,e)=>e*(1+t),Ei=(t,e)=>e/(1+t);function zl(t,e,r){const o=t>0?t:0,h=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,n=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,l=Array.isArray(r?.dimensionList)?r.dimensionList.length:0;let s=0,x=0,L=!1;if(l>0&&o>0){const A=o/l,u=Ei(n,A);if(u>=h||e.plotArea.fitChart)x=u,s=l,L=!1;else{const S=mi(n,h),b=Math.floor(o/S);b<=1?(s=1,x=Ei(n,o),L=l>1):(s=b,x=h,L=s<l)}}else s=0,x=0,L=!1;return{visibleBars:s,columnWidth:x,scrollbarVisible:L}}const Ba=(t,e,r)=>Math.max(e,Math.min(r,t)),Bt=(t,e,r,o,h,n,l,s,x,L,A,u,S=!1)=>{const b=(_,g,H,D,j)=>{try{if(j&&(_=L+_),!x||!Array.isArray(x.dimensionList)||!Array.isArray(t))return;_=_==null?0:Number(_),g=g==null?0:Number(g),H=H==null?0:Number(H),L=Ba(Math.round(_),0,Math.max(0,g)),s=typeof s=="number"?s:0;const K=L,J=K+s;let U=x.dimensionList.slice(K,J),V=JSON.parse(JSON.stringify(t||[]));V.forEach((he,Le)=>{const pe=Array.isArray(he?.data)?he.data:[];V[Le].data=pe.filter(ue=>U.includes(ue?.dimension))});const N=h?.left??0,$=h?.top??0,X=Number(n)||0,se=Number(innerHeight)||0,re=Number(H)||0,oe=g===0?1:g;if(S){const he=$+(se-re)*(g===0?0:L)/oe;D&&typeof D.attr=="function"&&D.attr("y",he)}else{const he=N+(X-re)*(g===0?0:L)/oe;D&&typeof D.attr=="function"&&D.attr("x",he)}u(U,V,s)}catch(K){typeof be=="function"&&be("ColumnChart","updateFromScrollPosition",K)}};if(l){const _=e-h.top-h.bottom,g=Math.max(0,t[0].data.length-s),H=e-8;o.append("rect").attr("id","scrollbarTrack").attr("x",S?r-8:h.left).attr("y",S?h.top:H).attr("width",S?8:n).attr("height",S?_:8).attr("fill","#ccc");const D=(S?_:n)*s/x.dimensionList.length,j=o.append("rect").attr("x",S?r-8:h.left).attr("y",S?h.top:H).attr("width",S?8:D).attr("height",S?D:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");j.call(T.drag().on("drag",K=>{if(S){const U=(Ba(K.y,h.top,h.top+_-D)-h.top)/(_-D)*(g||1);b(U,g,D,j,!1),j.attr("y",h.top+(_-D)*(g===0?0:L)/(g===0?1:g))}else{const U=(Ba(K.x,h.left,h.left+n-D)-h.left)/(n-D)*(g||1);b(U,g,D,j,!1),j.attr("x",h.left+(n-D)*(g===0?0:L)/(g===0?1:g))}})),o.on("wheel",K=>{K.preventDefault();const U=(S?K.deltaY:K.deltaX)>0?1:-1;if(b(U,g,D,j,!0),S){const V=h.top+(_-D)*(g===0?0:L)/(g===0?1:g);j.attr("y",V)}else{const V=h.left+(n-D)*(g===0?0:L)/(g===0?1:g);j.attr("x",V)}})}else o.on("wheel",null);b(0,0,0,null,!0)};function qa(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{if(l.total.totalVisibility){const g=l.annotation.annotationVisibility!="5"?10:0;let H=l.total.annotationType??"1",D=[H=="1"?"connector":""],j=h.annotation(),K=l.total.connectorType,J=l.total.totalFontStyle,U=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let V=[],N=Array.from(t,([X,se])=>({Dimension:X,Measure:se}));l.total.totalHideZeroValues&&(N=N.filter(X=>X.Measure!==0)),N.forEach((X,se)=>{let re={note:{label:X.Measure>=1e9&&l.total.totalNumberFormat===".2s"?Math.round(X.Measure/1e9)+"B":_e(X.Measure,l.total.totalDisplayUnits||l.plotArea.plotAreaDisplayUnits,l.total.totalNumberFormat,l.total.totalDecimalPrecision)},data:{y:X.Measure,x:X.Dimension},dx:0,dy:0,connector:{end:U,curve:si[l.total.connectorCurve]},disable:D,subject:{height:15,width:15},color:l.total.totalColor,type:ci(h,parseFloat(H)),height:x,width:L};V.push(re)}),j.editMode(l.total.annotationDraggable&&u).accessors({x:function(X){if(!S)return e(X.x);if(X.y>=0){const re=_?.get(X.x)??X.y;return r(re)+25}const se=b?.get(X.x)??X.y;return r(se)-25},y:function(X){if(S){const re=parseFloat(l.total.totalFontSize)||12;return l.annotation.annotationVisibility!=="5"?e(X.x)-re-4:e(X.x)-re/2}if(X.y>=0){const re=_?.get(X.x)??X.y;return r(re)-g-15}const se=b?.get(X.x)??X.y;return r(se)+g+5}}).on("dragend",function(X){$.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]),$.selectAll(`.connector-${U}`).attr("fill",l.total.connectorColor||"#ccc").style("stroke",l.total.connectorColor||"#ccc"),$.selectAll(".note-line").attr("hoverId",se=>se.data.currentLegend).style("stroke",l.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[l.total.connectorStyle.toLowerCase()]).filter(se=>se._dx==0&&se._dy==0).remove()}).accessorsInverse({x:X=>e.invert(X.x),y:X=>r.invert(X.y)}).notePadding(0).annotations(V);let $=$l(A,l,o,J,j,U);l.animation?.animationEnabled&&$.selectAll(".annotation").each(function(X){const se=T.select(this),oe=se.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!oe)return;const he=parseFloat(oe[1]),Le=parseFloat(oe[2]);if(S){const pe=r(0);se.attr("transform",`translate(${pe},${Le})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${he},${Le})`)}else{const pe=r(0);se.attr("transform",`translate(${he},${pe})`).transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`translate(${he},${Le})`)}})}}catch(g){throw g}}const $l=(t,e,r,o,h,n)=>{t.selectAll(".total-annotation-group").remove();let l=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.includes("Bold")?"Bold":"").call(h);return l.selectAll("rect").style("visibility","hidden"),l.selectAll(".annotation-subject").remove(),l.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.total.connectorStyle.toLowerCase()]),l.selectAll(`.connector-${n}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),l.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Et[e.total.connectorStyle.toLowerCase()]).filter(s=>s._dx==0&&s._dy==0).remove(),l.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),e.total.annotationType=="1"&&l.selectAll(".annotation-note-content").attr("transform",function(){const x=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(x)return`translate(${parseFloat(x[1])}, 0)`}),l.selectAll("text").append("text").style("fill",e.total.totalColor!==De.white?e.total.totalColor:"none"),l};function Ka(t,e,r){e.clear(),r&&r.length>0&&r.forEach(o=>{e.set(o,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(o=>{o.data.forEach((h,n)=>{if(e.has(h.dimension)){let l=e.get(h.dimension)||0;l+=h.value||0,e.set(h.dimension,l)}})})}function ia(t,e,r,o=!1){const h=o&&t.xAxisLabel.xAxisPosition=="1"?-1:1,n=r>0?r:0,l=parseFloat(t.plotArea.ticksHeight)||100,s=(e-n)*l/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-s*h:0}function Pt(t,e,r=0){const o=parseFloat(t.plotArea.ticksWidth)||100,h=(e-r)*o/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-h:0}const Ri={color:"defaultColor",name:"",type:"Line",axis:at.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:qe,labelColor:De.black,hideZeroValues:!1,markerShape:"Circle",lineStyle:"Solid",annotationPosition:1,markerColor:"defaultColor",areaBorderColor:"defaultColor",lineWidth:1.5,markerSize:1,opacity:.5,annotation:1,disableAnnotation:!0,disableAnnotationPosition:!0,connector:1,disableConnector:!0,measureUniqueId:"measureUniId",legendUniqueId:"uniqueLegendId",disableMarkerShape:!0,disableMarkerSize:!0,disableMarkerColor:!0,disableLineWidth:!0,disableLineStyle:!0,borderStyle:"Solid",borderWidth:2,borderRadius:0,borderColor:"black",labelFontSize:11,labelFontStyle:[],labelFont:qe,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:qe,valueFontColor:"black",backgroundColor:De.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:De.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var Qe=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(Qe||{});const Yl="11px",Ul="1.6";function At(t,e,r){return(o,h)=>{!t.current||!e.current||e.current(r(o,h))}}function ht(t,e,r){return t?.(e,r)??void 0}const ct="CommonFunctions.ts";le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.PieChart,le.PieofPie,le.DonutChart,le.PyramidChart,le.OrganizationChart,le.VennChart,le.ProgressChart,le.Maps,le.WordCloud,le.SankeyChart,le.Speedometer,le.RadialBarChart;function Dt(t,e,r,o,h,n,l,s,x,L,A,u,S,b){try{let _=l.legends.legendPosition,g=l.legends.legendAlignmentTopBottom,H=l.legends.legendAlignment;if(l.legends.legendVisibility)switch(_){case Be.none:break;case Be.right:let D=l.plotArea.fitChart?t-o-10:t-o-20;oa(e,s,h-(n+15),o+5,n+5,D,_,H,u,l,x,!1,b);break;case Be.top:oa(e,s,7,o,h-10,30,_,g,u,l,x,!1,b);break;case Be.left:let j=l.plotArea.fitChart?t-o-10:t-o-20;const K=L?L+A.bottom:0;oa(e,s,7,o+5,n+5,j-K,_,H,u,l,x,!1,b);break;case Be.bottom:oa(e,s,7,t-35,h-10,30,_,g,u,l,x,!1,b);break}}catch(_){be(ct,"drawLegends",_)}}function Bl(t,e){try{let r=0,o=t[0];return t.forEach(h=>{if(h!==void 0){let n=h.includes("~$~")?h.split("~$~")[1]:h.includes("-")?h.slice(h.indexOf("-")+1):h,l=n.length;r<l&&(r=l,o=n)}}),wt(o,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(r){be(ct,"calculateMaxLegendWidth",r)}}function Ca(t,e,r,o,h,n,l,s,x,L,A,u,S,b,_){try{let g=s.plotArea.hideZeroValues;s.plotArea.plotAreaHideLineAndMarkers===void 0&&(s.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(K=>K.data.forEach(J=>{J.markerShape=[le.CombinationLine,le.CombinationArea].includes(r)&&!s.plotArea.plotAreaHideLineAndMarkers?"None":K.properties.markerShape?K.properties.markerShape:"Circle",J.currentMeasure=K.properties.currentMeasure,J.markerColor=K.properties.markerColor?K.properties.markerColor:"Blue",J.alias=K.properties.alias,J.markerSize=K.properties.markerShape!="None"&&K.properties.markerSize&&K.properties.markerShape!="None"?r==="Area"?s.plotArea.plotAreaHideLineAndMarkers?K.properties.markerSize:0:K.properties.markerSize:0}));let H=t.selectAll(".lineGroup").data(e,K=>K.legend);H.enter().append("g").attr("class","parentGroup").attr("hoverId",K=>(K.properties.alias||K.properties.name||"Legend").replace(/\s+/g,"-")).merge(H).each(function(K){let U=T.select(this).selectAll("path").data(K.data);const N=U.enter().append("path").attr("fill",$=>$.markerColor).merge(U).attr("d",$=>T.symbol().type(zi($.markerShape)).size($.markerSize*50)()).attr("visibility",$=>{const X=!o($.dimension)&&o($.dimension)!==0,se=s.marker.markerVisibility?Wl(e,$,r,g,n,u,S)?Vt.hidden:[le.NormalizedStackLineChart,le.CombinationLine,le.CombinationArea].includes(r)||[le.StackAreaChart,le.AreaChart,le.CombinationStackArea].includes(r)?s.plotArea.plotAreaHideLineAndMarkers?Vt.visible:Vt.hidden:Vt.visible:[le.CombinationLine,le.CombinationArea].includes(r)||["Area"].includes(r)&&s.plotArea.plotAreaHideLineAndMarkers?Vt.visible:Vt.hidden;return X?Vt.hidden:se}).attr("transform",$=>{let X=$.axis==at.primary?h:n;const se=o($.dimension),re=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?$[1]>0?X($[1]):X($[0]):X($.value);return`translate(${se},${re})`}).on("mousemove",function($,X){const se=X,re=X,oe=T.select(this.parentNode),he=Array.isArray(se.dimension)?se.dimension[0]:se.dimension,Le=String(x.formattedDimensionListMap.get(he)??""),pe=_?.(String(he??""),{...X,formattedDimensionValue:Le})??void 0;ot([{key:s.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(s.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():s.xAxisTitle.xAxisTitleText,value:x.formattedDimensionListMap.get(Array.isArray(se.dimension)?se.dimension[0]:se.dimension)},{key:s.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(s.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():X.properties?.currentMeasure?X.properties.currentMeasure:s.yAxisTitle.yAxisTitleText||se.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(r)?se[1]-se[0]:se.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:re.alias.includes("~$~")?re.alias.split("~$~")[1]:re.alias}],s,$,X,pe),oe.selectAll(".halo").remove(),oe.insert("circle",":first-child").attr("class","halo").attr("cx",o(se.dimension)).attr("cy",()=>{const ue=se.axis===at.primary?h:n;return[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?se[1]>0?ue(se[1]):ue(se[0]):ue(se.value)}).attr("fill",re.markerColor).attr("opacity",.5).attr("r",re.markerSize*10),T.select(this).transition().duration(100).attr("transform",()=>{const ue=se.axis===at.primary?h:n,O=o(se.dimension),q=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?se[1]>0?ue(se[1]):ue(se[0]):ue(se.value);return`translate(${O},${q}) scale(1.3)`})}).on("mouseout",function($,X){const se=X,re=T.select(this.parentNode);rt(),re.selectAll(".halo").remove(),T.select(this).transition().duration(100).attr("transform",()=>{const oe=se.axis===at.primary?h:n,he=o(se.dimension),Le=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(r)?se[1]>0?oe(se[1]):oe(se[0]):oe(se.value);return`translate(${he},${Le}) scale(1)`})});if(s.animation.animationEnabled){const $=s.animation.animationDuration,X=Xe[s.animation.animationEffect]??T.easeLinear;if([le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationArea,le.CombinationStackArea].includes(r)){const re=[le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationStackArea];N.each(function(oe){const he=oe.axis===at.primary?h:n,Le=o(oe.dimension),pe=re.includes(r)?oe[1]>0?he(oe[1]):he(oe[0]):he(oe.value),ue=h(0);T.select(this).attr("transform",`translate(${Le},${ue})`).transition().duration($).ease(X).attr("transform",`translate(${Le},${pe})`)})}else{const re=o.range(),oe=Math.min(re[0],re[1]),he=Math.max(re[0],re[1])-oe,Le=(pe,ue=100)=>{for(let O=0;O<=ue;O++){const q=O/ue;if(X(q)>=pe)return q}return 1};N.attr("opacity",0).each(function(pe){const ue=o(pe.dimension)??oe,O=he>0?Math.max(0,Math.min(1,(ue-oe)/he)):0,q=Le(O)*$;T.select(this).transition().delay(q).duration(0).attr("opacity",1)})}}})}catch(g){be(ct,"lineMarkers",g)}}function zi(t){return t=="Square"?T.symbolSquare:t=="Circle"?T.symbolCircle:t=="Cross"?T.symbolCross:t=="Triangle"?T.symbolTriangle:t=="Star"?T.symbolStar:t=="Diamond"?T.symbolDiamond:t=="Wye"?T.symbolWye:T.symbolCircle}const Wl=(t,e,r,o,h,n,l)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?o&&e.value==0||e.value>h.domain()[1]||e.value<h.domain()[0]:r.includes("Stack")?e.value>0?o&&e[1]==0||e[1]<n||e[1]>l:o&&e[0]==0||e[0]<n||e[0]>l:o&&e.value==0||e.value<n||e.value>l}catch(s){be(ct,"checkVisibleConditions",s)}};function di(t,e,r,o,h,n,l,s,x){try{let L=function(u){try{let S=T.pointer(u),b=1e99,_,g=null;for(let D=0;D<A.length;D++){let j=Math.abs(S[0]-n(A[D]));j<b&&(b=j,g=D)}let H=1e99;for(let D=0;D<h.length;D++){const j=x?h[D].data[g].value>0?h[D].data[g][1]:h[D].data[g][0]:h[D].data[g].value;let K=Math.abs(S[1]-l(j));K<H&&(H=K,_=D)}r.attr("transform",Hl(h[_],g,n,l,x)).append("circle").attr("r",h[_].properties.markerSize*2.5).attr("id","tooltip").attr("fill",h[_].properties.markerColor).text(ot([{key:t.xAxisTitle.xAxisTitleText,value:h[_].data[g].dimension},{key:h[_].properties.currentMeasure?h[_].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:_e(s===le.NormalizedStackAreaChart?_===0?h[_].data[g].value:h[_].data[g].value-h[_-1].data[g].value:h[_].data[g].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:h[_].data[g].legend.includes("~$~")?h[_].data[g].legend.split("~$~")[1]:h[_].data[g].legend}],t,void 0,h[_].properties))}catch(S){be(ct,"onHoverMarkerForAreaChartFamily.mousemove",S)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){r.style("display",null)}).on("mousemove",L).on("mouseout",function(){r.style("display","none"),rt()});let A=o}catch(L){be(ct,"onHoverMarkerForAreaChartFamily",L)}}const Hl=(t,e,r,o,h)=>{try{const n=h?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value;return`translate(${r(t.data[e].dimension)},${o(n)})`}catch(n){be(ct,"getCoordinates",n)}};function It(t,e,r,o,h){try{const n=document.createElement("div");Object.assign(n.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(n),n.style.transform="",n.style.width="",n.style.whiteSpace="nowrap",n.style.overflowWrap="",e!=null&&(n.style.fontSize=`${e}px`),r!=null&&(n.style.fontFamily=r),h!=null,n.textContent=t;const l=n.getBoundingClientRect(),s=l.width,x=l.height;if(o&&o!==0){n.style.transform=`rotate(${o}deg)`;const L=n.getBoundingClientRect();return n.remove(),{width:s,height:x,rotatedWidth:L.width,rotatedHeight:L.height}}return n.remove(),{width:s,height:x,rotatedWidth:0,rotatedHeight:0}}catch(n){be(ct,"preCalculateTextDimensions",n)}}function $i(t,e){try{if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const o=t[r],h=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!h||n===void 0){e[r]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const l=Yi(o),s=Yi(n);l&&s&&$i(o,n)}),e}catch(r){be(ct,"addUndefinedDefaults",r)}}function Yi(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){be(ct,"isPlainObject",e)}}function je(t,e,r){try{let o=1,h="",n=r,l;return function(s){try{let x=s??0;if(t==="Auto")return Gl(x);switch(t&&t!=="None"&&(t==="Thousands"&&(o=1e3,h="K"),t==="Millions"&&(o=1e6,h="M"),t==="Billions"&&(o=1e9,h="B"),x=x/o),e){case",.0%":return l=`.${n}%`,T.format(l)(x);case"":return l=`.${n}f`,T.format(l)(x)+h;case".2n":return l=`.${n==0?1:parseFloat(n)+1}n`,T.format(l)(x)+h;case".2$":return l=`,.${n}f`,"$"+T.format(l)(x)+h;case".2c":return l=`,.${n}f`,"C$"+T.format(l)(x)+h;case".2ē":return l=`,.${n}f`,"€"+T.format(l)(x)+h;case".2ch":return l=`,.${n}f`,"CHF"+T.format(l)(x)+h;case".2£":return l=`,.${n}f`,"£"+T.format(l)(x)+h;case".2₹":return l=`,.${n}f`,"₹"+T.format(l)(x)+h;case",":return l=`,.${n}f`,T.format(l)(x)+h;default:return l=".2f",T.format(l)(x)+h}}catch(x){be(ct,"getNumberWithFormatFunction.inner",x)}}}catch(o){be(ct,"getNumberWithFormatFunction",o)}}function Gl(t){if(t==null)return"0";let e=Math.abs(t);return e>=1e9?(t/1e9).toFixed(2)+"B":e>=1e6?(t/1e6).toFixed(2)+"M":e>=1e3?(t/1e3).toFixed(2)+"K":t.toFixed(2)}function ot(t,e,r,o,h){try{const n=o?.color??o?.markerColor??"blue",l=o?.markerShape?.toLowerCase()??"circle",s=e.toolTip.toolTipTheme==="Light",x=s?"rgba(255, 255, 255)":"#272729ff",L=s?"black":De.white,A=s?"gray":"#d1d5db",u=(N,$=6)=>{if(!N)return"";const X=N.split(" ");let se="";for(let re=0;re<X.length;re+=$)se+=X.slice(re,re+$).join(" ")+"<br/>";return se};T.selectAll(".chartTooltip").style("visibility",Vt.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),b=T.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",L).style("background",x).style("border",S==="1"?"1px solid #d0d0d0":"1px solid #d4d4d4").style("border-radius",S==="1"?"0":"4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",S==="1"?"none":s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),_=r||window.event,g=_.pageX,H=_.pageY,D=t.reduce((N,$)=>{const X=(()=>{switch(l){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return N+=`
23
+ <%s key={someKey} {...props} />`,d,m,N,m),M[m+d]=!0)}if(m=null,o!==void 0&&(r(o),m=""+o),l(k)&&(r(k.key),m=""+k.key),"key"in k){o={};for(var re in k)re!=="key"&&(o[re]=k[re])}else o=k;return m&&s(o,typeof h=="function"?h.displayName||h.name||"Unknown":h),f(h,m,y,i,x(),o,T,a)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===b&&h._store&&(h._store.validated=1)}var S=Me,b=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),U=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),ne=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,ue=Array.isArray,ge=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(h){return h()}};var be,pe={},Q=S["react-stack-bottom-frame"].bind(S,n)(),G=ge(c(n)),M={};Ka.Fragment=A,Ka.jsx=function(h,k,o,d,i){var y=1e4>ne.recentlyCreatedOwnerStacks++;return L(h,k,o,!1,d,i,y?Error("react-stack-top-frame"):Q,y?ge(c(h)):G)},Ka.jsxs=function(h,k,o,d,i){var y=1e4>ne.recentlyCreatedOwnerStacks++;return L(h,k,o,!0,d,i,y?Error("react-stack-top-frame"):Q,y?ge(c(h)):G)}})()),Ka}var Ni;function Cl(){return Ni||(Ni=1,process.env.NODE_ENV==="production"?di.exports=vl():di.exports=kl()),di.exports}var Ge=Cl();function Ae(t,e,r){console.error(t,e,r)}var ct=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(ct||{}),$t=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))($t||{}),pt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(pt||{}),ya=(t=>(t.butt="butt",t.round="round",t.square="square",t))(ya||{}),Qe=(t=>(t.primary="Primary",t.secondary="Secondary",t))(Qe||{}),It=(t=>(t.visible="visible",t.hidden="hidden",t))(It||{});const fa="20,10,5,5,5,10",Ml={1:"",2:v.curveLinear,3:v.curveStep},Sl={1:xt.annotationLabel,2:xt.annotationLabel,3:xt.annotationCallout,4:xt.annotationCalloutElbow,5:xt.annotationCalloutCurve};var je=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(je||{}),Qa=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(Qa||{}),Aa=(t=>(t.percentage=",.0%",t.general="",t.scientific=".2n",t.currency_USD=".2$",t.currency_CAD=".2c",t.currency_EUR=".2ē",t.currency_CHF=".2ch",t.currency_UK=".2£",t.currency_INR=".2₹",t.commaSeparated=",",t))(Aa||{}),yi=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(yi||{}),Bt=(t=>(t.start="1",t.middle="2",t.end="3",t))(Bt||{}),Fa=(t=>(t.top="1",t.bottom="2",t))(Fa||{});const Ta={none:"1",discrete:"2",colorTheme:"3"},_t={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var Oa=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(Oa||{});const Fl={singleColor:"2",multiColor:"1"},oe={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Ia=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Ia||{}),Ea=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(Ea||{});const Wt={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var Re=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(Re||{});const tt="Calibri";var fi=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(fi||{}),va=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(va||{});const et={easeLinear:v.easeLinear,easeCubicIn:v.easeCubicIn,easeCubicOut:v.easeCubicOut,easeCubicInOut:v.easeCubicInOut,easeBounceOut:v.easeBounceOut,easeElasticOut:v.easeElasticOut,easeBackOut:v.easeBackOut},Pi={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:Re.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:Re.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:tt,chartTitleFontStyle:[],chartTitleColor:Re.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:Re.black,xAxisColorInverted:Re.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:tt,xAxisLabelFontStyle:[],xAxisLabelColor:Re.black,xAxisNumberFormat:"MMM-YY",xAxisQuarterFormat:"Long",xAxisDisplayUnits:"None",xAxisDisplayUnitsLabel:!1,xAxisLabelRotation:90,xAxisDateFormat:"DD-MM-YYYY",xAxisLabelDecimalPrecision:"2",xAxisLabelText:"",xAxisLabelDynamicText:"",xAxisLabelHTML:"",xAxisPosition:"0",xAxisBackgroundColor:"",xAxisIntervalsVisibility:!1,xAxisMinText:"",xAxisMaxText:"",xAxisIntervalText:"",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:tt,xAxisTitleFontStyle:[],xAxisTitleColor:Re.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:Re.transparent,yAxisColorInverted:Re.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:tt,yAxisLabelFontStyle:[],yAxisLabelColor:Re.black,yAxisNumberFormat:",",yAxisDisplayUnits:"Auto",yAxisLabelRotation:90,yAxisDisplayUnitsLabel:!1,yAxisDateFormat:"DD-MM-YYYY",yAxisLabelDecimalPrecision:"0",yAxisLabelText:"",yAxisLabelDynamicText:"",yAxisLabelHTML:"",yAxisPosition:"0",yAxisBackgroundColor:"",yAxisIntervalsVisibility:!1,yAxisMinText:"",yAxisMaxText:"",yAxisIntervalText:"",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:tt,yAxisTitleFontStyle:[],yAxisTitleColor:Re.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:Re.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:tt,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:Re.black,secondaryYAxisNumberFormat:",",secondaryYAxisDisplayUnits:"None",secondaryYAxisDisplayUnitsLabel:!1,secondaryYAxisSyncWithPrimaryLabel:!1,secondaryYAxisDateFormat:"DD-MM-YYYY",secondaryYAxisLabelDecimalPrecision:"2",secondaryYAxisBackgroundColor:"#e5e5e5",secondaryYAxisIntervalsVisibility:!1,secondaryYAxisMinText:"",secondaryYAxisMaxText:"",secondaryYAxisIntervalText:""},secondaryYAxisTitle:{secondaryYAxisTitleVisibility:!0,secondaryYAxisTitleFontSize:"11",secondaryYAxisTitleFontFamily:tt,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:Re.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:tt,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:tt,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:tt,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:Re.black,vennLabelColor:Re.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:Re.black},plotArea:{plotAreaColor:Re.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:Re.black,plotAreaGapWidth:"50",plotAreaSeriesWidth:"50",plotAreaBarWidth:"50",gridLinesVisibility:!0,gridLinesHorizontal:!0,gridLinesVertical:!1,ticksHeight:"100",ticksWidth:"100",gridLinesColor:"#ccc",xCoordinate:"None",yCoordinate:"None",dataLabels:!0,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsforMaps:!1,dataLabelPosition:"1",dataLabelSize:"12",dataLabelValueColor:Re.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:Re.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:tt,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:Re.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:tt,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:Re.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:Re.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:Re.black,opacity:"0.5",plotAreaCalculatedHigh:"#00FF00",plotAreaCalculatedLow:"#FF0000",plotAreaDataLabel:"1",plotAreaDisplayUnits:"None",plotAreaHideLineAndMarkers:!0,dataLabelsOptions:"1",xscaleposition:"1",yscaleposition:"1",numberOfBubbles:!1,totalAlias:!1,totalAliasText:"",refLineBorderThickness:"1",refLineBorderColor:Re.black,flipPyramid:!1,opacityforProgressScale:"0.2",opacityforProgressGoal:"1",lineStyle:"Solid",lineWidth:"2",fitChart:!0,scaleFactor:"5",rotation:"0",intersectionLabelVisibility:!1,intersectionValueVisibility:!1,dataLabelsCoordinates:[],hideInsignificantValue:!1,sortBy:"default",chartDirection:"right",plotAreaRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},heatMap:{showHeatMap:!1,heatMapMinColor:"#FF0000",heatMapMaxColor:"#7cfc00"},marker:{markerVisibility:!0,markerSize:"1",markerShape:"Circle",lineWidth:"1.5",markerColor:Re.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:Re.black,annotationFontSize:"9",annotationFontFamily:tt,annotationFontStyle:[],annotationDecimalPrecision:"2",annotationDisplayUnits:"None",annotationBoxVisibility:[],annotationHideZeroValues:!0,annotationShowHiddenValues:!0,annotationSetLabelColor:"1",annotationRangeFilter:{enabled:!1,condition:"lt",minVal:0,maxVal:100}},total:{totalVisibility:!1,annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",dataLabelsCoordinates:[],totalNumberFormat:",",totalColor:Re.black,totalFontSize:"9",totalFontFamily:tt,totalFontStyle:[],totalConnectorType:"None",totalDecimalPrecision:"2",totalPosition:"1",totalAlignment:"1",totalHideZeroValues:!0,totalDisplayUnits:"None",editTotalTextToggle:!1,editTotalText:"Total",showTotalLabel:!0},toolTip:{toolTipVisibility:!0,toolTipTheme:"Light",toolTipNumberFormat:",",toolTipNumberFormatProgress:",.0%",toolTipDecimalPrecision:"2",toolTipLabelText:"",toolTipDisplayUnits:"None",toolTipLabelDynamicText:""},nodes:{nodesColor:"#d9d7d7",nodesSingleColor:!1,nodesFillOpacity:"1",spacing:"15",sankeyNodeWidth:"10",sankeyChartType:"Left",curviness:"0.5",nodesBorderVisibility:!0,nodesBorderThickness:"1",nodesBorderColor:Re.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:tt,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:Re.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:Re.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:Re.black,nodesDisplayUnits:"None",percentageVisibility:!1,nodesLabelOverflow:!0},links:{linksColor:"Source",linksFillOpacity:"0.5"},bins:{binsGapWidth:"0",binsFillOpacity:"0.5",binsCalculation:"Automatic",binsCalculationValue:"3",binsBorderVisibility:!1,binsBorderThickness:"1",binsBorderColor:Re.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:tt,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:Re.black,connectorFontColor:Re.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:Re.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:tt,footerNoteFontStyle:[],footerNoteFontColor:Re.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:Re.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:Re.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:tt,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:Re.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:tt,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:Re.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:tt,textSpacing:"5",textRotation:90},colorScale:{showColor:"1",startColor:"#c1d8f3",endColor:"#4c6ba5",division1:"#c1d8f3",division2:"#b3cbed",division3:"#a4bfe8",division4:"#96b2e2",division5:"#88a6dc",division6:"#7999d7",division7:"#6b8dd1",division8:"#5c80cb",division9:"#4e74c6",division10:"#4c6ba5"},customScaling:{warningTextDummyNode:!1,customScalingtoggle:!1,division1:"#b3b3b3",share1:"",division2:"#b3b3b3",share2:"",division3:"#b3b3b3",share3:"",division4:"#b3b3b3",share4:"",division5:"#b3b3b3",share5:"",division6:"#b3b3b3",share6:"",division7:"#b3b3b3",share7:"",division8:"#b3b3b3",share8:"",division9:"#b3b3b3",share9:"",division10:"#b3b3b3",share10:""},colorScaleForMaps:{defaultColor:"#808080",showColorForMaps:"1",startColorForMaps:"#c1d8f3",endColorForMaps:"#4c6ba5"},pointerValue:{showPointerValue:!1,pointerValueNumberFormat:",",pointerValueDecimalPrecision:"2",connectorKPIforSpeedometer:"1",kpiAlias:!1,kpiAliasText:"",pointerValueDisplayUnits:"None",pointerValueFontSize:"11",pointerValueFontFamily:tt,pointerValueFontStyle:[],pointerValueColor:Re.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:Re.black,bubbleBorderColor:Re.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:Re.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:Re.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:tt,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:Re.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:tt,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:Re.black,dataTableAxisLabel:!0,dataTableLegends:!0,disableLegendIcon:!0,legendsWrapText:!1},dataTableOuterBorder:{borderButtonVisibility:!0,lineStyle:"solid",lineColor:"#d9d9d9",lineWidth:"1"},dataTableInnerBorder:{verticalBorderLineButton:!0,verticalBorderLineStyle:"solid",verticalBorderLineColor:"#d9d9d9",verticalBorderLineWidth:"1",horizontalBorderLineButton:!0,horizontalBorderLineStyle:"solid",horizontalBorderLineColor:"#d9d9d9",horizontalBorderLineWidth:"1"},chartPadding:{paddingArrayLTRB:[0,0,0,0]},statisticalTest:{zTest:!1,runZTest:[],zTestInputData:[]},cjsOptions:{cjsTension:0,cjsBorderRadius:0},animation:{animationEnabled:!1,animationDuration:1500,animationEffect:"easeCubicOut"},swapAxis:{swapAxisEnabled:!1}},jt={top:0,right:0,bottom:0,left:0};var se=(t=>(t.WaterfallChart="WaterfallChart",t.StackLineChart="StackLineChart",t.NormalizedStackLineChart="NormalizedStackLineChart",t.LineChart="LineChart",t.ColumnChart="ColumnChart",t.StackColumnChart="StackColumnChart",t.AreaChart="AreaChart",t.PieChart="PieChart",t.SankeyChart="SankeyChart",t.DonutChart="DonutChart",t.HorizontalBarChart="HorizontalBarChart",t.StackAreaChart="StackAreaChart",t.NormalizedStackAreaChart="NormalizedStackAreaChart",t.Treemap="Treemap",t.StackHorizontalBarChart="StackHorizontalBarChart",t.NormalizedStackColumnChart="NormalizedStackColumnChart",t.NormalizedStackHorizontalBarChart="NormalizedStackHorizontalBarChart",t.ScatterChart="ScatterChart",t.CustomColumnChart="CustomColumnChart",t.customBarChart="CustomBarChart",t.ColumnHistogramChart="ColumnHistogramChart",t.HorizontalHistogramChart="HorizontalHistogramChart",t.Maps="Maps",t.TornadoChart="TornadoChart",t.PieofPie="PieofPie",t.WordCloud="WordCloud",t.BubbleChart="BubbleChart",t.VennChart="VennChart",t.Speedometer="Speedometer",t.LayeredColumnChart="LayeredColumnChart",t.LayeredHorizontalBarChart="LayeredHorizontalBarChart",t.OrganizationChart="OrganizationChart",t.PyramidChart="PyramidChart",t.ProgressChart="ProgressChart",t.RadialBarChart="RadialBarChart",t.CombinationLine="CombinationLine",t.CombinationArea="CombinationArea",t.CombinationStackArea="CombinationStackArea",t.TornadoDefaultEntry="defaultEntry",t.DotPlot="DotPlot",t))(se||{});const ui={1:"",2:v.curveLinear,3:v.curveStep},wl=[se.ColumnChart,se.StackColumnChart,se.NormalizedStackColumnChart,se.LineChart,se.StackLineChart,se.NormalizedStackLineChart,se.AreaChart,se.StackAreaChart,se.NormalizedStackAreaChart],Ii=[se.PieChart,se.PieofPie,se.DonutChart,se.PyramidChart,se.OrganizationChart,se.VennChart,se.ProgressChart,se.Maps,se.WordCloud,se.SankeyChart,se.Speedometer,se.RadialBarChart];function Nt(t,e,r,c,x){var n=document.createElement("div");n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.fontSize=e==null?"":e+"px",n.style.fontFamily=r??"",n.style.margin="0",n.style.padding="1px",n.style.border="none",x?(n.style.width=x+"px",n.style.whiteSpace="normal",n.style.overflowWrap="break-word"):n.style.whiteSpace="nowrap",n.innerHTML=t,document.body.appendChild(n);var l=n.getBoundingClientRect(),s=l.width,p=l.height;return c!=null?(n.style.transform=`rotate(${c}deg)`,l=n.getBoundingClientRect(),n.remove(),[s,p,l.width,l.height]):(n.remove(),[l.width,l.height])}function Dl(t,e){let r=t.dataTableProperties&&t.dataTableProperties.dataTable,c=r?e*7<50?50:e*7>100?100:e*7:0;return r&&c<30&&(c=30),c}function Ti(t,e,r,c,x,n,l,s,p,f,L,u,S){let b=n.dataTableProperties&&n.dataTableProperties.dataTable&&n.xAxisLabel.xAxisPosition=="0"&&!S,_=!1;//!formatOptions.plotArea.fitChart;
24
+ let A=t<200?200:S?e:t,R=e<200?200:S?t:e,g=A*.15*.8,B=Jl(l,n),U=g<B[0]+10?g:B[0]+10,W=u?ft(n.xAxisLabel.xAxisNumberFormat,s).map(h=>h):s,P=W?W[0]+"":"",D=P.length;W&&W.forEach(h=>{h=h+"";let k=h.trim()?.length||0;k>D&&(D=k,P=h.trim())});let V=Nt(P,n.xAxisLabel.xAxisLabelFontSize,n.xAxisLabel.xAxisLabelFontFamily,n.xAxisLabel.xAxisLabelRotation),$=V[0]+5,Z=V[3]+10,ce;n.xAxisLabel.labelTextWrap?n.xAxisLabel.multiLineLabelWrap?ce=n.xAxisLabel.maxXAxisLabelWidth:ce=Z<R*.15?Z:R*.15:ce=Z;let ne=n.xAxisTitle.xAxisTitleVisibility?n.xAxisTitle.xAxisDynamicTitleText.length!==0?Nt(n.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:Nt(n.xAxisTitle.xAxisTitleText,"13",tt)[1]:b?5:0;ne=ne>R*.1?R*.1:ne;let ae=b?0:n.xAxisLabel.xAxisLabelVisibility?ce:0,ue=n.yAxisTitle.yAxisTitleVisibility?n.yAxisTitle.yAxisDynamicTitleText.length!==0?Nt(n.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:Nt(n.yAxisTitle.yAxisTitleText,"13",tt)[1]:0;ue=ue>A*.1?A*.1:ue;const ge=r*1.1,be=x*1.1;let pe=n.yAxisLabel.yAxisLabelVisibility?zi(ge,be,n,!1,L)+5:Dl(n,v.max(l,h=>h?.length||0)||0)+10,Q=n.secondaryYAxisLabel.secondaryYAxisLabelVisibility?zi(c,p,n,!0,L):0,G=n.secondaryYAxisTitle.secondaryYAxisTitleVisibility?n.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?Nt(n.secondaryYAxisTitle.secondaryYAxisTitleHTML,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:Nt(n.secondaryYAxisTitle.secondaryYAxisTitleText,n.secondaryYAxisTitle.secondaryYAxisTitleFontSize,n.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;G=G>A*.1?A*.1:G;let M=n.chartTitle.chartTitleVisibility?n.chartTitle.dynamicTitleText.length!==0?Nt(n.chartTitle.chartTitleHTML,void 0,void 0)[1]:Nt(n.chartTitle.chartTitleText,"16",tt)[1]:0;return M=M>R*.1?R*.1:M,{width:A,height:R,isChartScrollable:_,legendMargin:U,dimensionHeightWidthArray:V,actualDimesionWidth:$,maxDimensionWidth:Z,xTitle:ne,xLabel:ae,yTitle:ue,yLabel:pe,secondaryYLabel:Q,secondaryAxisTitleWidth:G,chartTitleHeight:M}}function Vl(t,e,r,c,x,n,l,s,p,f,L,u,S,b){try{const _=b??Ti(t,e,r,c,x,n,l,s,p,f,L,u,S),A=S?_.xTitle+_.xLabel:_.yTitle+_.yLabel,R=n.legends.legendPosition,g=n.legends.legendVisibility,B=n.xAxisLabel.xAxisPosition=="1"&&S;let U=0,W=0;const P=f&&!S?_.secondaryYLabel+_.secondaryAxisTitleWidth:0;switch(R){case je.none:case je.none:W=15+P,U=A+5;break;case je.top:W=B?A+5:15+P,U=B?5+P+_.xTitle:A+5;break;case je.right:W=B?A+5+_.legendMargin:_.legendMargin+P+20,U=B?5+P+_.xTitle+_.legendMargin:A+5;break;case je.bottom:W=B?A+5:15+P,U=B?5+P+_.xTitle:A+5;break;case je.left:U=_.legendMargin+A+33,W=15+P;break;default:W=15+P,U=A+5}const D=n.chartPadding?.paddingArrayLTRB;return D&&(U+=D[0],W+=D[2]),n.dataTableProperties&&n.dataTableProperties.dataTable&&L&&!S&&(U=U+35),{left:U,right:W,yLabel:_.yLabel,yTitle:_.yTitle,xLabel:_.xLabel,xTitle:_.xTitle,dimensionHeightWidthArray:_.dimensionHeightWidthArray,chartTitleHeight:_.chartTitleHeight,legendMargin:_.legendMargin,secondaryYLabel:_.secondaryYLabel,secondaryAxisTitleWidth:_.secondaryAxisTitleWidth}}catch(_){throw _}}function Nl(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_){try{const A=b??Ti(t,e,r,c,x,n,l,s,p,f,L,u,S),g=n.legends.legendVisibility?n.legends.legendPosition:je.none,B=_&&!S?12:0,U=S?A.yTitle+A.yLabel:A.xTitle+A.xLabel;let W=0,P=0;switch(g){case je.none:W=A.chartTitleHeight+5,P=U+5+B;break;case je.top:W=35+A.chartTitleHeight,P=U+B;break;case je.right:W=A.chartTitleHeight+5,P=U+5+B;break;case je.bottom:P=30+U+B,W=A.chartTitleHeight+5;break;case je.left:W=A.chartTitleHeight+5,P=U+5+B;break;default:W=A.chartTitleHeight+5,P=U+5+B}n.xAxisLabel.xAxisPosition&&!S&&n.xAxisLabel.xAxisPosition=="1"&&(P=P-A.xLabel,W=W+A.xLabel),L&&!S&&(W=W+12);const D=f&&S?A.secondaryYLabel+A.secondaryAxisTitleWidth:0;D&&(W=W+D);const V=n.chartPadding?.paddingArrayLTRB;return V&&(W+=V[1],P+=V[3]),{top:W,bottom:P,chartTitleHeight:A.chartTitleHeight,xAxisRelatedMargin:U,xLabel:A.xLabel,xTitle:A.xTitle}}catch(A){throw A}}function Ct(t,e,r,c,x,n,l,s,p,f,L,u,S,b){try{const _=Ti(t,e,r,c,x,n,l,s,p,f,L,u,S),A=Vl(t,e,r,c,x,n,l,s,p,f,L,u,S,_),R=Nl(t,e,r,c,x,n,l,s,p,f,L,u,S,_,!0);let g,B=t-A.left-A.right,U=e-R.top-R.bottom,W,P=!1;({visibleBars:g,columnWidth:W,scrollbarVisible:P}=Hl(S?U:B,n,b));const D={top:R.top,bottom:R.bottom,left:A.left,right:A.right};if(S){const V=L?30:0;D.right=D.right+V}return n.connector.connectorVisibility!="2"&&b?.chartType==se.StackColumnChart&&(D.top=D.top+20),n.connector.connectorVisibility!="2"&&b?.chartType==se.StackHorizontalBarChart&&(D.right=D.top+20),{margin:D,yLabel:A.yLabel,xLabel:A.xLabel,yTitle:A.yTitle,xTitle:A.xTitle,dimensionHeightWidthArray:A.dimensionHeightWidthArray,chartTitleHeight:A.chartTitleHeight,legendMargin:A.legendMargin,secondaryYLabel:A.secondaryYLabel,secondaryAxisTitleWidth:A.secondaryAxisTitleWidth,visibleBars:g,columnWidth:W,scrollbarVisible:P}}catch(_){throw _}}function Mt(t,e,r,c){t.attr("viewBox","0 0 "+e+" "+r);const{chartAreaColor:x,chartAreaBorder:n}=c.chartArea;if(t.style("background-color",x),n){const l=c.chartArea.chartAreaBorderColor,s=c.chartArea.chartAreaBorderThickness,p=c.chartArea.chartAreaBorderStyle.toString(),f=p==="1"?"solid":p==="2"?"dashed":"dotted";t.style("outline",`${s}px ${f} ${l}`).style("outline-offset",`-${s}px`)}else t.style("outline","none").style("outline-offset",null)}const St=(t,e)=>{let r=v.select(t.current);r.selectAll("*").remove();let c=Ei(Pi,e),x=t.current.getBoundingClientRect(),n=x.width,l=x.height;return{formatOptions:c,svg:r,width:n,height:l}},ta=(t,e,r)=>{if(!t.dataTableProperties.dataTable)return{formatOptions:t};let c=!1;return e.forEach(x=>{x?.properties?.showInDataTable==!0&&(c=!0)}),r.forEach(x=>{x?.properties?.showInDataTable==!0&&(c=!0)}),c||(t.dataTableProperties.dataTable=!1),{formatOptions:t}};function Ei(t,e){if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const c=t[r],x=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!x||n===void 0){e[r]=Array.isArray(c)?[...c]:typeof c=="object"&&c!==null?{...c}:c;return}const l=Ri(c),s=Ri(n);l&&s&&Ei(c,n)}),e}function Ri(t){return Object.prototype.toString.call(t)==="[object Object]"}function Et(t,e,r,c,x){parseFloat(t.yAxisLabel.yAxisIntervalText);let n=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText),s=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText),p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText);if(parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText),t.yAxisLabel.yAxisIntervalsVisibility){t.xAxisLabel.xAxisPosition=="2"&&(t.xAxisLabel.xAxisPosition="0"),l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let U=t.yAxisLabel.yAxisMaxText;n=String(U).length>0?parseFloat(U):r,n&&(r=n),parseFloat(t.yAxisLabel.yAxisIntervalText)<r&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else n=void 0,l=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<x&&(p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),s=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):x,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(s=void 0,p=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){s=void 0,p=void 0;const U=n!==void 0&&!Number.isNaN(n)?n:r,W=Math.max(U,x);r=W,x=W,n!==void 0&&!Number.isNaN(n)&&(n=W)}let f=e?Ze(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,L=r?Ze(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=c?Ze(c,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=x?Ze(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=n?Ze(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,_=l?Ze(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=s?Ze(s,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,R=p?Ze(p,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,g=f<L||f===L?r:e;if(l){let U=_<L?r:l;g=g<U?U:g}if(n){let U=b>f?n:e;g=g<U?U:g}n&&l&&(g=b>_?n:l);let B=u<S?x:c;if(p){let U=R<S?x:p;B=B<U?U:B}if(s){let U=A>S?s:x;B=B<U?U:B}return s&&p&&(B=A>R?s:p),{maxNumberForPrimaryAxis:g,maxNumberForSecondaryAxis:B,customYaxisMaxValue:r,secondaryCustomYaxisMaxValue:x}}function Ze(t,e,r,c,x){try{let n,l="",s=c,p;if(e==="Auto")return Pl(t);switch(e!=Qa.none&&(e==Qa.thousands&&(n=1e3,l="K"),e==Qa.millions&&(n=1e6,l="M"),e==Qa.billions&&(n=1e9,l="B"),t=t/n),x&&t<0&&(t=-t),r){case Aa.percentage:return p=`.${s}%`,v.format(p)(t);case Aa.general:return p=`.${s}f`,v.format(p)(t)+l;case Aa.scientific:let f=Number(s);return p=`.${f==0?1:(f+1).toString()}n`,v.format(p)(t)+l;case Aa.currency_USD:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"$"+v.format(p)(t)+l;case Aa.currency_CAD:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"C$"+v.format(p)(t)+l;case Aa.currency_EUR:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"€"+v.format(p)(t)+l;case Aa.currency_CHF:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"CHF"+v.format(p)(t)+l;case Aa.currency_UK:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"£"+v.format(p)(t)+l;case Aa.currency_INR:if(p=`,.${s}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+l}return"₹"+v.format(p)(t)+l;case Aa.commaSeparated:return p=`,.${s}f`,v.format(p)(t)+l;default:return p=".2f",v.format(p)(t)+l}}catch(n){throw n}}function Pl(t){if(t==null||isNaN(t))return"-";const e=Math.abs(t);if(e>=1e9)return v.format(".2s")(t).replace("G","B");if(e>=1e6)return v.format(".2s")(t);if(e>=1e3)return v.format(".2s")(t);if(e>=1){const r=v.format(".2f")(t);return+r===Math.floor(t)?v.format(".0f")(t):r}else return e>=.01?v.format(".2f")(t):e>0?v.format(".2e")(t):"0"}function zi(t,e,r,c,x){try{{let n,l,s=c?r.secondaryYAxisLabel.secondaryYAxisDisplayUnits:r.yAxisLabel.yAxisDisplayUnits,p=c?r.secondaryYAxisLabel.secondaryYAxisNumberFormat:r.yAxisLabel.yAxisNumberFormat,f=c?r.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:r.yAxisLabel.yAxisLabelDecimalPrecision,L=c?r.secondaryYAxisLabel.secondaryYAxisLabelFontSize:r.yAxisLabel.yAxisLabelFontSize,u=c?r.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:r.yAxisLabel.yAxisLabelFontFamily;if(s!="None")return n=Ze(Math.floor(t)||Math.floor(e),s,p,f??"2").toString(),l=Nt(n,L,u)[0],l<30?30:l+5;try{return n=Ze(Math.floor(t)||Math.floor(e),s,p,f??"2").toString(),x&&(n="-100%"),l=Nt(n,L,u)[0],l<30?30:l+5}catch{}}}catch(n){throw n}}function Ft(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){throw r}}function vt(t,e,r,c,x,n,l){try{let s=l??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",s+"-clip").append("rect").attr("width",c).attr("height",r>0?x-r:x),t.append("rect").attr("width",c).attr("height",r>0?x-r:x).attr("stroke",e.plotArea.plotAreaBorder&&!Ii.includes(n)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==Re.white&&!Ii.includes(n)?e.plotArea.plotAreaColor:"none")}catch(s){throw s}}function Il(t,e){const r=t.yPosition,c=t.yPosition+t.height,x=e.yPosition,n=e.yPosition+e.height;return r<n&&c>x}function dt(t,e,r,c,x,n,l,s,p){try{let f=c.yAxisLabel.yAxisIntervalsVisibility,L=!1,u=f?parseFloat(c.yAxisLabel.yAxisIntervalText):void 0,S=[],b;if(x.chartType===se.TornadoChart){const A=Math.max(Math.abs(e),Math.abs(t)),R=l||A,g=n||e;if(u&&u>0){for(let B=g;B<=R+1e-6;B+=u)S.push(parseFloat(B.toFixed(6)));b=S.length}else{L=!0;const B=6,W=(R-g)/B;for(let P=0;P<=B;P++){const D=g+P*W;S.push(parseFloat(D.toFixed(6)))}b=s?p/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:L}}if(!l&&t>0){const R=(t-e)*.05;t=t+R}if(u&&u!==0&&u!==void 0){let A=n||n==0?n:e,R=l||l==0?l:t;A<0?b=Math.floor((R-A)/u):b=Math.floor(R/u);let g=18;(l||l==0)&&(t=l);let B=n||n==0?n:e<0?Math.round(e):0;if(S.push(B),b>100){let U="Tick count cannot exceed more than 100.";A<0?u=(R-B)/100:u=R/100}if(b=b<100?b:100,b>g)for(let U=0;U<parseInt(b)&&(B+=u,parseFloat(B.toFixed(5))<=t);U++)S.push(B);else for(let U=0;U<g&&(B+=u,B<=t);U++)S.push(B)}else{L=!0;let A=Nt((l||x.yMaxLeft).toString(),c.yAxisLabel.yAxisLabelFontSize,c.yAxisLabel.yAxisLabelFontFamily,0);S=$i(n||x.yMinLeft,t,s?p:r,s?A[1]:A[0]),b=s?p/80:r/80}return{yAxisLabelArray:S,customTickValue:b,autoLabelFlag:L}}catch(f){throw f}}function $i(t,e,r,c=80){const x=e-t;if(!isFinite(x)||Math.abs(x)<1e-12)return[Number(t.toFixed(12))];const n=x<10?10:Math.max(2,Math.floor(r/c)),l=x/n,s=Math.pow(10,Math.floor(Math.log10(l))),p=[1,1.5,2,2.5,5,10];let f=p.map(_=>_*s).find(_=>Math.ceil(x/_)<=n);f||(f=p.at(-1)*s);const L=Math.floor(t/f)*f,u=Math.ceil(e/f)*f,S=Math.round((u-L)/f),b=new Array(S+1);for(let _=0;_<=S;_++)b[_]=Number((L+_*f).toFixed(12));return b}function Jt(t,e,r,c,x,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-c},0)`).attr("height",r>0?n-r:n).attr("width",c).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Re.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(x);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Re.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(l){throw l}}function hi(t,e,r,c,x,n,l){let s=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${l},0)`).attr("height",r>0?n-r:n).attr("width",c).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Re.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const p=t.append("g").call(x).attr("transform",`translate(${l},0)`);p.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==Re.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").attr("visibility",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),p.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",e.secondaryYAxisLabel.secondaryYAxisWidth),p.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",e.plotArea.fitChart?"1":"0").append("text").attr("transform","rotate(90)").attr("text-anchor","start").attr("class","DisplayUnit").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor).style("font-size",parseFloat(e.secondaryYAxisLabel.secondaryYAxisLabelFontSize)*.8).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle).attr("visibility",e.secondaryYAxisLabel.secondaryYAxisDisplayUnitsLabel==!1?"hidden":"visible").text("("+e.secondaryYAxisLabel.secondaryYAxisDisplayUnits+")")}function bt(t,e){try{let r=[],c=e/30<t.length?Math.round(e/30):t.length;if(c>=t.length)return r=t,r;let x=Math.round(t.length/c);(t.length-1)%x!=0&&(t.length-1)%(x+1)==0&&(x=x+1),r.push(t[0]);let n;for(let l=1;l<t.length-1;l++){const s=l*x;if(s>t.length)break;r.push(t[s]),n=s}if(!r.includes(t[t.length-1])){let l=n>=Math.round(t.length-t.length*.02);r.push(t[t.length-1])}return r=r.filter(l=>l)}catch(r){throw r}}function Ot(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_){try{let A=e.chartType!==se.ColumnHistogramChart?bt(b,u):[],R=[],g=s[3]+10;e.chartType!=se.ColumnHistogramChart?R=L?ft(c.xAxisLabel.xAxisNumberFormat,A.map(Q=>Q)).map(Q=>Q):A:A.forEach(Q=>{R.push(e.formattedDimensionListMap.get(Q))});let B=!c.plotArea.fitChart&&(e.chartType==se.AreaChart||e.chartType==se.StackAreaChart||e.chartType==se.NormalizedStackAreaChart);t||(t=t);let U=c.xAxisLabel.xAxisLabelFontStyle,W="rotate("+-c.xAxisLabel.xAxisLabelRotation+")";c.dataTableProperties&&c.dataTableProperties.dataTable&&wl.includes(e.chartType)&&c.xAxisLabel.xAxisPosition!="1"&&(c.xAxisLabel.xAxisLabelVisibility=!1);let P=c.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const D=t.append("g").attr("id","x-axis");D.append("rect").attr("transform",`translate(1,${P==="0"?x>0?S-x:S:P==="1"?-r:n(0)})`).attr("height",r).attr("width",u).attr("fill",c.xAxisLabel.xAxisLabelVisibility&&c.xAxisLabel.xAxisBackgroundColor?c.xAxisLabel.xAxisBackgroundColor!==Re.white?c.xAxisLabel.xAxisBackgroundColor:"none":c.chartArea.chartAreaColor);const V=D.append("g").attr("transform",`translate(0,${P=="0"?x>0?S-x:S:P=="1"?0:n(0)})`).call(l);let $=P==="1"?"5":"0",Z;c.xAxisLabel.labelTextWrap?c.xAxisLabel.multiLineLabelWrap?Z=c.xAxisLabel.maxXAxisLabelWidth:Z=g<p*.15?g:p*.15:Z=c.xAxisLabel.xAxisLabelRotation==0?f:g;const ce=typeof _.step=="function"?_.step():f,ne=parseInt(c.xAxisLabel.xAxisLabelFontSize)*1.2,ae=Math.floor(ce/ne),ue=c.xAxisLabel.xAxisLabelRotation==0;let ge=V.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(Z)).style("height",ce+"px").attr("transform",(Q,G)=>`rotate(${P==="1"?-c.xAxisLabel.xAxisLabelRotation:c.xAxisLabel.xAxisLabelRotation!=0?180-c.xAxisLabel.xAxisLabelRotation:0}) translate (${c.xAxisLabel.xAxisLabelRotation!=0?$+`, -${G==0&&B?15:ce/2}`:-Z/2+" , "+(P==="1"?"-15":"8")})`);ue||ge.style("overflow","visible"),Yi()==="safari"&&ge.attr("width",c.xAxisLabel.labelTextWrap?g<p*.125?g:p*.125:r).attr("height","20px");let pe=ge.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ue?"center":"end").style("align-items",ue?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Yi()==="safari"||P==="1"?"":c.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(c.xAxisLabel.labelTextWrap&&!c.xAxisLabel.multiLineLabelWrap||!c.xAxisLabel.labelTextWrap)&&pe.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),c.xAxisLabel.labelTextWrap&&c.xAxisLabel.multiLineLabelWrap&&pe.style("-webkit-line-clamp",ae.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),pe.style("text-align",c.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",c.xAxisLabel.xAxisLabelFontFamily).style("color",c.xAxisLabel.xAxisLabelColor).style("font-size",c.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",U.includes("Italic")?"Italic":"").style("text-decoration",U.includes("Underline")?"Underline":"").style("font-weight",U.includes("Bold")?"Bold":"").style("visibility",c.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===se.ColumnHistogramChart?pe.attr("title",(Q,G)=>Ze(Q,c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisNumberFormat,c.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((Q,G)=>Ze(Q,c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisNumberFormat,c.xAxisLabel.xAxisLabelDecimalPrecision,!1)):pe.attr("title",(Q,G)=>(""+R[G]).trim()).html((Q,G)=>(""+R[G]).trim()),V.selectAll("text").style("visibility",(c.xAxisLabel.xAxisLabelVisibility,"hidden")),V.selectAll("line").style("stroke",c.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",c.xAxisLabel.xAxisLabelVisibility||c.plotArea.gridLinesVertical?"visible":"hidden"),V.select(".domain").style("stroke",c.xAxisLabel.xAxisColor).attr("stroke-width",c.xAxisLabel.xAxisWidth?c.xAxisLabel.xAxisWidth:c.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",c.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(A){throw A}}function Yi(){let t="";try{const e=window.navigator.userAgent.toLowerCase();switch(!0){case e.indexOf("edge")>-1:t="edge";break;case(e.indexOf("opr")>-1&&!!window.opr):t="opera";break;case(e.indexOf("chrome")>-1&&!!window.chrome):t="chrome";break;case e.indexOf("trident")>-1:t="ie";break;case e.indexOf("firefox")>-1:t="firefox";break;case(e.indexOf("safari")>-1||e.indexOf("applewebkit")>-1):t="safari";break;default:t="other";break}}catch(e){throw e}finally{return t}}const Ui={short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],long:["January","February","March","April","May","June","July","August","September","October","November","December"]},El=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const r=Math.floor(e-25569),c=new Date(r*86400*1e3);return Number.isNaN(c.getTime())?null:{day:c.getUTCDate(),month:c.getUTCMonth(),year:c.getUTCFullYear()}},Rl=t=>String(t%100).padStart(2,"0"),zl=(t,e,r,c)=>{const x=Ui.short[e],n=Ui.long[e],l=String(t).padStart(2,"0"),s=String(e+1).padStart(2,"0"),p=Rl(r),f=String(r);switch(c){case"Month":return n;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${f}`;case"Year":return f;case"Default":return`${l}-${x}-${f}`;case"DD-MM-YYYY":return`${l}-${s}-${f}`;case"MM-DD-YYYY":return`${s}-${l}-${f}`;case"DD-MM":return`${l}-${s}`;case"YYYY-MM-DD":return`${f}-${s}-${l}`;case"YYYY-MM":return`${f}-${s}`;case"YYYY":return f;case"MM-YYYY":return`${s}-${f}`;case"MMM-YY":return`${x}-${p}`;case"YY-MMM":return`${p}-${x}`;case"MMMM-YY":return`${n}-${p}`;case"MMMM-YYYY":return`${n}-${f}`;case"DD-MMM":return`${l}-${x}`;case"DD-MMM-YY":return`${l}-${x}-${p}`;case"DD-MMM-YYYY":return`${l}-${x}-${f}`;default:return`${l}-${x}-${f}`}},ft=(t,e)=>{try{return e.map(r=>{const c=El(r);if(!c)return r;const{day:x,month:n,year:l}=c;return zl(x,n,l,t)})}catch(r){throw r}};function Ga(t,e,r){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let c=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(r).enter().filter(n=>n.isVisible).append("g").attr("class","seriesLabels").attr("transform",n=>`translate(${n.xPosition}, ${n.yPosition})`).append("foreignObject").attr("width",n=>n.width).attr("height",n=>n.height).append("xhtml:div").style("display","flex").style("align-items","center").style("justify-content","center").style("width","100%").style("height","100%").append("xhtml:div").style("width","fit-content").style("height","100%").style("padding-left","5px").style("padding-right","5px").style("border-radius","4px").style("background-color",t.seriesLabel.seriesLabelBackgroundColor).style("font-size",t.seriesLabel.seriesLabelFontSize+"px").style("font-family",t.seriesLabel.seriesLabelFontFamily).style("font-style",c.includes("Italic")?"italic":"").style("text-decoration",c.includes("Underline")?"underline":"").style("font-weight",c.includes("Bold")?"bold":"").style("color","black").text(n=>n.seriesValue)}}function $l(t,e,r,c,x,n){const l=r.xAxisLabel.xAxisPosition!="1"?e.left-20-x:5;return t?`rotate(-90) translate(-${e.top+c},${l})`:`translate(${e.left},${e.top+c+(r?.xAxisLabel?.xAxisPosition=="1"?0:t?n:x)})`}function wt(t,e,r,c,x,n,l,s,p,f,L){try{let u=r.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",$l(e,c,t,L,x,p)).attr("class","xAxisTitle").attr("width",e?L:f).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):u.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){throw u}}function Dt(t,e,r,c,x,n,l,s,p,f,L){try{let u=r>0?t-r:t,S=x.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",c?n.left:`-${n.top+u}`).attr("y",c?n.top+u+s:n.left-l-s).attr("class","yAxisTitle").attr("transform",c?"":"rotate(-90)").attr("width",c?p:u).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?S.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):S.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),x}catch(u){throw u}}function Ht(t,e,r,c,x,n,l,s,p,f=!1){let L=t.append("foreignObject").attr("visibility",e&&c.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",f?`${r.left}`:`-${r.top+(x>0?n-x:n)}`).attr("y",f?`${r.top-s-p-2}`:`${r.left+l+s-2}`).attr("class","yAxisTitleSecondary").attr("transform",f?"rotate(0)":"rotate(-90)").attr("width",f?l:x>0?n-x:n).attr("height",p+"px");c.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?L.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",c.secondaryYAxisTitle.secondaryYAxisTitleText).html(c.secondaryYAxisTitle.secondaryYAxisTitleHTML?c.secondaryYAxisTitle.secondaryYAxisTitleHTML:c.secondaryYAxisTitle.secondaryYAxisTitleText):L.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",c.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",c.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",c.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",c.secondaryYAxisTitle.secondaryYAxisTitleText).html(c.secondaryYAxisTitle.secondaryYAxisTitleText)}function Vt(t,e,r,c){let x=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r-4).attr("height",c+"px");const n=p=>{const f=document.createElement("div");return f.innerHTML=p,f.textContent||f.innerText||""},s=!!e.chartTitle.chartTitleHTML?n(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?x.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):x.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow","hidden").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",e.chartTitle.chartTitleFontFamily).attr("title",e.chartTitle.chartTitleText).html(e.chartTitle.chartTitleText)}function mt(t){if(t.line.interpolationType=="1")return v.curveLinear;if(t.line.interpolationType=="2"&&t.line.smoothType=="1")return v.curveMonotoneX;if(t.line.interpolationType=="2"&&t.line.smoothType=="2")return v.curveCardinal.tension(parseFloat(t.line.cardinalTension));if(t.line.interpolationType=="3"&&t.line.stepPosition=="1")return v.curveStepBefore;if(t.line.interpolationType=="3"&&t.line.stepPosition=="2")return v.curveStep;if(t.line.interpolationType=="3"&&t.line.stepPosition=="3")return v.curveStepAfter}function Yl(t){const e=t.indexOf(" - ");return e==-1?fi.default:t.slice(e+3)}const ka=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function _a(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Yt(t,e,r){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:c,minVal:x,maxVal:n}=e.annotation.annotationRangeFilter;return t.filter(l=>{const s=r(l);switch(c){case"lt":return s<=n;case"gt":return s>=x;case"in":return s>=x&&s<=n;case"not-in":return s<x||s>n;default:return!0}})}function Ra(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W,P,D,V){try{const $=f===se.TornadoChart;let Z=new Map,ce=p.annotation.annotationType??"1",ne=p.annotation.annotationPosition.toString()!="4"?p.annotation.annotationPosition:null,ae=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const ue=p.annotation.connectorType?.toLowerCase()==="curve";if(p.annotation.annotationVisibility){let ge=[ce=="1"?"connector":""],be=[],pe=n.annotation(),Q=p.annotation.connectorType,G=p.annotation.annotationVisibility,M=p.annotation.annotationFontStyle,h=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates)),k=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";h=vi(h,p,f);let o=[],d=[];switch(h.length!=0&&h.forEach(a=>{a.dx=a.dx*u/a.width,a.dy=a.dy*L/a.height,a.width=u,a.height=L}),G){case"2":t.forEach(a=>{a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"3":t.forEach(a=>{a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"4":t.forEach(a=>{a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})}),t.forEach(a=>{a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(m=>{m.data[a]&&be.push({Dimension:m.data[a].dimension,Measure:m.data[a].value,Legend:m.data[a].legend,LabelPosition:ne||m.properties.annotationPosition,Labelcolor:m.properties[ae],hoverText:ka(m,V),Axis:m.properties.axis,LegendUniqueId:m.properties.legendUniqueId})});break;case"5":break;case"6":t.forEach(a=>{switch(a.properties.annotation.toString()){case"1":for(let N=0;N<t[0].data.length;N++)a.data[N]&&be.push({Dimension:a.data[N].dimension,Measure:a.data[N].value,Legend:a.data[N].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"2":break;case"3":a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"4":a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"5":a.data[0]&&be.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId}),a.data[a.data.length-1]&&be.push({Dimension:a.data[a.data.length-1].dimension,Measure:a.data[a.data.length-1].value,Legend:a.data[a.data.length-1].legend,LabelPosition:ne||a.properties.annotationPosition,Labelcolor:a.properties[ae],hoverText:ka(a,V),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;be.forEach((a,m)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;be.forEach((a,m)=>{let N={note:{label:a.Measure>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":Ze(f===se.TornadoChart?Math.abs(a.Measure):a.Measure,p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:D&&f!==se.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":f===se.TornadoChart?"end":"middle"},data:D?{y:$?Yl(a.Legend):a.Dimension,x:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure}:{x:a.Dimension,y:{measure:a.Measure,axis:a.Axis},position:parseInt(a.LabelPosition),currentLegend:a.Legend,isVisible:!0,hoverId:a.hoverText.replace(/\s+/g,"-"),legendUniqueId:a.LegendUniqueId+"~$~"+a.Dimension+"~$~"+a.Measure},dx:0,dy:0,connector:{end:k,curve:ui[p.annotation.connectorCurve],points:ue?_a(0,0):[[0,0],[0,0]]},disable:ge,subject:{height:15,width:15},color:a.Labelcolor,type:xi(n,parseFloat(ce)),height:L,width:u};if(D){let re=a.Axis===Qe.primary?r:c;(bt(b,_).includes(a.Dimension)||f===se.TornadoChart)&&!l.includes(a.Legend)&&re(a.Measure)<=S&&re(a.Measure)>=0&&o.push(N)}else bt(b,S).includes(a.Dimension)&&!l.includes(a.Legend)&&(a.Axis==Qe.primary?r(a.Measure)<=_&&r(a.Measure)>=0:c(a.Measure)<=_&&c(a.Measure)>=0)&&o.push(N)}),p.annotation.annotationHideZeroValues&&(o=o.filter(a=>D?a.data.x.measure!==0:a.data.y.measure!==0)),o=Yt(o,p,a=>D?a.data.x.measure:a.data.y.measure),h.length===0?(h=o,Z=new Map(h.map(a=>[a.data.legendUniqueId,{measure:D?a.data.x.measure:a.data.y.measure,dimension:D?a.data.y:a.data.x,legendUniqueId:a.data.legendUniqueId,dx:a.dx,dy:a.dy,connectorPoints:a.connector?.points||[],isVisible:a.data.isVisible??!0,width:a.width,height:a.height}]))):Z=new Map(h.map(a=>[a.legendUniqueId,a])),o.forEach(a=>{const m=a.data.legendUniqueId;if(h.length!=0){const N=Z.get(m);N&&(a.dx=N.dx,a.dy=N.dy,a.data.isVisible=N.isVisible??!0,N?.connectorPoints&&N.connectorPoints.length>=(ue?3:2)?a.connector.points=N.connectorPoints:a.connector.points=ue?_a(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),pe.editMode(p.annotation.annotationDraggable&&W).accessors({x:function(a){if(D){let m=a.x.axis===Qe.primary?r:c,N=a.x.axis;return Bi(p,a.x.measure?a.x.measure:0,a.position,m,y,void 0,f,P,N)}else if(f===se.ColumnChart){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=B(m);return N!=null?e(a.x)+N-(U-B.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==Qe.primary)return ei(a.y.measure,parseFloat(a.position),r,y,a.prevValue,f);if(D){const m=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=B&&f!==se.DotPlot?B(m):0;return $?B(a.y)+B.bandwidth()/2:B?e(a.y)+N-(U-B.bandwidth())/2-5:e(a.y)-5}else return ei(a.y.measure,parseFloat(a.position),c,y,a.prevValue,f)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,h.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(T.selectAll(".annotation-note-label").filter(N=>N.data.x==a.data.x&&N.data.y.measure==a.data.y.measure).attr("display","block"),m.data.isVisible=!0)})),d.forEach(m=>{(m.data?.legendUniqueId==a.data.legendUniqueId||m.legendUniqueId==a.data.legendUniqueId)&&(m.dx=a._dx*u/m.width,m.dy=a._dy*L/m.height,m.connectorPoints=a.connector?.points?.map(N=>[...N])||[])}),g){const m=d.map(N=>({legendUniqueId:N.data?.legendUniqueId||N.legendUniqueId,dx:N.dx,dy:N.dy,connectorPoints:N.connectorPoints||[],isVisible:(N.data?.isVisible||N.isVisible)??!0,width:N.width,height:N.height}));g(m)}T.selectAll(".connector").attr("hoverId",m=>m.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]),T.selectAll(`.connector-${k}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),T.selectAll(".note-line").attr("hoverId",m=>m.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]).filter(m=>m._dx==0&&m._dy==0).remove(),T.selectAll(".annotation-note-label").filter(m=>m.data&&m.data.isVisible).style("display","block")}).on("noteclick",function(a){p.annotation.annotationDraggable&&W&&(a.data.isVisible=!1,h.forEach(m=>{m.data.x==a.data.x&&m.data.y.measure==a.data.y.measure&&(T.selectAll(".annotation-note-label").filter(N=>N.data.x==a.data.x&&N.data.y.measure==a.data.y.measure).attr("display","none"),m.data.isVisible=!1)}),T.selectAll(".annotation-note-label").filter(m=>m.data&&!m.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>r.invert(a.y)}).notePadding(0).annotations(d),p.plotArea.fitChart&&R.selectAll(".annotation-group").remove();let T=Ci(R,p,x,M,pe,k,D);if(p.animation?.animationEnabled){const a=p.animation.animationDuration,m=et[p.animation.animationEffect],N=pe.accessors(),re=f===se.LineChart,K=f===se.DotPlot,me=(Le,ze=0)=>{const Se=N.x(Le.data),ie=N.y(Le.data);return`translate(${Se+ze}, ${ie})`};if(K)T.selectAll(".annotation").attr("opacity",0).attr("transform",Le=>me(Le,-15)).transition().duration(a).ease(m).attr("opacity",1).attr("transform",Le=>me(Le));else if(re){const Le=e.range?e.range():[0,1],ze=Math.min(Le[0],Le[1]),Se=Math.max(Le[0],Le[1])-ze,ie=(De,ye=100)=>{for(let fe=0;fe<=ye;fe++){const $e=fe/ye;if((m??v.easeLinear)($e)>=De)return $e}return 1};T.selectAll(".annotation").attr("opacity",0).each(function(De){const ye=N.x(De.data)??ze,fe=Se>0?Math.max(0,Math.min(1,(ye-ze)/Se)):0,$e=ie(fe)*a;v.select(this).transition().delay($e).duration(0).attr("opacity",1)})}else T.selectAll(".annotation").attr("transform",function(Le){if(D){const ze=r?r(0):0,Se=N.y(Le.data);return`translate(${ze}, ${Se})`}else{const ze=N.x(Le.data),Se=Le.data?.y?.axis===Qe.primary?r:c??r,ie=Se?Se(0):0;return`translate(${ze}, ${ie})`}}).transition().duration(a).ease(m).attr("transform",function(Le){const ze=N.x(Le.data),Se=N.y(Le.data);return`translate(${ze}, ${Se})`})}}}catch($){throw $}}function Ul(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W,P){try{let D=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let V=[D=="1"?"connector":""],$=[],Z=new Map,ce=n.annotation(),ne=u.annotation.connectorType,ae=u.annotation.annotationVisibility,ue=u.annotation.annotationFontStyle,ge=[],be=[],pe=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const Q=u.annotation.connectorType?.toLowerCase()==="curve";let G=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));G=vi(G,u,se.CustomColumnChart);let M=[],h=[];G.length!=0&&G.forEach(i=>{i.dx=i.dx*b/i.width,i.dy=i.dy*S/i.height,i.width=b,i.height=S});for(let i=0;i<t.length;i++)t.forEach(y=>{y.properties.type&&y.properties.type!=se.ColumnChart&&!be.includes(y.properties.type)&&be.push(y.properties.type)});switch(ae){case"2":t.forEach((i,y)=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(T=>$.push(T[0]));break;case se.StackAreaChart:s.forEach(T=>$.push(T[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case se.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"4":t.forEach((i,y)=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[0],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(T=>$.push(T[0]));break;case se.StackAreaChart:s.forEach(T=>$.push(T[0]));break}}),t.forEach(i=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:$.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case se.StackColumnChart:l.forEach(y=>$.push(y[y.length-1]));break;case se.StackAreaChart:s.forEach(y=>$.push(y[y.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case se.ColumnChart:case se.LineChart:case se.AreaChart:i.data.forEach(a=>$.push({...a,alias:i.properties?.alias}));break;case se.StackColumnChart:let y=l.findIndex(a=>a.key===i.properties.legend);y!==-1&&l[y].forEach(a=>$.push(a));break;case se.StackAreaChart:let T=s.findIndex(a=>a.key===i.properties.legend);T!==-1&&s[T].forEach(a=>$.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let T=i.properties.annotation.toString();switch(i.properties.type){case se.ColumnChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)$.push(i.data[N]);break;case"2":break;case"3":$.push(i.data[0]);break;case"4":$.push(i.data[i.data.length-1]);break;case"5":$.push(i.data[0]),$.push(i.data[i.data.length-1]);break}break;case se.AreaChart:case se.LineChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)$.push({dimension:i.data[N].dimension,value:i.data[N].value,legend:i.data[N].legend,labelPosition:i.data[N].labelPosition,labelColor:i.data[N].labelColor,axis:i.data[N].axis,type:i.properties.type,alias:i.properties?.alias});break;case"2":break;case"3":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias});break;case"4":$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break;case"5":$.push({dimension:i.data[0].dimension,value:i.data[0].value,legend:i.data[0].legend,labelPosition:i.data[0].labelPosition,labelColor:i.data[0].labelColor,axis:i.data[0].axis,type:i.properties.type,alias:i.properties?.alias}),$.push({dimension:i.data[i.data.length-1].dimension,value:i.data[i.data.length-1].value,legend:i.data[i.data.length-1].legend,labelPosition:i.data[i.data.length-1].labelPosition,labelColor:i.data[i.data.length-1].labelColor,axis:i.data[i.data.length-1].axis,type:i.properties.type,alias:i.properties?.alias});break}break;case se.StackColumnChart:const a=l.findIndex(N=>N.key===i.properties.legend);a!==-1&&l[a].forEach((N,re)=>{switch(String(l[a].individualAnnotationVisibility)){case"1":$.push(l[a][re]);break;case"2":break;case"3":let K=l[a][0];$.find(Se=>Se.key==K.key)||$.push(K);break;case"4":let me=l[a][l[0].length-1];$.find(Se=>Se.key==me.key)||$.push(me);break;case"5":let Le=l[a][0],ze=l[a][l[0].length-1];if(!$.find(Se=>Se.key==Le.key||Se.key==ze.key)){$.push(l[a][0]),$.push(l[a][l[0].length-1]);break}}});break;case se.StackAreaChart:const m=s.findIndex(N=>N.key===i.properties.legend);m!=-1&&s[m].forEach((N,re)=>{switch(String(s[m].individualAnnotationVisibility)){case"1":$.push(s[m][re]);break;case"2":break;case"3":let K=s[m][0];$.find(Se=>Se.key==K.key)||$.push(K);break;case"4":let me=s[m][s[0].length-1];$.find(Se=>Se.key==me.key)||$.push(me);break;case"5":let Le=s[m][0],ze=s[m][s[0].length-1];if(!$.find(Se=>Se.key==Le.key||Se.key==ze.key)){$.push(Le),$.push(ze);break}}});break}});break}let k=0;$.forEach((i,y)=>{k<i.value&&(k=i.value)});let o=k*.1;$.forEach((i,y)=>{let T={note:{label:i.value||i.value==0?i.value>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":Ze(i.value,u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&u.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":Ze(i[1]-i[0],u.annotation.annotationDisplayUnits||u.plotArea.plotAreaDisplayUnits,u.annotation.annotationNumberFormat,u.annotation.annotationDecimalPrecision),align:"middle"},data:{x:i.dimension&&i.legend?{dimension:i.dimension,legend:i.legend,type:i.type,axis:i.axis||i.data.axis}:{dimension:i.data.dimension,legend:i.key,type:i.data.type,stacklegend:i.data.legend,axis:i.data.axis},y:i.value||i.value==0?i.value:i.data.type!=se.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0],prevValue:i[0]>=0?i[0]:i[1],position:parseInt(i.labelPosition)?parseInt(i.labelPosition):parseInt(i.data.labelPosition),type:i.type,currentLegend:i.legend?.includes("~$~")?i.legend.split("~$~")[1]:i.key?.includes("~$~")?i.key.split("~$~")[1]:i.legend??i.key,isVisible:!0,hoverId:i?.alias?.replaceAll(" ","-"),legendUniqueId:i.legendUniqueId+"~$~"+(i.dimension??i.data.dimension)+"~$~"+(i.value||i.value==0?i.value:i.data.type!=se.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:pe,curve:ui[u.annotation.connectorCurve],points:Q?_a(0,0):[[0,0],[0,0]]},disable:V,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:xi(n,parseFloat(D)),height:S,width:b};i.legend&&i.dimension?!p.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==Qe.primary?r(i.value)<=R&&r(i.value)>=0:c(i.value)<=R&&c(i.value)>=0)&&M.push(T):!p.includes(i.key)&&(i.data.axis==Qe.primary?r(i[1])<=R&&r(i[1])>=0:c(i[1])<=R&&c(i[1])>=0)&&M.push(T)}),u.annotation.annotationHideZeroValues&&(M=M.filter(i=>i.data.y!==0)),M=Yt(M,u,i=>i.data.y),G.length===0?(G=M,Z=new Map(G.map(i=>[i.data.legendUniqueId,{measure:i.data.y,dimension:i.data.x.dimension,legendUniqueId:i.data.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connector?.points||[],isVisible:i.data.isVisible??!0,width:i.width,height:i.height}]))):Z=new Map(G.map(i=>[i.legendUniqueId,i])),M.forEach(i=>{const y=i.data.legendUniqueId;if(G.length!=0){const T=Z.get(y);T&&(i.dx=T.dx,i.dy=T.dy,i.data.isVisible=T.isVisible??!0,T?.connectorPoints&&T.connectorPoints.length>=(Q?3:2)?i.connector.points=T.connectorPoints:i.connector.points=Q?_a(i.dx,i.dy):[[0,0],[0,0]],u.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&h.push(i)}),ce.editMode(u.annotation.annotationDraggable&&P).accessors({x:function(i){const y=i.x.type||i.type;if(be.includes(y))switch(y){case se.StackColumnChart:return e(i.x.dimension)+W(i.x.stacklegend)-(L-W.bandwidth())/2;case se.StackAreaChart:case se.LineChart:case se.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const T=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+W(T)-(L-W.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==Qe.primary?ei(i.y,parseFloat(i.position),r,o,i.prevValue,y):ei(i.y,parseFloat(i.position),c,o,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,G.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(T=>T.data.x.dimension==i.data.x.dimension&&T.data.x.legend==i.data.x.legend&&T.data.x.type==i.data.x.type&&T.data.prevValue==i.data.prevValue).attr("display","block"),y.data.isVisible=!0)})),h.forEach(y=>{(y.data?.legendUniqueId==i.data.legendUniqueId||y.legendUniqueId==i.data.legendUniqueId)&&(y.dx=i._dx*b/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(T=>[...T])||[])}),U){const y=h.map(T=>({legendUniqueId:T.data?.legendUniqueId||T.legendUniqueId,dx:T.dx,dy:T.dy,connectorPoints:T.connector.points||T.connectorPoints||[],isVisible:(T.data?.isVisible||T.isVisible)??!0,width:T.width,height:T.height}));U(y)}d.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[u.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${pe}`).attr("fill",u.annotation.connectorColor||"#ccc").style("stroke",u.annotation.connectorColor||"#ccc"),d.selectAll(".note-line").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[u.annotation.connectorStyle.toLowerCase()]).filter(y=>y._dx==0&&y._dy==0).remove(),d.selectAll(".annotation-note-label").filter(y=>y.data&&y.data.isVisible).style("display","block")}).on("noteclick",function(i){u.annotation.annotationDraggable&&P&&(i.data.isVisible=!1,G.forEach(y=>{y.data.x.dimension==i.data.x.dimension&&y.data.x.legend==i.data.x.legend&&y.data.x.type==i.data.x.type&&y.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(T=>T.data.x.dimension==i.data.x.dimension&&T.data.x.legend==i.data.x.legend&&T.data.x.type==i.data.x.type&&T.data.prevValue==i.data.prevValue).attr("display","none"),y.data.isVisible=!1)}),d.selectAll(".annotation-note-label").filter(y=>y.data&&!y.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==Qe.primary?r.invert(i.y):c.invert(i.y)}).notePadding(0).annotations(h),u.plotArea.fitChart||B.selectAll(".annotation-group").remove();let d=Ci(B,u,x,ue,ce,pe,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=et[u.animation.animationEffect],T=ce.accessors();d.selectAll(".annotation").attr("transform",function(a){const m=T.x(a.data),N=a.data.type||a.type,K=(a.data?.x?.axis||a.data?.axis)===Qe.primary?r:c;let me;return N===se.StackColumnChart||N===se.StackAreaChart?me=K(a.data.prevValue??0):me=K(0),`translate(${m}, ${me})`}).transition().duration(i).ease(y).attr("transform",function(a){const m=T.x(a.data),N=T.y(a.data);return`translate(${m}, ${N})`})}}}catch(D){throw D}}const vi=(t,e,r)=>{try{let c=[se.PieChart,se.DonutChart].includes(r)?"plotArea":"annotation";return t=e[c].annotationDraggable&&!!1?t??[]:[],t}catch(c){throw c}},xi=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},ei=(t,e,r,c,x,n)=>{try{let l=[se.LineChart,se.StackLineChart,se.StackAreaChart,se.NormalizedStackAreaChart,se.NormalizedStackLineChart,se.StackAreaChart];switch(x||(x=0),e){case 1:let s;switch(n){case se.LineChart:case se.HorizontalBarChart:case se.ColumnChart:case se.AreaChart:case se.StackAreaChart:s=t<0?r(t)+7:r(t)-15;break;case se.StackHorizontalBarChart:case se.NormalizedStackLineChart:case se.StackLineChart:case se.NormalizedStackAreaChart:case se.StackAreaChart:case se.StackColumnChart:s=t<0?r(t)+5:r(t)-15;break;case se.TornadoChart:s=r(t)+r.bandwidth()/2;break;default:s=t<0?r(x)+5:r(t)-15}return s;case 2:return l.includes(n)?r(t):t===0?n==="stack"?"":r(0)-15:r(x+(t-x)/2);case 3:return l.includes(n)?t===-1||t<0?r(t)-10:r(t)+10:n.includes("stack")?t===-1&&x===0?r(0)+10:t===1&&x!==0?r(x)-10:x<0?r(x)+10:x===0&&t<0?r(0)+10:x===0&&t>0?r(0)-10:r(x)-10:t<0?r(0)+10:r(0)-10}}catch(l){throw l}},aa=(t,e,r,c,x,n)=>{try{const l=n?.DataTableData??[];let s=[],p=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){t.dataTableProperties.dataTableAxisLabel?p=ki(x[0],void 0,t):p=0;const f=[...c,...l];t.xAxisLabel.xAxisLabelVisibility=!1;const u=!t.dataTableProperties.disableLegendIcon?35:0;let S=e+r-u;f.forEach((b,_)=>{if(b?.properties?.showInDataTable??!0){let A={data:b.data.filter(R=>x.includes(R.dimension)),properties:{legend:b.properties.alias,color:b.properties.color,markerColor:b.properties.markerColor,markerShape:b.properties.markerShape,lineStyle:b.properties.lineStyle,height:ki(b.properties.alias.includes("~$~")?b.properties.alias.split("~$~")[1]:b.properties.alias,S,t)}};p+=A.properties.height,s.push(A)}})}else p=0,s=[];return s.length==0&&(p=0,s=[],t.dataTableProperties.dataTable=!1),{dataTable:s,dataTableHeight:p}}catch{}},ki=(t,e,r)=>{try{let c=20,x=Nt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily)[0];return c=Nt(t,r.dataTableProperties.dataTableFontSize,r.dataTableProperties.dataTableFontFamily,void 0,x>e&&!r.dataTableProperties.legendsWrapText?e:void 0)[1],c}catch(c){throw c}};function ia(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W,P){try{let D=function(T,a,m,N){a===0&&T.append("foreignObject").attr("x",-W.left).attr("y",ue).attr("class","blankClass").attr("width",W.left).attr("height",y).append("xhtml:div").style("width",W.left).style("height",`${y}px`).style("border-width",Q?`0px 0px ${V.dataTableAxisLabel?M:0}px 0px`:"0px 0px 0px 0px").style("border-style",Q?`solid ${h} ${h} solid`:"solid solid solid solid").style("border-color",Q?`black ${G} ${G} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const K=T.append("foreignObject").attr("x",-W.left).attr("y",ue+pe).attr("width",W.left).attr("height",N).append("xhtml:div").style("display","flex").style("justify-content","center").style("align-items","center").attr("class","parentClass").style("flex-wrap","wrap").style("flex-direction","row").style("pointer-events","auto").style("width",ae).style("height",`${N}px`).style("padding-left",V.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>wa(S,a,void 0,Z,ce,"width")).style("border-style",()=>wa(S,a,void 0,Z,ce,"style")).style("border-color",()=>wa(S,a,void 0,Z,ce,"color"));if(!V.disableLegendIcon)switch(u){case se.ColumnChart:case se.StackColumnChart:case se.NormalizedStackColumnChart:K.append("xhtml:div").style("height","10px").style("width","15px").style("background",m.properties.color).style("border-radius","1px");break;case se.LineChart:case se.StackLineChart:case se.NormalizedStackLineChart:Zi(m,K,S);break;case se.AreaChart:case se.StackAreaChart:case se.NormalizedStackAreaChart:Xi(m,K,S);break}const me=m.properties.legend,Le=S?.legends?.legendColorMode=="1"?m?.properties?.color:S?.legends?.legendSelectedUnicolor,ze=K.append("xhtml:div").style("max-width",ae).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(d).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",Le??"black").style("width",V.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",me).text(me);V.legendsWrapText&&ze.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const V=S.dataTableProperties,$=V.dataTableFontStyle,Z=A.length,ce=c.length,ne=g[0]?g[0]:0,ae=typeof l.step=="function"?l.step():x,ue=P-L,ge=2;let be=20,pe=0;const Q=S.dataTableOuterBorder.borderButtonVisibility,G=S.dataTableOuterBorder.lineColor,M=S.dataTableOuterBorder.lineWidth,h=S.dataTableOuterBorder.lineStyle,k=T=>T===0?ae+ge+ne/2:T===Z-1?ae+ge-ne/2:ae,o=T=>Ze(u.includes("100stack")?T.TooltipMeasure/T.TotalMeasure:T.TooltipMeasure||T.value,V.dataTableDisplayUnits,V.dataTableNumberFormat,V.dataTableDecimalPrecision),d=T=>T.style("font-size",V.dataTableFontSize+"px").style("font-family",V.dataTableFontFamily).style("font-style",$.includes("Italic")?"Italic":"").style("text-decoration",$.includes("Underline")?"Underline":"").style("font-weight",$.includes("Bold")?"Bold":"");v.selectAll("#dataTableG"+U).remove();const i=r.append("g").attr("id","dataTableG"+U);let y=0;V.dataTableAxisLabel&&(y=ki(A[0],void 0,S),be=y),c.forEach((T,a)=>{pe+=!V.dataTableAxisLabel&&a===0?0:be,be=T.properties.height,V.dataTableLegends&&D(i,a,T,be);const m=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+U+" .foreignObject").data(()=>T.data).enter().filter(N=>l(N.dimension)).append("g").attr("fill",Re.transparent).attr("transform",(N,re)=>`translate(${re===0?0:l(N.dimension)-ae/2},0)`);a===0&&V.dataTableAxisLabel&&m.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",ue).attr("id",(N,re)=>re).attr("width",(N,re)=>k(re)).attr("height",`${y}px`).append("xhtml:div").style("width",(N,re)=>k(re)).style("height",`${y}px`).style("border-width",(N,re)=>wa(S,re,void 0,Z,ce,"width","colHeaders")).style("border-style",(N,re)=>wa(S,re,void 0,Z,ce,"style","colHeaders")).style("border-color",(N,re)=>wa(S,re,void 0,Z,ce,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(d).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",N=>B.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)).text(N=>B.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)),m.append("foreignObject").attr("x",0).attr("y",ue+pe).attr("width",(N,re)=>k(re)).attr("height",be).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(N,re)=>k(re)).style("height",`${be}px`).style("line-height",`${be}px`).style("border-width",(N,re)=>wa(S,a,re,Z,ce,"width")).style("border-style",(N,re)=>wa(S,a,re,Z,ce,"style")).style("border-color",(N,re)=>wa(S,a,re,Z,ce,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(d).style("color",V.dataTableLabelColor).attr("title",N=>o(N)).text(N=>o(N))})}catch(D){throw D}}function wa(t,e,r,c,x,n,l){try{const s=t.dataTableOuterBorder,p=t.dataTableInnerBorder,f=s.borderButtonVisibility,L=p.horizontalBorderLineButton,u=p.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,b={w:s.lineWidth,s:s.lineStyle,c:s.lineColor},_={w:p.horizontalBorderLineWidth,s:p.horizontalBorderLineStyle,c:p.horizontalBorderLineColor},A={w:p.verticalBorderLineWidth,s:p.verticalBorderLineStyle,c:p.verticalBorderLineColor},R={w:"0",s:"solid",c:"black"},g=f?b:R,B=L?_:R,U=u?A:R,W=c-1,P=x-1;let D=R,V=R,$=R,Z=R;switch(l?(D=g,$=B,Z=e===0?g:R,V=e===W?g:U):r===void 0?(Z=g,V=R,D=e===0&&!S?g:R,$=e===P?g:B):(D=e===0&&!S?g:R,$=e===P?g:B,Z=r===0?U:R,V=r===W?g:U),n){case"width":return`${D.w}px ${V.w}px ${$.w}px ${Z.w}px`;case"style":return`${D.s} ${V.s} ${$.s} ${Z.s}`;case"color":return`${D.c} ${V.c} ${$.c} ${Z.c}`}}catch(s){throw s}}function At(t,e,r){let c=[];for(let x=0;x<t.length;x++){const n=t[x];let l={},s=0,p=0,f=0;for(let L=0;L<e.length;L++){let u=e[L].data.find(S=>S.dimension===t[x])?.value||0;l[e[L].properties.legend]=u,s=s+(r?Math.abs(u):u),p+=u>0?u:0,f+=u}l.total=s,l.dimension=n,l.absoluteTotal=p,l.displayTotal=f,c.push(l)}return c}function la(t,e,r,c,x,n,l,s){try{let p=r.seriesLabel.seriesLabelApplySeries,f=r.seriesLabel.seriesLabelPosition,L=[],u=c[0].legend,S=Nt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily);return c.forEach(b=>{let _=!1;if(p=="1"?_=!0:_=b.properties.seriesLabelVisibility,_){let A={},R=f=="Right"?b.data[b.data.length-1]:b.data[0],g=s?R.value>0?R[1]:R[0]:R.value;b.properties.axis==Qe.primary||!x?A.yPosition=e(g):n&&x&&(A.yPosition=x(g)),(A.yPosition<0||A.yPosition>l)&&(_=!1),A.yPosition=A.yPosition-S[1]/2,A.isVisible=_,A.seriesValue=b.properties.alias,A.height=S[1],A.width=S[0];let B=!1;L.length>0&&L.some(U=>{B||(B=Il(U,A))}),_&&!B&&L.push(A)}else return}),u="",L.forEach(b=>{b.seriesValue.length>u.length&&(u=b.seriesValue)}),S=Nt(u,r.seriesLabel.seriesLabelFontSize,r.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,L.forEach(b=>{b.height=S[1],b.width=S[0],b.xPosition=f=="Right"?t+(n?10:0)-S[0]:5}),{labelArray:L,heightWidth:S}}catch(p){throw p}}function za(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R,g,B,U,W){try{let P=p.annotation.annotationType??"1";if(p.annotation.annotationVisibility){let D=[P=="1"?"connector":""],V=[],$=new Map,Z=n.annotation(),ce=p.annotation.connectorType,ne=p.annotation.annotationVisibility,ae=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",ue=p.annotation.annotationFontStyle,ge=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";const be=p.annotation.connectorType?.toLowerCase()==="curve";let pe=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates));pe=vi(pe,p,f);let Q=[],G=[];switch(pe.length!=0&&pe.forEach(o=>{o.dx=o.dx*u/o.width,o.dy=o.dy*L/o.height,o.width=u,o.height=L}),ne){case"2":t.forEach(o=>V.push(o[0]));break;case"3":t.forEach(o=>V.push(o[o.length-1]));break;case"4":t.forEach(o=>V.push(o[0])),t.forEach(o=>V.push(o[o.length-1]));break;case"1":for(let o=0;o<t[0].length;o++)t.forEach(d=>V.push(d[o]));break;case"5":break;case"6":t.forEach(o=>{switch(o[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)V.push(o[i]);break;case"2":break;case"3":V.push(o[0]);break;case"4":V.push(o[t[0].length-1]);break;case"5":V.push(o[0]),V.push(o[t[0].length-1]);break}});break}let M=0;V.forEach((o,d)=>{M<o.Measure&&(M=o.Measure)});let h=M*.1;p.annotation.annotationHideZeroValues&&(V=V.filter(o=>(o[1]<0&&o[0]<0?o[0]-o[1]:o[1]===0&&o[0]<0?o[1]+o[0]:o[1]-o[0])!==0)),V.forEach((o,d)=>{let i={note:{label:o[1]-o[0]>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(o[1]-o[0]/1e9)+"B":Ze(o[1]<0&&o[0]<0?o[0]-o[1]:o[1]===0&&o[0]<0?o[1]+o[0]:o[1]-o[0],p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:W?o.data.labelPosition==2?"middle":"start":"middle"},data:W?{y:o.data.dimension,x:o[1]>0?o[1]:o[0],prevValue:o[0]>=0?o[0]:o[1],position:p.annotation.annotationPosition=="4"?o.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:o.key.includes("~$~")?o.key.split("~$~")[1]:o.key,isVisible:!0,hoverId:o.properties.alias?Ja(o.properties.alias):Ja(o.key),legendUniqueId:o.properties.legendUniqueId+"~$~"+o.data.dimension+"~$~"+(o.key.includes("~$~")?o.key.split("~$~")[1]:o.key)+"~$~"+(o[1]>0?o[1]:o[0])}:{x:o.data.dimension,y:o[1]>0?o[1]:o[0],prevValue:o[0]>=0?o[0]:o[1],position:p.annotation.annotationPosition=="4"?o.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:o.key.includes("~$~")?o.key.split("~$~")[1]:o.key,isVisible:!0,hoverId:o.properties?.alias?Ja(o.properties.alias):Ja(o.key),legendUniqueId:o.properties.legendUniqueId+"~$~"+o.data.dimension+"~$~"+(o.key.includes("~$~")?o.key.split("~$~")[1]:o.key)+"~$~"+(o[1]>0?o[1]:o[0])},dx:0,dy:0,connector:{end:ge,curve:ui[p.annotation.connectorCurve],points:be?_a(0,0):[[0,0],[0,0]]},disable:D,subject:{height:15,width:15},color:o.properties&&o.properties[ae]?o.properties[ae]:o.data.labelColor,type:xi(n,parseFloat(P)),height:L,width:u};b.includes(o.data.dimension)&&Bl(_,S,W,o,r)&&Q.push(i)}),Q=Yt(Q,p,o=>W?o.data.x-o.data.prevValue:o.data.y-o.data.prevValue),pe.length===0?(pe=Q,$=new Map(pe.map(o=>[o.data.legendUniqueId,{measure:W?o.data.x:o.data.y,dimension:W?o.data.y:o.data.x,legendUniqueId:o.data.legendUniqueId,dx:o.dx,dy:o.dy,connectorPoints:o.connector?.points||[],isVisible:o.data.isVisible??!0,width:o.width,height:o.height}]))):$=new Map(pe.map(o=>[o.legendUniqueId,o])),Q.forEach(o=>{const d=o.data.legendUniqueId;if(pe.length!=0){const i=$.get(d);i&&(o.dx=i.dx,o.dy=i.dy,o.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(be?3:2)?o.connector.points=i.connectorPoints:o.connector.points=be?_a(o.dx,o.dy):[[0,0],[0,0]])}G.push(o)}),Z.editMode(p.annotation.annotationDraggable&&U).accessors({x:function(o){return W?Bi(p,o.x,parseFloat(o.position),r,h,o.prevValue,f):e(o.x)+e.bandwidth()/2},y:function(o){return W?e(o.y)+e.bandwidth()/2:ei(o.y,parseFloat(o.position),r,h,o.prevValue,f)}}).on("dragend",function(o){if(o.data.isVisible||(o.data.isVisible=!0,pe.forEach(d=>{d.data.x==o.data.x&&d.data.y==o.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==o.data.x&&i.data.y==o.data.y).attr("display","block"),d.data.isVisible=!0)})),G.forEach(d=>{(d.data?.legendUniqueId==o.data.legendUniqueId||d.legendUniqueId==o.data.legendUniqueId)&&(d.dx=o._dx*u/d.width,d.dy=o._dy*L/d.height,d.connectorPoints=o.connector?.points?.map(i=>[...i])||[])}),g){const d=G.map(i=>({legendUniqueId:i.data?.legendUniqueId||i.legendUniqueId,dx:i.dx,dy:i.dy,connectorPoints:i.connectorPoints||[],isVisible:(i.data?.isVisible||i.isVisible)??!0,width:i.width,height:i.height}));g(d)}k.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]),k.selectAll(`.connector-${ge}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[p.annotation.connectorStyle.toLowerCase()]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block")}).on("noteclick",function(o){p.annotation.annotationDraggable&&U&&(o.data.isVisible=!1,pe.forEach(d=>{d.data.x==o.data.x&&d.data.y==o.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==o.data.x&&i.data.y==o.data.y).attr("display","none"),d.data.isVisible=!1)}),k.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"))}).accessorsInverse({x:o=>e.invert(o.x),y:o=>r.invert(o.y)}).notePadding(0).annotations(G),R.selectAll(".annotation-group").remove();let k=Ci(R,p,x,ue,Z,ge,W);if(p.animation?.animationEnabled){const o=p.animation.animationDuration,d=et[p.animation.animationEffect],i=Z.accessors();if(f===se.StackLineChart||f===se.NormalizedStackLineChart){const T=e.range?e.range():[0,1],a=Math.min(T[0],T[1]),m=Math.max(T[0],T[1])-a,N=(re,K=100)=>{for(let me=0;me<=K;me++){const Le=me/K;if((d??v.easeLinear)(Le)>=re)return Le}return 1};k.selectAll(".annotation").attr("opacity",0).each(function(re){const K=i.x(re.data)??a,me=m>0?Math.max(0,Math.min(1,(K-a)/m)):0,Le=N(me)*o;v.select(this).transition().delay(Le).duration(0).attr("opacity",1)})}else k.selectAll(".annotation").attr("transform",function(T){if(W){const a=r?r(0):0,m=i.y(T.data);return`translate(${a}, ${m})`}else{const a=i.x(T.data),m=r?r(0):0;return`translate(${a}, ${m})`}}).transition().duration(o).ease(d).attr("transform",function(T){const a=i.x(T.data),m=i.y(T.data);return`translate(${a}, ${m})`})}}}catch(P){throw P}}function Bl(t,e,r,c,x){const n=x(c[1]>0?c[1]:c[0]);return r?n>=0&&n<=e:n<=t&&n>=0}const Ci=(t,e,r,c,x,n,l)=>{t.selectAll(".annotation-group").remove();let s=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",c.includes("Italic")?"Italic":"").style("text-decoration",c.includes("Underline")?"Underline":"").style("font-weight",c.includes("Bold")?"Bold":"").call(x);return s.selectAll("rect").style("visibility","hidden"),s.selectAll(".annotation-subject").remove(),s.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.annotation.connectorStyle.toLowerCase()]).style("visibility",p=>(l?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(`.connector-${n}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",p=>(l?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.annotation.connectorStyle.toLowerCase()]).filter(p=>p._dx==0&&p._dy==0).remove(),s.selectAll(".connector-end").filter(p=>p.connector.end=="dot"&&p._dx==0&&p._dy==0).remove(),s.selectAll(".annotation-note-label").filter(p=>p.data&&!p.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&s.selectAll(".annotation-note-content").attr("transform",function(){const f=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(f)return`translate(${l?0:parseFloat(f[1])}, 0)`}),s.selectAll("text").style("text-anchor",p=>l&&p.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==Re.white?e.annotation.annotationColor:"none"),s.selectAll("tspan").attr("hoverId",p=>p.data.hoverId?p.data.hoverId:p.data.currentLegend.replaceAll(" ","-")).style("visibility",p=>parseFloat(p.data.y)==0&&e.annotation.annotationHideZeroValues?"hidden":"visible"),s},ra=(t,e,r,c,x,n)=>{try{let l=t.yAxisLabel.yAxisLabelFontStyle,s="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${c})`).attr("height",r+10).attr("width",x).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==Re.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const p=e.append("g").call(n).attr("transform",`translate(0,${c})`);p.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),p.selectAll("text").style("text-anchor",s=="rotate(0)"?"middle":"end").attr("dx",s=="rotate(0)"?".2em":"-.1em").attr("dy",s=="rotate(0)"?"1em":".15em").attr("transform",s).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==Re.white?t.yAxisLabel.yAxisLabelColor:"none").style("font-size",t.yAxisLabel.yAxisLabelFontSize).style("font-family",t.yAxisLabel.yAxisLabelFontFamily).style("font-style",t.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),p.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.yAxisLabel.yAxisColor).attr("stroke-width",t.yAxisLabel.yAxisWidth?t.yAxisLabel.yAxisWidth:t.plotArea.plotAreaBorderThickness)}catch(l){throw l}};function Wl(t,e,r,c,x,n,l,s){return t?`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
25
+ translate(${-(c(x*.01)+n)} ,${-s/2})`:`rotate(${90-r.xAxisLabel.xAxisLabelRotation})
26
+ translate(${r.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-n},${-s/2}`:-l/2+" ,2"})`}const na=(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A,R)=>{try{const g=L===se.TornadoChart;let B=t.xAxisLabel.xAxisLabelFontStyle,U=parseInt(t.xAxisLabel.xAxisPosition),W=bt(f,c),P=u?ft(t.xAxisLabel.xAxisNumberFormat,W.map(pe=>pe)).map(pe=>pe):W;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let D;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?D=t.xAxisLabel.maxXAxisLabelWidth:D=r;let V=A.step();const $=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,Z=Math.floor(V/$),ce=t.xAxisLabel.xAxisLabelRotation==0;let ne=e.append("rect").attr("id","yAxisRect").attr("transform",L===se.TornadoChart?`translate(${-D-1},0)`:`translate(${U===0?-D-5:U===1?x:s(0)+(-D-5)},0)`).attr("height",c).attr("width",L===se.TornadoChart?D:D+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==Re.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const ae=e.append("g").attr("id","yAxisG").attr("transform",g?`translate(${s(0)},0)`:`translate(${U===0?0:U===1?x:s(0)},0)`).call(n);let be=ae.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",D).attr("height",V+"px").attr("transform",Wl(g,U,t,s,p,D,r,V)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ce?"center":"start").style("align-items",ce?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("text-align",t.xAxisLabel.xAxisLabelRotation==0?"center":"start").style("user-select","none").style("margin",0);if((t.xAxisLabel.labelTextWrap&&!t.xAxisLabel.multiLineLabelWrap||!t.xAxisLabel.labelTextWrap)&&be.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&be.style("-webkit-line-clamp",Z.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),be.style("padding",0).style("font-family",t.xAxisLabel.xAxisLabelFontFamily).style("font-style",t.xAxisLabel.xAxisLabelFontStyle).style("color",t.xAxisLabel.xAxisLabelColor).style("font-size",t.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",B.includes("Italic")?"Italic":"").style("text-decoration",B.includes("Underline")?"Underline":"").style("font-weight",B.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(pe,Q)=>P[Q]).html((pe,Q)=>P[Q]),L===se.TornadoChart){if(l){const pe=e.append("g").attr("transform",`translate(${s(0)},0)`).call(l);pe.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),pe.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),pe.selectAll("text").style("visibility","hidden")}ae.selectAll("text").style("visibility","hidden")}else ae.selectAll("text").style("visibility","hidden");ae.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),ae.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(g){throw g}},Bi=(t,e,r,c,x,n,l,s,p)=>{try{n=n??0;const f=Ze(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,l===se.TornadoChart),L=String(f).length,u=c(e),S=c(n),b=c(0),_=l??"",A=_.includes("stack"),R=_==="100%stackBar";switch(r){case 1:return R?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||s&&p==="positive"?u-L*5:u+5;case 2:return e===0?A?"":b+15:c(n+(e-n)/2);case 3:return A?n<0?S-L*5:n===0&&e<0?b-L*5:n===0&&e>0?b+10:S+10:e<0?b-L*5:b+10;default:return u}}catch(f){throw f}},pi=(t,e,r,c,x)=>{try{let n=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-r})`).attr("height",r).attr("width",x).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Re.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const l=e.append("g").call(c).attr("transform","translate(0,0)");l.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),l.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==Re.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),l.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(n){throw n}},Mi=(t,e)=>e*(1+t),Wi=(t,e)=>e/(1+t);function Hl(t,e,r){const c=t>0?t:0,x=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,n=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,l=Array.isArray(r?.dimensionList)?r.dimensionList.length:0;let s=0,p=0,f=!1;if(l>0&&c>0){const L=c/l,u=Wi(n,L);if(u>=x||e.plotArea.fitChart)p=u,s=l,f=!1;else{const S=Mi(n,x),b=Math.floor(c/S);b<=1?(s=1,p=Wi(n,c),f=l>1):(s=b,p=x,f=s<l)}}else s=0,p=0,f=!1;return{visibleBars:s,columnWidth:p,scrollbarVisible:f}}const ja=(t,e,r)=>Math.max(e,Math.min(r,t)),Gt=(t,e,r,c,x,n,l,s,p,f,L,u,S=!1)=>{const b=(_,A,R,g,B)=>{try{if(B&&(_=f+_),!p||!Array.isArray(p.dimensionList)||!Array.isArray(t))return;_=_==null?0:Number(_),A=A==null?0:Number(A),R=R==null?0:Number(R),f=ja(Math.round(_),0,Math.max(0,A)),s=typeof s=="number"?s:0;const U=f,W=U+s;let P=p.dimensionList.slice(U,W),D=JSON.parse(JSON.stringify(t||[]));D.forEach((ue,ge)=>{const be=Array.isArray(ue?.data)?ue.data:[];D[ge].data=be.filter(pe=>P.includes(pe?.dimension))});const V=x?.left??0,$=x?.top??0,Z=Number(n)||0,ce=Number(innerHeight)||0,ne=Number(R)||0,ae=A===0?1:A;if(S){const ue=$+(ce-ne)*(A===0?0:f)/ae;g&&typeof g.attr=="function"&&g.attr("y",ue)}else{const ue=V+(Z-ne)*(A===0?0:f)/ae;g&&typeof g.attr=="function"&&g.attr("x",ue)}u(P,D,s)}catch(U){typeof Ae=="function"&&Ae("ColumnChart","updateFromScrollPosition",U)}};if(l){const _=e-x.top-x.bottom,A=Math.max(0,t[0].data.length-s),R=e-8;c.append("rect").attr("id","scrollbarTrack").attr("x",S?r-8:x.left).attr("y",S?x.top:R).attr("width",S?8:n).attr("height",S?_:8).attr("fill","#ccc");const g=(S?_:n)*s/p.dimensionList.length,B=c.append("rect").attr("x",S?r-8:x.left).attr("y",S?x.top:R).attr("width",S?8:g).attr("height",S?g:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");B.call(v.drag().on("drag",U=>{if(S){const P=(ja(U.y,x.top,x.top+_-g)-x.top)/(_-g)*(A||1);b(P,A,g,B,!1),B.attr("y",x.top+(_-g)*(A===0?0:f)/(A===0?1:A))}else{const P=(ja(U.x,x.left,x.left+n-g)-x.left)/(n-g)*(A||1);b(P,A,g,B,!1),B.attr("x",x.left+(n-g)*(A===0?0:f)/(A===0?1:A))}})),c.on("wheel",U=>{U.preventDefault();const P=(S?U.deltaY:U.deltaX)>0?1:-1;if(b(P,A,g,B,!0),S){const D=x.top+(_-g)*(A===0?0:f)/(A===0?1:A);B.attr("y",D)}else{const D=x.left+(n-g)*(A===0?0:f)/(A===0?1:A);B.attr("x",D)}})}else c.on("wheel",null);b(0,0,0,null,!0)};function ti(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_){try{if(l.total.totalVisibility){const A=l.annotation.annotationVisibility!="5"?10:0;let R=l.total.annotationType??"1",g=[R=="1"?"connector":""],B=x.annotation(),U=l.total.connectorType,W=l.total.totalFontStyle,P=l.total.connectorType?l.total.connectorType.toLowerCase():"None";n=[];let D=[],V=Array.from(t,([Z,ce])=>({Dimension:Z,Measure:ce}));l.total.totalHideZeroValues&&(V=V.filter(Z=>Z.Measure!==0)),V.forEach((Z,ce)=>{let ne={note:{label:Z.Measure>=1e9&&l.total.totalNumberFormat===".2s"?Math.round(Z.Measure/1e9)+"B":Ze(Z.Measure,l.total.totalDisplayUnits||l.plotArea.plotAreaDisplayUnits,l.total.totalNumberFormat,l.total.totalDecimalPrecision)},data:{y:Z.Measure,x:Z.Dimension},dx:0,dy:0,connector:{end:P,curve:ui[l.total.connectorCurve]},disable:g,subject:{height:15,width:15},color:l.total.totalColor,type:xi(x,parseFloat(R)),height:p,width:f};D.push(ne)}),B.editMode(l.total.annotationDraggable&&u).accessors({x:function(Z){if(!S)return e(Z.x);if(Z.y>=0){const ne=_?.get(Z.x)??Z.y;return r(ne)+25}const ce=b?.get(Z.x)??Z.y;return r(ce)-25},y:function(Z){if(S){const ne=parseFloat(l.total.totalFontSize)||12;return l.annotation.annotationVisibility!=="5"?e(Z.x)-ne-4:e(Z.x)-ne/2}if(Z.y>=0){const ne=_?.get(Z.x)??Z.y;return r(ne)-A-15}const ce=b?.get(Z.x)??Z.y;return r(ce)+A+5}}).on("dragend",function(Z){$.selectAll(".connector").style("stroke",l.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[l.total.connectorStyle.toLowerCase()]),$.selectAll(`.connector-${P}`).attr("fill",l.total.connectorColor||"#ccc").style("stroke",l.total.connectorColor||"#ccc"),$.selectAll(".note-line").attr("hoverId",ce=>ce.data.currentLegend).style("stroke",l.total.connectorColor||"#ccc").attr("stroke-dasharray",$t[l.total.connectorStyle.toLowerCase()]).filter(ce=>ce._dx==0&&ce._dy==0).remove()}).accessorsInverse({x:Z=>e.invert(Z.x),y:Z=>r.invert(Z.y)}).notePadding(0).annotations(D);let $=Gl(L,l,c,W,B,P);l.animation?.animationEnabled&&$.selectAll(".annotation").each(function(Z){const ce=v.select(this),ae=ce.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!ae)return;const ue=parseFloat(ae[1]),ge=parseFloat(ae[2]);if(S){const be=r(0);ce.attr("transform",`translate(${be},${ge})`).transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`translate(${ue},${ge})`)}else{const be=r(0);ce.attr("transform",`translate(${ue},${be})`).transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`translate(${ue},${ge})`)}})}}catch(A){throw A}}const Gl=(t,e,r,c,x,n)=>{t.selectAll(".total-annotation-group").remove();let l=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${r.left},${r.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",c.includes("Italic")?"Italic":"").style("text-decoration",c.includes("Underline")?"Underline":"").style("font-weight",c.includes("Bold")?"Bold":"").call(x);return l.selectAll("rect").style("visibility","hidden"),l.selectAll(".annotation-subject").remove(),l.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.total.connectorStyle.toLowerCase()]),l.selectAll(`.connector-${n}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),l.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",$t[e.total.connectorStyle.toLowerCase()]).filter(s=>s._dx==0&&s._dy==0).remove(),l.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),e.total.annotationType=="1"&&l.selectAll(".annotation-note-content").attr("transform",function(){const p=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(p)return`translate(${parseFloat(p[1])}, 0)`}),l.selectAll("text").append("text").style("fill",e.total.totalColor!==Re.white?e.total.totalColor:"none"),l};function ai(t,e,r){e.clear(),r&&r.length>0&&r.forEach(c=>{e.set(c,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(c=>{c.data.forEach((x,n)=>{if(e.has(x.dimension)){let l=e.get(x.dimension)||0;l+=x.value||0,e.set(x.dimension,l)}})})}function sa(t,e,r,c=!1){const x=c&&t.xAxisLabel.xAxisPosition=="1"?-1:1,n=r>0?r:0,l=parseFloat(t.plotArea.ticksHeight)||100,s=(e-n)*l/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-s*x:0}function Rt(t,e,r=0){const c=parseFloat(t.plotArea.ticksWidth)||100,x=(e-r)*c/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-x:0}const Hi={color:"defaultColor",name:"",type:"Line",axis:Qe.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:tt,labelColor:Re.black,hideZeroValues:!1,markerShape:"Circle",lineStyle:"Solid",annotationPosition:1,markerColor:"defaultColor",areaBorderColor:"defaultColor",lineWidth:1.5,markerSize:1,opacity:.5,annotation:1,disableAnnotation:!0,disableAnnotationPosition:!0,connector:1,disableConnector:!0,measureUniqueId:"measureUniId",legendUniqueId:"uniqueLegendId",disableMarkerShape:!0,disableMarkerSize:!0,disableMarkerColor:!0,disableLineWidth:!0,disableLineStyle:!0,borderStyle:"Solid",borderWidth:2,borderRadius:0,borderColor:"black",labelFontSize:11,labelFontStyle:[],labelFont:tt,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:tt,valueFontColor:"black",backgroundColor:Re.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:Re.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var lt=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(lt||{});const _l="11px",jl="1.6";function Tt(t,e,r){return(c,x)=>{!t.current||!e.current||e.current(r(c,x))}}function gt(t,e,r){return t?.(e,r)??void 0}const ut="CommonFunctions.ts";se.ColumnChart,se.StackColumnChart,se.NormalizedStackColumnChart,se.LineChart,se.StackLineChart,se.NormalizedStackLineChart,se.AreaChart,se.StackAreaChart,se.NormalizedStackAreaChart,se.PieChart,se.PieofPie,se.DonutChart,se.PyramidChart,se.OrganizationChart,se.VennChart,se.ProgressChart,se.Maps,se.WordCloud,se.SankeyChart,se.Speedometer,se.RadialBarChart;function Pt(t,e,r,c,x,n,l,s,p,f,L,u,S,b){try{let _=l.legends.legendPosition,A=l.legends.legendAlignmentTopBottom,R=l.legends.legendAlignment;if(l.legends.legendVisibility)switch(_){case je.none:break;case je.right:let g=l.plotArea.fitChart?t-c-10:t-c-20;ua(e,s,x-(n+15),c+5,n+5,g,_,R,u,l,p,!1,b);break;case je.top:ua(e,s,7,c,x-10,30,_,A,u,l,p,!1,b);break;case je.left:let B=l.plotArea.fitChart?t-c-10:t-c-20;const U=f?f+L.bottom:0;ua(e,s,7,c+5,n+5,B-U,_,R,u,l,p,!1,b);break;case je.bottom:ua(e,s,7,t-35,x-10,30,_,A,u,l,p,!1,b);break}}catch(_){Ae(ut,"drawLegends",_)}}function Jl(t,e){try{let r=0,c=t[0];return t.forEach(x=>{if(x!==void 0){let n=x.includes("~$~")?x.split("~$~")[1]:x.includes("-")?x.slice(x.indexOf("-")+1):x,l=n.length;r<l&&(r=l,c=n)}}),Nt(c,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(r){Ae(ut,"calculateMaxLegendWidth",r)}}function Da(t,e,r,c,x,n,l,s,p,f,L,u,S,b,_,A=!1){try{const R=(P,D)=>A?[D,P]:[P,D];let g=s.plotArea.hideZeroValues;s.plotArea.plotAreaHideLineAndMarkers===void 0&&(s.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(P=>P.data.forEach(D=>{D.markerShape=[se.CombinationLine,se.CombinationArea].includes(r)&&!s.plotArea.plotAreaHideLineAndMarkers?"None":P.properties.markerShape?P.properties.markerShape:"Circle",D.currentMeasure=P.properties.currentMeasure,D.markerColor=P.properties.markerColor?P.properties.markerColor:"Blue",D.alias=P.properties.alias,D.markerSize=P.properties.markerShape!="None"&&P.properties.markerSize&&P.properties.markerShape!="None"?r==="Area"?s.plotArea.plotAreaHideLineAndMarkers?P.properties.markerSize:0:P.properties.markerSize:0}));let B=t.selectAll(".lineGroup").data(e,P=>P.legend);B.enter().append("g").attr("class","parentGroup").attr("hoverId",P=>(P.properties.alias||P.properties.name||"Legend").replace(/\s+/g,"-")).merge(B).each(function(P){let V=v.select(this).selectAll("path").data(P.data);const Z=V.enter().append("path").attr("fill",ce=>ce.markerColor).merge(V).attr("d",ce=>v.symbol().type(Gi(ce.markerShape)).size(ce.markerSize*50)()).attr("visibility",ce=>{const ne=!c(ce.dimension)&&c(ce.dimension)!==0,ae=s.marker.markerVisibility?Zl(e,ce,r,g,n,u,S)?It.hidden:[se.NormalizedStackLineChart,se.CombinationLine,se.CombinationArea].includes(r)||[se.StackAreaChart,se.AreaChart,se.CombinationStackArea].includes(r)?s.plotArea.plotAreaHideLineAndMarkers?It.visible:It.hidden:It.visible:[se.CombinationLine,se.CombinationArea].includes(r)||["Area"].includes(r)&&s.plotArea.plotAreaHideLineAndMarkers?It.visible:It.hidden;return ne?It.hidden:ae}).attr("transform",ce=>{let ne=ce.axis==Qe.primary?x:n;const ae=c(ce.dimension),ue=[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ce[1]>0?ne(ce[1]):ne(ce[0]):ne(ce.value),[ge,be]=R(ae,ue);return`translate(${ge},${be})`}).on("mousemove",function(ce,ne){const ae=ne,ue=ne,ge=v.select(this.parentNode),be=Array.isArray(ae.dimension)?ae.dimension[0]:ae.dimension,pe=String(p.formattedDimensionListMap.get(be)??""),Q=_?.(String(be??""),{...ne,formattedDimensionValue:pe})??void 0;yt([{key:s.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(s.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():s.xAxisTitle.xAxisTitleText,value:p.formattedDimensionListMap.get(Array.isArray(ae.dimension)?ae.dimension[0]:ae.dimension)},{key:s.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(s.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ne.properties?.currentMeasure?ne.properties.currentMeasure:s.yAxisTitle.yAxisTitleText||ae.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(r)?ae[1]-ae[0]:ae.value,s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ue.alias.includes("~$~")?ue.alias.split("~$~")[1]:ue.alias}],s,ce,ne,Q),ge.selectAll(".hoverHighlight").remove();const G=c(ae.dimension),M=()=>{const o=ae.axis===Qe.primary?x:n;return[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ae[1]>0?o(ae[1]):o(ae[0]):o(ae.value)},[h,k]=R(G,M());ge.insert("circle",":first-child").attr("class","hoverHighlight").attr("cx",h).attr("cy",k).attr("fill",ue.markerColor).attr("opacity",.5).attr("r",ue.markerSize*10),v.select(this).transition().duration(100).attr("transform",()=>{const o=ae.axis===Qe.primary?x:n,d=c(ae.dimension),i=[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ae[1]>0?o(ae[1]):o(ae[0]):o(ae.value),[y,T]=R(d,i);return`translate(${y},${T}) scale(1.3)`})}).on("mouseout",function(ce,ne){const ae=ne,ue=v.select(this.parentNode);ot(),ue.selectAll(".hoverHighlight").remove(),v.select(this).transition().duration(100).attr("transform",()=>{const ge=ae.axis===Qe.primary?x:n,be=c(ae.dimension),pe=[se.NormalizedStackAreaChart,se.StackAreaChart,se.StackLineChart,se.NormalizedStackLineChart,se.CombinationStackArea].includes(r)?ae[1]>0?ge(ae[1]):ge(ae[0]):ge(ae.value),[Q,G]=R(be,pe);return`translate(${Q},${G}) scale(1)`})});if(s.animation.animationEnabled){const ce=s.animation.animationDuration,ne=et[s.animation.animationEffect]??v.easeLinear;if([se.AreaChart,se.StackAreaChart,se.NormalizedStackAreaChart,se.CombinationArea,se.CombinationStackArea].includes(r)){const ue=[se.StackAreaChart,se.NormalizedStackAreaChart,se.CombinationStackArea];Z.each(function(ge){const be=ge.axis===Qe.primary?x:n,pe=c(ge.dimension),Q=ue.includes(r)?ge[1]>0?be(ge[1]):be(ge[0]):be(ge.value),G=x(0),[M,h]=R(pe,G),[k,o]=R(pe,Q);v.select(this).attr("transform",`translate(${M},${h})`).transition().duration(ce).ease(ne).attr("transform",`translate(${k},${o})`)})}else{const ue=c.range(),ge=Math.min(ue[0],ue[1]),be=Math.max(ue[0],ue[1])-ge,pe=(Q,G=100)=>{for(let M=0;M<=G;M++){const h=M/G;if(ne(h)>=Q)return h}return 1};Z.attr("opacity",0).each(function(Q){const G=c(Q.dimension)??ge,M=be>0?Math.max(0,Math.min(1,(G-ge)/be)):0,h=pe(M)*ce;v.select(this).transition().delay(h).duration(0).attr("opacity",1)})}}})}catch(R){Ae(ut,"lineMarkers",R)}}function Gi(t){return t=="Square"?v.symbolSquare:t=="Circle"?v.symbolCircle:t=="Cross"?v.symbolCross:t=="Triangle"?v.symbolTriangle:t=="Star"?v.symbolStar:t=="Diamond"?v.symbolDiamond:t=="Wye"?v.symbolWye:v.symbolCircle}const Zl=(t,e,r,c,x,n,l)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?c&&e.value==0||e.value>x.domain()[1]||e.value<x.domain()[0]:r.includes("Stack")?e.value>0?c&&e[1]==0||e[1]<n||e[1]>l:c&&e[0]==0||e[0]<n||e[0]>l:c&&e.value==0||e.value<n||e.value>l}catch(s){Ae(ut,"checkVisibleConditions",s)}};function bi(t,e,r,c,x,n,l,s,p,f=!1){try{let L=function(S){try{let b=v.pointer(S),_=1e99,A,R=null;const g=f?b[1]:b[0],B=f?b[0]:b[1];for(let W=0;W<u.length;W++){let P=Math.abs(g-n(u[W]));P<_&&(_=P,R=W)}let U=1e99;for(let W=0;W<x.length;W++){const P=p?x[W].data[R].value>0?x[W].data[R][1]:x[W].data[R][0]:x[W].data[R].value;let D=Math.abs(B-l(P));D<U&&(U=D,A=W)}r.attr("transform",Xl(x[A],R,n,l,p,f)).append("circle").attr("r",x[A].properties.markerSize*2.5).attr("id","tooltip").attr("fill",x[A].properties.markerColor).text(yt([{key:t.xAxisTitle.xAxisTitleText,value:x[A].data[R].dimension},{key:x[A].properties.currentMeasure?x[A].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:Ze(s===se.NormalizedStackAreaChart?A===0?x[A].data[R].value:x[A].data[R].value-x[A-1].data[R].value:x[A].data[R].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:x[A].data[R].legend.includes("~$~")?x[A].data[R].legend.split("~$~")[1]:x[A].data[R].legend}],t,void 0,x[A].properties))}catch(b){Ae(ut,"onHoverMarkerForAreaChartFamily.mousemove",b)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){r.style("display",null)}).on("mousemove",L).on("mouseout",function(){r.style("display","none"),ot()});let u=c}catch(L){Ae(ut,"onHoverMarkerForAreaChartFamily",L)}}const Xl=(t,e,r,c,x,n=!1)=>{try{const l=x?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value,s=r(t.data[e].dimension),p=c(l);return n?`translate(${p},${s})`:`translate(${s},${p})`}catch(l){Ae(ut,"getCoordinates",l)}};function zt(t,e,r,c,x){try{const n=document.createElement("div");Object.assign(n.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(n),n.style.transform="",n.style.width="",n.style.whiteSpace="nowrap",n.style.overflowWrap="",e!=null&&(n.style.fontSize=`${e}px`),r!=null&&(n.style.fontFamily=r),x!=null,n.textContent=t;const l=n.getBoundingClientRect(),s=l.width,p=l.height;if(c&&c!==0){n.style.transform=`rotate(${c}deg)`;const f=n.getBoundingClientRect();return n.remove(),{width:s,height:p,rotatedWidth:f.width,rotatedHeight:f.height}}return n.remove(),{width:s,height:p,rotatedWidth:0,rotatedHeight:0}}catch(n){Ae(ut,"preCalculateTextDimensions",n)}}function _i(t,e){try{if(typeof t!="object"||t===null)throw new TypeError("`defaults` must be a non-null object");if(typeof e!="object"||e===null)throw new TypeError("`target` must be a non-null object");return Object.keys(t).forEach(r=>{const c=t[r],x=Object.prototype.hasOwnProperty.call(e,r),n=e[r];if(!x||n===void 0){e[r]=Array.isArray(c)?[...c]:typeof c=="object"&&c!==null?{...c}:c;return}const l=ji(c),s=ji(n);l&&s&&_i(c,n)}),e}catch(r){Ae(ut,"addUndefinedDefaults",r)}}function ji(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){Ae(ut,"isPlainObject",e)}}function qe(t,e,r){try{let c=1,x="",n=r,l;return function(s){try{let p=s??0;if(t==="Auto")return ql(p);switch(t&&t!=="None"&&(t==="Thousands"&&(c=1e3,x="K"),t==="Millions"&&(c=1e6,x="M"),t==="Billions"&&(c=1e9,x="B"),p=p/c),e){case",.0%":return l=`.${n}%`,v.format(l)(p);case"":return l=`.${n}f`,v.format(l)(p)+x;case".2n":return l=`.${n==0?1:parseFloat(n)+1}n`,v.format(l)(p)+x;case".2$":return l=`,.${n}f`,"$"+v.format(l)(p)+x;case".2c":return l=`,.${n}f`,"C$"+v.format(l)(p)+x;case".2ē":return l=`,.${n}f`,"€"+v.format(l)(p)+x;case".2ch":return l=`,.${n}f`,"CHF"+v.format(l)(p)+x;case".2£":return l=`,.${n}f`,"£"+v.format(l)(p)+x;case".2₹":return l=`,.${n}f`,"₹"+v.format(l)(p)+x;case",":return l=`,.${n}f`,v.format(l)(p)+x;default:return l=".2f",v.format(l)(p)+x}}catch(p){Ae(ut,"getNumberWithFormatFunction.inner",p)}}}catch(c){Ae(ut,"getNumberWithFormatFunction",c)}}function ql(t){if(t==null)return"0";let e=Math.abs(t);return e>=1e9?(t/1e9).toFixed(2)+"B":e>=1e6?(t/1e6).toFixed(2)+"M":e>=1e3?(t/1e3).toFixed(2)+"K":t.toFixed(2)}function yt(t,e,r,c,x){try{const n=c?.color??c?.markerColor??"blue",l=c?.markerShape?.toLowerCase()??"circle",s=e.toolTip.toolTipTheme==="Light",p=s?"rgba(255, 255, 255)":"#272729ff",f=s?"black":Re.white,L=s?"gray":"#d1d5db",u=(V,$=6)=>{if(!V)return"";const Z=V.split(" ");let ce="";for(let ne=0;ne<Z.length;ne+=$)ce+=Z.slice(ne,ne+$).join(" ")+"<br/>";return ce};v.selectAll(".chartTooltip").style("visibility",It.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),b=v.select("#chartTooltipDiv").html("").append("div").attr("class",s?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",f).style("background",p).style("border",S==="1"?"1px solid #d0d0d0":"1px solid #d4d4d4").style("border-radius",S==="1"?"0":"4px").style("padding","8px 12px").style("position","absolute").style("box-shadow",S==="1"?"none":s?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),_=r||window.event,A=_.pageX,R=_.pageY,g=t.reduce((V,$)=>{const Z=(()=>{switch(l){case"circle":return"border-radius: 50%;";case"square":return"";case"triangle":return"clip-path: polygon(50% 0%, 0% 100%, 100% 100%);";case"cross":return"clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%);";case"star":return"clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);";case"diamond":return"clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0 50%);";case"wye":return"clip-path: polygon(50% 0%, 60% 40%, 100% 40%, 65% 60%, 75% 100%, 50% 75%, 25% 100%, 35% 60%, 0 40%, 40% 40%);";default:return"border-radius: 50%;"}})();return V+=`
27
27
  <div style="
28
28
  display:flex;
29
29
  align-items:flex-start;
@@ -49,7 +49,7 @@ let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+
49
49
 
50
50
  <span style="
51
51
  font-size:11px;
52
- color:${A};
52
+ color:${L};
53
53
  white-space:nowrap;
54
54
  ">
55
55
  ${$.key||""}
@@ -60,7 +60,7 @@ let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+
60
60
  <div style="
61
61
  font-size:11px;
62
62
  font-weight:bold;
63
- color:${L};
63
+ color:${f};
64
64
  text-align:right;
65
65
  max-width:200px;
66
66
  word-break:break-word;
@@ -70,125 +70,125 @@ let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+
70
70
  </div>
71
71
 
72
72
  </div>
73
- `,N},"");b.html(h?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${Yl}; color:${L}; line-height:${Ul};">${h}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${D}</div>`);const j=b.node(),K=j.offsetWidth,J=j.offsetHeight;let U=g+15,V=H+15;U+K>window.innerWidth&&(U=g-K-10),V+J>window.innerHeight&&(V=H-J-10),b.style("left",`${U}px`).style("top",`${V}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(n){console.error("Tooltip Error:",n)}}function rt(){try{T.select("#chartTooltipDiv").html("").style("visibility",Vt.hidden)}catch(t){be(ct,"hideTooltipOnMouseOut",t)}}const _t=(t,e,r,o)=>{try{let n=T.select(t.current).append("foreignObject").attr("visibility",o.chartTitle.chartTitleVisibility?Vt.visible:Vt.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r).attr("height",e+"px");o.chartTitle.dynamicTitleText.length!==0?n.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",Vt.visible).style("line-height","1.3em").html(o.chartTitle.chartTitleHTML?o.chartTitle.chartTitleHTML:o.chartTitle.chartTitleText):n.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",Vt.visible).style("line-height","1.3em").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",o.chartTitle.chartTitleFontFamily).attr("title",o.chartTitle.chartTitleText).html(o.chartTitle.chartTitleText)}catch(h){be(ct,"drawChartTitle",h)}},Ui=(t,e)=>{try{return t.reduce((r,o)=>{const h=typeof o=="string"?o:e&&typeof o=="object"&&o[e]||"";return h.length>r.length?h:r},"")}catch(r){be(ct,"findStringWithLongestLength",r)}},oa=(t,e,r,o,h,n,l,s,x,L,A,u=!1,S)=>{try{if(L.legends.legendVisibility){let _="",g="";l==Be.left||l==Be.right?(g="column",_=s==Fa.top?"start":s==Fa.middle?"center":"end"):(g="row",_=s==wa.start?"start":s==wa.middle?"center":"end");var b=t.append("foreignObject").attr("x",r).attr("y",o).style("pointer-events","auto").attr("width",h+"px").attr("height",n+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+A).attr("class","legendsBoxWrapper").style("width",h+"px").style("display","flex").style("height",n-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+_).style("flex-direction",g).style("outline-offset","-"+L.legends.legendBorderThickness+"px").style("outline",L.legends.legendBorder?`${L.legends.legendBorderThickness+"px solid"+L.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",g).style("flex-wrap","nowrap").style("padding-left","3px");(l==Be.top||l==Be.bottom)&&b.style("flex-direction","row"),e.forEach((D,j)=>{let K=b.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("width","fit-content").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("dblclick",function(){S(D?.properties)}).on("mousemove",function(){if(L.legends.onHoverEffect){const N=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${N}"]`).classed("highlight",!0).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!0)}}).on("mouseout",function(){if(L.legends.onHoverEffect){const N=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${N}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(l==Be.top||l==Be.bottom)&&K.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let J;if(!x){let N=D.properties.type;N==le.ColumnChart||N==le.StackColumnChart?J=nt.rectangle:N==le.LineChart||N==le.StackLineChart?J=nt.line:(N==le.AreaChart||N==le.StackAreaChart)&&(J=nt.areaWithLine)}(x||J)==nt.circle?_l(D,K):(x||J)==nt.hollowCircle?jl(D,K):(x||J)==nt.line?Bi(D,K,L):(x||J)==nt.areaWithLine?Wi(D,K,L):(x||J)==nt.rectangle&&Jl(D,K);let U=u&&(l==Be.bottom||l==Be.top)&&j!=e.length-1?" |":"",V=u?L.legends.legendSelectedUnicolor:L.legends.legendColorMode==fl.multiColor?D.properties.color?D.properties.color:De.black:L.legends.legendSelectedUnicolor;K.append("div").style("margin-left","5px").style("color",V).style("background",D.properties.axis==at.secondary&&L.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?L.legends.legendFontSize:D.properties.fontSize)+"px").style("font-family",u?L.legends.legendFontFamily:D.properties.fontFamily).style("font-style",()=>(u?L.legends.legendFontStyle:D.properties.fontStyle).includes(ne.italic)?ne.italic:"").style("text-decoration",()=>(u?L.legends.legendFontStyle:D.properties.fontStyle).includes(ne.underline)?ne.underline:"").style("font-weight",()=>(u?L.legends.legendFontStyle:D.properties.fontStyle).includes(ne.bold)?ne.bold:"").style("white-space","nowrap").attr("title",u?D.legendDisplay+" : "+D.actualValue:D.properties.alias).html(u?D.legendDisplay+" : "+D.actualValue+U:D.properties.alias)})}}catch(_){be(ct,"legendsWithScroll",_)}};function _l(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(r){be(ct,"getCircleShape",r)}}function jl(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("border",`3px solid ${t.properties.Color??t.properties.color}`)}catch(r){be(ct,"getHollowCircleShape",r)}}function Bi(t,e,r){try{const o=t.properties?.lineStyle?.toLowerCase()||"solid";let h=e.append("div").style("height","2px").style("width",o=="dashed"?"25px":"20px").style("background",De.transparent).style("position","relative").style("border-top",o=="none"?"unset":o=="dotted"?"2px dotted "+t.properties.color:o=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":h.append("div").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-6)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","4.5").style("fill",t.properties.markerColor);break;case"square":h.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-2px, -7px)").style("height","8px").style("width","8px").style("top","2px").style("left","9px").style("background",t.properties.markerColor);break;case"triangle":h.append("div").style("position","absolute").style("transform","translate(5px, -6.5px)").style("border-left","6px solid transparent").style("border-right","6px solid transparent").style("border-bottom",`10px solid ${t.properties.markerColor}`);break;case"cross":h.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-5px, -3px)").style("height","4px").style("width","10px").style("background",t.properties.markerColor).append("div").style("height","10px").style("width","4px").style("background",t.properties.markerColor).style("position","relative").style("top","-3px").style("left","3px");break;case"diamond":h.append("div").style("height","7px").style("width","7px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-4px").style("left","7px").style("position","absolute");break;case"star":h.append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-bottom",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-6.5px").style("left","7px").style("transform","rotate(0deg)").append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-top",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","2px").style("left","-4px").style("transform","rotate(360deg)");break;case"wye":h.append("div").style("height","6.5px").style("width","3px").style("background",t.properties.markerColor).style("position","absolute").style("left","10px").style("top","-3.5px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":default:break}}catch(o){be(ct,"getLineShape",o)}}function Wi(t,e,r){try{let o=e.append("div").style("height","10px").style("width","15px").style("background",t.properties.color).style("display","flex").style("flex-direction","column").style("border-radius","1px");if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.color).style("position","relative").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-5)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","2.5").style("fill",t.properties.markerColor);break;case"square":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-4px, -3.5px)").style("height","5px").style("width","5px").style("top","2px").style("left","9px").style("background",t.properties.markerColor).style("border-radius","1px");break;case"triangle":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("transform","translate(5px, -3.5px)").style("border-left","3px solid transparent").style("border-right","3px solid transparent").style("border-bottom",`7px solid ${t.properties.markerColor}`);break;case"cross":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-3px, -2px)").style("height","4px").style("width","7px").style("background",t.properties.markerColor).append("div").style("height","6px").style("width","3px").style("background",t.properties.markerColor).style("position","relative").style("top","-1px").style("left","2px");break;case"diamond":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4px").style("width","4px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-1px").style("left","5px").style("position","absolute");break;case"star":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-bottom",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-3px").style("left","6px").style("transform","rotate(0deg)").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-top",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","0.5px").style("left","-2px").style("transform","rotate(360deg)");break;case"wye":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4.5px").style("width","2px").style("background",t.properties.markerColor).style("position","absolute").style("left","6.5px").style("top","-0.5px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":o.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}o.append("div").style("height","20%").style("width","100%").style("background","white"),o.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(o){be(ct,"getAreaShape",o)}}function Jl(t,e){try{e.append("div").style("height","10px").style("width","15px").style("border-style",t).style("border-width",t).style("border-color",t).style("background",t.properties.color).style("border-radius","1px")}catch(r){be(ct,"getReactShape",r)}}const jt=(t,e,r,o)=>{try{let h=t.current;h.setAttribute("viewBox",`0 0 ${e} ${r}`);const{chartAreaColor:n,chartAreaBorder:l}=o.chartArea;if(h.style.backgroundColor=n,l){let x=o.chartArea.chartAreaBorderColor,L=o.chartArea.chartAreaBorderThickness+"px",A=et(o.chartArea.chartAreaBorderStyle),u=A==1?"solid":A==2?"dashed":"dotted";h.style.outline=`${L} ${u} ${x}`,h.style.outlineOffset=`-${L}`}else h.style.outline="unset"}catch(h){be(ct,"initSvg",h)}},la=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){be(ct,"initChartArea",r)}},Jt=(t,e)=>{try{let r=T.select(t.current);r.selectAll("*").remove();let o=$i(Mi,e),h=t.current.getBoundingClientRect(),n=h.width,l=h.height;return{chartFormatOptions:o,svg:r,width:n,height:l}}catch(r){be(ct,"firstFunctionBeforeRender",r)}},Na=(t,e,r,o,h,n=!1)=>{try{let l=t.legends.legendPosition;l=t.legends.legendVisibility?t.legends.legendPosition:Be.none;let s=e*.15*.8,x=n?o[0]:s<o[0]+15?s:o[0]+15,L=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?It(t.chartTitle.chartTitleHTML,void 0,void 0).height:It(t.chartTitle.chartTitleText,16,qe).height:5;switch(l){case Be.none:h.top=L+10,h.bottom=15,h.right=15,h.left=15;break;case Be.top:h.top=L+50,h.bottom=15,h.right=15,h.left=15;break;case Be.right:h.right=x+50,h.top=L+15,h.bottom=15,h.left=15;break;case Be.bottom:h.bottom=45,h.top=L+15,h.right=15,h.left=15;break;case Be.left:h.left=x+50,h.top=L+15,h.bottom=15,h.right=15}let A=r-h.top-h.bottom,u=e-h.left-h.right;return{margins:h,innerHeight:A,innerWidth:u,legendListWidth:x,chartTitleHeight:L}}catch(l){be(ct,"marginCalculationsForChartsWithoutAxis",l)}},Pa=(t,e,r,o,h,n,l,s,x,L,A=!0,u)=>{try{let S=t.legends.legendPosition,b=t.total.totalPosition,_=t.total.totalAlignment,g=t.total.totalVisibility&&A,H=t.legends.legendAlignmentTopBottom,D=t.legends.legendAlignment;switch(S){case Be.none:break;case Be.right:oa(e,r,o-n-25,l+5+(g&&b==va.top&&_==$t.end?10:0),n+15,h-l-10-(g?b==va.top&&_==$t.end?10:b==va.bottom&&_==$t.start?25:0:0),S,D,L,t,s,!1,u);break;case Be.top:oa(e,r,5,l+5,o-10,30,S,H,L,t,s,!1,u);break;case Be.left:oa(e,r,5,x.top+(g&&b==va.top&&_==$t.start?10:0),n+15,h-l-10-(g?b==va.top&&_==$t.start?10:b==va.bottom&&_==$t.start?25:0:0),S,D,L,t,s,!1,u);break;case Be.bottom:oa(e,r,5,h-35,o-10,30,S,H,L,t,s,!1,u);break}}catch(S){be(ct,"initLegendListWithTotalValueAllowance",S)}},Ia=(t,e,r="legend")=>{try{let o=It(Ui(e,r),et(t.legends.legendFontSize),t.legends.legendFontFamily);return[o.width,o.height]}catch(o){be(ct,"calculateLegendsMaxPossibleWidth",o)}},Qa=(t,e,r,o=!1)=>{try{let h=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?It(t.chartTitle.chartTitleHTML,void 0,void 0).height:It(t.chartTitle.chartTitleText,16,qe).height:5,n={top:t.chartTitle.chartTitleVisibility?h:20,bottom:o&&t.colorScale.showColor==ga.colorTheme?40:20,left:20,right:20};return innerHeight=e-n.top-n.bottom,innerWidth=r-n.left-n.right,{margins:n,chartTitleHeight:h,innerHeight,innerWidth}}catch(h){be(ct,"marginCalculationsForChartsWithoutLegends",h)}},et=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const r=parseFloat(e);return isNaN(r)?t:r}catch(e){be(ct,"convertStringToNumber",e)}};function bt(t,e,r=!1){try{return t.map(o=>{let h;o.properties?h={...Ri,...o.properties}:h={...Ri,legend:o.legend,currentLegend:o.legend,alias:o.legend,name:o.legend};const n=e&&e.length!==0?e.map(l=>{const s=o.data.find(x=>x.dimension===l);return s?{...s}:{dimension:l,legend:o.legend,value:0}}):o.data.map(l=>({...l}));return{...o,properties:h,data:r?o.data:n}})}catch(o){be(ct,"generalizedChartData",o)}}const yi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){be(ct,"getJQuerySelector",e)}},ui=(t,e,r,o,h,n,l)=>{try{let s=t-e,x=n-h,L=parseInt(l.connector.connectorKPI),A,u;switch(L){case 1:if(A=`.${r}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return T.format(A)(t);s=Math.abs(s);break;case 3:return A=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(A)(t):(s=Math.round(t/e*100-100)/100,u=T.format(A)(s),u);case 2:return h.toString().length!==4&&(x=NaN),A=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(A)(t):(s=Math.pow(t/e,1/x)-1,u=T.format(A)(s),u)}if(e==0)return"N/A";{let S,b="",_=l.connector.connectorDisplayUnits;switch(_!="None"&&_!=null&&(_=="Thousands"&&(S=1e3,b="K"),_=="Millions"&&(S=1e6,b="M"),_=="Billions"&&(S=1e9,b="B"),s=s/S),isNaN(s)&&(s=0),o){case",.0%":return A=`.${r}%`,T.format(A)(s);case"":return A=`.${r}f`,T.format(A)(s)+b;case".2n":return A=`.${r}n`,T.format(A)(s)+b;case".2$":return A=`,.${r}f`,"$"+T.format(A)(s)+b;case".2c":return A=`,.${r}f`,"C$"+T.format(A)(s)+b;case".2ē":return A=`,.${r}f`,"€"+T.format(A)(s)+b;case".2ch":return A=`,.${r}f`,"CHF"+T.format(A)(s)+b;case",":return A=`,.${r}f`,T.format(A)(s)+b;case".2£":return A=`,.${r}f`,"£"+T.format(A)(s)+b;case".2₹":return A=`,.${r}f`,"₹"+T.format(A)(s)+b;default:return A=".2f",T.format(A)(s)+b}}}catch{}},Wa=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function Zl(t,e,r){try{let o=function(n){const l=n.split(" - ");return l.length>1?l[0]:n};const h=new Map;return e?.LegendList?.forEach(n=>{h.set(r?o(n?.name):n.measureUniqueId,n)}),t.map(n=>({...n,properties:h.get(r?o(n.legend):n.properties.measureUniqueId)??n.properties})).filter(n=>n.data[0].value!==0)}catch{return t}}const Xl=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID();let A=0,u=!1;const S=le.ColumnChart,b=Te.useRef(),_=Te.useRef(l);_.current=l;const g=Te.useRef(s);g.current=s;const H=Te.useRef(x);H.current=x;const D=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let J=!1;const U=!1;let V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,X=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce,me=[],Ve=0,Ye=0;const te=new Map;let de={dimensionList:j,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(I){be("Columnchart","createColumnChart",I)}},[e]);const Pe=()=>{({formatOptions:e,svg:m,width:i,height:y}=kt(b,e)),{formatOptions:e}=Qt(e,D,r.DataTableData??[]),Ce(),{maxNumberForPrimaryAxis:p,maxNumberForSecondaryAxis:C,customYaxisMaxValue:N,secondaryCustomYaxisMaxValue:X}=Nt(e,de.yMinLeft,de.yMaxLeft,de.yMinRight,de.yMaxRight),{margin:se,yLabel:re,xLabel:oe,yTitle:he,xTitle:Le,dimensionHeightWidthArray:pe,chartTitleHeight:ue,secondaryAxisTitleWidth:O,legendMargin:q,secondaryYLabel:w,visibleBars:Ye,columnWidth:A,scrollbarVisible:u}=Tt(i,y,p,C,de.yMaxLeft,e,de.legendList,de.dimensionList,de.yMaxRight,J,U,t,!1,de),ee(se),{dataTable:f,dataTableHeight:a}=ea(e,re,he,D,de.dimensionList,r),vt(m,i,y,e),P=Ct(m,se),mt(P,e,a,c,d,S,L),Me(),xe(),Gt(P,e,a,re,fe,d),J&&oi(P,e,a,w,ke,d,c),Mt(e,K,m,se,oe,y,Le,de.chartType,re,c,d),St(d,e,a,K,m,se,he,re),Ut(m,J,se,e,a,d,c,w,O),Ft(m,e,i,ue),Dt(y,m,pe,ue,i,q,e,D,L,a,se,nt.rectangle,S,n),Bt(D,y,i,m,se,c,u,Ye,de,Ve,!1,Y)},Ce=()=>{const I=[],v=[];let F=[],z=-1/0,R=1/0,E=-1/0,k=1/0,M=1/0,G=-1/0;D.forEach(Z=>{v.push(Z.properties.legendUniqueId),G=-1/0,M=1/0,Z.data.forEach(B=>{I.push(B),Z.properties.axis==="Secondary"?(J=!0,E=Math.max(E,B.value),k=Math.min(k,B.value)):(z=Math.max(z,B.value),R=Math.min(R,B.value)),G=Math.max(G,B.value),M=Math.min(M,B.value)}),Z.properties.setColorScale&&te.set(Z.properties.legendUniqueId,T.scaleSequential().domain([M,G]).interpolator(ii.interpolateRgb(Z.properties.startColor,Z.properties.endColor)))}),de.chartData=I,de.legendList=v,de.yMaxLeft=z,de.yMinLeft=R>0?0:R,de.yMaxRight=E,de.yMinRight=k>0?0:k,F=t?gt(e.xAxisLabel.xAxisNumberFormat,de.dimensionList).map(Z=>Z):de.dimensionList,de.dimensionList.forEach((Z,B)=>{de.formattedDimensionListMap.set(Z,F[B])}),me=JSON.parse(JSON.stringify(D)),ce=de.dimensionList,e.plotArea.hideZeroValues&&(de.hideZeroValues=!0)},Me=()=>{let I=st(N||de.yMaxLeft,de.yMinLeft,d,e,de,V,N).yAxisLabelArray;if(de.yMaxLeft=I[I.length-1],de.yMinLeft=I[0],ie=T.scaleLinear().domain([de.yMinLeft>=0?V!==void 0&&!Number.isNaN(V)?V:0:de.yMinLeft<0?de.yMinLeft*1.1:de.yMinLeft*.9,de.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:de.yMaxLeft*1.1]).range([a>0?d-a:d,0]),J){let v=st(X||de.yMaxRight,de.yMinRight,d,e,de,$,X).yAxisLabelArray;de.yMaxRight=v[v.length-1],de.yMinRight=v[0],Q=T.scaleLinear().domain([de.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:de.yMinRight*1.1,de.yMaxRight<=0?X||0:X||de.yMaxRight*1.1]).range([a>0?d-a:d,0])}we=[0,c],ve()},ve=()=>{ge=T.scaleBand().domain(de.legendList).range([0,A]).paddingInner(de.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),Ae=T.scalePoint().domain(ce).range(we).padding(.5)},xe=()=>{{let I=st(N||de.yMaxLeft,de.yMinLeft,d,e,de,V,N);fe=T.axisLeft(ie).tickFormat(v=>_e(v,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,c)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(J){let I=st(X||de.yMaxRight,$||de.yMinRight,d,e,de,$,X);ke=T.axisRight(Q).tickFormat(v=>_e(v,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??d/30).tickSize(Pt(e,c)).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{ae=(parseInt(e.xAxisLabel.xAxisPosition)==1?T.axisTop(Ae):T.axisBottom(Ae)).tickSize(ia(e,d,a)).tickSizeOuter(0).tickValues(Lt(ce,c))},ye=I=>{I.forEach(v=>{v.data.forEach(F=>{F.hideZero=v.properties.hideZeroValues,F.axis=v.properties.axis,F.legendUniqueId=v.properties.legendUniqueId})}),ce.forEach(v=>{P.append("rect").attr("id",`dim-background-${v}`).attr("class","dimension-background").attr("x",Ae(v)-Ae.step()/2).attr("width",Ae.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),I.forEach(v=>{let F=P.selectAll(".parentGroup").data([v],M=>M.properties.legendUniqueId);F=F.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(F);let z=F.selectAll(".column-group").data(v.data,M=>M.legend+M.dimension),R=z.enter().append("g").attr("class","column-group").attr("hoverId",(v.properties.alias||v.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",M=>`translate(${Ae(M.dimension)-A/2}, 0)`);z.attr("transform",M=>`translate(${Ae(M.dimension)-A/2}, 0)`),R.merge(z).attr("transform",M=>`translate(${Ae(M.dimension)-A/2}, 0)`);const E=R.append("rect").attr("x",M=>ge(M.legendUniqueId)).attr("width",ge.bandwidth()).attr("y",M=>(v.properties.axis===at.primary?ie:Q)(0)).attr("height",0).attr("fill",M=>te.get(v.properties.legendUniqueId)?.(M.value)??v.properties.color).attr("stroke-dasharray",M=>v.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",M=>`${v.properties.stackBorderWidth}px`).attr("stroke",M=>v.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?v.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",M=>M.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>v.properties.legendUniqueId).attr(Qe.DimValue,M=>Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension));(e.animation.animationEnabled?E.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):E).attr("y",M=>{const G=v.properties.axis===at.primary?ie:Q;return M.value>0?G(M.value):G(0)}).attr("height",M=>{const G=v.properties.axis===at.primary?ie:Q;return Math.abs(G(M.value)-G(0))}),R.merge(z).on("mousemove",(M,G)=>{(v.properties.alias||v.properties.name||"Legend").replace(/ /g,"-");const Z=Array.isArray(G.dimension)?G.dimension[0]:G.dimension,B=String(de.formattedDimensionListMap.get(Z)??Z??""),Se=ht(_.current,String(Z??""),{...v.properties,formattedDimensionValue:B});ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:B},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():G.properties?.currentMeasure?G.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||G.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(S)?G[1]-G[0]:G.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:v.properties.alias}],e,M,v.properties,Se)}).on("mouseout",(M,G)=>{(v.properties.alias||v.properties.name||"Legend").replace(/ /g,"-"),rt()}),R.merge(z).on("click",At(H,g,(M,G)=>({seriesId:v.properties.legendUniqueId,dimValue:Array.isArray(G.dimension)?String(G.dimension[0]):String(G.dimension),legendUniqueId:v.properties.legendUniqueId,seriesDisplayName:v.properties.alias||v.properties.name||""}))),z.exit().remove()}),P.selectAll(".parentGroup").raise()},ee=I=>{c=i-I.left-I.right,d=y-I.bottom-I.top},Y=(I,v,F)=>{me=v,ce=I,Ye=F,W()},W=()=>{ve(),Fe(),qt(P,de,oe,e,a,ie,ae,pe,y,A,t,c,d,ce,Ae),ye(me),Da(D,Ae,ie,Q,se,dt,[],[],e,S,y,i,c,ce,d,L,m,h,ge,A,o),ta(e.plotArea.fitChart,m,P,f,A,ie,Ae,ge,void 0,void 0,a,S,e,re,he,de.dimensionList,c,we,de.formattedDimensionListMap,L,se,d)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:b,id:L,style:{width:"100%",height:"100%"}})})},ql=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0,u=!1,S=[];const b=le.CustomColumnChart,_=Te.useRef(),g=Te.useRef(l);g.current=l;const H=Te.useRef(s);H.current=s;const D=bt(r.ChartData,r.DimensionList),j=r.DimensionList,K=!1;let J=!1;const U=!1;let V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,X=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe=[],ae=[],ke=[],ce=[],me=[],Ve=[],Ye=[],te=[],de,Pe,Ce,Me=new Map,ve,xe=[],Fe=[],ye=0,ee,Y={dimensionList:j,chartType:b,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{W()}catch(Re){be("CustomColumnchart","createCustomColumnChart",Re)}},[e]);const W=()=>{({formatOptions:e,svg:m,width:i,height:y}=kt(_,e)),I(),{formatOptions:e}=Qt(e,D,r.DataTableData??[]),tt(),{maxNumberForPrimaryAxis:p,maxNumberForSecondaryAxis:C,customYaxisMaxValue:N,secondaryCustomYaxisMaxValue:X}=Nt(e,Y.yMinLeft,Y.yMaxLeft,Y.yMinRight,Y.yMaxRight),{margin:se,yLabel:re,xLabel:oe,yTitle:he,xTitle:Le,dimensionHeightWidthArray:pe,chartTitleHeight:ue,secondaryAxisTitleWidth:O,legendMargin:q,secondaryYLabel:w,visibleBars:ee,columnWidth:A,scrollbarVisible:u}=Tt(i,y,p,C,Y.yMaxLeft,e,Y.legendList,Y.dimensionList,Y.yMaxRight,J,U,t,!1,Y),ze(se),{dataTable:f,dataTableHeight:a}=ea(e,re,he,D,Y.dimensionList,r),vt(m,i,y,e),P=Ct(m,se),mt(P,e,a,c,d,b,L),F(),R(),Gt(P,e,a,re,de,d),J&&oi(P,e,a,w,Ce,d,c),Mt(e,K,m,se,oe,y,Le,Y.chartType,re,c,d),St(d,e,a,K,m,se,he,re),Ut(m,J,se,e,a,d,c,w,O),Ft(m,e,i,ue),Dt(y,m,pe,ue,i,q,e,D,L,a,se,null,b,n),Bt(D,y,i,m,se,c,u,ee,Y,ye,!1,Ie)},I=()=>{const Re=[];let He=[],it=-1/0,Je=1/0,Ze=-1/0,Ge=1/0,Ee=[];D.forEach((Ne,Ue)=>{[le.StackColumnChart,le.StackAreaChart].includes(Ne.properties.type)?le.StackColumnChart===Ne.properties.type&&(Re.includes(le.StackColumnChart)||Re.push(le.StackColumnChart)):(Ee.push(Ne),Ne.properties.type!==le.LineChart&&Ne.properties.type!==le.AreaChart&&Re.push(Ne.properties.legendUniqueId)),Ne.properties.axis==="Secondary"&&(ae.push(Ne),Ne.properties.type==le.StackColumnChart&&Ve.push(Ne),Ne.properties.type==le.StackAreaChart&&me.push(Ne)),Ne.properties.axis===at.primary&&(fe.push(Ne),Ne.properties.type==le.StackColumnChart&&ce.push(Ne),Ne.properties.type==le.StackAreaChart&&ke.push(Ne)),Ne.data=Ne.data.map(xt=>{const Ke={...xt,type:Ne.properties.type,axis:Ne.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ne.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ne.properties.labelColor,legendUniqueId:Ne.properties.legendUniqueId};return Ke.axis==="Secondary"?(J=!0,Ze=Math.max(Ze,Ke.value),Ge=Math.min(Ge,Ke.value)):(it=Math.max(it,Ke.value),Je=Math.min(Je,Ke.value)),Ke})}),xe=JSON.parse(JSON.stringify(D)),Y.chartData=Ee,Y.legendList=Re,Y.yMaxLeft=it,Y.yMinLeft=Je>0?0:Je,Y.yMaxRight=Ze,Y.yMinRight=Ge>0?0:Ge,He=t?gt(e.xAxisLabel.xAxisNumberFormat,Y.dimensionList).map(Ne=>Ne):Y.dimensionList,Y.dimensionList.forEach((Ne,Ue)=>{Y.formattedDimensionListMap.set(Ne,He[Ue])}),e.plotArea.fitChart?ve=Y.dimensionList:ve=Y.dimensionList.slice(ye,ye+ee),e.plotArea.hideZeroValues&&(Y.hideZeroValues=!0),v(ke,ce,me,Ve,D)},v=(Re,He,it,Je,Ze)=>{const Ge=pt(ve,Re,!1),Ee=pt(ve,it,!1),Ne=pt(ve,He,!1),Ue=pt(ve,Je,!1);Fe=[];const xt=[];if(Re.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ge,data:Re})}),it.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ee,data:it})}),He.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ne,data:He})}),Je.forEach(Ke=>{xt.push({properties:{axis:Ke.properties.axis,type:Ke.properties.type,legend:Ke.properties.legend,annotation:Ke.properties.annotation,alias:Ke.properties.alias},stackData:Ue,data:Je})}),xt.push(...Y.chartData),Ze.length){const Ke=[];Ze.forEach(xi=>{Ke.push(...xt.filter(ol=>ol.properties?.type===xi.properties.type&&ol.properties.legend===xi.legend))}),Fe.push(...Ke)}else Fe.push(...xt)},F=()=>{ie=T.scaleLinear().domain([Y.yMinLeft>=0?V!==void 0&&!Number.isNaN(V)?V:0:Y.yMinLeft<0?Y.yMinLeft*1.1:Y.yMinLeft*.9,Y.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:Y.yMaxLeft*1.1]).range([a>0?d-a:d,0]),J&&(Q=T.scaleLinear().domain([Y.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:Y.yMinRight*1.1,Y.yMaxRight<=0?(X||X==0)&&!Number.isNaN(X)?X:0:(X||X==0)&&!Number.isNaN(X)?X:Y.yMaxRight*1.1]).range([a>0?d-a:d,0])),we=[0,c]},z=()=>{ge=T.scaleBand().domain(Y.legendList).range([0,A]).paddingInner(Y.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),Ae=T.scalePoint().domain(ve).range(we).padding(.5)},R=()=>{{let Re=st(N||Y.yMaxLeft,Y.yMinLeft,d,e,Y,V,N);de=T.axisLeft(ie).tickFormat(He=>_e(He,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,c)).tickValues(Re.autoLabelFlag?void 0:Re.yAxisLabelArray).ticks(Re.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(J){let Re=st(N||Y.yMaxRight,Y.yMinRight,d,e,Y,V,N);Ce=T.axisRight(Q).tickFormat(He=>_e(He,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Re.autoLabelFlag?void 0:Re.yAxisLabelArray).ticks(Re.customTickValue??d/30).tickSize(Pt(e,c)).tickPadding(8).tickSizeOuter(0)}},E=()=>{Pe=T.axisBottom(Ae).tickSize(ia(e,d,a,!0)).tickSizeOuter(0).tickValues(Lt(ve,c))},k=Re=>{Re.forEach(Je=>{switch(Je.properties.type){default:case le.ColumnChart:M(Je);break;case le.LineChart:break;case le.AreaChart:break;case le.StackColumnChart:Ye=ut(Je),Se();break;case le.StackAreaChart:te=ut(Je),B(Je);break}});const He=xe.filter(Je=>Je.properties.type===le.LineChart);He.length&&G(He);const it=xe.filter(Je=>Je.properties.type===le.AreaChart);it.length&&Z(it),P.selectAll(".parentGroup").raise()},M=Re=>{let He=P.selectAll(".parentGroup").data([Re],Ee=>Ee.properties?.legendUniqueId);He=He.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(He);let it=He.selectAll(".column-group").data(Re.data,Ee=>Ee.legendUniqueId),Je=it.enter().append("g").attr("class","column-group").attr("hoverId",Ee=>(Re.properties.alias||Re.properties.name).includes("-")?(Re.properties.alias||Re.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(Re.properties.alias||Re.properties.name).replace(/ /g,"-")).attr("transform",Ee=>`translate(${Ae(Ee.dimension)}, 0)`);Je.merge(it).attr("transform",Ee=>`translate(${Ae(Ee.dimension)-A/2}, 0)`);const Ze=Je.append("rect").attr("x",Ee=>ge(Ee.legendUniqueId)).attr("width",ge.bandwidth()).attr("y",Ee=>(Re.properties.axis===at.primary?ie:Q)(0)).attr("height",0).attr("fill",Re.properties.color).attr("stroke-dasharray",Ee=>Re.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ee=>`${Re.properties.stackBorderWidth}px`).attr("stroke",Ee=>Re.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Re.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ee=>Ee.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>Re.properties.legendUniqueId).attr(Qe.DimValue,Ee=>Array.isArray(Ee.dimension)?String(Ee.dimension[0]):String(Ee.dimension)).on("mousemove",(Ee,Ne)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Y.formattedDimensionListMap.get(Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(b)?Ne[1]-Ne[0]:Ne.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.legend.includes("~$~")?Ne.legend.split("~$~")[1]:Ne.legend}],e,Ee,D.filter(Ue=>Ue.legend===Ne.legend)[0].properties,(()=>{const Ue=Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension,xt=D.filter(Ke=>Ke.legend===Ne.legend)[0].properties;return ht(x,String(Ue??""),{...xt,formattedDimensionValue:String(Y.formattedDimensionListMap.get(Ue)??Ue??"")})})())}).on("mouseout",rt).on("click",At(H,g,(Ee,Ne)=>({seriesId:Re.properties.legendUniqueId,dimValue:Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension),legendUniqueId:Re.properties.legendUniqueId,seriesDisplayName:Re.properties.alias||Re.properties.name||""})));(e.animation.animationEnabled?Ze.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ze).attr("y",Ee=>{const Ne=Re.properties.axis===at.primary?ie:Q;return Ee.value>0?Ne(Ee.value):Ne(0)}).attr("height",Ee=>{const Ne=Re.properties.axis===at.primary?ie:Q;return Math.abs(Ne(Ee.value)-Ne(0))}),it.exit().remove()},G=Re=>{Re.forEach(Ge=>{Ge.data.forEach(Ee=>{Ee.hideZero=Ge.properties.hideZeroValues,Ee.axis=Ge.properties.axis,Ee.legendUniqueId=Ge.properties.legendUniqueId})});const He=T.line().x(Ge=>Ae(Ge.dimension)?Ae(Ge.dimension):null).y(Ge=>Ge.axis==at.primary?ie(Ge.value):Q(Ge.value)).defined(Ge=>e?.plotArea?.hideZeroValues?!!Ge.value:!0).curve(Ot(e));let it=P.selectAll(".lines.parentGroup").data([1]);it=it.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(it);let Je=it.selectAll(".line-group").data(Re,Ge=>Ge.properties.legendUniqueId),Ze=Je.enter().append("g").attr("class","line-group");Ze.attr("hoverId",Ge=>(Ge.properties.alias||Ge.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Ze.merge(Je).select("path").attr("d",Ge=>He(Ge.data)).attr("stroke",Ge=>Ge.properties.color!==De.white?Ge.properties.color:"none").attr("stroke-dasharray",Ge=>{switch(Ge.properties.lineStyle){case yt.dotted:return"0,3";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",Ge=>Ge.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",Ge=>Ge.properties.lineStyle!=="None"?Ge.properties.lineWidth:"0"),e.animation.animationEnabled&&Ze.merge(Je).select("path").each(function(){const Ge=T.select(this),Ee=this.getTotalLength();Ge.attr("stroke-dasharray",Ee+" "+Ee).attr("stroke-dashoffset",Ee),Ge.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Je.exit().remove(),Ca(it,Re,le.CombinationLine,Ae,ie,Q,null,e,Y,X,$,V,N,!1,x)},Z=Re=>{Re.forEach(Ue=>{Ue.data.forEach(xt=>{xt.hideZero=Ue.properties.hideZeroValues,xt.axis=Ue.properties.axis,xt.legendUniqueId=Ue.properties.legendUniqueId})});const He=T.area().x(Ue=>Ae(Ue.dimension)?Ae(Ue.dimension):null).y0(Ue=>ie(0)).y1(Ue=>ie(Ue.value)).defined(Ue=>Ue.hideZero?!!Ue.value:!0).curve(Ot(e)),it=T.area().x(Ue=>Ae(Ue.dimension)?Ae(Ue.dimension):null).y0(()=>ie(0)).y1(()=>ie(0)).defined(Ue=>Ue.hideZero?!!Ue.value:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=P.selectAll(".areas.parentGroup").data([1]),Ge=P.append("g").attr("class","focusClass");Ze=Ze.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(Ze);let Ee=Ze.selectAll(".area-group").data(Re,Ue=>Ue.legend),Ne=Ee.enter().append("g").attr("class","area-group");Ne.append("path").attr("hoverId",Ue=>(Ue.properties.alias||Ue.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ue=>Ue.properties.color!==De.white?Ue.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",Ue=>Je?it(Ue.data):He(Ue.data)).each(function(Ue){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Ue.data))}),Ee.select("path").attr("d",Ue=>He(Ue.data)),Ne.merge(Ee).select("path").attr("stroke",Ue=>Ue.properties.areaBorderColor!==De.white?Ue.properties.areaBorderColor:"none").attr("stroke-dasharray",Ue=>{switch(Ue.properties.lineStyle){case"dotted":return"0,3";case"dashed":return ba;default:return""}}).attr("stroke-linecap",Ue=>Ue.properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",Ue=>Ue.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?Ue.properties.lineWidth:"0"),di(e,Ze,Ge,ve,Re,Ae,ie,b),Ee.exit().remove(),Ca(Ze,Re,le.CombinationArea,Ae,ie,Q,null,e,Y,X,$,V,N)},B=Re=>{Re.data.forEach(Ne=>{Ne.data.forEach(Ue=>{Ue.hideZero=Ne.properties.hideZeroValues,Ue.axis=Ne.properties.axis,Ue.legendUniqueId=Ne.properties.legendUniqueId})});const He=T.area().x(Ne=>Ae(Ne.data.dimension)?Ae(Ne.data.dimension):null).y0(Ne=>Ne.data.axis===at.primary?ie(Ne[0]):Q(Ne[0])).y1(Ne=>Ne.data.axis===at.primary?ie(Ne[1]):Q(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(Ot(e)),it=T.area().x(Ne=>Ae(Ne.data.dimension)?Ae(Ne.data.dimension):null).y0(()=>ie(0)).y1(()=>ie(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(Ot(e)),Je=e.animation.animationEnabled;let Ze=P.selectAll(".parentGroup").data([te]);P.append("g").attr("class","focusClass"),Ze=Ze.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(Ze);let Ge=Ze.selectAll(".area-group").data(Ne=>Ne),Ee=Ge.enter().append("g").attr("class",Ne=>"area-group "+Ne.key.replace(/ /g,"-"));Ee.append("path").attr("hoverId",Ne=>(Re.data.filter(Ue=>Ue.legend===Ne.key)[0].properties.alias||Re.data.filter(Ue=>Ue.legend===Ne.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ne=>Ne.color!==De.white?Ne.color:"none").attr("d",Ne=>Je?it(Ne):He(Ne)).each(function(Ne){Je&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",He(Ne))}),Ge.select("path").attr("d",Ne=>He(Ne)),Ee.merge(Ge).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ne=>Ne.color!==De.white?Ne.color:"none").attr("stroke-dasharray",(Ne,Ue)=>D[Ue].properties.lineStyle==="dotted"?"0,3":D[Ue].properties.lineStyle==="dashed"?ba:"").attr("stroke-linecap",(Ne,Ue)=>D[Ue].properties.lineStyle==="dotted"?sa.round:"").attr("stroke-width",(Ne,Ue)=>D[Ue].properties.lineStyle!=="None"?D[Ue].properties.lineWidth:"0"),Ge.exit().remove(),Ca(Ze,Re.data,le.CombinationStackArea,Ae,ie,Q,null,e,Y,X,$,V,N)},Se=()=>{let Re=P.selectAll(".parentGroup").data([Ye]);Re=Re.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(Re);let He=Re.selectAll(".stackcolumns-group").data(Ee=>Ee);He=He.enter().append("g").attr("class",Ee=>"stackcolumns-group ").merge(He);let Je=He.selectAll("rect").data(Ee=>Ee);Je.attr("y",Ee=>Ee.data.axis===at.primary?ie(Ee[1]):Q(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?N&&Ee[1]>N?ie(Ee[0])-ie(N):ie(Ee[0])-ie(Ee[1]):X&&Ee[1]>X?Q(Ee[0])-Q(X):Q(Ee[0])-Q(Ee[1]));const Ze=Je.enter().append("rect").attr("transform",Ee=>`translate(${Ae(Ee.data.dimension)-A/2},0)`).attr("y",Ee=>Ee.data.axis===at.primary?ie(0):Q(0)).attr("height",0);Ze.merge(Je).attr("hoverId",Ee=>Ee.alias.includes("~$~")?Ee.alias.split("~$~")[1].replace(/ /g,"-"):Ee.alias.replace(/ /g,"-")).attr("x",Ee=>ge(le.StackColumnChart)).attr("width",ge.bandwidth()).attr("fill",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(Ke=>Ke.legend===Ee.key);return D[xt]?.properties?.color||"gray"}).attr("stroke",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(xi=>xi.legend===Ee.key),Ke=D[xt]?.properties;return Ke?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Ke.stackBorderColor:"none"}).attr("stroke-dasharray",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(Ke=>Ke.legend===Ee.key);return D[xt]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ee,Ne,Ue)=>{const xt=Array.from(D).findIndex(Ke=>Ke.legend===Ee.key);return(D[xt]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ee,Ne)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Y.formattedDimensionListMap.get(Ne.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:_e(Ne.data[Ne.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.key.includes("~$~")?Ne.key.split("~$~")[1]:Ne.key}],e,Ee,D.filter(Ue=>Ue.legend===Ne.key)[0].properties,(()=>{const Ue=D.filter(xt=>xt.legend===Ne.key)[0].properties;return ht(x,String(Ne.data.dimension??""),{...Ue,formattedDimensionValue:String(Y.formattedDimensionListMap.get(Ne.data.dimension)??Ne.data.dimension??"")})})())}).on("mouseout",rt).attr(Qe.SeriesId,Ee=>Ee.key??"").attr(Qe.DimValue,Ee=>Array.isArray(Ee.data.dimension)?String(Ee.data.dimension[0]):String(Ee.data.dimension)).on("click",At(H,g,(Ee,Ne)=>({seriesId:Ne.key??"",dimValue:Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension),legendUniqueId:Ne.key??"",seriesDisplayName:Ne.alias||Ne.key||""}))),(e.animation.animationEnabled?Ze.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ze).attr("y",Ee=>Ee.data.axis===at.primary?ie(Ee[1]):Q(Ee[1])).attr("height",Ee=>Ee.data.axis===at.primary?N&&Ee[1]>N?ie(Ee[0])-ie(N):ie(Ee[0])-ie(Ee[1]):X&&Ee[1]>X?Q(Ee[0])-Q(X):Q(Ee[0])-Q(Ee[1])),He.exit().remove()},ze=Re=>{c=i-Re.left-Re.right,d=y-Re.bottom-Re.top},Ie=(Re,He,it)=>{xe=He,ve=Re,ee=it,Oe(r,Me,ve),v(ke,ce,me,Ve,He),xe=JSON.parse(JSON.stringify(Fe)),xe.forEach((Je,Ze)=>{Je.properties.type===le.StackColumnChart||Je.properties.type===le.StackAreaChart?Je.data.forEach((Ge,Ee)=>xe[Ze].data[Ee].data=Ge.data.filter(Ne=>ve.includes(Ne.dimension))):xe[Ze].data=Je.data.filter(Ge=>ve.includes(Ge.dimension))}),lt()};function Oe(Re,He,it){He.clear(),it&&it.length>0&&it.forEach(Je=>{He.set(Je,0)}),Re.ChartData&&Re.ChartData.length>0&&Re.ChartData.forEach(Je=>{Je.properties.type.includes("Stack")&&Je.data.forEach((Ze,Ge)=>{if(He.has(Ze.dimension)){let Ee=He.get(Ze.dimension)||0;Ee+=Ze.value||0,He.set(Ze.dimension,Ee)}})})}const lt=()=>{z(),E(),k(xe),qt(P,Y,oe,e,a,ie,Pe,pe,y,A,t,c,d,ve,Ae);const Re=()=>{Pl(xe,Ae,ie,Q,se,dt,Ye,te,[],[],A,e,y,i,c,ve,d,L,m,h,ge,o),qa(Me,Ae,ie,se,dt,[],e,b,y,i,m,o)};ta(e.plotArea.fitChart,m,P,f,A,ie,Ae,ge,void 0,void 0,a,b,e,re,he,Y.dimensionList,c,we,Y.formattedDimensionListMap,L,se,d),m.selectAll(".annotation-group").remove(),Re()},ut=Re=>{let He=Re.data.map(Je=>Je.legend);S=T.stack().keys(He).offset(T.stackOffsetNone)(Re.stackData),Re.data.forEach((Je,Ze)=>Je.data.forEach((Ge,Ee)=>{Ge[0]=S[Ze][Ee][0],Ge[1]=S[Ze][Ee][1]}));let it=e.annotation.annotationSetLabelColor;return S.forEach((Je,Ze)=>{Je.forEach(Ge=>{Ge.key=Je.key,Ge.alias=Re.data[Ze].properties.alias,Je.alias=Re.data[Ze].properties.alias,Je.color=JSON.parse(JSON.stringify(Re.data[Ze].properties.color)),Je.individualAnnotationVisibility=JSON.parse(JSON.stringify(Re.data[Ze].properties.annotation)),Ge.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?Re.data[Ze].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),Ge.data.labelColor=it=="2"?JSON.parse(JSON.stringify(Re.data[Ze].properties.color)):JSON.parse(JSON.stringify(Re.data[Ze].properties.labelColor)),Ge.hideZero=JSON.parse(JSON.stringify(Re.data[Ze].properties.hideZeroValues)),Ge.data.axis=JSON.parse(JSON.stringify(Re.data[Ze].properties.axis)),Ge.data.color=JSON.parse(JSON.stringify(Re.data[Ze].properties.color)),Ge.data.legend=Re.properties.type,Ge.data.type=JSON.parse(JSON.stringify(Re.data[Ze].properties.type))})}),S},tt=()=>{if(fe.length>0){const He=(ce.length>0?pt(ve,ce,!1):pt(ve,ke,!1)).map(it=>it.total);Y.yMaxLeft=Math.max(Y.yMaxLeft,...He),Y.yMinLeft=Math.min(Y.yMinLeft,...He)}if(ae.length>0){const He=(Ve.length>0?pt(ve,Ve,!1):pt(ve,me,!1)).map(it=>it.total);Y.yMaxRight=Math.max(Y.yMaxRight,...He),Y.yMinRight=Math.min(Y.yMinRight,...He)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:_,id:L,style:{width:"100%",height:"100%"}})})},Kl=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.LayeredColumnChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1,j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText);let V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we=[];const fe=new Map;let ae=0,ke=2,ce=!1,me={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ve()}catch(ye){be("LayeredColumnchart","createLayeredColumnChart",ye)}},[e]);const Ve=()=>{({formatOptions:e,svg:y,width:C,height:c}=kt(S,e)),Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:q,customYaxisMaxValue:U,secondaryCustomYaxisMaxValue:V}=Nt(e,me.yMinLeft,me.yMaxLeft,me.yMinRight,me.yMaxRight),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:A,scrollbarVisible:ce}=Tt(C,c,O,q,me.yMaxLeft,e,me.legendList,me.dimensionList,me.yMaxRight,j,K,t,!1,me),ve(N),{dataTable:d,dataTableHeight:i}=ea(e,$,se,g,me.dimensionList,r),vt(y,C,c,e),f=Ct(y,N),mt(f,e,i,w,p,u,L),te(),Pe(),Gt(f,e,i,$,Q,p),Mt(e,D,y,N,X,c,re,me.chartType,$,w,p),St(p,e,i,D,y,N,se,$),Ut(y,j,N,e,i,p,w,ue,Le),Ft(y,e,C,he),Dt(c,y,oe,he,C,pe,e,g,L,i,N,nt.rectangle,u,n),Bt(g,c,C,y,N,w,ce,ke,me,ae,!1,Fe)},Ye=()=>{const ye=[],ee=[];let Y=[],W=-1/0,I=1/0,v=-1/0,F=1/0,z=-1/0,R=1/0;g.forEach(E=>{ee.push(E.properties.legendUniqueId),z=-1/0,R=1/0,E.data.forEach(k=>{ye.push(k),z=Math.max(z,k.value),R=Math.min(R,k.value),W=Math.max(W,k.value),I=Math.min(I,k.value)}),E.properties.setColorScale&&fe.set(E.properties.legendUniqueId,T.scaleSequential().domain([R,z]).interpolator(T.interpolateRgb(E.properties.startColor,E.properties.endColor)))}),me.chartData=ye,me.legendList=ee,me.yMaxLeft=W,me.yMinLeft=I>0?0:I,me.yMaxRight=v,me.yMinRight=F>0?0:F,Y=t?gt(e.xAxisLabel.xAxisNumberFormat,me.dimensionList).map(E=>E):me.dimensionList,me.dimensionList.forEach((E,k)=>{me.formattedDimensionListMap.set(E,Y[k])}),we=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ge=me.dimensionList:ge=me.dimensionList.slice(ae,ae+ke),e.plotArea.hideZeroValues&&(me.hideZeroValues=!0)},te=()=>{let ye=st(U||me.yMaxLeft,me.yMinLeft,p,e,me,J,U).yAxisLabelArray;me.yMaxLeft=ye[ye.length-1],me.yMinLeft=ye[0],a=T.scaleLinear().domain([me.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:me.yMinLeft<0?me.yMinLeft*1.1:me.yMinLeft*.9,me.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:me.yMaxLeft*1.1]).range([i>0?p-i:p,0]),ie=[0,w]},de=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(me.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ge).range(ie).padding(.5)},Pe=()=>{Ce();{let ye=st(U||me.yMaxLeft,me.yMinLeft,p,e,me,J,U);Q=T.axisLeft(a).tickFormat(ee=>_e(ee,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,w)).tickValues(ye.autoLabelFlag?void 0:ye.yAxisLabelArray).ticks(ye.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ce=()=>{Ae=T.axisBottom(P).tickSize(ia(e,p,i)).tickSizeOuter(0).tickValues(Lt(ge,w))},Me=ye=>{ye.forEach(ee=>{ee.data.forEach(Y=>{Y.hideZero=ee.properties.hideZeroValues,Y.properties=ee.properties,Y.axis=ee.properties.axis})}),ye.forEach((ee,Y)=>{let W=f.selectAll(`.parentGroup-${ee.properties.legendUniqueId}`).data([ee],R=>R.properties.legendUniqueId);W=W.enter().append("g").attr("class",`column parentGroup parentGroup-${ee.properties.legendUniqueId}`).attr("clip-path",`url(#${L}-clip)`).merge(W);let I=W.selectAll(".column-group").data(ee.data,R=>R.dimension+"_"+ee.properties.legendUniqueId),v=I.enter().append("g").attr("class","column-group").attr("hoverId",(ee.properties.alias||ee.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",R=>Y===0?`translate(${P(R.dimension)-A/2}, 0)`:`translate(${P(R.dimension)-A/(2+Y*2)}, 0)`);I.attr("transform",R=>Y===0?`translate(${P(R.dimension)-A/2}, 0)`:`translate(${P(R.dimension)-A/(2+Y*2)}, 0)`),v.merge(I).attr("transform",R=>Y===0?`translate(${P(R.dimension)-A/2}, 0)`:`translate(${P(R.dimension)-A/(2+Y*2)}, 0)`);const F=v.append("rect").attr("x",()=>0).attr("width",Y===0?A:A/2+Y*2).attr("y",R=>(ee.properties.axis===at.primary?a:m)(0)).attr("height",0).attr("fill",R=>fe.get(ee.properties.legendUniqueId)?.(R.value)??ee.properties.color).attr("stroke-dasharray",()=>ee.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${ee.properties.stackBorderWidth}px`).attr("stroke",()=>ee.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ee.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",R=>R.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>ee.properties.legendUniqueId).attr(Qe.DimValue,R=>Array.isArray(R.dimension)?String(R.dimension[0]):String(R.dimension));(e.animation.animationEnabled?F.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):F).attr("y",R=>{const E=ee.properties.axis===at.primary?a:m;return R.value>0?E(R.value):E(0)}).attr("height",R=>{const E=ee.properties.axis===at.primary?a:m;return Math.abs(E(R.value)-E(0))}),I.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("y",R=>{const E=ee.properties.axis===at.primary?a:m;return R.value>0?E(R.value):E(0)}).attr("height",R=>{const E=ee.properties.axis===at.primary?a:m;return Math.abs(E(R.value)-E(0))}),v.merge(I).on("mousemove",(R,E)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:me.formattedDimensionListMap.get(Array.isArray(E.dimension)?E.dimension[0]:E.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():E.properties?.currentMeasure?E.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||E.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?E[1]-E[0]:E.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:E.properties.alias}],e,R,E.properties,(()=>{const M=Array.isArray(E.dimension)?E.dimension[0]:E.dimension;return ht(x,String(M??""),{...E.properties,formattedDimensionValue:String(me.formattedDimensionListMap.get(M)??M??"")})})());let k=(ee.properties.alias||ee.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+k+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(R,E)=>{let k=(ee.properties.alias||ee.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+k+'"]').classed("highlight",!1).classed("unhighlight",!1),rt()}),v.merge(I).on("click",At(_,b,(R,E)=>({seriesId:ee.properties.legendUniqueId,dimValue:Array.isArray(E.dimension)?String(E.dimension[0]):String(E.dimension),legendUniqueId:ee.properties.legendUniqueId,seriesDisplayName:ee.properties.alias||ee.properties.name||""}))),I.exit().remove()}),f.selectAll(".parentGroup").raise()},ve=ye=>{w=C-ye.left-ye.right,p=c-ye.bottom-ye.top},xe=()=>{de(),Ce(),qt(f,me,X,e,i,a,Ae,oe,c,A,t,w,p,ge,P),Me(we),Da(g,P,a,void 0,N,dt,[],[],e,u,c,C,w,ge,p,L,y,h,void 0,A,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,d,A,a,P,void 0,void 0,void 0,i,le.ColumnChart,e,$,se,me.dimensionList,w,ie,me.formattedDimensionListMap,L,N,p))},Fe=(ye,ee,Y)=>{we=ee,ge=ye,ke=Y,xe()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},Ql=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID();let A=0,u=!1;const S=le.StackColumnChart,b=Te.useRef(),_=Te.useRef(s);_.current=s;const g=Te.useRef(x);g.current=x;const H=r.DimensionList,D=(bt(r.ChartData,r.DimensionList)||[]).reverse(),j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P;const ie=new Map;let Q,Ae,ge,we=[],fe=0,ae,ke=[],ce=new Map;const me=!1;let Ve={dimensionList:H,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ye()}catch(v){be("StackStackColumnchart","createStackColumnChart",v)}},[e]);const Ye=()=>{({formatOptions:e,svg:i,width:p,height:C}=kt(b,e)),te(),{formatOptions:e}=Qt(e,D,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,Ve.yMinLeft,Ve.yMaxLeft,Ve.yMinRight,Ve.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe,visibleBars:ae,columnWidth:A,scrollbarVisible:u}=Tt(p,C,ue,O,Ve.yMaxLeft,e,Ve.legendList,Ve.dimensionList,Ve.yMaxRight,K,me,t,!1,Ve),xe(V),{dataTable:c,dataTableHeight:d}=ea(e,N,X,D,Ve.dimensionList,r),vt(i,p,C,e),y=Ct(i,V),mt(y,e,d,q,w,S,L),de(),Ce(),Gt(y,e,d,N,Q,w),Mt(e,j,i,V,$,C,se,Ve.chartType,N,q,w),St(w,e,d,j,i,V,X,N),Ut(i,K,V,e,d,w,q,pe,he),Ft(i,e,p,oe),Dt(C,i,re,oe,p,Le,e,[...D].reverse(),L,d,V,nt.rectangle,S,n),Bt(D,C,p,i,V,q,u,ae,Ve,fe,!1,Fe)},te=()=>{const v=[],F=[];let z=-1/0,R=1/0;D.forEach((B,Se)=>{const ze=`${Se}~$~${B.properties.legend}`;B.properties.legend=ze,F.push(ze),z=-1/0,R=1/0;for(const Ie of B.data)z=Math.max(z,Ie.value),R=Math.min(R,Ie.value),v.push(Ie);B.properties.setColorScale&&ie.set(B.properties.legendUniqueId,T.scaleSequential().domain([R,z]).interpolator(ii.interpolateRgb(B.properties.startColor,B.properties.endColor)))}),Ve.chartData=v,Ve.legendList=F,we=JSON.parse(JSON.stringify(D));let E=pt(Ve.dimensionList,D,me);ge=Ve.dimensionList;const k=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(E);ee();let M=1/0,G=-1/0;for(const B of k)for(const[Se,ze]of B)M=Math.min(M,Se),G=Math.max(G,ze);Ve.yMinLeft=M>0?0:M,Ve.yMaxLeft=G;let Z=t?gt(e.xAxisLabel.xAxisNumberFormat,Ve.dimensionList).map(B=>B):Ve.dimensionList;Ve.dimensionList.forEach((B,Se)=>{Ve.formattedDimensionListMap.set(B,Z[Se])}),e.plotArea.hideZeroValues&&(Ve.hideZeroValues=!0)},de=()=>{f=T.scaleLinear().domain([Ve.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:Ve.yMinLeft<0?Ve.yMinLeft*1.1:Ve.yMinLeft*.9,Ve.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:Ve.yMaxLeft*1.1]).range([d>0?w-d:w,0]),P=[0,q]},Pe=()=>{m=T.scalePoint().domain(ge).range([0,q]).padding(.5)},Ce=()=>{{const v=st(U||Ve.yMaxLeft,Ve.yMinLeft,w,e,Ve,J,U);Q=T.axisLeft(f).tickFormat(F=>_e(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,q)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Me=()=>{Ae=T.axisBottom(m).tickSize(ia(e,w,d,!0)).tickSizeOuter(0).tickValues(Lt(ge,q))},ve=v=>{v.forEach(Z=>{Z.data.forEach(B=>{B.hideZero=Z.properties.hideZeroValues,B.axis=Z.properties.axis})}),ge.forEach(Z=>{y.append("rect").attr("id",`dim-background-${Z}`).attr("class","dimension-background").attr("x",m(Z)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",w).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let F=y.selectAll(".parentGroup").data([ke]);F=F.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(F);let z=F.selectAll(".column-group").data(Z=>Z);z=z.enter().append("g").attr("class",Z=>"column-group "+Z.key.replace(/ /g,"-")).attr("hoverId",Z=>Z[0]?.properties.alias?Wa(Z[0]?.properties.alias):Wa(Z.key)).merge(z);let E=z.selectAll("rect").data(Z=>Z);const k=(Z,B)=>{const Se=Array.from(z.nodes()).indexOf(Z[B].parentNode);return{props:D[Se]?.properties,groupIndex:Se}},M=E.enter().append("rect").merge(E).attr("x",Z=>m(Z.data.dimension)-A/2).attr("width",A).attr("y",Z=>f(0)).attr("height",0).attr("fill",(Z,B,Se)=>{const{props:ze}=k(Se,B);return ie.get(ze.legendUniqueId)?.(Z.data[Z.key])??ze?.color??"gray"}).attr("stroke",(Z,B,Se)=>{const{props:ze}=k(Se,B);return ze?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ze.stackBorderColor:"none"}).attr("stroke-dasharray",(Z,B,Se)=>{const{props:ze}=k(Se,B);return ze?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Z,B,Se)=>{const{props:ze}=k(Se,B);return(ze?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(Z,B,Se)=>{const{props:ze}=k(Se,B);return Z.data[Z.key]==0&&ze?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,Z=>Z.key??"").attr(Qe.DimValue,Z=>Array.isArray(Z.data.dimension)?String(Z.data.dimension[0]):String(Z.data.dimension)).on("mousemove",(Z,B)=>{const Se=String(Ve.formattedDimensionListMap.get(B.data.dimension)??B.data.dimension??""),ze=ht(l,String(B.data.dimension??""),{...B.properties,formattedDimensionValue:Se});ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Ve.formattedDimensionListMap.get(B.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():B.properties?.currentMeasure?B.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||B.value,value:_e(B.data[B.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:B.properties.alias}],e,Z,B.properties,ze)}).on("mouseout",(Z,B)=>{rt()}).on("click",At(g,_,(Z,B)=>({seriesId:B.key??"",dimValue:Array.isArray(B.data.dimension)?String(B.data.dimension[0]):String(B.data.dimension),legendUniqueId:B.key??"",seriesDisplayName:B.properties?.alias||B.key||""})));(e.animation.animationEnabled?M.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):M).attr("y",Z=>Z[1]>=Z[0]?f(Z[1]):f(Z[0])).attr("height",Z=>Math.abs(f(Z[0])-f(Z[1]))),z.exit().remove(),y.selectAll(".parentGroup").raise()},xe=v=>{q=p-v.left-v.right,w=C-v.bottom-v.top},Fe=(v,F,z)=>{we=F,ge=v,ae=z,Ka(r,ce,ge),ye()},ye=()=>{Pe(),Me(),qt(y,Ve,$,e,d,f,Ae,re,C,A,t,q,w,ge,m),ee();const v=new Map;ge.forEach((F,z)=>{let R=0;ke.forEach(E=>{const k=E[z]?.[0]??0;k<R&&(R=k)}),v.set(F,R)}),ve(we),Va(ke,m,f,a,V,dt,[],[],e,S,C,p,q,ge,w,L,i,h,d,o),qa(ce,m,f,V,dt,[],e,S,C,p,i,o,!1,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,c,A,f,m,void 0,void 0,void 0,d,S,e,N,X,ge,q,P,Ve.formattedDimensionListMap,L,V,w)),Y()},ee=()=>{let v=pt(ge,we,me);ke=T.stack().keys(Ve.legendList).offset(T.stackOffsetDiverging)(v),we.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=ke[R][k][0],E[1]=ke[R][k][1]}));let F=e.annotation.annotationSetLabelColor;ke.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(D[R].properties.color)),E.data.labelPosition=D[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(D[R].properties.color)):D[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(D[R].properties.hideZeroValues)),E.properties=D[R].properties}))},Y=()=>{try{const v=e?.connector,F=Number(v?.connectorVisibility);if(!v||F===2)return;let z,R=[];F===1?z=1:F===3&&(Number(v.connectorFollow)===1?z=Number(v.connectorStepSize)||void 0:Number(v.connectorFollow)===2&&(R=v.connectorExclude??[],z=1));const E=(R||[]).map(B=>String(B).split("-")[0]),k=(ke[0]??[]).map((B,Se)=>({Dimension:B.data.dimension,Total:B.data.total,CustomTotal:B.data.total,Index:Se})),M=[],G=[];let Z=[];if(z){if(z===1)M.push(...k);else for(const B of k)B.Index%z===0&&M.push(B);for(let B=z;B<k.length;B+=z){const Se=Math.min(B+z,k.length);let ze=k[B]?.Total??Number.NEGATIVE_INFINITY;for(let Ie=B;Ie<Se;Ie++)k[Ie].Total>ze&&(ze=k[Ie].Total);Number.isFinite(ze)&&G.push(ze)}Z=M.slice(1)}else{const B=v.connectorCustomRange??[],Se=new Map;k.forEach(ze=>Se.set(String(ze.Dimension),ze.Index));for(const ze of B){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.from)),Oe=Se.get(String(ze.to));if(Ie!=null&&Oe!=null){M.push(k[Ie]);const lt=Math.min(Ie,Oe),ut=Math.max(Ie,Oe);let tt=k[lt]?.Total??Number.NEGATIVE_INFINITY;for(let Re=lt;Re<=ut;Re++)k[Re].Total>tt&&(tt=k[Re].Total);Number.isFinite(tt)&&G.push(tt)}}for(const ze of B){if(!ze?.from||!ze?.to)continue;const Ie=Se.get(String(ze.to));Ie!=null&&Z.push(k[Ie])}}y.selectAll("defs > #arrow").remove(),y.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",v.connectorMarkerColor!==De.white?v.connectorMarkerColor:"none"),W(M,G,Z,z,E),I(M,G,Z,z,E)}catch{}},W=(v,F,z,R,E)=>{try{const k=v.filter((B,Se)=>R!=null?Se<v.length-1:Se<v.length);let M=y.selectAll("path.connector-path").data(k,B=>String(B.Dimension));M.exit().remove(),M.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(B,Se)=>e.total.totalVisibility?`M ${m(B.Dimension)+m.bandwidth()/2+5}, ${f(B.Total)-25} V ${-35+Math.min(f(F[Se]),f(z[Se].Total),f(B.Total))} H ${m(z[Se].Dimension)+m.bandwidth()/2-10} V ${-27+f(z[Se].Total)}`:`M ${m(B.Dimension)+m.bandwidth()/2+5}, ${f(B.Total)-5} V ${-30+Math.min(f(z[Se].Total),f(B.Total))} H ${m(z[Se].Dimension)+m.bandwidth()/2-10} V ${-10+f(z[Se].Total)}`).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",B=>E.includes(B.Dimension)||B.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},I=(v,F,z,R,E)=>{try{let k,M=e.connector.connectorFontStyle,G=e.connector.connectorNumberFormat,Z=q/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(G=".2s");const B=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Se=mi(B,A),ze=Se*(typeof m.padding=="function"?m.padding():0),Ie=v.map((tt,Re)=>({d:tt,i:Re})).filter(tt=>R!=null?tt.i<v.length-1:tt.i<v.length);let Oe=y.selectAll("text.connector-text").data(Ie,tt=>String(tt.d.Dimension));Oe.exit().remove(),Oe.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(Oe).attr("x",tt=>{const Re=tt.d,He=tt.i,it=z[He];return m(it.Dimension)-Se*R/2}).attr("y",tt=>{const Re=tt.d,He=tt.i,it=F[He],Je=z[He],Ze=Math.min(f(Je?.Total??0),f(Re.Total));return e.total.totalVisibility?Z<8?-40+Ze:-41+Ze:Z<8?-35+Ze:-40+Ze}).style("text-anchor","middle").text(tt=>{const Re=tt.d,He=tt.i;return z[He]?(Re.CustomTotal==0&&z[He].CustomTotal!=0&&(Re.CustomTotal=1),ui(z[He].Total,Re.Total,parseInt(e.connector.connectorDecimalPrecision),G,parseInt(Re.Dimension),parseInt(z[He].Dimension),e)):""}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",M.includes("Italic")?"Italic":"").style("text-decoration",M.includes("Underline")?"Underline":"").style("font-weight",M.includes("Bold")?"Bold":"").style("visibility",tt=>{const Re=tt.d;return E.includes(Re.Dimension)||Re.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:b,id:L,style:{width:"100%",height:"100%"}})})},Ol=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.NormalizedStackColumnChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList).reverse(),H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U,V,N,$,X,se,re,oe,he,Le,pe,ue,O=!1,q,w,p,C,c,d,i,y,f,a,m,P;const ie=new Map;let Q,Ae,ge,we=[],fe=0,ae=0,ke=[];const ce=!0;let me={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ve()}catch(ee){be("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",ee)}},[e]);const Ve=()=>{({formatOptions:e,svg:i,width:p,height:C}=kt(S,e)),Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,me.yMinLeft,me.yMaxLeft,me.yMinRight,me.yMaxRight),{margin:U,yLabel:V,xLabel:N,yTitle:$,xTitle:X,dimensionHeightWidthArray:se,chartTitleHeight:re,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Le,visibleBars:ae,columnWidth:A,scrollbarVisible:O}=Tt(p,C,pe,ue,me.yMaxLeft,e,me.legendList,me.dimensionList,me.yMaxRight,j,ce,t,!1,me),ve(U),{dataTable:c,dataTableHeight:d}=ea(e,V,$,g,me.dimensionList,r),vt(i,p,C,e),y=Ct(i,U),mt(y,e,d,q,w,u),te(),Pe(),Gt(y,e,d,V,Q,w),Mt(e,D,i,U,N,C,X,me.chartType,V,q,w),St(w,e,d,D,i,U,$,V),Ut(i,j,U,e,d,w,q,Le,oe),Ft(i,e,p,re),Dt(C,i,se,re,p,he,e,[...g].reverse(),L,d,U,nt.rectangle,u,n),Bt(g,C,p,i,U,q,O,ae,me,fe,!1,xe)},Ye=()=>{const ee=[],Y=[];let W=-1/0,I=1/0;g.forEach((E,k)=>{const M=`${k}~$~${E.properties.legend}`;E.properties.legend=M,Y.push(M),W=-1/0,I=1/0;for(const G of E.data)W=Math.max(W,G.value),I=Math.min(I,G.value),ee.push(G);E.properties.setColorScale&&ie.set(E.properties.legendUniqueId,T.scaleSequential().domain([I,W]).interpolator(T.interpolateRgb(E.properties.startColor,E.properties.endColor)))}),me.chartData=ee,me.legendList=Y,we=JSON.parse(JSON.stringify(g));let v=pt(me.dimensionList,g,ce);ge=me.dimensionList;const F=T.stack().keys(me.legendList).offset(T.stackOffsetDiverging)(v);ye();let z=1/0;for(const E of F)for(const[k]of E)z=Math.min(z,k);me.yMinLeft=z>0?0:z,me.yMaxLeft=1;let R=t?gt(e.xAxisLabel.xAxisNumberFormat,me.dimensionList).map(E=>E):me.dimensionList;me.dimensionList.forEach((E,k)=>{me.formattedDimensionListMap.set(E,R[k])}),e.plotArea.hideZeroValues&&(me.hideZeroValues=!0)},te=()=>{let ee=st(J||me.yMaxLeft,me.yMinLeft,w,e,me,K,J).yAxisLabelArray;if(me.yMaxLeft=ee[ee.length-1],me.yMinLeft=ee[0],f=T.scaleLinear().domain([me.yMinLeft<0?-1:0,1]).range([d>0?w-d:w,0]),P=[0,q],e.seriesLabel.seriesLabelVisibility){let Y=aa(q,f,e,we,void 0,j,w,!0);Y.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&Y.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?P=[0,q-Y.heightWidth[0]]:P=[Y.heightWidth[0],q]}},de=()=>{m=T.scalePoint().domain(ge).range(P).padding(.5)},Pe=()=>{Q=T.axisLeft(f).tickSize(Pt(e,q)).ticks(d>0?(w-d)/80:w/80,"%").tickPadding(8).tickSizeOuter(0)},Ce=()=>{Ae=T.axisBottom(m).tickSize(ia(e,w,d,!0)).tickSizeOuter(0).tickValues(Lt(ge,q))},Me=ee=>{ke.forEach((k,M)=>k.forEach((G,Z)=>{ee[M].data[Z]&&ee[M].data[Z][0]!==void 0&&ee[M].data[Z][1]!==void 0&&(ee[M].data[Z][0]=G[0]=G.data.total===0?0:G[0]/G.data.total,ee[M].data[Z][1]=G[1]=G.data.total===0?0:G[1]/G.data.total)})),ee.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})}),ge.forEach(k=>{y.append("rect").attr("id",`dim-background-${k}`).attr("class","dimension-background").attr("x",m(k)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",w).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Y=y.selectAll(".parentGroup").data([ke]);Y=Y.enter().append("g").attr("class","columns parentGroup").merge(Y);let W=Y.selectAll(".column-group").data(k=>k);W=W.enter().append("g").attr("class",k=>"column-group "+k.key.replace(/ /g,"-")).attr("hoverId",k=>(ee[k.index].properties.alias||ee[k.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(W);let v=W.selectAll("rect").data(k=>k);const F=(k,M)=>{const G=Array.from(W.nodes()).indexOf(k[M].parentNode);return{props:g[G]?.properties,groupIndex:G}},z=v.enter().append("rect").attr("x",k=>m(k.data.dimension)-A/2).attr("width",A).attr("y",f(0)).attr("height",0).attr("fill",(k,M,G)=>{const{props:Z}=F(G,M);return ie.get(Z.legendUniqueId)?.(k.data[k.key])??Z?.color??"gray"}).attr("stroke",(k,M,G)=>{const{props:Z}=F(G,M);return Z?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?Z.stackBorderColor:"none"}).attr("stroke-dasharray",(k,M,G)=>{const{props:Z}=F(G,M);return Z?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(k,M,G)=>{const{props:Z}=F(G,M);return(Z?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(k,M,G)=>{const{props:Z}=F(G,M);return k.data[k.key]===0&&Z?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,k=>k.key??"").attr(Qe.DimValue,k=>Array.isArray(k.data.dimension)?String(k.data.dimension[0]):String(k.data.dimension)),R=e.animation.animationEnabled;(k=>R?k.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):k)(z).attr("y",k=>k[1]>=k[0]?f(k[1]):f(k[0])).attr("height",k=>Math.abs(f(k[0])-f(k[1]))),z.merge(v).on("mousemove",(k,M)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:me.formattedDimensionListMap.get(M.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e(M[1]-M[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,k,M.properties,ht(x,String(M.data.dimension??""),{...M.properties,formattedDimensionValue:String(me.formattedDimensionListMap.get(M.data.dimension)??M.data.dimension??"")}))}).on("mouseout",(k,M)=>{rt()}).on("click",At(_,b,(k,M)=>({seriesId:M.key??"",dimValue:Array.isArray(M.data.dimension)?String(M.data.dimension[0]):String(M.data.dimension),legendUniqueId:M.key??"",seriesDisplayName:M.properties?.alias||M.key||""}))),W.exit().remove(),y.selectAll(".parentGroup").raise()},ve=ee=>{q=p-ee.left-ee.right,w=C-ee.bottom-ee.top},xe=(ee,Y,W)=>{we=Y,ge=ee,ae=W,Fe()},Fe=()=>{de(),Ce(),ye(),qt(y,me,N,e,d,f,Ae,se,C,A,t,q,w,ge,m),Me(we),Va(ke,m,f,a,U,dt,[],[],e,u,C,p,q,ge,w,L,i,h,d,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,c,m.bandwidth(),f,m,void 0,void 0,void 0,d,u,e,V,$,me.dimensionList,q,P,me.formattedDimensionListMap,L,U,w))},ye=()=>{let ee=pt(ge,we,ce);ke=T.stack().keys(me.legendList).offset(T.stackOffsetDiverging)(ee),we.forEach((W,I)=>W.data.forEach((v,F)=>{v[0]=ke[I][F][0],v[1]=ke[I][F][1]}));let Y=e.annotation.annotationSetLabelColor;ke.forEach((W,I)=>W.forEach(v=>{v.key=W.key,W.color=JSON.parse(JSON.stringify(g[I].properties.color)),W.individualAnnotationVisibility=JSON.parse(JSON.stringify(g[I].properties.individualAnnotationVisibility)),v.data.labelPosition=g[I].properties.dataLabelPosition,v.data.labelColor=Y=="2"?JSON.parse(JSON.stringify(g[I].properties.color)):g[I].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[I].properties.hideZeroValues)),v.properties=g[I].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},ma="ChartsWithoutAxisFunctions.ts";function Hi(t,e,r){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:o,minVal:h,maxVal:n}=e.plotArea.plotAreaRangeFilter;return t.filter(l=>{const s=r(l);switch(o){case"lt":return s<=n;case"gt":return s>=h;case"in":return s>=h&&s<=n;case"not-in":return s<h||s>n;default:return!0}})}function Gi(t,e,r,o,h,n){try{o.xAxisLabel.xAxisDateFormat=o.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":o.xAxisLabel.xAxisDateFormat;let l={top:0,left:0,right:0,bottom:0},s=t*.15*.8,x=n[0],L=s<x+10?s:x+10,A=o.plotArea.numberOfBubbles?20:0;const u=je(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(h).toString();let b=wt(u,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,o.xAxisLabel.xAxisLabelRotation)[3]+10,_=o.xAxisTitle.xAxisTitleVisibility?o.xAxisTitle.xAxisDynamicTitleText.length!==0?It(o.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:It(o.xAxisTitle.xAxisTitleText,13,qe).height:0;_=_>e*.1?e*.1:_;let g=o.xAxisLabel.xAxisLabelVisibility?b:0,H=o.yAxisTitle.yAxisTitleVisibility?o.yAxisTitle.yAxisDynamicTitleText.length!==0?It(o.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:It(o.yAxisTitle.yAxisTitleText,13,qe).height:0;H=H>t*.1?t*.1:H;let D=o.yAxisLabel.yAxisLabelVisibility?It(je(o.yAxisLabel.yAxisDisplayUnits,o.yAxisLabel.yAxisNumberFormat,o.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString(),et(o.yAxisLabel.yAxisLabelFontSize),o.yAxisLabel.yAxisLabelFontFamily,o.yAxisLabel.yAxisLabelRotation).width+10:0,j=o.chartTitle.chartTitleVisibility?o.chartTitle.dynamicTitleText.length!==0?It(o.chartTitle.chartTitleHTML,void 0,void 0).height:It(o.chartTitle.chartTitleText,16,qe).height:0;j=j>e*.1?e*.1:j;let K=o.legends.legendPosition,J=o.legends.legendVisibility,U=!1;switch(J||(K="None"),K){case Be.none:l.top=j+5,l.bottom=_+g+5+A,l.right=15,l.left=H+D+5;break;case Be.top:l.top=40+j,l.bottom=_+g+5+A,l.right=15,l.left=H+D+5;break;case Be.right:l.right=L+35,l.top=j+5,l.bottom=_+g+5+A,l.left=H+D+5;break;case Be.bottom:l.bottom=40+g+_+A,l.top=j+5,l.right=15,l.left=H+D+5;break;case Be.left:l.left=L+H+D+33,l.top=j+5,l.bottom=_+g+5+A,l.right=15}o.xAxisLabel.xAxisPosition&&o.xAxisLabel.xAxisPosition=="1"&&(l.bottom=l.bottom-g,l.top=l.top+g);let V=o.chartPadding.paddingArrayLTRB;V&&(l.top+=V[1],l.bottom+=V[3],l.right+=V[2],l.left+=V[0]);let N=e-l.top-l.bottom,$=t-l.left-l.right;return{margins:l,yLabel:D,xLabel:g,yTitle:H,xTitle:_,chartTitleHeight:j,legendMargin:L,innerHeight:N,innerWidth:$}}catch(l){fa(ma,"marginCalculationForBubbleScatter",l)}}function _i(t,e,r){try{let o=parseFloat(t.yAxisLabel.yAxisIntervalText),h=parseFloat(t.yAxisLabel.yAxisMaxText),n=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){n=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;h=u.length>0?parseFloat(u):r,h&&(r=h)}else h=r,n=e,o=void 0;let l=e?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString().length:0,x=h?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(h).toString().length:0,L=n?je(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,A=l<s?r:e;if(n){let u=L<s?r:n;A=A<u?u:A}if(h){let u=x>l?h:e;A=A<u?u:A}return h&&n&&(A=x>L?h:n),{longestMeasure:A,customYaxisIntervalValue:o,customYaxisMaxValue:h,customYaxisMinValue:n}}catch(o){fa(ma,"customYscaleLabelFormatting",o)}}function ji(t,e,r){try{let o=parseFloat(t.xAxisLabel.xAxisIntervalText),h=parseFloat(t.xAxisLabel.xAxisMaxText),n=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){n=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();h=u.length>0?parseFloat(u):r,h&&(r=h)}else h=r,n=e,o=void 0;let l=e?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r).toString().length:0,x=h?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(h).toString().length:0,L=n?je(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,A=l<s?r:e;if(n){let u=L<s?r:n;A=A<u?u:A}if(h){let u=x>l?h:e;A=A<u?u:A}return h&&n&&(A=x>L?h:n),{longestDimension:A,customXaxisIntervalValue:o,customXaxisMaxValue:h,customXaxisMinValue:n}}catch(o){fa(ma,"customXscaleLabelFormatting",o)}}function Ji(t,e,r,o,h,n,l,s,x,L,A){try{let u=t.xAxisLabel.xAxisPosition,S=!0,_=r.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${o.left},${o.top+A+(t?.xAxisLabel?.xAxisPosition=="1"?0:h)})`:!t.plotArea.fitChart&&!1?`translate(${o.left},${n-l-5})`:`translate(${o.left},${o.top+A+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:h:s=="tornado"?h+5:x+5)})`).attr("class","xAxisTitle").attr("width",L).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?_.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):_.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","5px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){fa(ma,"setXaxistitle",u)}}function Zi(t,e,r,o,h,n,l,s){try{let x=r>0?t-r:t,L=h.append("foreignObject").attr("visibility",o?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${n.top+x}`).attr("y",n.left-l-s+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",x).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?L.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):L.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),h}catch(x){fa(ma,"yAxistitle",x)}}function Xi(t,e,r,o,h,n){try{let l=parseFloat(o.yAxisLabel.yAxisIntervalText),s=[],x;if(l&&l!==0&&l!==void 0){let L=h||h==0?h:e,A=n||n==0?n:t;L<0?x=Math.floor((A-L)/l):x=Math.floor(A/l);let u=18;(n||n==0)&&(t=n);let S=h||h==0?h:e<0?Math.round(e):0;if(s.push(S),x>100){let b="Tick count cannot exceed more than 100.";L<0?l=(A-S)/100:l=A/100}if(x=x<100?x:100,x>u)for(let b=0;b<parseInt(x)&&(S+=l,parseFloat(S.toFixed(5))<=t);b++)s.push(S);else for(let b=0;b<u&&(S+=l,S<=t);b++)s.push(S)}else x=r/60;return{yAxisLabelArray:s,customTickValue:x}}catch(l){fa(ma,"responsiveYaxisLabel",l)}}function hi(t,e,r,o,h,n,l,s){try{let x=!0,L=parseFloat(o.xAxisLabel.xAxisIntervalText),A=[],u;if(L&&L!==0&&L!==void 0){let S=h||h==0?h:e,b=n||n==0?n:t;S<0?u=Math.floor((b-S)/L):u=Math.floor(b/L);let _=18;(n||n==0)&&(t=n);let g=h||h==0?h:e<0?Math.round(e):0;if(A.push(g),x=!1,u>100){let H="Tick count cannot exceed more than 100.";S<0?L=(b-g)/100:L=b/100}if(u=u<100?u:100,u>_)for(let H=0;H<parseInt(u)&&(g+=L,parseFloat(g.toFixed(5))<=t);H++)A.push(g);else for(let H=0;H<_&&(g+=L,g<=t);H++)A.push(g)}else{const S=je(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisDateFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n||t).toString();let b=wt(S,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,0);A=Vi(h||e,n||t,s?l:r,b[0]),u=r/30}return{xAxisLabelArray:A,customTickValue:u,autoLabelFlag:x}}catch(x){fa(ma,"responsiveXaxisLabel",x)}}function qi(t,e,r,o,h,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",r>0?n-r:n).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==De.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(h);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==De.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes(ne.italic)?ne.italic:"").style("text-decoration",l.includes(ne.underline)?ne.underline:"").style("font-weight",l.includes(ne.bold)?ne.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(l){fa(ma,"initYaxis",l)}}function Ki(t,e,r,o,h,n,l,s,x){try{let L=e.xAxisLabel.xAxisLabelFontStyle,A=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${A==="0"?r>0?n-r:n:A==="1"?-o:x(0)})`).attr("height",o).attr("width",l).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==De.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${A==="0"?n:A==="1"?0:x(0)})`).call(h);let b=A==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(o)).style("height","20px").attr("transform",(g,H)=>`rotate(${A==="1"?-u:u!=0?180-u:0}) translate (${u!=0?b+", -5":-o/2+" , "+(A==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",A==="1"?"":u!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",u!=0?"start":"center").style("user-select","none").style("margin",0).style("padding",0).style("overflow","hidden").style("font-family",e.xAxisLabel.xAxisLabelFontFamily).style("color",e.xAxisLabel.xAxisLabelColor).style("font-size",e.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",L.includes(ne.italic)?ne.italic:"").style("text-decoration",L.includes(ne.underline)?ne.underline:"").style("font-weight",L.includes(ne.bold)?ne.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(g,H)=>je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(g)).html((g,H)=>je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(g)),S.selectAll("text").style("visibility",(e.xAxisLabel.xAxisLabelVisibility,"hidden")),S.selectAll("line").style("stroke",e.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",e.xAxisLabel.xAxisLabelVisibility||e.plotArea.gridLinesVertical?"visible":"hidden"),S.select(".domain").style("stroke",e.xAxisLabel.xAxisColor).attr("stroke-width",e.xAxisLabel.xAxisWidth?e.xAxisLabel.xAxisWidth:e.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges")}catch(L){fa(ma,"initXaxis",L)}}function Qi(t,e,r,o,h,n,l,s,x,L,A){try{if(!r.annotation.annotationVisibility)return;const u=r.plotArea.annotationType??"1",S=[u==="1"?"connector":""],b=r.plotArea.connectorType?.toLowerCase()??"none",_=u==="5",g=r.plotArea.rotation??0,H=h===le.PieChart?1.06:1.1,D={1:"",2:T.curveLinear,3:T.curveStep},j=(O,q)=>[[0,0],[O/2,q/2],[O,q]],K={solid:"unset",dotted:"2,2",dashed:"6,4"};let J=t.annotation(),U=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));U=U.map(O=>({dx:O.dx??0,dy:O.dy??0,ratioDistance:O.ratioDistance,ratioAngle:O.ratioAngle,connectorPoints:O.connectorPoints||O.connector?.points||[],radius:O.radius??x,data:O.data,width:n,height:l}));const V=e.reduce((O,q)=>O+(q?.data?.data?.[0]?.value??0),0),N=V===0?1:V,$=(O,q)=>{const w=O.data.data[0].value,p=(O.x0+O.x1)/2,C=O.x1-O.x0;return{note:{title:r.plotArea.dataLabelName?O.data.legend:"",label:r.plotArea.dataLabelValue&&w!==0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(w/N)*100).toFixed(et(r.plotArea.dataLabelDecimalPrecision))+"%":je(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(w):"",align:"middle",wrap:1e3},data:{x:{legend:O.data.legend},y:{value:w},midAngle:p,isVisible:!0,hoverId:O?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:O.data.legend,dx:0,dy:0,connector:{end:b,curve:D[r.plotArea.connectorCurve],points:_?j(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:er(t,u),color:r.plotArea.connectorColor??"#ccc",width:n,height:l,index:q}};let X=e.filter(O=>O.x1-O.x0>1e-4).map($);const se=O=>(O.data.y?.value??0)!==0;X=X.filter(se),X=Rt(X,r,O=>O.data.y.value);let re=new Map(U.map(O=>[O.data?.x?.legend,O])),oe=[];X.forEach(O=>{const q=O.data.x.legend,w=re.get(q);if(w){if(w.ratioDistance!=null&&w.ratioAngle!=null){const p=w.ratioDistance*x;O.dx=Math.cos(w.ratioAngle)*p,O.dy=Math.sin(w.ratioAngle)*p}else{const p=x/(w.radius||x);O.dx=w.dx*p,O.dy=w.dy*p}O.data.isVisible=w.data?.isVisible??!0,w.connectorPoints?.length>=(_?3:2)?O.connector.points=w.connectorPoints:O.connector.points=_?j(O.dx,O.dy):[[0,0],[0,0]]}oe.push(O)}),J.editMode(r.plotArea.annotationDraggable&&L).accessors({x(O){return Math.cos(O.midAngle-Math.PI/2)*(x-x*.35)},y(O){return Math.sin(O.midAngle-Math.PI/2)*(x-x*.35)}}).on("dragend",function(O){oe.forEach(w=>{if(w.data.x.legend===O.data.x.legend){const p=O._dx,C=O._dy,c=Math.sqrt(p*p+C*C),d=Math.atan2(C,p);w.dx=p,w.dy=C,w.ratioDistance=c/x,w.ratioAngle=d,w.width=n,w.height=l,w.connectorPoints=O.connector?.points||[]}});const q=oe.map(w=>({data:{x:w.data.x,isVisible:w.data.isVisible??!0},dx:w.dx,dy:w.dy,ratioDistance:w.ratioDistance,ratioAngle:w.ratioAngle,connectorPoints:w.connectorPoints||[],width:n,height:l,radius:x}));A&&A(q)}).annotations(oe);const he=s.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(J),Le=r.plotArea.dataLabelNameFontStyle??[];he.selectAll(".annotation-note-title").style("font-family",r.plotArea.dataLabelNameFontFamily).style("font-size",`${r.plotArea.dataLabelNameFontSize}px`).style("font-style",Le.includes("Italic")?"italic":"").style("text-decoration",Le.includes("Underline")?"underline":"").style("font-weight",Le.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelNameColor??"#000");const pe=r.plotArea.dataLabelValueFontStyle??[];if(he.selectAll(".annotation-note-label").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("font-style",pe.includes("Italic")?"italic":"").style("text-decoration",pe.includes("Underline")?"underline":"").style("font-weight",pe.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelValueColor??"#000"),r.plotArea.plotAreaAbsoluteValue&&he.selectAll(".annotation-note-label").each(function(O){const q=T.select(this),w=T.format(".2s")(Math.abs(O.data.y.value));q.append("tspan").attr("x",q.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("fill",r.plotArea.dataLabelValueColor??"#000").text(w)}),b==="diamond"){const O=r.plotArea.connectorColor??"#ccc",q=5;he.selectAll(".annotation-connector").each(function(){T.select(this).select("path.connector").empty()||T.select(this).append("polygon").attr("class","connector-end connector-diamond").attr("points",`0,${-q} ${q},0 0,${q} ${-q},0`).style("fill",O).style("stroke",O)})}if(he.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const O=r.animation.animationDuration,q=Xe[r.animation.animationEffect],w=he.selectAll(".annotation-note-label");w.interrupt().style("opacity",0),setTimeout(()=>{w.transition().delay((p,C)=>C*30).duration(O).ease(q).style("opacity",1)},50)}const ue=r.plotArea.connectorColor??"#ccc";he.selectAll(".connector").style("stroke",ue).attr("hoverId",O=>O.data.hoverId).attr("stroke-dasharray",K[r.plotArea.connectorStyle?.toLowerCase()]),he.selectAll(".connector-end").attr("hoverId",O=>O.data.hoverId).style("fill",ue).style("stroke",ue),he.selectAll(".annotation-note-title").attr("hoverId",O=>O.data.hoverId),he.selectAll(".annotation-note-label").attr("hoverId",O=>O.data.hoverId).filter(O=>!O.data.isVisible).style("display","none"),he.selectAll(".annotation-note-label").filter(O=>r.plotArea.hideInsignificantValue&&O.data.x1-O.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const er=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},Oi=(t,e,r,o,h,n,l,s,x,L)=>{try{if(r.plotArea.numberOfBubbles){let A=e=="Bottom"?o-55:o-25;t.append("foreignObject").attr("transform",`translate(${n.left},${A})`).attr("width",h).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",De.black).style("font-size","12px ").style("text-overflow","ellipsis").html((r.plotArea.totalAlias?r.plotArea.totalAliasText:"Total count : ")+L)}}catch(A){fa(ma,"setnumberOfBubbles",A)}};function fa(t,e,r){console.error(`[${t}] [${e}]`,r)}const tr=({isDateType:t,formatOptions:e,data:r})=>{const o=crypto.randomUUID(),h=0,n=le.ColumnHistogramChart,l=Te.useRef(),s=r.ChartData,x=r.DimensionList,L=!1,A=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,g=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,H,D,j,K,J,U,V,N,$,X,se,re,oe,he,Le,pe=[],ue=[],O,q,w,p,C,c,d,i,y,f,a,m,P,ie=[],Q=0;const Ae=2;let ge={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{we()}catch(Ce){be("Columnchart","createColumnChart",Ce)}},[e]);const we=()=>{({formatOptions:e,svg:C,width:O,height:q}=kt(l,e)),fe(),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:re}=Nt(e,ge.yMinLeft,ge.yMaxLeft,ge.yMinRight,ge.yMaxRight),{margin:H,yLabel:D,xLabel:j,yTitle:K,xTitle:J,dimensionHeightWidthArray:U,chartTitleHeight:V,secondaryAxisTitleWidth:N,legendMargin:$,secondaryYLabel:X}=Tt(O,q,se,re,ge.yMaxLeft,e,ge.legendList,ge.dimensionList,ge.yMaxRight,A,u,t),te(H),{dataTable:w,dataTableHeight:p}=ea(e,D,K,s,ge.dimensionList),vt(C,O,q,e),c=Ct(C,H),mt(c,e,p,oe,he,n),ae(),ce(),me(),Gt(c,e,p,D,a,he),de(s,q,C,H,oe),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,C,c,w,h,d,i,y,void 0,void 0,p,n,e,D,K,ge.dimensionList,oe,f,ge.formattedDimensionListMap,o,H,he)),Mt(e,L,C,H,j,q,J,ge.chartType,D,oe,he),St(he,e,p,L,C,H,K,D),Ut(C,A,H,e,p,he,oe,X,N),Ft(C,e,O,V),Dt(q,C,U,V,O,$,e,s,o,p,H,nt.rectangle)},fe=()=>{const Ce=[],Me=[];let ve=[],xe=-1/0,Fe=1/0;s.forEach(Y=>{Me.push(Y.legend),Y.data.forEach(W=>{Ce.push(W),xe=Math.max(xe,W.value),Fe=Math.min(Fe,W.value)})}),ge.chartData=Ce,ge.legendList=Me,ge.yMaxLeft=xe,ge.yMinLeft=Fe>0?0:Fe,ie=JSON.parse(JSON.stringify(s)),ie.forEach(Y=>Y.data.forEach(W=>ve.push(W.value)));let ye=S||S==0?S:0,ee=b||b==0?b:ie[0]?.data?.length;if(ge.yMaxLeft=parseFloat((ye+"").length>(ee+"").length?ye+"":ee+""),ge.xMax=T.max(ve),ge.xMin=T.min(ve),ge.xMin===ge.xMax){const Y=ge.xMax===0?1:Math.abs(ge.xMax*.1);ge.xMin-=Y,ge.xMax+=Y}},ae=()=>{switch(e.bins.binsCalculation){case"Automatic":Le=oe/50;break;case"Number of Bins":ke(!1);break;case"Bin Width":ke(!0)}},ke=Ce=>{ie.forEach(Fe=>Fe.data.sort(function(ye,ee){return ye.value-ee.value}));let Me=ge.xMax-ge.xMin,ve;Ce?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ve=Me/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ve=Me/parseFloat(e.bins.binsCalculationValue));let xe=ge.xMin;if(Ce)for(pe=[xe];xe<ge.xMax;)xe+=ve,pe.push(xe);else for(pe=[xe];Math.round(xe)<Math.round(ge.xMax);)xe+=ve,pe.push(Math.round(xe))},ce=()=>{i=T.scaleLinear().domain([ge.xMin,ge.xMax]).range([0,oe]);const Ce=pe.length>0?pe:i.ticks(Le);let Me=T.bin().value(xe=>xe).domain(i.domain()).thresholds(Ce);ie.forEach(xe=>{let Fe=Me(xe.data.map(ye=>ye.value));ue.push(Fe)}),ie.forEach((xe,Fe)=>ue[Fe].forEach(ye=>{ye.name=xe.properties.legend,ye.color=xe.properties.color,ye.opacity=xe.properties.opacity}));let ve=[];ue.forEach(xe=>xe.forEach(Fe=>ve.push(Fe.length))),ge.yMaxLeft=T.max(ve),ge.yMinLeft=T.min(ve),d=T.scaleLinear().range([he,0]).domain([S||S==0?S:0,b||b==0?b:ge.yMaxLeft+.2*ge.yMaxLeft])},me=()=>{Ve();{let Ce=st(ge.yMaxLeft,ge.yMinLeft,he,e,ge,S,b,!1,oe);a=T.axisLeft(d).tickFormat(Me=>_e(Me,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,oe)).tickValues(Ce.autoLabelFlag?void 0:Ce.yAxisLabelArray).ticks(Ce.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ve=()=>{let Ce=parseInt(e.xAxisLabel.xAxisPosition);hi(ge.xMax,ge.xMin,oe,e,_,g,he,!1).xAxisLabelArray.shift(),m=(Ce==1?T.axisTop(i):T.axisBottom(i)).tickFormat(ve=>_e(ve,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(ia(e,he,p)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?m.ticks(Le):m.tickValues(pe).ticks(oe/50)},Ye=Ce=>{const Me=e.animation.animationEnabled,ve=c.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(ue).enter().append("g").selectAll("rect").data(Fe=>Fe).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",1).attr("transform",function(Fe){return"translate("+i(Fe.x0)+","+he+")"}).attr("width",function(Fe){return i(Fe.x1)-i(Fe.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(Fe.x1)-i(Fe.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",Fe=>Fe.color!==De.white?Fe.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(Fe,ye)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:`${ye.x0}-${ye.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ye.properties?.currentMeasure?ye.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(ye.length/ie[0].data.length):ye.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,Fe)}).on("mouseout",rt);(Me?ve.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):ve).attr("transform",function(Fe){return"translate("+i(Fe.x0)+","+(d(Fe.length)>0?d(Fe.length):0)+")"}).attr("height",function(Fe){return he-d(Fe.length)}),c.selectAll(".parentGroup").raise()},te=Ce=>{oe=O-Ce.left-Ce.right,he=q-Ce.bottom-Ce.top},de=(Ce,Me,ve,xe,Fe)=>{if(!e.plotArea.fitChart){const ye=Ce[0].data.length-Ae,ee=Me-20;P=ge.dimensionList.slice(Q,Q+Ae),ie=JSON.parse(JSON.stringify(Ce)),ie.forEach((I,v)=>ie[v].data=I.data.filter(F=>P.includes(F.dimension))),ve.append("rect").attr("x",xe.left).attr("y",ee).attr("width",Fe).attr("height",8).attr("fill","#ddd").attr("rx",4);const Y=Fe*Ae/ge.dimensionList.length,W=ve.append("rect").attr("x",xe.left).attr("y",ee).attr("width",Y).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",I=>{let v=Math.min(Math.max(I.x,xe.left),xe.left+Fe-Y);W.attr("x",v),Q=Math.round((v-xe.left)/(Fe-Y)*ye),P=ge.dimensionList.slice(Q,Q+Ae),ie=JSON.parse(JSON.stringify(Ce)),ie.forEach((F,z)=>ie[z].data=F.data.filter(R=>P.includes(R.dimension))),Ve(),Pe()}));ve.on("wheel",I=>{I.preventDefault();const v=Math.abs(I.deltaX)>Math.abs(I.deltaY)?I.deltaX:I.deltaY;Q+=v>0?1:-1,Q=Math.max(0,Math.min(Q,ye));const F=xe.left+(Fe-Y)*Q/ye;W.attr("x",F),ie=JSON.parse(JSON.stringify(Ce)),ie.forEach((z,R)=>ie[R].data=z.data.filter(E=>P.includes(E.dimension))),Ve(),Pe()})}Pe()},Pe=()=>{qt(c,ge,j,e,p,d,m,U,q,h,t,oe,he,P,i),Ye()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:o,style:{width:"100%",height:"100%"}})})},ar=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID(),A=0,u=le.LineChart,S=Te.useRef(),b=Te.useRef(s);b.current=s;const _=Te.useRef(x);_.current=x;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1;let j=!1;const K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p=!1,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce=[],me=0,Ve=0,Ye=0,te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(W){be("Linechart","createLineChart",W)}},[e]);const de=()=>{({formatOptions:e,svg:a,width:d,height:i}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:w,customYaxisMaxValue:U,secondaryCustomYaxisMaxValue:N}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:$,yLabel:X,xLabel:se,yTitle:re,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Le,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:Ve,columnWidth:Ye,scrollbarVisible:p}=Tt(d,i,q,w,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t,!1,te),ee($),{dataTable:y,dataTableHeight:f}=ea(e,X,re,g,te.dimensionList,r),vt(a,d,i,e),m=Ct(a,$),mt(m,e,f,C,c,u,L),Ce(),xe(),Gt(m,e,f,X,we,c),j&&oi(m,e,f,O,ae,c,C),Mt(e,D,a,$,se,i,oe,te.chartType,X,C,c),St(c,e,f,D,a,$,re,X),j&&Ut(a,j,$,e,f,c,C,O,pe),Ft(a,e,d,Le),Dt(i,a,he,Le,d,ue,e,g,L,f,$,nt.line,u,n),Bt(g,i,d,a,$,C,p,Ve,te,me,!1,Me)},Pe=()=>{const W=[],I=[];let v=[],F=-1/0,z=1/0,R=-1/0,E=1/0;e.plotArea.hideZeroValues&&(te.hideZeroValues=!0),g.forEach(k=>{I.push(k.properties.alias?k.properties.alias:k.legend),k.data.forEach(M=>{W.push(M),k.properties.axis==="Secondary"?(j=!0,R=Math.max(R,M.value),E=Math.min(E,M.value)):(F=Math.max(F,M.value),z=Math.min(z,M.value))})}),te.chartData=W,te.legendList=I,te.yMaxLeft=F,te.yMinLeft=z,te.yMaxRight=R,te.yMinRight=E,v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(k=>k):te.dimensionList,te.dimensionList.forEach((k,M)=>{te.formattedDimensionListMap.set(k,v[M])}),ce=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ke=te.dimensionList:ke=te.dimensionList.slice(me,me+Ve)},Ce=()=>{let W=st(U||te.yMaxLeft,te.yMinLeft,c,e,te,J,U).yAxisLabelArray;if(te.yMaxLeft=W[W.length-1],te.yMinLeft=W[0],P=T.scaleLinear().domain([te.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:te.yMinLeft*.9:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:te.yMaxLeft*1.1]).range([f>0?c-f:c,0]),j&&(ie=T.scaleLinear().domain([te.yMinRight>=0?(V||V==0)&&!Number.isNaN(V)?V:0:(V||V==0)&&!Number.isNaN(V)?V:te.yMinRight*1.1,te.yMaxRight<=0?N||0:N||te.yMaxRight*1.1]).range([f>0?c-f:c,0])),Ae=[0,C],e.seriesLabel.seriesLabelVisibility){let I=aa(C,P,e,ce,ie,j,c,!1);I.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(ge=I.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Ae=[0,C-I.heightWidth[0]]:Ae=[I.heightWidth[0],C]}},Me=(W,I,v)=>{ce=I,ke=W,Ve=v,Y()},ve=()=>{Q=T.scalePoint().domain(ke).range(Ae).padding(.5)},xe=()=>{{let W=st(U||te.yMaxLeft,te.yMinLeft,c,e,te,J,U);we=T.axisLeft(P).tickFormat(I=>_e(I,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,C,ge)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let W=st(N||te.yMaxRight,V||te.yMinRight,c,e,te,V,N);ae=T.axisRight(ie).tickFormat(I=>_e(I,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickSize(Pt(e,C,ge)).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{fe=T.axisBottom(Q).tickSize(ia(e,c,f,!0)).tickSizeOuter(0).tickValues(Lt(ke,C))},ye=W=>{const I=[...W].reverse();I.forEach(M=>{M.data.forEach(G=>{G.hideZero=M.properties.hideZeroValues,G.axis=M.properties.axis})});const v=T.line().x(M=>{const G=Q(M.dimension);return G??0}).y(M=>M.axis===at.primary?P(M.value):ie(M.value)).defined(M=>M.hideZero||te.hideZeroValues?!!M.value:!0).curve(Ot(e)),F=e.animation.animationEnabled,z=M=>F?M.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):M;let R=m.selectAll(".parentGroup").data([I]);R=R.enter().append("g").attr("class","lines parentGroup").merge(R);let E=R.selectAll(".line-group").data(M=>M),k=E.enter().append("g").attr("class","line-group");k.append("path").attr("class","visibleLine").attr("fill","none"),k.merge(E).each(function(M){const Z=T.select(this).selectAll("path.visibleLine").data([M]).join("path").attr("class","visibleLine").attr("d",B=>v(B.data)).attr("stroke",B=>B.properties.color!==De.white?B.properties.color:"none").attr("stroke-dasharray",B=>{const Se=parseInt(B.properties.lineWidth);switch(B.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",B=>B.properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",B=>B.properties.lineStyle!=="None"?B.properties.lineWidth:0).attr("hoverId",(M.properties.alias||M.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${L}-clip)`).attr("d",B=>v(B.data)).attr(Qe.SeriesId,B=>B.properties.legendUniqueId).attr(Qe.DimValue,B=>B.properties.alias||B.properties.name||"").on("click",At(_,b,(B,Se)=>({seriesId:Se.properties.legendUniqueId,dimValue:Se.properties.alias||Se.properties.name||"",legendUniqueId:Se.properties.legendUniqueId,seriesDisplayName:Se.properties.alias||Se.properties.name||""})));F&&Z.each(function(){const B=T.select(this),Se=this.getTotalLength();B.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se),z(B).attr("stroke-dashoffset",0)})}),E.exit().remove(),Ca(R,I,"None",Q,P,ie,null,e,te,N,V,J,U,!1,l),m.selectAll(".parentGroup").raise()},ee=W=>{C=d-W.left-W.right,c=i-W.bottom-W.top},Y=()=>{ve(),Fe(),qt(m,te,se,e,f,P,fe,he,i,C/ke.length,t,C,c,ke,Q),ye(ce),Da(g,Q,P,ie,$,dt,[],[],e,u,i,d,C,ke,c,L,a,h,void 0,void 0,o);let W=aa(C,P,e,ce,ie,j,c,!1).labelArray;za(e,m,W),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,a,m,y,A,P,Q,void 0,void 0,void 0,f,u,e,X,re,te.dimensionList,C,Ae,te.formattedDimensionListMap,L,$,c))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},ir=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.StackLineChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=r.DimensionList,H=(bt(r.ChartData,r.DimensionList)||[]).reverse(),D=!1,j=new Map,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae=[],ke=0,ce=2,me=!1,Ve=0,Ye=[];const te=!1;let de={dimensionList:g,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(v){be("StackLinechart","createStackLineChart",v)}},[e]);const Pe=()=>{({formatOptions:e,svg:f,width:c,height:d}=kt(S,e)),Ce(),{formatOptions:e}=Qt(e,H,r.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:w}=Nt(e,de.yMinLeft,de.yMaxLeft,de.yMinRight,de.yMaxRight),{margin:$,yLabel:X,xLabel:se,yTitle:re,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Le,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:ce,columnWidth:Ve,scrollbarVisible:me}=Tt(c,d,q,w,de.yMaxLeft,e,de.legendList,de.dimensionList,de.yMaxRight,K,te,t,!1,de),ee($),{dataTable:i,dataTableHeight:y}=ea(e,X,re,H,de.dimensionList,r),vt(f,c,d,e),a=Ct(f,$),mt(a,e,y,p,C,u,L),Me(),xe(),Gt(a,e,y,X,ge,C),Mt(e,D,f,$,se,d,oe,de.chartType,X,p,C),St(C,e,y,D,f,$,re,X),Ut(f,K,$,e,y,C,p,O,pe),Ft(f,e,c,Le),Dt(d,f,he,Le,c,ue,e,[...H].reverse(),L,y,$,nt.line,u,n),Bt(H,d,c,f,$,p,me,ce,de,ke,!1,I),qa(j,ie,m,$,dt,[],e,u,d,c,f,o)},Ce=()=>{const v=[],F=[];e.plotArea.hideZeroValues&&(de.hideZeroValues=!0),H.forEach((G,Z)=>{const B=`${Z}~$~${G.properties.alias?G.properties.alias:G.legend}`;G.properties.legend=B,F.push(B);for(const Se of G.data)v.push(Se)}),de.chartData=v,de.legendList=F,ae=JSON.parse(JSON.stringify(H));let z=pt(de.dimensionList,H,te);e.plotArea.fitChart?fe=de.dimensionList:(fe=de.dimensionList.slice(ke,ke+ce),ae.forEach((G,Z)=>ae[Z].data=G.data.filter(B=>fe.includes(B.dimension))));const R=T.stack().keys(de.legendList).offset(T.stackOffsetDiverging)(z);W();let E=1/0,k=-1/0;for(const G of R)for(const[Z,B]of G)E=Math.min(E,Z),k=Math.max(k,B);de.yMinLeft=E>0?0:E,de.yMaxLeft=k;let M=t?gt(e.xAxisLabel.xAxisNumberFormat,de.dimensionList).map(G=>G):de.dimensionList;de.dimensionList.forEach((G,Z)=>{de.formattedDimensionListMap.set(G,M[Z])})},Me=()=>{let v=st(U||de.yMaxLeft,de.yMinLeft,C,e,de,J,U).yAxisLabelArray;if(de.yMaxLeft=v[v.length-1],de.yMinLeft=v[0],m=T.scaleLinear().domain([de.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:de.yMinLeft<0?de.yMinLeft*1.1:de.yMinLeft*.9,de.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:de.yMaxLeft*1.1]).range([y>0?C-y:C,0]),Q=[0,p],e.seriesLabel.seriesLabelVisibility){let F=aa(p,m,e,ae,void 0,K,C,!0);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Ae=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,p-F.heightWidth[0]]:Q=[F.heightWidth[0],p]}ve()},ve=()=>{ie=T.scalePoint().domain(fe).range(Q).padding(.5)},xe=()=>{Fe();{let v=st(U||de.yMaxLeft,de.yMinLeft,C,e,de,J,U);ge=T.axisLeft(m).tickFormat(F=>_e(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,p,Ae)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{we=T.axisBottom(ie).tickSize(ia(e,C,y,!0)).tickSizeOuter(0).tickValues(Lt(fe,p))},ye=v=>{v.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})});const F=T.line().x(k=>ie(k.data.dimension)?ie(k.data.dimension):null).y(k=>k[1]>0?m(k[1]):m(k[0])).defined(k=>{const M=k;return M.hideZero||de.hideZeroValues?M.data[M.key]:!0}).curve(Ot(e));let z=a.selectAll(".parentGroup").data([Ye]);z=z.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(z);let R=z.selectAll(".line-group").data(k=>k);const E=R.enter().append("g").attr("class",k=>"line-group "+k.key.replace(/ /g,"-"));E.append("path").attr("class","line").attr("fill","none"),E.merge(R).each(function(k,M){const G=T.select(this),Z=G.selectAll("path.visibleLine").data([k]).join("path").attr("class","visibleLine").attr("hoverId",ze=>(H[M]?.properties?.alias||H[M]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",F(k)).attr("stroke",k.color!==De.white?k.color:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(H[M].properties.lineWidth.toString());switch(H[M].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",H[M].properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",H[M].properties.lineStyle!==yt.none?H[M].properties.lineWidth:0).attr("fill","none").attr(Qe.SeriesId,H[M].properties.legendUniqueId).attr(Qe.DimValue,H[M].properties.alias||H[M].properties.name||"").on("click",At(_,b,()=>({seriesId:H[M].properties.legendUniqueId,dimValue:H[M].properties.alias||H[M].properties.name||"",legendUniqueId:H[M].properties.legendUniqueId,seriesDisplayName:H[M].properties.alias||H[M].properties.name||""}))),B=e.animation.animationEnabled,Se=Z.node().getTotalLength();B?Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0):Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",0),G.selectAll("path.hoverLine").data([k]).join("path").attr("class","hoverLine").attr("d",F(k)).attr("stroke",De.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){f.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),f.selectAll('[hoverId="'+yi(H[M].properties.alias||H[M].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){f.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),R.exit().remove(),Ca(z,v,u,ie,m,P,null,e,de,N,V,J,U,!1,x)},ee=v=>{p=c-v.left-v.right,C=d-v.bottom-v.top},Y=()=>{ve(),Fe(),qt(a,de,se,e,y,m,we,he,d,A,t,p,C,fe,ie),W(),ye(ae),Va(Ye,ie,m,P,$,dt,[],[],e,u,d,c,p,fe,C,L,f,h,y,o);let v=aa(p,m,e,ae,void 0,K,C,!0).labelArray;za(e,a,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,m,ie,void 0,void 0,void 0,y,le.LineChart,e,X,re,de.dimensionList,p,Q,de.formattedDimensionListMap,L,$,C))},W=()=>{let v=pt(fe,ae,te);Ye=T.stack().keys(de.legendList).offset(T.stackOffsetDiverging)(v),ae.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=Ye[R][k][0],E[1]=Ye[R][k][1]}));let F=e.annotation.annotationSetLabelColor;Ye.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(H[R].properties.color)),z.individualAnnotationVisibility=JSON.parse(JSON.stringify(H[R].properties.individualAnnotationVisibility)),E.data.labelPosition=H[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(H[R].properties.color)):H[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(H[R].properties.hideZeroValues)),E.properties=H[R].properties}))},I=(v,F,z)=>{ae=F,fe=v,ce=z,Ka(r,j,fe),Y()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},lr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.NormalizedStackLineChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe=[],ae=0,ke,ce=0,me=!1,Ve=[];const Ye=!0;let te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(v){be("NormalizedLinechart","createNormalizedLinechart",v)}},[e]);const de=()=>{({formatOptions:e,svg:y,width:C,height:c}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:ce,scrollbarVisible:me}=Tt(C,c,O,q,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,Ye,t,!1,te),ee(N),{dataTable:d,dataTableHeight:i}=ea(e,$,se,g,te.dimensionList,r),vt(y,C,c,e),f=Ct(y,N),mt(f,e,i,w,p,u,L),Ce(),xe(),Gt(f,e,i,$,Ae,p),Mt(e,D,y,N,X,c,re,te.chartType,$,w,p),St(p,e,i,D,y,N,se,$),Ut(y,j,N,e,i,p,w,ue,Le),Ft(y,e,C,he),Dt(c,y,oe,he,C,pe,e,[...g].reverse(),L,i,N,nt.line,u,n),Bt(g,c,C,y,N,w,me,ke,te,ae,!1,Y)},Pe=()=>{const v=[],F=[];e.plotArea.hideZeroValues&&(te.hideZeroValues=!0,g.forEach(M=>{M.data=M.data.filter(G=>G.value!==0)})),g.forEach((M,G)=>{const Z=`${G}~$~${M.properties.legend}`;M.properties.legend=Z,F.push(Z);for(const B of M.data)v.push(B)}),te.chartData=v,te.legendList=F,fe=JSON.parse(JSON.stringify(g)),we=te.dimensionList;const z=pt(te.dimensionList,g,Ye),R=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(z);I();let E=1/0;for(const M of R)for(const[G]of M)E=Math.min(E,G);te.yMinLeft=E>0?0:E,te.yMaxLeft=1;const k=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(M=>M):te.dimensionList;te.formattedDimensionListMap=new Map(te.dimensionList.map((M,G)=>[M,k[G]]))},Ce=()=>{if(a=T.scaleLinear().domain([te.yMinLeft<0?-1:0,1]).range([i>0?p-i:p,0]),ie=[0,w],e.seriesLabel.seriesLabelVisibility){ve(Ve,fe);let v=aa(w,a,e,fe,void 0,j,p,!0);v.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Q=v.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ie=[0,w-v.heightWidth[0]]:ie=[v.heightWidth[0],w]}},Me=()=>{P=T.scalePoint().domain(we).range(ie).padding(.5)};function ve(v,F){v.forEach((z,R)=>z.forEach((E,k)=>{F[R]&&F[R].data[k]&&(F[R].data[k][0]=E[0]=E.data.total===0?0:E[0]/E.data.total,F[R].data[k][1]=E[1]=E.data.total===0?0:E[1]/E.data.total)}))}const xe=()=>{Ae=T.axisLeft(a).tickSize(Pt(e,w,Q)).ticks(i>0?(p-i)/80:p/80,"%").tickPadding(8).tickSizeOuter(0)},Fe=()=>{ge=T.axisBottom(P).tickSize(ia(e,p,i,!0)).tickSizeOuter(0).tickValues(Lt(we,w))},ye=v=>{ve(Ve,fe),v.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})});const F=T.line().x(k=>P(k.data.dimension)?P(k.data.dimension):null).y(k=>k[1]>0?a(k[1]):a(k[0])).curve(Ot(e));let z=f.selectAll(".parentGroup").data([Ve]);z=z.enter().append("g").attr("class","lines parentGroup").merge(z);let R=z.selectAll(".line-group").data(k=>k),E=R.enter().append("g").attr("class",k=>"line-group "+k.key.replace(/ /g,"-"));E.attr("hoverId",k=>(v[k.index]?.properties?.alias||v[k.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),E.merge(R).each(function(k,M){const G=T.select(this),Z=G.selectAll("path.visibleLine").data([k]).join("path").attr("class","visibleLine").attr("d",F(k)).attr("stroke",k.color!==De.white?k.color:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[M].properties.lineWidth.toString());switch(g[M].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",g[M].properties.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",g[M].properties.lineStyle!==yt.none?g[M].properties.lineWidth:0).attr("fill","none").attr(Qe.SeriesId,g[M].properties.legendUniqueId).attr(Qe.DimValue,g[M].properties.alias||g[M].properties.name||"").on("click",At(_,b,()=>({seriesId:g[M].properties.legendUniqueId,dimValue:g[M].properties.alias||g[M].properties.name||"",legendUniqueId:g[M].properties.legendUniqueId,seriesDisplayName:g[M].properties.alias||g[M].properties.name||""}))),B=e.animation.animationEnabled,Se=Z.node().getTotalLength();B?Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",Se).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("stroke-dashoffset",0):Z.attr("stroke-dasharray",Se+" "+Se).attr("stroke-dashoffset",0),G.selectAll("path.hoverLine").data([k]).join("path").attr("class","hoverLine").attr("d",F(k)).attr("stroke",De.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(ze,Ie){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+yi(v[Ie.index]?.properties?.alias||v[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(ze,Ie){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+yi(v[Ie.index]?.properties?.alias||Ie[Ie.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),R.exit().remove(),Ca(z,v,u,P,a,m,null,e,te,V,U,K,J,!0,x)},ee=v=>{w=C-v.left-v.right,p=c-v.bottom-v.top},Y=(v,F,z)=>{fe=F,we=v,ke=z,W()},W=()=>{Me(),I(),Fe(),qt(f,te,X,e,i,a,ge,oe,c,A,t,w,p,we,P),ye(fe),Va(Ve,P,a,m,N,dt,[],[],e,u,c,C,w,we,p,L,y,h,i,o);let v=aa(w,a,e,fe,void 0,j,p,!0).labelArray;za(e,f,v),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,d,A,a,P,void 0,void 0,void 0,i,le.LineChart,e,$,se,te.dimensionList,w,ie,te.formattedDimensionListMap,L,N,p))},I=()=>{let v=pt(we,fe,Ye);Ve=T.stack().keys(te.legendList).offset(T.stackOffsetDiverging)(v),fe.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=Ve[R][k][0],E[1]=Ve[R][k][1]}));let F=e.annotation.annotationSetLabelColor;Ve.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(g[R].properties.color)),E.data.labelPosition=g[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),E.properties=g[R].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},rr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID();let A=0;const u=le.HorizontalBarChart,S=Te.useRef(),b=Te.useRef(s);b.current=s;const _=Te.useRef(x);_.current=x;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!0;let j=!1;const K=!1,J=new Map;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C=new Map,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce=[],me=0,Ve=2,Ye=!1,te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(W){be("HorizontalBarchart","createHorizontalBarChart",W)}},[e]);const de=()=>{({formatOptions:e,svg:a,width:i,height:y}=kt(S,e)),Pe(),{maxNumberForPrimaryAxis:w,maxNumberForSecondaryAxis:p,customYaxisMaxValue:V,secondaryCustomYaxisMaxValue:$}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:X,yLabel:se,xLabel:re,yTitle:oe,xTitle:he,dimensionHeightWidthArray:Le,chartTitleHeight:pe,secondaryAxisTitleWidth:ue,legendMargin:O,secondaryYLabel:q,visibleBars:Ve,columnWidth:A,scrollbarVisible:Ye}=Tt(i,y,w,p,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t,D,te),ye(X),vt(a,i,y,e),m=Ct(a,X),mt(m,e,f,c,d,u,L),Ce(),ve(),Ya(e,m,se,d,c,we),j&&Rl(e,m,q,fe,c),Mt(e,D,a,X,re,y,he,te.chartType,se,c,d),St(d,e,f,D,a,X,oe,se,c),Ut(a,j,X,e,f,d,c,q,ue,D),Ft(a,e,i,pe),Dt(y,a,Le,pe,i,O,e,g,L,f,X,nt.rectangle,u,n),Bt(g,y,i,a,X,c,Ye,Ve,te,me,!1,ee,D)},Pe=()=>{const W=[],I=[];let v=[],F=-1/0,z=1/0,R=-1/0,E=1/0,k=1/0,M=-1/0;g.forEach(G=>{I.push(G.properties.legendUniqueId),M=-1/0,k=1/0,G.data.forEach(Z=>{W.push(Z),G.properties.axis==="Secondary"?(j=!0,R=Math.max(R,Z.value),E=Math.min(E,Z.value)):(F=Math.max(F,Z.value),z=Math.min(z,Z.value)),M=Math.max(M,Z.value),k=Math.min(k,Z.value)}),G.properties.setColorScale&&J.set(G.properties.legendUniqueId,T.scaleSequential().domain([k,M]).interpolator(ii.interpolateRgb(G.properties.startColor,G.properties.endColor)))}),te.chartData=W,te.legendList=I,te.yMaxLeft=F,te.yMinLeft=z>0?0:z,te.yMaxRight=R,te.yMinRight=E>0?0:E,v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(G=>G):te.dimensionList,te.dimensionList.forEach((G,Z)=>{te.formattedDimensionListMap.set(G,v[Z])}),ce=JSON.parse(JSON.stringify(g)),ke=te.dimensionList,e.plotArea.hideZeroValues&&(te.hideZeroValues=!0)},Ce=()=>{let W=st(te.yMaxLeft,te.yMinLeft,d,e,te,U,V,D,c).yAxisLabelArray;te.yMaxLeft=W[W.length-1],te.yMinLeft=W[0],Q=T.scaleLinear().domain([te.yMinLeft>=0?U!==void 0&&!Number.isNaN(U)?U:0:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:V!==void 0&&!Number.isNaN(V)?V:te.yMaxLeft*1.1]).range([0,c]),j&&(Ae=T.scaleLinear().domain([te.yMinRight>=0?(N||N==0)&&!Number.isNaN(N)?N:0:(N||N==0)&&!Number.isNaN(N)?N:te.yMinRight*1.1,te.yMaxRight<=0?$||0:$||te.yMaxRight*1.1]).range([0,c])),ge=[d,0]},Me=()=>{ie=T.scaleBand().domain(te.legendList).range([0,A]).paddingInner(te.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ke).range(ge).padding(.5)},ve=()=>{{let W=st(V||te.yMaxLeft,te.yMinLeft,d,e,te,U,V,D,c);we=T.axisBottom(Q).tickFormat(I=>_e(I,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickPadding(8).tickSizeOuter(0)}if(j){let W=st($||te.yMaxRight,N||te.yMinRight,d,e,te,N,$);fe=T.axisTop(Ae).tickFormat(I=>_e(I,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0)}},xe=()=>{ae=T.axisLeft(P).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*c*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(ke,d))},Fe=W=>{W.forEach(I=>{I.data.forEach(v=>{v.hideZero=I.properties.hideZeroValues,v.axis=I.properties.axis,v.legendUniqueId=I.properties.legendUniqueId})}),ke.forEach(I=>{m.append("rect").attr("id",`dim-background-${I}`).attr("class","dimension-background").attr("y",P(I)-A/2).attr("height",A).attr("x",0).attr("width",c).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),W.forEach(I=>{let v=m.selectAll(".parentGroup").data([I],k=>k.properties.legendUniqueId);v=v.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(v);let F=v.selectAll(".column-group").data(I.data.map(k=>({...k,properties:I.properties})),k=>k.legend+k.dimension),z=F.enter().append("g").attr("class","column-group").attr("hoverId",(I.properties.alias||I.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",k=>`translate(0, ${P(k.dimension)-A/2})`);F.attr("transform",k=>`translate(0, ${P(k.dimension)-A/2})`),z.merge(F).attr("transform",k=>`translate(0, ${P(k.dimension)-A/2})`);const R=z.append("rect").attr("y",k=>ie(k.legendUniqueId)).attr("height",ie.bandwidth()).attr("x",k=>{const M=I.properties.axis===at.primary?Q:Ae;return k.value>=0,M(0)}).attr("width",0).attr("fill",k=>J.get(I.properties.legendUniqueId)?.(k.value)??I.properties.color).attr("stroke-dasharray",k=>k.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",k=>`${k.properties.stackBorderWidth}px`).attr("stroke",k=>I.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?I.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",k=>k.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>I.properties.legendUniqueId).attr(Qe.DimValue,k=>Array.isArray(k.dimension)?String(k.dimension[0]):String(k.dimension));(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",k=>{const M=I.properties.axis===at.primary?Q:Ae;return k.value>=0?M(0):M(k.value)}).attr("width",k=>{const M=I.properties.axis===at.primary?Q:Ae,G=I.properties.axis===at.primary?V:$;return k.value>=0?G&&k.value>G?M(G)-M(0):M(k.value)-M(0):Math.abs(M(0)-M(k.value))}),z.merge(F).on("mousemove",(k,M)=>{(I.properties.alias||I.properties.name||"Legend").replace(/ /g,"-");const G=Array.isArray(M.dimension)?M.dimension[0]:M.dimension,Z=String(te.formattedDimensionListMap.get(G)??G??""),B=ht(l,String(G??""),{...I.properties,formattedDimensionValue:Z});ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:te.formattedDimensionListMap.get(Array.isArray(M.dimension)?M.dimension[0]:M.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?M[1]-M[0]:M.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,k,I.properties,B)}).on("mouseout",(k,M)=>{(I.properties.alias||I.properties.name||"Legend").replace(/ /g,"-"),rt()}).on("click",At(_,b,(k,M)=>({seriesId:I.properties.legendUniqueId,dimValue:Array.isArray(M.dimension)?String(M.dimension[0]):String(M.dimension),legendUniqueId:I.properties.legendUniqueId,seriesDisplayName:I.properties.alias||I.properties.name||""}))),F.exit().remove()}),m.selectAll(".parentGroup").raise()},ye=W=>{c=i-W.left-W.right,d=y-W.bottom-W.top},ee=(W,I,v)=>{ce=I,ke=W,Ve=v,Ka(r,C,ke),e.xAxisLabel.hideZeroValues&&(ke=ke.filter(F=>C.get(F)!==0)),Y()},Y=()=>{Me(),xe(),Ua(e,m,re,d,c,ae,fe,Q,te.yMaxLeft,ke,u,t,i,Le,A,P),Fe(ce),Da(ce,P,Q,Ae,X,dt,[],[],e,u,y,i,c,ke,d,L,a,h,ie,A,o,!1,D)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},nr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.StackHorizontalBarChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse(),H=r.DimensionList,D=!0,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U,V,N,$,X,se,re,oe,he,Le,pe,ue;const O=new Map;let q,w,p,C,c,d,i,y,f,a,m,P,ie=[],Q=0,Ae=2,ge=!1,we=[];const fe=!1;let ae=new Map,ke={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ce()}catch(Y){be("StackStackHorizontalBarchart","createStackHorizontalBarChart",Y)}},[e]);const ce=()=>{({formatOptions:e,svg:c,width:p,height:C}=kt(S,e)),me(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,ke.yMinLeft,ke.yMaxLeft,ke.yMinRight,ke.yMaxRight),{margin:U,yLabel:V,xLabel:N,yTitle:$,xTitle:X,dimensionHeightWidthArray:se,chartTitleHeight:re,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Le,visibleBars:Ae,columnWidth:A,scrollbarVisible:ge}=Tt(p,C,pe,ue,ke.yMaxLeft,e,ke.legendList,ke.dimensionList,ke.yMaxRight,j,fe,t,D,ke),Ce(U),vt(c,p,C,e),d=Ct(c,U),mt(d,e,0,q,w,u,L),Ve(),te(),Ya(e,d,V,w,q,a),Mt(e,D,c,U,N,C,X,ke.chartType,V,q,w),St(w,e,0,D,c,U,$,V,p),Ft(c,e,p,re),Dt(C,c,se,re,p,he,e,[...g].reverse(),L,0,U,nt.rectangle,u,n),Bt(g,C,p,c,U,q,ge,Ae,ke,Q,!1,Me,D)},me=()=>{const Y=[],W=[];let I=-1/0,v=1/0;g.forEach((M,G)=>{const Z=`${G}~$~${M.properties.legend}`;M.properties.legend=Z,W.push(Z),I=-1/0,v=1/0;for(const B of M.data)I=Math.max(I,B.value),v=Math.min(v,B.value),Y.push(B);M.properties.setColorScale&&O.set(M.properties.legendUniqueId,T.scaleSequential().domain([v,I]).interpolator(T.interpolateRgb(M.properties.startColor,M.properties.endColor)))}),ke.chartData=Y,ke.legendList=W,ie=JSON.parse(JSON.stringify(g));let F=pt(ke.dimensionList,g,fe);e.plotArea.fitChart?P=ke.dimensionList:(P=ke.dimensionList.slice(Q,Q+Ae),ie.forEach((M,G)=>ie[G].data=M.data.filter(Z=>P.includes(Z.dimension))));const z=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(F);xe();let R=1/0,E=-1/0;for(const M of z)for(const[G,Z]of M)R=Math.min(R,G),E=Math.max(E,Z);ke.yMinLeft=R>0?0:R,ke.yMaxLeft=E;let k=t?gt(e.xAxisLabel.xAxisNumberFormat,ke.dimensionList).map(M=>M):ke.dimensionList;ke.dimensionList.forEach((M,G)=>{ke.formattedDimensionListMap.set(M,k[G])}),e.plotArea.hideZeroValues&&(ke.hideZeroValues=!0)},Ve=()=>{let Y=st(ke.yMaxLeft,ke.yMinLeft,w,e,ke,K,J,D,q).yAxisLabelArray;ke.yMaxLeft=Y[Y.length-1],ke.yMinLeft=Y[0],i=T.scaleLinear().domain([ke.yMinLeft>=0?K!==void 0&&!Number.isNaN(K)?K:0:ke.yMinLeft<0?ke.yMinLeft*1.1:ke.yMinLeft*.9,ke.yMaxLeft<=0?0:J!==void 0&&!Number.isNaN(J)?J:ke.yMaxLeft*1.1]).range([0,q]),f=[w,0]},Ye=()=>{y=T.scalePoint().domain(P).range(f).padding(.5)},te=()=>{{let Y=st(J||ke.yMaxLeft,ke.yMinLeft,w,e,ke,K,J,D,q);a=T.axisBottom(i).tickFormat(W=>_e(W,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-w:0).tickValues(Y.autoLabelFlag?void 0:Y.yAxisLabelArray).ticks(Y.customTickValue).tickPadding(8).tickSizeOuter(0)}},de=()=>{m=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,w))},Pe=Y=>{Y.forEach(k=>{k.data.forEach(M=>{M.hideZero=k.properties.hideZeroValues,M.axis=k.properties.axis})}),P.forEach(k=>{d.append("rect").attr("id",`dim-background-${k}`).attr("class","dimension-background").attr("y",y(k)-A/2).attr("height",A).attr("x",0).attr("width",q).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let W=d.selectAll(".parentGroup").data([we]);W=W.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${L}-clip)`).merge(W);let I=W.selectAll(".column-group").data(k=>k);I=I.enter().append("g").attr("class",k=>"column-group "+k.key.replace(/ /g,"-")).attr("hoverId",k=>(Y[k.index].properties.alias||Y[k.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(I);let F=I.selectAll("rect").data(k=>k);const z=(k,M)=>{const G=Array.from(I.nodes()).indexOf(k[M].parentNode);return{props:g[G]?.properties,groupIndex:G}},R=F.enter().append("rect").merge(F).attr("y",k=>y(k.data.dimension)-A/2).attr("height",A).attr("fill",(k,M,G)=>{const{props:Z}=z(G,M);return O.get(Z.legendUniqueId)?.(k.data[k.key])??Z?.color??"gray"}).attr("stroke",(k,M,G)=>{const Z=z(G,M).props;return Z?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?Z.stackBorderColor:"none"}).attr("stroke-dasharray",(k,M,G)=>z(G,M).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(k,M,G)=>(z(G,M).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",k=>Math.min(i(k[0]),i(k[1]))).attr("width",0).attr("visibility",(k,M,G)=>{const Z=z(G,M).props;return k.data[k.key]===0&&Z?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,k=>k.key??"").attr(Qe.DimValue,k=>Array.isArray(k.data.dimension)?String(k.data.dimension[0]):String(k.data.dimension)).on("mousemove",(k,M)=>{const G=M.data.dimension;ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ke.formattedDimensionListMap.get(G)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():M.properties?.currentMeasure?M.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||M.value,value:_e(M.data[M.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:M.properties.alias}],e,k,M.properties,ht(x,String(G??""),{...M.properties,formattedDimensionValue:String(ke.formattedDimensionListMap.get(G)??G??"")}))}).on("mouseout",(k,M)=>{M.data.dimension,rt()}).on("click",At(_,b,(k,M)=>({seriesId:M.key,dimValue:Array.isArray(M.data.dimension)?String(M.data.dimension[0]):String(M.data.dimension),legendUniqueId:M.key,seriesDisplayName:M.properties?.alias||M.properties?.name||""})));R.attr("x",k=>i(0)),(e.animation.animationEnabled?R.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):R).attr("x",k=>Math.min(i(k[0]),i(k[1]))).attr("width",k=>Math.abs(i(k[1])-i(k[0]))),I.exit().remove(),d.selectAll(".parentGroup").raise()},Ce=Y=>{q=p-Y.left-Y.right,w=C-Y.bottom-Y.top},Me=(Y,W,I)=>{ie=W,P=Y,Ae=I,Ka(r,ae,P),xe(),ve()},ve=()=>{Ye(),de(),Ua(e,d,N,w,q,m,void 0,i,ke.yMaxLeft,P,u,t,p,se,A,y);const Y=new Map;P.forEach((W,I)=>{let v=0;we.forEach(F=>{const z=F[I]?.[0]??0;z<v&&(v=z)}),Y.set(W,v)}),Pe(ie),Va(we,y,i,void 0,U,dt,[],[],e,u,C,p,q,P,w,L,c,h,0,o,D),qa(ae,y,i,U,dt,[],e,u,C,p,c,o,D,Y),Fe(),d.selectAll(".connectors").raise()},xe=()=>{let Y=pt(P,ie,fe);we=T.stack().keys(ke.legendList).offset(T.stackOffsetDiverging)(Y),ie.forEach((I,v)=>I.data.forEach((F,z)=>{F[0]=we[v][z][0],F[1]=we[v][z][1]}));let W=e.annotation.annotationSetLabelColor;we.forEach((I,v)=>I.forEach(F=>{F.key=I.key,I.color=JSON.parse(JSON.stringify(g[v].properties.color)),F.data.labelPosition=g[v].properties.dataLabelPosition,F.data.labelColor=W=="2"?JSON.parse(JSON.stringify(g[v].properties.color)):g[v].properties.labelColor,F.hideZero=JSON.parse(JSON.stringify(g[v].properties.hideZeroValues)),F.properties=g[v].properties}))},Fe=()=>{try{const Y=Number(e.connector?.connectorVisibility);if(!e.connector||Y===2)return;const W=[],I=[],v=[];let F;const z=[];if(Y===1)F=1;else if(Y===3){const B=Number(e.connector.connectorFollow);B===1?F=Number(e.connector.connectorStepSize):B===2&&((e.connector.connectorExclude||[]).forEach(Se=>v.push(Se)),F=1)}const R=[],E=[],k=[],M=e.connector?.connectorCustomRange||[];v.forEach(B=>{const Se=B.split("-");Se.length&&R.push(Se[0])});const Z=(we?.[0]||[]).map((B,Se)=>({Dimension:B.data.dimension,Total:B.data.total,CustomTotal:B.data.total-(k[Se]??0),Index:Se}));if(F!=null){for(let B=0;B<Z.length;B++)(F===1||B%F===0&&F!==1)&&W.push(Z[B]);for(let B=F;B<Z.length;B+=F){const Se=Math.min(B+F,Z.length);let ze=-1/0;for(let Ie=B;Ie<Se;Ie++)Z[Ie].Total>ze&&(ze=Z[Ie].Total);ze!==-1/0&&z.push(ze)}for(let B=1;B<W.length;B++)I.push(W[B])}else{const B=[];(M||[]).forEach(Se=>{if(Se?.from&&Se?.to){const ze=Z.some(Oe=>Oe.Dimension===Se.from),Ie=Z.some(Oe=>Oe.Dimension===Se.to);ze&&Ie&&B.push({from:Se.from,to:Se.to})}}),B.forEach(Se=>{const ze=Z.findIndex(Oe=>Oe.Dimension===Se.from),Ie=Z.findIndex(Oe=>Oe.Dimension===Se.to);if(ze>=0&&Ie>=0){const Oe=Math.min(ze,Ie),lt=Math.max(ze,Ie);W.push(Z[Oe]);let ut=Z[Oe]?.Total??-1/0;for(let tt=Oe;tt<=lt;tt++)Z[tt].Total>ut&&(ut=Z[tt].Total);ut!==-1/0&&z.push(ut),I.push(Z[lt])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==De.white?e.connector.connectorMarkerColor:"none"),ye(W,z,I,F,R),ee(W,z,I,F,R)}catch(Y){console.error(Y)}},ye=(Y,W,I,v,F)=>{try{const z=y.bandwidth()??0,R=d.selectAll(".connector-paths").data([0]),E=R.enter().append("g").attr("class","connector-paths connectors").merge(R),k=Y.filter((Z,B)=>v!=null?B<Y.length-1:B<Y.length),M=E.selectAll("path.connector-path").data(k,(Z,B)=>Z?.Dimension??B);M.exit().remove(),M.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(M).attr("d",(Z,B)=>{const Se=I?.[B]??{Total:0,Dimension:Z.Dimension},ze=Z?.Total??0,Ie=typeof Se.Total=="number"?i(Se.Total):0,Oe=typeof ze=="number"?i(ze):0,lt=Math.max(Ie,Oe);return e.total.totalVisibility?`M ${Oe+50},
74
- ${y(Z.Dimension)+z/2-5}
75
- H ${60+lt}
76
- V ${y(Se.Dimension)+z/2+5}
77
- H ${30+Ie}`:`M ${Oe+30},
78
- ${y(Z.Dimension)+z/2-5}
79
- H ${45+lt}
80
- V ${y(Se.Dimension)+z/2+5}
81
- H ${10+Ie}`}).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(Z,B)=>F.includes(Z.Dimension)||Z.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(z){console.error(z)}},ee=(Y,W,I,v,F)=>{try{const z=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,R=mi(z,A);let E=e.connector.connectorFontStyle,k=e.connector.connectorNumberFormat,M=w/30<P.length?Math.round(w/30):P.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(k=".2s");const G=Y.filter((Ie,Oe)=>v!=null?Oe<Y.length-1:Oe<Y.length),Z=d.selectAll(".connector-texts").data([0]),Se=Z.enter().append("g").attr("class","connector-texts connectors").merge(Z).selectAll("text.connector-text").data(G,Ie=>Ie?.Dimension??Ie);Se.exit().remove(),Se.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(Se).attr("y",(Ie,Oe)=>{const lt=I?.[Oe]??{Dimension:Ie.Dimension,Total:0},ut=y(Ie.Dimension)??0;return(y(lt.Dimension)??ut)+v*R/2}).attr("x",(Ie,Oe)=>{const lt=I?.[Oe]??{Total:0},ut=Ie?.Total??0,tt=Math.max(i(lt.Total),i(ut));return e.total.totalVisibility?70+tt:50+tt}).text((Ie,Oe)=>{const lt=I?.[Oe]??{Total:0,CustomTotal:0,Dimension:Ie.Dimension};return Ie.CustomTotal==0&&lt.CustomTotal!=0&&(Ie.CustomTotal=1),ui(lt.Total,Ie.Total,parseInt(e.connector.connectorDecimalPrecision),k,parseInt(Ie.Dimension),parseInt(lt.Dimension),e)}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",E.includes("Italic")?"Italic":"").style("text-decoration",E.includes("Underline")?"Underline":"").style("font-weight",E.includes("Bold")?"Bold":"").style("visibility",(Ie,Oe)=>F.includes(Ie.Dimension)||Ie.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(z){console.error(z)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},sr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.NormalizedStackHorizontalBarChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse(),H=r.DimensionList,D=!0,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p;const C=new Map;let c,d,i,y,f,a,m,P,ie=[],Q=0,Ae,ge=!1,we=[];const fe=!0;let ae={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(xe){be("StackNormalizedStackBarchart","createNormalizedStackBarChart",xe)}},[e]);const ke=()=>{({formatOptions:e,svg:c,width:w,height:p}=kt(S,e)),ce(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:ue}=Nt(e,ae.yMinLeft,ae.yMaxLeft,ae.yMinRight,ae.yMaxRight),{margin:U,yLabel:V,xLabel:N,yTitle:$,xTitle:X,dimensionHeightWidthArray:se,chartTitleHeight:re,secondaryAxisTitleWidth:oe,legendMargin:he,secondaryYLabel:Le,visibleBars:Ae,columnWidth:A,scrollbarVisible:ge}=Tt(w,p,pe,ue,ae.yMaxLeft,e,ae.legendList,ae.dimensionList,ae.yMaxRight,j,fe,t,D,ae),Pe(U),vt(c,w,p,e),d=Ct(c,U),mt(d,e,0,O,q,u),me(),Ye(),Ya(e,d,V,q,O,a),Mt(e,D,c,U,N,p,X,ae.chartType,V,O,q),St(q,e,0,D,c,U,$,V,O),Ft(c,e,w,re),Dt(p,c,se,re,w,he,e,[...g].reverse(),L,0,U,nt.rectangle,u,n),Bt(g,p,w,c,U,O,ge,Ae,ae,Q,!1,ve,D)},ce=()=>{const xe=[],Fe=[];let ye=-1/0,ee=1/0;g.forEach((F,z)=>{const R=`${z}~$~${F.properties.legend}`;F.properties.legend=R,Fe.push(R),ye=-1/0,ee=1/0;for(const E of F.data)ye=Math.max(ye,E.value),ee=Math.min(ee,E.value),xe.push(E);F.properties.setColorScale&&C.set(F.properties.legendUniqueId,T.scaleSequential().domain([ee,ye]).interpolator(T.interpolateRgb(F.properties.startColor,F.properties.endColor)))}),ae.chartData=xe,ae.legendList=Fe,ie=JSON.parse(JSON.stringify(g));let Y=pt(ae.dimensionList,g,fe);e.plotArea.fitChart?P=ae.dimensionList:(P=ae.dimensionList.slice(Q,Q+Ae),ie.forEach((F,z)=>ie[z].data=F.data.filter(R=>P.includes(R.dimension))));const W=T.stack().keys(ae.legendList).offset(T.stackOffsetDiverging)(Y);Me();let I=1/0;for(const F of W)for(const[z,R]of F)I=Math.min(I,z);ae.yMinLeft=I>0?0:I,ae.yMaxLeft=1;let v=t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(F=>F):ae.dimensionList;ae.dimensionList.forEach((F,z)=>{ae.formattedDimensionListMap.set(F,v[z])}),e.plotArea.hideZeroValues&&(ae.hideZeroValues=!0)},me=()=>{let xe=st(J||ae.yMaxLeft,ae.yMinLeft,q,e,ae,K,J,D,O).yAxisLabelArray;ae.yMaxLeft=xe[xe.length-1],ae.yMinLeft=xe[0],i=T.scaleLinear().domain([ae.yMinLeft<0?-1:0,1]).range([0,O]),f=[q,0]},Ve=()=>{y=T.scalePoint().domain(P).range(f).padding(.5)},Ye=()=>{a=T.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-q:0).ticks(O/80,"%").tickPadding(8).tickSizeOuter(0)},te=()=>{m=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*O*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,q))},de=xe=>{we.forEach((F,z)=>F.forEach((R,E)=>{xe[z].data[E][0]=R[0]=R.data.total===0?0:R[0]/R.data.total,xe[z].data[E][1]=R[1]=R.data.total===0?0:R[1]/R.data.total})),xe.forEach(F=>{F.data.forEach(z=>{z.hideZero=F.properties.hideZeroValues,z.axis=F.properties.axis})}),P.forEach(F=>{d.append("rect").attr("id",`dim-background-${F}`).attr("class","dimension-background").attr("y",y(F)-y.bandwidth()/2).attr("height",y.bandwidth()).attr("x",0).attr("width",O).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Fe=d.selectAll(".parentGroup").data([we]);Fe=Fe.enter().append("g").attr("class","columns parentGroup").merge(Fe);let ye=Fe.selectAll(".column-group").data(F=>F);ye=ye.enter().append("g").attr("class",F=>"column-group "+F.key.replace(/ /g,"-")).attr("hoverId",F=>(xe[F.index].properties.alias||xe[F.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(ye);let Y=ye.selectAll("rect").data(F=>F);const W=(F,z)=>{const R=Array.from(ye.nodes()).indexOf(F[z].parentNode);return{props:g[R]?.properties,groupIndex:R}},I=Y.enter().append("rect").merge(Y).attr("y",F=>y(F.data.dimension)-A/2).attr("height",A).attr("fill",(F,z,R)=>{const{props:E}=W(R,z);return C.get(E.legendUniqueId)?.(F.data[F.key])??E?.color??"gray"}).attr("stroke",(F,z,R)=>{const E=W(R,z).props;return E?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?E.stackBorderColor:"none"}).attr("stroke-dasharray",(F,z,R)=>W(R,z).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(F,z,R)=>(W(R,z).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",F=>i(0)).attr("width",0).attr("visibility",(F,z,R)=>{const E=W(R,z).props;return F.data[F.key]===0&&E?.hideZeroValues?"hidden":"visible"}).attr(Qe.SeriesId,F=>F.key??"").attr(Qe.DimValue,F=>Array.isArray(F.data.dimension)?String(F.data.dimension[0]):String(F.data.dimension)).on("mousemove",(F,z)=>{const R=z.data.dimension;ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ae.formattedDimensionListMap.get(R)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():z.properties?.currentMeasure?z.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||z.value,value:_e(z[1]-z[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:z.properties.alias}],e,F,z.properties,ht(x,String(R??""),{...z.properties,formattedDimensionValue:String(ae.formattedDimensionListMap.get(R)??R??"")}))}).on("mouseout",(F,z)=>{let R=(z.properties.alias||z.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+R+'"]').classed("highlight",!1).classed("unhighlight",!1),rt()}).on("click",At(_,b,(F,z)=>({seriesId:z.key,dimValue:Array.isArray(z.data.dimension)?String(z.data.dimension[0]):String(z.data.dimension),legendUniqueId:z.key,seriesDisplayName:z.properties?.alias||z.properties?.name||""})));(e.animation.animationEnabled?I.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):I).attr("x",F=>Math.min(i(F[0]),i(F[1]))).attr("width",F=>Math.abs(i(F[1])-i(F[0]))),ye.exit().remove(),d.selectAll(".parentGroup").raise()},Pe=xe=>{O=w-xe.left-xe.right,q=p-xe.bottom-xe.top},Ce=()=>{Ve(),te(),Ua(e,d,N,q,O,m,void 0,i,ae.yMaxLeft,P,u,t,w,se,A,y),de(ie),Va(we,y,i,void 0,U,dt,[],[],e,u,p,w,O,P,q,L,c,h,0,o,D)},Me=()=>{let xe=pt(P,ie,fe);we=T.stack().keys(ae.legendList).offset(T.stackOffsetDiverging)(xe),ie.forEach((ye,ee)=>ye.data.forEach((Y,W)=>{Y[0]=we[ee][W][0],Y[1]=we[ee][W][1]}));let Fe=e.annotation.annotationSetLabelColor;we.forEach((ye,ee)=>ye.forEach(Y=>{Y.key=ye.key,ye.color=JSON.parse(JSON.stringify(g[ee].properties.color)),Y.data.labelPosition=g[ee].properties.dataLabelPosition,Y.data.labelColor=Fe=="2"?JSON.parse(JSON.stringify(g[ee].properties.color)):g[ee].properties.labelColor,Y.hideZero=JSON.parse(JSON.stringify(g[ee].properties.hideZeroValues)),Y.properties=g[ee].properties}))},ve=(xe,Fe,ye)=>{ie=Fe,P=xe,Ae=ye,Me(),Ce()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID();let A=0;const u=le.LayeredHorizontalBarChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!0,j=!1,K=new Map;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie=[],Q=0,Ae=2,ge=!1,we=[];const fe=!1;let ae={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(ee){be("StackStackHorizontalBarchart","createStackHorizontalBarChart",ee)}},[e]);const ke=()=>{({formatOptions:e,svg:c,width:p,height:C}=kt(S,e)),ce(),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ae.yMinLeft,ae.yMaxLeft,ae.yMinRight,ae.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe,visibleBars:Ae,columnWidth:A,scrollbarVisible:ge}=Tt(p,C,ue,O,ae.yMaxLeft,e,ae.legendList,ae.dimensionList,ae.yMaxRight,j,fe,t,D,ae),Pe(V),vt(c,p,C,e),d=Ct(c,V),mt(d,e,0,q,w,u,L),me(),Ye(),Ya(e,d,N,w,q,a),Mt(e,D,c,V,$,C,se,ae.chartType,N,q,w),St(w,e,0,D,c,V,X,N),Ft(c,e,p,oe),Dt(C,c,re,oe,p,Le,e,g,L,0,V,nt.rectangle,u,n),Bt(g,C,p,c,V,q,ge,Ae,ae,Q,!1,Ce,D)},ce=()=>{const ee=[],Y=[];let W=[],I=-1/0,v=1/0,F=-1/0,z=1/0,R=-1/0,E=1/0;g.forEach(k=>{Y.push(k.properties.legendUniqueId),R=-1/0,E=1/0,k.data.forEach(M=>{ee.push(M),R=Math.max(R,M.value),E=Math.min(E,M.value),I=Math.max(I,M.value),v=Math.min(v,M.value)}),k.properties.setColorScale&&K.set(k.properties.legendUniqueId,T.scaleSequential().domain([E,R]).interpolator(T.interpolateRgb(k.properties.startColor,k.properties.endColor)))}),ae.chartData=ee,ae.legendList=Y,ae.yMaxLeft=I,ae.yMinLeft=v>0?0:v,ae.yMaxRight=F,ae.yMinRight=z,W=t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(k=>k):ae.dimensionList,W=t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(k=>k):ae.dimensionList,ae.dimensionList.forEach((k,M)=>{ae.formattedDimensionListMap.set(k,W[M]),ae.formattedDimensionListMap.set(k,W[M])}),ie=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?P=ae.dimensionList:P=ae.dimensionList.slice(Q,Q+Ae),e.plotArea.hideZeroValues&&(ae.hideZeroValues=!0)},me=()=>{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U,D,q).yAxisLabelArray;ae.yMaxLeft=ee[ee.length-1],ae.yMinLeft=ee[0],i=T.scaleLinear().domain([ae.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:ae.yMinLeft<0?ae.yMinLeft*1.1:ae.yMinLeft*.9,ae.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:ae.yMaxLeft*1.1]).range([0,q]),f=[w,0],Ve()},Ve=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,A]).paddingInner(ae.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=T.scalePoint().domain(P).range(f).padding(.5)},Ye=()=>{te();{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U,D,q);a=T.axisBottom(i).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-w:0).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue).tickPadding(8).tickSizeOuter(0)}},te=()=>{m=T.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(P,w))},de=ee=>{ee.forEach(Y=>{Y.data.forEach(W=>{W.hideZero=Y.properties.hideZeroValues,W.axis=Y.properties.axis,W.properties=Y.properties})}),ee.forEach((Y,W)=>{let I=d.selectAll(`.parentGroup-${Y.properties.legendUniqueId}`).data([Y],E=>E.properties.legendUniqueId);I=I.enter().append("g").attr("class",`column parentGroup parentGroup-${Y.properties.legendUniqueId}`).attr("clip-path",`url(#${L}-clip)`).merge(I);let v=I.selectAll(".column-group").data(Y.data,E=>E.dimension+"_"+Y.properties.legendUniqueId),F=v.enter().append("g").attr("class","column-group").attr("hoverId",(Y.properties.alias||Y.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",E=>W===0?`translate(0, ${y(E.dimension)-A/2})`:`translate(0, ${y(E.dimension)-A/(2+W*2)})`);v.attr("transform",E=>W===0?`translate(0, ${y(E.dimension)-A/2})`:`translate(0, ${y(E.dimension)-A/(2+W*2)})`),F.merge(v).attr("transform",E=>W===0?`translate(0, ${y(E.dimension)-A/2})`:`translate(0, ${y(E.dimension)-A/(2+W*2)})`);const z=F.append("rect").attr("y",0).attr("height",W===0?A:A/2).attr("x",()=>i(0)).attr("width",0).attr("fill",E=>K.get(Y.properties.legendUniqueId)?.(E.value)??Y.properties.color).attr("stroke-dasharray",()=>Y.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${Y.properties.stackBorderWidth}px`).attr("stroke",()=>Y.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Y.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",E=>E.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(Qe.SeriesId,()=>Y.properties.legendUniqueId).attr(Qe.DimValue,E=>Array.isArray(E.dimension)?String(E.dimension[0]):String(E.dimension));(e.animation.animationEnabled?z.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):z).attr("x",E=>E.value>0?i(0):i(E.value)).attr("width",E=>E.value>0?i(E.value)-i(0):Math.abs(i(0)-i(E.value))),v.select("rect").transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("x",E=>E.value>0?i(0):i(E.value)).attr("width",E=>E.value>0?i(E.value)-i(0):Math.abs(i(0)-i(E.value))),F.merge(v).on("mousemove",(E,k)=>{ot([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ae.formattedDimensionListMap.get(k.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():k.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||k.value,value:_e(k.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Y.properties.alias}],e,E,Y.properties,ht(x,String(k.dimension??""),{...Y.properties,formattedDimensionValue:String(ae.formattedDimensionListMap.get(k.dimension)??k.dimension??"")}))}).on("mouseout",()=>{rt()}).on("click",At(_,b,(E,k)=>({seriesId:Y.properties.legendUniqueId,dimValue:Array.isArray(k.dimension)?String(k.dimension[0]):String(k.dimension),legendUniqueId:Y.properties.legendUniqueId,seriesDisplayName:Y.properties.alias||Y.properties.name||""}))),v.exit().remove()}),d.selectAll(".parentGroup").raise()},Pe=ee=>{q=p-ee.left-ee.right,w=C-ee.bottom-ee.top},Ce=(ee,Y,W)=>{ie=Y,P=ee,Ae=W,Me()},Me=()=>{Ve(),te(),Ua(e,d,$,w,q,m,void 0,i,ae.yMaxLeft,P,u,t,p,re,A,y),ve(),de(ie),Da(ie,y,i,void 0,V,dt,[],[],e,u,C,p,q,P,w,L,c,h,void 0,A,o,!1,D),xe()},ve=()=>{let ee=pt(P,ie,fe);we=T.stack().keys(ae.legendList).offset(T.stackOffsetDiverging)(ee),ie.forEach((W,I)=>W.data.forEach((v,F)=>{v[0]=we[I][F][0],v[1]=we[I][F][1]}));let Y=e.annotation.annotationSetLabelColor;we.forEach((W,I)=>W.forEach(v=>{v.key=W.key,W.color=JSON.parse(JSON.stringify(g[I].properties.color)),v.data.labelPosition=g[I].properties.dataLabelPosition,v.data.labelColor=Y=="2"?JSON.parse(JSON.stringify(g[I].properties.color)):g[I].properties.labelColor,v.hideZero=JSON.parse(JSON.stringify(g[I].properties.hideZeroValues))}))},xe=()=>{try{const ee=Number(e.connector?.connectorVisibility);if(!e.connector||ee===2)return;const Y=[],W=[],I=[];let v;const F=[];if(ee===1)v=1;else if(ee===3){const Z=Number(e.connector.connectorFollow);Z===1?v=Number(e.connector.connectorStepSize):Z===2&&((e.connector.connectorExclude||[]).forEach(B=>I.push(B)),v=1)}const z=[],R=[],E=[],k=e.connector?.connectorCustomRange||[];I.forEach(Z=>{const B=Z.split("-");B.length&&z.push(B[0])});const G=(we?.[0]||[]).map((Z,B)=>({Dimension:Z.data.Dimension,Total:Z.data.Total,CustomTotal:Z.data.Total-(E[B]??0),Index:B}));if(v!=null){for(let Z=0;Z<G.length;Z++)(v===1||Z%v===0&&v!==1)&&Y.push(G[Z]);for(let Z=v;Z<G.length;Z+=v){const B=Math.min(Z+v,G.length);let Se=-1/0;for(let ze=Z;ze<B;ze++)G[ze].Total>Se&&(Se=G[ze].Total);Se!==-1/0&&F.push(Se)}for(let Z=1;Z<Y.length;Z++)W.push(Y[Z])}else{const Z=[];(k||[]).forEach(B=>{if(B?.from&&B?.to){const Se=G.some(Ie=>Ie.Dimension===B.from),ze=G.some(Ie=>Ie.Dimension===B.to);Se&&ze&&Z.push({from:B.from,to:B.to})}}),Z.forEach(B=>{const Se=G.findIndex(Ie=>Ie.Dimension===B.from),ze=G.findIndex(Ie=>Ie.Dimension===B.to);if(Se>=0&&ze>=0){const Ie=Math.min(Se,ze),Oe=Math.max(Se,ze);Y.push(G[Ie]);let lt=G[Ie]?.Total??-1/0;for(let ut=Ie;ut<=Oe;ut++)G[ut].Total>lt&&(lt=G[ut].Total);lt!==-1/0&&F.push(lt),W.push(G[Oe])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==De.white?e.connector.connectorMarkerColor:"none"),Fe(Y,F,W,v,z),ye(Y,F,W,v,z)}catch(ee){console.error(ee)}},Fe=(ee,Y,W,I,v)=>{try{d.append("g").selectAll("path").data(ee).enter().filter((F,z)=>I!=null?z<ee.length-1:z<ee.length).append("path").attr("d",(F,z)=>e.total.totalVisibility?`M ${i(F.Total)+50},
82
- ${y(F.Dimension)+y.bandwidth()/2-5}
83
- H ${60+Math.max(i(Y[z]),i(W[z].Total),i(F.Total))}
84
- V ${y(W[z].Dimension)+y.bandwidth()/2+5}
85
- H ${30+i(W[z].Total)}`:`M ${i(F.Total)+30},
86
- ${y(F.Dimension)+y.bandwidth()/2-5}
87
- H ${45+Math.max(i(Y[z]),i(W[z].Total),i(F.Total))}
88
- V ${y(W[z].Dimension)+y.bandwidth()/2+5}
89
- H ${10+i(W[z].Total)}
90
- `).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",F=>v.includes(F.Dimension)||F.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}},ye=(ee,Y,W,I,v)=>{try{let F=e.connector.connectorFontStyle,z=e.connector.connectorNumberFormat,R=w/30<P.length?Math.round(w/30):P.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(z=".2s"),d.append("g").selectAll("text1").data(ee).enter().filter((E,k)=>I!=null?k<ee.length-1:k<ee.length).append("text").attr("y",(E,k)=>I==null?y(W[k].Dimension)/2+y(E.Dimension)/2+15:I==1?R<6&&y.bandwidth()>40?y(W[k].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(W[k].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(W[k].Dimension)+y.bandwidth()/2+y.bandwidth()/2*I+12).attr("x",(E,k)=>e.total.totalVisibility?70+Math.max(i(Y[k]),i(W[k].Total),i(E.Total)):50+Math.max(i(Y[k]),i(W[k].Total),i(E.Total))).text((E,k)=>(E.CustomTotal==0&&W[k].CustomTotal!=0&&(E.CustomTotal=1),ui(W[k].Total,E.Total,parseInt(e.connector.connectorDecimalPrecision),z,parseInt(E.Dimension),parseInt(W[k].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",F.includes("Italic")?"Italic":"").style("text-decoration",F.includes("Underline")?"Underline":"").style("font-weight",F.includes("Bold")?"Bold":"").style("visibility",E=>v.includes(E.Dimension)||E.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:r})=>{const o=crypto.randomUUID(),h=0,n=le.ColumnHistogramChart,l=Te.useRef(),s=r.ChartData,x=r.DimensionList,L=!1,A=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,g=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,H,D,j,K,J,U,V,N,$,X,se,re,oe,he,Le,pe=[],ue=[],O,q,w,p,C,c,d,i,y,f,a,m=[],P=0;const ie=2;let Q={dimensionList:x,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ae()}catch(de){be("HorizontalHistogramChart","createHorizontalChart",de)}},[e]);const Ae=()=>{({formatOptions:e,svg:C,width:O,height:q}=kt(l,e)),ge(),{formatOptions:e}=Qt(e,s,r.DataTableData??[]),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:re}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:H,yLabel:D,xLabel:j,yTitle:K,xTitle:J,dimensionHeightWidthArray:U,chartTitleHeight:V,secondaryAxisTitleWidth:N,legendMargin:$,secondaryYLabel:X}=Tt(O,q,se,re,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,A,u,t),Ve(H),{dataTable:w,dataTableHeight:p}=ea(e,D,K,s,Q.dimensionList),vt(C,O,q,e),c=Ct(C,H),mt(c,e,p,oe,he,n),we(),ae(),ke(),qt(c,Q,j,e,p,d,f,U,q,h,t,oe,he,a,d),Gt(c,e,p,D,y,he),Ye(s,q,C,H,oe),Mt(e,L,C,H,j,q,J,Q.chartType,D,oe,he),St(he,e,p,L,C,H,K,D),Ut(C,A,H,e,p,he,oe,X,N),Ft(C,e,O,V),Dt(q,C,U,V,O,$,e,s,o,p,H,nt.rectangle)},ge=()=>{const de=[],Pe=[];let Ce=[],Me=-1/0,ve=1/0;s.forEach(ye=>{Pe.push(ye.legend),ye.data.forEach(ee=>{de.push(ee),Me=Math.max(Me,ee.value),ve=Math.min(ve,ee.value)})}),Q.chartData=de,Q.legendList=Pe,Q.yMaxLeft=Me,Q.yMinLeft=ve>0?0:ve,m=JSON.parse(JSON.stringify(s)),m.forEach(ye=>ye.data.forEach(ee=>Ce.push(ee.value)));let xe=S||S==0?S:0,Fe=b||b==0?b:m[0]?.data?.length;if(Q.yMaxLeft=parseFloat((xe+"").length>(Fe+"").length?xe+"":Fe+""),Q.xMax=T.max(Ce),Q.xMin=T.min(Ce),Q.xMin===Q.xMax){const ye=Q.xMax===0?1:Math.abs(Q.xMax*.1);Q.xMin-=ye,Q.xMax+=ye}},we=()=>{switch(e.bins.binsCalculation){case"Automatic":Le=he/50;break;case"Number of Bins":fe(!1);break;case"Bin Width":fe(!0)}},fe=de=>{m.forEach(ve=>ve.data.sort((xe,Fe)=>xe.value-Fe.value));let Pe=Q.xMax-Q.xMin,Ce;de?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),Ce=Pe/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),Ce=Pe/parseFloat(e.bins.binsCalculationValue));let Me=Q.xMin;if(de)for(pe=[Me];Me<Q.xMax;)Me+=Ce,pe.push(Me);else for(pe=[Me];Math.round(Me)<Math.round(Q.xMax);)Me+=Ce,pe.push(Math.round(Me))},ae=()=>{d=T.scaleLinear().domain([Q.xMin,Q.xMax]).range([he,0]);const de=pe.length>0?pe:d.ticks(Le);let Pe=T.bin().value(Me=>Me).domain(d.domain()).thresholds(de);m.forEach(Me=>{let ve=Pe(Me.data.map(xe=>xe.value));ue.push(ve)}),m.forEach((Me,ve)=>ue[ve].forEach(xe=>{xe.name=Me.properties.legend,xe.color=Me.properties.color,xe.opacity=Me.properties.opacity}));let Ce=[];ue.forEach(Me=>Me.forEach(ve=>Ce.push(ve.length))),Q.yMaxLeft=T.max(Ce),Q.yMinLeft=T.min(Ce),i=T.scaleLinear().domain([_||_==0?_:0,g||g==0?g:Q.yMaxLeft+.2*Q.yMaxLeft]).range([0,oe])},ke=()=>{ce();{let de=st(Q.yMaxLeft,Q.yMinLeft,oe,e,Q,S,b,!1,he);f=T.axisBottom(i).tickFormat(Pe=>_e(Pe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-he+0:0).tickValues(de.autoLabelFlag?void 0:de.yAxisLabelArray).ticks(de.customTickValue).tickPadding(8).tickSizeOuter(0)}},ce=()=>{hi(Q.xMax,Q.xMin,he,e,_,g,oe,!1).xAxisLabelArray.shift(),y=T.axisLeft(d).tickFormat(Pe=>_e(Pe,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-oe:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(Le):y.tickValues(pe).ticks(he/50)},me=de=>{const Pe=e.animation.animationEnabled,Ce=c.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(ue).enter().append("g").selectAll("rect").data(ve=>ve).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",0).attr("y",ve=>{const xe=d(ve.x0),Fe=d(ve.x1);return Math.min(xe,Fe)}).attr("height",ve=>{const xe=d(ve.x0),Fe=d(ve.x1),ye=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(Fe-xe)-ye)}).attr("width",0).style("fill",ve=>ve.color!==De.white?ve.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(ve,xe)=>{ot([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():xe.properties?.currentMeasure?xe.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${xe.x0}-${xe.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:_e(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(xe.length/m[0].data.length):xe.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,ve)}).on("mouseout",rt);(Pe?Ce.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):Ce).attr("width",ve=>i(ve.length)),c.selectAll(".parentGroup").raise()},Ve=de=>{oe=O-de.left-de.right,he=q-de.bottom-de.top},Ye=(de,Pe,Ce,Me,ve)=>{if(!e.plotArea.fitChart){const xe=de[0].data.length-ie,Fe=Pe-20;a=Q.dimensionList.slice(P,P+ie),m=JSON.parse(JSON.stringify(de)),m.forEach((Y,W)=>m[W].data=Y.data.filter(I=>a.includes(I.dimension))),Ce.append("rect").attr("x",Me.left).attr("y",Fe).attr("width",ve).attr("height",8).attr("fill","#ddd").attr("rx",4);const ye=ve*ie/Q.dimensionList.length,ee=Ce.append("rect").attr("x",Me.left).attr("y",Fe).attr("width",ye).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",Y=>{let W=Math.min(Math.max(Y.x,Me.left),Me.left+ve-ye);ee.attr("x",W),P=Math.round((W-Me.left)/(ve-ye)*xe),a=Q.dimensionList.slice(P,P+ie),m=JSON.parse(JSON.stringify(de)),m.forEach((I,v)=>m[v].data=I.data.filter(F=>a.includes(F.dimension))),ce(),te()}));Ce.on("wheel",Y=>{Y.preventDefault();const W=Math.abs(Y.deltaX)>Math.abs(Y.deltaY)?Y.deltaX:Y.deltaY;P+=W>0?1:-1,P=Math.max(0,Math.min(P,xe));const I=Me.left+(ve-ye)*P/xe;ee.attr("x",I),m=JSON.parse(JSON.stringify(de)),m.forEach((v,F)=>m[F].data=v.data.filter(z=>a.includes(z.dimension))),ce(),te()})}te()},te=()=>{Gt(c,e,p,D,y,he),me()};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"className",ref:l,id:o,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:x})=>{const L=crypto.randomUUID(),A=0,u=le.AreaChart,S=Te.useRef(),b=Te.useRef(s);b.current=s;const _=Te.useRef(x);_.current=x;const g=bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1;let j=!1;const K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae,ke=[],ce=0,me,Ve,Ye,te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(W){be("Linechart","createLineChart",W)}},[e]);const de=()=>{({formatOptions:e,svg:f,width:c,height:d}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:w,customYaxisMaxValue:U,secondaryCustomYaxisMaxValue:N}=Nt(e,te.yMinLeft,te.yMaxLeft,te.yMinRight,te.yMaxRight),{margin:$,yLabel:X,xLabel:se,yTitle:re,xTitle:oe,dimensionHeightWidthArray:he,chartTitleHeight:Le,secondaryAxisTitleWidth:pe,legendMargin:ue,secondaryYLabel:O,visibleBars:me,columnWidth:Ve,scrollbarVisible:Ye}=Tt(c,d,q,w,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,K,t,!1,te),ye($),{dataTable:i,dataTableHeight:y}=ea(e,X,re,g,te.dimensionList,r),vt(f,c,d,e),a=Ct(f,$),mt(a,e,y,p,C,u,L),Ce(),ve(),Gt(a,e,y,X,ge,C),j&&oi(a,e,y,O,fe,C,p),Mt(e,D,f,$,se,d,oe,te.chartType,X,p,C),St(C,e,y,D,f,$,re,X),Ut(f,j,$,e,y,C,p,O,pe),Ft(f,e,c,Le),Dt(d,f,he,Le,c,ue,e,g,L,y,$,nt.areaWithLine,u,n),Bt(g,d,c,f,$,p,Ye,me,te,ce,!1,ee)},Pe=()=>{const W=[],I=[];let v=[],F=-1/0,z=1/0,R=-1/0,E=1/0;e.plotArea.hideZeroValues&&(te.hideZeroValues=!0,g.forEach(k=>{k.data=k.data.filter(M=>M.value!==0)})),g.forEach(k=>{I.push(k.properties.alias?k.properties.alias:k.legend),k.data.forEach(M=>{W.push(M),k.properties.axis==="Secondary"?(j=!0,R=Math.max(R,M.value),E=Math.min(E,M.value)):(F=Math.max(F,M.value),z=Math.min(z,M.value))})}),te.chartData=W,te.legendList=I,te.yMaxLeft=F,te.yMinLeft=z>0?0:z,te.yMaxRight=R,te.yMinRight=E>0?0:E,v=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(k=>k):te.dimensionList,te.dimensionList.forEach((k,M)=>{te.formattedDimensionListMap.set(k,v[M])}),ke=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ae=te.dimensionList:ae=te.dimensionList.slice(ce,ce+me)},Ce=()=>{let W=st(U||te.yMaxLeft,te.yMinLeft,C,e,te,J,U).yAxisLabelArray;if(te.yMaxLeft=W[W.length-1],te.yMinLeft=W[0],m=T.scaleLinear().domain([te.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:te.yMinLeft<0?te.yMinLeft*1.1:te.yMinLeft*.9,te.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:te.yMaxLeft*1.1]).range([y>0?C-y:C,0]),j&&(P=T.scaleLinear().domain([te.yMinRight>=0?(V||V==0)&&!Number.isNaN(V)?V:0:(V||V==0)&&!Number.isNaN(V)?V:te.yMinRight*1.1,te.yMaxRight<=0?N||0:N||te.yMaxRight*1.1]).range([y>0?C-y:C,0])),Q=[0,p],e.seriesLabel.seriesLabelVisibility){let I=aa(p,m,e,ke,void 0,j,C);I.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Ae=I.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,p-I.heightWidth[0]]:Q=[I.heightWidth[0],p]}},Me=()=>{ie=T.scalePoint().domain(ae).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{xe();{let W=st(U||te.yMaxLeft,te.yMinLeft,C,e,te,J,U);ge=T.axisLeft(m).tickFormat(I=>_e(I,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,p,Ae)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue??C/30).tickPadding(8).tickSizeOuter(0)}if(j){let W=st(N||te.yMaxRight,V||te.yMinRight,C,e,te,V,N);fe=T.axisRight(P).tickFormat(I=>_e(I,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(W.autoLabelFlag?void 0:W.yAxisLabelArray).ticks(W.customTickValue??C/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-p:0).tickSizeOuter(0)}},xe=()=>{we=T.axisBottom(ie).tickSize(ia(e,C,y,!0)).tickSizeOuter(0).tickValues(Lt(ae,p))},Fe=W=>{const I=e.plotArea.plotAreaHideLineAndMarkers;W.forEach(G=>{G.data.forEach(Z=>{Z.hideZero=G.properties.hideZeroValues,Z.axis=G.properties.axis})});const v=T.area().x(G=>ie(G.dimension)?ie(G.dimension):null).y0(G=>G.axis===at.primary?m(0):P(0)).y1(G=>G.axis===at.primary?m(G.value):P(G.value)).defined(G=>G.hideZero?!!G.value:!0).curve(Ot(e)),F=T.area().x(G=>ie(G.dimension)?ie(G.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(G=>G.hideZero?!!G.value:!0).curve(Ot(e)),z=e.animation.animationEnabled;let R=a.selectAll(".parentGroup").data([W]),E=a.append("g").attr("class","focusClass");R=R.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${L}-clip)`).merge(R);let k=R.selectAll(".area-group").data(G=>G),M=k.enter().append("g").attr("class","area-group");M.append("path").attr("class","area parentGroup").attr("fill",G=>G.properties.color!==De.white?G.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",G=>(G.properties?.alias||G.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",G=>F(G.data)).attr(Qe.SeriesId,G=>G.properties.legendUniqueId).attr(Qe.DimValue,G=>G.properties.alias||G.properties.name||"").on("click",At(_,b,(G,Z)=>({seriesId:Z.properties.legendUniqueId,dimValue:Z.properties.alias||Z.properties.name||"",legendUniqueId:Z.properties.legendUniqueId,seriesDisplayName:Z.properties.alias||Z.properties.name||""}))).each(function(G){z?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v(G.data)):T.select(this).attr("d",v(G.data))}),M.merge(k).each(function(G){const Z=T.select(this);Z.selectAll("path.visibleLine").data([G]).join("path").attr("class","visibleLine parentGroup").attr("d",B=>z?F(B.data):v(B.data)).attr("stroke",B=>B.properties.areaBorderColor!==De.white?B.properties.areaBorderColor:"none").attr("stroke-dasharray",B=>{const Se=parseInt(B.properties.lineWidth);switch(B.properties.lineStyle){case yt.dotted:return`0,${Se+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",B=>B.properties.lineStyle===yt.dotted?sa.round:sa.butt).attr("stroke-width",B=>I?B.properties.lineStyle!==yt.none&&e.plotArea.plotAreaHideLineAndMarkers?B.properties.lineWidth:"0":0).attr("fill","none").each(function(B){z&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",v(B.data))}),Z.selectAll("path.hoverLine").data([G]).join("path").attr("class","hoverLine").attr("d",B=>v(B.data)).attr("fill",De.transparent).attr("stroke","none").style("pointer-events","all").raise(),di(e,R,E,ae,W,ie,m,u)}),k.exit().remove(),Ca(R,W,u,ie,m,P,null,e,te,N,V,J,U,!1,l),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ye=W=>{p=c-W.left-W.right,C=d-W.bottom-W.top},ee=(W,I,v)=>{ke=I,ae=W,me=v,Y()},Y=()=>{Me(),xe(),Da(g,ie,m,P,$,dt,[],[],e,u,d,c,p,ae,C,L,f,h,void 0,void 0,o);let W=aa(p,m,e,ke,void 0,j,C).labelArray;qt(a,te,se,e,y,m,we,he,d,A,t,p,C,ae,ie),Fe(ke),za(e,a,W),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,m,ie,void 0,void 0,void 0,y,u,e,X,re,ae,p,Q,te.formattedDimensionListMap,L,$,C))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.StackAreaChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w=new Map,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe,ae=[],ke=0,ce,me,Ve,Ye=[];const te=!1;let de={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Pe()}catch(v){be("StackAreaChart","createAreaChart",v)}},[e]);const Pe=()=>{({formatOptions:e,svg:f,width:c,height:d}=kt(S,e)),Ce(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:q}=Nt(e,de.yMinLeft,de.yMaxLeft,de.yMinRight,de.yMaxRight),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ce,columnWidth:me,scrollbarVisible:Ve}=Tt(c,d,O,q,de.yMaxLeft,e,de.legendList,de.dimensionList,de.yMaxRight,j,te,t,!1,de),ee(N),{dataTable:i,dataTableHeight:y}=ea(e,$,se,g,de.dimensionList,r),vt(f,c,d,e),a=Ct(f,N),mt(a,e,y,p,C,u,L),Me(),xe(),Gt(a,e,y,$,ge,C),Mt(e,D,f,N,X,d,re,de.chartType,$,p,C),St(C,e,y,D,f,N,se,$),Ut(f,j,N,e,y,C,p,ue,Le),Ft(f,e,c,he),Dt(d,f,oe,he,c,pe,e,[...g].reverse(),L,y,N,nt.areaWithLine,u,n),Bt(g,d,c,f,N,p,Ve,ce,de,ke,!1,Y,D)},Ce=()=>{const v=[],F=[];e.plotArea.hideZeroValues&&(de.hideZeroValues=!0,g.forEach(G=>{G.data=G.data.filter(Z=>Z.value!==0)})),g.forEach((G,Z)=>{const B=`${Z}~$~${G.properties.alias}`;G.properties.legend=B,F.push(B);for(const Se of G.data)v.push(Se)}),de.chartData=v,de.legendList=F,ae=JSON.parse(JSON.stringify(g));let z=pt(de.dimensionList,g,te);e.plotArea.fitChart?fe=de.dimensionList:(fe=de.dimensionList.slice(ke,ke+ce),ae.forEach((G,Z)=>ae[Z].data=G.data.filter(B=>fe.includes(B.dimension))));const R=T.stack().keys(de.legendList).offset(T.stackOffsetNone)(z);I();let E=1/0,k=-1/0;for(const G of R)for(const[Z,B]of G)E=Math.min(E,Z),k=Math.max(k,B);de.yMinLeft=E>0?0:E,de.yMaxLeft=k;let M=t?gt(e.xAxisLabel.xAxisNumberFormat,de.dimensionList).map(G=>G):de.dimensionList;de.dimensionList.forEach((G,Z)=>{de.formattedDimensionListMap.set(G,M[Z])})},Me=()=>{let v=st(J||de.yMaxLeft,de.yMinLeft,C,e,de,K,J).yAxisLabelArray;if(de.yMaxLeft=v[v.length-1],de.yMinLeft=v[0],m=T.scaleLinear().domain([de.yMinLeft>=0?K!==void 0&&!Number.isNaN(K)?K:0:de.yMinLeft<0?de.yMinLeft*1.1:de.yMinLeft*.9,de.yMaxLeft<=0?0:J!==void 0&&!Number.isNaN(J)?J:de.yMaxLeft*1.1]).range([y>0?C-y:C,0]),Q=[0,p],e.seriesLabel.seriesLabelVisibility){let F=aa(p,m,e,g,void 0,j,C,!0);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Ae=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Q=[0,p-F.heightWidth[0]]:Q=[F.heightWidth[0],p]}},ve=()=>{ie=T.scalePoint().domain(fe).range(Q).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},xe=()=>{{let v=st(J||de.yMaxLeft,de.yMinLeft,C,e,de,K,J);ge=T.axisLeft(m).tickFormat(F=>_e(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Pt(e,p,Ae)).tickValues(v.autoLabelFlag?void 0:v.yAxisLabelArray).ticks(v.customTickValue).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{we=T.axisBottom(ie).tickSize(ia(e,C,y,!0)).tickSizeOuter(0).tickValues(Lt(fe,p))},ye=v=>{const F=e.animation.animationEnabled,z=e.plotArea.plotAreaHideLineAndMarkers;v.forEach(B=>{B.data.forEach(Se=>{Se.hideZero=B.properties.hideZeroValues,Se.axis=B.properties.axis})});const R=T.area().x(B=>ie(B.data.dimension)?ie(B.data.dimension):null).y0(B=>m(B[0])).y1(B=>m(B[1])).defined(B=>B.data.hideZero?!!B.data.key:!0).curve(Ot(e)),E=T.area().x(B=>ie(B.data.dimension)?ie(B.data.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(B=>B.data.hideZero?!!B.data.key:!0).curve(Ot(e));let k=a.selectAll(".lineGroup").data([Ye]),M=a.append("g").attr("class","focusClass");k=k.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${L}-clip)`).merge(k);let G=k.selectAll(".area-group").data(B=>B),Z=G.enter().append("g").attr("class",B=>"area-group "+B.key.replace(/ /g,"-"));Z.append("path").attr("hoverId",B=>(v[B.index].properties.alias||v[B.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",B=>B.color!==De.white?B.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",B=>E(B)).attr(Qe.SeriesId,B=>g[B.index]?.properties?.legendUniqueId??B.key).attr(Qe.DimValue,B=>g[B.index]?.properties?.alias||g[B.index]?.properties?.name||"").on("click",At(_,b,(B,Se)=>{const ze=g[Se.index]?.properties?.legendUniqueId??Se.key,Ie=g[Se.index]?.properties?.alias||g[Se.index]?.properties?.name||"";return{seriesId:ze,dimValue:Ie,legendUniqueId:ze,seriesDisplayName:Ie}})).each(function(B){F?T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",R(B)):T.select(this).attr("d",R(B))}),Z.merge(G).each(function(B,Se){const ze=T.select(this);ze.selectAll("path.visibleLine").data([B]).join("path").attr("class","visibleLine parentGroup").attr("d",Ie=>F?E(Ie):R(Ie)).attr("stroke",Ie=>Ie.color!==De.white?g[Se].properties.areaBorderColor:"none").attr("stroke-dasharray",Ie=>{const Oe=parseInt(g[Se].properties.lineWidth.toString());switch(g[Se].properties.lineStyle){case yt.dotted:return`0,${Oe+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[Se]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>z?g[Se].properties.lineStyle!==yt.none?g[Se].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(Ie){F&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",R(Ie))}),ze.selectAll("path.hoverLine").data([B]).join("path").attr("class","hoverLine").attr("d",Ie=>R(Ie)).attr("fill",De.transparent).attr("stroke","none").style("pointer-events","all").raise(),f.selectAll('[hoverId="'+(g[B.index].properties.alias||g[B.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),G.exit().remove(),di(e,k,M,fe,v,ie,m,u,!0),Ca(k,v,u,ie,m,P,null,e,de,V,U,K,J,!1,x),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ee=v=>{p=c-v.left-v.right,C=d-v.bottom-v.top},Y=(v,F,z)=>{ae=F,fe=v,ce=z,Ka(r,w,fe),I(),W()},W=()=>{ve(),Fe(),qt(a,de,X,e,y,m,we,oe,d,A,t,p,C,fe,ie),ye(ae),Va(Ye,ie,m,P,N,dt,[],[],e,u,d,c,p,fe,C,L,f,h,y,o);let v=aa(p,m,e,ae,void 0,j,C,!0).labelArray;za(e,a,v),qa(w,ie,m,N,dt,[],e,u,d,c,f,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,f,a,i,A,m,ie,void 0,void 0,void 0,y,u,e,$,se,de.dimensionList,p,Q,de.formattedDimensionListMap,L,N,C))},I=()=>{let v=pt(fe,ae,te);Ye=T.stack().keys(de.legendList).offset(T.stackOffsetNone)(v),ae.forEach((z,R)=>z.data.forEach((E,k)=>{E[0]=Ye[R][k][0],E[1]=Ye[R][k][1]}));let F=e.annotation.annotationSetLabelColor;Ye.forEach((z,R)=>z.forEach(E=>{E.key=z.key,z.color=JSON.parse(JSON.stringify(g[R].properties.color)),E.data.labelPosition=g[R].properties.dataLabelPosition,E.data.labelColor=F=="2"?JSON.parse(JSON.stringify(g[R].properties.color)):g[R].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(g[R].properties.hideZeroValues)),E.properties=g[R].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},ur=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=crypto.randomUUID(),A=0,u=le.NormalizedStackAreaChart,S=Te.useRef(),b=Te.useRef(l);b.current=l;const _=Te.useRef(s);_.current=s;const g=bt(r.ChartData,r.DimensionList)?.reverse()||[],H=r.DimensionList,D=!1,j=!1;let K=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,U=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we,fe=[],ae=0,ke,ce,me,Ve=[];const Ye=!0;let te={dimensionList:H,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{de()}catch(I){be("NormalizedLinechart","createLineChart",I)}},[e]);const de=()=>{({formatOptions:e,svg:y,width:C,height:c}=kt(S,e)),Pe(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{margin:N,yLabel:$,xLabel:X,yTitle:se,xTitle:re,dimensionHeightWidthArray:oe,chartTitleHeight:he,secondaryAxisTitleWidth:Le,legendMargin:pe,secondaryYLabel:ue,visibleBars:ke,columnWidth:me,scrollbarVisible:ce}=Tt(C,c,O,q,te.yMaxLeft,e,te.legendList,te.dimensionList,te.yMaxRight,j,Ye,t,!1,te),ye(N),{dataTable:d,dataTableHeight:i}=ea(e,$,se,g,te.dimensionList,r),vt(y,C,c,e),f=Ct(y,N),mt(f,e,i,w,p,u),Ce(),ve(),Gt(f,e,i,$,Ae,p),Mt(e,D,y,N,X,c,re,te.chartType,$,w,p),St(p,e,i,D,y,N,se,$),Ut(y,j,N,e,i,p,w,ue,Le),Ft(y,e,C,he),Dt(c,y,oe,he,C,pe,e,[...g].reverse(),L,i,N,nt.areaWithLine,u,n),Bt(g,c,C,y,N,w,ce,ke,te,ae,!1,ee)},Pe=()=>{const I=[],v=[];e.plotArea.hideZeroValues&&(te.hideZeroValues=!0,g.forEach(k=>{k.data=k.data.filter(M=>M.value!==0)})),g.forEach((k,M)=>{const G=`${M}~$~${k.properties.alias}`;k.properties.legend=G,v.push(G);for(const Z of k.data)I.push(Z)}),te.chartData=I,te.legendList=v,fe=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?we=te.dimensionList:(we=te.dimensionList.slice(ae,ae+ke),fe.forEach(k=>{k.data=k.data.filter(M=>we.includes(M.dimension))}));const F=pt(te.dimensionList,g,Ye),z=T.stack().keys(te.legendList).offset(T.stackOffsetNone)(F);W();let R=1/0;for(const k of z)for(const[M]of k)R=Math.min(R,M);te.yMinLeft=R>0?0:R,te.yMaxLeft=1;const E=t?gt(e.xAxisLabel.xAxisNumberFormat,te.dimensionList).map(k=>k):te.dimensionList;te.formattedDimensionListMap=new Map(te.dimensionList.map((k,M)=>[k,E[M]]))},Ce=()=>{if(a=T.scaleLinear().domain([te.yMinLeft<0?-1:0,1]).range([i>0?p-i:p,0]),ie=[0,w],e.seriesLabel.seriesLabelVisibility){let I=aa(w,a,e,g,void 0,j,p,!0);I.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Q=I.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ie=[0,w-I.heightWidth[0]]:ie=[I.heightWidth[0],w]}},Me=()=>{P=T.scalePoint().domain(we).range(ie).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0)},ve=()=>{Ae=T.axisLeft(a).tickSize(Pt(e,w,Q)).ticks(i>0?(p-i)/80:p/80,"%").tickPadding(8).tickSizeOuter(0)},xe=()=>{ge=T.axisBottom(P).tickSize(ia(e,p,i,!0)).tickSizeOuter(0).tickValues(Lt(we,w))},Fe=I=>{const v=e.animation.animationEnabled,F=e.plotArea.plotAreaHideLineAndMarkers;Ve.forEach((Z,B)=>Z.forEach((Se,ze)=>{const Ie=Se.data.total;I[B].data[ze]&&(I[B].data[ze][0]=Se[0]=Ie===0?0:Se[0]/Ie,I[B].data[ze][1]=Se[1]=Ie===0?0:Se[1]/Ie)})),I.forEach(Z=>{Z.data.forEach(B=>{B.hideZero=Z.properties.hideZeroValues,B.axis=Z.properties.axis})});const z=T.area().x(Z=>P(Z.data.dimension)?P(Z.data.dimension):null).y0(Z=>a(Z[0])).y1(Z=>a(Z[1])).defined(Z=>Z.data.hideZero?!!Z[0]:!0).curve(T.curveLinear),R=T.area().x(Z=>P(Z.data.dimension)?P(Z.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined(Z=>Z.data.hideZero?!!Z.data.key:!0).curve(Ot(e));let E=f.selectAll(".lineGroup").data([Ve]),k=f.append("g").attr("class","focusClass");E=E.enter().append("g").attr("class","areas lineGroup").merge(E);let M=E.selectAll(".area-group").data(Z=>Z),G=M.enter().append("g").attr("class",Z=>"area-group "+Z.key.replace(/ /g,"-"));G.append("path").attr("hoverId",Z=>(I[Z.index]?.properties?.alias||I[Z.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Z=>Z.color!==De.white?Z.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Z=>R(Z)).attr(Qe.SeriesId,Z=>g[Z.index]?.properties?.legendUniqueId??Z.key).attr(Qe.DimValue,Z=>g[Z.index]?.properties?.alias||g[Z.index]?.properties?.name||"").on("click",At(_,b,(Z,B)=>{const Se=g[B.index]?.properties?.legendUniqueId??B.key,ze=g[B.index]?.properties?.alias||g[B.index]?.properties?.name||"";return{seriesId:Se,dimValue:ze,legendUniqueId:Se,seriesDisplayName:ze}})).each(function(Z){const B=T.select(this);v?B.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",z(Z)):B.attr("d",z(Z))}),G.merge(M).each(function(Z,B){const Se=T.select(this);Se.selectAll("path.visibleLine").data([Z]).join("path").attr("class","visibleLine parentGroup").attr("d",ze=>v?R(ze):z(ze)).attr("stroke",ze=>ze.color!==De.white?g[B].properties.areaBorderColor:"none").attr("stroke-dasharray",ze=>{const Ie=parseInt(g[B].properties.lineWidth.toString());switch(g[B].properties.lineStyle){case yt.dotted:return`0,${Ie+2}`;case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",()=>g[B]?.properties?.lineStyle===yt.dotted?sa.round:"").attr("stroke-width",()=>F?g[B].properties.lineStyle!==yt.none?g[B].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(ze){v&&T.select(this).transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("d",z(ze))}),Se.selectAll("path.hoverLine").data([Z]).join("path").attr("class","hoverLine").attr("d",ze=>z(ze)).attr("fill",De.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+yi((I[Z.index]?.properties?.alias||I[Z.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),M.exit().remove(),di(e,E,k,we,I,P,a,u,!0),f.selectAll(".parentGroup").raise(),f.selectAll(".hoverLine").raise(),Ca(E,I,u,P,a,m,null,e,te,V,U,K,J,!0,x),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,y,f,d,A,a,P,void 0,void 0,void 0,i,u,e,$,se,te.dimensionList,w,ie,te.formattedDimensionListMap,L,N,p))},ye=I=>{w=C-I.left-I.right,p=c-I.bottom-I.top},ee=(I,v,F)=>{fe=v,we=I,ke=F,W(),Y()},Y=()=>{Me(),xe(),qt(f,te,X,e,i,a,ge,oe,c,A,t,w,p,we,P),Fe(fe),Va(Ve,P,a,m,N,dt,[],[],e,u,c,C,w,we,p,L,y,h,i,o,!1);let I=aa(w,a,e,fe,void 0,j,p,!0).labelArray;za(e,f,I)},W=()=>{let I=pt(we,fe,Ye);Ve=T.stack().keys(te.legendList).offset(T.stackOffsetNone)(I),fe.forEach((F,z)=>F.data.forEach((R,E)=>{Ve[z][E]&&(R[0]=Ve[z][E][0],R[1]=Ve[z][E][1])}));let v=e.annotation.annotationSetLabelColor;Ve.forEach((F,z)=>F.forEach(R=>{R.key=F.key,F.color=JSON.parse(JSON.stringify(g[z].properties.color)),R.data.labelPosition=g[z].properties.dataLabelPosition,R.data.labelColor=v=="2"?JSON.parse(JSON.stringify(g[z].properties.color)):g[z].properties.labelColor,R.hideZero=JSON.parse(JSON.stringify(g[z].properties.hideZeroValues)),R.properties=g[z].properties}))};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:L,style:{width:"100%",height:"100%"}})})},Oa={left:"Left",right:"Right",center:"Center"},zt={left:"left",right:"right",top:"top",bottom:"bottom"},Ha={solid:"solid",dashed:"Dashed",dotted:"Dotted"},ei={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},ca={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},el="PieFamilyCommonFunctions.ts",hr=(t,e,r,o)=>{try{let h=t.total.totalPosition,n=t.total.totalAlignment,l=t.legends.legendPosition,s=0;switch(h){case va.top:switch(s=l=="Top"?35:0,n){case $t.start:return{x:5,y:e+s+10};case $t.middle:return{x:r/2,y:e+s+10};case $t.end:return{x:r-20,y:e+s+10}}break;case va.bottom:switch(s=l=="Bottom"?30:0,n){case $t.start:return{x:10,y:o-s-10};case $t.middle:return{x:r/2,y:o-s-10};case $t.end:return{x:r-20,y:o-s-10}}break}}catch(h){be(el,"getTotalValueCords",h)}},fi=(t,e,r,o,h,n)=>{try{if(t.total&&t.total.totalVisibility){let l=t.total.totalFontStyle,s=t.total.totalAlignment,x=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":je(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),L=hr(t,r,h,n);const A=o.append("g").attr("transform",`translate(${L.x}, ${L.y})`).style("user-select","none");A.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${x}`:x).style("fill",t.total.totalColor!==De.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",l.includes(ne.italic)?ne.italic:"").style("text-decoration",l.includes(ne.underline)?ne.underline:"").style("font-weight",l.includes(ne.bold)?ne.bold:"").attr("text-anchor",s===$t.start?"start":s===$t.middle?"middle":s===$t.end?"end":""),t.animation?.animationEnabled&&A.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(Xe[t.animation.animationEffect]).attr("opacity",1)}}catch(l){be(el,"drawTotalValue",l)}},Ea="PieChart.tsx",xr=({data:t,formatOptions:e,chartId:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=Te.useRef(),A=Te.useRef(l);A.current=l;const u=Te.useRef(s);u.current=s;const S=bt(t.ChartData);let b,_,g,H=40,D=Ht,j=[0,0],K,J,U,V,N,$,X,se,re=!1;Te.useEffect(()=>{oe()},[e]);const oe=()=>{({chartFormatOptions:b,svg:N,width:g,height:_}=Jt(L,e)),he(),j=Ia(b,S),{margins:D,innerHeight:K,innerWidth:J,legendListWidth:se,chartTitleHeight:H}=Na(b,g,_,j,D),Le(),jt(L,g,_,b),V=la(N,D),_t(L,H,g,b),Pa(b,N,S,g,_,se,H,r,D,nt.circle,void 0,n),pe(),ue(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?Qi(dt,$,b,O(),le.PieChart,g,_,V,Math.min(K*.5,J*.5),o,h):w(),fi(b,X,H,N,g,_)},he=()=>{try{X=0,t.ChartData.forEach(p=>{p.properties.dataLabelPosition=="2"&&(re=!0),X+=p.data[0].value})}catch(p){be(Ea,"loopOverSeriesData",p)}},Le=()=>{try{U=Math.min(K*.5,J*.5),re&&(U=U*.9)}catch(p){be(Ea,"defineChartRadius",p)}},pe=()=>{try{let p=et(b.plotArea.rotation);const C=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;$=T.pie().value(i=>Math.abs(C?100:i.data[0].value)).startAngle((p??0)*(Math.PI/180)%360).endAngle(((p??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,y)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:U,depth:2}))}catch(p){be(Ea,"initPieChartData",p)}},ue=()=>{try{const p=T.arc().innerRadius(0).outerRadius(U),C=T.arc().innerRadius(0).outerRadius(U+10),c=V.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data($).enter().append("path").attr("class",d=>"path").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",d=>d.data.properties.color!==De.white?d.data.properties.color:"none").attr(Qe.SeriesId,d=>d.data.properties.legendUniqueId??d.data.properties.name??"").attr(Qe.DimValue,d=>d.data.properties.alias||d.data.legend||"").on("click",At(u,A,(d,i)=>({seriesId:i.data.properties.legendUniqueId??i.data.properties.name??"",dimValue:i.data.properties.alias||i.data.legend||"",legendUniqueId:i.data.properties.legendUniqueId??i.data.properties.name??"",seriesDisplayName:i.data.properties.alias||i.data.properties.name||""}))).on("mouseover.arc",function(d){T.select(this).transition().duration(100).attr("d",C)}).on("mousemove. ",d=>{ot([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/X)*100).toFixed(et(b.toolTip.toolTipDecimalPrecision))+"%":je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],b,void 0,d.currentTarget.__data__.data.properties,ht(x,String(d.currentTarget.__data__.data.legend??""),d.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(d){T.select(this).transition().duration(100).attr("d",p),rt()});b.animation.animationEnabled?c.transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attrTween("d",function(d){const i=T.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return y=>p(i(y))}):c.attr("d",d=>p(d))}catch(p){be(Ea,"drawPieChart",p)}},O=()=>{try{return`translate(${J/2},${K/2})`}catch(p){return be(Ea,"getPiePosition",p),""}},q=(p,C)=>{try{if(C)return"translate(0 0)";{const c=(p.startAngle+p.endAngle)/2,d=Math.cos(c-Math.PI/2)*(U*.65),i=Math.sin(c-Math.PI/2)*(U*.65);let y=c*180/Math.PI%360,f=0;return y>180&&y<360?f=90:f=-90,y+=f,`translate(${d},${i}) rotate(${y})`}}catch(c){return be(Ea,"getDataLabelTransformString",c),""}},w=()=>{try{if(b.plotArea.dataLabels){const p=$&&$.length===1;V.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.labelFontSize??11).attr("fill",d=>d.data.properties?.labelFontColor??De.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",d=>d.data.properties?.labelFont??qe).attr("transform",d=>q(d,p)).attr("visibility",d=>d.endAngle-d.startAngle<.09&&e.plotArea.hideInsignificantValue?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(d=>{const{plotArea:i}=b;return i.dataLabelName?d.data.properties?.alias||d.data.legend:""}),V.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.valueFontSize??11).attr("fill",d=>d.data.properties?.valueFontColor??De.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??qe).attr("transform",d=>q(d,p)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(b.plotArea.dataLabelValue){const i=d.data.data[0].value;return b.plotArea.dataLabelValue&&i!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/X)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision)??0)+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&i!==void 0?T.format(".2s")(i):""});let C=T.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>1?d.y1-1+U/7:0).outerRadius(d=>d.depth>1?d.y1-1+U/7:0),c=T.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>2?d.y0:0).outerRadius(d=>d.y1+U/1.5);V.selectAll("polyline.pie-label-connector").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",O()).style("stroke",d=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Ha.solid?0:b.connector.connectorStyle===Ha.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",d=>{const i=c.centroid(d),y=C.centroid(d);let f=d.x0+(d.x1-d.x0)/2;f=f%(2*Math.PI);const a=U*1.1*(f<Math.PI?1:-1),m=y[1];return[i,y,[a,m]].map(P=>P.join(",")).join(" ")}),V.append("g").attr("class","pie-label-group").attr("transform",O()).selectAll("foreignObject").data(Rt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",d=>{let i=d.x0+(d.x1-d.x0)/2;i=i%(2*Math.PI);const f=i<Math.PI?0:-80;return U*1.1*(i<Math.PI?1:-1)+f}).attr("y",d=>C.centroid(d)[1]-30).append("xhtml:div").attr("hoverId",d=>(d.data.properties.alias||d.data.properties.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(d=>{let i=d.data.data[0].value.toString();d.data.data[0].value!==void 0&&(i=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/X)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision))+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let y="";return b.plotArea.dataLabelName&&(y+=`<span style="
73
+ `,V},"");b.html(x?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${_l}; color:${f}; line-height:${jl};">${x}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${g}</div>`);const B=b.node(),U=B.offsetWidth,W=B.offsetHeight;let P=A+15,D=R+15;P+U>window.innerWidth&&(P=A-U-10),D+W>window.innerHeight&&(D=R-W-10),b.style("left",`${P}px`).style("top",`${D}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(n){console.error("Tooltip Error:",n)}}function ot(){try{v.select("#chartTooltipDiv").html("").style("visibility",It.hidden)}catch(t){Ae(ut,"hideTooltipOnMouseOut",t)}}const Zt=(t,e,r,c)=>{try{let n=v.select(t.current).append("foreignObject").attr("visibility",c.chartTitle.chartTitleVisibility?It.visible:It.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",r).attr("height",e+"px");c.chartTitle.dynamicTitleText.length!==0?n.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",c.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",It.visible).style("line-height","1.3em").html(c.chartTitle.chartTitleHTML?c.chartTitle.chartTitleHTML:c.chartTitle.chartTitleText):n.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",It.visible).style("line-height","1.3em").attr("class","chartTiltle").attr("id","chartTitleId").style("text-anchor","start").style("color","rgba(119,119,119)").style("font-size","16px").style("font-family",c.chartTitle.chartTitleFontFamily).attr("title",c.chartTitle.chartTitleText).html(c.chartTitle.chartTitleText)}catch(x){Ae(ut,"drawChartTitle",x)}},Ji=(t,e)=>{try{return t.reduce((r,c)=>{const x=typeof c=="string"?c:e&&typeof c=="object"&&c[e]||"";return x.length>r.length?x:r},"")}catch(r){Ae(ut,"findStringWithLongestLength",r)}},ua=(t,e,r,c,x,n,l,s,p,f,L,u=!1,S)=>{try{if(f.legends.legendVisibility){let _="",A="";l==je.left||l==je.right?(A="column",_=s==Ia.top?"start":s==Ia.middle?"center":"end"):(A="row",_=s==Ea.start?"start":s==Ea.middle?"center":"end");var b=t.append("foreignObject").attr("x",r).attr("y",c).style("pointer-events","auto").attr("width",x+"px").attr("height",n+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+L).attr("class","legendsBoxWrapper").style("width",x+"px").style("display","flex").style("height",n-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+_).style("flex-direction",A).style("outline-offset","-"+f.legends.legendBorderThickness+"px").style("outline",f.legends.legendBorder?`${f.legends.legendBorderThickness+"px solid"+f.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",A).style("flex-wrap","nowrap").style("padding-left","3px");(l==je.top||l==je.bottom)&&b.style("flex-direction","row"),e.forEach((g,B)=>{let U=b.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("width","fit-content").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("dblclick",function(){S(g?.properties)}).on("mousemove",function(){if(f.legends.onHoverEffect){const V=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${V}"]`).classed("highlight",!0).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!0)}}).on("mouseout",function(){if(f.legends.onHoverEffect){const V=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${V}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(l==je.top||l==je.bottom)&&U.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let W;if(!p){let V=g.properties.type;V==se.ColumnChart||V==se.StackColumnChart?W=ct.rectangle:V==se.LineChart||V==se.StackLineChart?W=ct.line:(V==se.AreaChart||V==se.StackAreaChart)&&(W=ct.areaWithLine)}(p||W)==ct.circle?Kl(g,U):(p||W)==ct.hollowCircle?Ql(g,U):(p||W)==ct.line?Zi(g,U,f):(p||W)==ct.areaWithLine?Xi(g,U,f):(p||W)==ct.rectangle&&Ol(g,U);let P=u&&(l==je.bottom||l==je.top)&&B!=e.length-1?" |":"",D=u?f.legends.legendSelectedUnicolor:f.legends.legendColorMode==Fl.multiColor?g.properties.color?g.properties.color:Re.black:f.legends.legendSelectedUnicolor;U.append("div").style("margin-left","5px").style("color",D).style("background",g.properties.axis==Qe.secondary&&f.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?f.legends.legendFontSize:g.properties.fontSize)+"px").style("font-family",u?f.legends.legendFontFamily:g.properties.fontFamily).style("font-style",()=>(u?f.legends.legendFontStyle:g.properties.fontStyle).includes(oe.italic)?oe.italic:"").style("text-decoration",()=>(u?f.legends.legendFontStyle:g.properties.fontStyle).includes(oe.underline)?oe.underline:"").style("font-weight",()=>(u?f.legends.legendFontStyle:g.properties.fontStyle).includes(oe.bold)?oe.bold:"").style("white-space","nowrap").attr("title",u?g.legendDisplay+" : "+g.actualValue:g.properties.alias).html(u?g.legendDisplay+" : "+g.actualValue+P:g.properties.alias)})}}catch(_){Ae(ut,"legendsWithScroll",_)}};function Kl(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(r){Ae(ut,"getCircleShape",r)}}function Ql(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("border",`3px solid ${t.properties.Color??t.properties.color}`)}catch(r){Ae(ut,"getHollowCircleShape",r)}}function Zi(t,e,r){try{const c=t.properties?.lineStyle?.toLowerCase()||"solid";let x=e.append("div").style("height","2px").style("width",c=="dashed"?"25px":"20px").style("background",Re.transparent).style("position","relative").style("border-top",c=="none"?"unset":c=="dotted"?"2px dotted "+t.properties.color:c=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":x.append("div").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-6)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","4.5").style("fill",t.properties.markerColor);break;case"square":x.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-2px, -7px)").style("height","8px").style("width","8px").style("top","2px").style("left","9px").style("background",t.properties.markerColor);break;case"triangle":x.append("div").style("position","absolute").style("transform","translate(5px, -6.5px)").style("border-left","6px solid transparent").style("border-right","6px solid transparent").style("border-bottom",`10px solid ${t.properties.markerColor}`);break;case"cross":x.append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-5px, -3px)").style("height","4px").style("width","10px").style("background",t.properties.markerColor).append("div").style("height","10px").style("width","4px").style("background",t.properties.markerColor).style("position","relative").style("top","-3px").style("left","3px");break;case"diamond":x.append("div").style("height","7px").style("width","7px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-4px").style("left","7px").style("position","absolute");break;case"star":x.append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-bottom",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-6.5px").style("left","7px").style("transform","rotate(0deg)").append("div").style("border-left","4px solid transparent").style("border-right","4px solid transparent").style("border-top",`8px solid ${t.properties.markerColor}`).style("position","absolute").style("top","2px").style("left","-4px").style("transform","rotate(360deg)");break;case"wye":x.append("div").style("height","6.5px").style("width","3px").style("background",t.properties.markerColor).style("position","absolute").style("left","10px").style("top","-3.5px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","5px").style("width","3px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":default:break}}catch(c){Ae(ut,"getLineShape",c)}}function Xi(t,e,r){try{let c=e.append("div").style("height","10px").style("width","15px").style("background",t.properties.color).style("display","flex").style("flex-direction","column").style("border-radius","1px");if(r.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.color).style("position","relative").append("svg").style("position","absolute").style("left","50%").style("top","50%").attr("transform","translate(-5,-5)").attr("height","10px").attr("width","10px").append("circle").attr("cx","5").attr("cy","5").attr("r","2.5").style("fill",t.properties.markerColor);break;case"square":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-4px, -3.5px)").style("height","5px").style("width","5px").style("top","2px").style("left","9px").style("background",t.properties.markerColor).style("border-radius","1px");break;case"triangle":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("transform","translate(5px, -3.5px)").style("border-left","3px solid transparent").style("border-right","3px solid transparent").style("border-bottom",`7px solid ${t.properties.markerColor}`);break;case"cross":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("position","absolute").style("left","50%").style("top","50%").style("transform","translate(-3px, -2px)").style("height","4px").style("width","7px").style("background",t.properties.markerColor).append("div").style("height","6px").style("width","3px").style("background",t.properties.markerColor).style("position","relative").style("top","-1px").style("left","2px");break;case"diamond":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4px").style("width","4px").style("background",t.properties.markerColor).style("transform","rotate(45deg)").style("top","-1px").style("left","5px").style("position","absolute");break;case"star":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-bottom",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","-3px").style("left","6px").style("transform","rotate(0deg)").append("div").style("border-left","2.5px solid transparent").style("border-right","2.5px solid transparent").style("border-top",`6px solid ${t.properties.markerColor}`).style("position","absolute").style("top","0.5px").style("left","-2px").style("transform","rotate(360deg)");break;case"wye":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor).style("position","relative").append("div").style("height","4.5px").style("width","2px").style("background",t.properties.markerColor).style("position","absolute").style("left","6.5px").style("top","-0.5px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(-55deg)").style("position","relative").style("top","-2px").style("left","-2px").append("div").style("height","3px").style("width","2px").style("background",t.properties.markerColor).style("transform","rotate(108deg)").style("position","relative").style("top","3px").style("left","2px");break;case"none":c.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}c.append("div").style("height","20%").style("width","100%").style("background","white"),c.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(c){Ae(ut,"getAreaShape",c)}}function Ol(t,e){try{e.append("div").style("height","10px").style("width","15px").style("border-style",t).style("border-width",t).style("border-color",t).style("background",t.properties.color).style("border-radius","1px")}catch(r){Ae(ut,"getReactShape",r)}}const Xt=(t,e,r,c)=>{try{let x=t.current;x.setAttribute("viewBox",`0 0 ${e} ${r}`);const{chartAreaColor:n,chartAreaBorder:l}=c.chartArea;if(x.style.backgroundColor=n,l){let p=c.chartArea.chartAreaBorderColor,f=c.chartArea.chartAreaBorderThickness+"px",L=rt(c.chartArea.chartAreaBorderStyle),u=L==1?"solid":L==2?"dashed":"dotted";x.style.outline=`${f} ${u} ${p}`,x.style.outlineOffset=`-${f}`}else x.style.outline="unset"}catch(x){Ae(ut,"initSvg",x)}},oa=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(r){Ae(ut,"initChartArea",r)}},qt=(t,e)=>{try{let r=v.select(t.current);r.selectAll("*").remove();let c=_i(Pi,e),x=t.current.getBoundingClientRect(),n=x.width,l=x.height;return{chartFormatOptions:c,svg:r,width:n,height:l}}catch(r){Ae(ut,"firstFunctionBeforeRender",r)}},$a=(t,e,r,c,x,n=!1)=>{try{let l=t.legends.legendPosition;l=t.legends.legendVisibility?t.legends.legendPosition:je.none;let s=e*.15*.8,p=n?c[0]:s<c[0]+15?s:c[0]+15,f=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?zt(t.chartTitle.chartTitleHTML,void 0,void 0).height:zt(t.chartTitle.chartTitleText,16,tt).height:5;switch(l){case je.none:x.top=f+10,x.bottom=15,x.right=15,x.left=15;break;case je.top:x.top=f+50,x.bottom=15,x.right=15,x.left=15;break;case je.right:x.right=p+50,x.top=f+15,x.bottom=15,x.left=15;break;case je.bottom:x.bottom=45,x.top=f+15,x.right=15,x.left=15;break;case je.left:x.left=p+50,x.top=f+15,x.bottom=15,x.right=15}let L=r-x.top-x.bottom,u=e-x.left-x.right;return{margins:x,innerHeight:L,innerWidth:u,legendListWidth:p,chartTitleHeight:f}}catch(l){Ae(ut,"marginCalculationsForChartsWithoutAxis",l)}},Ya=(t,e,r,c,x,n,l,s,p,f,L=!0,u)=>{try{let S=t.legends.legendPosition,b=t.total.totalPosition,_=t.total.totalAlignment,A=t.total.totalVisibility&&L,R=t.legends.legendAlignmentTopBottom,g=t.legends.legendAlignment;switch(S){case je.none:break;case je.right:ua(e,r,c-n-25,l+5+(A&&b==Fa.top&&_==Bt.end?10:0),n+15,x-l-10-(A?b==Fa.top&&_==Bt.end?10:b==Fa.bottom&&_==Bt.start?25:0:0),S,g,f,t,s,!1,u);break;case je.top:ua(e,r,5,l+5,c-10,30,S,R,f,t,s,!1,u);break;case je.left:ua(e,r,5,p.top+(A&&b==Fa.top&&_==Bt.start?10:0),n+15,x-l-10-(A?b==Fa.top&&_==Bt.start?10:b==Fa.bottom&&_==Bt.start?25:0:0),S,g,f,t,s,!1,u);break;case je.bottom:ua(e,r,5,x-35,c-10,30,S,R,f,t,s,!1,u);break}}catch(S){Ae(ut,"initLegendListWithTotalValueAllowance",S)}},Ua=(t,e,r="legend")=>{try{let c=zt(Ji(e,r),rt(t.legends.legendFontSize),t.legends.legendFontFamily);return[c.width,c.height]}catch(c){Ae(ut,"calculateLegendsMaxPossibleWidth",c)}},ii=(t,e,r,c=!1)=>{try{let x=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?zt(t.chartTitle.chartTitleHTML,void 0,void 0).height:zt(t.chartTitle.chartTitleText,16,tt).height:5,n={top:t.chartTitle.chartTitleVisibility?x:20,bottom:c&&t.colorScale.showColor==Ta.colorTheme?40:20,left:20,right:20};return innerHeight=e-n.top-n.bottom,innerWidth=r-n.left-n.right,{margins:n,chartTitleHeight:x,innerHeight,innerWidth}}catch(x){Ae(ut,"marginCalculationsForChartsWithoutLegends",x)}},rt=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const r=parseFloat(e);return isNaN(r)?t:r}catch(e){Ae(ut,"convertStringToNumber",e)}};function Lt(t,e,r=!1){try{return t.map(c=>{let x;c.properties?x={...Hi,...c.properties}:x={...Hi,legend:c.legend,currentLegend:c.legend,alias:c.legend,name:c.legend};const n=e&&e.length!==0?e.map(l=>{const s=c.data.find(p=>p.dimension===l);return s?{...s}:{dimension:l,legend:c.legend,value:0}}):c.data.map(l=>({...l}));return{...c,properties:x,data:r?c.data:n}})}catch(c){Ae(ut,"generalizedChartData",c)}}const gi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){Ae(ut,"getJQuerySelector",e)}},Ai=(t,e,r,c,x,n,l)=>{try{let s=t-e,p=n-x,f=parseInt(l.connector.connectorKPI),L,u;switch(f){case 1:if(L=`.${r}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return v.format(L)(t);s=Math.abs(s);break;case 3:return L=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(s=Math.round(t/e*100-100)/100,u=v.format(L)(s),u);case 2:return x.toString().length!==4&&(p=NaN),L=`.${r}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(s=Math.pow(t/e,1/p)-1,u=v.format(L)(s),u)}if(e==0)return"N/A";{let S,b="",_=l.connector.connectorDisplayUnits;switch(_!="None"&&_!=null&&(_=="Thousands"&&(S=1e3,b="K"),_=="Millions"&&(S=1e6,b="M"),_=="Billions"&&(S=1e9,b="B"),s=s/S),isNaN(s)&&(s=0),c){case",.0%":return L=`.${r}%`,v.format(L)(s);case"":return L=`.${r}f`,v.format(L)(s)+b;case".2n":return L=`.${r}n`,v.format(L)(s)+b;case".2$":return L=`,.${r}f`,"$"+v.format(L)(s)+b;case".2c":return L=`,.${r}f`,"C$"+v.format(L)(s)+b;case".2ē":return L=`,.${r}f`,"€"+v.format(L)(s)+b;case".2ch":return L=`,.${r}f`,"CHF"+v.format(L)(s)+b;case",":return L=`,.${r}f`,v.format(L)(s)+b;case".2£":return L=`,.${r}f`,"£"+v.format(L)(s)+b;case".2₹":return L=`,.${r}f`,"₹"+v.format(L)(s)+b;default:return L=".2f",v.format(L)(s)+b}}}catch{}},Ja=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function er(t,e,r){try{let c=function(n){const l=n.split(" - ");return l.length>1?l[0]:n};const x=new Map;return e?.LegendList?.forEach(n=>{x.set(r?c(n?.name):n.measureUniqueId,n)}),t.map(n=>({...n,properties:x.get(r?c(n.legend):n.properties.measureUniqueId)??n.properties})).filter(n=>n.data[0].value!==0)}catch{return t}}const tr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID();let L=0,u=!1;const S=se.ColumnChart,b=Me.useRef(),_=Me.useRef(l);_.current=l;const A=Me.useRef(s);A.current=s;const R=Me.useRef(p);R.current=p;const g=Lt(r.ChartData,r.DimensionList),B=r.DimensionList,U=!1;let W=!1;const P=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,Z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe=[],$e=0,Ue=0;const Ye=new Map;let Pe={dimensionList:B,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{Ee()}catch(H){Ae("Columnchart","createColumnChart",H)}},[e]);const Ee=()=>{({formatOptions:e,svg:m,width:i,height:y}=St(b,e)),{formatOptions:e}=ta(e,g,r.DataTableData??[]),we(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:V,secondaryCustomYaxisMaxValue:Z}=Et(e,Pe.yMinLeft,Pe.yMaxLeft,Pe.yMinRight,Pe.yMaxRight),{margin:ce,yLabel:ne,xLabel:ae,yTitle:ue,xTitle:ge,dimensionHeightWidthArray:be,chartTitleHeight:pe,secondaryAxisTitleWidth:Q,legendMargin:G,secondaryYLabel:M,visibleBars:Ue,columnWidth:L,scrollbarVisible:u}=Ct(i,y,h,k,Pe.yMaxLeft,e,Pe.legendList,Pe.dimensionList,Pe.yMaxRight,W,P,t,!1,Pe),te(ce),{dataTable:T,dataTableHeight:a}=aa(e,ne,ue,g,Pe.dimensionList,r),Mt(m,i,y,e),N=Ft(m,ce),vt(N,e,a,o,d,S,f),Ce(),F(),Jt(N,e,a,ne,Se,d),W&&hi(N,e,a,M,De,d,o),wt(e,U,m,ce,ae,y,ge,Pe.chartType,ne,o,d),Dt(d,e,a,U,m,ce,ue,ne),Ht(m,W,ce,e,a,d,o,M,Q),Vt(m,e,i,pe),Pt(y,m,be,pe,i,G,e,g,f,a,ce,ct.rectangle,S,n),Gt(g,y,i,m,ce,o,u,Ue,Pe,$e,!1,O)},we=()=>{const H=[],E=[];let Y=[],ee=-1/0,z=1/0,I=-1/0,w=1/0,C=1/0,q=-1/0;g.forEach(J=>{E.push(J.properties.legendUniqueId),q=-1/0,C=1/0,J.data.forEach(j=>{H.push(j),J.properties.axis==="Secondary"?(W=!0,I=Math.max(I,j.value),w=Math.min(w,j.value)):(ee=Math.max(ee,j.value),z=Math.min(z,j.value)),q=Math.max(q,j.value),C=Math.min(C,j.value)}),J.properties.setColorScale&&Ye.set(J.properties.legendUniqueId,v.scaleSequential().domain([C,q]).interpolator(oi.interpolateRgb(J.properties.startColor,J.properties.endColor)))}),Pe.chartData=H,Pe.legendList=E,Pe.yMaxLeft=ee,Pe.yMinLeft=z>0?0:z,Pe.yMaxRight=I,Pe.yMinRight=w>0?0:w,Y=t?ft(e.xAxisLabel.xAxisNumberFormat,Pe.dimensionList).map(J=>J):Pe.dimensionList,Pe.dimensionList.forEach((J,j)=>{Pe.formattedDimensionListMap.set(J,Y[j])}),fe=JSON.parse(JSON.stringify(g)),ye=Pe.dimensionList,e.plotArea.hideZeroValues&&(Pe.hideZeroValues=!0)},Ce=()=>{let H=dt(V||Pe.yMaxLeft,Pe.yMinLeft,d,e,Pe,D,V).yAxisLabelArray;if(Pe.yMaxLeft=H[H.length-1],Pe.yMinLeft=H[0],re=v.scaleLinear().domain([Pe.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:Pe.yMinLeft<0?Pe.yMinLeft*1.1:Pe.yMinLeft*.9,Pe.yMaxLeft<=0?0:V!==void 0&&!Number.isNaN(V)?V:Pe.yMaxLeft*1.1]).range([a>0?d-a:d,0]),W){let E=dt(Z||Pe.yMaxRight,Pe.yMinRight,d,e,Pe,$,Z).yAxisLabelArray;Pe.yMaxRight=E[E.length-1],Pe.yMinRight=E[0],K=v.scaleLinear().domain([Pe.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:Pe.yMinRight*1.1,Pe.yMaxRight<=0?Z||0:Z||Pe.yMaxRight*1.1]).range([a>0?d-a:d,0])}ze=[0,o],ve()},ve=()=>{Le=v.scaleBand().domain(Pe.legendList).range([0,L]).paddingInner(Pe.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),me=v.scalePoint().domain(ye).range(ze).padding(.5)},F=()=>{{let H=dt(V||Pe.yMaxLeft,Pe.yMinLeft,d,e,Pe,D,V);Se=v.axisLeft(re).tickFormat(E=>Ze(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,o)).tickValues(H.autoLabelFlag?void 0:H.yAxisLabelArray).ticks(H.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(W){let H=dt(Z||Pe.yMaxRight,$||Pe.yMinRight,d,e,Pe,$,Z);De=v.axisRight(K).tickFormat(E=>Ze(E,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(H.autoLabelFlag?void 0:H.yAxisLabelArray).ticks(H.customTickValue??d/30).tickSize(Rt(e,o)).tickPadding(8).tickSizeOuter(0)}},le=()=>{ie=(parseInt(e.xAxisLabel.xAxisPosition)==1?v.axisTop(me):v.axisBottom(me)).tickSize(sa(e,d,a)).tickSizeOuter(0).tickValues(bt(ye,o))},he=H=>{H.forEach(E=>{E.data.forEach(Y=>{Y.hideZero=E.properties.hideZeroValues,Y.axis=E.properties.axis,Y.legendUniqueId=E.properties.legendUniqueId})}),ye.forEach(E=>{N.append("rect").attr("id",`dim-background-${E}`).attr("class","dimension-background").attr("x",me(E)-me.step()/2).attr("width",me.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),H.forEach(E=>{let Y=N.selectAll(".parentGroup").data([E],C=>C.properties.legendUniqueId);Y=Y.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Y);let ee=Y.selectAll(".column-group").data(E.data,C=>C.legend+C.dimension),z=ee.enter().append("g").attr("class","column-group").attr("hoverId",(E.properties.alias||E.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",C=>`translate(${me(C.dimension)-L/2}, 0)`);ee.attr("transform",C=>`translate(${me(C.dimension)-L/2}, 0)`),z.merge(ee).attr("transform",C=>`translate(${me(C.dimension)-L/2}, 0)`);const I=z.append("rect").attr("x",C=>Le(C.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",C=>(E.properties.axis===Qe.primary?re:K)(0)).attr("height",0).attr("fill",C=>Ye.get(E.properties.legendUniqueId)?.(C.value)??E.properties.color).attr("stroke-dasharray",C=>E.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",C=>`${E.properties.stackBorderWidth}px`).attr("stroke",C=>E.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?E.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",C=>C.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>E.properties.legendUniqueId).attr(lt.DimValue,C=>Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension));(e.animation.animationEnabled?I.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):I).attr("y",C=>{const q=E.properties.axis===Qe.primary?re:K;return C.value>0?q(C.value):q(0)}).attr("height",C=>{const q=E.properties.axis===Qe.primary?re:K;return Math.abs(q(C.value)-q(0))}),z.merge(ee).on("mousemove",(C,q)=>{(E.properties.alias||E.properties.name||"Legend").replace(/ /g,"-");const J=Array.isArray(q.dimension)?q.dimension[0]:q.dimension,j=String(Pe.formattedDimensionListMap.get(J)??J??""),Te=gt(_.current,String(J??""),{...E.properties,formattedDimensionValue:j});yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:j},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():q.properties?.currentMeasure?q.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||q.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(S)?q[1]-q[0]:q.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:E.properties.alias}],e,C,E.properties,Te)}).on("mouseout",(C,q)=>{(E.properties.alias||E.properties.name||"Legend").replace(/ /g,"-"),ot()}),z.merge(ee).on("click",Tt(R,A,(C,q)=>({seriesId:E.properties.legendUniqueId,dimValue:Array.isArray(q.dimension)?String(q.dimension[0]):String(q.dimension),legendUniqueId:E.properties.legendUniqueId,seriesDisplayName:E.properties.alias||E.properties.name||""}))),ee.exit().remove()}),N.selectAll(".parentGroup").raise()},te=H=>{o=i-H.left-H.right,d=y-H.bottom-H.top},O=(H,E,Y)=>{fe=E,ye=H,Ue=Y,X()},X=()=>{ve(),le(),Ot(N,Pe,ae,e,a,re,ie,be,y,L,t,o,d,ye,me),he(fe),Ra(g,me,re,K,ce,xt,[],[],e,S,y,i,o,ye,d,f,m,x,Le,L,c),ia(e.plotArea.fitChart,m,N,T,L,re,me,Le,void 0,void 0,a,S,e,ne,ue,Pe.dimensionList,o,ze,Pe.formattedDimensionListMap,f,ce,d)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:b,id:f,style:{width:"100%",height:"100%"}})})},ar=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0,u=!1,S=[];const b=se.CustomColumnChart,_=Me.useRef(),A=Me.useRef(l);A.current=l;const R=Me.useRef(s);R.current=s;const g=Lt(r.ChartData,r.DimensionList),B=r.DimensionList,U=!!e.swapAxis?.swapAxisEnabled;let W=!1;const P=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,V=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,Z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se=[],ie=[],De=[],ye=[],fe=[],$e=[],Ue=[],Ye=[],Pe,Ee,we,Ce=new Map,ve,F,le,he,te,O,X,H=[],E=[],Y=0,ee,z={dimensionList:B,chartType:b,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{I()}catch(We){Ae("CustomColumnchart","createCustomColumnChart",We)}},[e]);const I=()=>{({formatOptions:e,svg:m,width:i,height:y}=St(_,e)),w(),{formatOptions:e}=ta(e,g,r.DataTableData??[]),Fi(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:V,secondaryCustomYaxisMaxValue:Z}=Et(e,z.yMinLeft,z.yMaxLeft,z.yMinRight,z.yMaxRight),{margin:ce,yLabel:ne,xLabel:ae,yTitle:ue,xTitle:ge,dimensionHeightWidthArray:be,chartTitleHeight:pe,secondaryAxisTitleWidth:Q,legendMargin:G,secondaryYLabel:M,visibleBars:ee,columnWidth:L,scrollbarVisible:u}=Ct(i,y,h,k,z.yMaxLeft,e,z.legendList,z.dimensionList,z.yMaxRight,W,P,t,U,z),at(ce),{dataTable:T,dataTableHeight:a}=aa(e,ne,ue,g,z.dimensionList,r),U&&(T=[],a=0),Mt(m,i,y,e),N=Ft(m,ce),vt(N,e,a,o,d,b,f),q(),j(),U?(ra(e,N,ne,d,o,he),W&&pi(e,N,M,te,o)):(Jt(N,e,a,ne,Pe,d),W&&hi(N,e,a,M,we,d,o)),wt(e,U,m,ce,ae,y,ge,z.chartType,ne,o,d),Dt(d,e,a,U,m,ce,ue,ne,o),Ht(m,W,ce,e,a,d,o,M,Q,U),Vt(m,e,i,pe),Pt(y,m,be,pe,i,G,e,g,f,a,ce,null,b,n),Gt(g,y,i,m,ce,o,u,ee,z,Y,!1,it,U)},w=()=>{const We=[];let Xe=[],st=-1/0,Ke=1/0,Oe=-1/0,_e=1/0,Ie=[];g.forEach((Ne,He)=>{[se.StackColumnChart,se.StackAreaChart].includes(Ne.properties.type)?se.StackColumnChart===Ne.properties.type&&(We.includes(se.StackColumnChart)||We.push(se.StackColumnChart)):(Ie.push(Ne),Ne.properties.type!==se.LineChart&&Ne.properties.type!==se.AreaChart&&We.push(Ne.properties.legendUniqueId)),Ne.properties.axis==="Secondary"&&(ie.push(Ne),Ne.properties.type==se.StackColumnChart&&$e.push(Ne),Ne.properties.type==se.StackAreaChart&&fe.push(Ne)),Ne.properties.axis===Qe.primary&&(Se.push(Ne),Ne.properties.type==se.StackColumnChart&&ye.push(Ne),Ne.properties.type==se.StackAreaChart&&De.push(Ne)),Ne.data=Ne.data.map(ht=>{const nt={...ht,type:Ne.properties.type,axis:Ne.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ne.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ne.properties.labelColor,legendUniqueId:Ne.properties.legendUniqueId};return nt.axis==="Secondary"?(W=!0,Oe=Math.max(Oe,nt.value),_e=Math.min(_e,nt.value)):(st=Math.max(st,nt.value),Ke=Math.min(Ke,nt.value)),nt})}),H=JSON.parse(JSON.stringify(g)),z.chartData=Ie,z.legendList=We,z.yMaxLeft=st,z.yMinLeft=Ke>0?0:Ke,z.yMaxRight=Oe,z.yMinRight=_e>0?0:_e,Xe=t?ft(e.xAxisLabel.xAxisNumberFormat,z.dimensionList).map(Ne=>Ne):z.dimensionList,z.dimensionList.forEach((Ne,He)=>{z.formattedDimensionListMap.set(Ne,Xe[He])}),e.plotArea.fitChart?X=z.dimensionList:X=z.dimensionList.slice(Y,Y+ee),e.plotArea.hideZeroValues&&(z.hideZeroValues=!0),C(De,ye,fe,$e,g)},C=(We,Xe,st,Ke,Oe)=>{const _e=At(X,We,!1),Ie=At(X,st,!1),Ne=At(X,Xe,!1),He=At(X,Ke,!1);E=[];const ht=[];if(We.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:_e,data:We})}),st.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:Ie,data:st})}),Xe.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:Ne,data:Xe})}),Ke.forEach(nt=>{ht.push({properties:{axis:nt.properties.axis,type:nt.properties.type,legend:nt.properties.legend,annotation:nt.properties.annotation,alias:nt.properties.alias},stackData:He,data:Ke})}),ht.push(...z.chartData),Oe.length){const nt=[];Oe.forEach(mi=>{nt.push(...ht.filter(pl=>pl.properties?.type===mi.properties.type&&pl.properties.legend===mi.legend))}),E.push(...nt)}else E.push(...ht)},q=()=>{const We=U?[0,a>0?o-a:o]:[a>0?d-a:d,0];{const Xe=v.scaleLinear().domain([z.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:z.yMinLeft<0?z.yMinLeft*1.1:z.yMinLeft*.9,z.yMaxLeft<=0?0:V!==void 0&&!Number.isNaN(V)?V:z.yMaxLeft*1.1]).range(We);U?F=Xe:re=Xe}if(W){const Xe=v.scaleLinear().domain([z.yMinRight>=0?($||$==0)&&!Number.isNaN($)?$:0:($||$==0)&&!Number.isNaN($)?$:z.yMinRight*1.1,z.yMaxRight<=0?(Z||Z==0)&&!Number.isNaN(Z)?Z:0:(Z||Z==0)&&!Number.isNaN(Z)?Z:z.yMaxRight*1.1]).range(We);U?le=Xe:K=Xe}ze=U?[d,0]:[0,o]},J=()=>{Le=v.scaleBand().domain(z.legendList).range([0,L]).paddingInner(z.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0);const We=v.scalePoint().domain(X).range(ze).padding(.5);U?ve=We:me=We},j=()=>{{let We=dt(V||z.yMaxLeft,z.yMinLeft,d,e,z,D,V,U,o);U?he=v.axisBottom(F).tickFormat(Xe=>Ze(Xe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??o/50).tickPadding(8).tickSizeOuter(0):Pe=v.axisLeft(re).tickFormat(Xe=>Ze(Xe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,o)).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(W){let We=dt(V||z.yMaxRight,z.yMinRight,d,e,z,D,V);U?te=v.axisTop(le).tickFormat(Xe=>Ze(Xe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??o/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0):we=v.axisRight(K).tickFormat(Xe=>Ze(Xe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue??d/30).tickSize(Rt(e,o)).tickPadding(8).tickSizeOuter(0)}},Te=()=>{U?O=v.axisLeft(ve).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*o*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(X,d)):Ee=v.axisBottom(me).tickSize(sa(e,d,a,!0)).tickSizeOuter(0).tickValues(bt(X,o))},xe=We=>{We.forEach(Ke=>{switch(Ke.properties.type){default:case se.ColumnChart:de(Ke);break;case se.LineChart:break;case se.AreaChart:break;case se.StackColumnChart:Ue=Pa(Ke),Be();break;case se.StackAreaChart:Ye=Pa(Ke),ke(Ke);break}});const Xe=H.filter(Ke=>Ke.properties.type===se.LineChart);Xe.length&&Fe(Xe);const st=H.filter(Ke=>Ke.properties.type===se.AreaChart);st.length&&Ve(st),N.selectAll(".parentGroup").raise()},de=We=>{let Xe=N.selectAll(".parentGroup").data([We],Ie=>Ie.properties?.legendUniqueId);Xe=Xe.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Xe);let st=Xe.selectAll(".column-group").data(We.data,Ie=>Ie.legendUniqueId),Ke=st.enter().append("g").attr("class","column-group").attr("hoverId",Ie=>(We.properties.alias||We.properties.name).includes("-")?(We.properties.alias||We.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(We.properties.alias||We.properties.name).replace(/ /g,"-")).attr("transform",Ie=>U?`translate(0, ${ve(Ie.dimension)})`:`translate(${me(Ie.dimension)}, 0)`);Ke.merge(st).attr("transform",Ie=>U?`translate(0, ${ve(Ie.dimension)-L/2})`:`translate(${me(Ie.dimension)-L/2}, 0)`);const Oe=(U?Ke.append("rect").attr("y",Ie=>Le(Ie.legendUniqueId)).attr("height",Le.bandwidth()).attr("x",()=>(We.properties.axis===Qe.primary?F:le)(0)).attr("width",0):Ke.append("rect").attr("x",Ie=>Le(Ie.legendUniqueId)).attr("width",Le.bandwidth()).attr("y",()=>(We.properties.axis===Qe.primary?re:K)(0)).attr("height",0)).attr("fill",We.properties.color).attr("stroke-dasharray",Ie=>We.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ie=>`${We.properties.stackBorderWidth}px`).attr("stroke",Ie=>We.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?We.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ie=>Ie.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>We.properties.legendUniqueId).attr(lt.DimValue,Ie=>Array.isArray(Ie.dimension)?String(Ie.dimension[0]):String(Ie.dimension)).on("mousemove",(Ie,Ne)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:z.formattedDimensionListMap.get(Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(b)?Ne[1]-Ne[0]:Ne.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.legend.includes("~$~")?Ne.legend.split("~$~")[1]:Ne.legend}],e,Ie,g.filter(He=>He.legend===Ne.legend)[0].properties,(()=>{const He=Array.isArray(Ne.dimension)?Ne.dimension[0]:Ne.dimension,ht=g.filter(nt=>nt.legend===Ne.legend)[0].properties;return gt(p,String(He??""),{...ht,formattedDimensionValue:String(z.formattedDimensionListMap.get(He)??He??"")})})())}).on("mouseout",ot).on("click",Tt(R,A,(Ie,Ne)=>({seriesId:We.properties.legendUniqueId,dimValue:Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension),legendUniqueId:We.properties.legendUniqueId,seriesDisplayName:We.properties.alias||We.properties.name||""}))),_e=e.animation.animationEnabled?Oe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Oe;U?_e.attr("x",Ie=>{const Ne=We.properties.axis===Qe.primary?F:le;return Ie.value>0?Ne(0):Ne(Ie.value)}).attr("width",Ie=>{const Ne=We.properties.axis===Qe.primary?F:le;return Math.abs(Ne(Ie.value)-Ne(0))}):_e.attr("y",Ie=>{const Ne=We.properties.axis===Qe.primary?re:K;return Ie.value>0?Ne(Ie.value):Ne(0)}).attr("height",Ie=>{const Ne=We.properties.axis===Qe.primary?re:K;return Math.abs(Ne(Ie.value)-Ne(0))}),st.exit().remove()},Fe=We=>{We.forEach(_e=>{_e.data.forEach(Ie=>{Ie.hideZero=_e.properties.hideZeroValues,Ie.axis=_e.properties.axis,Ie.legendUniqueId=_e.properties.legendUniqueId})});const Xe=U?v.line().y(_e=>{const Ie=ve(_e.dimension);return Ie??0}).x(_e=>_e.axis==Qe.primary?F(_e.value):le(_e.value)).defined(_e=>e?.plotArea?.hideZeroValues?!!_e.value:!0).curve(mt(e)):v.line().x(_e=>me(_e.dimension)?me(_e.dimension):null).y(_e=>_e.axis==Qe.primary?re(_e.value):K(_e.value)).defined(_e=>e?.plotArea?.hideZeroValues?!!_e.value:!0).curve(mt(e));let st=N.selectAll(".lines.parentGroup").data([1]);st=st.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(st);let Ke=st.selectAll(".line-group").data(We,_e=>_e.properties.legendUniqueId),Oe=Ke.enter().append("g").attr("class","line-group");Oe.attr("hoverId",_e=>(_e.properties.alias||_e.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Oe.merge(Ke).select("path").attr("d",_e=>Xe(_e.data)).attr("stroke",_e=>_e.properties.color!==Re.white?_e.properties.color:"none").attr("stroke-dasharray",_e=>{switch(_e.properties.lineStyle){case pt.dotted:return"0,3";case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",_e=>_e.properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",_e=>_e.properties.lineStyle!=="None"?_e.properties.lineWidth:"0"),e.animation.animationEnabled&&Oe.merge(Ke).select("path").each(function(){const _e=v.select(this),Ie=this.getTotalLength();_e.attr("stroke-dasharray",Ie+" "+Ie).attr("stroke-dashoffset",Ie),_e.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Ke.exit().remove(),Da(st,We,se.CombinationLine,U?ve:me,U?F:re,U?le:K,null,e,z,Z,$,D,V,!1,p,U)},Ve=We=>{We.forEach(He=>{He.data.forEach(ht=>{ht.hideZero=He.properties.hideZeroValues,ht.axis=He.properties.axis,ht.legendUniqueId=He.properties.legendUniqueId})});const Xe=U?v.area().y(He=>{const ht=ve(He.dimension);return ht??0}).x0(()=>F(0)).x1(He=>F(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)):v.area().x(He=>me(He.dimension)?me(He.dimension):null).y0(()=>re(0)).y1(He=>re(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)),st=U?v.area().y(He=>{const ht=ve(He.dimension);return ht??0}).x0(()=>F(0)).x1(()=>F(0)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)):v.area().x(He=>me(He.dimension)?me(He.dimension):null).y0(()=>re(0)).y1(()=>re(0)).defined(He=>He.hideZero?!!He.value:!0).curve(mt(e)),Ke=e.animation.animationEnabled;let Oe=N.selectAll(".areas.parentGroup").data([1]),_e=N.append("g").attr("class","focusClass");Oe=Oe.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Oe);let Ie=Oe.selectAll(".area-group").data(We,He=>He.legend),Ne=Ie.enter().append("g").attr("class","area-group");Ne.append("path").attr("hoverId",He=>(He.properties.alias||He.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",He=>He.properties.color!==Re.white?He.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",He=>Ke?st(He.data):Xe(He.data)).each(function(He){Ke&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",Xe(He.data))}),Ie.select("path").attr("d",He=>Xe(He.data)),Ne.merge(Ie).select("path").attr("stroke",He=>He.properties.areaBorderColor!==Re.white?He.properties.areaBorderColor:"none").attr("stroke-dasharray",He=>{switch(He.properties.lineStyle){case"dotted":return"0,3";case"dashed":return fa;default:return""}}).attr("stroke-linecap",He=>He.properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",He=>He.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?He.properties.lineWidth:"0"),bi(e,Oe,_e,X,We,U?ve:me,U?F:re,b,!1,U),Ie.exit().remove(),Da(Oe,We,se.CombinationArea,U?ve:me,U?F:re,U?le:K,null,e,z,Z,$,D,V,!1,void 0,U)},ke=We=>{We.data.forEach(Ne=>{Ne.data.forEach(He=>{He.hideZero=Ne.properties.hideZeroValues,He.axis=Ne.properties.axis,He.legendUniqueId=Ne.properties.legendUniqueId})});const Xe=U?v.area().y(Ne=>{const He=ve(Ne.data.dimension);return He??0}).x0(Ne=>Ne.data.axis===Qe.primary?F(Ne[0]):le(Ne[0])).x1(Ne=>Ne.data.axis===Qe.primary?F(Ne[1]):le(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)):v.area().x(Ne=>me(Ne.data.dimension)?me(Ne.data.dimension):null).y0(Ne=>Ne.data.axis===Qe.primary?re(Ne[0]):K(Ne[0])).y1(Ne=>Ne.data.axis===Qe.primary?re(Ne[1]):K(Ne[1])).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)),st=U?v.area().y(Ne=>{const He=ve(Ne.data.dimension);return He??0}).x0(()=>F(0)).x1(()=>F(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)):v.area().x(Ne=>me(Ne.data.dimension)?me(Ne.data.dimension):null).y0(()=>re(0)).y1(()=>re(0)).defined(Ne=>Ne.hideZero?!!Ne.key:!0).curve(mt(e)),Ke=e.animation.animationEnabled;let Oe=N.selectAll(".parentGroup").data([Ye]);N.append("g").attr("class","focusClass"),Oe=Oe.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Oe);let _e=Oe.selectAll(".area-group").data(Ne=>Ne),Ie=_e.enter().append("g").attr("class",Ne=>"area-group "+Ne.key.replace(/ /g,"-"));Ie.append("path").attr("hoverId",Ne=>(We.data.filter(He=>He.legend===Ne.key)[0].properties.alias||We.data.filter(He=>He.legend===Ne.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ne=>Ne.color!==Re.white?Ne.color:"none").attr("d",Ne=>Ke?st(Ne):Xe(Ne)).each(function(Ne){Ke&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",Xe(Ne))}),_e.select("path").attr("d",Ne=>Xe(Ne)),Ie.merge(_e).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ne=>Ne.color!==Re.white?Ne.color:"none").attr("stroke-dasharray",(Ne,He)=>g[He].properties.lineStyle==="dotted"?"0,3":g[He].properties.lineStyle==="dashed"?fa:"").attr("stroke-linecap",(Ne,He)=>g[He].properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",(Ne,He)=>g[He].properties.lineStyle!=="None"?g[He].properties.lineWidth:"0"),_e.exit().remove(),Da(Oe,We.data,se.CombinationStackArea,U?ve:me,U?F:re,U?le:K,null,e,z,Z,$,D,V,!1,void 0,U)},Be=()=>{let We=N.selectAll(".parentGroup").data([Ue]);We=We.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(We);let Xe=We.selectAll(".stackcolumns-group").data(Ie=>Ie);Xe=Xe.enter().append("g").attr("class",Ie=>"stackcolumns-group ").merge(Xe);let Ke=Xe.selectAll("rect").data(Ie=>Ie);U?Ke.attr("x",Ie=>Ie.data.axis===Qe.primary?F(Ie[0]):le(Ie[0])).attr("width",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?F(V)-F(Ie[0]):F(Ie[1])-F(Ie[0]):Z&&Ie[1]>Z?le(Z)-le(Ie[0]):le(Ie[1])-le(Ie[0])):Ke.attr("y",Ie=>Ie.data.axis===Qe.primary?re(Ie[1]):K(Ie[1])).attr("height",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?re(Ie[0])-re(V):re(Ie[0])-re(Ie[1]):Z&&Ie[1]>Z?K(Ie[0])-K(Z):K(Ie[0])-K(Ie[1]));const Oe=U?Ke.enter().append("rect").attr("transform",Ie=>`translate(0, ${ve(Ie.data.dimension)-L/2})`).attr("x",Ie=>Ie.data.axis===Qe.primary?F(0):le(0)).attr("width",0):Ke.enter().append("rect").attr("transform",Ie=>`translate(${me(Ie.data.dimension)-L/2},0)`).attr("y",Ie=>Ie.data.axis===Qe.primary?re(0):K(0)).attr("height",0);Oe.merge(Ke).attr("hoverId",Ie=>Ie.alias.includes("~$~")?Ie.alias.split("~$~")[1].replace(/ /g,"-"):Ie.alias.replace(/ /g,"-")).attr(U?"y":"x",Ie=>Le(se.StackColumnChart)).attr(U?"height":"width",Le.bandwidth()).attr("fill",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(nt=>nt.legend===Ie.key);return g[ht]?.properties?.color||"gray"}).attr("stroke",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(mi=>mi.legend===Ie.key),nt=g[ht]?.properties;return nt?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?nt.stackBorderColor:"none"}).attr("stroke-dasharray",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(nt=>nt.legend===Ie.key);return g[ht]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ie,Ne,He)=>{const ht=Array.from(g).findIndex(nt=>nt.legend===Ie.key);return(g[ht]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ie,Ne)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:z.formattedDimensionListMap.get(Ne.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ne.properties?.currentMeasure?Ne.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ne.value,value:Ze(Ne.data[Ne.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ne.key.includes("~$~")?Ne.key.split("~$~")[1]:Ne.key}],e,Ie,g.filter(He=>He.legend===Ne.key)[0].properties,(()=>{const He=g.filter(ht=>ht.legend===Ne.key)[0].properties;return gt(p,String(Ne.data.dimension??""),{...He,formattedDimensionValue:String(z.formattedDimensionListMap.get(Ne.data.dimension)??Ne.data.dimension??"")})})())}).on("mouseout",ot).attr(lt.SeriesId,Ie=>Ie.key??"").attr(lt.DimValue,Ie=>Array.isArray(Ie.data.dimension)?String(Ie.data.dimension[0]):String(Ie.data.dimension)).on("click",Tt(R,A,(Ie,Ne)=>({seriesId:Ne.key??"",dimValue:Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension),legendUniqueId:Ne.key??"",seriesDisplayName:Ne.alias||Ne.key||""})));const _e=e.animation.animationEnabled?Oe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Oe;U?_e.attr("x",Ie=>Ie.data.axis===Qe.primary?F(Ie[0]):le(Ie[0])).attr("width",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?F(V)-F(Ie[0]):F(Ie[1])-F(Ie[0]):Z&&Ie[1]>Z?le(Z)-le(Ie[0]):le(Ie[1])-le(Ie[0])):_e.attr("y",Ie=>Ie.data.axis===Qe.primary?re(Ie[1]):K(Ie[1])).attr("height",Ie=>Ie.data.axis===Qe.primary?V&&Ie[1]>V?re(Ie[0])-re(V):re(Ie[0])-re(Ie[1]):Z&&Ie[1]>Z?K(Ie[0])-K(Z):K(Ie[0])-K(Ie[1])),Xe.exit().remove()},at=We=>{o=i-We.left-We.right,d=y-We.bottom-We.top},it=(We,Xe,st)=>{H=Xe,X=We,ee=st,ga(r,Ce,X),C(De,ye,fe,$e,Xe),H=JSON.parse(JSON.stringify(E)),H.forEach((Ke,Oe)=>{Ke.properties.type===se.StackColumnChart||Ke.properties.type===se.StackAreaChart?Ke.data.forEach((_e,Ie)=>H[Oe].data[Ie].data=_e.data.filter(Ne=>X.includes(Ne.dimension))):H[Oe].data=Ke.data.filter(_e=>X.includes(_e.dimension))}),Ha()};function ga(We,Xe,st){Xe.clear(),st&&st.length>0&&st.forEach(Ke=>{Xe.set(Ke,0)}),We.ChartData&&We.ChartData.length>0&&We.ChartData.forEach(Ke=>{Ke.properties.type.includes("Stack")&&Ke.data.forEach((Oe,_e)=>{if(Xe.has(Oe.dimension)){let Ie=Xe.get(Oe.dimension)||0;Ie+=Oe.value||0,Xe.set(Oe.dimension,Ie)}})})}const Ha=()=>{J(),Te(),xe(H),U?na(e,N,ae,d,o,O,te,F,z.yMaxLeft,X,b,t,i,be,L,ve):Ot(N,z,ae,e,a,re,Ee,be,y,L,t,o,d,X,me);const We=()=>{U||Ul(H,me,re,K,ce,xt,Ue,Ye,[],[],L,e,y,i,o,X,d,f,m,x,Le,c),ti(Ce,U?ve:me,U?F:re,ce,xt,[],e,b,y,i,m,c,U)};U||ia(e.plotArea.fitChart,m,N,T,L,re,me,Le,void 0,void 0,a,b,e,ne,ue,z.dimensionList,o,ze,z.formattedDimensionListMap,f,ce,d),m.selectAll(".annotation-group").remove(),We()},Pa=We=>{let Xe=We.data.map(Ke=>Ke.legend);S=v.stack().keys(Xe).offset(v.stackOffsetNone)(We.stackData),We.data.forEach((Ke,Oe)=>Ke.data.forEach((_e,Ie)=>{_e[0]=S[Oe][Ie][0],_e[1]=S[Oe][Ie][1]}));let st=e.annotation.annotationSetLabelColor;return S.forEach((Ke,Oe)=>{Ke.forEach(_e=>{_e.key=Ke.key,_e.alias=We.data[Oe].properties.alias,Ke.alias=We.data[Oe].properties.alias,Ke.color=JSON.parse(JSON.stringify(We.data[Oe].properties.color)),Ke.individualAnnotationVisibility=JSON.parse(JSON.stringify(We.data[Oe].properties.annotation)),_e.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?We.data[Oe].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),_e.data.labelColor=st=="2"?JSON.parse(JSON.stringify(We.data[Oe].properties.color)):JSON.parse(JSON.stringify(We.data[Oe].properties.labelColor)),_e.hideZero=JSON.parse(JSON.stringify(We.data[Oe].properties.hideZeroValues)),_e.data.axis=JSON.parse(JSON.stringify(We.data[Oe].properties.axis)),_e.data.color=JSON.parse(JSON.stringify(We.data[Oe].properties.color)),_e.data.legend=We.properties.type,_e.data.type=JSON.parse(JSON.stringify(We.data[Oe].properties.type))})}),S},Fi=()=>{if(Se.length>0){const Xe=(ye.length>0?At(X,ye,!1):At(X,De,!1)).map(st=>st.total);z.yMaxLeft=Math.max(z.yMaxLeft,...Xe),z.yMinLeft=Math.min(z.yMinLeft,...Xe)}if(ie.length>0){const Xe=($e.length>0?At(X,$e,!1):At(X,fe,!1)).map(st=>st.total);z.yMaxRight=Math.max(z.yMaxRight,...Xe),z.yMinRight=Math.min(z.yMinRight,...Xe)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:_,id:f,style:{width:"100%",height:"100%"}})})},ir=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.LayeredColumnChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!1,B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText);let D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze=[];const Se=new Map;let ie=0,De=2,ye=!1,fe={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{$e()}catch(he){Ae("LayeredColumnchart","createLayeredColumnChart",he)}},[e]);const $e=()=>{({formatOptions:e,svg:y,width:k,height:o}=St(S,e)),Ue(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:Q,maxNumberForSecondaryAxis:G,customYaxisMaxValue:P,secondaryCustomYaxisMaxValue:D}=Et(e,fe.yMinLeft,fe.yMaxLeft,fe.yMinRight,fe.yMaxRight),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:De,columnWidth:L,scrollbarVisible:ye}=Ct(k,o,Q,G,fe.yMaxLeft,e,fe.legendList,fe.dimensionList,fe.yMaxRight,B,U,t,!1,fe),ve(V),{dataTable:d,dataTableHeight:i}=aa(e,$,ce,A,fe.dimensionList,r),Mt(y,k,o,e),T=Ft(y,V),vt(T,e,i,M,h,u,f),Ye(),Ee(),Jt(T,e,i,$,K,h),wt(e,g,y,V,Z,o,ne,fe.chartType,$,M,h),Dt(h,e,i,g,y,V,ce,$),Ht(y,B,V,e,i,h,M,pe,ge),Vt(y,e,k,ue),Pt(o,y,ae,ue,k,be,e,A,f,i,V,ct.rectangle,u,n),Gt(A,o,k,y,V,M,ye,De,fe,ie,!1,le)},Ue=()=>{const he=[],te=[];let O=[],X=-1/0,H=1/0,E=-1/0,Y=1/0,ee=-1/0,z=1/0;A.forEach(I=>{te.push(I.properties.legendUniqueId),ee=-1/0,z=1/0,I.data.forEach(w=>{he.push(w),ee=Math.max(ee,w.value),z=Math.min(z,w.value),X=Math.max(X,w.value),H=Math.min(H,w.value)}),I.properties.setColorScale&&Se.set(I.properties.legendUniqueId,v.scaleSequential().domain([z,ee]).interpolator(v.interpolateRgb(I.properties.startColor,I.properties.endColor)))}),fe.chartData=he,fe.legendList=te,fe.yMaxLeft=X,fe.yMinLeft=H>0?0:H,fe.yMaxRight=E,fe.yMinRight=Y>0?0:Y,O=t?ft(e.xAxisLabel.xAxisNumberFormat,fe.dimensionList).map(I=>I):fe.dimensionList,fe.dimensionList.forEach((I,w)=>{fe.formattedDimensionListMap.set(I,O[w])}),ze=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Le=fe.dimensionList:Le=fe.dimensionList.slice(ie,ie+De),e.plotArea.hideZeroValues&&(fe.hideZeroValues=!0)},Ye=()=>{let he=dt(P||fe.yMaxLeft,fe.yMinLeft,h,e,fe,W,P).yAxisLabelArray;fe.yMaxLeft=he[he.length-1],fe.yMinLeft=he[0],a=v.scaleLinear().domain([fe.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:fe.yMinLeft<0?fe.yMinLeft*1.1:fe.yMinLeft*.9,fe.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:fe.yMaxLeft*1.1]).range([i>0?h-i:h,0]),re=[0,M]},Pe=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(fe.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(Le).range(re).padding(.5)},Ee=()=>{we();{let he=dt(P||fe.yMaxLeft,fe.yMinLeft,h,e,fe,W,P);K=v.axisLeft(a).tickFormat(te=>Ze(te,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,M)).tickValues(he.autoLabelFlag?void 0:he.yAxisLabelArray).ticks(he.customTickValue).tickPadding(8).tickSizeOuter(0)}},we=()=>{me=v.axisBottom(N).tickSize(sa(e,h,i)).tickSizeOuter(0).tickValues(bt(Le,M))},Ce=he=>{he.forEach(te=>{te.data.forEach(O=>{O.hideZero=te.properties.hideZeroValues,O.properties=te.properties,O.axis=te.properties.axis})}),he.forEach((te,O)=>{let X=T.selectAll(".parentGroup").filter(z=>z?.properties?.legendUniqueId===te.properties.legendUniqueId).data([te],z=>z.properties.legendUniqueId);X=X.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",te.properties.legendUniqueId).attr("clip-path",`url(#${f}-clip)`).merge(X);let H=X.selectAll(".column-group").data(te.data,z=>z.dimension+"_"+te.properties.legendUniqueId),E=H.enter().append("g").attr("class","column-group").attr("hoverId",(te.properties.alias||te.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",z=>O===0?`translate(${N(z.dimension)-L/2}, 0)`:`translate(${N(z.dimension)-L/(2+O*2)}, 0)`);H.attr("transform",z=>O===0?`translate(${N(z.dimension)-L/2}, 0)`:`translate(${N(z.dimension)-L/(2+O*2)}, 0)`),E.merge(H).attr("transform",z=>O===0?`translate(${N(z.dimension)-L/2}, 0)`:`translate(${N(z.dimension)-L/(2+O*2)}, 0)`);const Y=E.append("rect").attr("x",()=>0).attr("width",O===0?L:L/2+O*2).attr("y",z=>(te.properties.axis===Qe.primary?a:m)(0)).attr("height",0).attr("fill",z=>Se.get(te.properties.legendUniqueId)?.(z.value)??te.properties.color).attr("stroke-dasharray",()=>te.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${te.properties.stackBorderWidth}px`).attr("stroke",()=>te.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?te.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",z=>z.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>te.properties.legendUniqueId).attr(lt.DimValue,z=>Array.isArray(z.dimension)?String(z.dimension[0]):String(z.dimension));(e.animation.animationEnabled?Y.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Y).attr("y",z=>{const I=te.properties.axis===Qe.primary?a:m;return z.value>0?I(z.value):I(0)}).attr("height",z=>{const I=te.properties.axis===Qe.primary?a:m;return Math.abs(I(z.value)-I(0))}),H.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("y",z=>{const I=te.properties.axis===Qe.primary?a:m;return z.value>0?I(z.value):I(0)}).attr("height",z=>{const I=te.properties.axis===Qe.primary?a:m;return Math.abs(I(z.value)-I(0))}),E.merge(H).on("mousemove",(z,I)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:fe.formattedDimensionListMap.get(Array.isArray(I.dimension)?I.dimension[0]:I.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():I.properties?.currentMeasure?I.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||I.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(u)?I[1]-I[0]:I.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:I.properties.alias}],e,z,I.properties,(()=>{const C=Array.isArray(I.dimension)?I.dimension[0]:I.dimension;return gt(p,String(C??""),{...I.properties,formattedDimensionValue:String(fe.formattedDimensionListMap.get(C)??C??"")})})());let w=(te.properties.alias||te.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),v.selectAll('[hoverId="'+w+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(z,I)=>{let w=(te.properties.alias||te.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+w+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}),E.merge(H).on("click",Tt(_,b,(z,I)=>({seriesId:te.properties.legendUniqueId,dimValue:Array.isArray(I.dimension)?String(I.dimension[0]):String(I.dimension),legendUniqueId:te.properties.legendUniqueId,seriesDisplayName:te.properties.alias||te.properties.name||""}))),H.exit().remove()}),T.selectAll(".parentGroup").raise()},ve=he=>{M=k-he.left-he.right,h=o-he.bottom-he.top},F=()=>{Pe(),we(),Ot(T,fe,Z,e,i,a,me,ae,o,L,t,M,h,Le,N),Ce(ze),Ra(A,N,a,void 0,V,xt,[],[],e,u,o,k,M,Le,h,f,y,x,void 0,L,c),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,se.ColumnChart,e,$,ce,fe.dimensionList,M,re,fe.formattedDimensionListMap,f,V,h))},le=(he,te,O)=>{ze=te,Le=he,De=O,F()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},lr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID();let L=0,u=!1;const S=se.StackColumnChart,b=Me.useRef(),_=Me.useRef(s);_.current=s;const A=Me.useRef(p);A.current=p;const R=r.DimensionList,g=(Lt(r.ChartData,r.DimensionList)||[]).reverse(),B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0;e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText),e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility&&parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText);let D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N;const re=new Map;let K,me,Le,ze=[],Se=0,ie,De=[],ye=new Map;const fe=!1;let $e={dimensionList:R,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{Ue()}catch(E){Ae("StackStackColumnchart","createStackColumnChart",E)}},[e]);const Ue=()=>{({formatOptions:e,svg:i,width:h,height:k}=St(b,e)),Ye(),{formatOptions:e}=ta(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,$e.yMinLeft,$e.yMaxLeft,$e.yMinRight,$e.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be,visibleBars:ie,columnWidth:L,scrollbarVisible:u}=Ct(h,k,pe,Q,$e.yMaxLeft,e,$e.legendList,$e.dimensionList,$e.yMaxRight,U,fe,t,!1,$e),F(D),{dataTable:o,dataTableHeight:d}=aa(e,V,Z,g,$e.dimensionList,r),Mt(i,h,k,e),y=Ft(i,D),vt(y,e,d,G,M,S,f),Pe(),we(),Jt(y,e,d,V,K,M),wt(e,B,i,D,$,k,ce,$e.chartType,V,G,M),Dt(M,e,d,B,i,D,Z,V),Ht(i,U,D,e,d,M,G,be,ue),Vt(i,e,h,ae),Pt(k,i,ne,ae,h,ge,e,[...g].reverse(),f,d,D,ct.rectangle,S,n),Gt(g,k,h,i,D,G,u,ie,$e,Se,!1,le)},Ye=()=>{const E=[],Y=[];let ee=-1/0,z=1/0;g.forEach((j,Te)=>{const xe=`${Te}~$~${j.properties.legend}`;j.properties.legend=xe,Y.push(xe),ee=-1/0,z=1/0;for(const de of j.data)ee=Math.max(ee,de.value),z=Math.min(z,de.value),E.push(de);j.properties.setColorScale&&re.set(j.properties.legendUniqueId,v.scaleSequential().domain([z,ee]).interpolator(oi.interpolateRgb(j.properties.startColor,j.properties.endColor)))}),$e.chartData=E,$e.legendList=Y,ze=JSON.parse(JSON.stringify(g));let I=At($e.dimensionList,g,fe);Le=$e.dimensionList;const w=v.stack().keys($e.legendList).offset(v.stackOffsetDiverging)(I);te();let C=1/0,q=-1/0;for(const j of w)for(const[Te,xe]of j)C=Math.min(C,Te),q=Math.max(q,xe);$e.yMinLeft=C>0?0:C,$e.yMaxLeft=q;let J=t?ft(e.xAxisLabel.xAxisNumberFormat,$e.dimensionList).map(j=>j):$e.dimensionList;$e.dimensionList.forEach((j,Te)=>{$e.formattedDimensionListMap.set(j,J[Te])}),e.plotArea.hideZeroValues&&($e.hideZeroValues=!0)},Pe=()=>{T=v.scaleLinear().domain([$e.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:$e.yMinLeft<0?$e.yMinLeft*1.1:$e.yMinLeft*.9,$e.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:$e.yMaxLeft*1.1]).range([d>0?M-d:M,0]),N=[0,G]},Ee=()=>{m=v.scalePoint().domain(Le).range([0,G]).padding(.5)},we=()=>{{const E=dt(P||$e.yMaxLeft,$e.yMinLeft,M,e,$e,W,P);K=v.axisLeft(T).tickFormat(Y=>Ze(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,G)).tickValues(E.autoLabelFlag?void 0:E.yAxisLabelArray).ticks(E.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ce=()=>{me=v.axisBottom(m).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(bt(Le,G))},ve=E=>{E.forEach(J=>{J.data.forEach(j=>{j.hideZero=J.properties.hideZeroValues,j.axis=J.properties.axis})}),Le.forEach(J=>{y.append("rect").attr("id",`dim-background-${J}`).attr("class","dimension-background").attr("x",m(J)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Y=y.selectAll(".parentGroup").data([De]);Y=Y.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(Y);let ee=Y.selectAll(".column-group").data(J=>J);ee=ee.enter().append("g").attr("class",J=>"column-group "+J.key.replace(/ /g,"-")).attr("hoverId",J=>J[0]?.properties.alias?Ja(J[0]?.properties.alias):Ja(J.key)).merge(ee);let I=ee.selectAll("rect").data(J=>J);const w=(J,j)=>{const Te=Array.from(ee.nodes()).indexOf(J[j].parentNode);return{props:g[Te]?.properties,groupIndex:Te}},C=I.enter().append("rect").merge(I).attr("x",J=>m(J.data.dimension)-L/2).attr("width",L).attr("y",J=>T(0)).attr("height",0).attr("fill",(J,j,Te)=>{const{props:xe}=w(Te,j);return re.get(xe.legendUniqueId)?.(J.data[J.key])??xe?.color??"gray"}).attr("stroke",(J,j,Te)=>{const{props:xe}=w(Te,j);return xe?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?xe.stackBorderColor:"none"}).attr("stroke-dasharray",(J,j,Te)=>{const{props:xe}=w(Te,j);return xe?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(J,j,Te)=>{const{props:xe}=w(Te,j);return(xe?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(J,j,Te)=>{const{props:xe}=w(Te,j);return J.data[J.key]==0&&xe?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,J=>J.key??"").attr(lt.DimValue,J=>Array.isArray(J.data.dimension)?String(J.data.dimension[0]):String(J.data.dimension)).on("mousemove",(J,j)=>{const Te=String($e.formattedDimensionListMap.get(j.data.dimension)??j.data.dimension??""),xe=gt(l,String(j.data.dimension??""),{...j.properties,formattedDimensionValue:Te});yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:$e.formattedDimensionListMap.get(j.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():j.properties?.currentMeasure?j.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||j.value,value:Ze(j.data[j.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:j.properties.alias}],e,J,j.properties,xe)}).on("mouseout",(J,j)=>{ot()}).on("click",Tt(A,_,(J,j)=>({seriesId:j.key??"",dimValue:Array.isArray(j.data.dimension)?String(j.data.dimension[0]):String(j.data.dimension),legendUniqueId:j.key??"",seriesDisplayName:j.properties?.alias||j.key||""})));(e.animation.animationEnabled?C.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):C).attr("y",J=>J[1]>=J[0]?T(J[1]):T(J[0])).attr("height",J=>Math.abs(T(J[0])-T(J[1]))),ee.exit().remove(),y.selectAll(".parentGroup").raise()},F=E=>{G=h-E.left-E.right,M=k-E.bottom-E.top},le=(E,Y,ee)=>{ze=Y,Le=E,ie=ee,ai(r,ye,Le),he()},he=()=>{Ee(),Ce(),Ot(y,$e,$,e,d,T,me,ne,k,L,t,G,M,Le,m),te();const E=new Map;Le.forEach((Y,ee)=>{let z=0;De.forEach(I=>{const w=I[ee]?.[0]??0;w<z&&(z=w)}),E.set(Y,z)}),ve(ze),za(De,m,T,a,D,xt,[],[],e,S,k,h,G,Le,M,f,i,x,d,c),ti(ye,m,T,D,xt,[],e,S,k,h,i,c,!1,E),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,i,y,o,L,T,m,void 0,void 0,void 0,d,S,e,V,Z,Le,G,N,$e.formattedDimensionListMap,f,D,M)),O()},te=()=>{let E=At(Le,ze,fe);De=v.stack().keys($e.legendList).offset(v.stackOffsetDiverging)(E),ze.forEach((ee,z)=>ee.data.forEach((I,w)=>{I[0]=De[z][w][0],I[1]=De[z][w][1]}));let Y=e.annotation.annotationSetLabelColor;De.forEach((ee,z)=>ee.forEach(I=>{I.key=ee.key,ee.color=JSON.parse(JSON.stringify(g[z].properties.color)),I.data.labelPosition=g[z].properties.dataLabelPosition,I.data.labelColor=Y=="2"?JSON.parse(JSON.stringify(g[z].properties.color)):g[z].properties.labelColor,I.hideZero=JSON.parse(JSON.stringify(g[z].properties.hideZeroValues)),I.properties=g[z].properties}))},O=()=>{try{const E=e?.connector,Y=Number(E?.connectorVisibility);if(!E||Y===2)return;let ee,z=[];Y===1?ee=1:Y===3&&(Number(E.connectorFollow)===1?ee=Number(E.connectorStepSize)||void 0:Number(E.connectorFollow)===2&&(z=E.connectorExclude??[],ee=1));const I=(z||[]).map(j=>String(j).split("-")[0]),w=(De[0]??[]).map((j,Te)=>({Dimension:j.data.dimension,Total:j.data.total,CustomTotal:j.data.total,Index:Te})),C=[],q=[];let J=[];if(ee){if(ee===1)C.push(...w);else for(const j of w)j.Index%ee===0&&C.push(j);for(let j=ee;j<w.length;j+=ee){const Te=Math.min(j+ee,w.length);let xe=w[j]?.Total??Number.NEGATIVE_INFINITY;for(let de=j;de<Te;de++)w[de].Total>xe&&(xe=w[de].Total);Number.isFinite(xe)&&q.push(xe)}J=C.slice(1)}else{const j=E.connectorCustomRange??[],Te=new Map;w.forEach(xe=>Te.set(String(xe.Dimension),xe.Index));for(const xe of j){if(!xe?.from||!xe?.to)continue;const de=Te.get(String(xe.from)),Fe=Te.get(String(xe.to));if(de!=null&&Fe!=null){C.push(w[de]);const Ve=Math.min(de,Fe),ke=Math.max(de,Fe);let Be=w[Ve]?.Total??Number.NEGATIVE_INFINITY;for(let at=Ve;at<=ke;at++)w[at].Total>Be&&(Be=w[at].Total);Number.isFinite(Be)&&q.push(Be)}}for(const xe of j){if(!xe?.from||!xe?.to)continue;const de=Te.get(String(xe.to));de!=null&&J.push(w[de])}}y.selectAll("defs > #arrow").remove(),y.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",E.connectorMarkerColor!==Re.white?E.connectorMarkerColor:"none"),X(C,q,J,ee,I),H(C,q,J,ee,I)}catch{}},X=(E,Y,ee,z,I)=>{try{const w=E.filter((j,Te)=>z!=null?Te<E.length-1:Te<E.length);let C=y.selectAll("path.connector-path").data(w,j=>String(j.Dimension));C.exit().remove(),C.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(C).attr("d",(j,Te)=>e.total.totalVisibility?`M ${m(j.Dimension)+m.bandwidth()/2+5}, ${T(j.Total)-25} V ${-35+Math.min(T(Y[Te]),T(ee[Te].Total),T(j.Total))} H ${m(ee[Te].Dimension)+m.bandwidth()/2-10} V ${-27+T(ee[Te].Total)}`:`M ${m(j.Dimension)+m.bandwidth()/2+5}, ${T(j.Total)-5} V ${-30+Math.min(T(ee[Te].Total),T(j.Total))} H ${m(ee[Te].Dimension)+m.bandwidth()/2-10} V ${-10+T(ee[Te].Total)}`).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",j=>I.includes(j.Dimension)||j.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},H=(E,Y,ee,z,I)=>{try{let w,C=e.connector.connectorFontStyle,q=e.connector.connectorNumberFormat,J=G/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(q=".2s");const j=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Te=Mi(j,L),xe=Te*(typeof m.padding=="function"?m.padding():0),de=E.map((Be,at)=>({d:Be,i:at})).filter(Be=>z!=null?Be.i<E.length-1:Be.i<E.length);let Fe=y.selectAll("text.connector-text").data(de,Be=>String(Be.d.Dimension));Fe.exit().remove(),Fe.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(Fe).attr("x",Be=>{const at=Be.d,it=Be.i,ga=ee[it];return m(ga.Dimension)-Te*z/2}).attr("y",Be=>{const at=Be.d,it=Be.i,ga=Y[it],Ha=ee[it],Pa=Math.min(T(Ha?.Total??0),T(at.Total));return e.total.totalVisibility?J<8?-40+Pa:-41+Pa:J<8?-35+Pa:-40+Pa}).style("text-anchor","middle").text(Be=>{const at=Be.d,it=Be.i;return ee[it]?(at.CustomTotal==0&&ee[it].CustomTotal!=0&&(at.CustomTotal=1),Ai(ee[it].Total,at.Total,parseInt(e.connector.connectorDecimalPrecision),q,parseInt(at.Dimension),parseInt(ee[it].Dimension),e)):""}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",C.includes("Italic")?"Italic":"").style("text-decoration",C.includes("Underline")?"Underline":"").style("font-weight",C.includes("Bold")?"Bold":"").style("visibility",Be=>{const at=Be.d;return I.includes(at.Dimension)||at.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:b,id:f,style:{width:"100%",height:"100%"}})})},rr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.NormalizedStackColumnChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList).reverse(),R=r.DimensionList,g=!1,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q=!1,G,M,h,k,o,d,i,y,T,a,m,N;const re=new Map;let K,me,Le,ze=[],Se=0,ie=0,De=[];const ye=!0;let fe={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{$e()}catch(te){Ae("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",te)}},[e]);const $e=()=>{({formatOptions:e,svg:i,width:h,height:k}=St(S,e)),Ue(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:be,maxNumberForSecondaryAxis:pe}=Et(e,fe.yMinLeft,fe.yMaxLeft,fe.yMinRight,fe.yMaxRight),{margin:P,yLabel:D,xLabel:V,yTitle:$,xTitle:Z,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:ae,legendMargin:ue,secondaryYLabel:ge,visibleBars:ie,columnWidth:L,scrollbarVisible:Q}=Ct(h,k,be,pe,fe.yMaxLeft,e,fe.legendList,fe.dimensionList,fe.yMaxRight,B,ye,t,!1,fe),ve(P),{dataTable:o,dataTableHeight:d}=aa(e,D,$,A,fe.dimensionList,r),Mt(i,h,k,e),y=Ft(i,P),vt(y,e,d,G,M,u),Ye(),Ee(),Jt(y,e,d,D,K,M),wt(e,g,i,P,V,k,Z,fe.chartType,D,G,M),Dt(M,e,d,g,i,P,$,D),Ht(i,B,P,e,d,M,G,ge,ae),Vt(i,e,h,ne),Pt(k,i,ce,ne,h,ue,e,[...A].reverse(),f,d,P,ct.rectangle,u,n),Gt(A,k,h,i,P,G,Q,ie,fe,Se,!1,F)},Ue=()=>{const te=[],O=[];let X=-1/0,H=1/0;A.forEach((I,w)=>{const C=`${w}~$~${I.properties.legend}`;I.properties.legend=C,O.push(C),X=-1/0,H=1/0;for(const q of I.data)X=Math.max(X,q.value),H=Math.min(H,q.value),te.push(q);I.properties.setColorScale&&re.set(I.properties.legendUniqueId,v.scaleSequential().domain([H,X]).interpolator(v.interpolateRgb(I.properties.startColor,I.properties.endColor)))}),fe.chartData=te,fe.legendList=O,ze=JSON.parse(JSON.stringify(A));let E=At(fe.dimensionList,A,ye);Le=fe.dimensionList;const Y=v.stack().keys(fe.legendList).offset(v.stackOffsetDiverging)(E);he();let ee=1/0;for(const I of Y)for(const[w]of I)ee=Math.min(ee,w);fe.yMinLeft=ee>0?0:ee,fe.yMaxLeft=1;let z=t?ft(e.xAxisLabel.xAxisNumberFormat,fe.dimensionList).map(I=>I):fe.dimensionList;fe.dimensionList.forEach((I,w)=>{fe.formattedDimensionListMap.set(I,z[w])}),e.plotArea.hideZeroValues&&(fe.hideZeroValues=!0)},Ye=()=>{let te=dt(W||fe.yMaxLeft,fe.yMinLeft,M,e,fe,U,W).yAxisLabelArray;if(fe.yMaxLeft=te[te.length-1],fe.yMinLeft=te[0],T=v.scaleLinear().domain([fe.yMinLeft<0?-1:0,1]).range([d>0?M-d:M,0]),N=[0,G],e.seriesLabel.seriesLabelVisibility){let O=la(G,T,e,ze,void 0,B,M,!0);O.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&O.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?N=[0,G-O.heightWidth[0]]:N=[O.heightWidth[0],G]}},Pe=()=>{m=v.scalePoint().domain(Le).range(N).padding(.5)},Ee=()=>{K=v.axisLeft(T).tickSize(Rt(e,G)).ticks(d>0?(M-d)/80:M/80,"%").tickPadding(8).tickSizeOuter(0)},we=()=>{me=v.axisBottom(m).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(bt(Le,G))},Ce=te=>{De.forEach((w,C)=>w.forEach((q,J)=>{te[C].data[J]&&te[C].data[J][0]!==void 0&&te[C].data[J][1]!==void 0&&(te[C].data[J][0]=q[0]=q.data.total===0?0:q[0]/q.data.total,te[C].data[J][1]=q[1]=q.data.total===0?0:q[1]/q.data.total)})),te.forEach(w=>{w.data.forEach(C=>{C.hideZero=w.properties.hideZeroValues,C.axis=w.properties.axis})}),Le.forEach(w=>{y.append("rect").attr("id",`dim-background-${w}`).attr("class","dimension-background").attr("x",m(w)-m.step()/2).attr("width",m.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let O=y.selectAll(".parentGroup").data([De]);O=O.enter().append("g").attr("class","columns parentGroup").merge(O);let X=O.selectAll(".column-group").data(w=>w);X=X.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(te[w.index].properties.alias||te[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(X);let E=X.selectAll("rect").data(w=>w);const Y=(w,C)=>{const q=Array.from(X.nodes()).indexOf(w[C].parentNode);return{props:A[q]?.properties,groupIndex:q}},ee=E.enter().append("rect").attr("x",w=>m(w.data.dimension)-L/2).attr("width",L).attr("y",T(0)).attr("height",0).attr("fill",(w,C,q)=>{const{props:J}=Y(q,C);return re.get(J.legendUniqueId)?.(w.data[w.key])??J?.color??"gray"}).attr("stroke",(w,C,q)=>{const{props:J}=Y(q,C);return J?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?J.stackBorderColor:"none"}).attr("stroke-dasharray",(w,C,q)=>{const{props:J}=Y(q,C);return J?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(w,C,q)=>{const{props:J}=Y(q,C);return(J?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(w,C,q)=>{const{props:J}=Y(q,C);return w.data[w.key]===0&&J?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,w=>w.key??"").attr(lt.DimValue,w=>Array.isArray(w.data.dimension)?String(w.data.dimension[0]):String(w.data.dimension)),z=e.animation.animationEnabled;(w=>z?w.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):w)(ee).attr("y",w=>w[1]>=w[0]?T(w[1]):T(w[0])).attr("height",w=>Math.abs(T(w[0])-T(w[1]))),ee.merge(E).on("mousemove",(w,C)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:fe.formattedDimensionListMap.get(C.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Ze(C[1]-C[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,w,C.properties,gt(p,String(C.data.dimension??""),{...C.properties,formattedDimensionValue:String(fe.formattedDimensionListMap.get(C.data.dimension)??C.data.dimension??"")}))}).on("mouseout",(w,C)=>{ot()}).on("click",Tt(_,b,(w,C)=>({seriesId:C.key??"",dimValue:Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension),legendUniqueId:C.key??"",seriesDisplayName:C.properties?.alias||C.key||""}))),X.exit().remove(),y.selectAll(".parentGroup").raise()},ve=te=>{G=h-te.left-te.right,M=k-te.bottom-te.top},F=(te,O,X)=>{ze=O,Le=te,ie=X,le()},le=()=>{Pe(),we(),he(),Ot(y,fe,V,e,d,T,me,ce,k,L,t,G,M,Le,m),Ce(ze),za(De,m,T,a,P,xt,[],[],e,u,k,h,G,Le,M,f,i,x,d,c),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,i,y,o,m.bandwidth(),T,m,void 0,void 0,void 0,d,u,e,D,$,fe.dimensionList,G,N,fe.formattedDimensionListMap,f,P,M))},he=()=>{let te=At(Le,ze,ye);De=v.stack().keys(fe.legendList).offset(v.stackOffsetDiverging)(te),ze.forEach((X,H)=>X.data.forEach((E,Y)=>{E[0]=De[H][Y][0],E[1]=De[H][Y][1]}));let O=e.annotation.annotationSetLabelColor;De.forEach((X,H)=>X.forEach(E=>{E.key=X.key,X.color=JSON.parse(JSON.stringify(A[H].properties.color)),X.individualAnnotationVisibility=JSON.parse(JSON.stringify(A[H].properties.individualAnnotationVisibility)),E.data.labelPosition=A[H].properties.dataLabelPosition,E.data.labelColor=O=="2"?JSON.parse(JSON.stringify(A[H].properties.color)):A[H].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(A[H].properties.hideZeroValues)),E.properties=A[H].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},Ca="ChartsWithoutAxisFunctions.ts";function qi(t,e,r){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:c,minVal:x,maxVal:n}=e.plotArea.plotAreaRangeFilter;return t.filter(l=>{const s=r(l);switch(c){case"lt":return s<=n;case"gt":return s>=x;case"in":return s>=x&&s<=n;case"not-in":return s<x||s>n;default:return!0}})}function Ki(t,e,r,c,x,n){try{c.xAxisLabel.xAxisDateFormat=c.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":c.xAxisLabel.xAxisDateFormat;let l={top:0,left:0,right:0,bottom:0},s=t*.15*.8,p=n[0],f=s<p+10?s:p+10,L=c.plotArea.numberOfBubbles?20:0;const u=qe(c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisNumberFormat,c.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString();let b=Nt(u,c.xAxisLabel.xAxisLabelFontSize,c.xAxisLabel.xAxisLabelFontFamily,c.xAxisLabel.xAxisLabelRotation)[3]+10,_=c.xAxisTitle.xAxisTitleVisibility?c.xAxisTitle.xAxisDynamicTitleText.length!==0?zt(c.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:zt(c.xAxisTitle.xAxisTitleText,13,tt).height:0;_=_>e*.1?e*.1:_;let A=c.xAxisLabel.xAxisLabelVisibility?b:0,R=c.yAxisTitle.yAxisTitleVisibility?c.yAxisTitle.yAxisDynamicTitleText.length!==0?zt(c.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:zt(c.yAxisTitle.yAxisTitleText,13,tt).height:0;R=R>t*.1?t*.1:R;let g=c.yAxisLabel.yAxisLabelVisibility?zt(qe(c.yAxisLabel.yAxisDisplayUnits,c.yAxisLabel.yAxisNumberFormat,c.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString(),rt(c.yAxisLabel.yAxisLabelFontSize),c.yAxisLabel.yAxisLabelFontFamily,c.yAxisLabel.yAxisLabelRotation).width+10:0,B=c.chartTitle.chartTitleVisibility?c.chartTitle.dynamicTitleText.length!==0?zt(c.chartTitle.chartTitleHTML,void 0,void 0).height:zt(c.chartTitle.chartTitleText,16,tt).height:0;B=B>e*.1?e*.1:B;let U=c.legends.legendPosition,W=c.legends.legendVisibility,P=!1;switch(W||(U="None"),U){case je.none:l.top=B+5,l.bottom=_+A+5+L,l.right=15,l.left=R+g+5;break;case je.top:l.top=40+B,l.bottom=_+A+5+L,l.right=15,l.left=R+g+5;break;case je.right:l.right=f+35,l.top=B+5,l.bottom=_+A+5+L,l.left=R+g+5;break;case je.bottom:l.bottom=40+A+_+L,l.top=B+5,l.right=15,l.left=R+g+5;break;case je.left:l.left=f+R+g+33,l.top=B+5,l.bottom=_+A+5+L,l.right=15}c.xAxisLabel.xAxisPosition&&c.xAxisLabel.xAxisPosition=="1"&&(l.bottom=l.bottom-A,l.top=l.top+A);let D=c.chartPadding.paddingArrayLTRB;D&&(l.top+=D[1],l.bottom+=D[3],l.right+=D[2],l.left+=D[0]);let V=e-l.top-l.bottom,$=t-l.left-l.right;return{margins:l,yLabel:g,xLabel:A,yTitle:R,xTitle:_,chartTitleHeight:B,legendMargin:f,innerHeight:V,innerWidth:$}}catch(l){Ma(Ca,"marginCalculationForBubbleScatter",l)}}function Qi(t,e,r){try{let c=parseFloat(t.yAxisLabel.yAxisIntervalText),x=parseFloat(t.yAxisLabel.yAxisMaxText),n=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){n=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;x=u.length>0?parseFloat(u):r,x&&(r=x)}else x=r,n=e,c=void 0;let l=e?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString().length:0,p=x?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(x).toString().length:0,f=n?qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,L=l<s?r:e;if(n){let u=f<s?r:n;L=L<u?u:L}if(x){let u=p>l?x:e;L=L<u?u:L}return x&&n&&(L=p>f?x:n),{longestMeasure:L,customYaxisIntervalValue:c,customYaxisMaxValue:x,customYaxisMinValue:n}}catch(c){Ma(Ca,"customYscaleLabelFormatting",c)}}function Oi(t,e,r){try{let c=parseFloat(t.xAxisLabel.xAxisIntervalText),x=parseFloat(t.xAxisLabel.xAxisMaxText),n=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){n=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();x=u.length>0?parseFloat(u):r,x&&(r=x)}else x=r,n=e,c=void 0;let l=e?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,s=r?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r).toString().length:0,p=x?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString().length:0,f=n?qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,L=l<s?r:e;if(n){let u=f<s?r:n;L=L<u?u:L}if(x){let u=p>l?x:e;L=L<u?u:L}return x&&n&&(L=p>f?x:n),{longestDimension:L,customXaxisIntervalValue:c,customXaxisMaxValue:x,customXaxisMinValue:n}}catch(c){Ma(Ca,"customXscaleLabelFormatting",c)}}function el(t,e,r,c,x,n,l,s,p,f,L){try{let u=t.xAxisLabel.xAxisPosition,S=!0,_=r.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${c.left},${c.top+L+(t?.xAxisLabel?.xAxisPosition=="1"?0:x)})`:!t.plotArea.fitChart&&!1?`translate(${c.left},${n-l-5})`:`translate(${c.left},${c.top+L+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:x:s=="tornado"?x+5:p+5)})`).attr("class","xAxisTitle").attr("width",f).attr("height",l+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?_.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",t.xAxisTitle.xAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(t.xAxisTitle.xAxisTitleHTML?t.xAxisTitle.xAxisTitleHTML:t.xAxisTitle.xAxisTitleText):_.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("padding-top","5px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",t.xAxisTitle.xAxisTitleFontSize).style("font-family",t.xAxisTitle.xAxisTitleFontFamily).style("font-style",t.xAxisTitle.xAxisTitleFontStyle).attr("title",t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"").html(t.xAxisTitle.xAxisTitleText!=="~$~Dimension"?t.xAxisTitle.xAxisTitleText:"")}catch(u){Ma(Ca,"setXaxistitle",u)}}function tl(t,e,r,c,x,n,l,s){try{let p=r>0?t-r:t,f=x.append("foreignObject").attr("visibility",c?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${n.top+p}`).attr("y",n.left-l-s+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",p).attr("height",l+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?f.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",e.yAxisTitle.yAxisTitleText).style("white-space","pre").style("text-overflow","ellipsis").html(e.yAxisTitle.yAxisTitleHTML?e.yAxisTitle.yAxisTitleHTML:e.yAxisTitle.yAxisTitleText):f.append("xhtml:h3").style("white-space","pre").style("text-overflow","ellipsis").style("user-select","none").style("margin",0).style("padding",0).style("text-align","center").style("overflow","hidden").attr("class","xAxisTitle").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size","12px").style("font-size",e.yAxisTitle.yAxisTitleFontSize).style("font-family",e.yAxisTitle.yAxisTitleFontFamily).style("font-style",e.yAxisTitle.yAxisTitleFontStyle).attr("title",e.yAxisTitle.yAxisTitleText).html(e.yAxisTitle.yAxisTitleText),x}catch(p){Ma(Ca,"yAxistitle",p)}}function al(t,e,r,c,x,n){try{let l=parseFloat(c.yAxisLabel.yAxisIntervalText),s=[],p;if(l&&l!==0&&l!==void 0){let f=x||x==0?x:e,L=n||n==0?n:t;f<0?p=Math.floor((L-f)/l):p=Math.floor(L/l);let u=18;(n||n==0)&&(t=n);let S=x||x==0?x:e<0?Math.round(e):0;if(s.push(S),p>100){let b="Tick count cannot exceed more than 100.";f<0?l=(L-S)/100:l=L/100}if(p=p<100?p:100,p>u)for(let b=0;b<parseInt(p)&&(S+=l,parseFloat(S.toFixed(5))<=t);b++)s.push(S);else for(let b=0;b<u&&(S+=l,S<=t);b++)s.push(S)}else p=r/60;return{yAxisLabelArray:s,customTickValue:p}}catch(l){Ma(Ca,"responsiveYaxisLabel",l)}}function Li(t,e,r,c,x,n,l,s){try{let p=!0,f=parseFloat(c.xAxisLabel.xAxisIntervalText),L=[],u;if(f&&f!==0&&f!==void 0){let S=x||x==0?x:e,b=n||n==0?n:t;S<0?u=Math.floor((b-S)/f):u=Math.floor(b/f);let _=18;(n||n==0)&&(t=n);let A=x||x==0?x:e<0?Math.round(e):0;if(L.push(A),p=!1,u>100){let R="Tick count cannot exceed more than 100.";S<0?f=(b-A)/100:f=b/100}if(u=u<100?u:100,u>_)for(let R=0;R<parseInt(u)&&(A+=f,parseFloat(A.toFixed(5))<=t);R++)L.push(A);else for(let R=0;R<_&&(A+=f,A<=t);R++)L.push(A)}else{const S=qe(c.xAxisLabel.xAxisDisplayUnits,c.xAxisLabel.xAxisDateFormat,c.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n||t).toString();let b=Nt(S,c.xAxisLabel.xAxisLabelFontSize,c.xAxisLabel.xAxisLabelFontFamily,0);L=$i(x||e,n||t,s?l:r,b[0]),u=r/30}return{xAxisLabelArray:L,customTickValue:u,autoLabelFlag:p}}catch(p){Ma(Ca,"responsiveXaxisLabel",p)}}function il(t,e,r,c,x,n){try{let l=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-c},0)`).attr("height",r>0?n-r:n).attr("width",c).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Re.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const s=t.append("g").call(x);s.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),s.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Re.white?e.yAxisLabel.yAxisLabelColor:"none").style("user-select","none").style("font-size",e.yAxisLabel.yAxisLabelFontSize).style("font-family",e.yAxisLabel.yAxisLabelFontFamily).style("font-style",e.yAxisLabel.yAxisLabelFontStyle).style("font-style",l.includes(oe.italic)?oe.italic:"").style("text-decoration",l.includes(oe.underline)?oe.underline:"").style("font-weight",l.includes(oe.bold)?oe.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),s.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(l){Ma(Ca,"initYaxis",l)}}function ll(t,e,r,c,x,n,l,s,p){try{let f=e.xAxisLabel.xAxisLabelFontStyle,L=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${L==="0"?r>0?n-r:n:L==="1"?-c:p(0)})`).attr("height",c).attr("width",l).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==Re.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${L==="0"?n:L==="1"?0:p(0)})`).call(x);let b=L==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(c)).style("height","20px").attr("transform",(A,R)=>`rotate(${L==="1"?-u:u!=0?180-u:0}) translate (${u!=0?b+", -5":-c/2+" , "+(L==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",L==="1"?"":u!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",u!=0?"start":"center").style("user-select","none").style("margin",0).style("padding",0).style("overflow","hidden").style("font-family",e.xAxisLabel.xAxisLabelFontFamily).style("color",e.xAxisLabel.xAxisLabelColor).style("font-size",e.xAxisLabel.xAxisLabelFontSize+"px").style("font-style",f.includes(oe.italic)?oe.italic:"").style("text-decoration",f.includes(oe.underline)?oe.underline:"").style("font-weight",f.includes(oe.bold)?oe.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(A,R)=>qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)).html((A,R)=>qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)),S.selectAll("text").style("visibility",(e.xAxisLabel.xAxisLabelVisibility,"hidden")),S.selectAll("line").style("stroke",e.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",e.xAxisLabel.xAxisLabelVisibility||e.plotArea.gridLinesVertical?"visible":"hidden"),S.select(".domain").style("stroke",e.xAxisLabel.xAxisColor).attr("stroke-width",e.xAxisLabel.xAxisWidth?e.xAxisLabel.xAxisWidth:e.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges")}catch(f){Ma(Ca,"initXaxis",f)}}function rl(t,e,r,c,x,n,l,s,p,f,L){try{if(!r.annotation.annotationVisibility)return;const u=r.plotArea.annotationType??"1",S=[u==="1"?"connector":""],b=r.plotArea.connectorType?.toLowerCase()??"none",_=u==="5",A=r.plotArea.rotation??0,R=x===se.PieChart?1.06:1.1,g={1:"",2:v.curveLinear,3:v.curveStep},B=(Q,G)=>[[0,0],[Q/2,G/2],[Q,G]],U={solid:"unset",dotted:"2,2",dashed:"6,4"};let W=t.annotation(),P=JSON.parse(JSON.stringify(r.plotArea.dataLabelsCoordinates||[]));P=P.map(Q=>({dx:Q.dx??0,dy:Q.dy??0,ratioDistance:Q.ratioDistance,ratioAngle:Q.ratioAngle,connectorPoints:Q.connectorPoints||Q.connector?.points||[],radius:Q.radius??p,data:Q.data,width:n,height:l}));const D=e.reduce((Q,G)=>Q+(G?.data?.data?.[0]?.value??0),0),V=D===0?1:D,$=(Q,G)=>{const M=Q.data.data[0].value,h=(Q.x0+Q.x1)/2,k=Q.x1-Q.x0;return{note:{title:r.plotArea.dataLabelName?Q.data.legend:"",label:r.plotArea.dataLabelValue&&M!==0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(M/V)*100).toFixed(rt(r.plotArea.dataLabelDecimalPrecision))+"%":qe(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(M):"",align:"middle",wrap:1e3},data:{x:{legend:Q.data.legend},y:{value:M},midAngle:h,isVisible:!0,hoverId:Q?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:Q.data.legend,dx:0,dy:0,connector:{end:b,curve:g[r.plotArea.connectorCurve],points:_?B(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:nr(t,u),color:r.plotArea.connectorColor??"#ccc",width:n,height:l,index:G}};let Z=e.filter(Q=>Q.x1-Q.x0>1e-4).map($);const ce=Q=>(Q.data.y?.value??0)!==0;Z=Z.filter(ce),Z=Yt(Z,r,Q=>Q.data.y.value);let ne=new Map(P.map(Q=>[Q.data?.x?.legend,Q])),ae=[];Z.forEach(Q=>{const G=Q.data.x.legend,M=ne.get(G);if(M){if(M.ratioDistance!=null&&M.ratioAngle!=null){const h=M.ratioDistance*p;Q.dx=Math.cos(M.ratioAngle)*h,Q.dy=Math.sin(M.ratioAngle)*h}else{const h=p/(M.radius||p);Q.dx=M.dx*h,Q.dy=M.dy*h}Q.data.isVisible=M.data?.isVisible??!0,M.connectorPoints?.length>=(_?3:2)?Q.connector.points=M.connectorPoints:Q.connector.points=_?B(Q.dx,Q.dy):[[0,0],[0,0]]}ae.push(Q)}),W.editMode(r.plotArea.annotationDraggable&&f).accessors({x(Q){return Math.cos(Q.midAngle-Math.PI/2)*(p-p*.35)},y(Q){return Math.sin(Q.midAngle-Math.PI/2)*(p-p*.35)}}).on("dragend",function(Q){ae.forEach(M=>{if(M.data.x.legend===Q.data.x.legend){const h=Q._dx,k=Q._dy,o=Math.sqrt(h*h+k*k),d=Math.atan2(k,h);M.dx=h,M.dy=k,M.ratioDistance=o/p,M.ratioAngle=d,M.width=n,M.height=l,M.connectorPoints=Q.connector?.points||[]}});const G=ae.map(M=>({data:{x:M.data.x,isVisible:M.data.isVisible??!0},dx:M.dx,dy:M.dy,ratioDistance:M.ratioDistance,ratioAngle:M.ratioAngle,connectorPoints:M.connectorPoints||[],width:n,height:l,radius:p}));L&&L(G)}).annotations(ae);const ue=s.append("g").attr("class","annotation-group parentGroup").attr("transform",c).call(W),ge=r.plotArea.dataLabelNameFontStyle??[];ue.selectAll(".annotation-note-title").style("font-family",r.plotArea.dataLabelNameFontFamily).style("font-size",`${r.plotArea.dataLabelNameFontSize}px`).style("font-style",ge.includes("Italic")?"italic":"").style("text-decoration",ge.includes("Underline")?"underline":"").style("font-weight",ge.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelNameColor??"#000");const be=r.plotArea.dataLabelValueFontStyle??[];if(ue.selectAll(".annotation-note-label").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("font-style",be.includes("Italic")?"italic":"").style("text-decoration",be.includes("Underline")?"underline":"").style("font-weight",be.includes("Bold")?"bold":"").style("fill",r.plotArea.dataLabelValueColor??"#000"),r.plotArea.plotAreaAbsoluteValue&&ue.selectAll(".annotation-note-label").each(function(Q){const G=v.select(this),M=v.format(".2s")(Math.abs(Q.data.y.value));G.append("tspan").attr("x",G.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",r.plotArea.dataLabelValueFontFamily).style("font-size",`${r.plotArea.dataLabelValueFontSize}px`).style("fill",r.plotArea.dataLabelValueColor??"#000").text(M)}),b==="diamond"){const Q=r.plotArea.connectorColor??"#ccc",G=5;ue.selectAll(".annotation-connector").each(function(){v.select(this).select("path.connector").empty()||v.select(this).append("polygon").attr("class","connector-end connector-diamond").attr("points",`0,${-G} ${G},0 0,${G} ${-G},0`).style("fill",Q).style("stroke",Q)})}if(ue.selectAll("rect,.annotation-subject").remove(),r.animation?.animationEnabled){const Q=r.animation.animationDuration,G=et[r.animation.animationEffect],M=ue.selectAll(".annotation-note-label");M.interrupt().style("opacity",0),setTimeout(()=>{M.transition().delay((h,k)=>k*30).duration(Q).ease(G).style("opacity",1)},50)}const pe=r.plotArea.connectorColor??"#ccc";ue.selectAll(".connector").style("stroke",pe).attr("hoverId",Q=>Q.data.hoverId).attr("stroke-dasharray",U[r.plotArea.connectorStyle?.toLowerCase()]),ue.selectAll(".connector-end").attr("hoverId",Q=>Q.data.hoverId).style("fill",pe).style("stroke",pe),ue.selectAll(".annotation-note-title").attr("hoverId",Q=>Q.data.hoverId),ue.selectAll(".annotation-note-label").attr("hoverId",Q=>Q.data.hoverId).filter(Q=>!Q.data.isVisible).style("display","none"),ue.selectAll(".annotation-note-label").filter(Q=>r.plotArea.hideInsignificantValue&&Q.data.x1-Q.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const nr=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(r){throw r}},nl=(t,e,r,c,x,n,l,s,p,f)=>{try{if(r.plotArea.numberOfBubbles){let L=e=="Bottom"?c-55:c-25;t.append("foreignObject").attr("transform",`translate(${n.left},${L})`).attr("width",x).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",Re.black).style("font-size","12px ").style("text-overflow","ellipsis").html((r.plotArea.totalAlias?r.plotArea.totalAliasText:"Total count : ")+f)}}catch(L){Ma(Ca,"setnumberOfBubbles",L)}};function Ma(t,e,r){console.error(`[${t}] [${e}]`,r)}const sr=({isDateType:t,formatOptions:e,data:r})=>{const c=crypto.randomUUID(),x=0,n=se.ColumnHistogramChart,l=Me.useRef(),s=r.ChartData,p=r.DimensionList,f=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,R,g,B,U,W,P,D,V,$,Z,ce,ne,ae,ue,ge,be=[],pe=[],Q,G,M,h,k,o,d,i,y,T,a,m,N,re=[],K=0;const me=2;let Le={dimensionList:p,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{ze()}catch(we){Ae("Columnchart","createColumnChart",we)}},[e]);const ze=()=>{({formatOptions:e,svg:k,width:Q,height:G}=St(l,e)),Se(),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:ne}=Et(e,Le.yMinLeft,Le.yMaxLeft,Le.yMinRight,Le.yMaxRight),{margin:R,yLabel:g,xLabel:B,yTitle:U,xTitle:W,dimensionHeightWidthArray:P,chartTitleHeight:D,secondaryAxisTitleWidth:V,legendMargin:$,secondaryYLabel:Z}=Ct(Q,G,ce,ne,Le.yMaxLeft,e,Le.legendList,Le.dimensionList,Le.yMaxRight,L,u,t),Ye(R),{dataTable:M,dataTableHeight:h}=aa(e,g,U,s,Le.dimensionList),Mt(k,Q,G,e),o=Ft(k,R),vt(o,e,h,ae,ue,n),ie(),ye(),fe(),Jt(o,e,h,g,a,ue),Pe(s,G,k,R,ae),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,k,o,M,x,d,i,y,void 0,void 0,h,n,e,g,U,Le.dimensionList,ae,T,Le.formattedDimensionListMap,c,R,ue)),wt(e,f,k,R,B,G,W,Le.chartType,g,ae,ue),Dt(ue,e,h,f,k,R,U,g),Ht(k,L,R,e,h,ue,ae,Z,V),Vt(k,e,Q,D),Pt(G,k,P,D,Q,$,e,s,c,h,R,ct.rectangle)},Se=()=>{const we=[],Ce=[];let ve=[],F=-1/0,le=1/0;s.forEach(O=>{Ce.push(O.legend),O.data.forEach(X=>{we.push(X),F=Math.max(F,X.value),le=Math.min(le,X.value)})}),Le.chartData=we,Le.legendList=Ce,Le.yMaxLeft=F,Le.yMinLeft=le>0?0:le,re=JSON.parse(JSON.stringify(s)),re.forEach(O=>O.data.forEach(X=>ve.push(X.value)));let he=S||S==0?S:0,te=b||b==0?b:re[0]?.data?.length;if(Le.yMaxLeft=parseFloat((he+"").length>(te+"").length?he+"":te+""),Le.xMax=v.max(ve),Le.xMin=v.min(ve),Le.xMin===Le.xMax){const O=Le.xMax===0?1:Math.abs(Le.xMax*.1);Le.xMin-=O,Le.xMax+=O}},ie=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=ae/50;break;case"Number of Bins":De(!1);break;case"Bin Width":De(!0)}},De=we=>{re.forEach(le=>le.data.sort(function(he,te){return he.value-te.value}));let Ce=Le.xMax-Le.xMin,ve;we?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ve=Ce/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ve=Ce/parseFloat(e.bins.binsCalculationValue));let F=Le.xMin;if(we)for(be=[F];F<Le.xMax;)F+=ve,be.push(F);else for(be=[F];Math.round(F)<Math.round(Le.xMax);)F+=ve,be.push(Math.round(F))},ye=()=>{i=v.scaleLinear().domain([Le.xMin,Le.xMax]).range([0,ae]);const we=be.length>0?be:i.ticks(ge);let Ce=v.bin().value(F=>F).domain(i.domain()).thresholds(we);re.forEach(F=>{let le=Ce(F.data.map(he=>he.value));pe.push(le)}),re.forEach((F,le)=>pe[le].forEach(he=>{he.name=F.properties.legend,he.color=F.properties.color,he.opacity=F.properties.opacity}));let ve=[];pe.forEach(F=>F.forEach(le=>ve.push(le.length))),Le.yMaxLeft=v.max(ve),Le.yMinLeft=v.min(ve),d=v.scaleLinear().range([ue,0]).domain([S||S==0?S:0,b||b==0?b:Le.yMaxLeft+.2*Le.yMaxLeft])},fe=()=>{$e();{let we=dt(Le.yMaxLeft,Le.yMinLeft,ue,e,Le,S,b,!1,ae);a=v.axisLeft(d).tickFormat(Ce=>Ze(Ce,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,ae)).tickValues(we.autoLabelFlag?void 0:we.yAxisLabelArray).ticks(we.customTickValue).tickPadding(8).tickSizeOuter(0)}},$e=()=>{let we=parseInt(e.xAxisLabel.xAxisPosition);Li(Le.xMax,Le.xMin,ae,e,_,A,ue,!1).xAxisLabelArray.shift(),m=(we==1?v.axisTop(i):v.axisBottom(i)).tickFormat(ve=>Ze(ve,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(sa(e,ue,h)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?m.ticks(ge):m.tickValues(be).ticks(ae/50)},Ue=we=>{const Ce=e.animation.animationEnabled,ve=o.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+c+" .rect").data(pe).enter().append("g").selectAll("rect").data(le=>le).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",1).attr("transform",function(le){return"translate("+i(le.x0)+","+ue+")"}).attr("width",function(le){return i(le.x1)-i(le.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(le.x1)-i(le.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",le=>le.color!==Re.white?le.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(le,he)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:`${he.x0}-${he.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():he.properties?.currentMeasure?he.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:Ze(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(he.length/re[0].data.length):he.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,le)}).on("mouseout",ot);(Ce?ve.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ve).attr("transform",function(le){return"translate("+i(le.x0)+","+(d(le.length)>0?d(le.length):0)+")"}).attr("height",function(le){return ue-d(le.length)}),o.selectAll(".parentGroup").raise()},Ye=we=>{ae=Q-we.left-we.right,ue=G-we.bottom-we.top},Pe=(we,Ce,ve,F,le)=>{if(!e.plotArea.fitChart){const he=we[0].data.length-me,te=Ce-20;N=Le.dimensionList.slice(K,K+me),re=JSON.parse(JSON.stringify(we)),re.forEach((H,E)=>re[E].data=H.data.filter(Y=>N.includes(Y.dimension))),ve.append("rect").attr("x",F.left).attr("y",te).attr("width",le).attr("height",8).attr("fill","#ddd").attr("rx",4);const O=le*me/Le.dimensionList.length,X=ve.append("rect").attr("x",F.left).attr("y",te).attr("width",O).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",H=>{let E=Math.min(Math.max(H.x,F.left),F.left+le-O);X.attr("x",E),K=Math.round((E-F.left)/(le-O)*he),N=Le.dimensionList.slice(K,K+me),re=JSON.parse(JSON.stringify(we)),re.forEach((Y,ee)=>re[ee].data=Y.data.filter(z=>N.includes(z.dimension))),$e(),Ee()}));ve.on("wheel",H=>{H.preventDefault();const E=Math.abs(H.deltaX)>Math.abs(H.deltaY)?H.deltaX:H.deltaY;K+=E>0?1:-1,K=Math.max(0,Math.min(K,he));const Y=F.left+(le-O)*K/he;X.attr("x",Y),re=JSON.parse(JSON.stringify(we)),re.forEach((ee,z)=>re[z].data=ee.data.filter(I=>N.includes(I.dimension))),$e(),Ee()})}Ee()},Ee=()=>{Ot(o,Le,B,e,h,d,m,P,G,x,t,ae,ue,N,i),Ue()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:c,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID(),L=0,u=se.LineChart,S=Me.useRef(),b=Me.useRef(s);b.current=s;const _=Me.useRef(p);_.current=p;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled;let B=!1;const U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h=!1,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye,Pe,Ee=[],we=0,Ce=0,ve=0,F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(I){Ae("Linechart","createLineChart",I)}},[e]);const le=()=>{({formatOptions:e,svg:a,width:d,height:i}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:G,maxNumberForSecondaryAxis:M,customYaxisMaxValue:P,secondaryCustomYaxisMaxValue:V}=Et(e,F.yMinLeft,F.yMaxLeft,F.yMinRight,F.yMaxRight),{margin:$,yLabel:Z,xLabel:ce,yTitle:ne,xTitle:ae,dimensionHeightWidthArray:ue,chartTitleHeight:ge,secondaryAxisTitleWidth:be,legendMargin:pe,secondaryYLabel:Q,visibleBars:Ce,columnWidth:ve,scrollbarVisible:h}=Ct(d,i,G,M,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,U,t,g,F),ee($),{dataTable:y,dataTableHeight:T}=aa(e,Z,ne,A,F.dimensionList,r),g&&(y=[],T=0),Mt(a,d,i,e),m=Ft(a,$),vt(m,e,T,k,o,u,f),te(),H(),g?(ra(e,m,Z,o,k,$e),B&&pi(e,m,Q,Ue,k)):(Jt(m,e,T,Z,ze,o),B&&hi(m,e,T,Q,ie,o,k)),wt(e,g,a,$,ce,i,ae,F.chartType,Z,k,o),Dt(o,e,T,g,a,$,ne,Z,k),B&&Ht(a,B,$,e,T,o,k,Q,be,g),Vt(a,e,d,ge),Pt(i,a,ue,ge,d,pe,e,A,f,T,$,ct.line,u,n),Gt(A,i,d,a,$,k,h,Ce,F,we,!1,O,g)},he=()=>{const I=[],w=[];let C=[],q=-1/0,J=1/0,j=-1/0,Te=1/0;e.plotArea.hideZeroValues&&(F.hideZeroValues=!0),A.forEach(xe=>{w.push(xe.properties.alias?xe.properties.alias:xe.legend),xe.data.forEach(de=>{I.push(de),xe.properties.axis==="Secondary"?(B=!0,j=Math.max(j,de.value),Te=Math.min(Te,de.value)):(q=Math.max(q,de.value),J=Math.min(J,de.value))})}),F.chartData=I,F.legendList=w,F.yMaxLeft=q,F.yMinLeft=J,F.yMaxRight=j,F.yMinRight=Te,C=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(xe=>xe):F.dimensionList,F.dimensionList.forEach((xe,de)=>{F.formattedDimensionListMap.set(xe,C[de])}),Ee=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Pe=F.dimensionList:Pe=F.dimensionList.slice(we,we+Ce)},te=()=>{let I=dt(P||F.yMaxLeft,F.yMinLeft,o,e,F,W,P,g,k).yAxisLabelArray;F.yMaxLeft=I[I.length-1],F.yMinLeft=I[0];const w=g?[0,T>0?k-T:k]:[T>0?o-T:o,0];{const C=v.scaleLinear().domain([F.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:F.yMinLeft*.9:F.yMinLeft<0?F.yMinLeft*1.1:F.yMinLeft*.9,F.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:F.yMaxLeft*1.1]).range(w);g?ye=C:N=C}if(B){const C=v.scaleLinear().domain([F.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:F.yMinRight*1.1,F.yMaxRight<=0?V||0:V||F.yMaxRight*1.1]).range(w);g?fe=C:re=C}if(me=g?[o,0]:[0,k],!g&&e.seriesLabel.seriesLabelVisibility){let C=la(k,N,e,Ee,re,B,o,!1);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Le=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?me=[0,k-C.heightWidth[0]]:me=[C.heightWidth[0],k]}},O=(I,w,C)=>{Ee=w,Pe=I,Ce=C,z()},X=()=>{const I=v.scalePoint().domain(Pe).range(me).padding(.5);g?De=I:K=I},H=()=>{{let I=dt(P||F.yMaxLeft,F.yMinLeft,o,e,F,W,P,g,k);g?$e=v.axisBottom(ye).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-o:0).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/50).tickPadding(8).tickSizeOuter(0):ze=v.axisLeft(N).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,k,Le)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue).tickPadding(8).tickSizeOuter(0)}if(B){let I=dt(V||F.yMaxRight,D||F.yMinRight,o,e,F,D,V);g?Ue=v.axisTop(fe).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/50).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-o:0).tickPadding(8).tickSizeOuter(0):ie=v.axisRight(re).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue).tickSize(Rt(e,k,Le)).tickPadding(8).tickSizeOuter(0)}},E=()=>{g?Ye=v.axisLeft(De).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*k*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Pe,o)):Se=v.axisBottom(K).tickSize(sa(e,o,T,!0)).tickSizeOuter(0).tickValues(bt(Pe,k))},Y=I=>{const w=[...I].reverse();w.forEach(de=>{de.data.forEach(Fe=>{Fe.hideZero=de.properties.hideZeroValues,Fe.axis=de.properties.axis})});const C=g?v.line().y(de=>{const Fe=De(de.dimension);return Fe??0}).x(de=>de.axis===Qe.primary?ye(de.value):fe(de.value)).defined(de=>de.hideZero||F.hideZeroValues?!!de.value:!0).curve(mt(e)):v.line().x(de=>{const Fe=K(de.dimension);return Fe??0}).y(de=>de.axis===Qe.primary?N(de.value):re(de.value)).defined(de=>de.hideZero||F.hideZeroValues?!!de.value:!0).curve(mt(e)),q=e.animation.animationEnabled,J=de=>q?de.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):de;let j=m.selectAll(".parentGroup").data([w]);j=j.enter().append("g").attr("class","lines parentGroup").merge(j);let Te=j.selectAll(".line-group").data(de=>de),xe=Te.enter().append("g").attr("class","line-group");xe.append("path").attr("class","visibleLine").attr("fill","none"),xe.merge(Te).each(function(de){const Ve=v.select(this).selectAll("path.visibleLine").data([de]).join("path").attr("class","visibleLine").attr("d",ke=>C(ke.data)).attr("stroke",ke=>ke.properties.color!==Re.white?ke.properties.color:"none").attr("stroke-dasharray",ke=>{const Be=parseInt(ke.properties.lineWidth);switch(ke.properties.lineStyle){case pt.dotted:return`0,${Be+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",ke=>ke.properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",ke=>ke.properties.lineStyle!=="None"?ke.properties.lineWidth:0).attr("hoverId",(de.properties.alias||de.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${f}-clip)`).attr("d",ke=>C(ke.data)).attr(lt.SeriesId,ke=>ke.properties.legendUniqueId).attr(lt.DimValue,ke=>ke.properties.alias||ke.properties.name||"").on("click",Tt(_,b,(ke,Be)=>({seriesId:Be.properties.legendUniqueId,dimValue:Be.properties.alias||Be.properties.name||"",legendUniqueId:Be.properties.legendUniqueId,seriesDisplayName:Be.properties.alias||Be.properties.name||""})));q&&Ve.each(function(){const ke=v.select(this),Be=this.getTotalLength();ke.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",Be),J(ke).attr("stroke-dashoffset",0)})}),Te.exit().remove(),Da(j,w,"None",g?De:K,g?ye:N,g?fe:re,null,e,F,V,D,W,P,!1,l,g),m.selectAll(".parentGroup").raise()},ee=I=>{k=d-I.left-I.right,o=i-I.bottom-I.top},z=()=>{if(X(),E(),g?na(e,m,ce,o,k,Ye,Ue,ye,F.yMaxLeft,Pe,u,t,d,ue,ve,De):Ot(m,F,ce,e,T,N,Se,ue,i,k/Pe.length,t,k,o,Pe,K),Y(Ee),Ra(A,g?De:K,g?ye:N,g?fe:re,$,xt,[],[],e,u,i,d,k,Pe,o,f,a,x,void 0,void 0,c,!1,g),!g){let I=la(k,N,e,Ee,re,B,o,!1).labelArray;Ga(e,m,I),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,a,m,y,L,N,K,void 0,void 0,void 0,T,u,e,Z,ne,F.dimensionList,k,me,F.formattedDimensionListMap,f,$,o))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.StackLineChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=r.DimensionList,R=(Lt(r.ChartData,r.DimensionList)||[]).reverse(),g=!!e.swapAxis?.swapAxisEnabled,B=new Map,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye=[],Pe=0,Ee=2,we=!1,Ce=0,ve=[];const F=!1;let le={dimensionList:A,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{he()}catch(C){Ae("StackLinechart","createStackLineChart",C)}},[e]);const he=()=>{({formatOptions:e,svg:T,width:o,height:d}=St(S,e)),te(),{formatOptions:e}=ta(e,R,r.DataTableData??[]),{maxNumberForPrimaryAxis:G,maxNumberForSecondaryAxis:M}=Et(e,le.yMinLeft,le.yMaxLeft,le.yMinRight,le.yMaxRight),{margin:$,yLabel:Z,xLabel:ce,yTitle:ne,xTitle:ae,dimensionHeightWidthArray:ue,chartTitleHeight:ge,secondaryAxisTitleWidth:be,legendMargin:pe,secondaryYLabel:Q,visibleBars:Ee,columnWidth:Ce,scrollbarVisible:we}=Ct(o,d,G,M,le.yMaxLeft,e,le.legendList,le.dimensionList,le.yMaxRight,U,F,t,g,le),ee($),{dataTable:i,dataTableHeight:y}=aa(e,Z,ne,R,le.dimensionList,r),g&&(i=[],y=0),Mt(T,o,d,e),a=Ft(T,$),vt(a,e,y,h,k,u,f),O(),H(),g?ra(e,a,Z,k,h,ye):Jt(a,e,y,Z,Le,k),wt(e,g,T,$,ce,d,ae,le.chartType,Z,h,k),Dt(k,e,y,g,T,$,ne,Z,h),Ht(T,U,$,e,y,k,h,Q,be,g),Vt(T,e,o,ge),Pt(d,T,ue,ge,o,pe,e,[...R].reverse(),f,y,$,ct.line,u,n),Gt(R,d,o,T,$,h,we,Ee,le,Pe,!1,w,g),ti(B,g?Se:re,g?ie:m,$,xt,[],e,u,d,o,T,c,g)},te=()=>{const C=[],q=[];e.plotArea.hideZeroValues&&(le.hideZeroValues=!0),R.forEach((Fe,Ve)=>{const ke=`${Ve}~$~${Fe.properties.alias?Fe.properties.alias:Fe.legend}`;Fe.properties.legend=ke,q.push(ke);for(const Be of Fe.data)C.push(Be)}),le.chartData=C,le.legendList=q,Ye=JSON.parse(JSON.stringify(R));let J=At(le.dimensionList,R,F);e.plotArea.fitChart?Ue=le.dimensionList:(Ue=le.dimensionList.slice(Pe,Pe+Ee),Ye.forEach((Fe,Ve)=>Ye[Ve].data=Fe.data.filter(ke=>Ue.includes(ke.dimension))));const j=v.stack().keys(le.legendList).offset(v.stackOffsetDiverging)(J);I();let Te=1/0,xe=-1/0;for(const Fe of j)for(const[Ve,ke]of Fe)Te=Math.min(Te,Ve),xe=Math.max(xe,ke);le.yMinLeft=Te>0?0:Te,le.yMaxLeft=xe;let de=t?ft(e.xAxisLabel.xAxisNumberFormat,le.dimensionList).map(Fe=>Fe):le.dimensionList;le.dimensionList.forEach((Fe,Ve)=>{le.formattedDimensionListMap.set(Fe,de[Ve])})},O=()=>{let C=dt(P||le.yMaxLeft,le.yMinLeft,k,e,le,W,P,g,h).yAxisLabelArray;le.yMaxLeft=C[C.length-1],le.yMinLeft=C[0];const q=g?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const J=v.scaleLinear().domain([le.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:le.yMinLeft<0?le.yMinLeft*1.1:le.yMinLeft*.9,le.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:le.yMaxLeft*1.1]).range(q);g?ie=J:m=J}if(K=g?[k,0]:[0,h],!g&&e.seriesLabel.seriesLabelVisibility){let J=la(h,m,e,Ye,void 0,U,k,!0);J.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=J.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,h-J.heightWidth[0]]:K=[J.heightWidth[0],h]}X()},X=()=>{const C=v.scalePoint().domain(Ue).range(K).padding(.5);g?Se=C:re=C},H=()=>{E();{let C=dt(P||le.yMaxLeft,le.yMinLeft,k,e,le,W,P,g,h);g?ye=v.axisBottom(ie).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Le=v.axisLeft(m).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,h,me)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},E=()=>{g?$e=v.axisLeft(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Ue,k)):ze=v.axisBottom(re).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(bt(Ue,h))},Y=C=>{C.forEach(xe=>{xe.data.forEach(de=>{de.hideZero=xe.properties.hideZeroValues,de.axis=xe.properties.axis})});const q=g?v.line().y(xe=>{const de=Se(xe.data.dimension);return de??0}).x(xe=>xe[1]>0?ie(xe[1]):ie(xe[0])).defined(xe=>{const de=xe;return de.hideZero||le.hideZeroValues?de.data[de.key]:!0}).curve(mt(e)):v.line().x(xe=>{const de=re(xe.data.dimension);return de??0}).y(xe=>xe[1]>0?m(xe[1]):m(xe[0])).defined(xe=>{const de=xe;return de.hideZero||le.hideZeroValues?de.data[de.key]:!0}).curve(mt(e));let J=a.selectAll(".parentGroup").data([ve]);J=J.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(J);let j=J.selectAll(".line-group").data(xe=>xe);const Te=j.enter().append("g").attr("class",xe=>"line-group "+xe.key.replace(/ /g,"-"));Te.append("path").attr("class","line").attr("fill","none"),Te.merge(j).each(function(xe,de){const Fe=v.select(this),Ve=Fe.selectAll("path.visibleLine").data([xe]).join("path").attr("class","visibleLine").attr("hoverId",at=>(R[de]?.properties?.alias||R[de]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",q(xe)).attr("stroke",xe.color!==Re.white?xe.color:"none").attr("stroke-dasharray",at=>{const it=parseInt(R[de].properties.lineWidth.toString());switch(R[de].properties.lineStyle){case pt.dotted:return`0,${it+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",R[de].properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",R[de].properties.lineStyle!==pt.none?R[de].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,R[de].properties.legendUniqueId).attr(lt.DimValue,R[de].properties.alias||R[de].properties.name||"").on("click",Tt(_,b,()=>({seriesId:R[de].properties.legendUniqueId,dimValue:R[de].properties.alias||R[de].properties.name||"",legendUniqueId:R[de].properties.legendUniqueId,seriesDisplayName:R[de].properties.alias||R[de].properties.name||""}))),ke=e.animation.animationEnabled,Be=Ve.node().getTotalLength();ke?Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",Be).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",0),Fe.selectAll("path.hoverLine").data([xe]).join("path").attr("class","hoverLine").attr("d",q(xe)).attr("stroke",Re.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+gi(R[de].properties.alias||R[de].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),j.exit().remove(),Da(J,C,u,g?Se:re,g?ie:m,g?De:N,null,e,le,V,D,W,P,!1,p,g)},ee=C=>{h=o-C.left-C.right,k=d-C.bottom-C.top},z=()=>{if(X(),E(),g?na(e,a,ce,k,h,$e,fe,ie,le.yMaxLeft,Ue,u,t,o,ue,Ce,Se):Ot(a,le,ce,e,y,m,ze,ue,d,L,t,h,k,Ue,re),I(),Y(Ye),za(ve,g?Se:re,g?ie:m,g?De:N,$,xt,[],[],e,u,d,o,h,Ue,k,f,T,x,y,c,g),!g){let C=la(h,m,e,Ye,void 0,U,k,!0).labelArray;Ga(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,T,a,i,L,m,re,void 0,void 0,void 0,y,se.LineChart,e,Z,ne,le.dimensionList,h,K,le.formattedDimensionListMap,f,$,k))}},I=()=>{let C=At(Ue,Ye,F);ve=v.stack().keys(le.legendList).offset(v.stackOffsetDiverging)(C),Ye.forEach((J,j)=>J.data.forEach((Te,xe)=>{Te[0]=ve[j][xe][0],Te[1]=ve[j][xe][1]}));let q=e.annotation.annotationSetLabelColor;ve.forEach((J,j)=>J.forEach(Te=>{Te.key=J.key,J.color=JSON.parse(JSON.stringify(R[j].properties.color)),J.individualAnnotationVisibility=JSON.parse(JSON.stringify(R[j].properties.individualAnnotationVisibility)),Te.data.labelPosition=R[j].properties.dataLabelPosition,Te.data.labelColor=q=="2"?JSON.parse(JSON.stringify(R[j].properties.color)):R[j].properties.labelColor,Te.hideZero=JSON.parse(JSON.stringify(R[j].properties.hideZeroValues)),Te.properties=R[j].properties}))},w=(C,q,J)=>{Ye=q,Ue=C,Ee=J,ai(r,B,Ue),z()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.NormalizedStackLineChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse()||[],R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue=[],Ye=0,Pe,Ee=0,we=!1,Ce=[];const ve=!0;let F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(C){Ae("NormalizedLinechart","createNormalizedLinechart",C)}},[e]);const le=()=>{({formatOptions:e,svg:y,width:k,height:o}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:Pe,columnWidth:Ee,scrollbarVisible:we}=Ct(k,o,Q,G,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,ve,t,g,F),ee(V),{dataTable:d,dataTableHeight:i}=aa(e,$,ce,A,F.dimensionList,r),g&&(d=[],i=0),Mt(y,k,o,e),T=Ft(y,V),vt(T,e,i,M,h,u,f),te(),H(),g?ra(e,T,$,h,M,De):Jt(T,e,i,$,me,h),wt(e,g,y,V,Z,o,ne,F.chartType,$,M,h),Dt(h,e,i,g,y,V,ce,$,M),Ht(y,B,V,e,i,h,M,pe,ge,g),Vt(y,e,k,ue),Pt(o,y,ae,ue,k,be,e,[...A].reverse(),f,i,V,ct.line,u,n),Gt(A,o,k,y,V,M,we,Pe,F,Ye,!1,z,g)},he=()=>{const C=[],q=[];e.plotArea.hideZeroValues&&(F.hideZeroValues=!0,A.forEach(de=>{de.data=de.data.filter(Fe=>Fe.value!==0)})),A.forEach((de,Fe)=>{const Ve=`${Fe}~$~${de.properties.legend}`;de.properties.legend=Ve,q.push(Ve);for(const ke of de.data)C.push(ke)}),F.chartData=C,F.legendList=q,Ue=JSON.parse(JSON.stringify(A)),$e=F.dimensionList;const J=At(F.dimensionList,A,ve),j=v.stack().keys(F.legendList).offset(v.stackOffsetDiverging)(J);w();let Te=1/0;for(const de of j)for(const[Fe]of de)Te=Math.min(Te,Fe);F.yMinLeft=Te>0?0:Te,F.yMaxLeft=1;const xe=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(de=>de):F.dimensionList;F.formattedDimensionListMap=new Map(F.dimensionList.map((de,Fe)=>[de,xe[Fe]]))},te=()=>{const C=g?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const q=v.scaleLinear().domain([F.yMinLeft<0?-1:0,1]).range(C);g?Se=q:a=q}if(re=g?[h,0]:[0,M],!g&&e.seriesLabel.seriesLabelVisibility){X(Ce,Ue);let q=la(M,a,e,Ue,void 0,B,h,!0);q.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(K=q.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?re=[0,M-q.heightWidth[0]]:re=[q.heightWidth[0],M]}},O=()=>{const C=v.scalePoint().domain($e).range(re).padding(.5);g?ze=C:N=C};function X(C,q){C.forEach((J,j)=>J.forEach((Te,xe)=>{q[j]&&q[j].data[xe]&&(q[j].data[xe][0]=Te[0]=Te.data.total===0?0:Te[0]/Te.data.total,q[j].data[xe][1]=Te[1]=Te.data.total===0?0:Te[1]/Te.data.total)}))}const H=()=>{g?De=v.axisBottom(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).ticks(i>0?(M-i)/80:M/80,"%").tickPadding(8).tickSizeOuter(0):me=v.axisLeft(a).tickSize(Rt(e,M,K)).ticks(i>0?(h-i)/80:h/80,"%").tickPadding(8).tickSizeOuter(0)},E=()=>{g?fe=v.axisLeft(ze).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt($e,h)):Le=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(bt($e,M))},Y=C=>{X(Ce,Ue),C.forEach(xe=>{xe.data.forEach(de=>{de.hideZero=xe.properties.hideZeroValues,de.axis=xe.properties.axis})});const q=g?v.line().y(xe=>{const de=ze(xe.data.dimension);return de??0}).x(xe=>xe[1]>0?Se(xe[1]):Se(xe[0])).curve(mt(e)):v.line().x(xe=>N(xe.data.dimension)?N(xe.data.dimension):null).y(xe=>xe[1]>0?a(xe[1]):a(xe[0])).curve(mt(e));let J=T.selectAll(".parentGroup").data([Ce]);J=J.enter().append("g").attr("class","lines parentGroup").merge(J);let j=J.selectAll(".line-group").data(xe=>xe),Te=j.enter().append("g").attr("class",xe=>"line-group "+xe.key.replace(/ /g,"-"));Te.attr("hoverId",xe=>(C[xe.index]?.properties?.alias||C[xe.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),Te.merge(j).each(function(xe,de){const Fe=v.select(this),Ve=Fe.selectAll("path.visibleLine").data([xe]).join("path").attr("class","visibleLine").attr("d",q(xe)).attr("stroke",xe.color!==Re.white?xe.color:"none").attr("stroke-dasharray",at=>{const it=parseInt(A[de].properties.lineWidth.toString());switch(A[de].properties.lineStyle){case pt.dotted:return`0,${it+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",A[de].properties.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",A[de].properties.lineStyle!==pt.none?A[de].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,A[de].properties.legendUniqueId).attr(lt.DimValue,A[de].properties.alias||A[de].properties.name||"").on("click",Tt(_,b,()=>({seriesId:A[de].properties.legendUniqueId,dimValue:A[de].properties.alias||A[de].properties.name||"",legendUniqueId:A[de].properties.legendUniqueId,seriesDisplayName:A[de].properties.alias||A[de].properties.name||""}))),ke=e.animation.animationEnabled,Be=Ve.node().getTotalLength();ke?Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",Be).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):Ve.attr("stroke-dasharray",Be+" "+Be).attr("stroke-dashoffset",0),Fe.selectAll("path.hoverLine").data([xe]).join("path").attr("class","hoverLine").attr("d",q(xe)).attr("stroke",Re.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(at,it){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+gi(C[it.index]?.properties?.alias||C[it.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(at,it){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+gi(C[it.index]?.properties?.alias||it[it.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),j.exit().remove(),Da(J,C,u,g?ze:N,g?Se:a,g?ie:m,null,e,F,D,P,U,W,!0,p,g)},ee=C=>{M=k-C.left-C.right,h=o-C.bottom-C.top},z=(C,q,J)=>{Ue=q,$e=C,Pe=J,I()},I=()=>{if(O(),w(),E(),g?na(e,T,Z,h,M,fe,ye,Se,F.yMaxLeft,$e,u,t,k,ae,Ee,ze):Ot(T,F,Z,e,i,a,Le,ae,o,L,t,M,h,$e,N),Y(Ue),za(Ce,g?ze:N,g?Se:a,g?ie:m,V,xt,[],[],e,u,o,k,M,$e,h,f,y,x,i,c,g),!g){let C=la(M,a,e,Ue,void 0,B,h,!0).labelArray;Ga(e,T,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,se.LineChart,e,$,ce,F.dimensionList,M,re,F.formattedDimensionListMap,f,V,h))}},w=()=>{let C=At($e,Ue,ve);Ce=v.stack().keys(F.legendList).offset(v.stackOffsetDiverging)(C),Ue.forEach((J,j)=>J.data.forEach((Te,xe)=>{Te[0]=Ce[j][xe][0],Te[1]=Ce[j][xe][1]}));let q=e.annotation.annotationSetLabelColor;Ce.forEach((J,j)=>J.forEach(Te=>{Te.key=J.key,J.color=JSON.parse(JSON.stringify(A[j].properties.color)),Te.data.labelPosition=A[j].properties.dataLabelPosition,Te.data.labelColor=q=="2"?JSON.parse(JSON.stringify(A[j].properties.color)):A[j].properties.labelColor,Te.hideZero=JSON.parse(JSON.stringify(A[j].properties.hideZeroValues)),Te.properties=A[j].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID();let L=0;const u=se.HorizontalBarChart,S=Me.useRef(),b=Me.useRef(s);b.current=s;const _=Me.useRef(p);_.current=p;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!0;let B=!1;const U=!1,W=new Map;let P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,$=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k=new Map,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye=[],fe=0,$e=2,Ue=!1,Ye={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{Pe()}catch(X){Ae("HorizontalBarchart","createHorizontalBarChart",X)}},[e]);const Pe=()=>{({formatOptions:e,svg:a,width:i,height:y}=St(S,e)),Ee(),{maxNumberForPrimaryAxis:M,maxNumberForSecondaryAxis:h,customYaxisMaxValue:D,secondaryCustomYaxisMaxValue:$}=Et(e,Ye.yMinLeft,Ye.yMaxLeft,Ye.yMinRight,Ye.yMaxRight),{margin:Z,yLabel:ce,xLabel:ne,yTitle:ae,xTitle:ue,dimensionHeightWidthArray:ge,chartTitleHeight:be,secondaryAxisTitleWidth:pe,legendMargin:Q,secondaryYLabel:G,visibleBars:$e,columnWidth:L,scrollbarVisible:Ue}=Ct(i,y,M,h,Ye.yMaxLeft,e,Ye.legendList,Ye.dimensionList,Ye.yMaxRight,B,U,t,g,Ye),he(Z),Mt(a,i,y,e),m=Ft(a,Z),vt(m,e,T,o,d,u,f),we(),ve(),ra(e,m,ce,d,o,ze),B&&pi(e,m,G,Se,o),wt(e,g,a,Z,ne,y,ue,Ye.chartType,ce,o,d),Dt(d,e,T,g,a,Z,ae,ce,o),Ht(a,B,Z,e,T,d,o,G,pe,g),Vt(a,e,i,be),Pt(y,a,ge,be,i,Q,e,A,f,T,Z,ct.rectangle,u,n),Gt(A,y,i,a,Z,o,Ue,$e,Ye,fe,!1,te,g)},Ee=()=>{const X=[],H=[];let E=[],Y=-1/0,ee=1/0,z=-1/0,I=1/0,w=1/0,C=-1/0;A.forEach(q=>{H.push(q.properties.legendUniqueId),C=-1/0,w=1/0,q.data.forEach(J=>{X.push(J),q.properties.axis==="Secondary"?(B=!0,z=Math.max(z,J.value),I=Math.min(I,J.value)):(Y=Math.max(Y,J.value),ee=Math.min(ee,J.value)),C=Math.max(C,J.value),w=Math.min(w,J.value)}),q.properties.setColorScale&&W.set(q.properties.legendUniqueId,v.scaleSequential().domain([w,C]).interpolator(oi.interpolateRgb(q.properties.startColor,q.properties.endColor)))}),Ye.chartData=X,Ye.legendList=H,Ye.yMaxLeft=Y,Ye.yMinLeft=ee>0?0:ee,Ye.yMaxRight=z,Ye.yMinRight=I>0?0:I,E=t?ft(e.xAxisLabel.xAxisNumberFormat,Ye.dimensionList).map(q=>q):Ye.dimensionList,Ye.dimensionList.forEach((q,J)=>{Ye.formattedDimensionListMap.set(q,E[J])}),ye=JSON.parse(JSON.stringify(A)),De=Ye.dimensionList,e.plotArea.hideZeroValues&&(Ye.hideZeroValues=!0)},we=()=>{let X=dt(Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,P,D,g,o).yAxisLabelArray;Ye.yMaxLeft=X[X.length-1],Ye.yMinLeft=X[0],K=v.scaleLinear().domain([Ye.yMinLeft>=0?P!==void 0&&!Number.isNaN(P)?P:0:Ye.yMinLeft<0?Ye.yMinLeft*1.1:Ye.yMinLeft*.9,Ye.yMaxLeft<=0?0:D!==void 0&&!Number.isNaN(D)?D:Ye.yMaxLeft*1.1]).range([0,o]),B&&(me=v.scaleLinear().domain([Ye.yMinRight>=0?(V||V==0)&&!Number.isNaN(V)?V:0:(V||V==0)&&!Number.isNaN(V)?V:Ye.yMinRight*1.1,Ye.yMaxRight<=0?$||0:$||Ye.yMaxRight*1.1]).range([0,o])),Le=[d,0]},Ce=()=>{re=v.scaleBand().domain(Ye.legendList).range([0,L]).paddingInner(Ye.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(De).range(Le).padding(.5)},ve=()=>{{let X=dt(D||Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,P,D,g,o);ze=v.axisBottom(K).tickFormat(H=>Ze(H,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(X.autoLabelFlag?void 0:X.yAxisLabelArray).ticks(X.customTickValue).tickPadding(8).tickSizeOuter(0)}if(B){let X=dt($||Ye.yMaxRight,V||Ye.yMinRight,d,e,Ye,V,$);Se=v.axisTop(me).tickFormat(H=>Ze(H,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(X.autoLabelFlag?void 0:X.yAxisLabelArray).ticks(X.customTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0)}},F=()=>{ie=v.axisLeft(N).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*o*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(De,d))},le=X=>{X.forEach(H=>{H.data.forEach(E=>{E.hideZero=H.properties.hideZeroValues,E.axis=H.properties.axis,E.legendUniqueId=H.properties.legendUniqueId})}),De.forEach(H=>{m.append("rect").attr("id",`dim-background-${H}`).attr("class","dimension-background").attr("y",N(H)-L/2).attr("height",L).attr("x",0).attr("width",o).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),X.forEach(H=>{let E=m.selectAll(".parentGroup").data([H],w=>w.properties.legendUniqueId);E=E.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(E);let Y=E.selectAll(".column-group").data(H.data.map(w=>({...w,properties:H.properties})),w=>w.legend+w.dimension),ee=Y.enter().append("g").attr("class","column-group").attr("hoverId",(H.properties.alias||H.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",w=>`translate(0, ${N(w.dimension)-L/2})`);Y.attr("transform",w=>`translate(0, ${N(w.dimension)-L/2})`),ee.merge(Y).attr("transform",w=>`translate(0, ${N(w.dimension)-L/2})`);const z=ee.append("rect").attr("y",w=>re(w.legendUniqueId)).attr("height",re.bandwidth()).attr("x",w=>{const C=H.properties.axis===Qe.primary?K:me;return w.value>=0,C(0)}).attr("width",0).attr("fill",w=>W.get(H.properties.legendUniqueId)?.(w.value)??H.properties.color).attr("stroke-dasharray",w=>w.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",w=>`${w.properties.stackBorderWidth}px`).attr("stroke",w=>H.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?H.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",w=>w.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>H.properties.legendUniqueId).attr(lt.DimValue,w=>Array.isArray(w.dimension)?String(w.dimension[0]):String(w.dimension));(e.animation.animationEnabled?z.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):z).attr("x",w=>{const C=H.properties.axis===Qe.primary?K:me;return w.value>=0?C(0):C(w.value)}).attr("width",w=>{const C=H.properties.axis===Qe.primary?K:me,q=H.properties.axis===Qe.primary?D:$;return w.value>=0?q&&w.value>q?C(q)-C(0):C(w.value)-C(0):Math.abs(C(0)-C(w.value))}),ee.merge(Y).on("mousemove",(w,C)=>{(H.properties.alias||H.properties.name||"Legend").replace(/ /g,"-");const q=Array.isArray(C.dimension)?C.dimension[0]:C.dimension,J=String(Ye.formattedDimensionListMap.get(q)??q??""),j=gt(l,String(q??""),{...H.properties,formattedDimensionValue:J});yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:Ye.formattedDimensionListMap.get(Array.isArray(C.dimension)?C.dimension[0]:C.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Ze([se.NormalizedStackLineChart,se.NormalizedStackAreaChart,""].includes(u)?C[1]-C[0]:C.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,w,H.properties,j)}).on("mouseout",(w,C)=>{(H.properties.alias||H.properties.name||"Legend").replace(/ /g,"-"),ot()}).on("click",Tt(_,b,(w,C)=>({seriesId:H.properties.legendUniqueId,dimValue:Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension),legendUniqueId:H.properties.legendUniqueId,seriesDisplayName:H.properties.alias||H.properties.name||""}))),Y.exit().remove()}),m.selectAll(".parentGroup").raise()},he=X=>{o=i-X.left-X.right,d=y-X.bottom-X.top},te=(X,H,E)=>{ye=H,De=X,$e=E,ai(r,k,De),e.xAxisLabel.hideZeroValues&&(De=De.filter(Y=>k.get(Y)!==0)),O()},O=()=>{Ce(),F(),na(e,m,ne,d,o,ie,Se,K,Ye.yMaxLeft,De,u,t,i,ge,L,N),le(ye),Ra(ye,N,K,me,Z,xt,[],[],e,u,y,i,o,De,d,f,a,x,re,L,c,!1,g)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},ur=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.StackHorizontalBarChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse(),R=r.DimensionList,g=!0,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe;const Q=new Map;let G,M,h,k,o,d,i,y,T,a,m,N,re=[],K=0,me=2,Le=!1,ze=[];const Se=!1;let ie=new Map,De={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{ye()}catch(O){Ae("StackStackHorizontalBarchart","createStackHorizontalBarChart",O)}},[e]);const ye=()=>{({formatOptions:e,svg:o,width:h,height:k}=St(S,e)),fe(),{maxNumberForPrimaryAxis:be,maxNumberForSecondaryAxis:pe}=Et(e,De.yMinLeft,De.yMaxLeft,De.yMinRight,De.yMaxRight),{margin:P,yLabel:D,xLabel:V,yTitle:$,xTitle:Z,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:ae,legendMargin:ue,secondaryYLabel:ge,visibleBars:me,columnWidth:L,scrollbarVisible:Le}=Ct(h,k,be,pe,De.yMaxLeft,e,De.legendList,De.dimensionList,De.yMaxRight,B,Se,t,g,De),we(P),Mt(o,h,k,e),d=Ft(o,P),vt(d,e,0,G,M,u,f),$e(),Ye(),ra(e,d,D,M,G,a),wt(e,g,o,P,V,k,Z,De.chartType,D,G,M),Dt(M,e,0,g,o,P,$,D,h),Vt(o,e,h,ne),Pt(k,o,ce,ne,h,ue,e,[...A].reverse(),f,0,P,ct.rectangle,u,n),Gt(A,k,h,o,P,G,Le,me,De,K,!1,Ce,g)},fe=()=>{const O=[],X=[];let H=-1/0,E=1/0;A.forEach((C,q)=>{const J=`${q}~$~${C.properties.legend}`;C.properties.legend=J,X.push(J),H=-1/0,E=1/0;for(const j of C.data)H=Math.max(H,j.value),E=Math.min(E,j.value),O.push(j);C.properties.setColorScale&&Q.set(C.properties.legendUniqueId,v.scaleSequential().domain([E,H]).interpolator(v.interpolateRgb(C.properties.startColor,C.properties.endColor)))}),De.chartData=O,De.legendList=X,re=JSON.parse(JSON.stringify(A));let Y=At(De.dimensionList,A,Se);e.plotArea.fitChart?N=De.dimensionList:(N=De.dimensionList.slice(K,K+me),re.forEach((C,q)=>re[q].data=C.data.filter(J=>N.includes(J.dimension))));const ee=v.stack().keys(De.legendList).offset(v.stackOffsetDiverging)(Y);F();let z=1/0,I=-1/0;for(const C of ee)for(const[q,J]of C)z=Math.min(z,q),I=Math.max(I,J);De.yMinLeft=z>0?0:z,De.yMaxLeft=I;let w=t?ft(e.xAxisLabel.xAxisNumberFormat,De.dimensionList).map(C=>C):De.dimensionList;De.dimensionList.forEach((C,q)=>{De.formattedDimensionListMap.set(C,w[q])}),e.plotArea.hideZeroValues&&(De.hideZeroValues=!0)},$e=()=>{let O=dt(De.yMaxLeft,De.yMinLeft,M,e,De,U,W,g,G).yAxisLabelArray;De.yMaxLeft=O[O.length-1],De.yMinLeft=O[0],i=v.scaleLinear().domain([De.yMinLeft>=0?U!==void 0&&!Number.isNaN(U)?U:0:De.yMinLeft<0?De.yMinLeft*1.1:De.yMinLeft*.9,De.yMaxLeft<=0?0:W!==void 0&&!Number.isNaN(W)?W:De.yMaxLeft*1.1]).range([0,G]),T=[M,0]},Ue=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Ye=()=>{{let O=dt(W||De.yMaxLeft,De.yMinLeft,M,e,De,U,W,g,G);a=v.axisBottom(i).tickFormat(X=>Ze(X,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-M:0).tickValues(O.autoLabelFlag?void 0:O.yAxisLabelArray).ticks(O.customTickValue).tickPadding(8).tickSizeOuter(0)}},Pe=()=>{m=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*G*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(N,M))},Ee=O=>{O.forEach(w=>{w.data.forEach(C=>{C.hideZero=w.properties.hideZeroValues,C.axis=w.properties.axis})}),N.forEach(w=>{d.append("rect").attr("id",`dim-background-${w}`).attr("class","dimension-background").attr("y",y(w)-L/2).attr("height",L).attr("x",0).attr("width",G).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let X=d.selectAll(".parentGroup").data([ze]);X=X.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${f}-clip)`).merge(X);let H=X.selectAll(".column-group").data(w=>w);H=H.enter().append("g").attr("class",w=>"column-group "+w.key.replace(/ /g,"-")).attr("hoverId",w=>(O[w.index].properties.alias||O[w.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(H);let Y=H.selectAll("rect").data(w=>w);const ee=(w,C)=>{const q=Array.from(H.nodes()).indexOf(w[C].parentNode);return{props:A[q]?.properties,groupIndex:q}},z=Y.enter().append("rect").merge(Y).attr("y",w=>y(w.data.dimension)-L/2).attr("height",L).attr("fill",(w,C,q)=>{const{props:J}=ee(q,C);return Q.get(J.legendUniqueId)?.(w.data[w.key])??J?.color??"gray"}).attr("stroke",(w,C,q)=>{const J=ee(q,C).props;return J?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?J.stackBorderColor:"none"}).attr("stroke-dasharray",(w,C,q)=>ee(q,C).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(w,C,q)=>(ee(q,C).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",w=>Math.min(i(w[0]),i(w[1]))).attr("width",0).attr("visibility",(w,C,q)=>{const J=ee(q,C).props;return w.data[w.key]===0&&J?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,w=>w.key??"").attr(lt.DimValue,w=>Array.isArray(w.data.dimension)?String(w.data.dimension[0]):String(w.data.dimension)).on("mousemove",(w,C)=>{const q=C.data.dimension;yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:De.formattedDimensionListMap.get(q)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||C.value,value:Ze(C.data[C.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,w,C.properties,gt(p,String(q??""),{...C.properties,formattedDimensionValue:String(De.formattedDimensionListMap.get(q)??q??"")}))}).on("mouseout",(w,C)=>{C.data.dimension,ot()}).on("click",Tt(_,b,(w,C)=>({seriesId:C.key,dimValue:Array.isArray(C.data.dimension)?String(C.data.dimension[0]):String(C.data.dimension),legendUniqueId:C.key,seriesDisplayName:C.properties?.alias||C.properties?.name||""})));z.attr("x",w=>i(0)),(e.animation.animationEnabled?z.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):z).attr("x",w=>Math.min(i(w[0]),i(w[1]))).attr("width",w=>Math.abs(i(w[1])-i(w[0]))),H.exit().remove(),d.selectAll(".parentGroup").raise()},we=O=>{G=h-O.left-O.right,M=k-O.bottom-O.top},Ce=(O,X,H)=>{re=X,N=O,me=H,ai(r,ie,N),F(),ve()},ve=()=>{Ue(),Pe(),na(e,d,V,M,G,m,void 0,i,De.yMaxLeft,N,u,t,h,ce,L,y);const O=new Map;N.forEach((X,H)=>{let E=0;ze.forEach(Y=>{const ee=Y[H]?.[0]??0;ee<E&&(E=ee)}),O.set(X,E)}),Ee(re),za(ze,y,i,void 0,P,xt,[],[],e,u,k,h,G,N,M,f,o,x,0,c,g),ti(ie,y,i,P,xt,[],e,u,k,h,o,c,g,O),le(),d.selectAll(".connectors").raise()},F=()=>{let O=At(N,re,Se);ze=v.stack().keys(De.legendList).offset(v.stackOffsetDiverging)(O),re.forEach((H,E)=>H.data.forEach((Y,ee)=>{Y[0]=ze[E][ee][0],Y[1]=ze[E][ee][1]}));let X=e.annotation.annotationSetLabelColor;ze.forEach((H,E)=>H.forEach(Y=>{Y.key=H.key,H.color=JSON.parse(JSON.stringify(A[E].properties.color)),Y.data.labelPosition=A[E].properties.dataLabelPosition,Y.data.labelColor=X=="2"?JSON.parse(JSON.stringify(A[E].properties.color)):A[E].properties.labelColor,Y.hideZero=JSON.parse(JSON.stringify(A[E].properties.hideZeroValues)),Y.properties=A[E].properties}))},le=()=>{try{const O=Number(e.connector?.connectorVisibility);if(!e.connector||O===2)return;const X=[],H=[],E=[];let Y;const ee=[];if(O===1)Y=1;else if(O===3){const j=Number(e.connector.connectorFollow);j===1?Y=Number(e.connector.connectorStepSize):j===2&&((e.connector.connectorExclude||[]).forEach(Te=>E.push(Te)),Y=1)}const z=[],I=[],w=[],C=e.connector?.connectorCustomRange||[];E.forEach(j=>{const Te=j.split("-");Te.length&&z.push(Te[0])});const J=(ze?.[0]||[]).map((j,Te)=>({Dimension:j.data.dimension,Total:j.data.total,CustomTotal:j.data.total-(w[Te]??0),Index:Te}));if(Y!=null){for(let j=0;j<J.length;j++)(Y===1||j%Y===0&&Y!==1)&&X.push(J[j]);for(let j=Y;j<J.length;j+=Y){const Te=Math.min(j+Y,J.length);let xe=-1/0;for(let de=j;de<Te;de++)J[de].Total>xe&&(xe=J[de].Total);xe!==-1/0&&ee.push(xe)}for(let j=1;j<X.length;j++)H.push(X[j])}else{const j=[];(C||[]).forEach(Te=>{if(Te?.from&&Te?.to){const xe=J.some(Fe=>Fe.Dimension===Te.from),de=J.some(Fe=>Fe.Dimension===Te.to);xe&&de&&j.push({from:Te.from,to:Te.to})}}),j.forEach(Te=>{const xe=J.findIndex(Fe=>Fe.Dimension===Te.from),de=J.findIndex(Fe=>Fe.Dimension===Te.to);if(xe>=0&&de>=0){const Fe=Math.min(xe,de),Ve=Math.max(xe,de);X.push(J[Fe]);let ke=J[Fe]?.Total??-1/0;for(let Be=Fe;Be<=Ve;Be++)J[Be].Total>ke&&(ke=J[Be].Total);ke!==-1/0&&ee.push(ke),H.push(J[Ve])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Re.white?e.connector.connectorMarkerColor:"none"),he(X,ee,H,Y,z),te(X,ee,H,Y,z)}catch(O){console.error(O)}},he=(O,X,H,E,Y)=>{try{const ee=y.bandwidth()??0,z=d.selectAll(".connector-paths").data([0]),I=z.enter().append("g").attr("class","connector-paths connectors").merge(z),w=O.filter((J,j)=>E!=null?j<O.length-1:j<O.length),C=I.selectAll("path.connector-path").data(w,(J,j)=>J?.Dimension??j);C.exit().remove(),C.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(C).attr("d",(J,j)=>{const Te=H?.[j]??{Total:0,Dimension:J.Dimension},xe=J?.Total??0,de=typeof Te.Total=="number"?i(Te.Total):0,Fe=typeof xe=="number"?i(xe):0,Ve=Math.max(de,Fe);return e.total.totalVisibility?`M ${Fe+50},
74
+ ${y(J.Dimension)+ee/2-5}
75
+ H ${60+Ve}
76
+ V ${y(Te.Dimension)+ee/2+5}
77
+ H ${30+de}`:`M ${Fe+30},
78
+ ${y(J.Dimension)+ee/2-5}
79
+ H ${45+Ve}
80
+ V ${y(Te.Dimension)+ee/2+5}
81
+ H ${10+de}`}).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(J,j)=>Y.includes(J.Dimension)||J.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}},te=(O,X,H,E,Y)=>{try{const ee=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,z=Mi(ee,L);let I=e.connector.connectorFontStyle,w=e.connector.connectorNumberFormat,C=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(w=".2s");const q=O.filter((de,Fe)=>E!=null?Fe<O.length-1:Fe<O.length),J=d.selectAll(".connector-texts").data([0]),Te=J.enter().append("g").attr("class","connector-texts connectors").merge(J).selectAll("text.connector-text").data(q,de=>de?.Dimension??de);Te.exit().remove(),Te.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(Te).attr("y",(de,Fe)=>{const Ve=H?.[Fe]??{Dimension:de.Dimension,Total:0},ke=y(de.Dimension)??0;return(y(Ve.Dimension)??ke)+E*z/2}).attr("x",(de,Fe)=>{const Ve=H?.[Fe]??{Total:0},ke=de?.Total??0,Be=Math.max(i(Ve.Total),i(ke));return e.total.totalVisibility?70+Be:50+Be}).text((de,Fe)=>{const Ve=H?.[Fe]??{Total:0,CustomTotal:0,Dimension:de.Dimension};return de.CustomTotal==0&&Ve.CustomTotal!=0&&(de.CustomTotal=1),Ai(Ve.Total,de.Total,parseInt(e.connector.connectorDecimalPrecision),w,parseInt(de.Dimension),parseInt(Ve.Dimension),e)}).style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",I.includes("Italic")?"Italic":"").style("text-decoration",I.includes("Underline")?"Underline":"").style("font-weight",I.includes("Bold")?"Bold":"").style("visibility",(de,Fe)=>Y.includes(de.Dimension)||de.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},hr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.NormalizedStackHorizontalBarChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse(),R=r.DimensionList,g=!0,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h;const k=new Map;let o,d,i,y,T,a,m,N,re=[],K=0,me,Le=!1,ze=[];const Se=!0;let ie={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{De()}catch(F){Ae("StackNormalizedStackBarchart","createNormalizedStackBarChart",F)}},[e]);const De=()=>{({formatOptions:e,svg:o,width:M,height:h}=St(S,e)),ye(),{maxNumberForPrimaryAxis:be,maxNumberForSecondaryAxis:pe}=Et(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:P,yLabel:D,xLabel:V,yTitle:$,xTitle:Z,dimensionHeightWidthArray:ce,chartTitleHeight:ne,secondaryAxisTitleWidth:ae,legendMargin:ue,secondaryYLabel:ge,visibleBars:me,columnWidth:L,scrollbarVisible:Le}=Ct(M,h,be,pe,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,B,Se,t,g,ie),Ee(P),Mt(o,M,h,e),d=Ft(o,P),vt(d,e,0,Q,G,u),fe(),Ue(),ra(e,d,D,G,Q,a),wt(e,g,o,P,V,h,Z,ie.chartType,D,Q,G),Dt(G,e,0,g,o,P,$,D,Q),Vt(o,e,M,ne),Pt(h,o,ce,ne,M,ue,e,[...A].reverse(),f,0,P,ct.rectangle,u,n),Gt(A,h,M,o,P,Q,Le,me,ie,K,!1,ve,g)},ye=()=>{const F=[],le=[];let he=-1/0,te=1/0;A.forEach((Y,ee)=>{const z=`${ee}~$~${Y.properties.legend}`;Y.properties.legend=z,le.push(z),he=-1/0,te=1/0;for(const I of Y.data)he=Math.max(he,I.value),te=Math.min(te,I.value),F.push(I);Y.properties.setColorScale&&k.set(Y.properties.legendUniqueId,v.scaleSequential().domain([te,he]).interpolator(v.interpolateRgb(Y.properties.startColor,Y.properties.endColor)))}),ie.chartData=F,ie.legendList=le,re=JSON.parse(JSON.stringify(A));let O=At(ie.dimensionList,A,Se);e.plotArea.fitChart?N=ie.dimensionList:(N=ie.dimensionList.slice(K,K+me),re.forEach((Y,ee)=>re[ee].data=Y.data.filter(z=>N.includes(z.dimension))));const X=v.stack().keys(ie.legendList).offset(v.stackOffsetDiverging)(O);Ce();let H=1/0;for(const Y of X)for(const[ee,z]of Y)H=Math.min(H,ee);ie.yMinLeft=H>0?0:H,ie.yMaxLeft=1;let E=t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(Y=>Y):ie.dimensionList;ie.dimensionList.forEach((Y,ee)=>{ie.formattedDimensionListMap.set(Y,E[ee])}),e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0)},fe=()=>{let F=dt(W||ie.yMaxLeft,ie.yMinLeft,G,e,ie,U,W,g,Q).yAxisLabelArray;ie.yMaxLeft=F[F.length-1],ie.yMinLeft=F[0],i=v.scaleLinear().domain([ie.yMinLeft<0?-1:0,1]).range([0,Q]),T=[G,0]},$e=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Ue=()=>{a=v.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-G:0).ticks(Q/80,"%").tickPadding(8).tickSizeOuter(0)},Ye=()=>{m=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*Q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(N,G))},Pe=F=>{ze.forEach((Y,ee)=>Y.forEach((z,I)=>{F[ee].data[I][0]=z[0]=z.data.total===0?0:z[0]/z.data.total,F[ee].data[I][1]=z[1]=z.data.total===0?0:z[1]/z.data.total})),F.forEach(Y=>{Y.data.forEach(ee=>{ee.hideZero=Y.properties.hideZeroValues,ee.axis=Y.properties.axis})}),N.forEach(Y=>{d.append("rect").attr("id",`dim-background-${Y}`).attr("class","dimension-background").attr("y",y(Y)-y.bandwidth()/2).attr("height",y.bandwidth()).attr("x",0).attr("width",Q).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let le=d.selectAll(".parentGroup").data([ze]);le=le.enter().append("g").attr("class","columns parentGroup").merge(le);let he=le.selectAll(".column-group").data(Y=>Y);he=he.enter().append("g").attr("class",Y=>"column-group "+Y.key.replace(/ /g,"-")).attr("hoverId",Y=>(F[Y.index].properties.alias||F[Y.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(he);let O=he.selectAll("rect").data(Y=>Y);const X=(Y,ee)=>{const z=Array.from(he.nodes()).indexOf(Y[ee].parentNode);return{props:A[z]?.properties,groupIndex:z}},H=O.enter().append("rect").merge(O).attr("y",Y=>y(Y.data.dimension)-L/2).attr("height",L).attr("fill",(Y,ee,z)=>{const{props:I}=X(z,ee);return k.get(I.legendUniqueId)?.(Y.data[Y.key])??I?.color??"gray"}).attr("stroke",(Y,ee,z)=>{const I=X(z,ee).props;return I?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?I.stackBorderColor:"none"}).attr("stroke-dasharray",(Y,ee,z)=>X(z,ee).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(Y,ee,z)=>(X(z,ee).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",Y=>i(0)).attr("width",0).attr("visibility",(Y,ee,z)=>{const I=X(z,ee).props;return Y.data[Y.key]===0&&I?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,Y=>Y.key??"").attr(lt.DimValue,Y=>Array.isArray(Y.data.dimension)?String(Y.data.dimension[0]):String(Y.data.dimension)).on("mousemove",(Y,ee)=>{const z=ee.data.dimension;yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ie.formattedDimensionListMap.get(z)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ee.properties?.currentMeasure?ee.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||ee.value,value:Ze(ee[1]-ee[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ee.properties.alias}],e,Y,ee.properties,gt(p,String(z??""),{...ee.properties,formattedDimensionValue:String(ie.formattedDimensionListMap.get(z)??z??"")}))}).on("mouseout",(Y,ee)=>{let z=(ee.properties.alias||ee.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+z+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}).on("click",Tt(_,b,(Y,ee)=>({seriesId:ee.key,dimValue:Array.isArray(ee.data.dimension)?String(ee.data.dimension[0]):String(ee.data.dimension),legendUniqueId:ee.key,seriesDisplayName:ee.properties?.alias||ee.properties?.name||""})));(e.animation.animationEnabled?H.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):H).attr("x",Y=>Math.min(i(Y[0]),i(Y[1]))).attr("width",Y=>Math.abs(i(Y[1])-i(Y[0]))),he.exit().remove(),d.selectAll(".parentGroup").raise()},Ee=F=>{Q=M-F.left-F.right,G=h-F.bottom-F.top},we=()=>{$e(),Ye(),na(e,d,V,G,Q,m,void 0,i,ie.yMaxLeft,N,u,t,M,ce,L,y),Pe(re),za(ze,y,i,void 0,P,xt,[],[],e,u,h,M,Q,N,G,f,o,x,0,c,g)},Ce=()=>{let F=At(N,re,Se);ze=v.stack().keys(ie.legendList).offset(v.stackOffsetDiverging)(F),re.forEach((he,te)=>he.data.forEach((O,X)=>{O[0]=ze[te][X][0],O[1]=ze[te][X][1]}));let le=e.annotation.annotationSetLabelColor;ze.forEach((he,te)=>he.forEach(O=>{O.key=he.key,he.color=JSON.parse(JSON.stringify(A[te].properties.color)),O.data.labelPosition=A[te].properties.dataLabelPosition,O.data.labelColor=le=="2"?JSON.parse(JSON.stringify(A[te].properties.color)):A[te].properties.labelColor,O.hideZero=JSON.parse(JSON.stringify(A[te].properties.hideZeroValues)),O.properties=A[te].properties}))},ve=(F,le,he)=>{re=le,N=F,me=he,Ce(),we()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},xr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID();let L=0;const u=se.LayeredHorizontalBarChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!0,B=!1,U=new Map;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re=[],K=0,me=2,Le=!1,ze=[];const Se=!1;let ie={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{De()}catch(te){Ae("StackStackHorizontalBarchart","createStackHorizontalBarChart",te)}},[e]);const De=()=>{({formatOptions:e,svg:o,width:h,height:k}=St(S,e)),ye(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be,visibleBars:me,columnWidth:L,scrollbarVisible:Le}=Ct(h,k,pe,Q,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,B,Se,t,g,ie),Ee(D),Mt(o,h,k,e),d=Ft(o,D),vt(d,e,0,G,M,u,f),fe(),Ue(),ra(e,d,V,M,G,a),wt(e,g,o,D,$,k,ce,ie.chartType,V,G,M),Dt(M,e,0,g,o,D,Z,V),Vt(o,e,h,ae),Pt(k,o,ne,ae,h,ge,e,A,f,0,D,ct.rectangle,u,n),Gt(A,k,h,o,D,G,Le,me,ie,K,!1,we,g)},ye=()=>{const te=[],O=[];let X=[],H=-1/0,E=1/0,Y=-1/0,ee=1/0,z=-1/0,I=1/0;A.forEach(w=>{O.push(w.properties.legendUniqueId),z=-1/0,I=1/0,w.data.forEach(C=>{te.push(C),z=Math.max(z,C.value),I=Math.min(I,C.value),H=Math.max(H,C.value),E=Math.min(E,C.value)}),w.properties.setColorScale&&U.set(w.properties.legendUniqueId,v.scaleSequential().domain([I,z]).interpolator(v.interpolateRgb(w.properties.startColor,w.properties.endColor)))}),ie.chartData=te,ie.legendList=O,ie.yMaxLeft=H,ie.yMinLeft=E>0?0:E,ie.yMaxRight=Y,ie.yMinRight=ee,X=t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(w=>w):ie.dimensionList,X=t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(w=>w):ie.dimensionList,ie.dimensionList.forEach((w,C)=>{ie.formattedDimensionListMap.set(w,X[C]),ie.formattedDimensionListMap.set(w,X[C])}),re=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?N=ie.dimensionList:N=ie.dimensionList.slice(K,K+me),e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0)},fe=()=>{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P,g,G).yAxisLabelArray;ie.yMaxLeft=te[te.length-1],ie.yMinLeft=te[0],i=v.scaleLinear().domain([ie.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:ie.yMaxLeft*1.1]).range([0,G]),T=[M,0],$e()},$e=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(ie.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=v.scalePoint().domain(N).range(T).padding(.5)},Ue=()=>{Ye();{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P,g,G);a=v.axisBottom(i).tickFormat(O=>Ze(O,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-M:0).tickValues(te.autoLabelFlag?void 0:te.yAxisLabelArray).ticks(te.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ye=()=>{m=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*G*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(N,M))},Pe=te=>{te.forEach(O=>{O.data.forEach(X=>{X.hideZero=O.properties.hideZeroValues,X.axis=O.properties.axis,X.properties=O.properties})}),te.forEach((O,X)=>{let H=d.selectAll(".parentGroup").filter(I=>I?.properties?.legendUniqueId===O.properties.legendUniqueId).data([O],I=>I.properties.legendUniqueId);H=H.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",O.properties.legendUniqueId).attr("clip-path",`url(#${f}-clip)`).merge(H);let E=H.selectAll(".column-group").data(O.data,I=>I.dimension+"_"+O.properties.legendUniqueId),Y=E.enter().append("g").attr("class","column-group").attr("hoverId",(O.properties.alias||O.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",I=>X===0?`translate(0, ${y(I.dimension)-L/2})`:`translate(0, ${y(I.dimension)-L/(2+X*2)})`);E.attr("transform",I=>X===0?`translate(0, ${y(I.dimension)-L/2})`:`translate(0, ${y(I.dimension)-L/(2+X*2)})`),Y.merge(E).attr("transform",I=>X===0?`translate(0, ${y(I.dimension)-L/2})`:`translate(0, ${y(I.dimension)-L/(2+X*2)})`);const ee=Y.append("rect").attr("y",0).attr("height",X===0?L:L/2).attr("x",()=>i(0)).attr("width",0).attr("fill",I=>U.get(O.properties.legendUniqueId)?.(I.value)??O.properties.color).attr("stroke-dasharray",()=>O.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${O.properties.stackBorderWidth}px`).attr("stroke",()=>O.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?O.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",I=>I.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>O.properties.legendUniqueId).attr(lt.DimValue,I=>Array.isArray(I.dimension)?String(I.dimension[0]):String(I.dimension));(e.animation.animationEnabled?ee.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ee).attr("x",I=>I.value>0?i(0):i(I.value)).attr("width",I=>I.value>0?i(I.value)-i(0):Math.abs(i(0)-i(I.value))),E.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("x",I=>I.value>0?i(0):i(I.value)).attr("width",I=>I.value>0?i(I.value)-i(0):Math.abs(i(0)-i(I.value))),Y.merge(E).on("mousemove",(I,w)=>{yt([{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText.includes("~$~")?e.xAxisTitle.xAxisTitleText.split("~$~")[1]:e.xAxisTitle.xAxisTitleText,value:ie.formattedDimensionListMap.get(w.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():w.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||w.value,value:Ze(w.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:O.properties.alias}],e,I,O.properties,gt(p,String(w.dimension??""),{...O.properties,formattedDimensionValue:String(ie.formattedDimensionListMap.get(w.dimension)??w.dimension??"")}))}).on("mouseout",()=>{ot()}).on("click",Tt(_,b,(I,w)=>({seriesId:O.properties.legendUniqueId,dimValue:Array.isArray(w.dimension)?String(w.dimension[0]):String(w.dimension),legendUniqueId:O.properties.legendUniqueId,seriesDisplayName:O.properties.alias||O.properties.name||""}))),E.exit().remove()}),d.selectAll(".parentGroup").raise()},Ee=te=>{G=h-te.left-te.right,M=k-te.bottom-te.top},we=(te,O,X)=>{re=O,N=te,me=X,Ce()},Ce=()=>{$e(),Ye(),na(e,d,$,M,G,m,void 0,i,ie.yMaxLeft,N,u,t,h,ne,L,y),ve(),Pe(re),Ra(re,y,i,void 0,D,xt,[],[],e,u,k,h,G,N,M,f,o,x,void 0,L,c,!1,g),F()},ve=()=>{let te=At(N,re,Se);ze=v.stack().keys(ie.legendList).offset(v.stackOffsetDiverging)(te),re.forEach((X,H)=>X.data.forEach((E,Y)=>{E[0]=ze[H][Y][0],E[1]=ze[H][Y][1]}));let O=e.annotation.annotationSetLabelColor;ze.forEach((X,H)=>X.forEach(E=>{E.key=X.key,X.color=JSON.parse(JSON.stringify(A[H].properties.color)),E.data.labelPosition=A[H].properties.dataLabelPosition,E.data.labelColor=O=="2"?JSON.parse(JSON.stringify(A[H].properties.color)):A[H].properties.labelColor,E.hideZero=JSON.parse(JSON.stringify(A[H].properties.hideZeroValues))}))},F=()=>{try{const te=Number(e.connector?.connectorVisibility);if(!e.connector||te===2)return;const O=[],X=[],H=[];let E;const Y=[];if(te===1)E=1;else if(te===3){const J=Number(e.connector.connectorFollow);J===1?E=Number(e.connector.connectorStepSize):J===2&&((e.connector.connectorExclude||[]).forEach(j=>H.push(j)),E=1)}const ee=[],z=[],I=[],w=e.connector?.connectorCustomRange||[];H.forEach(J=>{const j=J.split("-");j.length&&ee.push(j[0])});const q=(ze?.[0]||[]).map((J,j)=>({Dimension:J.data.Dimension,Total:J.data.Total,CustomTotal:J.data.Total-(I[j]??0),Index:j}));if(E!=null){for(let J=0;J<q.length;J++)(E===1||J%E===0&&E!==1)&&O.push(q[J]);for(let J=E;J<q.length;J+=E){const j=Math.min(J+E,q.length);let Te=-1/0;for(let xe=J;xe<j;xe++)q[xe].Total>Te&&(Te=q[xe].Total);Te!==-1/0&&Y.push(Te)}for(let J=1;J<O.length;J++)X.push(O[J])}else{const J=[];(w||[]).forEach(j=>{if(j?.from&&j?.to){const Te=q.some(de=>de.Dimension===j.from),xe=q.some(de=>de.Dimension===j.to);Te&&xe&&J.push({from:j.from,to:j.to})}}),J.forEach(j=>{const Te=q.findIndex(de=>de.Dimension===j.from),xe=q.findIndex(de=>de.Dimension===j.to);if(Te>=0&&xe>=0){const de=Math.min(Te,xe),Fe=Math.max(Te,xe);O.push(q[de]);let Ve=q[de]?.Total??-1/0;for(let ke=de;ke<=Fe;ke++)q[ke].Total>Ve&&(Ve=q[ke].Total);Ve!==-1/0&&Y.push(Ve),X.push(q[Fe])}})}d.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Re.white?e.connector.connectorMarkerColor:"none"),le(O,Y,X,E,ee),he(O,Y,X,E,ee)}catch(te){console.error(te)}},le=(te,O,X,H,E)=>{try{d.append("g").selectAll("path").data(te).enter().filter((Y,ee)=>H!=null?ee<te.length-1:ee<te.length).append("path").attr("d",(Y,ee)=>e.total.totalVisibility?`M ${i(Y.Total)+50},
82
+ ${y(Y.Dimension)+y.bandwidth()/2-5}
83
+ H ${60+Math.max(i(O[ee]),i(X[ee].Total),i(Y.Total))}
84
+ V ${y(X[ee].Dimension)+y.bandwidth()/2+5}
85
+ H ${30+i(X[ee].Total)}`:`M ${i(Y.Total)+30},
86
+ ${y(Y.Dimension)+y.bandwidth()/2-5}
87
+ H ${45+Math.max(i(O[ee]),i(X[ee].Total),i(Y.Total))}
88
+ V ${y(X[ee].Dimension)+y.bandwidth()/2+5}
89
+ H ${10+i(X[ee].Total)}
90
+ `).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",Y=>E.includes(Y.Dimension)||Y.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(Y){console.error(Y)}},he=(te,O,X,H,E)=>{try{let Y=e.connector.connectorFontStyle,ee=e.connector.connectorNumberFormat,z=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(ee=".2s"),d.append("g").selectAll("text1").data(te).enter().filter((I,w)=>H!=null?w<te.length-1:w<te.length).append("text").attr("y",(I,w)=>H==null?y(X[w].Dimension)/2+y(I.Dimension)/2+15:H==1?z<6&&y.bandwidth()>40?y(X[w].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(X[w].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(X[w].Dimension)+y.bandwidth()/2+y.bandwidth()/2*H+12).attr("x",(I,w)=>e.total.totalVisibility?70+Math.max(i(O[w]),i(X[w].Total),i(I.Total)):50+Math.max(i(O[w]),i(X[w].Total),i(I.Total))).text((I,w)=>(I.CustomTotal==0&&X[w].CustomTotal!=0&&(I.CustomTotal=1),Ai(X[w].Total,I.Total,parseInt(e.connector.connectorDecimalPrecision),ee,parseInt(I.Dimension),parseInt(X[w].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",Y.includes("Italic")?"Italic":"").style("text-decoration",Y.includes("Underline")?"Underline":"").style("font-weight",Y.includes("Bold")?"Bold":"").style("visibility",I=>E.includes(I.Dimension)||I.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(Y){console.error(Y)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},pr=({isDateType:t,formatOptions:e,data:r})=>{const c=crypto.randomUUID(),x=0,n=se.ColumnHistogramChart,l=Me.useRef(),s=r.ChartData,p=r.DimensionList,f=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,b=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,_=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,R,g,B,U,W,P,D,V,$,Z,ce,ne,ae,ue,ge,be=[],pe=[],Q,G,M,h,k,o,d,i,y,T,a,m=[],N=0;const re=2;let K={dimensionList:p,chartType:n,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{me()}catch(Pe){Ae("HorizontalHistogramChart","createHorizontalChart",Pe)}},[e]);const me=()=>{({formatOptions:e,svg:k,width:Q,height:G}=St(l,e)),Le(),{formatOptions:e}=ta(e,s,r.DataTableData??[]),{maxNumberForPrimaryAxis:ce,maxNumberForSecondaryAxis:ne}=Et(e,K.yMinLeft,K.yMaxLeft,K.yMinRight,K.yMaxRight),{margin:R,yLabel:g,xLabel:B,yTitle:U,xTitle:W,dimensionHeightWidthArray:P,chartTitleHeight:D,secondaryAxisTitleWidth:V,legendMargin:$,secondaryYLabel:Z}=Ct(Q,G,ce,ne,K.yMaxLeft,e,K.legendList,K.dimensionList,K.yMaxRight,L,u,t),$e(R),{dataTable:M,dataTableHeight:h}=aa(e,g,U,s,K.dimensionList),Mt(k,Q,G,e),o=Ft(k,R),vt(o,e,h,ae,ue,n),ze(),ie(),De(),Ot(o,K,B,e,h,d,T,P,G,x,t,ae,ue,a,d),Jt(o,e,h,g,y,ue),Ue(s,G,k,R,ae),wt(e,f,k,R,B,G,W,K.chartType,g,ae,ue),Dt(ue,e,h,f,k,R,U,g),Ht(k,L,R,e,h,ue,ae,Z,V),Vt(k,e,Q,D),Pt(G,k,P,D,Q,$,e,s,c,h,R,ct.rectangle)},Le=()=>{const Pe=[],Ee=[];let we=[],Ce=-1/0,ve=1/0;s.forEach(he=>{Ee.push(he.legend),he.data.forEach(te=>{Pe.push(te),Ce=Math.max(Ce,te.value),ve=Math.min(ve,te.value)})}),K.chartData=Pe,K.legendList=Ee,K.yMaxLeft=Ce,K.yMinLeft=ve>0?0:ve,m=JSON.parse(JSON.stringify(s)),m.forEach(he=>he.data.forEach(te=>we.push(te.value)));let F=S||S==0?S:0,le=b||b==0?b:m[0]?.data?.length;if(K.yMaxLeft=parseFloat((F+"").length>(le+"").length?F+"":le+""),K.xMax=v.max(we),K.xMin=v.min(we),K.xMin===K.xMax){const he=K.xMax===0?1:Math.abs(K.xMax*.1);K.xMin-=he,K.xMax+=he}},ze=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=ue/50;break;case"Number of Bins":Se(!1);break;case"Bin Width":Se(!0)}},Se=Pe=>{m.forEach(ve=>ve.data.sort((F,le)=>F.value-le.value));let Ee=K.xMax-K.xMin,we;Pe?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),we=Ee/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),we=Ee/parseFloat(e.bins.binsCalculationValue));let Ce=K.xMin;if(Pe)for(be=[Ce];Ce<K.xMax;)Ce+=we,be.push(Ce);else for(be=[Ce];Math.round(Ce)<Math.round(K.xMax);)Ce+=we,be.push(Math.round(Ce))},ie=()=>{d=v.scaleLinear().domain([K.xMin,K.xMax]).range([ue,0]);const Pe=be.length>0?be:d.ticks(ge);let Ee=v.bin().value(Ce=>Ce).domain(d.domain()).thresholds(Pe);m.forEach(Ce=>{let ve=Ee(Ce.data.map(F=>F.value));pe.push(ve)}),m.forEach((Ce,ve)=>pe[ve].forEach(F=>{F.name=Ce.properties.legend,F.color=Ce.properties.color,F.opacity=Ce.properties.opacity}));let we=[];pe.forEach(Ce=>Ce.forEach(ve=>we.push(ve.length))),K.yMaxLeft=v.max(we),K.yMinLeft=v.min(we),i=v.scaleLinear().domain([_||_==0?_:0,A||A==0?A:K.yMaxLeft+.2*K.yMaxLeft]).range([0,ae])},De=()=>{ye();{let Pe=dt(K.yMaxLeft,K.yMinLeft,ae,e,K,S,b,!1,ue);T=v.axisBottom(i).tickFormat(Ee=>Ze(Ee,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-ue+0:0).tickValues(Pe.autoLabelFlag?void 0:Pe.yAxisLabelArray).ticks(Pe.customTickValue).tickPadding(8).tickSizeOuter(0)}},ye=()=>{Li(K.xMax,K.xMin,ue,e,_,A,ae,!1).xAxisLabelArray.shift(),y=v.axisLeft(d).tickFormat(Ee=>Ze(Ee,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-ae:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(ge):y.tickValues(be).ticks(ue/50)},fe=Pe=>{const Ee=e.animation.animationEnabled,we=o.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+c+" .rect").data(pe).enter().append("g").selectAll("rect").data(ve=>ve).enter().append("rect").attr("class","rect").attr("stroke",e.bins.binsBorderVisibility&&e.bins.binsBorderColor).attr("stroke-width",e.bins.binsBorderVisibility&&e.bins.binsBorderThickness).attr("stroke-opacity",e.bins.binsBorderVisibility&&e.bins.binsBorderOpacity).attr("x",0).attr("y",ve=>{const F=d(ve.x0),le=d(ve.x1);return Math.min(F,le)}).attr("height",ve=>{const F=d(ve.x0),le=d(ve.x1),he=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(le-F)-he)}).attr("width",0).style("fill",ve=>ve.color!==Re.white?ve.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(ve,F)=>{yt([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():F.properties?.currentMeasure?F.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${F.x0}-${F.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:Ze(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(F.length/m[0].data.length):F.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,ve)}).on("mouseout",ot);(Ee?we.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):we).attr("width",ve=>i(ve.length)),o.selectAll(".parentGroup").raise()},$e=Pe=>{ae=Q-Pe.left-Pe.right,ue=G-Pe.bottom-Pe.top},Ue=(Pe,Ee,we,Ce,ve)=>{if(!e.plotArea.fitChart){const F=Pe[0].data.length-re,le=Ee-20;a=K.dimensionList.slice(N,N+re),m=JSON.parse(JSON.stringify(Pe)),m.forEach((O,X)=>m[X].data=O.data.filter(H=>a.includes(H.dimension))),we.append("rect").attr("x",Ce.left).attr("y",le).attr("width",ve).attr("height",8).attr("fill","#ddd").attr("rx",4);const he=ve*re/K.dimensionList.length,te=we.append("rect").attr("x",Ce.left).attr("y",le).attr("width",he).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",O=>{let X=Math.min(Math.max(O.x,Ce.left),Ce.left+ve-he);te.attr("x",X),N=Math.round((X-Ce.left)/(ve-he)*F),a=K.dimensionList.slice(N,N+re),m=JSON.parse(JSON.stringify(Pe)),m.forEach((H,E)=>m[E].data=H.data.filter(Y=>a.includes(Y.dimension))),ye(),Ye()}));we.on("wheel",O=>{O.preventDefault();const X=Math.abs(O.deltaX)>Math.abs(O.deltaY)?O.deltaX:O.deltaY;N+=X>0?1:-1,N=Math.max(0,Math.min(N,F));const H=Ce.left+(ve-he)*N/F;te.attr("x",H),m=JSON.parse(JSON.stringify(Pe)),m.forEach((E,Y)=>m[Y].data=E.data.filter(ee=>a.includes(ee.dimension))),ye(),Ye()})}Ye()},Ye=()=>{Jt(o,e,h,g,y,ue),fe()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"className",ref:l,id:c,style:{width:"100%",height:"100%"}})})},br=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l,onElementClick:s,vfxPickModeActive:p})=>{const f=crypto.randomUUID(),L=0,u=se.AreaChart,S=Me.useRef(),b=Me.useRef(s);b.current=s;const _=Me.useRef(p);_.current=p;const A=Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled;let B=!1;const U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,V=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye,Pe=[],Ee=0,we,Ce,ve,F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(I){Ae("Linechart","createLineChart",I)}},[e]);const le=()=>{({formatOptions:e,svg:T,width:o,height:d}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:G,maxNumberForSecondaryAxis:M,customYaxisMaxValue:P,secondaryCustomYaxisMaxValue:V}=Et(e,F.yMinLeft,F.yMaxLeft,F.yMinRight,F.yMaxRight),{margin:$,yLabel:Z,xLabel:ce,yTitle:ne,xTitle:ae,dimensionHeightWidthArray:ue,chartTitleHeight:ge,secondaryAxisTitleWidth:be,legendMargin:pe,secondaryYLabel:Q,visibleBars:we,columnWidth:Ce,scrollbarVisible:ve}=Ct(o,d,G,M,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,U,t,g,F),Y($),{dataTable:i,dataTableHeight:y}=aa(e,Z,ne,A,F.dimensionList,r),g&&(i=[],y=0),Mt(T,o,d,e),a=Ft(T,$),vt(a,e,y,h,k,u,f),te(),X(),g?(ra(e,a,Z,k,h,fe),B&&pi(e,a,Q,$e,h)):(Jt(a,e,y,Z,Le,k),B&&hi(a,e,y,Q,Se,k,h)),wt(e,g,T,$,ce,d,ae,F.chartType,Z,h,k),Dt(k,e,y,g,T,$,ne,Z,h),Ht(T,B,$,e,y,k,h,Q,be,g),Vt(T,e,o,ge),Pt(d,T,ue,ge,o,pe,e,A,f,y,$,ct.areaWithLine,u,n),Gt(A,d,o,T,$,h,ve,we,F,Ee,!1,ee,g)},he=()=>{const I=[],w=[];let C=[],q=-1/0,J=1/0,j=-1/0,Te=1/0;e.plotArea.hideZeroValues&&(F.hideZeroValues=!0,A.forEach(xe=>{xe.data=xe.data.filter(de=>de.value!==0)})),A.forEach(xe=>{w.push(xe.properties.alias?xe.properties.alias:xe.legend),xe.data.forEach(de=>{I.push(de),xe.properties.axis==="Secondary"?(B=!0,j=Math.max(j,de.value),Te=Math.min(Te,de.value)):(q=Math.max(q,de.value),J=Math.min(J,de.value))})}),F.chartData=I,F.legendList=w,F.yMaxLeft=q,F.yMinLeft=J>0?0:J,F.yMaxRight=j,F.yMinRight=Te>0?0:Te,C=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(xe=>xe):F.dimensionList,F.dimensionList.forEach((xe,de)=>{F.formattedDimensionListMap.set(xe,C[de])}),Pe=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Ye=F.dimensionList:Ye=F.dimensionList.slice(Ee,Ee+we)},te=()=>{let I=dt(P||F.yMaxLeft,F.yMinLeft,k,e,F,W,P,g,h).yAxisLabelArray;F.yMaxLeft=I[I.length-1],F.yMinLeft=I[0];const w=g?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const C=v.scaleLinear().domain([F.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:F.yMinLeft<0?F.yMinLeft*1.1:F.yMinLeft*.9,F.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:F.yMaxLeft*1.1]).range(w);g?De=C:m=C}if(B){const C=v.scaleLinear().domain([F.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:F.yMinRight*1.1,F.yMaxRight<=0?V||0:V||F.yMaxRight*1.1]).range(w);g?ye=C:N=C}if(K=g?[k,0]:[0,h],!g&&e.seriesLabel.seriesLabelVisibility){let C=la(h,m,e,Pe,void 0,B,k);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,h-C.heightWidth[0]]:K=[C.heightWidth[0],h]}},O=()=>{const I=v.scalePoint().domain(Ye).range(K).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);g?ie=I:re=I},X=()=>{H();{let I=dt(P||F.yMaxLeft,F.yMinLeft,k,e,F,W,P,g,h);g?fe=v.axisBottom(De).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Le=v.axisLeft(m).tickFormat(w=>Ze(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,h,me)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/30).tickPadding(8).tickSizeOuter(0)}if(B){let I=dt(V||F.yMaxRight,D||F.yMinRight,k,e,F,D,V);g?$e=v.axisTop(ye).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??h/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-k:0).tickSizeOuter(0):Se=v.axisRight(N).tickFormat(w=>Ze(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(I.autoLabelFlag?void 0:I.yAxisLabelArray).ticks(I.customTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-h:0).tickSizeOuter(0)}},H=()=>{g?Ue=v.axisLeft(ie).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Ye,k)):ze=v.axisBottom(re).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(bt(Ye,h))},E=I=>{const w=e.plotArea.plotAreaHideLineAndMarkers;I.forEach(Fe=>{Fe.data.forEach(Ve=>{Ve.hideZero=Fe.properties.hideZeroValues,Ve.axis=Fe.properties.axis})});const C=g?v.area().y(Fe=>{const Ve=ie(Fe.dimension);return Ve??0}).x0(Fe=>Fe.axis===Qe.primary?De(0):ye(0)).x1(Fe=>Fe.axis===Qe.primary?De(Fe.value):ye(Fe.value)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)):v.area().x(Fe=>re(Fe.dimension)?re(Fe.dimension):null).y0(Fe=>Fe.axis===Qe.primary?m(0):N(0)).y1(Fe=>Fe.axis===Qe.primary?m(Fe.value):N(Fe.value)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)),q=g?v.area().y(Fe=>{const Ve=ie(Fe.dimension);return Ve??0}).x0(()=>De(0)).x1(()=>De(0)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)):v.area().x(Fe=>re(Fe.dimension)?re(Fe.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(Fe=>Fe.hideZero?!!Fe.value:!0).curve(mt(e)),J=e.animation.animationEnabled;let j=a.selectAll(".parentGroup").data([I]),Te=a.append("g").attr("class","focusClass");j=j.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${f}-clip)`).merge(j);let xe=j.selectAll(".area-group").data(Fe=>Fe),de=xe.enter().append("g").attr("class","area-group");de.append("path").attr("class","area parentGroup").attr("fill",Fe=>Fe.properties.color!==Re.white?Fe.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",Fe=>(Fe.properties?.alias||Fe.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",Fe=>q(Fe.data)).attr(lt.SeriesId,Fe=>Fe.properties.legendUniqueId).attr(lt.DimValue,Fe=>Fe.properties.alias||Fe.properties.name||"").on("click",Tt(_,b,(Fe,Ve)=>({seriesId:Ve.properties.legendUniqueId,dimValue:Ve.properties.alias||Ve.properties.name||"",legendUniqueId:Ve.properties.legendUniqueId,seriesDisplayName:Ve.properties.alias||Ve.properties.name||""}))).each(function(Fe){J?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(Fe.data)):v.select(this).attr("d",C(Fe.data))}),de.merge(xe).each(function(Fe){const Ve=v.select(this);Ve.selectAll("path.visibleLine").data([Fe]).join("path").attr("class","visibleLine parentGroup").attr("d",ke=>J?q(ke.data):C(ke.data)).attr("stroke",ke=>ke.properties.areaBorderColor!==Re.white?ke.properties.areaBorderColor:"none").attr("stroke-dasharray",ke=>{const Be=parseInt(ke.properties.lineWidth);switch(ke.properties.lineStyle){case pt.dotted:return`0,${Be+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",ke=>ke.properties.lineStyle===pt.dotted?ya.round:ya.butt).attr("stroke-width",ke=>w?ke.properties.lineStyle!==pt.none&&e.plotArea.plotAreaHideLineAndMarkers?ke.properties.lineWidth:"0":0).attr("fill","none").each(function(ke){J&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(ke.data))}),Ve.selectAll("path.hoverLine").data([Fe]).join("path").attr("class","hoverLine").attr("d",ke=>C(ke.data)).attr("fill",Re.transparent).attr("stroke","none").style("pointer-events","all").raise(),bi(e,j,Te,Ye,I,g?ie:re,g?De:m,u,!1,g)}),xe.exit().remove(),Da(j,I,u,g?ie:re,g?De:m,g?ye:N,null,e,F,V,D,W,P,!1,l,g),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},Y=I=>{h=o-I.left-I.right,k=d-I.bottom-I.top},ee=(I,w,C)=>{Pe=w,Ye=I,we=C,z()},z=()=>{if(O(),H(),Ra(A,g?ie:re,g?De:m,g?ye:N,$,xt,[],[],e,u,d,o,h,Ye,k,f,T,x,void 0,void 0,c,!1,g),g?na(e,a,ce,k,h,Ue,$e,De,F.yMaxLeft,Ye,u,t,o,ue,Ce,ie):Ot(a,F,ce,e,y,m,ze,ue,d,L,t,h,k,Ye,re),E(Pe),!g){let I=la(h,m,e,Pe,void 0,B,k).labelArray;Ga(e,a,I),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,T,a,i,L,m,re,void 0,void 0,void 0,y,u,e,Z,ne,Ye,h,K,F.formattedDimensionListMap,f,$,k))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},gr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.StackAreaChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse()||[],R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M=new Map,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue,Ye=[],Pe=0,Ee,we,Ce,ve=[];const F=!1;let le={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{he()}catch(C){Ae("StackAreaChart","createAreaChart",C)}},[e]);const he=()=>{({formatOptions:e,svg:T,width:o,height:d}=St(S,e)),te(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:Q,maxNumberForSecondaryAxis:G}=Et(e,le.yMinLeft,le.yMaxLeft,le.yMinRight,le.yMaxRight),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:Ee,columnWidth:we,scrollbarVisible:Ce}=Ct(o,d,Q,G,le.yMaxLeft,e,le.legendList,le.dimensionList,le.yMaxRight,B,F,t,g,le),ee(V),{dataTable:i,dataTableHeight:y}=aa(e,$,ce,A,le.dimensionList,r),g&&(i=[],y=0),Mt(T,o,d,e),a=Ft(T,V),vt(a,e,y,h,k,u,f),O(),H(),g?ra(e,a,$,k,h,ye):Jt(a,e,y,$,Le,k),wt(e,g,T,V,Z,d,ne,le.chartType,$,h,k),Dt(k,e,y,g,T,V,ce,$,h),Ht(T,B,V,e,y,k,h,pe,ge,g),Vt(T,e,o,ue),Pt(d,T,ae,ue,o,be,e,[...A].reverse(),f,y,V,ct.areaWithLine,u,n),Gt(A,d,o,T,V,h,Ce,Ee,le,Pe,!1,z,g)},te=()=>{const C=[],q=[];e.plotArea.hideZeroValues&&(le.hideZeroValues=!0,A.forEach(Fe=>{Fe.data=Fe.data.filter(Ve=>Ve.value!==0)})),A.forEach((Fe,Ve)=>{const ke=`${Ve}~$~${Fe.properties.alias}`;Fe.properties.legend=ke,q.push(ke);for(const Be of Fe.data)C.push(Be)}),le.chartData=C,le.legendList=q,Ye=JSON.parse(JSON.stringify(A));let J=At(le.dimensionList,A,F);e.plotArea.fitChart?Ue=le.dimensionList:(Ue=le.dimensionList.slice(Pe,Pe+Ee),Ye.forEach((Fe,Ve)=>Ye[Ve].data=Fe.data.filter(ke=>Ue.includes(ke.dimension))));const j=v.stack().keys(le.legendList).offset(v.stackOffsetNone)(J);w();let Te=1/0,xe=-1/0;for(const Fe of j)for(const[Ve,ke]of Fe)Te=Math.min(Te,Ve),xe=Math.max(xe,ke);le.yMinLeft=Te>0?0:Te,le.yMaxLeft=xe;let de=t?ft(e.xAxisLabel.xAxisNumberFormat,le.dimensionList).map(Fe=>Fe):le.dimensionList;le.dimensionList.forEach((Fe,Ve)=>{le.formattedDimensionListMap.set(Fe,de[Ve])})},O=()=>{let C=dt(W||le.yMaxLeft,le.yMinLeft,k,e,le,U,W,g,h).yAxisLabelArray;le.yMaxLeft=C[C.length-1],le.yMinLeft=C[0];const q=g?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const J=v.scaleLinear().domain([le.yMinLeft>=0?U!==void 0&&!Number.isNaN(U)?U:0:le.yMinLeft<0?le.yMinLeft*1.1:le.yMinLeft*.9,le.yMaxLeft<=0?0:W!==void 0&&!Number.isNaN(W)?W:le.yMaxLeft*1.1]).range(q);g?ie=J:m=J}if(K=g?[k,0]:[0,h],!g&&e.seriesLabel.seriesLabelVisibility){let J=la(h,m,e,A,void 0,B,k,!0);J.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=J.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?K=[0,h-J.heightWidth[0]]:K=[J.heightWidth[0],h]}},X=()=>{const C=v.scalePoint().domain(Ue).range(K).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);g?Se=C:re=C},H=()=>{{let C=dt(W||le.yMaxLeft,le.yMinLeft,k,e,le,U,W,g,h);g?ye=v.axisBottom(ie).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Le=v.axisLeft(m).tickFormat(q=>Ze(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Rt(e,h,me)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},E=()=>{g?$e=v.axisLeft(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(Ue,k)):ze=v.axisBottom(re).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(bt(Ue,h))},Y=C=>{const q=e.animation.animationEnabled,J=e.plotArea.plotAreaHideLineAndMarkers;C.forEach(ke=>{ke.data.forEach(Be=>{Be.hideZero=ke.properties.hideZeroValues,Be.axis=ke.properties.axis})});const j=g?v.area().y(ke=>{const Be=Se(ke.data.dimension);return Be??0}).x0(ke=>ie(ke[0])).x1(ke=>ie(ke[1])).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e)):v.area().x(ke=>re(ke.data.dimension)?re(ke.data.dimension):null).y0(ke=>m(ke[0])).y1(ke=>m(ke[1])).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e)),Te=g?v.area().y(ke=>{const Be=Se(ke.data.dimension);return Be??0}).x0(()=>ie(0)).x1(()=>ie(0)).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e)):v.area().x(ke=>re(ke.data.dimension)?re(ke.data.dimension):null).y0(()=>m(0)).y1(()=>m(0)).defined(ke=>ke.data.hideZero?!!ke.data.key:!0).curve(mt(e));let xe=a.selectAll(".lineGroup").data([ve]),de=a.append("g").attr("class","focusClass");xe=xe.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${f}-clip)`).merge(xe);let Fe=xe.selectAll(".area-group").data(ke=>ke),Ve=Fe.enter().append("g").attr("class",ke=>"area-group "+ke.key.replace(/ /g,"-"));Ve.append("path").attr("hoverId",ke=>(C[ke.index].properties.alias||C[ke.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",ke=>ke.color!==Re.white?ke.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",ke=>Te(ke)).attr(lt.SeriesId,ke=>A[ke.index]?.properties?.legendUniqueId??ke.key).attr(lt.DimValue,ke=>A[ke.index]?.properties?.alias||A[ke.index]?.properties?.name||"").on("click",Tt(_,b,(ke,Be)=>{const at=A[Be.index]?.properties?.legendUniqueId??Be.key,it=A[Be.index]?.properties?.alias||A[Be.index]?.properties?.name||"";return{seriesId:at,dimValue:it,legendUniqueId:at,seriesDisplayName:it}})).each(function(ke){q?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j(ke)):v.select(this).attr("d",j(ke))}),Ve.merge(Fe).each(function(ke,Be){const at=v.select(this);at.selectAll("path.visibleLine").data([ke]).join("path").attr("class","visibleLine parentGroup").attr("d",it=>q?Te(it):j(it)).attr("stroke",it=>it.color!==Re.white?A[Be].properties.areaBorderColor:"none").attr("stroke-dasharray",it=>{const ga=parseInt(A[Be].properties.lineWidth.toString());switch(A[Be].properties.lineStyle){case pt.dotted:return`0,${ga+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[Be]?.properties?.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",()=>J?A[Be].properties.lineStyle!==pt.none?A[Be].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(it){q&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j(it))}),at.selectAll("path.hoverLine").data([ke]).join("path").attr("class","hoverLine").attr("d",it=>j(it)).attr("fill",Re.transparent).attr("stroke","none").style("pointer-events","all").raise(),T.selectAll('[hoverId="'+(A[ke.index].properties.alias||A[ke.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),Fe.exit().remove(),bi(e,xe,de,Ue,C,g?Se:re,g?ie:m,u,!0,g),Da(xe,C,u,g?Se:re,g?ie:m,g?De:N,null,e,le,D,P,U,W,!1,p,g),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ee=C=>{h=o-C.left-C.right,k=d-C.bottom-C.top},z=(C,q,J)=>{Ye=q,Ue=C,Ee=J,ai(r,M,Ue),w(),I()},I=()=>{if(X(),E(),g?na(e,a,Z,k,h,$e,fe,ie,le.yMaxLeft,Ue,u,t,o,ae,we,Se):Ot(a,le,Z,e,y,m,ze,ae,d,L,t,h,k,Ue,re),Y(Ye),za(ve,g?Se:re,g?ie:m,g?De:N,V,xt,[],[],e,u,d,o,h,Ue,k,f,T,x,y,c,g),ti(M,g?Se:re,g?ie:m,V,xt,[],e,u,d,o,T,c,g),!g){let C=la(h,m,e,Ye,void 0,B,k,!0).labelArray;Ga(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,T,a,i,L,m,re,void 0,void 0,void 0,y,u,e,$,ce,le.dimensionList,h,K,le.formattedDimensionListMap,f,V,k))}},w=()=>{let C=At(Ue,Ye,F);ve=v.stack().keys(le.legendList).offset(v.stackOffsetNone)(C),Ye.forEach((J,j)=>J.data.forEach((Te,xe)=>{Te[0]=ve[j][xe][0],Te[1]=ve[j][xe][1]}));let q=e.annotation.annotationSetLabelColor;ve.forEach((J,j)=>J.forEach(Te=>{Te.key=J.key,J.color=JSON.parse(JSON.stringify(A[j].properties.color)),Te.data.labelPosition=A[j].properties.dataLabelPosition,Te.data.labelColor=q=="2"?JSON.parse(JSON.stringify(A[j].properties.color)):A[j].properties.labelColor,Te.hideZero=JSON.parse(JSON.stringify(A[j].properties.hideZeroValues)),Te.properties=A[j].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},Ar=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=crypto.randomUUID(),L=0,u=se.NormalizedStackAreaChart,S=Me.useRef(),b=Me.useRef(l);b.current=l;const _=Me.useRef(s);_.current=s;const A=Lt(r.ChartData,r.DimensionList)?.reverse()||[],R=r.DimensionList,g=!!e.swapAxis?.swapAxisEnabled,B=!1;let U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,P=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze,Se,ie,De,ye,fe,$e,Ue=[],Ye=0,Pe,Ee,we,Ce=[];const ve=!0;let F={dimensionList:R,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{le()}catch(w){Ae("NormalizedLinechart","createLineChart",w)}},[e]);const le=()=>{({formatOptions:e,svg:y,width:k,height:o}=St(S,e)),he(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{margin:V,yLabel:$,xLabel:Z,yTitle:ce,xTitle:ne,dimensionHeightWidthArray:ae,chartTitleHeight:ue,secondaryAxisTitleWidth:ge,legendMargin:be,secondaryYLabel:pe,visibleBars:Pe,columnWidth:we,scrollbarVisible:Ee}=Ct(k,o,Q,G,F.yMaxLeft,e,F.legendList,F.dimensionList,F.yMaxRight,B,ve,t,g,F),Y(V),{dataTable:d,dataTableHeight:i}=aa(e,$,ce,A,F.dimensionList,r),g&&(d=[],i=0),Mt(y,k,o,e),T=Ft(y,V),vt(T,e,i,M,h,u),te(),X(),g?ra(e,T,$,h,M,De):Jt(T,e,i,$,me,h),wt(e,g,y,V,Z,o,ne,F.chartType,$,M,h),Dt(h,e,i,g,y,V,ce,$,M),Ht(y,B,V,e,i,h,M,pe,ge,g),Vt(y,e,k,ue),Pt(o,y,ae,ue,k,be,e,[...A].reverse(),f,i,V,ct.areaWithLine,u,n),Gt(A,o,k,y,V,M,Ee,Pe,F,Ye,!1,ee,g)},he=()=>{const w=[],C=[];e.plotArea.hideZeroValues&&(F.hideZeroValues=!0,A.forEach(xe=>{xe.data=xe.data.filter(de=>de.value!==0)})),A.forEach((xe,de)=>{const Fe=`${de}~$~${xe.properties.alias}`;xe.properties.legend=Fe,C.push(Fe);for(const Ve of xe.data)w.push(Ve)}),F.chartData=w,F.legendList=C,Ue=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?$e=F.dimensionList:($e=F.dimensionList.slice(Ye,Ye+Pe),Ue.forEach(xe=>{xe.data=xe.data.filter(de=>$e.includes(de.dimension))}));const q=At(F.dimensionList,A,ve),J=v.stack().keys(F.legendList).offset(v.stackOffsetNone)(q);I();let j=1/0;for(const xe of J)for(const[de]of xe)j=Math.min(j,de);F.yMinLeft=j>0?0:j,F.yMaxLeft=1;const Te=t?ft(e.xAxisLabel.xAxisNumberFormat,F.dimensionList).map(xe=>xe):F.dimensionList;F.formattedDimensionListMap=new Map(F.dimensionList.map((xe,de)=>[xe,Te[de]]))},te=()=>{const w=g?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const C=v.scaleLinear().domain([F.yMinLeft<0?-1:0,1]).range(w);g?Se=C:a=C}if(re=g?[h,0]:[0,M],!g&&e.seriesLabel.seriesLabelVisibility){let C=la(M,a,e,A,void 0,B,h,!0);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(K=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?re=[0,M-C.heightWidth[0]]:re=[C.heightWidth[0],M]}},O=()=>{const w=v.scalePoint().domain($e).range(re).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);g?ze=w:N=w},X=()=>{g?De=v.axisBottom(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).ticks(i>0?(M-i)/80:M/80,"%").tickPadding(8).tickSizeOuter(0):me=v.axisLeft(a).tickSize(Rt(e,M,K)).ticks(i>0?(h-i)/80:h/80,"%").tickPadding(8).tickSizeOuter(0)},H=()=>{g?fe=v.axisLeft(ze).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt($e,h)):Le=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(bt($e,M))},E=w=>{const C=e.animation.animationEnabled,q=e.plotArea.plotAreaHideLineAndMarkers;Ce.forEach((Ve,ke)=>Ve.forEach((Be,at)=>{const it=Be.data.total;w[ke].data[at]&&(w[ke].data[at][0]=Be[0]=it===0?0:Be[0]/it,w[ke].data[at][1]=Be[1]=it===0?0:Be[1]/it)})),w.forEach(Ve=>{Ve.data.forEach(ke=>{ke.hideZero=Ve.properties.hideZeroValues,ke.axis=Ve.properties.axis})});const J=g?v.area().y(Ve=>{const ke=ze(Ve.data.dimension);return ke??0}).x0(Ve=>Se(Ve[0])).x1(Ve=>Se(Ve[1])).defined(Ve=>Ve.data.hideZero?!!Ve[0]:!0).curve(v.curveLinear):v.area().x(Ve=>N(Ve.data.dimension)?N(Ve.data.dimension):null).y0(Ve=>a(Ve[0])).y1(Ve=>a(Ve[1])).defined(Ve=>Ve.data.hideZero?!!Ve[0]:!0).curve(v.curveLinear),j=g?v.area().y(Ve=>{const ke=ze(Ve.data.dimension);return ke??0}).x0(()=>Se(0)).x1(()=>Se(0)).defined(Ve=>Ve.data.hideZero?!!Ve.data.key:!0).curve(mt(e)):v.area().x(Ve=>N(Ve.data.dimension)?N(Ve.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined(Ve=>Ve.data.hideZero?!!Ve.data.key:!0).curve(mt(e));let Te=T.selectAll(".lineGroup").data([Ce]),xe=T.append("g").attr("class","focusClass");Te=Te.enter().append("g").attr("class","areas lineGroup").merge(Te);let de=Te.selectAll(".area-group").data(Ve=>Ve),Fe=de.enter().append("g").attr("class",Ve=>"area-group "+Ve.key.replace(/ /g,"-"));Fe.append("path").attr("hoverId",Ve=>(w[Ve.index]?.properties?.alias||w[Ve.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ve=>Ve.color!==Re.white?Ve.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Ve=>j(Ve)).attr(lt.SeriesId,Ve=>A[Ve.index]?.properties?.legendUniqueId??Ve.key).attr(lt.DimValue,Ve=>A[Ve.index]?.properties?.alias||A[Ve.index]?.properties?.name||"").on("click",Tt(_,b,(Ve,ke)=>{const Be=A[ke.index]?.properties?.legendUniqueId??ke.key,at=A[ke.index]?.properties?.alias||A[ke.index]?.properties?.name||"";return{seriesId:Be,dimValue:at,legendUniqueId:Be,seriesDisplayName:at}})).each(function(Ve){const ke=v.select(this);C?ke.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",J(Ve)):ke.attr("d",J(Ve))}),Fe.merge(de).each(function(Ve,ke){const Be=v.select(this);Be.selectAll("path.visibleLine").data([Ve]).join("path").attr("class","visibleLine parentGroup").attr("d",at=>C?j(at):J(at)).attr("stroke",at=>at.color!==Re.white?A[ke].properties.areaBorderColor:"none").attr("stroke-dasharray",at=>{const it=parseInt(A[ke].properties.lineWidth.toString());switch(A[ke].properties.lineStyle){case pt.dotted:return`0,${it+2}`;case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[ke]?.properties?.lineStyle===pt.dotted?ya.round:"").attr("stroke-width",()=>q?A[ke].properties.lineStyle!==pt.none?A[ke].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(at){C&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",J(at))}),Be.selectAll("path.hoverLine").data([Ve]).join("path").attr("class","hoverLine").attr("d",at=>J(at)).attr("fill",Re.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+gi((w[Ve.index]?.properties?.alias||w[Ve.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),de.exit().remove(),bi(e,Te,xe,$e,w,g?ze:N,g?Se:a,u,!0,g),T.selectAll(".parentGroup").raise(),T.selectAll(".hoverLine").raise(),Da(Te,w,u,g?ze:N,g?Se:a,g?ie:m,null,e,F,D,P,U,W,!0,p,g),!g&&e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,u,e,$,ce,F.dimensionList,M,re,F.formattedDimensionListMap,f,V,h))},Y=w=>{M=k-w.left-w.right,h=o-w.bottom-w.top},ee=(w,C,q)=>{Ue=C,$e=w,Pe=q,I(),z()},z=()=>{if(O(),H(),g?na(e,T,Z,h,M,fe,ye,Se,F.yMaxLeft,$e,u,t,k,ae,we,ze):Ot(T,F,Z,e,i,a,Le,ae,o,L,t,M,h,$e,N),E(Ue),za(Ce,g?ze:N,g?Se:a,g?ie:m,V,xt,[],[],e,u,o,k,M,$e,h,f,y,x,i,c,g),!g){let w=la(M,a,e,Ue,void 0,B,h,!0).labelArray;Ga(e,T,w)}},I=()=>{let w=At($e,Ue,ve);Ce=v.stack().keys(F.legendList).offset(v.stackOffsetNone)(w),Ue.forEach((q,J)=>q.data.forEach((j,Te)=>{Ce[J][Te]&&(j[0]=Ce[J][Te][0],j[1]=Ce[J][Te][1])}));let C=e.annotation.annotationSetLabelColor;Ce.forEach((q,J)=>q.forEach(j=>{j.key=q.key,q.color=JSON.parse(JSON.stringify(A[J].properties.color)),j.data.labelPosition=A[J].properties.dataLabelPosition,j.data.labelColor=C=="2"?JSON.parse(JSON.stringify(A[J].properties.color)):A[J].properties.labelColor,j.hideZero=JSON.parse(JSON.stringify(A[J].properties.hideZeroValues)),j.properties=A[J].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:f,style:{width:"100%",height:"100%"}})})},li={left:"Left",right:"Right",center:"Center"},Ut={left:"left",right:"right",top:"top",bottom:"bottom"},Za={solid:"solid",dashed:"Dashed",dotted:"Dotted"},ri={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},ha={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},sl="PieFamilyCommonFunctions.ts",Lr=(t,e,r,c)=>{try{let x=t.total.totalPosition,n=t.total.totalAlignment,l=t.legends.legendPosition,s=0;switch(x){case Fa.top:switch(s=l=="Top"?35:0,n){case Bt.start:return{x:5,y:e+s+10};case Bt.middle:return{x:r/2,y:e+s+10};case Bt.end:return{x:r-20,y:e+s+10}}break;case Fa.bottom:switch(s=l=="Bottom"?30:0,n){case Bt.start:return{x:10,y:c-s-10};case Bt.middle:return{x:r/2,y:c-s-10};case Bt.end:return{x:r-20,y:c-s-10}}break}}catch(x){Ae(sl,"getTotalValueCords",x)}},Si=(t,e,r,c,x,n)=>{try{if(t.total&&t.total.totalVisibility){let l=t.total.totalFontStyle,s=t.total.totalAlignment,p=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":qe(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),f=Lr(t,r,x,n);const L=c.append("g").attr("transform",`translate(${f.x}, ${f.y})`).style("user-select","none");L.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${p}`:p).style("fill",t.total.totalColor!==Re.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",l.includes(oe.italic)?oe.italic:"").style("text-decoration",l.includes(oe.underline)?oe.underline:"").style("font-weight",l.includes(oe.bold)?oe.bold:"").attr("text-anchor",s===Bt.start?"start":s===Bt.middle?"middle":s===Bt.end?"end":""),t.animation?.animationEnabled&&L.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(et[t.animation.animationEffect]).attr("opacity",1)}}catch(l){Ae(sl,"drawTotalValue",l)}},Ba="PieChart.tsx",mr=({data:t,formatOptions:e,chartId:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=Me.useRef(),L=Me.useRef(l);L.current=l;const u=Me.useRef(s);u.current=s;const S=Lt(t.ChartData);let b,_,A,R=40,g=jt,B=[0,0],U,W,P,D,V,$,Z,ce,ne=!1;Me.useEffect(()=>{ae()},[e]);const ae=()=>{({chartFormatOptions:b,svg:V,width:A,height:_}=qt(f,e)),ue(),B=Ua(b,S),{margins:g,innerHeight:U,innerWidth:W,legendListWidth:ce,chartTitleHeight:R}=$a(b,A,_,B,g),ge(),Xt(f,A,_,b),D=oa(V,g),Zt(f,R,A,b),Ya(b,V,S,A,_,ce,R,r,g,ct.circle,void 0,n),be(),pe(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?rl(xt,$,b,Q(),se.PieChart,A,_,D,Math.min(U*.5,W*.5),c,x):M(),Si(b,Z,R,V,A,_)},ue=()=>{try{Z=0,t.ChartData.forEach(h=>{h.properties.dataLabelPosition=="2"&&(ne=!0),Z+=h.data[0].value})}catch(h){Ae(Ba,"loopOverSeriesData",h)}},ge=()=>{try{P=Math.min(U*.5,W*.5),ne&&(P=P*.9)}catch(h){Ae(Ba,"defineChartRadius",h)}},be=()=>{try{let h=rt(b.plotArea.rotation);const k=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;$=v.pie().value(i=>Math.abs(k?100:i.data[0].value)).startAngle((h??0)*(Math.PI/180)%360).endAngle(((h??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,y)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:P,depth:2}))}catch(h){Ae(Ba,"initPieChartData",h)}},pe=()=>{try{const h=v.arc().innerRadius(0).outerRadius(P),k=v.arc().innerRadius(0).outerRadius(P+10),o=D.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${Q()}`).selectAll("path").data($).enter().append("path").attr("class",d=>"path").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",d=>d.data.properties.color!==Re.white?d.data.properties.color:"none").attr(lt.SeriesId,d=>d.data.properties.legendUniqueId??d.data.properties.name??"").attr(lt.DimValue,d=>d.data.properties.alias||d.data.legend||"").on("click",Tt(u,L,(d,i)=>({seriesId:i.data.properties.legendUniqueId??i.data.properties.name??"",dimValue:i.data.properties.alias||i.data.legend||"",legendUniqueId:i.data.properties.legendUniqueId??i.data.properties.name??"",seriesDisplayName:i.data.properties.alias||i.data.properties.name||""}))).on("mouseover.arc",function(d){v.select(this).transition().duration(100).attr("d",k)}).on("mousemove. ",d=>{yt([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/Z)*100).toFixed(rt(b.toolTip.toolTipDecimalPrecision))+"%":qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],b,void 0,d.currentTarget.__data__.data.properties,gt(p,String(d.currentTarget.__data__.data.legend??""),d.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(d){v.select(this).transition().duration(100).attr("d",h),ot()});b.animation.animationEnabled?o.transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attrTween("d",function(d){const i=v.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return y=>h(i(y))}):o.attr("d",d=>h(d))}catch(h){Ae(Ba,"drawPieChart",h)}},Q=()=>{try{return`translate(${W/2},${U/2})`}catch(h){return Ae(Ba,"getPiePosition",h),""}},G=(h,k)=>{try{if(k)return"translate(0 0)";{const o=(h.startAngle+h.endAngle)/2,d=Math.cos(o-Math.PI/2)*(P*.65),i=Math.sin(o-Math.PI/2)*(P*.65);let y=o*180/Math.PI%360,T=0;return y>180&&y<360?T=90:T=-90,y+=T,`translate(${d},${i}) rotate(${y})`}}catch(o){return Ae(Ba,"getDataLabelTransformString",o),""}},M=()=>{try{if(b.plotArea.dataLabels){const h=$&&$.length===1;D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.labelFontSize??11).attr("fill",d=>d.data.properties?.labelFontColor??Re.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",d=>d.data.properties?.labelFont??tt).attr("transform",d=>G(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.09&&e.plotArea.hideInsignificantValue?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(d=>{const{plotArea:i}=b;return i.dataLabelName?d.data.properties?.alias||d.data.legend:""}),D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="1"),b,d=>d.data.data[0].value)).enter().append("text").attr("hoverId",d=>(d.data?.properties?.alias||d.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",d=>d.data.properties?.valueFontSize??11).attr("fill",d=>d.data.properties?.valueFontColor??Re.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??tt).attr("transform",d=>G(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(b.plotArea.dataLabelValue){const i=d.data.data[0].value;return b.plotArea.dataLabelValue&&i!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/Z)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&i!==void 0?v.format(".2s")(i):""});let k=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>1?d.y1-1+P/7:0).outerRadius(d=>d.depth>1?d.y1-1+P/7:0),o=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>2?d.y0:0).outerRadius(d=>d.y1+P/1.5);D.selectAll("polyline.pie-label-connector").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",Q()).style("stroke",d=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Za.solid?0:b.connector.connectorStyle===Za.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",d=>{const i=o.centroid(d),y=k.centroid(d);let T=d.x0+(d.x1-d.x0)/2;T=T%(2*Math.PI);const a=P*1.1*(T<Math.PI?1:-1),m=y[1];return[i,y,[a,m]].map(N=>N.join(",")).join(" ")}),D.append("g").attr("class","pie-label-group").attr("transform",Q()).selectAll("foreignObject").data(Yt($.filter(d=>d.data.properties.dataLabelPosition=="2"),b,d=>d.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",d=>{let i=d.x0+(d.x1-d.x0)/2;i=i%(2*Math.PI);const T=i<Math.PI?0:-80;return P*1.1*(i<Math.PI?1:-1)+T}).attr("y",d=>k.centroid(d)[1]-30).append("xhtml:div").attr("hoverId",d=>(d.data.properties.alias||d.data.properties.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(d=>{let i=d.data.data[0].value.toString();d.data.data[0].value!==void 0&&(i=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/Z)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision))+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let y="";return b.plotArea.dataLabelName&&(y+=`<span style="
91
91
  font-size: ${d.data.properties.labelFontSize}px;
92
92
  color: ${d.data.properties.labelFontColor};
93
- font-style: ${d.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:""};
94
- text-decoration: ${d.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:""};
95
- font-weight: ${d.data.properties.labelFontStyle.includes(ne.bold)?ne.bold:""};
93
+ font-style: ${d.data.properties.labelFontStyle.includes(oe.italic)?oe.italic:""};
94
+ text-decoration: ${d.data.properties.labelFontStyle.includes(oe.underline)?oe.underline:""};
95
+ font-weight: ${d.data.properties.labelFontStyle.includes(oe.bold)?oe.bold:""};
96
96
  font-family: ${d.data.properties.labelFont};
97
97
  display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
98
98
  ${d.data.legend}
99
99
  </span>`),b.plotArea.dataLabelValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
100
100
  font-size: ${d.data.properties.valueFontSize}px;
101
101
  color: ${d.data.properties.valueFontColor};
102
- font-style: ${d.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
103
- text-decoration: ${d.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
104
- font-weight: ${d.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
102
+ font-style: ${d.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
103
+ text-decoration: ${d.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
104
+ font-weight: ${d.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
105
105
  font-family: ${d.data.properties.valueFont};
106
106
  display: block;">
107
107
  ${i}
108
108
  </span>`),b.plotArea.plotAreaAbsoluteValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
109
109
  font-size: ${d.data.properties.valueFontSize}px;
110
110
  color: ${d.data.properties.valueFontColor};
111
- font-style: ${d.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
112
- text-decoration: ${d.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
113
- font-weight: ${d.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
111
+ font-style: ${d.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
112
+ text-decoration: ${d.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
113
+ font-weight: ${d.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
114
114
  font-family: ${d.data.properties.valueFont};
115
115
  display: block;">
116
- ${T.format(".2s")(d.data.data[0].value)}
117
- </span>`),y}),b.animation.animationEnabled&&V.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",1)}}catch(p){be(Ea,"drawPieDataLabels",p)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:L,id:r,style:{width:"100%",height:"100%"}})})},Ma="DonutChart.tsx",pr=({data:t,formatOptions:e,chartId:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:x})=>{const L=Te.useRef(),A=Te.useRef(l);A.current=l;const u=Te.useRef(s);u.current=s;const S=bt(t.ChartData);let b,_,g,H=40,D=Ht,j=[0,0],K,J,U,V,N,$,X,se,re=!1,oe;Te.useEffect(()=>{he()},[e]);const he=()=>{({chartFormatOptions:b,svg:oe,width:_,height:g}=Jt(L,e)),Le(),j=Ia(b,S),{margins:D,innerHeight:K,innerWidth:J,legendListWidth:N,chartTitleHeight:H}=Na(b,_,g,j,D),pe(),jt(L,_,g,b),$=la(oe,D),_t(L,H,_,b),Pa(b,oe,S,_,g,N,H,r,D,nt.hollowCircle,!1,n),ue(),O(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?Qi(dt,X,b,q(),le.DonutChart,_,g,$,Math.min(K*.5,J*.5),o,h):p(),C()},Le=()=>{try{se=0,S.forEach(c=>{c.properties.dataLabelPosition=="2"&&(re=!0),se+=c.data[0].value})}catch(c){be(Ma,"loopOverSeriesData",c)}},pe=()=>{try{U=Math.min(K*.4,J*.4),re&&(U=U*.9),V=Math.min(et(b.plotArea.innerRadius)/100*U,U)}catch(c){be(Ma,"defineChartRadius",c)}},ue=()=>{try{let c=et(b.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;X=T.pie().value(f=>Math.abs(d?100:f.data[0].value)).startAngle((c??0)*(Math.PI/180)%360).endAngle(((c??0)+360)*(Math.PI/180)%360)(S)?.map((f,a)=>({...f,x0:f.startAngle,x1:f.endAngle,y0:0,y1:U,depth:2}))}catch(c){be(Ma,"initPieChartData",c)}},O=()=>{try{const c=b.animation.animationEnabled,d=T.arc().innerRadius(V).outerRadius(U),i=T.arc().innerRadius(V).outerRadius(U+10),f=$.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${q()}`).selectAll("path").data(X).enter().append("path").attr("class",a=>"path").attr("hoverId",a=>(a.data?.properties?.alias||a.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",a=>a.data.properties.color!==De.white?a.data.properties.color:"none").attr(Qe.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(Qe.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",At(u,A,(a,m)=>({seriesId:m.data.properties.legendUniqueId??m.data.properties.name??"",dimValue:m.data.properties.alias||m.data.legend||"",legendUniqueId:m.data.properties.legendUniqueId??m.data.properties.name??"",seriesDisplayName:m.data.properties.alias||m.data.properties.name||""}))).each(function(a){const m=a;m._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){c?T.select(this).transition().duration(150).attr("d",i):T.select(this).attr("d",i)}).on("mousemove.text",a=>{ot([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/se)*100).toFixed(et(b.toolTip.toolTipDecimalPrecision))+"%":je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],b,void 0,a.currentTarget.__data__.data.properties,ht(x,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>rt()).on("mouseout.arc",function(){c?T.select(this).transition().duration(150).attr("d",d):T.select(this).attr("d",d)});c?f.transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attrTween("d",function(a){const m=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(P){return d(m(P))}}):f.attr("d",a=>d(a))}catch(c){be(Ma,"drawDonutChart",c)}},q=()=>{try{return`translate(${J/2},${K/2})`}catch(c){return be(Ma,"getPiePosition",c),""}},w=(c,d)=>{try{if(d)return"translate(0 0)";{const i=(c.startAngle+c.endAngle)/2,y=(V+U)/2,f=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let m=i*180/Math.PI%360,P=0;return m>180&&m<360?P=90:P=-90,m+=P,`translate(${f},${a}) rotate(${m})`}}catch(i){return be(Ma,"getDataLabelTransformString",i),""}},p=()=>{try{if(b.plotArea.dataLabels){const c=X&&X.length===1;$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??De.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",y=>y.data.properties?.labelFont??qe).attr("transform",y=>w(y,c)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:f}=b;return f.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.lableFontColor??De.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??qe).attr("fill",y=>y.data.properties?.valueFontColor??De.black).attr("transform",y=>w(y,c)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(b.plotArea.dataLabelValue){const f=y.data.data[0].value;return b.plotArea.dataLabelValue&&f!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(f/se)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision)??0)+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(f):f}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??De.black).attr("fill-opacity",.5).text(y=>{const f=Math.abs(y.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&f!==void 0?T.format(".2s")(f):""});let d=T.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>1?y.y1-1+U/7:0).outerRadius(y=>y.depth>1?y.y1-1+U/7:0),i=T.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>2?y.y0:0).outerRadius(y=>y.y1+U/1.5);$.selectAll("polyline.pie-label-connector").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",q()).style("stroke",y=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Ha.solid?0:b.connector.connectorStyle===Ha.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",y=>{const f=i.centroid(y),a=d.centroid(y);let m=y.x0+(y.x1-y.x0)/2;m=m%(2*Math.PI);const P=U*1.1*(m<Math.PI?1:-1),ie=a[1];return[f,a,[P,ie]].map(Q=>Q.join(",")).join(" ")}),$.append("g").attr("class","pie-label-group").attr("transform",q()).selectAll("foreignObject").data(Rt(X.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",y=>{let f=y.x0+(y.x1-y.x0)/2;f=f%(2*Math.PI);const m=f<Math.PI?0:-80;return U*1.1*(f<Math.PI?1:-1)+m}).attr("y",y=>d.centroid(y)[1]-30).append("xhtml:div").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(y=>{try{let f=y.data.data[0].value.toString();y.data.data[0].value!==void 0&&(f=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/se)*100).toFixed(et(b.plotArea.dataLabelDecimalPrecision))+"%":je(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return b.plotArea.dataLabelName&&(a+=`<span style="
116
+ ${v.format(".2s")(d.data.data[0].value)}
117
+ </span>`),y}),b.animation.animationEnabled&&D.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",1)}}catch(h){Ae(Ba,"drawPieDataLabels",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:f,id:r,style:{width:"100%",height:"100%"}})})},Va="DonutChart.tsx",fr=({data:t,formatOptions:e,chartId:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,onElementClick:l,vfxPickModeActive:s,tooltipFormatter:p})=>{const f=Me.useRef(),L=Me.useRef(l);L.current=l;const u=Me.useRef(s);u.current=s;const S=Lt(t.ChartData);let b,_,A,R=40,g=jt,B=[0,0],U,W,P,D,V,$,Z,ce,ne=!1,ae;Me.useEffect(()=>{ue()},[e]);const ue=()=>{({chartFormatOptions:b,svg:ae,width:_,height:A}=qt(f,e)),ge(),B=Ua(b,S),{margins:g,innerHeight:U,innerWidth:W,legendListWidth:V,chartTitleHeight:R}=$a(b,_,A,B,g),be(),Xt(f,_,A,b),$=oa(ae,g),Zt(f,R,_,b),Ya(b,ae,S,_,A,V,R,r,g,ct.hollowCircle,!1,n),pe(),Q(),b.plotArea.annotationDraggable&&b.plotArea.dataLabels?rl(xt,Z,b,G(),se.DonutChart,_,A,$,Math.min(U*.5,W*.5),c,x):h(),k()},ge=()=>{try{ce=0,S.forEach(o=>{o.properties.dataLabelPosition=="2"&&(ne=!0),ce+=o.data[0].value})}catch(o){Ae(Va,"loopOverSeriesData",o)}},be=()=>{try{P=Math.min(U*.4,W*.4),ne&&(P=P*.9),D=Math.min(rt(b.plotArea.innerRadius)/100*P,P)}catch(o){Ae(Va,"defineChartRadius",o)}},pe=()=>{try{let o=rt(b.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;Z=v.pie().value(T=>Math.abs(d?100:T.data[0].value)).startAngle((o??0)*(Math.PI/180)%360).endAngle(((o??0)+360)*(Math.PI/180)%360)(S)?.map((T,a)=>({...T,x0:T.startAngle,x1:T.endAngle,y0:0,y1:P,depth:2}))}catch(o){Ae(Va,"initPieChartData",o)}},Q=()=>{try{const o=b.animation.animationEnabled,d=v.arc().innerRadius(D).outerRadius(P),i=v.arc().innerRadius(D).outerRadius(P+10),T=$.append("g").attr("class","parentGroup").attr("fill-opacity",b.plotArea.opacity).attr("transform",`${G()}`).selectAll("path").data(Z).enter().append("path").attr("class",a=>"path").attr("hoverId",a=>(a.data?.properties?.alias||a.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("fill",a=>a.data.properties.color!==Re.white?a.data.properties.color:"none").attr(lt.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(lt.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",Tt(u,L,(a,m)=>({seriesId:m.data.properties.legendUniqueId??m.data.properties.name??"",dimValue:m.data.properties.alias||m.data.legend||"",legendUniqueId:m.data.properties.legendUniqueId??m.data.properties.name??"",seriesDisplayName:m.data.properties.alias||m.data.properties.name||""}))).each(function(a){const m=a;m._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){o?v.select(this).transition().duration(150).attr("d",i):v.select(this).attr("d",i)}).on("mousemove.text",a=>{yt([{key:b.yAxisTitle.yAxisTitleText,value:b.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/ce)*100).toFixed(rt(b.toolTip.toolTipDecimalPrecision))+"%":qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],b,void 0,a.currentTarget.__data__.data.properties,gt(p,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>ot()).on("mouseout.arc",function(){o?v.select(this).transition().duration(150).attr("d",d):v.select(this).attr("d",d)});o?T.transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attrTween("d",function(a){const m=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(N){return d(m(N))}}):T.attr("d",a=>d(a))}catch(o){Ae(Va,"drawDonutChart",o)}},G=()=>{try{return`translate(${W/2},${U/2})`}catch(o){return Ae(Va,"getPiePosition",o),""}},M=(o,d)=>{try{if(d)return"translate(0 0)";{const i=(o.startAngle+o.endAngle)/2,y=(D+P)/2,T=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let m=i*180/Math.PI%360,N=0;return m>180&&m<360?N=90:N=-90,m+=N,`translate(${T},${a}) rotate(${m})`}}catch(i){return Ae(Va,"getDataLabelTransformString",i),""}},h=()=>{try{if(b.plotArea.dataLabels){const o=Z&&Z.length===1;$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??Re.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,o)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=b;return T.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),$.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="1"),b,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.lableFontColor??Re.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("fill",y=>y.data.properties?.valueFontColor??Re.black).attr("transform",y=>M(y,o)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",b.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(b.plotArea.dataLabelValue){const T=y.data.data[0].value;return b.plotArea.dataLabelValue&&T!==void 0?b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/ce)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(T):T}}).append("tspan").attr("x",0).attr("y",b.plotArea.dataLabelValue?b.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??Re.black).attr("fill-opacity",.5).text(y=>{const T=Math.abs(y.data.data[0].value);return b.plotArea.plotAreaAbsoluteValue&&T!==void 0?v.format(".2s")(T):""});let d=v.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>1?y.y1-1+P/7:0).outerRadius(y=>y.depth>1?y.y1-1+P/7:0),i=v.arc().startAngle(y=>y.x0).endAngle(y=>y.x1).innerRadius(y=>y.depth>2?y.y0:0).outerRadius(y=>y.y1+P/1.5);$.selectAll("polyline.pie-label-connector").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",G()).style("stroke",y=>b.connector.connectorColorOption=="Uniform"?b.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",b.connector.connectorStyle===Za.solid?0:b.connector.connectorStyle===Za.dotted?1:4).style("stroke-width",b.connector.connectorLineThickness).attr("points",y=>{const T=i.centroid(y),a=d.centroid(y);let m=y.x0+(y.x1-y.x0)/2;m=m%(2*Math.PI);const N=P*1.1*(m<Math.PI?1:-1),re=a[1];return[T,a,[N,re]].map(K=>K.join(",")).join(" ")}),$.append("g").attr("class","pie-label-group").attr("transform",G()).selectAll("foreignObject").data(Yt(Z.filter(y=>y.data.properties.dataLabelPosition=="2"),b,y=>y.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",y=>{let T=y.x0+(y.x1-y.x0)/2;T=T%(2*Math.PI);const m=T<Math.PI?0:-80;return P*1.1*(T<Math.PI?1:-1)+m}).attr("y",y=>d.centroid(y)[1]-30).append("xhtml:div").attr("hoverId",y=>(y.data?.properties?.alias||y.data?.properties?.name||"Legend").replace(/\s+/g,"-")).style("display","flex").style("flex-direction","column").style("justify-content","center").style("align-items","center").style("height","60px").html(y=>{try{let T=y.data.data[0].value.toString();y.data.data[0].value!==void 0&&(T=b.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/ce)*100).toFixed(rt(b.plotArea.dataLabelDecimalPrecision))+"%":qe(b.plotArea.plotAreaDisplayUnits,b.plotArea.dataLabelNumberFormat,b.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return b.plotArea.dataLabelName&&(a+=`<span style="
118
118
  font-size: ${y.data.properties.labelFontSize}px;
119
119
  color: ${y.data.properties.labelFontColor};
120
- font-style: ${y.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:""};
121
- text-decoration: ${y.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:""};
122
- font-weight: ${y.data.properties.labelFontStyle.includes(ne.bold)?ne.bold:""};
120
+ font-style: ${y.data.properties.labelFontStyle.includes(oe.italic)?oe.italic:""};
121
+ text-decoration: ${y.data.properties.labelFontStyle.includes(oe.underline)?oe.underline:""};
122
+ font-weight: ${y.data.properties.labelFontStyle.includes(oe.bold)?oe.bold:""};
123
123
  font-family: ${y.data.properties.labelFont};
124
124
  display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
125
125
  ${y.data.legend}
126
126
  </span>`),b.plotArea.dataLabelValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
127
127
  font-size: ${y.data.properties.valueFontSize}px;
128
128
  color: ${y.data.properties.valueFontColor};
129
- font-style: ${y.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
130
- text-decoration: ${y.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
131
- font-weight: ${y.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
129
+ font-style: ${y.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
130
+ text-decoration: ${y.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
131
+ font-weight: ${y.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
132
132
  font-family: ${y.data.properties.valueFont};
133
133
  display: block;">
134
- ${f}
134
+ ${T}
135
135
  </span>`),b.plotArea.plotAreaAbsoluteValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
136
136
  font-size: ${y.data.properties.valueFontSize}px;
137
137
  color: ${y.data.properties.valueFontColor};
138
- font-style: ${y.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:""};
139
- text-decoration: ${y.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:""};
140
- font-weight: ${y.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"300"};
138
+ font-style: ${y.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:""};
139
+ text-decoration: ${y.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:""};
140
+ font-weight: ${y.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"300"};
141
141
  font-family: ${y.data.properties.valueFont};
142
142
  display: block;">
143
- ${T.format(".2s")(y.data.data[0].value)}
144
- </span>`),a}catch(f){return be(Ma,"drawDonutDataLabels",f),""}}),b.animation.animationEnabled&&$.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",1)}}catch(c){be(Ma,"drawDonutDataLabels",c)}},C=()=>{try{if(b.total&&b.total.totalVisibility){let c=se,d=b.total.totalFontStyle;const i=$.append("g").attr("transform",q()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",b.total.totalColor!==De.white?b.total.totalColor:"none").style("font-family",b.total.totalFontFamily).style("font-size",b.total.totalFontSize).style("font-style",d.includes(ne.italic)?ne.italic:"").style("text-decoration",d.includes(ne.underline)?ne.underline:"").style("font-weight",d.includes(ne.bold)?ne.bold:"").attr("text-anchor","middle").attr("visibility",b.plotArea.dataLabelValue?"visible":"hidden").text(b.total.showTotalLabel!==!1?b.total.editTotalText:"").append("tspan").attr("x",0).attr("y",b.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(ne.bold)?ne.bold:300).text(b.total.totalNumberFormat===",.0%"||b.total.totalNumberFormat==="Percentage"?"100%":je(b.total.totalDisplayUnits,b.total.totalNumberFormat,b.total.totalDecimalPrecision)(c)),b.animation.animationEnabled&&i.attr("opacity",0).transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",1)}}catch(c){be(Ma,"drawTotalValue",c)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:L,id:r,style:{width:"100%",height:"100%"}})})},Ga="TreemapChart.tsx",br=({data:t,formatOptions:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{const l=Te.useRef(),s=Te.useRef(o);s.current=o;const x=Te.useRef(h);x.current=h;let L,A,u,S=40,b=Ht,_,g,H,D,j,K;Te.useEffect(()=>{J()},[e]);const J=()=>{({chartFormatOptions:L,svg:K,width:A,height:u}=Jt(l,e)),{margins:b,chartTitleHeight:S,innerHeight:_,innerWidth:g}=Qa(L,u,A,!0),jt(l,A,u,L),H=la(K,b),_t(l,S,A,L),U(),V(),se()},U=()=>{try{const re={name:"root",children:t.ChartData},oe=T.hierarchy(re).sum(he=>he.data&&he.data[0].value).sort((he,Le)=>(Le.data.data[0].value??0)-(he.data.data[0].value??0));D=T.treemap().tile(T.treemapSquarify).size([g,_]).padding(1).round(!0)(oe).leaves(),j=D[0].data.properties.color}catch(re){be(Ga,"initChartData",re)}},V=()=>{try{if(L.colorScale.showColor===ga.colorTheme){let oe=D[0].data.data.length>1?1:0,he=L.colorScale.startColor,Le=L.colorScale.endColor,pe=new Set(D.map(w=>w.data.data[oe].value)),ue=Array.from(pe).sort((w,p)=>w-p),O=ue.length,q;if(O===1)q=()=>he;else{const w=T.interpolateLab(he,Le);q=T.scaleOrdinal().domain(ue.map(String)).range(ue.map((p,C)=>w(C/(O-1))))}D=D.map(w=>{let p=w.data.data[oe].value;return{...w,data:{...w.data,properties:{...w.data.properties,themeColor:q(p.toString())}}}}),N(he,Le,O,ue)}}catch(re){be(Ga,"prepareTreeColors",re)}},N=(re,oe,he,Le)=>{try{let pe=T.scalePow().exponent(1).domain([0,he-1]).range([re,oe]),O=K.append("foreignObject").attr("class","parentGroup").attr("x",A-130).attr("y",u-30).attr("width",115).attr("height",10).selectAll(null).data(Le).enter().append("xhtml:div").style("width",`${100/he}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(w,p)=>pe(p)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const q=K.append("g").attr("transform",`translate(${A-120},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",L.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",L.yAxisTitle.yAxisTitleFontFamily).text("min");K.append("g").attr("transform",`translate(${A-10},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",L.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",L.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(pe){be(Ga,"appendColorScale",pe)}},$=re=>{try{switch(L.colorScale.showColor){case ga.none:return j;case ga.discrete:return re.properties.color;case ga.colorTheme:return re.properties.themeColor;default:return}}catch(oe){be(Ga,"getColor",oe)}},X=re=>{try{const oe=re?.currentTarget?.__data__?.data?.properties;if(!oe)return;switch(L.colorScale.showColor){case ga.none:return{...oe,markerColor:j};case ga.colorTheme:return{...oe,markerColor:oe.themeColor};case ga.discrete:default:return oe}}catch(oe){be(Ga,"getMarkerColorForTooltip",oe)}},se=()=>{try{const re=L.animation.animationEnabled,oe=H.selectAll("g").data(D).enter().append("g").attr("transform",Le=>`translate(${Le.x0},${Le.y0})`),he=oe.append("rect").attr("fill",Le=>$(Le.data)).attr("fill-opacity",re?0:.7).attr("width",Le=>Le.x1-Le.x0).attr("height",Le=>Le.y1-Le.y0).on("mousemove",(Le,pe)=>{ot([{key:L.yAxisTitle.yAxisTitleText,value:je(L.toolTip.toolTipDisplayUnits,L.toolTip.toolTipNumberFormat,L.toolTip.toolTipDecimalPrecision)(pe.data.data[0].value)},{key:"Legend",value:pe.data.data[0].legend}],L,void 0,X(Le),ht(n,String(pe.data.data[0]?.legend??""),X(Le)))}).on("mouseout",()=>rt()).attr(Qe.SeriesId,Le=>String(Le.data.properties?.legendUniqueId??Le.data.legend??"")).attr(Qe.DimValue,Le=>String(Le.data.data[0].legend??"")).on("click",At(x,s,(Le,pe)=>{const ue=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),O=String(pe.data.data[0].legend??"");return{seriesId:ue,dimValue:O,legendUniqueId:ue,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||O)}}));if(re&&he.transition().duration(L.animation.animationDuration).ease(Xe[L.animation.animationEffect]).attr("fill-opacity",.7),oe.append("clipPath").attr("id",(Le,pe)=>`clip-${pe}-${r}`).append("rect").attr("width",Le=>Le.x1-Le.x0).attr("height",Le=>Le.y1-Le.y0),L.plotArea.dataLabels){const Le=L.annotation.annotationRangeFilter;oe.filter(pe=>{if(!Le?.enabled)return!0;const ue=pe.data.data[0].value;switch(Le.condition){case"lt":return ue<Le.maxVal;case"gt":return ue>Le.minVal;case"in":return ue>=Le.minVal&&ue<=Le.maxVal;case"not-in":return ue<Le.minVal||ue>Le.maxVal;default:return!0}}).append("text").style("fill",pe=>pe.data.properties.labelFontColor).style("font-family",pe=>pe.data.properties.fontFamily).style("font-size",pe=>pe.data.properties.fontSize).style("font-style",pe=>pe.data.properties.fontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",pe=>pe.data.properties.fontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",pe=>pe.data.properties.fontStyle.includes(ne.bold)?ne.bold:"").attr("clip-path",(pe,ue)=>`url(#clip-${ue}-${r})`),L.plotArea.dataLabelName&&oe.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(pe=>pe.data.legend),L.plotArea.dataLabelValue&&oe.selectAll("text").append("tspan").attr("x",5).attr("y",L.plotArea.dataLabelName?"2.1em":"1.1em").text(pe=>je(L.plotArea.plotAreaDisplayUnits,L.plotArea.dataLabelNumberFormat,L.plotArea.dataLabelDecimalPrecision)(pe.data.data[0].value)),re&&oe.selectAll("text").attr("opacity",0).transition().duration(L.animation.animationDuration).ease(Xe[L.animation.animationEffect]).attr("opacity",1)}}catch(re){be(Ga,"initChartRect",re)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},ra="PieofPieChart.tsx",gr=({data:t,formatOptions:e,chartId:r,legendProperties:o,tooltipFormatter:h})=>{const n=Te.useRef();let l,s,x,L=40,A=Ht,u,S,b,_,g,H,D,j,K,J,U,V,N,$=[0,0],X,se;Te.useEffect(()=>{re()},[e]);const re=()=>{({chartFormatOptions:l,svg:_,width:s,height:x}=Jt(n,e)),{plotArea:se}=l,oe(),{margins:A,innerHeight:u,innerWidth:S,legendListWidth:X,chartTitleHeight:L}=Na(l,s,x,$,A),he(),jt(n,s,x,l),b=la(_,A),_t(n,L,s,l),Le(),pe(),p(),fi(l,j,L,_,s,x),d()},oe=()=>{try{let i=It(Ui(o,"name"),et(l.legends.legendFontSize),l.legends.legendFontFamily);$=[i.width,i.height]}catch(i){be(ra,"calculateMaxPossibleWidth",i)}},he=()=>{try{H=Math.min(u*.4,S*.4),D=l.pieofPie.pieOfPieRadius}catch(i){be(ra,"calculatePieRadius",i)}},Le=()=>{try{let i=new Map;o.forEach(a=>{i.set(a.name,a)}),j=0,t.forEach(a=>{a.properties=i.get(a.legend),j+=a.data[0].value,a.children&&a.children.forEach(m=>m.properties=i.get(m.legend))}),g=T.pie().value(a=>a.data[0].value)(t).map((a,m)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:H,depth:2}))}catch(i){be(ra,"initChartData",i)}},pe=()=>{try{const i=T.arc().innerRadius(0).outerRadius(H),y=T.arc().innerRadius(0).outerRadius(H+10),f=b.append("g").attr("class","parentGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(g).enter().append("path").attr("class",a=>"path "+a.data.legend).attr("hoverId",a=>a.data.legend.replace(/ /g,"-")).attr("fill",a=>a.data.properties.color!==De.white?a.data.properties.color:"none").on("mouseover.arc",function(a){T.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{ot([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision)??0)+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],l,void 0,a.currentTarget.__data__.data.properties,ht(h,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(a){T.select(this).transition().duration(100).attr("d",i),rt()}).on("click",(a,m)=>{try{let P=m;if(P.data.children&&P.data.children.length>1){b.selectAll(".childGroup").remove(),b.selectAll(".childLabels").remove(),b.selectAll("line").remove(),K=P.data.legend;let ie=90-(m.x0+m.x1)/2/Math.PI*180;ue(P.data.children,ie,m)}}catch(P){be(ra,"drawPieChart_onClick",P)}});l.animation.animationEnabled?f.transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attrTween("d",function(a){const m=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return P=>i(m(P))}):f.attr("d",a=>i(a))}catch(i){be(ra,"drawPieChart",i)}},ue=(i,y,f)=>{try{b.select(".parentGroup").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`),b.selectAll(".parentLabels").transition().duration(l.animation.animationDuration).ease(Xe[l.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`);let m=T.pie().value(Q=>Q.data[0].value)(i).map((Q,Ae)=>({...Q,x0:Q.startAngle,x1:Q.endAngle,y0:0,y1:D,depth:2}));const P=T.arc().innerRadius(0).outerRadius(D),ie=T.arc().innerRadius(0).outerRadius(D+10);b.append("g").attr("class","childGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${q()}`).selectAll("path").data(m).enter().append("path").attr("class",Q=>"path "+Q.data.legend).attr("hoverId",Q=>Q.data.legend.replace(/ /g,"-")).attr("fill",Q=>Q.data.properties.color!==De.white?Q.data.properties.color:"none").attr("d",Q=>P(Q)).on("mouseover.arc",function(Q){T.select(this).transition().duration(100).attr("d",ie)}).on("mousemove.text",Q=>{ot([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(Q.currentTarget.__data__.data.data[0].value/j)*100).toFixed(et(l.toolTip.toolTipDecimalPrecision))+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(Q.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:Q.currentTarget.__data__.data.legend}],l,void 0,Q.currentTarget.__data__.data.properties,ht(h,String(Q.currentTarget.__data__.data.legend??""),Q.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{rt()}).on("mouseout.arc",function(Q){T.select(this).transition().duration(100).attr("d",P),rt()}),C(m),c(f,i)}catch(a){be(ra,"drawChildPie",a)}},O=()=>{try{return J=K?3*S/8:S/2,U=u/2,`translate(${J},${U})`}catch(i){be(ra,"getParentPiePosition",i)}},q=()=>{try{return V=3*S/4,N=u/2,`translate(${V},${N})`}catch(i){be(ra,"getChildPiePosition",i)}},w=(i,y)=>{try{const f=(i.startAngle+i.endAngle)/2,a=Math.cos(f-Math.PI/2)*(y*.65),m=Math.sin(f-Math.PI/2)*(y*.65);let P=f*180/Math.PI-90;return`translate(${a},${m}) rotate(${P})`}catch(f){be(ra,"getDataLabelTransformString",f)}},p=()=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(g,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.labelFontSize??11).attr("fill",i=>i.data.properties?.labelFontColor??De.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",i=>i.data.properties?.labelFont??qe).attr("transform",i=>w(i,H)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=l;return y.dataLabelName?i.data.legend:""}),b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(g,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.valueFontSize??11).attr("fill",i=>i.data.properties?.valueFontColor??De.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??qe).attr("transform",i=>w(i,H)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(l.plotArea.dataLabelValue){const y=i.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&y!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/j)*100).toFixed(et(l.plotArea.dataLabelDecimalPrecision)??0)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){be(ra,"drawParentPieDataLabels",i)}},C=i=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","childLabels parentGroup").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??De.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ne.bold)?ne.bold:"").attr("font-family",y=>y.data.properties?.labelFont??qe).attr("transform",y=>w(y,D)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:f}=l;return f.dataLabelName?y.data.legend:""}),b.append("g").attr("class","childLabels parentGroup").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Rt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.valueFontColor??De.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ne.italic)?ne.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ne.underline)?ne.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ne.bold)?ne.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??qe).attr("transform",y=>w(y,D)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(l.plotArea.dataLabelValue){const f=y.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&f!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(f/j)*100).toFixed(et(l.plotArea.dataLabelDecimalPrecision)??0)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(f):f}}))}catch(y){be(ra,"drawChildPieDataLabels",y)}},c=(i,y)=>{try{let f=Math.abs(i.x0-i.x1)/2,m=i.y1*Math.sin(f),P=m/Math.tan(f);b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",J+P).attr("y1",U-m).attr("x2",V).attr("y2",N-D),b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",J+P).attr("y1",U+m).attr("x2",V).attr("y2",N+D)}catch(f){be(ra,"drawLines",f)}},d=()=>{try{let i=o.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){be(ra,"initLegendList",i)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},da="PyramidChart.tsx",Ar=({data:t,formatOptions:e,chartId:r,onDataLabelCoordinatesChange:o,addLocalFilterFromLib:h,tooltipFormatter:n})=>{const l=Te.useRef();let s=bt(t.ChartData),x,L,A,u,S=40,b=Ht,_=[0,0],g,H,D,j,K=[0],J,U,V,N;Te.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:x,svg:L,width:A,height:u}=Jt(l,e)),_=Ia(x,s),{margins:b,innerHeight:g,innerWidth:H,legendListWidth:V,chartTitleHeight:S}=Na(x,A,u,_,b),X(),jt(l,A,u,x),J=se(),_t(l,S,A,x),Pa(x,L,s,A,u,V,S,r,b,nt.rectangle,!1,h),re(),oe(),Le(),he()},X=()=>{try{D=Math.min(g,H),j=.866*D}catch(ue){be(da,"initPyramidSideCalculations",ue)}},se=()=>{try{return L.append("g").attr("transform",`translate(${b.left},${b.top+(g-j)/2})`)}catch(ue){return be(da,"initChartArea",ue),null}},re=()=>{try{s=s.sort((ue,O)=>{const q=ue.data[0].value,w=O.data[0].value;return x.plotArea.flipPyramid?w-q:q-w}),U=T.sum(s,ue=>Math.abs(ue.data[0].value)),K=[0],s.forEach((ue,O)=>{const q=Math.abs(ue.data[0].value)/U*j;K.push(K[O]+q)})}catch(ue){be(da,"initPyramidData",ue)}},oe=()=>{try{s.forEach((ue,O)=>{try{const q=K[O],w=K[O+1];let p=x.plotArea.flipPyramid?1:0;const C=D*(p-K[O]/j),c=D*(p-K[O+1]/j),d=H/2,i=J.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=x.animation.animationEnabled,f=i.append("polygon").attr("class","segment").attr("hoverId",ue.legend.replace(/\s+/g,"-")).attr("data-series-id",ue.legendUniqueId??ue.legend).attr("data-dim-value",ue.legend).attr("points",`
145
- ${d-C/2},${q}
146
- ${d+C/2},${q}
147
- ${d+c/2},${w}
148
- ${d-c/2},${w}
149
- `).attr("fill",ue.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{ot([{key:ue.legend,value:x.toolTip.toolTipNumberFormat==",.0%"?ue.data[0].value?(Math.abs(ue.data[0].value/U)*100).toFixed(et(x.toolTip.toolTipDecimalPrecision))+"%":"":je(x.toolTip.toolTipDisplayUnits,x.toolTip.toolTipNumberFormat,x.toolTip.toolTipDecimalPrecision)(ue.data[0].value)}],x,void 0,ue.properties,ht(n,String(ue.legend??""),ue.properties)),T.select(this).style("opacity",.8).style("stroke",x.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){be(da,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{rt(),T.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){be(da,"drawPyramidChart.onMouseOut",a)}});y&&f.transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1)}catch(q){be(da,"drawPyramidChart.forEach",q)}})}catch(ue){be(da,"drawPyramidChart",ue)}},he=ue=>{try{if(x.annotation.annotationVisibility){let O=dt.annotation(),q=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"None",w=Rt(N,x,c=>c.data.measure);const p=x.annotation.connectorStyle?.toLowerCase();O.editMode(x.annotation.annotationDraggable).accessors({x:function(){return H*.5},y:function(c,d){return c.y}}).on("dragend",function(c){try{w.forEach(d=>{d.data.legend===c.data.legend&&(d.dx=c._dx,d.dy=c._dy,d.width=A,d.height=u)}),o&&o(w.map(d=>({data:{legend:d.data.legend,isVisible:d.data.isVisible??!0},dx:d.dx,dy:d.dy,width:A,height:u}))),C.selectAll(".connector").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]),C.selectAll(`.connector-${q}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),C.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend.replace(/\s+/g,"-")).style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]).filter(d=>d._dx==0&&d._dy==0).remove(),C.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block"),C.selectAll(".annotation-note-title").filter(d=>d.data&&d.data.isVisible).style("display","block")}catch(d){be(da,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(w);let C=J.append("g").attr("class","annotation-group parentGroup").call(O);x.animation.animationEnabled&&C.attr("opacity",0).transition().duration(x.animation.animationDuration).ease(Xe[x.animation.animationEffect]).attr("opacity",1),C.selectAll("rect").style("visibility","hidden"),C.selectAll(".annotation-subject").remove(),C.selectAll(".connector").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]),C.selectAll(`.connector-${q}`).attr("fill",x.annotation.connectorColor||"#ccc").style("stroke",x.annotation.connectorColor||"#ccc"),C.selectAll(".note-line").style("stroke",x.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Et[p]).filter(c=>c._dx==0&&c._dy==0).remove(),C.selectAll(".connector-end").filter(c=>c.connector.end=="dot"&&c._dx==0&&c._dy==0).remove(),C.selectAll(".annotation-note-label").filter(c=>c.data&&!c.data.isVisible).style("display","none"),C.selectAll(".annotation-note-title").filter(c=>c.data&&!c.data.isVisible).style("display","none"),x.annotation.annotationType==Wt.automatic&&C.selectAll(".annotation-note-content").attr("transform",function(){const d=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(d)return`translate(${parseFloat(d[1])}, 0)`}),C.selectAll(".annotation-note-label").attr("y","15").attr("text-anchor","middle"),C.selectAll(".annotation-note-title").attr("text-anchor","middle"),C.selectAll(".annotation-note-content").attr("transform","translate(0,-28)"),!x.plotArea.dataLabelName&&C.selectAll("tspan").attr("dy","0"),x.plotArea.dataLabelName&&C.selectAll(".annotation-note-title").attr("hoverId",c=>c.data.legend.replace(/\s+/g,"-")).style("font-size",c=>c.data.labelFontSize).attr("font-family",c=>c.data.labelFontFamily).style("font-style",c=>c.data.labelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",c=>c.data.labelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",c=>c.data.labelFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",c=>c.data.labelFontColor),x.plotArea.dataLabelValue&&C.selectAll(".annotation-note-label").attr("hoverId",c=>c.data.legend.replace(/\s+/g,"-")).style("font-size",c=>c.data.valueFontSize).attr("font-family",c=>c.data.valueFontFamily).style("font-style",c=>c.data.valueFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",c=>c.data.valueFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",c=>c.data.valueFontStyle.includes(ne.bold)?ne.bold:"300").style("fill",c=>c.data.valueFontColor)}}catch(O){be(da,"pyramidAnnotations",O)}},Le=()=>{try{let ue=x.annotation.annotationType??"1",O=[ue=="1"?"connector":""],q=x.annotation.connectorType?x.annotation.connectorType.toLowerCase():"none";const w=JSON.parse(JSON.stringify(x.plotArea.dataLabelsCoordinates||[])),p=new Map(w.map(C=>[C.data?.legend,C]));N=[],s.forEach((C,c)=>{try{const d=x.annotation.annotationVisibility,i=s.length-1;if(d===Wt.none||d===Wt.startOnly&&c!==0||d===Wt.endOnly&&c!==i||d===Wt.startAndEndBoth&&c!==0&&c!==i)return;let y={note:{title:x.plotArea.dataLabelName?C.properties.alias:"",label:x.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(C.data[0].value/U)*100).toFixed(et(x.plotArea.dataLabelDecimalPrecision))+"%":x.plotArea.dataLabelValue?C.data[0].value>=1e9&&x.annotation.annotationNumberFormat===".2s"?Math.round(C.data[0].value/1e9)+"B":je(x.annotation.annotationDisplayUnits,x.plotArea.dataLabelNumberFormat,x.plotArea.dataLabelDecimalPrecision)(C.data[0].value):"",align:"middle"},data:{x:H/2,y:pe(C,c,C.properties.dataLabelPosition),isVisible:!0,dimension:C.legend,legend:C.legend,measure:C.data[0].value,labelFontFamily:C.properties.labelFont,labelFontSize:C.properties.labelFontSize,labelFontColor:C.properties.labelFontColor,labelFontStyle:C.properties.labelFontStyle,valueFontFamily:C.properties.valueFont,valueFontSize:C.properties.valueFontSize,valueFontColor:C.properties.valueFontColor,valueFontStyle:C.properties.valueFontStyle},dx:0,dy:0,connector:{end:q,curve:Ll[x.annotation.connectorCurve]},disable:O,subject:{height:15,width:15},type:ml[ue],color:x.plotArea.dataLabelNameColor!=De.black?x.plotArea.dataLabelNameColor:De.black,height:A,width:A,index:c};const f=p.get(C.legend);f&&(y.dx=f.dx*A/(f.width||A),y.dy=f.dy*u/(f.height||u),y.data.isVisible=f.data?.isVisible??!0),N.push(y)}catch(d){be(da,"prepareNewAnnotationsList.forEach",d)}})}catch(ue){be(da,"prepareNewAnnotationsList",ue)}},pe=(ue,O,q)=>{try{switch(q){case ni.top:return K[O]+30;case ni.middle:return(K[O]+K[O+1])/2+15;case ni.bottom:return K[O+1];default:return K[O]+30}}catch(w){return be(da,"getYCordinate",w),0}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},Ta="ProgressChart.tsx",Lr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:o,tooltipFormatter:h})=>{const n=Te.useRef();let l=bt(t),s,x,L,A=40,u=Ht,S=[0,0],b,_,g,H,D,j,K,J;const U=1,V=0;Te.useEffect(()=>{N()},[e]);const N=()=>{({chartFormatOptions:s,svg:D,width:x,height:L}=Jt(n,e)),S=Ia(s,l),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:j,chartTitleHeight:A}=Na(s,x,L,S,u),$(),jt(n,x,L,s),H=la(D,u),_t(n,A,x,s),Pa(s,D,l,x,L,j,A,r,u,nt.hollowCircle,!0,o),X(),se(),fi(s,g,A,D,x,L)},$=()=>{try{K=Math.min(b*.45,_*.45),J=Math.min(et(s.plotArea.innerRadius)/100*K,K)}catch(oe){be(Ta,"setRadiusAndInnerRadius",oe)}},X=()=>{try{g=t[U].data[0].value+t[V].data[0].value}catch(oe){be(Ta,"initProgressChartData",oe)}},se=()=>{try{let oe=t[U].data[0].value,he=t[V].data[0].value,Le=Math.PI*2,pe=he/oe*Math.PI*2,ue=s.plotArea.dataLabelValueFontStyle;const O=T.arc().innerRadius(J).outerRadius(K).startAngle(0).cornerRadius(et(s.plotArea.cornerRadius));H.append("path").attr("class","secondary-circle").attr("fill",t[U].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressScale).attr("hoverId",w=>(t[U]?.properties?.alias||t[U]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[U].properties.legendUniqueId??t[U].properties.alias??"*").attr("data-dim-value",t[U].properties.alias??"*").attr("d",O({endAngle:Le})).on("mousemove",w=>{try{ot([{key:t[U].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)}],s,void 0,t[U].properties,ht(h,String(t[U].properties?.alias??""),t[U].properties))}catch(p){be(Ta,"drawProgressChart.onMouseMove.secondary-circle",p)}}).on("mouseout",()=>{try{rt()}catch(w){be(Ta,"drawProgressChart.onMouseOut.secondary-circle",w)}}).attr("transform",re()),H.append("path").attr("class","progress-circle").attr("fill",t[V].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressGoal).attr("hoverId",w=>(t[V]?.properties?.alias||t[V]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[V].properties.legendUniqueId??t[V].properties.alias??"*").attr("data-dim-value",t[V].properties.alias??"*").attr("d",O({endAngle:pe})).on("mousemove",w=>{try{ot([{key:t[V].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(he/oe*100)+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(oe)},{key:t[U].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(he)}],s,void 0,t[V].properties,ht(h,String(t[V].properties?.alias??""),t[V].properties))}catch(p){be(Ta,"drawProgressChart.onMouseMove.progress-circle",p)}}).on("mouseout",()=>{try{rt()}catch(w){be(Ta,"drawProgressChart.onMouseOut.progress-circle",w)}}).attr("transform","translate("+_/2+","+b/2+")").transition().duration(s.animation.animationEnabled?s.animation.animationDuration:0).ease(Xe[s.animation.animationEffect]).attrTween("d",function(w){try{const p=T.interpolate(0,pe);return function(C){try{return O({endAngle:p(C)})}catch(c){return be(Ta,"drawProgressChart.attrTween.inner",c),""}}}catch(p){return be(Ta,"drawProgressChart.attrTween",p),()=>""}});const q=H.append("text").attr("transform",re()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&Hi([{value:he}],s,p=>p?.value??0).length>0?"visible":"hidden").attr("fill",s.plotArea.dataLabelValueColor!==De.white?s.plotArea.dataLabelValueColor:s.toolTip.toolTipDisplayUnits).attr("font-style",ue.includes(ne.italic)?ne.italic:"").attr("text-decoration",ue.includes(ne.underline)?ne.underline:"").attr("font-weight",ue.includes(ne.bold)?ne.bold:"").attr("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-size",s.plotArea.dataLabelValueFontSize).text(()=>s.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(he/oe*100)+"%":je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormatProgress,s.plotArea.dataLabelDecimalPrecision)(he));s.animation.animationEnabled&&q.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1)}catch(oe){be(Ta,"drawProgressChart",oe)}},re=()=>{try{return"translate("+_/2+","+b/2+")"}catch(oe){return be(Ta,"getTransformString",oe),""}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},mr=({data:{ChartData:t},formatOptions:e,chartId:r})=>{const o=Te.useRef(),h=bt(t);let n,l,s,x=40,L=Ht,A,u,S,b,_,g,H,D,j,K,J,U={},V;const N="Speedometer.tsx";Te.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:n,svg:b,width:l,height:s}=Jt(o,e)),{margins:L,chartTitleHeight:x,innerHeight:A,innerWidth:u}=Qa(n,s,l),X(),jt(o,l,s,n),S=la(b,L),_t(o,x,l,n),re(),oe(),Le(),ue()},X=()=>{try{let p;A*.8<u*.45?(_=A*.8,p="width"):(_=u*.45,p="height"),V=se(p),g=et(n.plotArea.innerRadiusForSpeedometer)/100*_}catch(p){be(N,"initChartRadius",p)}};function se(p){try{return p=="height"?`translate(${u/2},${A/2+_/2})`:`translate(${u/2},${s-60})`}catch(C){return be(N,"centerTranslation",C),""}}const re=()=>{try{let p=t[0].data[0].value;p<0?(H=0,D=p):(H=p,D=0),n.customScaling.customScalingtoggle?K=100:K=et(n.plotArea.ticks)}catch(p){be(N,"initSpeedometerData",p)}},oe=()=>{try{j=[];let p=et(n.plotArea.ticks);if(n.customScaling.customScalingtoggle){for(let C=1;C<=p;C++){let c=n.customScaling[`share${C}`];if(j.length<100)for(let d=0;d<c;d++)j.push(n.customScaling[`division${C}`])}if(j.length<101)for(let C=j.length;C<100;C++)j.push(De.black)}else if(n.colorScale.showColor==ga.none){const C=t[0].properties?.color??"#bac8de";for(let c=1;c<=p;c++)j.push(C)}else if(n.colorScale.showColor==ga.discrete)for(let C=1;C<=p;C++)j.push(n.colorScale["division"+C]);else{let C=n.colorScale.startColor,c=n.colorScale.endColor;const d=T.scaleLinear().domain([0,p]).range([C,c]);for(let i=0;i<p;i++)j.push(d(i))}}catch(p){be(N,"initColorTheme",p)}},he=(p,C,c)=>{try{let d=[],i=Math.abs(p)-Math.abs(C),y=Math.abs(i)/c,f=C>0?0:C;d.push(f);for(let a=0;a<c-1;a++)f+=parseFloat(y.toFixed(5)),f.toFixed(5)<=Math.abs(p)&&d.push(f);return d.push(d.includes(p)?0:p),d}catch(d){return be(N,"setTickValues",d),[]}},Le=()=>{try{switch(n.plotArea.dataLabelsOptions){case Wt.automatic:J=pe();break;case Wt.startOnly:J=[D];break;case Wt.endOnly:let C=Array(K).fill("");C[K]=H,J=C;break;case Wt.startAndEndBoth:let c=Array(K).fill("");c[K]=H,c[0]=D,J=c;break;case Wt.none:J=[];break}}catch(p){be(N,"setDataLabelsOptions",p)}},pe=()=>{try{let p,C=et(n.plotArea.ticks),c=he(H,D,K);if(n.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=D;let i=0;for(let y=1;y<=C;y++){let f=parseInt(n.customScaling[`share${y}`]);if(i+=f,i>=100)break;d[i]=c[i]}d[99]=H,p=d}else p=c;return p}catch(p){return be(N,"initTicksValues",p),[]}},ue=()=>{try{let C=function(c,d){try{let i=function(me){try{return me*Math.PI/180}catch(Ve){return be(N,"deg2rad",Ve),0}},y=function(me){try{let Ve;for(Ve in me)ce[Ve]=me[Ve];m=ce.maxAngle-ce.minAngle,ie=Math.round(_*ce.pointerHeadLengthPercent),ge=T.scaleLinear().range([0,1]).domain([ce.minValue,ce.maxValue]),Ae=T.arc().innerRadius(g).outerRadius(_).startAngle((Ye,te)=>{let de=1/ce.majorTicks*te;return i(ce.minAngle+de*m)}).endAngle((Ye,te)=>{let de=1/ce.majorTicks*(te+1);return i(ce.minAngle+de*m)})}catch(Ve){be(N,"configure",Ve)}},f=function(me,Ve){try{if(Ve===0){S.append("g").attr("class","arc").attr("transform",V).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(j).enter().append("path").attr("fill",ve=>ve).attr("stroke",ve=>ve).attr("d",Ae);let Ce=H,Me=S.append("g").attr("class","label").attr("transform",V);if(Me.selectAll("text").data(J).enter().append("text").attr("transform",function(ve,xe){let Fe=m/ce.majorTicks*xe;return"rotate("+(ce.minAngle+Fe)+") translate(0,"+(ce.labelInset-_)+")"}).attr("text-anchor","middle").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==De.white?n.plotArea.dataLabelValueColor:"none").attr("font-style",n.plotArea.dataLabelValueFontStyle.includes(ne.italic)?ne.italic:"").attr("text-decoration",n.plotArea.dataLabelValueFontStyle.includes(ne.underline)?ne.underline:"").attr("font-weight",n.plotArea.dataLabelValueFontStyle.includes(ne.bold)?ne.bold:"").attr("font-family",n.plotArea.dataLabelValueFontFamily).text(ve=>n.plotArea.dataLabelNumberFormat==",.0%"?Q=Math.round(ve/Ce*100)+"%":je(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(ve)).attr("visibility",ve=>ve===""?"hidden":"visible"),n.animation.animationEnabled){const ve=n.animation.animationDuration,xe=Xe[n.animation.animationEffect];Me.selectAll("text").attr("opacity",0).attr("transform",function(Fe,ye){const ee=m/ce.majorTicks*ye;return`rotate(${ce.minAngle+ee}) translate(0, ${ce.labelInset-_+20})`}).transition().duration(ve).ease(xe).attr("opacity",1).attr("transform",function(Fe,ye){const ee=m/ce.majorTicks*ye;return`rotate(${ce.minAngle+ee}) translate(0, ${ce.labelInset-_})`})}}n.pointerValue.showPointerValue&&h.length===2&&q(V);let Ye=[[ce.pointerWidth/2,0],[0,-ie],[-(ce.pointerWidth/2),0],[0,ce.pointerTailLength],[ce.pointerWidth/2,0]],te=T.line().curve(T.curveLinear);ae=S.append("g").data([Ye]).attr("class","pointer").attr("transform",V).append("path").attr("d",Ve>0?te:null).attr("transform","rotate("+ce.minAngle+")").attr("fill",n.plotArea.pointerColor).on("mousemove",(Pe,Ce)=>{ot([{key:`${t[Ve].data[0].legend}`,value:n.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[Ve].data[0].value/we[we.length-1]*100)+"%":je(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(t[Ve].data[0].value)}],n,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{rt()}),ae.selectAll("text").append("text").text(ce.maxValue),a(me===void 0?0:me)}catch(Ye){be(N,"gauge.render",Ye)}},a=function(me,Ve){try{Ve!==void 0&&y(Ve);let Ye=ge(me),te=ce.minAngle+Ye*m;ae.transition().duration(n.animation.animationEnabled?n.animation.animationDuration:0).ease(Xe[n.animation.animationEffect]).attr("transform","rotate("+te+")")}catch(Ye){be(N,"gauge.update",Ye)}},m,P,ie,Q,Ae,ge,we,fe,ae,ke,ce={clipWidth:u,clipHeight:A,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:et(n.plotArea.pointerHeadLength)/10,minValue:D,maxValue:H,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:K,labelFormat:me=>je(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(me),labelInset:-5};return U.configure=y,U.render=f,U.update=a,y(d),U}catch(i){be(N,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:A,ringWidth:2.75*et(n.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:H,transitionMs:0});if(h.length>0)for(let c=0;c<h.length;c++)C.render(O(h[c],c),c)}catch(p){be(N,"initSpeedometer",p)}};function O(p,C){try{let c=H,d=p.data[0].value;return c<0&&d>0||c>0&&d<0?0:c<0&&d<0&&c>d?c:c<0&&d<0&&c<d||c>d?d:c}catch(c){return be(N,"setPointerofSpeedometer",c),0}}function q(p){try{let C="";if(n.pointerValue.kpiAlias)C=n.pointerValue.kpiAliasText;else switch(n.pointerValue.connectorKPIforSpeedometer){case Za.PointerValue:C="Pointer Value";break;case Za.Absolute:C="Absolute Value";break;case Za.CAGR:C="CAGR";break;case Za.PercentageGrowth:C="Percentage Growth";break}let c=n.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",p).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",n.pointerValue.pointerValueFontSize).attr("fill",n.pointerValue.pointerValueColor!==De.white?n.pointerValue.pointerValueColor:"none").attr("font-style",c.includes(ne.italic)?ne.italic:"").attr("text-decoration",c.includes(ne.underline)?ne.underline:"").attr("font-weight",c.includes(ne.bold)?ne.bold:"").attr("font-family",n.pointerValue.pointerValueFontFamily).text(i=>`${C}: ${!n.pointerValue.pointerValueAlias&&i!=0?w(t[0].data[0].value,t[1].data[0].value):n.pointerValue.pointerValueAliasText}`).attr("visibility",n.plotArea.dataLabels?"visible":"hidden")}catch(C){be(N,"setPointerValueText",C)}}function w(p,C){try{let c=p-C,d=1,i=parseInt(n.pointerValue.connectorKPIforSpeedometer),y,f;const a=n.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:c=C;break;case 2:c=Math.abs(c);break;case 3:return y=`.${a}%`,c=Math.pow(C/p,1/d)-1,f=T.format(y)(c),f;case 4:return y=`.${a}%`,c=Math.round(C/p*100-100)/100,f=T.format(y)(c),f}return isNaN(c)&&(c=0),je(n.pointerValue.pointerValueDisplayUnits,n.pointerValue.pointerValueNumberFormat,a)(c)}catch(c){return be(N,"connectorNumberFormat",c),""}}return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:o,id:r,style:{width:"100%",height:"100%"}})})};function Sa(t,e,r){console.error(`[${t}][${e}]`,r)}const fr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:o,tooltipFormatter:h})=>{const n=Te.useRef(),l=bt(t);let s,x,L,A=40,u=Ht,S=[0,0],b,_,g,H,D,j;Te.useEffect(()=>{K()},[e]);const K=()=>{({chartFormatOptions:s,svg:H,width:x,height:L}=Jt(n,e)),J(),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:j,chartTitleHeight:A}=Na(s,x,L,S,u),S=Ia(s,l),jt(n,x,L,s),g=la(H,u),_t(n,A,x,s),Pa(s,H,l,x,L,j,A,r,u,nt.hollowCircle,!1,o),V()},J=()=>{try{D=0,l.forEach($=>{D+=$.data[0].value})}catch($){Sa("RadialBarChart.tsx","loopOverChartData",$)}},U=$=>{try{switch(s.plotArea.dataLabelsOptions){case Wt.automatic:return $.map((se,re)=>({...se,index:re}));case Wt.startOnly:return[{...$[0],index:0}];case Wt.endOnly:return[{...$[$.length-1],index:$.length-1}];case Wt.startAndEndBoth:return[{...$[0],index:0},{...$[$.length-1],index:$.length-1}];case Wt.none:return[]}}catch(X){return Sa("RadialBarChart.tsx","getModifiedDataForLabels",X),$}},V=()=>{try{let $=function(fe,ae){try{const ke=T.interpolate(0,d(Math.abs(fe.data[0].value)));return ce=>ie({...fe,endAngle:ke(ce)},ae)}catch(ke){Sa("RadialBarChart.tsx","arcTween",ke)}},X=function(fe){try{return fe*180/w}catch(ae){Sa("RadialBarChart.tsx","radTodeg",ae)}},se=function(fe){try{return fe*Math.PI/180}catch(ae){Sa("RadialBarChart.tsx","degToRad",ae)}},re=function(fe){try{return p+(m-(fe+1))*(P+C)}catch(ae){Sa("RadialBarChart.tsx","getInnerRadius",ae)}},oe=function(fe){try{return re(fe)+P}catch(ae){Sa("RadialBarChart.tsx","getOuterRadius",ae)}},he=l.length>1?T.max(l,fe=>fe.data[0].value)*1.1:t[0].data[0].value*1.1,Le=s.plotArea.dataLabelValueFontStyle,pe=je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(he),ue=s.plotArea.axialAxis?It(pe,et(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const O=Math.min(b*.5,_*.5)-ue;let q=g.append("g").attr("transform",N()).attr("width",_).attr("height",b);const w=Math.PI,p=l.length>1?10:70,C=et(s.plotArea.arcPadding),c=et(s.plotArea.axialTicks);let d=T.scaleLinear().domain([0,he]).range([0,se(360)]),i=d.ticks(c);i[i.length-1]==he&&i.pop();let y=i,f=l.map((fe,ae)=>fe.data[0].legend),a=l.reduce((fe,ae)=>fe+ae.data[0].value,0);const m=f.length,P=(O-p-m*C)/m;let ie=T.arc().innerRadius((fe,ae)=>re(ae)).outerRadius((fe,ae)=>oe(ae)).startAngle(0).endAngle(fe=>fe.endAngle),Q=T.arc().innerRadius((fe,ae)=>re(ae)).outerRadius((fe,ae)=>oe(ae)).startAngle(0).endAngle(se(360)),Ae=q.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&Ae.append("circle").attr("r",(fe,ae)=>oe(ae)+C).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let ge=q.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",fe=>"rotate("+(X(d(fe))-90)+")");s.plotArea.axialGrid&&ge.append("line").attr("x2",O).attr("stroke","#a9a9a9").attr("stroke-width",1),ge.append("text").attr("x",O+10).attr("class","text-xs text-gray-600").style("text-anchor",fe=>d(fe)>=w&&d(fe)<2*w?"end":null).attr("transform",fe=>"rotate("+(90-X(d(fe)))+","+(O+10)+",0)").text(fe=>je(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(fe)).attr("fill",s.plotArea.axialAxisDataLabelColor!==De.white?s.plotArea.axialAxisDataLabelColor:"none").style("font-size",s.plotArea.axialAxisDataLabelFontSize).style("font-family",s.plotArea.axialAxisDataLabelFontFamily).attr("font-style",s.plotArea.axialAxisDataLabelFontStyle.includes(ne.italic)?ne.italic:"").attr("text-decoration",s.plotArea.axialAxisDataLabelFontStyle.includes(ne.underline)?ne.underline:"").attr("font-weight",s.plotArea.axialAxisDataLabelFontStyle.includes(ne.bold)?ne.bold:"").attr("visibility",s.plotArea.axialAxis?"visible":"hidden");let we=q.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",fe=>fe.data[0].legend.replaceAll(" ","-")).attr("data-series-id",fe=>fe.properties.legendUniqueId??fe.data[0].legend).attr("data-dim-value",fe=>fe.data[0].legend).attr("fill",fe=>fe.properties.color).attr("d",(fe,ae)=>ie({...fe,endAngle:0},ae)).on("mousemove",(fe,ae)=>{ot([{key:s.yAxisTitle.yAxisTitleText,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(ae.data[0].value/a)*100).toFixed(et(s.toolTip.toolTipDecimalPrecision))+"%":je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ae.data[0].value)},{key:"Legend",value:ae.properties.alias}],s,void 0,ae.properties,ht(h,String(ae.data[0]?.legend??""),ae.properties))}).on("mouseout",()=>{rt()});if(s.animation.animationEnabled?we.transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attrTween("d",$):we.attr("d",(fe,ae)=>ie({...fe,endAngle:d(Math.abs(fe.data[0].value))},ae)),s.plotArea.dataLabels){const fe=Hi(U(t),s,ke=>ke?.data?.[0]?.value??0),ae=q.selectAll(".arc-label-"+r).data(fe).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(ke,ce)=>(oe(ke.index??ce)-re(ke.index??ce))/1.75);ae.append("textPath").attr("xlink:href",(ke,ce)=>`#arc-path-${ke.index??ce}-`+r).style("startOffset","50%").attr("hoverId",ke=>ke.legend.replaceAll(" ","-")).text(ke=>`  ${ke.properties.alias}
150
-  ${s.plotArea.dataLabelValue?je(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormat,s.plotArea.dataLabelDecimalPrecision)(ke.data[0].value):""}`).attr("fill",s.plotArea.dataLabelValueColor!==De.white?s.plotArea.dataLabelValueColor:"none").style("font-size",s.plotArea.dataLabelValueFontSize).style("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-style",Le.includes(ne.italic)?ne.italic:"").attr("text-decoration",Le.includes(ne.underline)?ne.underline:"").attr("font-weight",Le.includes(ne.bold)?ne.bold:"").on("mousemove",(ke,ce)=>{ot([{key:s.yAxisTitle.yAxisTitleText,value:je(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)(ce.data[0].value)},{key:"Legend",value:ce.properties.alias}],s,ke,ce.properties,ht(h,String(ce.data[0]?.legend??""),ce.properties))}).on("mouseout",()=>{rt()}),s.animation.animationEnabled&&ae.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(Xe[s.animation.animationEffect]).attr("opacity",1),we.each((ke,ce)=>{q.append("path").attr("id",`arc-path-${ce}-`+r).attr("d",Q(ke,ce)).attr("fill","none").attr("stroke","none")})}}catch($){Sa("RadialBarChart.tsx","initRadialBarChart",$)}},N=()=>{try{return`translate(${_/2},${b/2})`}catch($){Sa("RadialBarChart.tsx","getPiePosition",$)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},ya="WordCloud.tsx",Tr=({data:{ChartData:t},formatOptions:e,chartId:r,tooltipFormatter:o})=>{const h=Te.useRef();let n=bt(t),l,s,x,L=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,b,_,g,H,D,j=0;Te.useEffect(()=>{K()},[e]);const K=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(h,e)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=Qa(l,x,s),jt(h,s,x,l),g=la(H,S),_t(h,u,s,l),J(),U()},J=()=>{try{j=0,n=n.map(V=>{let N=V.data[0].value;return j+=N,l.plotArea.hideZeroValues&&N==0?null:(N<L&&(L=N),N>A&&(A=N),V)}),n=n.filter(V=>V!==null),D=T.scaleLinear().domain([L,A]).range([12,70])}catch(V){be(ya,"calculateWordCloudData",V)}},U=()=>{try{let V=function(se){try{g.append("g").attr("transform","translate("+X.size()[0]/2+","+X.size()[1]/2+")").selectAll("text").data(se).enter().append("text").attr("font-size",function(re){try{return D(re.data[0].value)+"px"}catch(oe){return be(ya,"draw-font-size",oe),"12px"}}).attr("text-anchor","middle").style("font-family",l.text.textFontFamily).attr("fill",function(re){try{return re.properties.color!==De.white?re.properties.color:"none"}catch(oe){return be(ya,"draw-fill",oe),"none"}}).attr("transform",function(re){try{return"translate("+[re.x,re.y]+")rotate("+re.rotate+")"}catch(oe){return be(ya,"draw-transform",oe),""}}).text(function(re){try{return re.properties.alias}catch(oe){return be(ya,"draw-text",oe),""}}).attr("data-series-id",re=>re.properties.legendUniqueId??re.properties.alias).attr("data-dim-value",re=>re.properties.alias).on("mousemove.text",(re,oe)=>{try{ot([{key:oe.properties.alias,value:je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(oe.data[0].value)},{key:oe.properties.measureUniqueId,value:j}],l,void 0,oe.properties,ht(o,String(oe.properties.alias??""),oe.properties))}catch(he){be(ya,"draw-mousemove",he)}}).on("mouseout.text",()=>{try{rt()}catch(re){be(ya,"draw-mouseout",re)}})}catch(re){be(ya,"draw",re)}},N=l.text.textSpacing,$=l.text.textRotation,X=dl().size([_,b]).words(n).padding(N).rotate(function(){try{return Math.round(Math.random())*$}catch(se){return be(ya,"rotate",se),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(se){try{return D(se.data[0].value)}catch(re){return be(ya,"fontSize",re),12}}).text(function(se){try{return se.properties.alias}catch(re){return be(ya,"text",re),""}}).on("end",V);X.start()}catch(V){be(ya,"drawWordCloudChart",V)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:h,id:r,style:{width:"100%",height:"100%"}})})},vr=({data:t,formatOptions:e,chartId:r})=>{const o=Te.useRef();let h=bt(t),n,l,s,x=40,L=Ht,A,u,S,b=[0,0],_,g;Te.useEffect(()=>{H()},[e]);const H=()=>{({chartFormatOptions:n,svg:g,width:l,height:s}=Jt(o,e)),b=j(),{margins:L,innerHeight:A,innerWidth:u,legendListWidth:S,chartTitleHeight:x}=Na(n,l,s,b,L,!0),jt(o,l,s,n),_=la(g,L),_t(o,x,l,n),D(),K()},D=()=>{try{let J=n.plotArea.dataLabelNameFontStyle,U=n.plotArea.dataLabelValueFontStyle,V=_.attr("class","vennContainer");V&&V.datum(t).call(pl.VennDiagram().width(u).height(A)),V&&V.selectAll(".venn-circle path").style("fill-opacity",n.plotArea.opacity),n.plotArea.dataLabelName?(V&&V.selectAll(".venn-circle text").html(""),V&&V.selectAll(".venn-circle text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",J.includes(ne.italic)?ne.italic:"").attr("text-decoration",J.includes(ne.underline)?ne.underline:"").style("font-weight",J.includes(ne.bold)?ne.bold:"").html(N=>N.label).attr("visibility",n.plotArea.dataLabelName?"visible":"hidden")):(V&&V.selectAll(".venn-circle text").style("visibility","hidden"),V&&V.selectAll(".venn-circle text").html("")),n.plotArea.dataLabelValue&&V&&V.selectAll(".venn-circle text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==De.white?n.plotArea.dataLabelValueColor:"none").style("font-style",U.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",U.includes(ne.underline)?ne.underline:"none").style("font-weight",U.includes(ne.bold)?ne.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(N=>N.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(N.actualValue):"").attr("visibility",n.plotArea.dataLabelValue?"visible":"hidden"),n.plotArea.intersectionLabelVisibility?(V&&V.selectAll(".venn-intersection text").html(""),V&&V.selectAll(".venn-intersection text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",J.includes(ne.italic)?ne.italic:"").attr("text-decoration",J.includes(ne.underline)?ne.underline:"").style("font-weight",J.includes(ne.bold)?ne.bold:"").html(N=>N.label).attr("visibility",n.plotArea.intersectionLabelVisibility?"visible":"hidden")):(V&&V.selectAll(".venn-intersection text").style("visibility","hidden"),V&&V.selectAll(".venn-intersection text").html("")),n.plotArea.intersectionValueVisibility&&V&&V.selectAll(".venn-intersection text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==De.white?n.plotArea.dataLabelValueColor:"none").style("font-style",U.includes(ne.italic)?ne.italic:"normal").attr("text-decoration",U.includes(ne.underline)?ne.underline:"none").style("font-weight",U.includes(ne.bold)?ne.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(N=>N.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+T.format(n.plotArea.dataLabelNumberFormat)(N.actualValue):"").attr("visibility",n.plotArea.intersectionValueVisibility?"visible":"hidden"),V&&V.selectAll(".venn-circle path").style("fill",N=>N.properties?N.properties.color:null),V&&V.selectAll("g").on("mousemove",function(N,$){ot([{key:$.label,value:je(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)($.size)}],n,void 0,$.properties),T.select(this).transition("tooltip").duration(10).selectAll("path").style("stroke-dasharray","5,5").style("stroke-opacity",1).style("stroke","black")}).on("mouseout",function(N,$){rt();var X=T.select(this).transition("tooltip").duration(400);X.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(J){be("VennChart.tsx","drawVennDiagramChart",J)}},j=()=>{try{let J=0,U=0;return h.forEach(V=>{if(V.legendDisplay){let N=It(V.legendDisplay+" : "+V.actualValue,et(n.legends.legendFontSize),n.legends.legendFontFamily);J=Math.max(J,N.width),U=Math.max(U,N.height)}}),[J,U]}catch(J){return be("VennChart.tsx","calculateLegendsMaxPossibleWidth",J),[0,0]}},K=()=>{try{let J=n.legends.legendPosition,U=n.legends.legendAlignmentTopBottom,V=n.legends.legendAlignment;switch(J){case Be.none:break;case Be.right:oa(g,h,l-S-25,x+5,S+15,s-x-10,J,V,nt.none,n,r,!0);break;case Be.top:oa(g,h,5,x+5,l-10,30,J,U,nt.none,n,r,!0);break;case Be.left:oa(g,h,5,L.top,S+15,s-x-10,J,V,nt.none,n,r,!0);break;case Be.bottom:oa(g,h,5,s-35,l-10,30,J,U,nt.none,n,r,!0);break}}catch(J){be("VennChart.tsx","initLegendListWithTotalValueAllowance",J)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:o,id:r,style:{width:"100%",height:"100%"}})})},kr=({formatOptions:t,data:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{if(!e)return null;let l=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],s=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const x=Te.useRef(),L=Te.useRef(o);L.current=o;const A=Te.useRef(h);A.current=h;let u,S,b,_=40,g=Ht,H,D,j,K,J=Oa.left,U=0,V=!1,N=new Map,$=new Map,X=.8,se=.8;Te.useEffect(()=>{re()},[t]);const re=()=>{({chartFormatOptions:u,svg:K,width:S,height:b}=Jt(x,t)),{margins:g,chartTitleHeight:_,innerHeight:H,innerWidth:D}=Qa(u,b,S),oe(),jt(x,S,b,u),j=la(K,g),_t(x,_,S,u),pe()},oe=()=>{try{X=et(u.nodes.nodesFillOpacity),se=et(u.links.linksFillOpacity),s.forEach(p=>{p.totalValue=0}),s.forEach(p=>l.forEach(C=>(p.name==C.source||p.name==C.target)&&(p.totalValue=(p.totalValue||0)+C.value))),s=s.filter(p=>p.totalValue!=0),l=l.filter(p=>p.value!=0);let q=ue(l),w=new Map;q.forEach(p=>{p.nodes.forEach(C=>{w.set(C,p.layer)})}),s.forEach(p=>{let C=w.get(p.name);N.set(C,(N.get(C)||0)+p.totalValue)}),s.forEach(p=>{$.set(p.name,p.totalValue/N.get(w.get(p.name))*100)}),he(q)}catch(q){be("SankeyChart.tsx","prepareDataForSankey",q)}},he=q=>{try{V=u.nodes.nodesLabelWrap,J=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let w="",p=0;s.forEach(d=>{w=d.name.length>w.length?d.name:w,p=d.totalValue.toString().length>p.toString().length?d.totalValue:p});let C=It(w,et(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),c=It(je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(p),et(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);U=Math.max(C.width,c.width)+6,V&&(U=Math.min(D*.1,U))}catch(w){be("SankeyChart.tsx","calculateMaxNodeValueWidth",w)}},Le=(q,w)=>{try{let p=u.nodes.spacing!==void 0?et(u.nodes.spacing)*1.5:15,C=u.nodes.sankeyNodeWidth!==void 0?u.nodes.sankeyNodeWidth:10,c=[],d=[];switch(J){case Oa.center:c=[1,5],d=[D,H];break;case Oa.right:c=[1,5],d=[D-U,H];break;case Oa.left:c=[U,5],d=[D,H];break;default:c=[1,5],d=[D,H];break}return Ti.sankey().nodeId(y=>y.name).nodeAlign(Ti.sankeyJustify).nodeWidth(C).nodePadding(p).extent([c,d]).nodeSort(null)({nodes:q.map(y=>Object.assign({},y)),links:w.map(y=>Object.assign({},y))})}catch(p){return be("SankeyChart.tsx","getsankey",p),{nodes:[],links:[]}}},pe=()=>{try{let q=function(){try{const f={};c.forEach(a=>{const m=a.x0;f[m]||(f[m]=[]),f[m].push(a)}),Object.keys(f).forEach(a=>{const m=f[a];if(m.length===0)return;m.sort((ge,we)=>ge.y0-we.y0);const P=m[0],ie=m[m.length-1],Q=P.y1-P.y0,Ae=ie.y1-ie.y0;if(P.y0=0,P.y1=Q,ie.y1=H,ie.y0=H-Ae,m.length>2){const ge=m.slice(1,m.length-1),we=ie.y0-P.y1,fe=T.sum(ge,ce=>ce.y1-ce.y0),ae=(we-fe)/(ge.length+1);let ke=P.y1+ae;ge.forEach(ce=>{const me=ce.y1-ce.y0;ce.y0=ke,ce.y1=ke+me,ke+=me+ae})}})}catch(f){be("SankeyChart.tsx","centerAlignNodesByLayer",f)}},w=function(){try{c.forEach(f=>{let a=0,m=0;f.sourceLinks.forEach(P=>{P.sy=a,a+=P.width}),f.targetLinks.forEach(P=>{P.ty=m,m+=P.width})})}catch(f){be("SankeyChart.tsx","arrangeFlows",f)}},p=function(f){return function(a){try{const m=a.source.x1,P=a.source.y0+a.sy+a.width/2,ie=a.target.x0,Q=a.target.y0+a.ty+a.width/2,Ae=ie-m,ge=m+Ae*f,we=ie-Ae*f;return`M${m},${P} C${ge},${P} ${we},${Q} ${ie},${Q}`}catch(m){return be("SankeyChart.tsx","sankeyLinkCustom",m),""}}},C=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:c,links:d}=Le(s,l);w(),q(),w(),w();const i=j.append("g").selectAll("rect").data(c).enter().append("rect").style("fill-opacity",X).attr("id",f=>"Node"+f.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none").attr("stroke-width",u.nodes.nodesBorderVisibility?u.nodes.nodesBorderThickness:0).attr("x",f=>f.x0).attr("y",f=>f.y0).attr("height",f=>f.y1-f.y0).attr("width",f=>f.x1-f.x0).attr("fill",f=>f.color?f.color:De.white).on("mousemove",function(f,a){try{u.toolTip.toolTipVisibility&&ot([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?$.get(a.name)+"%":je(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},ht(n,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),j.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),j.selectAll(".sankey-nodes-texts").style("opacity","0"),j.selectAll(".sankey-links").style("stroke-opacity",.1),j.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",X).style("cursor","pointer"),j.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(m=>{j.select(`#Node${m.target.index}`).style("fill-opacity",X).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${m.index}`).style("stroke-opacity",se),j.select(`#Label${m.target.index}`).style("opacity",1)}),a.targetLinks.forEach(m=>{j.select(`#Node${m.source.index}`).style("fill-opacity",X).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Link${m.index}`).style("stroke-opacity",se),j.select(`#Label${m.source.index}`).style("opacity",1)})}catch(m){be("SankeyChart.tsx","Nodes.onMouseMove",m)}}).on("mouseout",function(f){try{j.selectAll(".sankey-nodes").style("fill-opacity",X).style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",se),j.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&rt()}catch(a){be("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(Qe.SeriesId,f=>String(f.name??"")).attr(Qe.DimValue,f=>String(f.name??"")).on("click",At(A,L,(f,a)=>{const m=String(a.name??"");return{seriesId:m,dimValue:m,legendUniqueId:m,seriesDisplayName:m.includes("~$~")?m.split("~$~")[1]:m}}));if(j.append("g").attr("fill","none").selectAll("g").data(d).enter().append("g").style("mix-blend-mode","multiply").append("path").attr("class","sankey-links").attr("stroke-opacity",se).attr("id",f=>"Link"+f.index).attr("d",p(C)).attr("stroke",f=>u.links.linksColor==="Source"?f.source.color:f.target.color).attr("stroke-width",f=>Math.max(1,f.width)).on("mousemove",function(f,a){try{j.selectAll(".sankey-links").style("stroke-opacity",.1),j.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),j.selectAll(".sankey-nodes-texts").style("opacity","0"),j.select(`#Link${a.index}`).style("stroke-opacity",se).style("cursor","pointer"),j.select(`#Node${a.target.index}`).style("fill-opacity",X).style("Stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Node${a.source.index}`).style("fill-opacity",X).style("Stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.select(`#Label${a.target.index}`).style("opacity",1),j.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&ot([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:je(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},ht(n,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(m){be("SankeyChart.tsx","link.onMouseMove",m)}}).on("mouseout",function(f){try{u.toolTip.toolTipVisibility&&rt(),j.selectAll(".sankey-nodes").style("fill-opacity",X),j.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==De.white?u.nodes.nodesBorderColor:"none"),j.selectAll(".sankey-links").style("stroke-opacity",se),j.selectAll(".sankey-nodes-texts").style("opacity","1"),T.select(this).select("rect").style("pointer-events","all"),T.select(this).style("cursor","none")}catch(a){be("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const f=j.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ne.bold)?ne.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(c).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const m=u.nodes.sankeyNodeWidth,P=J===Oa.center;T.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y-16).attr("width",Ae=>P?m:U).attr("height",20).append("xhtml:div").style("white-space",P||V?"nowrap":"normal").style("overflow",P||V?"hidden":"visible").style("text-overflow",P||V?"ellipsis":"clip").style("display","block").style("max-width",Ae=>P?"100px":U+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ne.bold)?ne.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",Ae=>$.get(Ae.name)>0?Ae.alias?Ae.alias.includes("~$~")?Ae.alias.split("~$~")[1]:Ae.alias:Ae.name.includes("~$~")?Ae.name.split("~$~")[1]:Ae.name:"").text(Ae=>$.get(Ae.name)>0?Ae.alias?Ae.alias.includes("~$~")?Ae.alias.split("~$~")[1]:Ae.alias:Ae.name.includes("~$~")?Ae.name.split("~$~")[1]:Ae.name:""),T.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y).attr("width",Ae=>P?m:U).attr("height",20).append("xhtml:div").style("white-space",P||V?"nowrap":"normal").style("overflow",P||V?"hidden":"visible").style("text-overflow",P||V?"ellipsis":"clip").style("display","block").style("max-width",Ae=>P?"100px":U+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(ne.italic)?ne.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ne.underline)?ne.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ne.bold)?ne.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",Ae=>$.get(Ae.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(Ae.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(Ae.totalValue):"").text(Ae=>$.get(Ae.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(Ae.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":je(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(Ae.totalValue):"")}}catch(m){be("SankeyChart.tsx","texts.each",m)}})}catch(f){be("SankeyChart.tsx","inittree.texts",f)}}catch(q){be("SankeyChart.tsx","inittree",q)}};function ue(q){try{const w=new Map,p=new Map,C=new Set;for(const{source:f,target:a}of q)C.add(f),C.add(a),w.has(a)||w.set(a,new Set),p.has(f)||p.set(f,new Set),w.get(a).add(f),p.get(f).add(a);const c=new Map,d=[];for(const f of C)w.has(f)||(c.set(f,0),d.push(f));for(;d.length>0;){const f=d.shift(),a=c.get(f),m=p.get(f)||[];for(const P of m){const ie=a+1;(!c.has(P)||c.get(P)<ie)&&(c.set(P,ie),d.push(P))}}const i=new Map;for(const[f,a]of c.entries())i.has(a)||i.set(a,[]),i.get(a).push(f);return[...i.entries()].sort((f,a)=>f[0]-a[0]).map(([f,a])=>({layer:f,nodes:a}))}catch(w){return be("SankeyChart.tsx","assignNodeLayers",w),[]}}const O=q=>{try{let w={};const p=Number(u.nodes.sankeyNodeWidth),C=p/2;switch(J){case"Right":w.x=q.x1+6;break;default:case"Left":w.x=q.x0-U;break;case"Center":w.x=q.x0+C-p/2;break}return w.y=(q.y1+q.y0)/2,w}catch(w){return be("SankeyChart.tsx","getXandYPositionOfLables",w),{x:0,y:0}}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:x,id:r,style:{width:"100%",height:"100%"}})})},Cr={type:"FeatureCollection",features:[{type:"Feature",id:"AL",properties:{name:"Alabama",value:55},geometry:{type:"Polygon",coordinates:[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}},{type:"Feature",id:"AK",properties:{name:"Alaska",value:87},geometry:{type:"MultiPolygon",coordinates:[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[173.107557,52.992929],[173.293773,52.927205],[173.304726,52.823143],[172.90491,52.762897],[172.642017,52.927205],[172.642017,53.003883],[173.107557,52.992929]]]]}},{type:"Feature",id:"AZ",properties:{name:"Arizona",value:98},geometry:{type:"Polygon",coordinates:[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}},{type:"Feature",id:"AR",properties:{name:"Arkansas",value:5},geometry:{type:"Polygon",coordinates:[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}},{type:"Feature",id:"CA",properties:{name:"California",value:38},geometry:{type:"Polygon",coordinates:[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}},{type:"Feature",id:"CO",properties:{name:"Colorado",value:59},geometry:{type:"Polygon",coordinates:[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}},{type:"Feature",id:"CT",properties:{name:"Connecticut",value:45},geometry:{type:"Polygon",coordinates:[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}},{type:"Feature",id:"DE",properties:{name:"Delaware",value:76},geometry:{type:"Polygon",coordinates:[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}},{type:"Feature",id:"FL",properties:{name:"Florida",value:3},geometry:{type:"Polygon",coordinates:[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}},{type:"Feature",id:"GA",properties:{name:"Georgia",value:77},geometry:{type:"Polygon",coordinates:[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}},{type:"Feature",id:"HI",properties:{name:"Hawaii",value:88},geometry:{type:"MultiPolygon",coordinates:[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}},{type:"Feature",id:"ID",properties:{name:"Idaho",value:22},geometry:{type:"Polygon",coordinates:[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}},{type:"Feature",id:"IL",properties:{name:"Illinois",value:83},geometry:{type:"Polygon",coordinates:[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}},{type:"Feature",id:"IN",properties:{name:"Indiana",value:100},geometry:{type:"Polygon",coordinates:[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}},{type:"Feature",id:"IA",properties:{name:"Iowa",value:44},geometry:{type:"Polygon",coordinates:[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}},{type:"Feature",id:"KS",properties:{name:"Kansas",value:76},geometry:{type:"Polygon",coordinates:[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}},{type:"Feature",id:"KY",properties:{name:"Kentucky",value:29},geometry:{type:"Polygon",coordinates:[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}},{type:"Feature",id:"LA",properties:{name:"Louisiana",value:94},geometry:{type:"Polygon",coordinates:[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}},{type:"Feature",id:"ME",properties:{name:"Maine",value:44},geometry:{type:"Polygon",coordinates:[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}},{type:"Feature",id:"MD",properties:{name:"Maryland",value:66},geometry:{type:"MultiPolygon",coordinates:[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}},{type:"Feature",id:"MA",properties:{name:"Massachusetts",value:39},geometry:{type:"Polygon",coordinates:[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}},{type:"Feature",id:"MI",properties:{name:"Michigan",value:70},geometry:{type:"MultiPolygon",coordinates:[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}},{type:"Feature",id:"MN",properties:{name:"Minnesota",value:11},geometry:{type:"Polygon",coordinates:[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}},{type:"Feature",id:"MS",properties:{name:"Mississippi",value:66},geometry:{type:"Polygon",coordinates:[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}},{type:"Feature",id:"MO",properties:{name:"Missouri",value:36},geometry:{type:"Polygon",coordinates:[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}},{type:"Feature",id:"MT",properties:{name:"Montana",value:99},geometry:{type:"Polygon",coordinates:[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}},{type:"Feature",id:"NE",properties:{name:"Nebraska",value:55},geometry:{type:"Polygon",coordinates:[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}},{type:"Feature",id:"NV",properties:{name:"Nevada",value:65},geometry:{type:"Polygon",coordinates:[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}},{type:"Feature",id:"NH",properties:{name:"New Hampshire",value:32},geometry:{type:"Polygon",coordinates:[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}},{type:"Feature",id:"NJ",properties:{name:"New Jersey",value:50},geometry:{type:"Polygon",coordinates:[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}},{type:"Feature",id:"NM",properties:{name:"New Mexico",value:79},geometry:{type:"Polygon",coordinates:[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:55},geometry:{type:"Polygon",coordinates:[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}},{type:"Feature",id:"NC",properties:{name:"North Carolina",value:78},geometry:{type:"Polygon",coordinates:[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}},{type:"Feature",id:"ND",properties:{name:"North Dakota",value:98},geometry:{type:"Polygon",coordinates:[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}},{type:"Feature",id:"OH",properties:{name:"Ohio",value:22},geometry:{type:"Polygon",coordinates:[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}},{type:"Feature",id:"OK",properties:{name:"Oklahoma",value:1},geometry:{type:"Polygon",coordinates:[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}},{type:"Feature",id:"OR",properties:{name:"Oregon",value:87},geometry:{type:"Polygon",coordinates:[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}},{type:"Feature",id:"PA",properties:{name:"Pennsylvania",value:37},geometry:{type:"Polygon",coordinates:[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}},{type:"Feature",id:"RI",properties:{name:"Rhode Island",value:78},geometry:{type:"MultiPolygon",coordinates:[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}},{type:"Feature",id:"SC",properties:{name:"South Carolina",value:54},geometry:{type:"Polygon",coordinates:[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}},{type:"Feature",id:"SD",properties:{name:"South Dakota",value:0},geometry:{type:"Polygon",coordinates:[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}},{type:"Feature",id:"TN",properties:{name:"Tennessee",value:66},geometry:{type:"Polygon",coordinates:[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}},{type:"Feature",id:"UT",properties:{name:"Utah",value:87},geometry:{type:"Polygon",coordinates:[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}},{type:"Feature",id:"VT",properties:{name:"Vermont",value:55},geometry:{type:"Polygon",coordinates:[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}},{type:"Feature",id:"VA",properties:{name:"Virginia",value:55},geometry:{type:"MultiPolygon",coordinates:[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}},{type:"Feature",id:"WA",properties:{name:"Washington",value:77},geometry:{type:"MultiPolygon",coordinates:[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}},{type:"Feature",id:"WV",properties:{name:"West Virginia",value:57},geometry:{type:"Polygon",coordinates:[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}},{type:"Feature",id:"WI",properties:{name:"Wisconsin",value:99},geometry:{type:"Polygon",coordinates:[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}},{type:"Feature",id:"WY",properties:{name:"Wyoming",value:5},geometry:{type:"Polygon",coordinates:[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}}]},Mr=({data:t,geoJsonNode:e,formatOptions:r,chartId:o})=>{const h=Te.useRef();let n=bt(t),l,s,x,L=Number.MAX_VALUE,A=Number.MIN_VALUE,u=40,S=Ht,b,_,g,H,D=0,j=1,K,J=new Map,U=new Map,V=new Map,N=Number.MAX_VALUE,$=Number.MIN_VALUE,X=0,se=0,re,oe;Te.useEffect(()=>{he()},[r,o]);const he=()=>{({chartFormatOptions:l,svg:H,width:s,height:x}=Jt(h,r)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=Qa(l,x,s),jt(h,s,x,l),g=la(H,S),_t(h,u,s,l),Le(t),pe(),ue(),O()},Le=w=>{try{let p=new Set,C=new Set;w.forEach(i=>{i.data.forEach((y,f)=>{f===D&&(p.add(y.value.toString()),X+=y.value),f===j&&(C.add(y.value.toString()),se+=y.value)})});let c=l.colorScaleForMaps&&l.colorScaleForMaps.startColorForMaps?l.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=l.colorScaleForMaps&&l.colorScaleForMaps.endColorForMaps?l.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(p.size===1)re=()=>c;else{const i=T.interpolateLab(c,d);re=T.scaleOrdinal().domain(Array.from(p)).range(Array.from(p).map((y,f)=>i(f/(p.size-1))))}if(C.size===1)oe=()=>c;else{const i=T.interpolateLab(l.colorScaleForMapsBubble.startColorForMapsBubble,l.colorScaleForMapsBubble.endColorForMapsBubble);oe=T.scaleOrdinal().domain(Array.from(C)).range(Array.from(C).map((y,f)=>i(f/(C.size-1))))}}catch(p){be("Maps.tsx","dataPreparation",p)}},pe=w=>{K=Cr},ue=()=>{try{n?.forEach(w=>{V.set(w.legend,w)}),e.mappings.forEach(w=>{U.set(w.actualName,w.mappedName)}),e.groups.forEach(w=>{w.groupedRegions.forEach(p=>{J.set(p,w.groupName)})}),K.features.forEach(w=>{const p=w.properties.name;let C;if(U.has(p)){const c=U.get(p);w.properties.displayName=c,C=c}if(J.has(p)){const c=J.get(p);w.properties.displayName=c,C=c}else C=p;if(V.has(C)){const c=V.get(C);w.properties.data=c;let d;c.data&&c.data[1]&&(d=c.data[1]?c.data[1].value:0,N=Math.min(N,d),$=Math.max($,d)),c.data&&c.data[0]&&(d=c.data[0].value,L=Math.min(L,d),A=Math.max(A,d))}else w.properties.data=void 0})}catch(w){be("Maps.tsx","generateDataForMaps",w)}},O=()=>{try{let w=0;const p=T.geoAlbersUsa().fitSize([_,b],K),C=T.geoPath().projection(p),c=g.append("g").attr("class","paths");if(c.selectAll(o+" .path-group").data(K.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>q(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",l.plotArea.opacity).attr("stroke-width","0.4px").attr("d",d=>(w+=C.area(d),C(d))).on("mousemove",(d,i)=>{let y=i.properties.data;if(y){let f=y.data.map(a=>({key:a.dimension,value:je("None",l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.value)}));ot([{key:"Region",value:y.properties.alias},...f],l,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{rt()}),l.plotArea.dataLabels){const d=w/K.features.length,i=l.plotArea.dataLabelName,y=l.plotArea.dataLabelValue,f=a=>l.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?C.area(a)<d*.25:!1;c.selectAll(".text-container").data(K.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>C.centroid(a)[0]-50).attr("y",a=>{const m=C.centroid(a);return i&&y?m[1]-15:m[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let m=a.properties.data;if((i||y)&&m&&!f(a)){if(f(a))return null;const P=m?.properties.alias||a.properties.displayName,ie=l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/X*100)+"%":je(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let Q="";return l.plotArea.dataLabelName&&(Q+=`<div style=
143
+ ${v.format(".2s")(y.data.data[0].value)}
144
+ </span>`),a}catch(T){return Ae(Va,"drawDonutDataLabels",T),""}}),b.animation.animationEnabled&&$.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",1)}}catch(o){Ae(Va,"drawDonutDataLabels",o)}},k=()=>{try{if(b.total&&b.total.totalVisibility){let o=ce,d=b.total.totalFontStyle;const i=$.append("g").attr("transform",G()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",b.total.totalColor!==Re.white?b.total.totalColor:"none").style("font-family",b.total.totalFontFamily).style("font-size",b.total.totalFontSize).style("font-style",d.includes(oe.italic)?oe.italic:"").style("text-decoration",d.includes(oe.underline)?oe.underline:"").style("font-weight",d.includes(oe.bold)?oe.bold:"").attr("text-anchor","middle").attr("visibility",b.plotArea.dataLabelValue?"visible":"hidden").text(b.total.showTotalLabel!==!1?b.total.editTotalText:"").append("tspan").attr("x",0).attr("y",b.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(oe.bold)?oe.bold:300).text(b.total.totalNumberFormat===",.0%"||b.total.totalNumberFormat==="Percentage"?"100%":qe(b.total.totalDisplayUnits,b.total.totalNumberFormat,b.total.totalDecimalPrecision)(o)),b.animation.animationEnabled&&i.attr("opacity",0).transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",1)}}catch(o){Ae(Va,"drawTotalValue",o)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:f,id:r,style:{width:"100%",height:"100%"}})})},Xa="TreemapChart.tsx",Tr=({data:t,formatOptions:e,chartId:r,onElementClick:c,vfxPickModeActive:x,tooltipFormatter:n})=>{const l=Me.useRef(),s=Me.useRef(c);s.current=c;const p=Me.useRef(x);p.current=x;let f,L,u,S=40,b=jt,_,A,R,g,B,U;Me.useEffect(()=>{W()},[e]);const W=()=>{({chartFormatOptions:f,svg:U,width:L,height:u}=qt(l,e)),{margins:b,chartTitleHeight:S,innerHeight:_,innerWidth:A}=ii(f,u,L,!0),Xt(l,L,u,f),R=oa(U,b),Zt(l,S,L,f),P(),D(),ce()},P=()=>{try{const ne={name:"root",children:t.ChartData},ae=v.hierarchy(ne).sum(ue=>ue.data&&ue.data[0].value).sort((ue,ge)=>(ge.data.data[0].value??0)-(ue.data.data[0].value??0));g=v.treemap().tile(v.treemapSquarify).size([A,_]).padding(1).round(!0)(ae).leaves(),B=g[0].data.properties.color}catch(ne){Ae(Xa,"initChartData",ne)}},D=()=>{try{if(f.colorScale.showColor===Ta.colorTheme){let ae=g[0].data.data.length>1?1:0,ue=f.colorScale.startColor,ge=f.colorScale.endColor,be=new Set(g.map(M=>M.data.data[ae].value)),pe=Array.from(be).sort((M,h)=>M-h),Q=pe.length,G;if(Q===1)G=()=>ue;else{const M=v.interpolateLab(ue,ge);G=v.scaleOrdinal().domain(pe.map(String)).range(pe.map((h,k)=>M(k/(Q-1))))}g=g.map(M=>{let h=M.data.data[ae].value;return{...M,data:{...M.data,properties:{...M.data.properties,themeColor:G(h.toString())}}}}),V(ue,ge,Q,pe)}}catch(ne){Ae(Xa,"prepareTreeColors",ne)}},V=(ne,ae,ue,ge)=>{try{let be=v.scalePow().exponent(1).domain([0,ue-1]).range([ne,ae]),Q=U.append("foreignObject").attr("class","parentGroup").attr("x",L-130).attr("y",u-30).attr("width",115).attr("height",10).selectAll(null).data(ge).enter().append("xhtml:div").style("width",`${100/ue}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(M,h)=>be(h)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const G=U.append("g").attr("transform",`translate(${L-120},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",f.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",f.yAxisTitle.yAxisTitleFontFamily).text("min");U.append("g").attr("transform",`translate(${L-10},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",f.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",f.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(be){Ae(Xa,"appendColorScale",be)}},$=ne=>{try{switch(f.colorScale.showColor){case Ta.none:return B;case Ta.discrete:return ne.properties.color;case Ta.colorTheme:return ne.properties.themeColor;default:return}}catch(ae){Ae(Xa,"getColor",ae)}},Z=ne=>{try{const ae=ne?.currentTarget?.__data__?.data?.properties;if(!ae)return;switch(f.colorScale.showColor){case Ta.none:return{...ae,markerColor:B};case Ta.colorTheme:return{...ae,markerColor:ae.themeColor};case Ta.discrete:default:return ae}}catch(ae){Ae(Xa,"getMarkerColorForTooltip",ae)}},ce=()=>{try{const ne=f.animation.animationEnabled,ae=R.selectAll("g").data(g).enter().append("g").attr("transform",ge=>`translate(${ge.x0},${ge.y0})`),ue=ae.append("rect").attr("fill",ge=>$(ge.data)).attr("fill-opacity",ne?0:.7).attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0).on("mousemove",(ge,be)=>{yt([{key:f.yAxisTitle.yAxisTitleText,value:qe(f.toolTip.toolTipDisplayUnits,f.toolTip.toolTipNumberFormat,f.toolTip.toolTipDecimalPrecision)(be.data.data[0].value)},{key:"Legend",value:be.data.data[0].legend}],f,void 0,Z(ge),gt(n,String(be.data.data[0]?.legend??""),Z(ge)))}).on("mouseout",()=>ot()).attr(lt.SeriesId,ge=>String(ge.data.properties?.legendUniqueId??ge.data.legend??"")).attr(lt.DimValue,ge=>String(ge.data.data[0].legend??"")).on("click",Tt(p,s,(ge,be)=>{const pe=String(be.data.properties?.legendUniqueId??be.data.legend??""),Q=String(be.data.data[0].legend??"");return{seriesId:pe,dimValue:Q,legendUniqueId:pe,seriesDisplayName:String(be.data.properties?.alias||be.data.properties?.name||Q)}}));if(ne&&ue.transition().duration(f.animation.animationDuration).ease(et[f.animation.animationEffect]).attr("fill-opacity",.7),ae.append("clipPath").attr("id",(ge,be)=>`clip-${be}-${r}`).append("rect").attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0),f.plotArea.dataLabels){const ge=f.annotation.annotationRangeFilter;ae.filter(be=>{if(!ge?.enabled)return!0;const pe=be.data.data[0].value;switch(ge.condition){case"lt":return pe<ge.maxVal;case"gt":return pe>ge.minVal;case"in":return pe>=ge.minVal&&pe<=ge.maxVal;case"not-in":return pe<ge.minVal||pe>ge.maxVal;default:return!0}}).append("text").style("fill",be=>be.data.properties.labelFontColor).style("font-family",be=>be.data.properties.fontFamily).style("font-size",be=>be.data.properties.fontSize).style("font-style",be=>be.data.properties.fontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",be=>be.data.properties.fontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",be=>be.data.properties.fontStyle.includes(oe.bold)?oe.bold:"").attr("clip-path",(be,pe)=>`url(#clip-${pe}-${r})`),f.plotArea.dataLabelName&&ae.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(be=>be.data.legend),f.plotArea.dataLabelValue&&ae.selectAll("text").append("tspan").attr("x",5).attr("y",f.plotArea.dataLabelName?"2.1em":"1.1em").text(be=>qe(f.plotArea.plotAreaDisplayUnits,f.plotArea.dataLabelNumberFormat,f.plotArea.dataLabelDecimalPrecision)(be.data.data[0].value)),ne&&ae.selectAll("text").attr("opacity",0).transition().duration(f.animation.animationDuration).ease(et[f.animation.animationEffect]).attr("opacity",1)}}catch(ne){Ae(Xa,"initChartRect",ne)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},ca="PieofPieChart.tsx",vr=({data:t,formatOptions:e,chartId:r,legendProperties:c,tooltipFormatter:x})=>{const n=Me.useRef();let l,s,p,f=40,L=jt,u,S,b,_,A,R,g,B,U,W,P,D,V,$=[0,0],Z,ce;Me.useEffect(()=>{ne()},[e]);const ne=()=>{({chartFormatOptions:l,svg:_,width:s,height:p}=qt(n,e)),{plotArea:ce}=l,ae(),{margins:L,innerHeight:u,innerWidth:S,legendListWidth:Z,chartTitleHeight:f}=$a(l,s,p,$,L),ue(),Xt(n,s,p,l),b=oa(_,L),Zt(n,f,s,l),ge(),be(),h(),Si(l,B,f,_,s,p),d()},ae=()=>{try{let i=zt(Ji(c,"name"),rt(l.legends.legendFontSize),l.legends.legendFontFamily);$=[i.width,i.height]}catch(i){Ae(ca,"calculateMaxPossibleWidth",i)}},ue=()=>{try{R=Math.min(u*.4,S*.4),g=l.pieofPie.pieOfPieRadius}catch(i){Ae(ca,"calculatePieRadius",i)}},ge=()=>{try{let i=new Map;c.forEach(a=>{i.set(a.name,a)}),B=0,t.forEach(a=>{a.properties=i.get(a.legend),B+=a.data[0].value,a.children&&a.children.forEach(m=>m.properties=i.get(m.legend))}),A=v.pie().value(a=>a.data[0].value)(t).map((a,m)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:R,depth:2}))}catch(i){Ae(ca,"initChartData",i)}},be=()=>{try{const i=v.arc().innerRadius(0).outerRadius(R),y=v.arc().innerRadius(0).outerRadius(R+10),T=b.append("g").attr("class","parentGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${Q()}`).selectAll("path").data(A).enter().append("path").attr("class",a=>"path "+a.data.legend).attr("hoverId",a=>a.data.legend.replace(/ /g,"-")).attr("fill",a=>a.data.properties.color!==Re.white?a.data.properties.color:"none").on("mouseover.arc",function(a){v.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{yt([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/B)*100).toFixed(rt(l.toolTip.toolTipDecimalPrecision)??0)+"%":qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],l,void 0,a.currentTarget.__data__.data.properties,gt(x,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(a){v.select(this).transition().duration(100).attr("d",i),ot()}).on("click",(a,m)=>{try{let N=m;if(N.data.children&&N.data.children.length>1){b.selectAll(".childGroup").remove(),b.selectAll(".childLabels").remove(),b.selectAll("line").remove(),U=N.data.legend;let re=90-(m.x0+m.x1)/2/Math.PI*180;pe(N.data.children,re,m)}}catch(N){Ae(ca,"drawPieChart_onClick",N)}});l.animation.animationEnabled?T.transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attrTween("d",function(a){const m=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return N=>i(m(N))}):T.attr("d",a=>i(a))}catch(i){Ae(ca,"drawPieChart",i)}},pe=(i,y,T)=>{try{b.select(".parentGroup").transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`${Q()} rotate(${y})`),b.selectAll(".parentLabels").transition().duration(l.animation.animationDuration).ease(et[l.animation.animationEffect]).attr("transform",`${Q()} rotate(${y})`);let m=v.pie().value(K=>K.data[0].value)(i).map((K,me)=>({...K,x0:K.startAngle,x1:K.endAngle,y0:0,y1:g,depth:2}));const N=v.arc().innerRadius(0).outerRadius(g),re=v.arc().innerRadius(0).outerRadius(g+10);b.append("g").attr("class","childGroup").attr("fill-opacity",l.plotArea.opacity).attr("transform",`${G()}`).selectAll("path").data(m).enter().append("path").attr("class",K=>"path "+K.data.legend).attr("hoverId",K=>K.data.legend.replace(/ /g,"-")).attr("fill",K=>K.data.properties.color!==Re.white?K.data.properties.color:"none").attr("d",K=>N(K)).on("mouseover.arc",function(K){v.select(this).transition().duration(100).attr("d",re)}).on("mousemove.text",K=>{yt([{key:l.yAxisTitle.yAxisTitleText,value:l.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(K.currentTarget.__data__.data.data[0].value/B)*100).toFixed(rt(l.toolTip.toolTipDecimalPrecision))+"%":qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(K.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:K.currentTarget.__data__.data.legend}],l,void 0,K.currentTarget.__data__.data.properties,gt(x,String(K.currentTarget.__data__.data.legend??""),K.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(K){v.select(this).transition().duration(100).attr("d",N),ot()}),k(m),o(T,i)}catch(a){Ae(ca,"drawChildPie",a)}},Q=()=>{try{return W=U?3*S/8:S/2,P=u/2,`translate(${W},${P})`}catch(i){Ae(ca,"getParentPiePosition",i)}},G=()=>{try{return D=3*S/4,V=u/2,`translate(${D},${V})`}catch(i){Ae(ca,"getChildPiePosition",i)}},M=(i,y)=>{try{const T=(i.startAngle+i.endAngle)/2,a=Math.cos(T-Math.PI/2)*(y*.65),m=Math.sin(T-Math.PI/2)*(y*.65);let N=T*180/Math.PI-90;return`translate(${a},${m}) rotate(${N})`}catch(T){Ae(ca,"getDataLabelTransformString",T)}},h=()=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(A,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.labelFontSize??11).attr("fill",i=>i.data.properties?.labelFontColor??Re.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",i=>i.data.properties?.labelFont??tt).attr("transform",i=>M(i,R)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=l;return y.dataLabelName?i.data.legend:""}),b.append("g").attr("class","parentLabels parentGroup").attr("transform",`${Q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(A,l,i=>i.data.data[0].value)).enter().append("text").attr("hoverId",i=>i.data.legend.replace(/ /g,"-")).attr("font-size",i=>i.data.properties?.valueFontSize??11).attr("fill",i=>i.data.properties?.valueFontColor??Re.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??tt).attr("transform",i=>M(i,R)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(l.plotArea.dataLabelValue){const y=i.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&y!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/B)*100).toFixed(rt(l.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){Ae(ca,"drawParentPieDataLabels",i)}},k=i=>{try{l.plotArea.dataLabels&&(b.append("g").attr("class","childLabels parentGroup").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.labelFontSize??11).attr("fill",y=>y.data.properties?.labelFontColor??Re.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(oe.bold)?oe.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,g)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=l;return T.dataLabelName?y.data.legend:""}),b.append("g").attr("class","childLabels parentGroup").attr("transform",`${G()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Yt(i,l,y=>y.data.data[0].value)).enter().append("text").attr("hoverId",y=>y.data.legend.replace(/ /g,"-")).attr("font-size",y=>y.data.properties?.valueFontSize??11).attr("fill",y=>y.data.properties?.valueFontColor??Re.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(oe.italic)?oe.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(oe.underline)?oe.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(oe.bold)?oe.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("transform",y=>M(y,g)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(l.plotArea.dataLabelValue){const T=y.data.data[0].value;return l.plotArea.dataLabelName&&l.plotArea.dataLabelValue&&T!==void 0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/B)*100).toFixed(rt(l.plotArea.dataLabelDecimalPrecision)??0)+"%":qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(T):T}}))}catch(y){Ae(ca,"drawChildPieDataLabels",y)}},o=(i,y)=>{try{let T=Math.abs(i.x0-i.x1)/2,m=i.y1*Math.sin(T),N=m/Math.tan(T);b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",W+N).attr("y1",P-m).attr("x2",D).attr("y2",V-g),b.append("line").style("stroke",l.pieofPie.pieOfPieLineColor).style("stroke-width",l.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",W+N).attr("y1",P+m).attr("x2",D).attr("y2",V+g)}catch(T){Ae(ca,"drawLines",T)}},d=()=>{try{let i=c.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){Ae(ca,"initLegendList",i)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},xa="PyramidChart.tsx",kr=({data:t,formatOptions:e,chartId:r,onDataLabelCoordinatesChange:c,addLocalFilterFromLib:x,tooltipFormatter:n})=>{const l=Me.useRef();let s=Lt(t.ChartData),p,f,L,u,S=40,b=jt,_=[0,0],A,R,g,B,U=[0],W,P,D,V;Me.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:p,svg:f,width:L,height:u}=qt(l,e)),_=Ua(p,s),{margins:b,innerHeight:A,innerWidth:R,legendListWidth:D,chartTitleHeight:S}=$a(p,L,u,_,b),Z(),Xt(l,L,u,p),W=ce(),Zt(l,S,L,p),Ya(p,f,s,L,u,D,S,r,b,ct.rectangle,!1,x),ne(),ae(),ge(),ue()},Z=()=>{try{g=Math.min(A,R),B=.866*g}catch(pe){Ae(xa,"initPyramidSideCalculations",pe)}},ce=()=>{try{return f.append("g").attr("transform",`translate(${b.left},${b.top+(A-B)/2})`)}catch(pe){return Ae(xa,"initChartArea",pe),null}},ne=()=>{try{s=s.sort((pe,Q)=>{const G=pe.data[0].value,M=Q.data[0].value;return p.plotArea.flipPyramid?M-G:G-M}),P=v.sum(s,pe=>Math.abs(pe.data[0].value)),U=[0],s.forEach((pe,Q)=>{const G=Math.abs(pe.data[0].value)/P*B;U.push(U[Q]+G)})}catch(pe){Ae(xa,"initPyramidData",pe)}},ae=()=>{try{s.forEach((pe,Q)=>{try{const G=U[Q],M=U[Q+1];let h=p.plotArea.flipPyramid?1:0;const k=g*(h-U[Q]/B),o=g*(h-U[Q+1]/B),d=R/2,i=W.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=p.animation.animationEnabled,T=i.append("polygon").attr("class","segment").attr("hoverId",pe.legend.replace(/\s+/g,"-")).attr("data-series-id",pe.legendUniqueId??pe.legend).attr("data-dim-value",pe.legend).attr("points",`
145
+ ${d-k/2},${G}
146
+ ${d+k/2},${G}
147
+ ${d+o/2},${M}
148
+ ${d-o/2},${M}
149
+ `).attr("fill",pe.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{yt([{key:pe.legend,value:p.toolTip.toolTipNumberFormat==",.0%"?pe.data[0].value?(Math.abs(pe.data[0].value/P)*100).toFixed(rt(p.toolTip.toolTipDecimalPrecision))+"%":"":qe(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(pe.data[0].value)}],p,void 0,pe.properties,gt(n,String(pe.legend??""),pe.properties)),v.select(this).style("opacity",.8).style("stroke",p.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){Ae(xa,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{ot(),v.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){Ae(xa,"drawPyramidChart.onMouseOut",a)}});y&&T.transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1)}catch(G){Ae(xa,"drawPyramidChart.forEach",G)}})}catch(pe){Ae(xa,"drawPyramidChart",pe)}},ue=pe=>{try{if(p.annotation.annotationVisibility){let Q=xt.annotation(),G=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None",M=Yt(V,p,o=>o.data.measure);const h=p.annotation.connectorStyle?.toLowerCase();Q.editMode(p.annotation.annotationDraggable).accessors({x:function(){return R*.5},y:function(o,d){return o.y}}).on("dragend",function(o){try{M.forEach(d=>{d.data.legend===o.data.legend&&(d.dx=o._dx,d.dy=o._dy,d.width=L,d.height=u)}),c&&c(M.map(d=>({data:{legend:d.data.legend,isVisible:d.data.isVisible??!0},dx:d.dx,dy:d.dy,width:L,height:u}))),k.selectAll(".connector").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]),k.selectAll(`.connector-${G}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").attr("hoverId",d=>d.data.currentLegend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]).filter(d=>d._dx==0&&d._dy==0).remove(),k.selectAll(".annotation-note-label").filter(d=>d.data&&d.data.isVisible).style("display","block"),k.selectAll(".annotation-note-title").filter(d=>d.data&&d.data.isVisible).style("display","block")}catch(d){Ae(xa,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(M);let k=W.append("g").attr("class","annotation-group parentGroup").call(Q);p.animation.animationEnabled&&k.attr("opacity",0).transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1),k.selectAll("rect").style("visibility","hidden"),k.selectAll(".annotation-subject").remove(),k.selectAll(".connector").style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]),k.selectAll(`.connector-${G}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),k.selectAll(".note-line").style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",$t[h]).filter(o=>o._dx==0&&o._dy==0).remove(),k.selectAll(".connector-end").filter(o=>o.connector.end=="dot"&&o._dx==0&&o._dy==0).remove(),k.selectAll(".annotation-note-label").filter(o=>o.data&&!o.data.isVisible).style("display","none"),k.selectAll(".annotation-note-title").filter(o=>o.data&&!o.data.isVisible).style("display","none"),p.annotation.annotationType==_t.automatic&&k.selectAll(".annotation-note-content").attr("transform",function(){const d=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(d)return`translate(${parseFloat(d[1])}, 0)`}),k.selectAll(".annotation-note-label").attr("y","15").attr("text-anchor","middle"),k.selectAll(".annotation-note-title").attr("text-anchor","middle"),k.selectAll(".annotation-note-content").attr("transform","translate(0,-28)"),!p.plotArea.dataLabelName&&k.selectAll("tspan").attr("dy","0"),p.plotArea.dataLabelName&&k.selectAll(".annotation-note-title").attr("hoverId",o=>o.data.legend.replace(/\s+/g,"-")).style("font-size",o=>o.data.labelFontSize).attr("font-family",o=>o.data.labelFontFamily).style("font-style",o=>o.data.labelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",o=>o.data.labelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",o=>o.data.labelFontStyle.includes(oe.bold)?oe.bold:"300").style("fill",o=>o.data.labelFontColor),p.plotArea.dataLabelValue&&k.selectAll(".annotation-note-label").attr("hoverId",o=>o.data.legend.replace(/\s+/g,"-")).style("font-size",o=>o.data.valueFontSize).attr("font-family",o=>o.data.valueFontFamily).style("font-style",o=>o.data.valueFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",o=>o.data.valueFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",o=>o.data.valueFontStyle.includes(oe.bold)?oe.bold:"300").style("fill",o=>o.data.valueFontColor)}}catch(Q){Ae(xa,"pyramidAnnotations",Q)}},ge=()=>{try{let pe=p.annotation.annotationType??"1",Q=[pe=="1"?"connector":""],G=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"none";const M=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates||[])),h=new Map(M.map(k=>[k.data?.legend,k]));V=[],s.forEach((k,o)=>{try{const d=p.annotation.annotationVisibility,i=s.length-1;if(d===_t.none||d===_t.startOnly&&o!==0||d===_t.endOnly&&o!==i||d===_t.startAndEndBoth&&o!==0&&o!==i)return;let y={note:{title:p.plotArea.dataLabelName?k.properties.alias:"",label:p.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(k.data[0].value/P)*100).toFixed(rt(p.plotArea.dataLabelDecimalPrecision))+"%":p.plotArea.dataLabelValue?k.data[0].value>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(k.data[0].value/1e9)+"B":qe(p.annotation.annotationDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(k.data[0].value):"",align:"middle"},data:{x:R/2,y:be(k,o,k.properties.dataLabelPosition),isVisible:!0,dimension:k.legend,legend:k.legend,measure:k.data[0].value,labelFontFamily:k.properties.labelFont,labelFontSize:k.properties.labelFontSize,labelFontColor:k.properties.labelFontColor,labelFontStyle:k.properties.labelFontStyle,valueFontFamily:k.properties.valueFont,valueFontSize:k.properties.valueFontSize,valueFontColor:k.properties.valueFontColor,valueFontStyle:k.properties.valueFontStyle},dx:0,dy:0,connector:{end:G,curve:Ml[p.annotation.connectorCurve]},disable:Q,subject:{height:15,width:15},type:Sl[pe],color:p.plotArea.dataLabelNameColor!=Re.black?p.plotArea.dataLabelNameColor:Re.black,height:L,width:L,index:o};const T=h.get(k.legend);T&&(y.dx=T.dx*L/(T.width||L),y.dy=T.dy*u/(T.height||u),y.data.isVisible=T.data?.isVisible??!0),V.push(y)}catch(d){Ae(xa,"prepareNewAnnotationsList.forEach",d)}})}catch(pe){Ae(xa,"prepareNewAnnotationsList",pe)}},be=(pe,Q,G)=>{try{switch(G){case yi.top:return U[Q]+30;case yi.middle:return(U[Q]+U[Q+1])/2+15;case yi.bottom:return U[Q+1];default:return U[Q]+30}}catch(M){return Ae(xa,"getYCordinate",M),0}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:r,style:{width:"100%",height:"100%"}})})},Sa="ProgressChart.tsx",Cr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:c,tooltipFormatter:x})=>{const n=Me.useRef();let l=Lt(t),s,p,f,L=40,u=jt,S=[0,0],b,_,A,R,g,B,U,W;const P=1,D=0;Me.useEffect(()=>{V()},[e]);const V=()=>{({chartFormatOptions:s,svg:g,width:p,height:f}=qt(n,e)),S=Ua(s,l),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:B,chartTitleHeight:L}=$a(s,p,f,S,u),$(),Xt(n,p,f,s),R=oa(g,u),Zt(n,L,p,s),Ya(s,g,l,p,f,B,L,r,u,ct.hollowCircle,!0,c),Z(),ce(),Si(s,A,L,g,p,f)},$=()=>{try{U=Math.min(b*.45,_*.45),W=Math.min(rt(s.plotArea.innerRadius)/100*U,U)}catch(ae){Ae(Sa,"setRadiusAndInnerRadius",ae)}},Z=()=>{try{A=t[P].data[0].value+t[D].data[0].value}catch(ae){Ae(Sa,"initProgressChartData",ae)}},ce=()=>{try{let ae=t[P].data[0].value,ue=t[D].data[0].value,ge=Math.PI*2,be=ue/ae*Math.PI*2,pe=s.plotArea.dataLabelValueFontStyle;const Q=v.arc().innerRadius(W).outerRadius(U).startAngle(0).cornerRadius(rt(s.plotArea.cornerRadius));R.append("path").attr("class","secondary-circle").attr("fill",t[P].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressScale).attr("hoverId",M=>(t[P]?.properties?.alias||t[P]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[P].properties.legendUniqueId??t[P].properties.alias??"*").attr("data-dim-value",t[P].properties.alias??"*").attr("d",Q({endAngle:ge})).on("mousemove",M=>{try{yt([{key:t[P].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ae)}],s,void 0,t[P].properties,gt(x,String(t[P].properties?.alias??""),t[P].properties))}catch(h){Ae(Sa,"drawProgressChart.onMouseMove.secondary-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){Ae(Sa,"drawProgressChart.onMouseOut.secondary-circle",M)}}).attr("transform",ne()),R.append("path").attr("class","progress-circle").attr("fill",t[D].properties.color).attr("fill-opacity",s.plotArea.opacityforProgressGoal).attr("hoverId",M=>(t[D]?.properties?.alias||t[D]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[D].properties.legendUniqueId??t[D].properties.alias??"*").attr("data-dim-value",t[D].properties.alias??"*").attr("d",Q({endAngle:be})).on("mousemove",M=>{try{yt([{key:t[D].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(ue/ae*100)+"%":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ae)},{key:t[P].properties.alias,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ue)}],s,void 0,t[D].properties,gt(x,String(t[D].properties?.alias??""),t[D].properties))}catch(h){Ae(Sa,"drawProgressChart.onMouseMove.progress-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){Ae(Sa,"drawProgressChart.onMouseOut.progress-circle",M)}}).attr("transform","translate("+_/2+","+b/2+")").transition().duration(s.animation.animationEnabled?s.animation.animationDuration:0).ease(et[s.animation.animationEffect]).attrTween("d",function(M){try{const h=v.interpolate(0,be);return function(k){try{return Q({endAngle:h(k)})}catch(o){return Ae(Sa,"drawProgressChart.attrTween.inner",o),""}}}catch(h){return Ae(Sa,"drawProgressChart.attrTween",h),()=>""}});const G=R.append("text").attr("transform",ne()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>s.plotArea.dataLabels&&qi([{value:ue}],s,h=>h?.value??0).length>0?"visible":"hidden").attr("fill",s.plotArea.dataLabelValueColor!==Re.white?s.plotArea.dataLabelValueColor:s.toolTip.toolTipDisplayUnits).attr("font-style",pe.includes(oe.italic)?oe.italic:"").attr("text-decoration",pe.includes(oe.underline)?oe.underline:"").attr("font-weight",pe.includes(oe.bold)?oe.bold:"").attr("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-size",s.plotArea.dataLabelValueFontSize).text(()=>s.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(ue/ae*100)+"%":qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormatProgress,s.plotArea.dataLabelDecimalPrecision)(ue));s.animation.animationEnabled&&G.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(et[s.animation.animationEffect]).attr("opacity",1)}catch(ae){Ae(Sa,"drawProgressChart",ae)}},ne=()=>{try{return"translate("+_/2+","+b/2+")"}catch(ae){return Ae(Sa,"getTransformString",ae),""}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},Mr=({data:{ChartData:t},formatOptions:e,chartId:r})=>{const c=Me.useRef(),x=Lt(t);let n,l,s,p=40,f=jt,L,u,S,b,_,A,R,g,B,U,W,P={},D;const V="Speedometer.tsx";Me.useEffect(()=>{$()},[e]);const $=()=>{({chartFormatOptions:n,svg:b,width:l,height:s}=qt(c,e)),{margins:f,chartTitleHeight:p,innerHeight:L,innerWidth:u}=ii(n,s,l),Z(),Xt(c,l,s,n),S=oa(b,f),Zt(c,p,l,n),ne(),ae(),ge(),pe()},Z=()=>{try{let h;L*.8<u*.45?(_=L*.8,h="width"):(_=u*.45,h="height"),D=ce(h),A=rt(n.plotArea.innerRadiusForSpeedometer)/100*_}catch(h){Ae(V,"initChartRadius",h)}};function ce(h){try{return h=="height"?`translate(${u/2},${L/2+_/2})`:`translate(${u/2},${s-60})`}catch(k){return Ae(V,"centerTranslation",k),""}}const ne=()=>{try{let h=t[0].data[0].value;h<0?(R=0,g=h):(R=h,g=0),n.customScaling.customScalingtoggle?U=100:U=rt(n.plotArea.ticks)}catch(h){Ae(V,"initSpeedometerData",h)}},ae=()=>{try{B=[];let h=rt(n.plotArea.ticks);if(n.customScaling.customScalingtoggle){for(let k=1;k<=h;k++){let o=n.customScaling[`share${k}`];if(B.length<100)for(let d=0;d<o;d++)B.push(n.customScaling[`division${k}`])}if(B.length<101)for(let k=B.length;k<100;k++)B.push(Re.black)}else if(n.colorScale.showColor==Ta.none){const k=t[0].properties?.color??"#bac8de";for(let o=1;o<=h;o++)B.push(k)}else if(n.colorScale.showColor==Ta.discrete)for(let k=1;k<=h;k++)B.push(n.colorScale["division"+k]);else{let k=n.colorScale.startColor,o=n.colorScale.endColor;const d=v.scaleLinear().domain([0,h]).range([k,o]);for(let i=0;i<h;i++)B.push(d(i))}}catch(h){Ae(V,"initColorTheme",h)}},ue=(h,k,o)=>{try{let d=[],i=Math.abs(h)-Math.abs(k),y=Math.abs(i)/o,T=k>0?0:k;d.push(T);for(let a=0;a<o-1;a++)T+=parseFloat(y.toFixed(5)),T.toFixed(5)<=Math.abs(h)&&d.push(T);return d.push(d.includes(h)?0:h),d}catch(d){return Ae(V,"setTickValues",d),[]}},ge=()=>{try{switch(n.plotArea.dataLabelsOptions){case _t.automatic:W=be();break;case _t.startOnly:W=[g];break;case _t.endOnly:let k=Array(U).fill("");k[U]=R,W=k;break;case _t.startAndEndBoth:let o=Array(U).fill("");o[U]=R,o[0]=g,W=o;break;case _t.none:W=[];break}}catch(h){Ae(V,"setDataLabelsOptions",h)}},be=()=>{try{let h,k=rt(n.plotArea.ticks),o=ue(R,g,U);if(n.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=g;let i=0;for(let y=1;y<=k;y++){let T=parseInt(n.customScaling[`share${y}`]);if(i+=T,i>=100)break;d[i]=o[i]}d[99]=R,h=d}else h=o;return h}catch(h){return Ae(V,"initTicksValues",h),[]}},pe=()=>{try{let k=function(o,d){try{let i=function(fe){try{return fe*Math.PI/180}catch($e){return Ae(V,"deg2rad",$e),0}},y=function(fe){try{let $e;for($e in fe)ye[$e]=fe[$e];m=ye.maxAngle-ye.minAngle,re=Math.round(_*ye.pointerHeadLengthPercent),Le=v.scaleLinear().range([0,1]).domain([ye.minValue,ye.maxValue]),me=v.arc().innerRadius(A).outerRadius(_).startAngle((Ue,Ye)=>{let Pe=1/ye.majorTicks*Ye;return i(ye.minAngle+Pe*m)}).endAngle((Ue,Ye)=>{let Pe=1/ye.majorTicks*(Ye+1);return i(ye.minAngle+Pe*m)})}catch($e){Ae(V,"configure",$e)}},T=function(fe,$e){try{if($e===0){S.append("g").attr("class","arc").attr("transform",D).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(B).enter().append("path").attr("fill",ve=>ve).attr("stroke",ve=>ve).attr("d",me);let we=R,Ce=S.append("g").attr("class","label").attr("transform",D);if(Ce.selectAll("text").data(W).enter().append("text").attr("transform",function(ve,F){let le=m/ye.majorTicks*F;return"rotate("+(ye.minAngle+le)+") translate(0,"+(ye.labelInset-_)+")"}).attr("text-anchor","middle").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Re.white?n.plotArea.dataLabelValueColor:"none").attr("font-style",n.plotArea.dataLabelValueFontStyle.includes(oe.italic)?oe.italic:"").attr("text-decoration",n.plotArea.dataLabelValueFontStyle.includes(oe.underline)?oe.underline:"").attr("font-weight",n.plotArea.dataLabelValueFontStyle.includes(oe.bold)?oe.bold:"").attr("font-family",n.plotArea.dataLabelValueFontFamily).text(ve=>n.plotArea.dataLabelNumberFormat==",.0%"?K=Math.round(ve/we*100)+"%":qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(ve)).attr("visibility",ve=>ve===""?"hidden":"visible"),n.animation.animationEnabled){const ve=n.animation.animationDuration,F=et[n.animation.animationEffect];Ce.selectAll("text").attr("opacity",0).attr("transform",function(le,he){const te=m/ye.majorTicks*he;return`rotate(${ye.minAngle+te}) translate(0, ${ye.labelInset-_+20})`}).transition().duration(ve).ease(F).attr("opacity",1).attr("transform",function(le,he){const te=m/ye.majorTicks*he;return`rotate(${ye.minAngle+te}) translate(0, ${ye.labelInset-_})`})}}n.pointerValue.showPointerValue&&x.length===2&&G(D);let Ue=[[ye.pointerWidth/2,0],[0,-re],[-(ye.pointerWidth/2),0],[0,ye.pointerTailLength],[ye.pointerWidth/2,0]],Ye=v.line().curve(v.curveLinear);ie=S.append("g").data([Ue]).attr("class","pointer").attr("transform",D).append("path").attr("d",$e>0?Ye:null).attr("transform","rotate("+ye.minAngle+")").attr("fill",n.plotArea.pointerColor).on("mousemove",(Ee,we)=>{yt([{key:`${t[$e].data[0].legend}`,value:n.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[$e].data[0].value/ze[ze.length-1]*100)+"%":qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(t[$e].data[0].value)}],n,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{ot()}),ie.selectAll("text").append("text").text(ye.maxValue),a(fe===void 0?0:fe)}catch(Ue){Ae(V,"gauge.render",Ue)}},a=function(fe,$e){try{$e!==void 0&&y($e);let Ue=Le(fe),Ye=ye.minAngle+Ue*m;ie.transition().duration(n.animation.animationEnabled?n.animation.animationDuration:0).ease(et[n.animation.animationEffect]).attr("transform","rotate("+Ye+")")}catch(Ue){Ae(V,"gauge.update",Ue)}},m,N,re,K,me,Le,ze,Se,ie,De,ye={clipWidth:u,clipHeight:L,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:rt(n.plotArea.pointerHeadLength)/10,minValue:g,maxValue:R,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:U,labelFormat:fe=>qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(fe),labelInset:-5};return P.configure=y,P.render=T,P.update=a,y(d),P}catch(i){Ae(V,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:L,ringWidth:2.75*rt(n.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:R,transitionMs:0});if(x.length>0)for(let o=0;o<x.length;o++)k.render(Q(x[o],o),o)}catch(h){Ae(V,"initSpeedometer",h)}};function Q(h,k){try{let o=R,d=h.data[0].value;return o<0&&d>0||o>0&&d<0?0:o<0&&d<0&&o>d?o:o<0&&d<0&&o<d||o>d?d:o}catch(o){return Ae(V,"setPointerofSpeedometer",o),0}}function G(h){try{let k="";if(n.pointerValue.kpiAlias)k=n.pointerValue.kpiAliasText;else switch(n.pointerValue.connectorKPIforSpeedometer){case Oa.PointerValue:k="Pointer Value";break;case Oa.Absolute:k="Absolute Value";break;case Oa.CAGR:k="CAGR";break;case Oa.PercentageGrowth:k="Percentage Growth";break}let o=n.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",h).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",n.pointerValue.pointerValueFontSize).attr("fill",n.pointerValue.pointerValueColor!==Re.white?n.pointerValue.pointerValueColor:"none").attr("font-style",o.includes(oe.italic)?oe.italic:"").attr("text-decoration",o.includes(oe.underline)?oe.underline:"").attr("font-weight",o.includes(oe.bold)?oe.bold:"").attr("font-family",n.pointerValue.pointerValueFontFamily).text(i=>`${k}: ${!n.pointerValue.pointerValueAlias&&i!=0?M(t[0].data[0].value,t[1].data[0].value):n.pointerValue.pointerValueAliasText}`).attr("visibility",n.plotArea.dataLabels?"visible":"hidden")}catch(k){Ae(V,"setPointerValueText",k)}}function M(h,k){try{let o=h-k,d=1,i=parseInt(n.pointerValue.connectorKPIforSpeedometer),y,T;const a=n.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:o=k;break;case 2:o=Math.abs(o);break;case 3:return y=`.${a}%`,o=Math.pow(k/h,1/d)-1,T=v.format(y)(o),T;case 4:return y=`.${a}%`,o=Math.round(k/h*100-100)/100,T=v.format(y)(o),T}return isNaN(o)&&(o=0),qe(n.pointerValue.pointerValueDisplayUnits,n.pointerValue.pointerValueNumberFormat,a)(o)}catch(o){return Ae(V,"connectorNumberFormat",o),""}}return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:c,id:r,style:{width:"100%",height:"100%"}})})};function Na(t,e,r){console.error(`[${t}][${e}]`,r)}const Sr=({data:{ChartData:t},formatOptions:e,chartId:r,addLocalFilterFromLib:c,tooltipFormatter:x})=>{const n=Me.useRef(),l=Lt(t);let s,p,f,L=40,u=jt,S=[0,0],b,_,A,R,g,B;Me.useEffect(()=>{U()},[e]);const U=()=>{({chartFormatOptions:s,svg:R,width:p,height:f}=qt(n,e)),W(),{margins:u,innerHeight:b,innerWidth:_,legendListWidth:B,chartTitleHeight:L}=$a(s,p,f,S,u),S=Ua(s,l),Xt(n,p,f,s),A=oa(R,u),Zt(n,L,p,s),Ya(s,R,l,p,f,B,L,r,u,ct.hollowCircle,!1,c),D()},W=()=>{try{g=0,l.forEach($=>{g+=$.data[0].value})}catch($){Na("RadialBarChart.tsx","loopOverChartData",$)}},P=$=>{try{switch(s.plotArea.dataLabelsOptions){case _t.automatic:return $.map((ce,ne)=>({...ce,index:ne}));case _t.startOnly:return[{...$[0],index:0}];case _t.endOnly:return[{...$[$.length-1],index:$.length-1}];case _t.startAndEndBoth:return[{...$[0],index:0},{...$[$.length-1],index:$.length-1}];case _t.none:return[]}}catch(Z){return Na("RadialBarChart.tsx","getModifiedDataForLabels",Z),$}},D=()=>{try{let $=function(Se,ie){try{const De=v.interpolate(0,d(Math.abs(Se.data[0].value)));return ye=>re({...Se,endAngle:De(ye)},ie)}catch(De){Na("RadialBarChart.tsx","arcTween",De)}},Z=function(Se){try{return Se*180/M}catch(ie){Na("RadialBarChart.tsx","radTodeg",ie)}},ce=function(Se){try{return Se*Math.PI/180}catch(ie){Na("RadialBarChart.tsx","degToRad",ie)}},ne=function(Se){try{return h+(m-(Se+1))*(N+k)}catch(ie){Na("RadialBarChart.tsx","getInnerRadius",ie)}},ae=function(Se){try{return ne(Se)+N}catch(ie){Na("RadialBarChart.tsx","getOuterRadius",ie)}},ue=l.length>1?v.max(l,Se=>Se.data[0].value)*1.1:t[0].data[0].value*1.1,ge=s.plotArea.dataLabelValueFontStyle,be=qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(ue),pe=s.plotArea.axialAxis?zt(be,rt(s.plotArea.axialAxisDataLabelFontSize),s.plotArea.axialAxisDataLabelFontFamily).width+10:20;const Q=Math.min(b*.5,_*.5)-pe;let G=A.append("g").attr("transform",V()).attr("width",_).attr("height",b);const M=Math.PI,h=l.length>1?10:70,k=rt(s.plotArea.arcPadding),o=rt(s.plotArea.axialTicks);let d=v.scaleLinear().domain([0,ue]).range([0,ce(360)]),i=d.ticks(o);i[i.length-1]==ue&&i.pop();let y=i,T=l.map((Se,ie)=>Se.data[0].legend),a=l.reduce((Se,ie)=>Se+ie.data[0].value,0);const m=T.length,N=(Q-h-m*k)/m;let re=v.arc().innerRadius((Se,ie)=>ne(ie)).outerRadius((Se,ie)=>ae(ie)).startAngle(0).endAngle(Se=>Se.endAngle),K=v.arc().innerRadius((Se,ie)=>ne(ie)).outerRadius((Se,ie)=>ae(ie)).startAngle(0).endAngle(ce(360)),me=G.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");s.plotArea.axialGrid&&me.append("circle").attr("r",(Se,ie)=>ae(ie)+k).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let Le=G.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",Se=>"rotate("+(Z(d(Se))-90)+")");s.plotArea.axialGrid&&Le.append("line").attr("x2",Q).attr("stroke","#a9a9a9").attr("stroke-width",1),Le.append("text").attr("x",Q+10).attr("class","text-xs text-gray-600").style("text-anchor",Se=>d(Se)>=M&&d(Se)<2*M?"end":null).attr("transform",Se=>"rotate("+(90-Z(d(Se)))+","+(Q+10)+",0)").text(Se=>qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.axialAxisDataLabelNumberFormat,s.plotArea.axialAxisDataLabelDecimalPrecision)(Se)).attr("fill",s.plotArea.axialAxisDataLabelColor!==Re.white?s.plotArea.axialAxisDataLabelColor:"none").style("font-size",s.plotArea.axialAxisDataLabelFontSize).style("font-family",s.plotArea.axialAxisDataLabelFontFamily).attr("font-style",s.plotArea.axialAxisDataLabelFontStyle.includes(oe.italic)?oe.italic:"").attr("text-decoration",s.plotArea.axialAxisDataLabelFontStyle.includes(oe.underline)?oe.underline:"").attr("font-weight",s.plotArea.axialAxisDataLabelFontStyle.includes(oe.bold)?oe.bold:"").attr("visibility",s.plotArea.axialAxis?"visible":"hidden");let ze=G.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Se=>Se.data[0].legend.replaceAll(" ","-")).attr("data-series-id",Se=>Se.properties.legendUniqueId??Se.data[0].legend).attr("data-dim-value",Se=>Se.data[0].legend).attr("fill",Se=>Se.properties.color).attr("d",(Se,ie)=>re({...Se,endAngle:0},ie)).on("mousemove",(Se,ie)=>{yt([{key:s.yAxisTitle.yAxisTitleText,value:s.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(ie.data[0].value/a)*100).toFixed(rt(s.toolTip.toolTipDecimalPrecision))+"%":qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormatProgress,s.toolTip.toolTipDecimalPrecision)(ie.data[0].value)},{key:"Legend",value:ie.properties.alias}],s,void 0,ie.properties,gt(x,String(ie.data[0]?.legend??""),ie.properties))}).on("mouseout",()=>{ot()});if(s.animation.animationEnabled?ze.transition().duration(s.animation.animationDuration).ease(et[s.animation.animationEffect]).attrTween("d",$):ze.attr("d",(Se,ie)=>re({...Se,endAngle:d(Math.abs(Se.data[0].value))},ie)),s.plotArea.dataLabels){const Se=qi(P(t),s,De=>De?.data?.[0]?.value??0),ie=G.selectAll(".arc-label-"+r).data(Se).enter().append("text").attr("class","arc-label-"+r).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(De,ye)=>(ae(De.index??ye)-ne(De.index??ye))/1.75);ie.append("textPath").attr("xlink:href",(De,ye)=>`#arc-path-${De.index??ye}-`+r).style("startOffset","50%").attr("hoverId",De=>De.legend.replaceAll(" ","-")).text(De=>`  ${De.properties.alias}
150
+  ${s.plotArea.dataLabelValue?qe(s.plotArea.plotAreaDisplayUnits,s.plotArea.dataLabelNumberFormat,s.plotArea.dataLabelDecimalPrecision)(De.data[0].value):""}`).attr("fill",s.plotArea.dataLabelValueColor!==Re.white?s.plotArea.dataLabelValueColor:"none").style("font-size",s.plotArea.dataLabelValueFontSize).style("font-family",s.plotArea.dataLabelValueFontFamily).attr("font-style",ge.includes(oe.italic)?oe.italic:"").attr("text-decoration",ge.includes(oe.underline)?oe.underline:"").attr("font-weight",ge.includes(oe.bold)?oe.bold:"").on("mousemove",(De,ye)=>{yt([{key:s.yAxisTitle.yAxisTitleText,value:qe(s.toolTip.toolTipDisplayUnits,s.toolTip.toolTipNumberFormat,s.toolTip.toolTipDecimalPrecision)(ye.data[0].value)},{key:"Legend",value:ye.properties.alias}],s,De,ye.properties,gt(x,String(ye.data[0]?.legend??""),ye.properties))}).on("mouseout",()=>{ot()}),s.animation.animationEnabled&&ie.attr("opacity",0).transition().duration(s.animation.animationDuration).ease(et[s.animation.animationEffect]).attr("opacity",1),ze.each((De,ye)=>{G.append("path").attr("id",`arc-path-${ye}-`+r).attr("d",K(De,ye)).attr("fill","none").attr("stroke","none")})}}catch($){Na("RadialBarChart.tsx","initRadialBarChart",$)}},V=()=>{try{return`translate(${_/2},${b/2})`}catch($){Na("RadialBarChart.tsx","getPiePosition",$)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:n,id:r,style:{width:"100%",height:"100%"}})})},pa="WordCloud.tsx",Fr=({data:{ChartData:t},formatOptions:e,chartId:r,tooltipFormatter:c})=>{const x=Me.useRef();let n=Lt(t),l,s,p,f=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=jt,b,_,A,R,g,B=0;Me.useEffect(()=>{U()},[e]);const U=()=>{({chartFormatOptions:l,svg:R,width:s,height:p}=qt(x,e)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=ii(l,p,s),Xt(x,s,p,l),A=oa(R,S),Zt(x,u,s,l),W(),P()},W=()=>{try{B=0,n=n.map(D=>{let V=D.data[0].value;return B+=V,l.plotArea.hideZeroValues&&V==0?null:(V<f&&(f=V),V>L&&(L=V),D)}),n=n.filter(D=>D!==null),g=v.scaleLinear().domain([f,L]).range([12,70])}catch(D){Ae(pa,"calculateWordCloudData",D)}},P=()=>{try{let D=function(ce){try{A.append("g").attr("transform","translate("+Z.size()[0]/2+","+Z.size()[1]/2+")").selectAll("text").data(ce).enter().append("text").attr("font-size",function(ne){try{return g(ne.data[0].value)+"px"}catch(ae){return Ae(pa,"draw-font-size",ae),"12px"}}).attr("text-anchor","middle").style("font-family",l.text.textFontFamily).attr("fill",function(ne){try{return ne.properties.color!==Re.white?ne.properties.color:"none"}catch(ae){return Ae(pa,"draw-fill",ae),"none"}}).attr("transform",function(ne){try{return"translate("+[ne.x,ne.y]+")rotate("+ne.rotate+")"}catch(ae){return Ae(pa,"draw-transform",ae),""}}).text(function(ne){try{return ne.properties.alias}catch(ae){return Ae(pa,"draw-text",ae),""}}).attr("data-series-id",ne=>ne.properties.legendUniqueId??ne.properties.alias).attr("data-dim-value",ne=>ne.properties.alias).on("mousemove.text",(ne,ae)=>{try{yt([{key:ae.properties.alias,value:qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(ae.data[0].value)},{key:ae.properties.measureUniqueId,value:B}],l,void 0,ae.properties,gt(c,String(ae.properties.alias??""),ae.properties))}catch(ue){Ae(pa,"draw-mousemove",ue)}}).on("mouseout.text",()=>{try{ot()}catch(ne){Ae(pa,"draw-mouseout",ne)}})}catch(ne){Ae(pa,"draw",ne)}},V=l.text.textSpacing,$=l.text.textRotation,Z=gl().size([_,b]).words(n).padding(V).rotate(function(){try{return Math.round(Math.random())*$}catch(ce){return Ae(pa,"rotate",ce),0}}).random(()=>.5).font(l.text.textFontFamily).fontWeight("bolder").fontSize(function(ce){try{return g(ce.data[0].value)}catch(ne){return Ae(pa,"fontSize",ne),12}}).text(function(ce){try{return ce.properties.alias}catch(ne){return Ae(pa,"text",ne),""}}).on("end",D);Z.start()}catch(D){Ae(pa,"drawWordCloudChart",D)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:x,id:r,style:{width:"100%",height:"100%"}})})},wr=({data:t,formatOptions:e,chartId:r})=>{const c=Me.useRef();let x=Lt(t),n,l,s,p=40,f=jt,L,u,S,b=[0,0],_,A;Me.useEffect(()=>{R()},[e]);const R=()=>{({chartFormatOptions:n,svg:A,width:l,height:s}=qt(c,e)),b=B(),{margins:f,innerHeight:L,innerWidth:u,legendListWidth:S,chartTitleHeight:p}=$a(n,l,s,b,f,!0),Xt(c,l,s,n),_=oa(A,f),Zt(c,p,l,n),g(),U()},g=()=>{try{let W=n.plotArea.dataLabelNameFontStyle,P=n.plotArea.dataLabelValueFontStyle,D=_.attr("class","vennContainer");D&&D.datum(t).call(Tl.VennDiagram().width(u).height(L)),D&&D.selectAll(".venn-circle path").style("fill-opacity",n.plotArea.opacity),n.plotArea.dataLabelName?(D&&D.selectAll(".venn-circle text").html(""),D&&D.selectAll(".venn-circle text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",W.includes(oe.italic)?oe.italic:"").attr("text-decoration",W.includes(oe.underline)?oe.underline:"").style("font-weight",W.includes(oe.bold)?oe.bold:"").html(V=>V.label).attr("visibility",n.plotArea.dataLabelName?"visible":"hidden")):(D&&D.selectAll(".venn-circle text").style("visibility","hidden"),D&&D.selectAll(".venn-circle text").html("")),n.plotArea.dataLabelValue&&D&&D.selectAll(".venn-circle text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Re.white?n.plotArea.dataLabelValueColor:"none").style("font-style",P.includes(oe.italic)?oe.italic:"normal").attr("text-decoration",P.includes(oe.underline)?oe.underline:"none").style("font-weight",P.includes(oe.bold)?oe.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(V=>V.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+v.format(n.plotArea.dataLabelNumberFormat)(V.actualValue):"").attr("visibility",n.plotArea.dataLabelValue?"visible":"hidden"),n.plotArea.intersectionLabelVisibility?(D&&D.selectAll(".venn-intersection text").html(""),D&&D.selectAll(".venn-intersection text").append("tspan").style("font-family",n.plotArea.dataLabelNameFontFamily).style("fill",n.plotArea.dataLabelNameColor).style("font-size",n.plotArea.dataLabelNameFontSize+"px").style("font-style",W.includes(oe.italic)?oe.italic:"").attr("text-decoration",W.includes(oe.underline)?oe.underline:"").style("font-weight",W.includes(oe.bold)?oe.bold:"").html(V=>V.label).attr("visibility",n.plotArea.intersectionLabelVisibility?"visible":"hidden")):(D&&D.selectAll(".venn-intersection text").style("visibility","hidden"),D&&D.selectAll(".venn-intersection text").html("")),n.plotArea.intersectionValueVisibility&&D&&D.selectAll(".venn-intersection text").append("tspan").attr("font-size",n.plotArea.dataLabelValueFontSize).attr("fill",n.plotArea.dataLabelValueColor!==Re.white?n.plotArea.dataLabelValueColor:"none").style("font-style",P.includes(oe.italic)?oe.italic:"normal").attr("text-decoration",P.includes(oe.underline)?oe.underline:"none").style("font-weight",P.includes(oe.bold)?oe.bold:"normal").attr("font-family",n.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(V=>V.actualValue!==void 0?(n.plotArea.dataLabelName?" : ":"")+v.format(n.plotArea.dataLabelNumberFormat)(V.actualValue):"").attr("visibility",n.plotArea.intersectionValueVisibility?"visible":"hidden"),D&&D.selectAll(".venn-circle path").style("fill",V=>V.properties?V.properties.color:null),D&&D.selectAll("g").on("mousemove",function(V,$){yt([{key:$.label,value:qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)($.size)}],n,void 0,$.properties),v.select(this).transition("tooltip").duration(10).selectAll("path").style("stroke-dasharray","5,5").style("stroke-opacity",1).style("stroke","black")}).on("mouseout",function(V,$){ot();var Z=v.select(this).transition("tooltip").duration(400);Z.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(W){Ae("VennChart.tsx","drawVennDiagramChart",W)}},B=()=>{try{let W=0,P=0;return x.forEach(D=>{if(D.legendDisplay){let V=zt(D.legendDisplay+" : "+D.actualValue,rt(n.legends.legendFontSize),n.legends.legendFontFamily);W=Math.max(W,V.width),P=Math.max(P,V.height)}}),[W,P]}catch(W){return Ae("VennChart.tsx","calculateLegendsMaxPossibleWidth",W),[0,0]}},U=()=>{try{let W=n.legends.legendPosition,P=n.legends.legendAlignmentTopBottom,D=n.legends.legendAlignment;switch(W){case je.none:break;case je.right:ua(A,x,l-S-25,p+5,S+15,s-p-10,W,D,ct.none,n,r,!0);break;case je.top:ua(A,x,5,p+5,l-10,30,W,P,ct.none,n,r,!0);break;case je.left:ua(A,x,5,f.top,S+15,s-p-10,W,D,ct.none,n,r,!0);break;case je.bottom:ua(A,x,5,s-35,l-10,30,W,P,ct.none,n,r,!0);break}}catch(W){Ae("VennChart.tsx","initLegendListWithTotalValueAllowance",W)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:c,id:r,style:{width:"100%",height:"100%"}})})},Dr=({formatOptions:t,data:e,chartId:r,onElementClick:c,vfxPickModeActive:x,tooltipFormatter:n})=>{if(!e)return null;let l=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],s=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const p=Me.useRef(),f=Me.useRef(c);f.current=c;const L=Me.useRef(x);L.current=x;let u,S,b,_=40,A=jt,R,g,B,U,W=li.left,P=0,D=!1,V=new Map,$=new Map,Z=.8,ce=.8;Me.useEffect(()=>{ne()},[t]);const ne=()=>{({chartFormatOptions:u,svg:U,width:S,height:b}=qt(p,t)),{margins:A,chartTitleHeight:_,innerHeight:R,innerWidth:g}=ii(u,b,S),ae(),Xt(p,S,b,u),B=oa(U,A),Zt(p,_,S,u),be()},ae=()=>{try{Z=rt(u.nodes.nodesFillOpacity),ce=rt(u.links.linksFillOpacity),s.forEach(h=>{h.totalValue=0}),s.forEach(h=>l.forEach(k=>(h.name==k.source||h.name==k.target)&&(h.totalValue=(h.totalValue||0)+k.value))),s=s.filter(h=>h.totalValue!=0),l=l.filter(h=>h.value!=0);let G=pe(l),M=new Map;G.forEach(h=>{h.nodes.forEach(k=>{M.set(k,h.layer)})}),s.forEach(h=>{let k=M.get(h.name);V.set(k,(V.get(k)||0)+h.totalValue)}),s.forEach(h=>{$.set(h.name,h.totalValue/V.get(M.get(h.name))*100)}),ue(G)}catch(G){Ae("SankeyChart.tsx","prepareDataForSankey",G)}},ue=G=>{try{D=u.nodes.nodesLabelWrap,W=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let M="",h=0;s.forEach(d=>{M=d.name.length>M.length?d.name:M,h=d.totalValue.toString().length>h.toString().length?d.totalValue:h});let k=zt(M,rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),o=zt(qe(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(h),rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);P=Math.max(k.width,o.width)+6,D&&(P=Math.min(g*.1,P))}catch(M){Ae("SankeyChart.tsx","calculateMaxNodeValueWidth",M)}},ge=(G,M)=>{try{let h=u.nodes.spacing!==void 0?rt(u.nodes.spacing)*1.5:15,k=u.nodes.sankeyNodeWidth!==void 0?u.nodes.sankeyNodeWidth:10,o=[],d=[];switch(W){case li.center:o=[1,5],d=[g,R];break;case li.right:o=[1,5],d=[g-P,R];break;case li.left:o=[P,5],d=[g,R];break;default:o=[1,5],d=[g,R];break}return wi.sankey().nodeId(y=>y.name).nodeAlign(wi.sankeyJustify).nodeWidth(k).nodePadding(h).extent([o,d]).nodeSort(null)({nodes:G.map(y=>Object.assign({},y)),links:M.map(y=>Object.assign({},y))})}catch(h){return Ae("SankeyChart.tsx","getsankey",h),{nodes:[],links:[]}}},be=()=>{try{let G=function(){try{const T={};o.forEach(a=>{const m=a.x0;T[m]||(T[m]=[]),T[m].push(a)}),Object.keys(T).forEach(a=>{const m=T[a];if(m.length===0)return;m.sort((Le,ze)=>Le.y0-ze.y0);const N=m[0],re=m[m.length-1],K=N.y1-N.y0,me=re.y1-re.y0;if(N.y0=0,N.y1=K,re.y1=R,re.y0=R-me,m.length>2){const Le=m.slice(1,m.length-1),ze=re.y0-N.y1,Se=v.sum(Le,ye=>ye.y1-ye.y0),ie=(ze-Se)/(Le.length+1);let De=N.y1+ie;Le.forEach(ye=>{const fe=ye.y1-ye.y0;ye.y0=De,ye.y1=De+fe,De+=fe+ie})}})}catch(T){Ae("SankeyChart.tsx","centerAlignNodesByLayer",T)}},M=function(){try{o.forEach(T=>{let a=0,m=0;T.sourceLinks.forEach(N=>{N.sy=a,a+=N.width}),T.targetLinks.forEach(N=>{N.ty=m,m+=N.width})})}catch(T){Ae("SankeyChart.tsx","arrangeFlows",T)}},h=function(T){return function(a){try{const m=a.source.x1,N=a.source.y0+a.sy+a.width/2,re=a.target.x0,K=a.target.y0+a.ty+a.width/2,me=re-m,Le=m+me*T,ze=re-me*T;return`M${m},${N} C${Le},${N} ${ze},${K} ${re},${K}`}catch(m){return Ae("SankeyChart.tsx","sankeyLinkCustom",m),""}}},k=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:o,links:d}=ge(s,l);M(),G(),M(),M();const i=B.append("g").selectAll("rect").data(o).enter().append("rect").style("fill-opacity",Z).attr("id",T=>"Node"+T.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none").attr("stroke-width",u.nodes.nodesBorderVisibility?u.nodes.nodesBorderThickness:0).attr("x",T=>T.x0).attr("y",T=>T.y0).attr("height",T=>T.y1-T.y0).attr("width",T=>T.x1-T.x0).attr("fill",T=>T.color?T.color:Re.white).on("mousemove",function(T,a){try{u.toolTip.toolTipVisibility&&yt([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?$.get(a.name)+"%":qe(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},gt(n,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),B.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),B.selectAll(".sankey-nodes-texts").style("opacity","0"),B.selectAll(".sankey-links").style("stroke-opacity",.1),B.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",Z).style("cursor","pointer"),B.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(m=>{B.select(`#Node${m.target.index}`).style("fill-opacity",Z).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Link${m.index}`).style("stroke-opacity",ce),B.select(`#Label${m.target.index}`).style("opacity",1)}),a.targetLinks.forEach(m=>{B.select(`#Node${m.source.index}`).style("fill-opacity",Z).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Link${m.index}`).style("stroke-opacity",ce),B.select(`#Label${m.source.index}`).style("opacity",1)})}catch(m){Ae("SankeyChart.tsx","Nodes.onMouseMove",m)}}).on("mouseout",function(T){try{B.selectAll(".sankey-nodes").style("fill-opacity",Z).style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.selectAll(".sankey-links").style("stroke-opacity",ce),B.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&ot()}catch(a){Ae("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(lt.SeriesId,T=>String(T.name??"")).attr(lt.DimValue,T=>String(T.name??"")).on("click",Tt(L,f,(T,a)=>{const m=String(a.name??"");return{seriesId:m,dimValue:m,legendUniqueId:m,seriesDisplayName:m.includes("~$~")?m.split("~$~")[1]:m}}));if(B.append("g").attr("fill","none").selectAll("g").data(d).enter().append("g").style("mix-blend-mode","multiply").append("path").attr("class","sankey-links").attr("stroke-opacity",ce).attr("id",T=>"Link"+T.index).attr("d",h(k)).attr("stroke",T=>u.links.linksColor==="Source"?T.source.color:T.target.color).attr("stroke-width",T=>Math.max(1,T.width)).on("mousemove",function(T,a){try{B.selectAll(".sankey-links").style("stroke-opacity",.1),B.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),B.selectAll(".sankey-nodes-texts").style("opacity","0"),B.select(`#Link${a.index}`).style("stroke-opacity",ce).style("cursor","pointer"),B.select(`#Node${a.target.index}`).style("fill-opacity",Z).style("Stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Node${a.source.index}`).style("fill-opacity",Z).style("Stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.select(`#Label${a.target.index}`).style("opacity",1),B.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&yt([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:qe(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},gt(n,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(m){Ae("SankeyChart.tsx","link.onMouseMove",m)}}).on("mouseout",function(T){try{u.toolTip.toolTipVisibility&&ot(),B.selectAll(".sankey-nodes").style("fill-opacity",Z),B.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==Re.white?u.nodes.nodesBorderColor:"none"),B.selectAll(".sankey-links").style("stroke-opacity",ce),B.selectAll(".sankey-nodes-texts").style("opacity","1"),v.select(this).select("rect").style("pointer-events","all"),v.select(this).style("cursor","none")}catch(a){Ae("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const T=B.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(oe.bold)?oe.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(o).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const m=u.nodes.sankeyNodeWidth,N=W===li.center;v.select(this).append("foreignObject").attr("x",Q(a).x).attr("y",Q(a).y-16).attr("width",me=>N?m:P).attr("height",20).append("xhtml:div").style("white-space",N||D?"nowrap":"normal").style("overflow",N||D?"hidden":"visible").style("text-overflow",N||D?"ellipsis":"clip").style("display","block").style("max-width",me=>N?"100px":P+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(oe.bold)?oe.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",me=>$.get(me.name)>0?me.alias?me.alias.includes("~$~")?me.alias.split("~$~")[1]:me.alias:me.name.includes("~$~")?me.name.split("~$~")[1]:me.name:"").text(me=>$.get(me.name)>0?me.alias?me.alias.includes("~$~")?me.alias.split("~$~")[1]:me.alias:me.name.includes("~$~")?me.name.split("~$~")[1]:me.name:""),v.select(this).append("foreignObject").attr("x",Q(a).x).attr("y",Q(a).y).attr("width",me=>N?m:P).attr("height",20).append("xhtml:div").style("white-space",N||D?"nowrap":"normal").style("overflow",N||D?"hidden":"visible").style("text-overflow",N||D?"ellipsis":"clip").style("display","block").style("max-width",me=>N?"100px":P+"px").style("padding","0 3px").style("color",u.nodes.nodesLabelColor).style("font-family",u.nodes.nodesLabelFontFamily).style("font-size",u.nodes.nodesLabelFontSize+"px").style("font-style",u.nodes.nodesLabelFontStyle.includes(oe.italic)?oe.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(oe.underline)?oe.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(oe.bold)?oe.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",me=>$.get(me.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(me.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":qe(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(me.totalValue):"").text(me=>$.get(me.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?$.get(me.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":qe(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(me.totalValue):"")}}catch(m){Ae("SankeyChart.tsx","texts.each",m)}})}catch(T){Ae("SankeyChart.tsx","inittree.texts",T)}}catch(G){Ae("SankeyChart.tsx","inittree",G)}};function pe(G){try{const M=new Map,h=new Map,k=new Set;for(const{source:T,target:a}of G)k.add(T),k.add(a),M.has(a)||M.set(a,new Set),h.has(T)||h.set(T,new Set),M.get(a).add(T),h.get(T).add(a);const o=new Map,d=[];for(const T of k)M.has(T)||(o.set(T,0),d.push(T));for(;d.length>0;){const T=d.shift(),a=o.get(T),m=h.get(T)||[];for(const N of m){const re=a+1;(!o.has(N)||o.get(N)<re)&&(o.set(N,re),d.push(N))}}const i=new Map;for(const[T,a]of o.entries())i.has(a)||i.set(a,[]),i.get(a).push(T);return[...i.entries()].sort((T,a)=>T[0]-a[0]).map(([T,a])=>({layer:T,nodes:a}))}catch(M){return Ae("SankeyChart.tsx","assignNodeLayers",M),[]}}const Q=G=>{try{let M={};const h=Number(u.nodes.sankeyNodeWidth),k=h/2;switch(W){case"Right":M.x=G.x1+6;break;default:case"Left":M.x=G.x0-P;break;case"Center":M.x=G.x0+k-h/2;break}return M.y=(G.y1+G.y0)/2,M}catch(M){return Ae("SankeyChart.tsx","getXandYPositionOfLables",M),{x:0,y:0}}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:p,id:r,style:{width:"100%",height:"100%"}})})},Vr={type:"FeatureCollection",features:[{type:"Feature",id:"AL",properties:{name:"Alabama",value:55},geometry:{type:"Polygon",coordinates:[[[-87.359296,35.00118],[-85.606675,34.984749],[-85.431413,34.124869],[-85.184951,32.859696],[-85.069935,32.580372],[-84.960397,32.421541],[-85.004212,32.322956],[-84.889196,32.262709],[-85.058981,32.13674],[-85.053504,32.01077],[-85.141136,31.840985],[-85.042551,31.539753],[-85.113751,31.27686],[-85.004212,31.003013],[-85.497137,30.997536],[-87.600282,30.997536],[-87.633143,30.86609],[-87.408589,30.674397],[-87.446927,30.510088],[-87.37025,30.427934],[-87.518128,30.280057],[-87.655051,30.247195],[-87.90699,30.411504],[-87.934375,30.657966],[-88.011052,30.685351],[-88.10416,30.499135],[-88.137022,30.318396],[-88.394438,30.367688],[-88.471115,31.895754],[-88.241084,33.796253],[-88.098683,34.891641],[-88.202745,34.995703],[-87.359296,35.00118]]]}},{type:"Feature",id:"AK",properties:{name:"Alaska",value:87},geometry:{type:"MultiPolygon",coordinates:[[[[-131.602021,55.117982],[-131.569159,55.28229],[-131.355558,55.183705],[-131.38842,55.01392],[-131.645836,55.035827],[-131.602021,55.117982]]],[[[-131.832052,55.42469],[-131.645836,55.304197],[-131.749898,55.128935],[-131.832052,55.189182],[-131.832052,55.42469]]],[[[-132.976733,56.437924],[-132.735747,56.459832],[-132.631685,56.421493],[-132.664547,56.273616],[-132.878148,56.240754],[-133.069841,56.333862],[-132.976733,56.437924]]],[[[-133.595627,56.350293],[-133.162949,56.317431],[-133.05341,56.125739],[-132.620732,55.912138],[-132.472854,55.780691],[-132.4619,55.671152],[-132.357838,55.649245],[-132.341408,55.506844],[-132.166146,55.364444],[-132.144238,55.238474],[-132.029222,55.276813],[-131.97993,55.178228],[-131.958022,54.789365],[-132.029222,54.701734],[-132.308546,54.718165],[-132.385223,54.915335],[-132.483808,54.898904],[-132.686455,55.046781],[-132.746701,54.997489],[-132.916486,55.046781],[-132.889102,54.898904],[-132.73027,54.937242],[-132.626209,54.882473],[-132.675501,54.679826],[-132.867194,54.701734],[-133.157472,54.95915],[-133.239626,55.090597],[-133.223195,55.22752],[-133.453227,55.216566],[-133.453227,55.320628],[-133.277964,55.331582],[-133.102702,55.42469],[-133.17938,55.588998],[-133.387503,55.62186],[-133.420365,55.884753],[-133.497042,56.0162],[-133.639442,55.923092],[-133.694212,56.070969],[-133.546335,56.142169],[-133.666827,56.311955],[-133.595627,56.350293]]],[[[-133.738027,55.556137],[-133.546335,55.490413],[-133.414888,55.572568],[-133.283441,55.534229],[-133.420365,55.386352],[-133.633966,55.430167],[-133.738027,55.556137]]],[[[-133.907813,56.930849],[-134.050213,57.029434],[-133.885905,57.095157],[-133.343688,57.002049],[-133.102702,57.007526],[-132.932917,56.82131],[-132.620732,56.667956],[-132.653593,56.55294],[-132.817901,56.492694],[-133.042456,56.520078],[-133.201287,56.448878],[-133.420365,56.492694],[-133.66135,56.448878],[-133.710643,56.684386],[-133.688735,56.837741],[-133.869474,56.843218],[-133.907813,56.930849]]],[[[-134.115936,56.48174],[-134.25286,56.558417],[-134.400737,56.722725],[-134.417168,56.848695],[-134.296675,56.908941],[-134.170706,56.848695],[-134.143321,56.952757],[-133.748981,56.772017],[-133.710643,56.596755],[-133.847566,56.574848],[-133.935197,56.377678],[-133.836612,56.322908],[-133.957105,56.092877],[-134.110459,56.142169],[-134.132367,55.999769],[-134.230952,56.070969],[-134.291198,56.350293],[-134.115936,56.48174]]],[[[-134.636246,56.28457],[-134.669107,56.169554],[-134.806031,56.235277],[-135.178463,56.67891],[-135.413971,56.810356],[-135.331817,56.914418],[-135.424925,57.166357],[-135.687818,57.369004],[-135.419448,57.566174],[-135.298955,57.48402],[-135.063447,57.418296],[-134.849846,57.407343],[-134.844369,57.248511],[-134.636246,56.728202],[-134.636246,56.28457]]],[[[-134.712923,58.223407],[-134.373353,58.14673],[-134.176183,58.157683],[-134.187137,58.081006],[-133.902336,57.807159],[-134.099505,57.850975],[-134.148798,57.757867],[-133.935197,57.615466],[-133.869474,57.363527],[-134.083075,57.297804],[-134.154275,57.210173],[-134.499322,57.029434],[-134.603384,57.034911],[-134.6472,57.226604],[-134.575999,57.341619],[-134.608861,57.511404],[-134.729354,57.719528],[-134.707446,57.829067],[-134.784123,58.097437],[-134.91557,58.212453],[-134.953908,58.409623],[-134.712923,58.223407]]],[[[-135.857603,57.330665],[-135.715203,57.330665],[-135.567326,57.149926],[-135.633049,57.023957],[-135.857603,56.996572],[-135.824742,57.193742],[-135.857603,57.330665]]],[[[-136.279328,58.206976],[-135.978096,58.201499],[-135.780926,58.28913],[-135.496125,58.168637],[-135.64948,58.037191],[-135.59471,57.987898],[-135.45231,58.135776],[-135.107263,58.086483],[-134.91557,57.976944],[-135.025108,57.779775],[-134.937477,57.763344],[-134.822462,57.500451],[-135.085355,57.462112],[-135.572802,57.675713],[-135.556372,57.456635],[-135.709726,57.369004],[-135.890465,57.407343],[-136.000004,57.544266],[-136.208128,57.637374],[-136.366959,57.829067],[-136.569606,57.916698],[-136.558652,58.075529],[-136.421728,58.130299],[-136.377913,58.267222],[-136.279328,58.206976]]],[[[-147.079854,60.200582],[-147.501579,59.948643],[-147.53444,59.850058],[-147.874011,59.784335],[-147.80281,59.937689],[-147.435855,60.09652],[-147.205824,60.271782],[-147.079854,60.200582]]],[[[-147.561825,60.578491],[-147.616594,60.370367],[-147.758995,60.156767],[-147.956165,60.227967],[-147.791856,60.474429],[-147.561825,60.578491]]],[[[-147.786379,70.245291],[-147.682318,70.201475],[-147.162008,70.15766],[-146.888161,70.185044],[-146.510252,70.185044],[-146.099482,70.146706],[-145.858496,70.168614],[-145.622988,70.08646],[-145.195787,69.993352],[-144.620708,69.971444],[-144.461877,70.026213],[-144.078491,70.059075],[-143.914183,70.130275],[-143.497935,70.141229],[-143.503412,70.091936],[-143.25695,70.119321],[-142.747594,70.042644],[-142.402547,69.916674],[-142.079408,69.856428],[-142.008207,69.801659],[-141.712453,69.790705],[-141.433129,69.697597],[-141.378359,69.63735],[-141.208574,69.686643],[-141.00045,69.648304],[-141.00045,60.304644],[-140.53491,60.22249],[-140.474664,60.310121],[-139.987216,60.184151],[-139.696939,60.342983],[-139.088998,60.359413],[-139.198537,60.091043],[-139.045183,59.997935],[-138.700135,59.910304],[-138.623458,59.767904],[-137.604747,59.242118],[-137.445916,58.908024],[-137.265177,59.001132],[-136.827022,59.159963],[-136.580559,59.16544],[-136.465544,59.285933],[-136.476498,59.466672],[-136.301236,59.466672],[-136.25742,59.625503],[-135.945234,59.663842],[-135.479694,59.800766],[-135.025108,59.565257],[-135.068924,59.422857],[-134.959385,59.280456],[-134.701969,59.247595],[-134.378829,59.033994],[-134.400737,58.973748],[-134.25286,58.858732],[-133.842089,58.727285],[-133.173903,58.152206],[-133.075318,57.998852],[-132.867194,57.845498],[-132.560485,57.505928],[-132.253777,57.21565],[-132.368792,57.095157],[-132.05113,57.051341],[-132.127807,56.876079],[-131.870391,56.804879],[-131.837529,56.602232],[-131.580113,56.613186],[-131.087188,56.405062],[-130.78048,56.366724],[-130.621648,56.268139],[-130.468294,56.240754],[-130.424478,56.142169],[-130.101339,56.114785],[-130.002754,55.994292],[-130.150631,55.769737],[-130.128724,55.583521],[-129.986323,55.276813],[-130.095862,55.200136],[-130.336847,54.920812],[-130.687372,54.718165],[-130.785957,54.822227],[-130.917403,54.789365],[-131.010511,54.997489],[-130.983126,55.08512],[-131.092665,55.189182],[-130.862634,55.298721],[-130.928357,55.337059],[-131.158389,55.200136],[-131.284358,55.287767],[-131.426759,55.238474],[-131.843006,55.457552],[-131.700606,55.698537],[-131.963499,55.616383],[-131.974453,55.49589],[-132.182576,55.588998],[-132.226392,55.704014],[-132.083991,55.829984],[-132.127807,55.955953],[-132.324977,55.851892],[-132.522147,56.076446],[-132.642639,56.032631],[-132.719317,56.218847],[-132.527624,56.339339],[-132.341408,56.339339],[-132.396177,56.487217],[-132.297592,56.67891],[-132.450946,56.673433],[-132.768609,56.837741],[-132.993164,57.034911],[-133.51895,57.177311],[-133.507996,57.577128],[-133.677781,57.62642],[-133.639442,57.790728],[-133.814705,57.834544],[-134.072121,58.053622],[-134.143321,58.168637],[-134.586953,58.206976],[-135.074401,58.502731],[-135.282525,59.192825],[-135.38111,59.033994],[-135.337294,58.891593],[-135.140124,58.617746],[-135.189417,58.573931],[-135.05797,58.349376],[-135.085355,58.201499],[-135.277048,58.234361],[-135.430402,58.398669],[-135.633049,58.426053],[-135.91785,58.382238],[-135.912373,58.617746],[-136.087635,58.814916],[-136.246466,58.75467],[-136.876314,58.962794],[-136.931084,58.902547],[-136.586036,58.836824],[-136.317666,58.672516],[-136.213604,58.667039],[-136.180743,58.535592],[-136.043819,58.382238],[-136.388867,58.294607],[-136.591513,58.349376],[-136.59699,58.212453],[-136.859883,58.316515],[-136.947514,58.393192],[-137.111823,58.393192],[-137.566409,58.590362],[-137.900502,58.765624],[-137.933364,58.869686],[-138.11958,59.02304],[-138.634412,59.132579],[-138.919213,59.247595],[-139.417615,59.379041],[-139.746231,59.505011],[-139.718846,59.641934],[-139.625738,59.598119],[-139.5162,59.68575],[-139.625738,59.88292],[-139.488815,59.992458],[-139.554538,60.041751],[-139.801,59.833627],[-140.315833,59.696704],[-140.92925,59.745996],[-141.444083,59.871966],[-141.46599,59.970551],[-141.706976,59.948643],[-141.964392,60.019843],[-142.539471,60.085566],[-142.873564,60.091043],[-143.623905,60.036274],[-143.892275,59.997935],[-144.231845,60.140336],[-144.65357,60.206059],[-144.785016,60.29369],[-144.834309,60.441568],[-145.124586,60.430614],[-145.223171,60.299167],[-145.738004,60.474429],[-145.820158,60.551106],[-146.351421,60.408706],[-146.608837,60.238921],[-146.718376,60.397752],[-146.608837,60.485383],[-146.455483,60.463475],[-145.951604,60.578491],[-146.017328,60.666122],[-146.252836,60.622307],[-146.345944,60.737322],[-146.565022,60.753753],[-146.784099,61.044031],[-146.866253,60.972831],[-147.172962,60.934492],[-147.271547,60.972831],[-147.375609,60.879723],[-147.758995,60.912584],[-147.775426,60.808523],[-148.032842,60.781138],[-148.153334,60.819476],[-148.065703,61.005692],[-148.175242,61.000215],[-148.350504,60.803046],[-148.109519,60.737322],[-148.087611,60.594922],[-147.939734,60.441568],[-148.027365,60.277259],[-148.219058,60.332029],[-148.273827,60.249875],[-148.087611,60.217013],[-147.983549,59.997935],[-148.251919,59.95412],[-148.399797,59.997935],[-148.635305,59.937689],[-148.755798,59.986981],[-149.067984,59.981505],[-149.05703,60.063659],[-149.204907,60.008889],[-149.287061,59.904827],[-149.418508,59.997935],[-149.582816,59.866489],[-149.511616,59.806242],[-149.741647,59.729565],[-149.949771,59.718611],[-150.031925,59.61455],[-150.25648,59.521442],[-150.409834,59.554303],[-150.579619,59.444764],[-150.716543,59.450241],[-151.001343,59.225687],[-151.308052,59.209256],[-151.406637,59.280456],[-151.592853,59.159963],[-151.976239,59.253071],[-151.888608,59.422857],[-151.636669,59.483103],[-151.47236,59.472149],[-151.423068,59.537872],[-151.127313,59.669319],[-151.116359,59.778858],[-151.505222,59.63098],[-151.828361,59.718611],[-151.8667,59.778858],[-151.702392,60.030797],[-151.423068,60.211536],[-151.379252,60.359413],[-151.297098,60.386798],[-151.264237,60.545629],[-151.406637,60.720892],[-151.06159,60.786615],[-150.404357,61.038554],[-150.245526,60.939969],[-150.042879,60.912584],[-149.741647,61.016646],[-150.075741,61.15357],[-150.207187,61.257632],[-150.47008,61.246678],[-150.656296,61.29597],[-150.711066,61.252155],[-151.023251,61.180954],[-151.165652,61.044031],[-151.477837,61.011169],[-151.800977,60.852338],[-151.833838,60.748276],[-152.080301,60.693507],[-152.13507,60.578491],[-152.310332,60.507291],[-152.392486,60.304644],[-152.732057,60.173197],[-152.567748,60.069136],[-152.704672,59.915781],[-153.022334,59.888397],[-153.049719,59.691227],[-153.345474,59.620026],[-153.438582,59.702181],[-153.586459,59.548826],[-153.761721,59.543349],[-153.72886,59.433811],[-154.117723,59.368087],[-154.1944,59.066856],[-153.750768,59.050425],[-153.400243,58.968271],[-153.301658,58.869686],[-153.444059,58.710854],[-153.679567,58.612269],[-153.898645,58.606793],[-153.920553,58.519161],[-154.062953,58.4863],[-153.99723,58.376761],[-154.145107,58.212453],[-154.46277,58.059098],[-154.643509,58.059098],[-154.818771,58.004329],[-154.988556,58.015283],[-155.120003,57.955037],[-155.081664,57.872883],[-155.328126,57.829067],[-155.377419,57.708574],[-155.547204,57.785251],[-155.73342,57.549743],[-156.045606,57.566174],[-156.023698,57.440204],[-156.209914,57.473066],[-156.34136,57.418296],[-156.34136,57.248511],[-156.549484,56.985618],[-156.883577,56.952757],[-157.157424,56.832264],[-157.20124,56.766541],[-157.376502,56.859649],[-157.672257,56.607709],[-157.754411,56.67891],[-157.918719,56.657002],[-157.957058,56.514601],[-158.126843,56.459832],[-158.32949,56.48174],[-158.488321,56.339339],[-158.208997,56.295524],[-158.510229,55.977861],[-159.375585,55.873799],[-159.616571,55.594475],[-159.676817,55.654722],[-159.643955,55.829984],[-159.813741,55.857368],[-160.027341,55.791645],[-160.060203,55.720445],[-160.394296,55.605429],[-160.536697,55.473983],[-160.580512,55.567091],[-160.668143,55.457552],[-160.865313,55.528752],[-161.232268,55.358967],[-161.506115,55.364444],[-161.467776,55.49589],[-161.588269,55.62186],[-161.697808,55.517798],[-161.686854,55.408259],[-162.053809,55.074166],[-162.179779,55.15632],[-162.218117,55.03035],[-162.470057,55.052258],[-162.508395,55.249428],[-162.661749,55.293244],[-162.716519,55.222043],[-162.579595,55.134412],[-162.645319,54.997489],[-162.847965,54.926289],[-163.00132,55.079643],[-163.187536,55.090597],[-163.220397,55.03035],[-163.034181,54.942719],[-163.373752,54.800319],[-163.14372,54.76198],[-163.138243,54.696257],[-163.329936,54.74555],[-163.587352,54.614103],[-164.085754,54.61958],[-164.332216,54.531949],[-164.354124,54.466226],[-164.638925,54.389548],[-164.847049,54.416933],[-164.918249,54.603149],[-164.710125,54.663395],[-164.551294,54.88795],[-164.34317,54.893427],[-163.894061,55.041304],[-163.532583,55.046781],[-163.39566,54.904381],[-163.291598,55.008443],[-163.313505,55.128935],[-163.105382,55.183705],[-162.880827,55.183705],[-162.579595,55.446598],[-162.245502,55.682106],[-161.807347,55.89023],[-161.292514,55.983338],[-161.078914,55.939523],[-160.87079,55.999769],[-160.816021,55.912138],[-160.931036,55.813553],[-160.805067,55.736876],[-160.766728,55.857368],[-160.509312,55.868322],[-160.438112,55.791645],[-160.27928,55.76426],[-160.273803,55.857368],[-160.536697,55.939523],[-160.558604,55.994292],[-160.383342,56.251708],[-160.147834,56.399586],[-159.830171,56.541986],[-159.326293,56.667956],[-158.959338,56.848695],[-158.784076,56.782971],[-158.641675,56.810356],[-158.701922,56.925372],[-158.658106,57.034911],[-158.378782,57.264942],[-157.995396,57.41282],[-157.688688,57.609989],[-157.705118,57.719528],[-157.458656,58.497254],[-157.07527,58.705377],[-157.119086,58.869686],[-158.039212,58.634177],[-158.32949,58.661562],[-158.40069,58.760147],[-158.564998,58.803962],[-158.619768,58.913501],[-158.767645,58.864209],[-158.860753,58.694424],[-158.701922,58.480823],[-158.893615,58.387715],[-159.0634,58.420577],[-159.392016,58.760147],[-159.616571,58.929932],[-159.731586,58.929932],[-159.808264,58.803962],[-159.906848,58.782055],[-160.054726,58.886116],[-160.235465,58.902547],[-160.317619,59.072332],[-160.854359,58.88064],[-161.33633,58.743716],[-161.374669,58.667039],[-161.752577,58.552023],[-161.938793,58.656085],[-161.769008,58.776578],[-161.829255,59.061379],[-161.955224,59.36261],[-161.703285,59.48858],[-161.911409,59.740519],[-162.092148,59.88292],[-162.234548,60.091043],[-162.448149,60.178674],[-162.502918,59.997935],[-162.760334,59.959597],[-163.171105,59.844581],[-163.66403,59.795289],[-163.9324,59.806242],[-164.162431,59.866489],[-164.189816,60.02532],[-164.386986,60.074613],[-164.699171,60.29369],[-164.962064,60.337506],[-165.268773,60.578491],[-165.060649,60.68803],[-165.016834,60.890677],[-165.175665,60.846861],[-165.197573,60.972831],[-165.120896,61.076893],[-165.323543,61.170001],[-165.34545,61.071416],[-165.591913,61.109754],[-165.624774,61.279539],[-165.816467,61.301447],[-165.920529,61.416463],[-165.915052,61.558863],[-166.106745,61.49314],[-166.139607,61.630064],[-165.904098,61.662925],[-166.095791,61.81628],[-165.756221,61.827233],[-165.756221,62.013449],[-165.674067,62.139419],[-165.044219,62.539236],[-164.912772,62.659728],[-164.819664,62.637821],[-164.874433,62.807606],[-164.633448,63.097884],[-164.425324,63.212899],[-164.036462,63.262192],[-163.73523,63.212899],[-163.313505,63.037637],[-163.039658,63.059545],[-162.661749,63.22933],[-162.272887,63.486746],[-162.075717,63.514131],[-162.026424,63.448408],[-161.555408,63.448408],[-161.13916,63.503177],[-160.766728,63.771547],[-160.766728,63.837271],[-160.952944,64.08921],[-160.974852,64.237087],[-161.26513,64.395918],[-161.374669,64.532842],[-161.078914,64.494503],[-160.79959,64.609519],[-160.783159,64.719058],[-161.144637,64.921705],[-161.413007,64.762873],[-161.664946,64.790258],[-161.900455,64.702627],[-162.168825,64.680719],[-162.234548,64.620473],[-162.541257,64.532842],[-162.634365,64.384965],[-162.787719,64.324718],[-162.858919,64.49998],[-163.045135,64.538319],[-163.176582,64.401395],[-163.253259,64.467119],[-163.598306,64.565704],[-164.304832,64.560227],[-164.80871,64.450688],[-165.000403,64.434257],[-165.411174,64.49998],[-166.188899,64.576658],[-166.391546,64.636904],[-166.484654,64.735489],[-166.413454,64.872412],[-166.692778,64.987428],[-166.638008,65.113398],[-166.462746,65.179121],[-166.517516,65.337952],[-166.796839,65.337952],[-167.026871,65.381768],[-167.47598,65.414629],[-167.711489,65.496784],[-168.072967,65.578938],[-168.105828,65.682999],[-167.541703,65.819923],[-166.829701,66.049954],[-166.3313,66.186878],[-166.046499,66.110201],[-165.756221,66.09377],[-165.690498,66.203309],[-165.86576,66.21974],[-165.88219,66.312848],[-165.186619,66.466202],[-164.403417,66.581218],[-163.981692,66.592172],[-163.751661,66.553833],[-163.872153,66.389525],[-163.828338,66.274509],[-163.915969,66.192355],[-163.768091,66.060908],[-163.494244,66.082816],[-163.149197,66.060908],[-162.749381,66.088293],[-162.634365,66.039001],[-162.371472,66.028047],[-162.14144,66.077339],[-161.840208,66.02257],[-161.549931,66.241647],[-161.341807,66.252601],[-161.199406,66.208786],[-161.128206,66.334755],[-161.528023,66.395002],[-161.911409,66.345709],[-161.87307,66.510017],[-162.174302,66.68528],[-162.502918,66.740049],[-162.601503,66.89888],[-162.344087,66.937219],[-162.015471,66.778388],[-162.075717,66.652418],[-161.916886,66.553833],[-161.571838,66.438817],[-161.489684,66.55931],[-161.884024,66.718141],[-161.714239,67.002942],[-161.851162,67.052235],[-162.240025,66.991988],[-162.639842,67.008419],[-162.700088,67.057712],[-162.902735,67.008419],[-163.740707,67.128912],[-163.757138,67.254881],[-164.009077,67.534205],[-164.211724,67.638267],[-164.534863,67.725898],[-165.192096,67.966884],[-165.493328,68.059992],[-165.794559,68.081899],[-166.243668,68.246208],[-166.681824,68.339316],[-166.703731,68.372177],[-166.375115,68.42147],[-166.227238,68.574824],[-166.216284,68.881533],[-165.329019,68.859625],[-164.255539,68.930825],[-163.976215,68.985595],[-163.532583,69.138949],[-163.110859,69.374457],[-163.023228,69.609966],[-162.842489,69.812613],[-162.470057,69.982398],[-162.311225,70.108367],[-161.851162,70.311014],[-161.779962,70.256245],[-161.396576,70.239814],[-160.837928,70.343876],[-160.487404,70.453415],[-159.649432,70.792985],[-159.33177,70.809416],[-159.298908,70.760123],[-158.975769,70.798462],[-158.658106,70.787508],[-158.033735,70.831323],[-157.420318,70.979201],[-156.812377,71.285909],[-156.565915,71.351633],[-156.522099,71.296863],[-155.585543,71.170894],[-155.508865,71.083263],[-155.832005,70.968247],[-155.979882,70.96277],[-155.974405,70.809416],[-155.503388,70.858708],[-155.476004,70.940862],[-155.262403,71.017539],[-155.191203,70.973724],[-155.032372,71.148986],[-154.566832,70.990155],[-154.643509,70.869662],[-154.353231,70.8368],[-154.183446,70.7656],[-153.931507,70.880616],[-153.487874,70.886093],[-153.235935,70.924431],[-152.589656,70.886093],[-152.26104,70.842277],[-152.419871,70.606769],[-151.817408,70.546523],[-151.773592,70.486276],[-151.187559,70.382214],[-151.182082,70.431507],[-150.760358,70.49723],[-150.355064,70.491753],[-150.349588,70.436984],[-150.114079,70.431507],[-149.867617,70.508184],[-149.462323,70.519138],[-149.177522,70.486276],[-148.78866,70.404122],[-148.607921,70.420553],[-148.350504,70.305537],[-148.202627,70.349353],[-147.961642,70.316491],[-147.786379,70.245291]]],[[[-152.94018,58.026237],[-152.945657,57.982421],[-153.290705,58.048145],[-153.044242,58.305561],[-152.819688,58.327469],[-152.666333,58.562977],[-152.496548,58.354853],[-152.354148,58.426053],[-152.080301,58.311038],[-152.080301,58.152206],[-152.480117,58.130299],[-152.655379,58.059098],[-152.94018,58.026237]]],[[[-153.958891,57.538789],[-153.67409,57.670236],[-153.931507,57.69762],[-153.936983,57.812636],[-153.723383,57.889313],[-153.570028,57.834544],[-153.548121,57.719528],[-153.46049,57.796205],[-153.455013,57.96599],[-153.268797,57.889313],[-153.235935,57.998852],[-153.071627,57.933129],[-152.874457,57.933129],[-152.721103,57.993375],[-152.469163,57.889313],[-152.469163,57.599035],[-152.151501,57.620943],[-152.359625,57.42925],[-152.74301,57.505928],[-152.60061,57.379958],[-152.710149,57.275896],[-152.907319,57.325188],[-152.912796,57.128019],[-153.214027,57.073249],[-153.312612,56.991095],[-153.498828,57.067772],[-153.695998,56.859649],[-153.849352,56.837741],[-154.013661,56.744633],[-154.073907,56.969187],[-154.303938,56.848695],[-154.314892,56.919895],[-154.523016,56.991095],[-154.539447,57.193742],[-154.742094,57.275896],[-154.627078,57.511404],[-154.227261,57.659282],[-153.980799,57.648328],[-153.958891,57.538789]]],[[[-154.53397,56.602232],[-154.742094,56.399586],[-154.807817,56.432447],[-154.53397,56.602232]]],[[[-155.634835,55.923092],[-155.476004,55.912138],[-155.530773,55.704014],[-155.793666,55.731399],[-155.837482,55.802599],[-155.634835,55.923092]]],[[[-159.890418,55.28229],[-159.950664,55.068689],[-160.257373,54.893427],[-160.109495,55.161797],[-160.005433,55.134412],[-159.890418,55.28229]]],[[[-160.520266,55.358967],[-160.33405,55.358967],[-160.339527,55.249428],[-160.525743,55.128935],[-160.690051,55.211089],[-160.794113,55.134412],[-160.854359,55.320628],[-160.79959,55.380875],[-160.520266,55.358967]]],[[[-162.256456,54.981058],[-162.234548,54.893427],[-162.349564,54.838658],[-162.437195,54.931766],[-162.256456,54.981058]]],[[[-162.415287,63.634624],[-162.563165,63.536039],[-162.612457,63.62367],[-162.415287,63.634624]]],[[[-162.80415,54.488133],[-162.590549,54.449795],[-162.612457,54.367641],[-162.782242,54.373118],[-162.80415,54.488133]]],[[[-165.548097,54.29644],[-165.476897,54.181425],[-165.630251,54.132132],[-165.685021,54.252625],[-165.548097,54.29644]]],[[[-165.73979,54.15404],[-166.046499,54.044501],[-166.112222,54.121178],[-165.980775,54.219763],[-165.73979,54.15404]]],[[[-166.364161,60.359413],[-166.13413,60.397752],[-166.084837,60.326552],[-165.88219,60.342983],[-165.685021,60.277259],[-165.646682,59.992458],[-165.750744,59.89935],[-166.00816,59.844581],[-166.062929,59.745996],[-166.440838,59.855535],[-166.6161,59.850058],[-166.994009,59.992458],[-167.125456,59.992458],[-167.344534,60.074613],[-167.421211,60.206059],[-167.311672,60.238921],[-166.93924,60.206059],[-166.763978,60.310121],[-166.577762,60.321075],[-166.495608,60.392275],[-166.364161,60.359413]]],[[[-166.375115,54.01164],[-166.210807,53.934962],[-166.5449,53.748746],[-166.539423,53.715885],[-166.117699,53.852808],[-166.112222,53.776131],[-166.282007,53.683023],[-166.555854,53.622777],[-166.583239,53.529669],[-166.878994,53.431084],[-167.13641,53.425607],[-167.306195,53.332499],[-167.623857,53.250345],[-167.793643,53.337976],[-167.459549,53.442038],[-167.355487,53.425607],[-167.103548,53.513238],[-167.163794,53.611823],[-167.021394,53.715885],[-166.807793,53.666592],[-166.785886,53.732316],[-167.015917,53.754223],[-167.141887,53.825424],[-167.032348,53.945916],[-166.643485,54.017116],[-166.561331,53.880193],[-166.375115,54.01164]]],[[[-168.790446,53.157237],[-168.40706,53.34893],[-168.385152,53.431084],[-168.237275,53.524192],[-168.007243,53.568007],[-167.886751,53.518715],[-167.842935,53.387268],[-168.270136,53.244868],[-168.500168,53.036744],[-168.686384,52.965544],[-168.790446,53.157237]]],[[[-169.74891,52.894344],[-169.705095,52.795759],[-169.962511,52.790282],[-169.989896,52.856005],[-169.74891,52.894344]]],[[[-170.148727,57.221127],[-170.28565,57.128019],[-170.313035,57.221127],[-170.148727,57.221127]]],[[[-170.669036,52.697174],[-170.603313,52.604066],[-170.789529,52.538343],[-170.816914,52.636928],[-170.669036,52.697174]]],[[[-171.742517,63.716778],[-170.94836,63.5689],[-170.488297,63.69487],[-170.280174,63.683916],[-170.093958,63.612716],[-170.044665,63.492223],[-169.644848,63.4265],[-169.518879,63.366254],[-168.99857,63.338869],[-168.686384,63.295053],[-168.856169,63.147176],[-169.108108,63.180038],[-169.376478,63.152653],[-169.513402,63.08693],[-169.639372,62.939052],[-169.831064,63.075976],[-170.055619,63.169084],[-170.263743,63.180038],[-170.362328,63.2841],[-170.866206,63.415546],[-171.101715,63.421023],[-171.463193,63.306007],[-171.73704,63.366254],[-171.852055,63.486746],[-171.742517,63.716778]]],[[[-172.432611,52.390465],[-172.41618,52.275449],[-172.607873,52.253542],[-172.569535,52.352127],[-172.432611,52.390465]]],[[[-173.626584,52.14948],[-173.495138,52.105664],[-173.122706,52.111141],[-173.106275,52.07828],[-173.549907,52.028987],[-173.626584,52.14948]]],[[[-174.322156,52.280926],[-174.327632,52.379511],[-174.185232,52.41785],[-173.982585,52.319265],[-174.059262,52.226157],[-174.179755,52.231634],[-174.141417,52.127572],[-174.333109,52.116618],[-174.738403,52.007079],[-174.968435,52.039941],[-174.902711,52.116618],[-174.656249,52.105664],[-174.322156,52.280926]]],[[[-176.469116,51.853725],[-176.288377,51.870156],[-176.288377,51.744186],[-176.518409,51.760617],[-176.80321,51.61274],[-176.912748,51.80991],[-176.792256,51.815386],[-176.775825,51.963264],[-176.627947,51.968741],[-176.627947,51.859202],[-176.469116,51.853725]]],[[[-177.153734,51.946833],[-177.044195,51.897541],[-177.120872,51.727755],[-177.274226,51.678463],[-177.279703,51.782525],[-177.153734,51.946833]]],[[[-178.123152,51.919448],[-177.953367,51.913971],[-177.800013,51.793479],[-177.964321,51.651078],[-178.123152,51.919448]]],[[[173.107557,52.992929],[173.293773,52.927205],[173.304726,52.823143],[172.90491,52.762897],[172.642017,52.927205],[172.642017,53.003883],[173.107557,52.992929]]]]}},{type:"Feature",id:"AZ",properties:{name:"Arizona",value:98},geometry:{type:"Polygon",coordinates:[[[-109.042503,37.000263],[-109.04798,31.331629],[-111.074448,31.331629],[-112.246513,31.704061],[-114.815198,32.492741],[-114.72209,32.717295],[-114.524921,32.755634],[-114.470151,32.843265],[-114.524921,33.029481],[-114.661844,33.034958],[-114.727567,33.40739],[-114.524921,33.54979],[-114.497536,33.697668],[-114.535874,33.933176],[-114.415382,34.108438],[-114.256551,34.174162],[-114.136058,34.305608],[-114.333228,34.448009],[-114.470151,34.710902],[-114.634459,34.87521],[-114.634459,35.00118],[-114.574213,35.138103],[-114.596121,35.324319],[-114.678275,35.516012],[-114.738521,36.102045],[-114.371566,36.140383],[-114.251074,36.01989],[-114.152489,36.025367],[-114.048427,36.195153],[-114.048427,37.000263],[-110.499369,37.00574],[-109.042503,37.000263]]]}},{type:"Feature",id:"AR",properties:{name:"Arkansas",value:5},geometry:{type:"Polygon",coordinates:[[[-94.473842,36.501861],[-90.152536,36.496384],[-90.064905,36.304691],[-90.218259,36.184199],[-90.377091,35.997983],[-89.730812,35.997983],[-89.763673,35.811767],[-89.911551,35.756997],[-89.944412,35.603643],[-90.130628,35.439335],[-90.114197,35.198349],[-90.212782,35.023087],[-90.311367,34.995703],[-90.251121,34.908072],[-90.409952,34.831394],[-90.481152,34.661609],[-90.585214,34.617794],[-90.568783,34.420624],[-90.749522,34.365854],[-90.744046,34.300131],[-90.952169,34.135823],[-90.891923,34.026284],[-91.072662,33.867453],[-91.231493,33.560744],[-91.056231,33.429298],[-91.143862,33.347144],[-91.089093,33.13902],[-91.16577,33.002096],[-93.608485,33.018527],[-94.041164,33.018527],[-94.041164,33.54979],[-94.183564,33.593606],[-94.380734,33.544313],[-94.484796,33.637421],[-94.430026,35.395519],[-94.616242,36.501861],[-94.473842,36.501861]]]}},{type:"Feature",id:"CA",properties:{name:"California",value:38},geometry:{type:"Polygon",coordinates:[[[-123.233256,42.006186],[-122.378853,42.011663],[-121.037003,41.995232],[-120.001861,41.995232],[-119.996384,40.264519],[-120.001861,38.999346],[-118.71478,38.101128],[-117.498899,37.21934],[-116.540435,36.501861],[-115.85034,35.970598],[-114.634459,35.00118],[-114.634459,34.87521],[-114.470151,34.710902],[-114.333228,34.448009],[-114.136058,34.305608],[-114.256551,34.174162],[-114.415382,34.108438],[-114.535874,33.933176],[-114.497536,33.697668],[-114.524921,33.54979],[-114.727567,33.40739],[-114.661844,33.034958],[-114.524921,33.029481],[-114.470151,32.843265],[-114.524921,32.755634],[-114.72209,32.717295],[-116.04751,32.624187],[-117.126467,32.536556],[-117.24696,32.668003],[-117.252437,32.876127],[-117.329114,33.122589],[-117.471515,33.297851],[-117.7837,33.538836],[-118.183517,33.763391],[-118.260194,33.703145],[-118.413548,33.741483],[-118.391641,33.840068],[-118.566903,34.042715],[-118.802411,33.998899],[-119.218659,34.146777],[-119.278905,34.26727],[-119.558229,34.415147],[-119.875891,34.40967],[-120.138784,34.475393],[-120.472878,34.448009],[-120.64814,34.579455],[-120.609801,34.858779],[-120.670048,34.902595],[-120.631709,35.099764],[-120.894602,35.247642],[-120.905556,35.450289],[-121.004141,35.461243],[-121.168449,35.636505],[-121.283465,35.674843],[-121.332757,35.784382],[-121.716143,36.195153],[-121.896882,36.315645],[-121.935221,36.638785],[-121.858544,36.6114],[-121.787344,36.803093],[-121.929744,36.978355],[-122.105006,36.956447],[-122.335038,37.115279],[-122.417192,37.241248],[-122.400761,37.361741],[-122.515777,37.520572],[-122.515777,37.783465],[-122.329561,37.783465],[-122.406238,38.15042],[-122.488392,38.112082],[-122.504823,37.931343],[-122.701993,37.893004],[-122.937501,38.029928],[-122.97584,38.265436],[-123.129194,38.451652],[-123.331841,38.566668],[-123.44138,38.698114],[-123.737134,38.95553],[-123.687842,39.032208],[-123.824765,39.366301],[-123.764519,39.552517],[-123.85215,39.831841],[-124.109566,40.105688],[-124.361506,40.259042],[-124.410798,40.439781],[-124.158859,40.877937],[-124.109566,41.025814],[-124.158859,41.14083],[-124.065751,41.442061],[-124.147905,41.715908],[-124.257444,41.781632],[-124.213628,42.000709],[-123.233256,42.006186]]]}},{type:"Feature",id:"CO",properties:{name:"Colorado",value:59},geometry:{type:"Polygon",coordinates:[[[-107.919731,41.003906],[-105.728954,40.998429],[-104.053011,41.003906],[-102.053927,41.003906],[-102.053927,40.001626],[-102.042974,36.994786],[-103.001438,37.000263],[-104.337812,36.994786],[-106.868158,36.994786],[-107.421329,37.000263],[-109.042503,37.000263],[-109.042503,38.166851],[-109.058934,38.27639],[-109.053457,39.125316],[-109.04798,40.998429],[-107.919731,41.003906]]]}},{type:"Feature",id:"CT",properties:{name:"Connecticut",value:45},geometry:{type:"Polygon",coordinates:[[[-73.053528,42.039048],[-71.799309,42.022617],[-71.799309,42.006186],[-71.799309,41.414677],[-71.859555,41.321569],[-71.947186,41.338],[-72.385341,41.261322],[-72.905651,41.28323],[-73.130205,41.146307],[-73.371191,41.102491],[-73.655992,40.987475],[-73.727192,41.102491],[-73.48073,41.21203],[-73.55193,41.294184],[-73.486206,42.050002],[-73.053528,42.039048]]]}},{type:"Feature",id:"DE",properties:{name:"Delaware",value:76},geometry:{type:"Polygon",coordinates:[[[-75.414089,39.804456],[-75.507197,39.683964],[-75.611259,39.61824],[-75.589352,39.459409],[-75.441474,39.311532],[-75.403136,39.065069],[-75.189535,38.807653],[-75.09095,38.796699],[-75.047134,38.451652],[-75.693413,38.462606],[-75.786521,39.722302],[-75.616736,39.831841],[-75.414089,39.804456]]]}},{type:"Feature",id:"FL",properties:{name:"Florida",value:3},geometry:{type:"Polygon",coordinates:[[[-85.497137,30.997536],[-85.004212,31.003013],[-84.867289,30.712735],[-83.498053,30.647012],[-82.216449,30.570335],[-82.167157,30.356734],[-82.046664,30.362211],[-82.002849,30.564858],[-82.041187,30.751074],[-81.948079,30.827751],[-81.718048,30.745597],[-81.444201,30.707258],[-81.383954,30.27458],[-81.257985,29.787132],[-80.967707,29.14633],[-80.524075,28.461713],[-80.589798,28.41242],[-80.56789,28.094758],[-80.381674,27.738757],[-80.091397,27.021277],[-80.03115,26.796723],[-80.036627,26.566691],[-80.146166,25.739673],[-80.239274,25.723243],[-80.337859,25.465826],[-80.304997,25.383672],[-80.49669,25.197456],[-80.573367,25.241272],[-80.759583,25.164595],[-81.077246,25.120779],[-81.170354,25.224841],[-81.126538,25.378195],[-81.351093,25.821827],[-81.526355,25.903982],[-81.679709,25.843735],[-81.800202,26.090198],[-81.833064,26.292844],[-82.041187,26.517399],[-82.09048,26.665276],[-82.057618,26.878877],[-82.172634,26.917216],[-82.145249,26.791246],[-82.249311,26.758384],[-82.566974,27.300601],[-82.692943,27.437525],[-82.391711,27.837342],[-82.588881,27.815434],[-82.720328,27.689464],[-82.851774,27.886634],[-82.676512,28.434328],[-82.643651,28.888914],[-82.764143,28.998453],[-82.802482,29.14633],[-82.994175,29.179192],[-83.218729,29.420177],[-83.399469,29.518762],[-83.410422,29.66664],[-83.536392,29.721409],[-83.640454,29.885717],[-84.02384,30.104795],[-84.357933,30.055502],[-84.341502,29.902148],[-84.451041,29.929533],[-84.867289,29.743317],[-85.310921,29.699501],[-85.299967,29.80904],[-85.404029,29.940487],[-85.924338,30.236241],[-86.29677,30.362211],[-86.630863,30.395073],[-86.910187,30.373165],[-87.518128,30.280057],[-87.37025,30.427934],[-87.446927,30.510088],[-87.408589,30.674397],[-87.633143,30.86609],[-87.600282,30.997536],[-85.497137,30.997536]]]}},{type:"Feature",id:"GA",properties:{name:"Georgia",value:77},geometry:{type:"Polygon",coordinates:[[[-83.109191,35.00118],[-83.322791,34.787579],[-83.339222,34.683517],[-83.005129,34.469916],[-82.901067,34.486347],[-82.747713,34.26727],[-82.714851,34.152254],[-82.55602,33.94413],[-82.325988,33.81816],[-82.194542,33.631944],[-81.926172,33.462159],[-81.937125,33.347144],[-81.761863,33.160928],[-81.493493,33.007573],[-81.42777,32.843265],[-81.416816,32.629664],[-81.279893,32.558464],[-81.121061,32.290094],[-81.115584,32.120309],[-80.885553,32.032678],[-81.132015,31.693108],[-81.175831,31.517845],[-81.279893,31.364491],[-81.290846,31.20566],[-81.400385,31.13446],[-81.444201,30.707258],[-81.718048,30.745597],[-81.948079,30.827751],[-82.041187,30.751074],[-82.002849,30.564858],[-82.046664,30.362211],[-82.167157,30.356734],[-82.216449,30.570335],[-83.498053,30.647012],[-84.867289,30.712735],[-85.004212,31.003013],[-85.113751,31.27686],[-85.042551,31.539753],[-85.141136,31.840985],[-85.053504,32.01077],[-85.058981,32.13674],[-84.889196,32.262709],[-85.004212,32.322956],[-84.960397,32.421541],[-85.069935,32.580372],[-85.184951,32.859696],[-85.431413,34.124869],[-85.606675,34.984749],[-84.319594,34.990226],[-83.618546,34.984749],[-83.109191,35.00118]]]}},{type:"Feature",id:"HI",properties:{name:"Hawaii",value:88},geometry:{type:"MultiPolygon",coordinates:[[[[-155.634835,18.948267],[-155.881297,19.035898],[-155.919636,19.123529],[-155.886774,19.348084],[-156.062036,19.73147],[-155.925113,19.857439],[-155.826528,20.032702],[-155.897728,20.147717],[-155.87582,20.26821],[-155.596496,20.12581],[-155.284311,20.021748],[-155.092618,19.868393],[-155.092618,19.736947],[-154.807817,19.523346],[-154.983079,19.348084],[-155.295265,19.26593],[-155.514342,19.134483],[-155.634835,18.948267]]],[[[-156.587823,21.029505],[-156.472807,20.892581],[-156.324929,20.952827],[-156.00179,20.793996],[-156.051082,20.651596],[-156.379699,20.580396],[-156.445422,20.60778],[-156.461853,20.783042],[-156.631638,20.821381],[-156.697361,20.919966],[-156.587823,21.029505]]],[[[-156.982162,21.210244],[-157.080747,21.106182],[-157.310779,21.106182],[-157.239579,21.221198],[-156.982162,21.210244]]],[[[-157.951581,21.697691],[-157.842042,21.462183],[-157.896811,21.325259],[-158.110412,21.303352],[-158.252813,21.582676],[-158.126843,21.588153],[-157.951581,21.697691]]],[[[-159.468693,22.228955],[-159.353678,22.218001],[-159.298908,22.113939],[-159.33177,21.966061],[-159.446786,21.872953],[-159.764448,21.987969],[-159.726109,22.152277],[-159.468693,22.228955]]]]}},{type:"Feature",id:"ID",properties:{name:"Idaho",value:22},geometry:{type:"Polygon",coordinates:[[[-116.04751,49.000239],[-116.04751,47.976051],[-115.724371,47.696727],[-115.718894,47.42288],[-115.527201,47.302388],[-115.324554,47.258572],[-115.302646,47.187372],[-114.930214,46.919002],[-114.886399,46.809463],[-114.623506,46.705401],[-114.612552,46.639678],[-114.322274,46.645155],[-114.464674,46.272723],[-114.492059,46.037214],[-114.387997,45.88386],[-114.568736,45.774321],[-114.497536,45.670259],[-114.546828,45.560721],[-114.333228,45.456659],[-114.086765,45.593582],[-113.98818,45.703121],[-113.807441,45.604536],[-113.834826,45.522382],[-113.736241,45.330689],[-113.571933,45.128042],[-113.45144,45.056842],[-113.456917,44.865149],[-113.341901,44.782995],[-113.133778,44.772041],[-113.002331,44.448902],[-112.887315,44.394132],[-112.783254,44.48724],[-112.471068,44.481763],[-112.241036,44.569394],[-112.104113,44.520102],[-111.868605,44.563917],[-111.819312,44.509148],[-111.616665,44.547487],[-111.386634,44.75561],[-111.227803,44.580348],[-111.047063,44.476286],[-111.047063,42.000709],[-112.164359,41.995232],[-114.04295,41.995232],[-117.027882,42.000709],[-117.027882,43.830007],[-116.896436,44.158624],[-116.97859,44.240778],[-117.170283,44.257209],[-117.241483,44.394132],[-117.038836,44.750133],[-116.934774,44.782995],[-116.830713,44.930872],[-116.847143,45.02398],[-116.732128,45.144473],[-116.671881,45.319735],[-116.463758,45.61549],[-116.545912,45.752413],[-116.78142,45.823614],[-116.918344,45.993399],[-116.92382,46.168661],[-117.055267,46.343923],[-117.038836,46.426077],[-117.044313,47.762451],[-117.033359,49.000239],[-116.04751,49.000239]]]}},{type:"Feature",id:"IL",properties:{name:"Illinois",value:83},geometry:{type:"Polygon",coordinates:[[[-90.639984,42.510065],[-88.788778,42.493634],[-87.802929,42.493634],[-87.83579,42.301941],[-87.682436,42.077386],[-87.523605,41.710431],[-87.529082,39.34987],[-87.63862,39.169131],[-87.512651,38.95553],[-87.49622,38.780268],[-87.62219,38.637868],[-87.655051,38.506421],[-87.83579,38.292821],[-87.950806,38.27639],[-87.923421,38.15042],[-88.000098,38.101128],[-88.060345,37.865619],[-88.027483,37.799896],[-88.15893,37.657496],[-88.065822,37.482234],[-88.476592,37.389126],[-88.514931,37.285064],[-88.421823,37.153617],[-88.547792,37.071463],[-88.914747,37.224817],[-89.029763,37.213863],[-89.183118,37.038601],[-89.133825,36.983832],[-89.292656,36.994786],[-89.517211,37.279587],[-89.435057,37.34531],[-89.517211,37.537003],[-89.517211,37.690357],[-89.84035,37.903958],[-89.949889,37.88205],[-90.059428,38.013497],[-90.355183,38.216144],[-90.349706,38.374975],[-90.179921,38.632391],[-90.207305,38.725499],[-90.10872,38.845992],[-90.251121,38.917192],[-90.470199,38.961007],[-90.585214,38.867899],[-90.661891,38.928146],[-90.727615,39.256762],[-91.061708,39.470363],[-91.368417,39.727779],[-91.494386,40.034488],[-91.50534,40.237135],[-91.417709,40.379535],[-91.401278,40.560274],[-91.121954,40.669813],[-91.09457,40.823167],[-90.963123,40.921752],[-90.946692,41.097014],[-91.111001,41.239415],[-91.045277,41.414677],[-90.656414,41.463969],[-90.344229,41.589939],[-90.311367,41.743293],[-90.179921,41.809016],[-90.141582,42.000709],[-90.168967,42.126679],[-90.393521,42.225264],[-90.420906,42.329326],[-90.639984,42.510065]]]}},{type:"Feature",id:"IN",properties:{name:"Indiana",value:100},geometry:{type:"Polygon",coordinates:[[[-85.990061,41.759724],[-84.807042,41.759724],[-84.807042,41.694001],[-84.801565,40.500028],[-84.817996,39.103408],[-84.894673,39.059592],[-84.812519,38.785745],[-84.987781,38.780268],[-85.173997,38.68716],[-85.431413,38.730976],[-85.42046,38.533806],[-85.590245,38.451652],[-85.655968,38.325682],[-85.83123,38.27639],[-85.924338,38.024451],[-86.039354,37.958727],[-86.263908,38.051835],[-86.302247,38.166851],[-86.521325,38.040881],[-86.504894,37.931343],[-86.729448,37.893004],[-86.795172,37.991589],[-87.047111,37.893004],[-87.129265,37.788942],[-87.381204,37.93682],[-87.512651,37.903958],[-87.600282,37.975158],[-87.682436,37.903958],[-87.934375,37.893004],[-88.027483,37.799896],[-88.060345,37.865619],[-88.000098,38.101128],[-87.923421,38.15042],[-87.950806,38.27639],[-87.83579,38.292821],[-87.655051,38.506421],[-87.62219,38.637868],[-87.49622,38.780268],[-87.512651,38.95553],[-87.63862,39.169131],[-87.529082,39.34987],[-87.523605,41.710431],[-87.42502,41.644708],[-87.118311,41.644708],[-86.822556,41.759724],[-85.990061,41.759724]]]}},{type:"Feature",id:"IA",properties:{name:"Iowa",value:44},geometry:{type:"Polygon",coordinates:[[[-91.368417,43.501391],[-91.215062,43.501391],[-91.204109,43.353514],[-91.056231,43.254929],[-91.176724,43.134436],[-91.143862,42.909881],[-91.067185,42.75105],[-90.711184,42.636034],[-90.639984,42.510065],[-90.420906,42.329326],[-90.393521,42.225264],[-90.168967,42.126679],[-90.141582,42.000709],[-90.179921,41.809016],[-90.311367,41.743293],[-90.344229,41.589939],[-90.656414,41.463969],[-91.045277,41.414677],[-91.111001,41.239415],[-90.946692,41.097014],[-90.963123,40.921752],[-91.09457,40.823167],[-91.121954,40.669813],[-91.401278,40.560274],[-91.417709,40.379535],[-91.527248,40.412397],[-91.729895,40.615043],[-91.833957,40.609566],[-93.257961,40.582182],[-94.632673,40.571228],[-95.7664,40.587659],[-95.881416,40.719105],[-95.826646,40.976521],[-95.925231,41.201076],[-95.919754,41.453015],[-96.095016,41.540646],[-96.122401,41.67757],[-96.062155,41.798063],[-96.127878,41.973325],[-96.264801,42.039048],[-96.44554,42.488157],[-96.631756,42.707235],[-96.544125,42.855112],[-96.511264,43.052282],[-96.434587,43.123482],[-96.560556,43.222067],[-96.527695,43.397329],[-96.582464,43.479483],[-96.451017,43.501391],[-91.368417,43.501391]]]}},{type:"Feature",id:"KS",properties:{name:"Kansas",value:76},geometry:{type:"Polygon",coordinates:[[[-101.90605,40.001626],[-95.306337,40.001626],[-95.207752,39.908518],[-94.884612,39.831841],[-95.109167,39.541563],[-94.983197,39.442978],[-94.824366,39.20747],[-94.610765,39.158177],[-94.616242,37.000263],[-100.087706,37.000263],[-102.042974,36.994786],[-102.053927,40.001626],[-101.90605,40.001626]]]}},{type:"Feature",id:"KY",properties:{name:"Kentucky",value:29},geometry:{type:"Polygon",coordinates:[[[-83.903347,38.769315],[-83.678792,38.632391],[-83.519961,38.703591],[-83.142052,38.626914],[-83.032514,38.725499],[-82.890113,38.758361],[-82.846298,38.588575],[-82.731282,38.561191],[-82.594358,38.424267],[-82.621743,38.123036],[-82.50125,37.931343],[-82.342419,37.783465],[-82.293127,37.668449],[-82.101434,37.553434],[-81.969987,37.537003],[-82.353373,37.268633],[-82.720328,37.120755],[-82.720328,37.044078],[-82.868205,36.978355],[-82.879159,36.890724],[-83.070852,36.852385],[-83.136575,36.742847],[-83.673316,36.600446],[-83.689746,36.584015],[-84.544149,36.594969],[-85.289013,36.627831],[-85.486183,36.616877],[-86.592525,36.655216],[-87.852221,36.633308],[-88.071299,36.677123],[-88.054868,36.496384],[-89.298133,36.507338],[-89.418626,36.496384],[-89.363857,36.622354],[-89.215979,36.578538],[-89.133825,36.983832],[-89.183118,37.038601],[-89.029763,37.213863],[-88.914747,37.224817],[-88.547792,37.071463],[-88.421823,37.153617],[-88.514931,37.285064],[-88.476592,37.389126],[-88.065822,37.482234],[-88.15893,37.657496],[-88.027483,37.799896],[-87.934375,37.893004],[-87.682436,37.903958],[-87.600282,37.975158],[-87.512651,37.903958],[-87.381204,37.93682],[-87.129265,37.788942],[-87.047111,37.893004],[-86.795172,37.991589],[-86.729448,37.893004],[-86.504894,37.931343],[-86.521325,38.040881],[-86.302247,38.166851],[-86.263908,38.051835],[-86.039354,37.958727],[-85.924338,38.024451],[-85.83123,38.27639],[-85.655968,38.325682],[-85.590245,38.451652],[-85.42046,38.533806],[-85.431413,38.730976],[-85.173997,38.68716],[-84.987781,38.780268],[-84.812519,38.785745],[-84.894673,39.059592],[-84.817996,39.103408],[-84.43461,39.103408],[-84.231963,38.895284],[-84.215533,38.807653],[-83.903347,38.769315]]]}},{type:"Feature",id:"LA",properties:{name:"Louisiana",value:94},geometry:{type:"Polygon",coordinates:[[[-93.608485,33.018527],[-91.16577,33.002096],[-91.072662,32.887081],[-91.143862,32.843265],[-91.154816,32.640618],[-91.006939,32.514649],[-90.985031,32.218894],[-91.105524,31.988862],[-91.341032,31.846462],[-91.401278,31.621907],[-91.499863,31.643815],[-91.516294,31.27686],[-91.636787,31.265906],[-91.565587,31.068736],[-91.636787,30.997536],[-89.747242,30.997536],[-89.845827,30.66892],[-89.681519,30.449842],[-89.643181,30.285534],[-89.522688,30.181472],[-89.818443,30.044549],[-89.84035,29.945964],[-89.599365,29.88024],[-89.495303,30.039072],[-89.287179,29.88024],[-89.30361,29.754271],[-89.424103,29.699501],[-89.648657,29.748794],[-89.621273,29.655686],[-89.69795,29.513285],[-89.506257,29.387316],[-89.199548,29.348977],[-89.09001,29.2011],[-89.002379,29.179192],[-89.16121,29.009407],[-89.336472,29.042268],[-89.484349,29.217531],[-89.851304,29.310638],[-89.851304,29.480424],[-90.032043,29.425654],[-90.021089,29.283254],[-90.103244,29.151807],[-90.23469,29.129899],[-90.333275,29.277777],[-90.563307,29.283254],[-90.645461,29.129899],[-90.798815,29.086084],[-90.963123,29.179192],[-91.09457,29.190146],[-91.220539,29.436608],[-91.445094,29.546147],[-91.532725,29.529716],[-91.620356,29.73784],[-91.883249,29.710455],[-91.888726,29.836425],[-92.146142,29.715932],[-92.113281,29.622824],[-92.31045,29.535193],[-92.617159,29.579009],[-92.97316,29.715932],[-93.2251,29.776178],[-93.767317,29.726886],[-93.838517,29.688547],[-93.926148,29.787132],[-93.690639,30.143133],[-93.767317,30.334826],[-93.696116,30.438888],[-93.728978,30.575812],[-93.630393,30.679874],[-93.526331,30.93729],[-93.542762,31.15089],[-93.816609,31.556184],[-93.822086,31.775262],[-94.041164,31.994339],[-94.041164,33.018527],[-93.608485,33.018527]]]}},{type:"Feature",id:"ME",properties:{name:"Maine",value:44},geometry:{type:"Polygon",coordinates:[[[-70.703921,43.057759],[-70.824413,43.128959],[-70.807983,43.227544],[-70.966814,43.34256],[-71.032537,44.657025],[-71.08183,45.303304],[-70.649151,45.440228],[-70.720352,45.511428],[-70.556043,45.664782],[-70.386258,45.735983],[-70.41912,45.796229],[-70.260289,45.889337],[-70.309581,46.064599],[-70.210996,46.327492],[-70.057642,46.415123],[-69.997395,46.694447],[-69.225147,47.461219],[-69.044408,47.428357],[-69.033454,47.242141],[-68.902007,47.176418],[-68.578868,47.285957],[-68.376221,47.285957],[-68.233821,47.357157],[-67.954497,47.198326],[-67.790188,47.066879],[-67.779235,45.944106],[-67.801142,45.675736],[-67.456095,45.604536],[-67.505388,45.48952],[-67.417757,45.379982],[-67.488957,45.281397],[-67.346556,45.128042],[-67.16034,45.160904],[-66.979601,44.804903],[-67.187725,44.646072],[-67.308218,44.706318],[-67.406803,44.596779],[-67.549203,44.624164],[-67.565634,44.531056],[-67.75185,44.54201],[-68.047605,44.328409],[-68.118805,44.476286],[-68.222867,44.48724],[-68.173574,44.328409],[-68.403606,44.251732],[-68.458375,44.377701],[-68.567914,44.311978],[-68.82533,44.311978],[-68.830807,44.459856],[-68.984161,44.426994],[-68.956777,44.322932],[-69.099177,44.103854],[-69.071793,44.043608],[-69.258008,43.923115],[-69.444224,43.966931],[-69.553763,43.840961],[-69.707118,43.82453],[-69.833087,43.720469],[-69.986442,43.742376],[-70.030257,43.851915],[-70.254812,43.676653],[-70.194565,43.567114],[-70.358873,43.528776],[-70.369827,43.435668],[-70.556043,43.320652],[-70.703921,43.057759]]]}},{type:"Feature",id:"MD",properties:{name:"Maryland",value:66},geometry:{type:"MultiPolygon",coordinates:[[[[-75.994645,37.95325],[-76.016553,37.95325],[-76.043938,37.95325],[-75.994645,37.95325]]],[[[-79.477979,39.722302],[-75.786521,39.722302],[-75.693413,38.462606],[-75.047134,38.451652],[-75.244304,38.029928],[-75.397659,38.013497],[-75.671506,37.95325],[-75.885106,37.909435],[-75.879629,38.073743],[-75.961783,38.139466],[-75.846768,38.210667],[-76.000122,38.374975],[-76.049415,38.303775],[-76.257538,38.320205],[-76.328738,38.500944],[-76.263015,38.500944],[-76.257538,38.736453],[-76.191815,38.829561],[-76.279446,39.147223],[-76.169907,39.333439],[-76.000122,39.366301],[-75.972737,39.557994],[-76.098707,39.536086],[-76.104184,39.437501],[-76.367077,39.311532],[-76.443754,39.196516],[-76.460185,38.906238],[-76.55877,38.769315],[-76.514954,38.539283],[-76.383508,38.380452],[-76.399939,38.259959],[-76.317785,38.139466],[-76.3616,38.057312],[-76.591632,38.216144],[-76.920248,38.292821],[-77.018833,38.446175],[-77.205049,38.358544],[-77.276249,38.479037],[-77.128372,38.632391],[-77.040741,38.791222],[-76.909294,38.895284],[-77.035264,38.993869],[-77.117418,38.933623],[-77.248864,39.026731],[-77.456988,39.076023],[-77.456988,39.223901],[-77.566527,39.306055],[-77.719881,39.322485],[-77.834897,39.601809],[-78.004682,39.601809],[-78.174467,39.694917],[-78.267575,39.61824],[-78.431884,39.623717],[-78.470222,39.514178],[-78.765977,39.585379],[-78.963147,39.437501],[-79.094593,39.470363],[-79.291763,39.300578],[-79.488933,39.20747],[-79.477979,39.722302]]]]}},{type:"Feature",id:"MA",properties:{name:"Massachusetts",value:39},geometry:{type:"Polygon",coordinates:[[[-70.917521,42.887974],[-70.818936,42.871543],[-70.780598,42.696281],[-70.824413,42.55388],[-70.983245,42.422434],[-70.988722,42.269079],[-70.769644,42.247172],[-70.638197,42.08834],[-70.660105,41.962371],[-70.550566,41.929509],[-70.539613,41.814493],[-70.260289,41.715908],[-69.937149,41.809016],[-70.008349,41.672093],[-70.484843,41.5516],[-70.660105,41.546123],[-70.764167,41.639231],[-70.928475,41.611847],[-70.933952,41.540646],[-71.120168,41.496831],[-71.196845,41.67757],[-71.22423,41.710431],[-71.328292,41.781632],[-71.383061,42.01714],[-71.530939,42.01714],[-71.799309,42.006186],[-71.799309,42.022617],[-73.053528,42.039048],[-73.486206,42.050002],[-73.508114,42.08834],[-73.267129,42.745573],[-72.456542,42.729142],[-71.29543,42.696281],[-71.185891,42.789389],[-70.917521,42.887974]]]}},{type:"Feature",id:"MI",properties:{name:"Michigan",value:70},geometry:{type:"MultiPolygon",coordinates:[[[[-83.454238,41.732339],[-84.807042,41.694001],[-84.807042,41.759724],[-85.990061,41.759724],[-86.822556,41.759724],[-86.619909,41.891171],[-86.482986,42.115725],[-86.357016,42.252649],[-86.263908,42.444341],[-86.209139,42.718189],[-86.231047,43.013943],[-86.526801,43.594499],[-86.433693,43.813577],[-86.499417,44.07647],[-86.269385,44.34484],[-86.220093,44.569394],[-86.252954,44.689887],[-86.088646,44.73918],[-86.066738,44.903488],[-85.809322,44.947303],[-85.612152,45.128042],[-85.628583,44.766564],[-85.524521,44.750133],[-85.393075,44.930872],[-85.387598,45.237581],[-85.305444,45.314258],[-85.031597,45.363551],[-85.119228,45.577151],[-84.938489,45.75789],[-84.713934,45.768844],[-84.461995,45.653829],[-84.215533,45.637398],[-84.09504,45.494997],[-83.908824,45.484043],[-83.596638,45.352597],[-83.4871,45.358074],[-83.317314,45.144473],[-83.454238,45.029457],[-83.322791,44.88158],[-83.273499,44.711795],[-83.333745,44.339363],[-83.536392,44.246255],[-83.585684,44.054562],[-83.82667,43.988839],[-83.958116,43.758807],[-83.908824,43.671176],[-83.667839,43.589022],[-83.481623,43.714992],[-83.262545,43.972408],[-82.917498,44.070993],[-82.747713,43.994316],[-82.643651,43.851915],[-82.539589,43.435668],[-82.523158,43.227544],[-82.413619,42.975605],[-82.517681,42.614127],[-82.681989,42.559357],[-82.687466,42.690804],[-82.797005,42.652465],[-82.922975,42.351234],[-83.125621,42.236218],[-83.185868,42.006186],[-83.437807,41.814493],[-83.454238,41.732339]]],[[[-85.508091,45.730506],[-85.49166,45.610013],[-85.623106,45.588105],[-85.568337,45.75789],[-85.508091,45.730506]]],[[[-87.589328,45.095181],[-87.742682,45.199243],[-87.649574,45.341643],[-87.885083,45.363551],[-87.791975,45.500474],[-87.781021,45.675736],[-87.989145,45.796229],[-88.10416,45.922199],[-88.531362,46.020784],[-88.662808,45.987922],[-89.09001,46.135799],[-90.119674,46.338446],[-90.229213,46.508231],[-90.415429,46.568478],[-90.026566,46.672539],[-89.851304,46.793032],[-89.413149,46.842325],[-89.128348,46.990202],[-88.996902,46.995679],[-88.887363,47.099741],[-88.575177,47.247618],[-88.416346,47.373588],[-88.180837,47.455742],[-87.956283,47.384542],[-88.350623,47.077833],[-88.443731,46.973771],[-88.438254,46.787555],[-88.246561,46.929956],[-87.901513,46.908048],[-87.633143,46.809463],[-87.392158,46.535616],[-87.260711,46.486323],[-87.008772,46.530139],[-86.948526,46.469893],[-86.696587,46.437031],[-86.159846,46.667063],[-85.880522,46.68897],[-85.508091,46.678016],[-85.256151,46.754694],[-85.064458,46.760171],[-85.02612,46.480847],[-84.82895,46.442508],[-84.63178,46.486323],[-84.549626,46.4206],[-84.418179,46.502754],[-84.127902,46.530139],[-84.122425,46.179615],[-83.990978,46.031737],[-83.793808,45.993399],[-83.7719,46.091984],[-83.580208,46.091984],[-83.476146,45.987922],[-83.563777,45.911245],[-84.111471,45.976968],[-84.374364,45.933153],[-84.659165,46.053645],[-84.741319,45.944106],[-84.70298,45.850998],[-84.82895,45.872906],[-85.015166,46.00983],[-85.338305,46.091984],[-85.502614,46.097461],[-85.661445,45.966014],[-85.924338,45.933153],[-86.209139,45.960537],[-86.324155,45.905768],[-86.351539,45.796229],[-86.663725,45.703121],[-86.647294,45.834568],[-86.784218,45.861952],[-86.838987,45.725029],[-87.069019,45.719552],[-87.17308,45.659305],[-87.326435,45.423797],[-87.611236,45.122565],[-87.589328,45.095181]]],[[[-88.805209,47.976051],[-89.057148,47.850082],[-89.188594,47.833651],[-89.177641,47.937713],[-88.547792,48.173221],[-88.668285,48.008913],[-88.805209,47.976051]]]]}},{type:"Feature",id:"MN",properties:{name:"Minnesota",value:11},geometry:{type:"Polygon",coordinates:[[[-92.014696,46.705401],[-92.091373,46.749217],[-92.29402,46.667063],[-92.29402,46.075553],[-92.354266,46.015307],[-92.639067,45.933153],[-92.869098,45.719552],[-92.885529,45.577151],[-92.770513,45.566198],[-92.644544,45.440228],[-92.75956,45.286874],[-92.737652,45.117088],[-92.808852,44.750133],[-92.545959,44.569394],[-92.337835,44.552964],[-92.233773,44.443425],[-91.927065,44.333886],[-91.877772,44.202439],[-91.592971,44.032654],[-91.43414,43.994316],[-91.242447,43.775238],[-91.269832,43.616407],[-91.215062,43.501391],[-91.368417,43.501391],[-96.451017,43.501391],[-96.451017,45.297827],[-96.681049,45.412843],[-96.856311,45.604536],[-96.582464,45.818137],[-96.560556,45.933153],[-96.598895,46.332969],[-96.719387,46.437031],[-96.801542,46.656109],[-96.785111,46.924479],[-96.823449,46.968294],[-96.856311,47.609096],[-97.053481,47.948667],[-97.130158,48.140359],[-97.16302,48.545653],[-97.097296,48.682577],[-97.228743,49.000239],[-95.152983,49.000239],[-95.152983,49.383625],[-94.955813,49.372671],[-94.824366,49.295994],[-94.69292,48.775685],[-94.588858,48.715438],[-94.260241,48.699007],[-94.221903,48.649715],[-93.838517,48.627807],[-93.794701,48.518268],[-93.466085,48.545653],[-93.466085,48.589469],[-93.208669,48.644238],[-92.984114,48.62233],[-92.726698,48.540176],[-92.655498,48.436114],[-92.50762,48.447068],[-92.370697,48.222514],[-92.304974,48.315622],[-92.053034,48.359437],[-92.009219,48.266329],[-91.713464,48.200606],[-91.713464,48.112975],[-91.565587,48.041775],[-91.264355,48.080113],[-91.083616,48.178698],[-90.837154,48.238944],[-90.749522,48.091067],[-90.579737,48.123929],[-90.377091,48.091067],[-90.141582,48.112975],[-89.873212,47.987005],[-89.615796,48.008913],[-89.637704,47.954144],[-89.971797,47.828174],[-90.437337,47.729589],[-90.738569,47.625527],[-91.171247,47.368111],[-91.357463,47.20928],[-91.642264,47.028541],[-92.091373,46.787555],[-92.014696,46.705401]]]}},{type:"Feature",id:"MS",properties:{name:"Mississippi",value:66},geometry:{type:"Polygon",coordinates:[[[-88.471115,34.995703],[-88.202745,34.995703],[-88.098683,34.891641],[-88.241084,33.796253],[-88.471115,31.895754],[-88.394438,30.367688],[-88.503977,30.323872],[-88.744962,30.34578],[-88.843547,30.411504],[-89.084533,30.367688],[-89.418626,30.252672],[-89.522688,30.181472],[-89.643181,30.285534],[-89.681519,30.449842],[-89.845827,30.66892],[-89.747242,30.997536],[-91.636787,30.997536],[-91.565587,31.068736],[-91.636787,31.265906],[-91.516294,31.27686],[-91.499863,31.643815],[-91.401278,31.621907],[-91.341032,31.846462],[-91.105524,31.988862],[-90.985031,32.218894],[-91.006939,32.514649],[-91.154816,32.640618],[-91.143862,32.843265],[-91.072662,32.887081],[-91.16577,33.002096],[-91.089093,33.13902],[-91.143862,33.347144],[-91.056231,33.429298],[-91.231493,33.560744],[-91.072662,33.867453],[-90.891923,34.026284],[-90.952169,34.135823],[-90.744046,34.300131],[-90.749522,34.365854],[-90.568783,34.420624],[-90.585214,34.617794],[-90.481152,34.661609],[-90.409952,34.831394],[-90.251121,34.908072],[-90.311367,34.995703],[-88.471115,34.995703]]]}},{type:"Feature",id:"MO",properties:{name:"Missouri",value:36},geometry:{type:"Polygon",coordinates:[[[-91.833957,40.609566],[-91.729895,40.615043],[-91.527248,40.412397],[-91.417709,40.379535],[-91.50534,40.237135],[-91.494386,40.034488],[-91.368417,39.727779],[-91.061708,39.470363],[-90.727615,39.256762],[-90.661891,38.928146],[-90.585214,38.867899],[-90.470199,38.961007],[-90.251121,38.917192],[-90.10872,38.845992],[-90.207305,38.725499],[-90.179921,38.632391],[-90.349706,38.374975],[-90.355183,38.216144],[-90.059428,38.013497],[-89.949889,37.88205],[-89.84035,37.903958],[-89.517211,37.690357],[-89.517211,37.537003],[-89.435057,37.34531],[-89.517211,37.279587],[-89.292656,36.994786],[-89.133825,36.983832],[-89.215979,36.578538],[-89.363857,36.622354],[-89.418626,36.496384],[-89.484349,36.496384],[-89.539119,36.496384],[-89.533642,36.249922],[-89.730812,35.997983],[-90.377091,35.997983],[-90.218259,36.184199],[-90.064905,36.304691],[-90.152536,36.496384],[-94.473842,36.501861],[-94.616242,36.501861],[-94.616242,37.000263],[-94.610765,39.158177],[-94.824366,39.20747],[-94.983197,39.442978],[-95.109167,39.541563],[-94.884612,39.831841],[-95.207752,39.908518],[-95.306337,40.001626],[-95.552799,40.264519],[-95.7664,40.587659],[-94.632673,40.571228],[-93.257961,40.582182],[-91.833957,40.609566]]]}},{type:"Feature",id:"MT",properties:{name:"Montana",value:99},geometry:{type:"Polygon",coordinates:[[[-104.047534,49.000239],[-104.042057,47.861036],[-104.047534,45.944106],[-104.042057,44.996596],[-104.058488,44.996596],[-105.91517,45.002073],[-109.080842,45.002073],[-111.05254,45.002073],[-111.047063,44.476286],[-111.227803,44.580348],[-111.386634,44.75561],[-111.616665,44.547487],[-111.819312,44.509148],[-111.868605,44.563917],[-112.104113,44.520102],[-112.241036,44.569394],[-112.471068,44.481763],[-112.783254,44.48724],[-112.887315,44.394132],[-113.002331,44.448902],[-113.133778,44.772041],[-113.341901,44.782995],[-113.456917,44.865149],[-113.45144,45.056842],[-113.571933,45.128042],[-113.736241,45.330689],[-113.834826,45.522382],[-113.807441,45.604536],[-113.98818,45.703121],[-114.086765,45.593582],[-114.333228,45.456659],[-114.546828,45.560721],[-114.497536,45.670259],[-114.568736,45.774321],[-114.387997,45.88386],[-114.492059,46.037214],[-114.464674,46.272723],[-114.322274,46.645155],[-114.612552,46.639678],[-114.623506,46.705401],[-114.886399,46.809463],[-114.930214,46.919002],[-115.302646,47.187372],[-115.324554,47.258572],[-115.527201,47.302388],[-115.718894,47.42288],[-115.724371,47.696727],[-116.04751,47.976051],[-116.04751,49.000239],[-111.50165,48.994762],[-109.453274,49.000239],[-104.047534,49.000239]]]}},{type:"Feature",id:"NE",properties:{name:"Nebraska",value:55},geometry:{type:"Polygon",coordinates:[[[-103.324578,43.002989],[-101.626726,42.997512],[-98.499393,42.997512],[-98.466531,42.94822],[-97.951699,42.767481],[-97.831206,42.866066],[-97.688806,42.844158],[-97.217789,42.844158],[-96.692003,42.657942],[-96.626279,42.515542],[-96.44554,42.488157],[-96.264801,42.039048],[-96.127878,41.973325],[-96.062155,41.798063],[-96.122401,41.67757],[-96.095016,41.540646],[-95.919754,41.453015],[-95.925231,41.201076],[-95.826646,40.976521],[-95.881416,40.719105],[-95.7664,40.587659],[-95.552799,40.264519],[-95.306337,40.001626],[-101.90605,40.001626],[-102.053927,40.001626],[-102.053927,41.003906],[-104.053011,41.003906],[-104.053011,43.002989],[-103.324578,43.002989]]]}},{type:"Feature",id:"NV",properties:{name:"Nevada",value:65},geometry:{type:"Polygon",coordinates:[[[-117.027882,42.000709],[-114.04295,41.995232],[-114.048427,37.000263],[-114.048427,36.195153],[-114.152489,36.025367],[-114.251074,36.01989],[-114.371566,36.140383],[-114.738521,36.102045],[-114.678275,35.516012],[-114.596121,35.324319],[-114.574213,35.138103],[-114.634459,35.00118],[-115.85034,35.970598],[-116.540435,36.501861],[-117.498899,37.21934],[-118.71478,38.101128],[-120.001861,38.999346],[-119.996384,40.264519],[-120.001861,41.995232],[-118.698349,41.989755],[-117.027882,42.000709]]]}},{type:"Feature",id:"NH",properties:{name:"New Hampshire",value:32},geometry:{type:"Polygon",coordinates:[[[-71.08183,45.303304],[-71.032537,44.657025],[-70.966814,43.34256],[-70.807983,43.227544],[-70.824413,43.128959],[-70.703921,43.057759],[-70.818936,42.871543],[-70.917521,42.887974],[-71.185891,42.789389],[-71.29543,42.696281],[-72.456542,42.729142],[-72.544173,42.80582],[-72.533219,42.953697],[-72.445588,43.008466],[-72.456542,43.150867],[-72.379864,43.572591],[-72.204602,43.769761],[-72.116971,43.994316],[-72.02934,44.07647],[-72.034817,44.322932],[-71.700724,44.41604],[-71.536416,44.585825],[-71.629524,44.750133],[-71.4926,44.914442],[-71.503554,45.013027],[-71.361154,45.270443],[-71.131122,45.243058],[-71.08183,45.303304]]]}},{type:"Feature",id:"NJ",properties:{name:"New Jersey",value:50},geometry:{type:"Polygon",coordinates:[[[-74.236547,41.14083],[-73.902454,40.998429],[-74.022947,40.708151],[-74.187255,40.642428],[-74.274886,40.489074],[-74.001039,40.412397],[-73.979131,40.297381],[-74.099624,39.760641],[-74.411809,39.360824],[-74.614456,39.245808],[-74.795195,38.993869],[-74.888303,39.158177],[-75.178581,39.240331],[-75.534582,39.459409],[-75.55649,39.607286],[-75.561967,39.629194],[-75.507197,39.683964],[-75.414089,39.804456],[-75.145719,39.88661],[-75.129289,39.963288],[-74.82258,40.127596],[-74.773287,40.215227],[-75.058088,40.417874],[-75.069042,40.543843],[-75.195012,40.576705],[-75.205966,40.691721],[-75.052611,40.866983],[-75.134765,40.971045],[-74.882826,41.179168],[-74.828057,41.288707],[-74.69661,41.359907],[-74.236547,41.14083]]]}},{type:"Feature",id:"NM",properties:{name:"New Mexico",value:79},geometry:{type:"Polygon",coordinates:[[[-107.421329,37.000263],[-106.868158,36.994786],[-104.337812,36.994786],[-103.001438,37.000263],[-103.001438,36.501861],[-103.039777,36.501861],[-103.045254,34.01533],[-103.067161,33.002096],[-103.067161,31.999816],[-106.616219,31.999816],[-106.643603,31.901231],[-106.528588,31.786216],[-108.210008,31.786216],[-108.210008,31.331629],[-109.04798,31.331629],[-109.042503,37.000263],[-107.421329,37.000263]]]}},{type:"Feature",id:"NY",properties:{name:"New York",value:55},geometry:{type:"Polygon",coordinates:[[[-73.343806,45.013027],[-73.332852,44.804903],[-73.387622,44.618687],[-73.294514,44.437948],[-73.321898,44.246255],[-73.436914,44.043608],[-73.349283,43.769761],[-73.404052,43.687607],[-73.245221,43.523299],[-73.278083,42.833204],[-73.267129,42.745573],[-73.508114,42.08834],[-73.486206,42.050002],[-73.55193,41.294184],[-73.48073,41.21203],[-73.727192,41.102491],[-73.655992,40.987475],[-73.22879,40.905321],[-73.141159,40.965568],[-72.774204,40.965568],[-72.587988,40.998429],[-72.28128,41.157261],[-72.259372,41.042245],[-72.100541,40.992952],[-72.467496,40.845075],[-73.239744,40.625997],[-73.562884,40.582182],[-73.776484,40.593136],[-73.935316,40.543843],[-74.022947,40.708151],[-73.902454,40.998429],[-74.236547,41.14083],[-74.69661,41.359907],[-74.740426,41.431108],[-74.89378,41.436584],[-75.074519,41.60637],[-75.052611,41.754247],[-75.173104,41.869263],[-75.249781,41.863786],[-75.35932,42.000709],[-79.76278,42.000709],[-79.76278,42.252649],[-79.76278,42.269079],[-79.149363,42.55388],[-79.050778,42.690804],[-78.853608,42.783912],[-78.930285,42.953697],[-79.012439,42.986559],[-79.072686,43.260406],[-78.486653,43.375421],[-77.966344,43.369944],[-77.75822,43.34256],[-77.533665,43.233021],[-77.391265,43.276836],[-76.958587,43.271359],[-76.695693,43.34256],[-76.41637,43.523299],[-76.235631,43.528776],[-76.230154,43.802623],[-76.137046,43.961454],[-76.3616,44.070993],[-76.312308,44.196962],[-75.912491,44.366748],[-75.764614,44.514625],[-75.282643,44.848718],[-74.828057,45.018503],[-74.148916,44.991119],[-73.343806,45.013027]]]}},{type:"Feature",id:"NC",properties:{name:"North Carolina",value:78},geometry:{type:"Polygon",coordinates:[[[-80.978661,36.562108],[-80.294043,36.545677],[-79.510841,36.5402],[-75.868676,36.551154],[-75.75366,36.151337],[-76.032984,36.189676],[-76.071322,36.140383],[-76.410893,36.080137],[-76.460185,36.025367],[-76.68474,36.008937],[-76.673786,35.937736],[-76.399939,35.987029],[-76.3616,35.943213],[-76.060368,35.992506],[-75.961783,35.899398],[-75.781044,35.937736],[-75.715321,35.696751],[-75.775568,35.581735],[-75.89606,35.570781],[-76.147999,35.324319],[-76.482093,35.313365],[-76.536862,35.14358],[-76.394462,34.973795],[-76.279446,34.940933],[-76.493047,34.661609],[-76.673786,34.694471],[-76.991448,34.667086],[-77.210526,34.60684],[-77.555573,34.415147],[-77.82942,34.163208],[-77.971821,33.845545],[-78.179944,33.916745],[-78.541422,33.851022],[-79.675149,34.80401],[-80.797922,34.820441],[-80.781491,34.935456],[-80.934845,35.105241],[-81.038907,35.044995],[-81.044384,35.149057],[-82.276696,35.198349],[-82.550543,35.160011],[-82.764143,35.066903],[-83.109191,35.00118],[-83.618546,34.984749],[-84.319594,34.990226],[-84.29221,35.225734],[-84.09504,35.247642],[-84.018363,35.41195],[-83.7719,35.559827],[-83.498053,35.565304],[-83.251591,35.718659],[-82.994175,35.773428],[-82.775097,35.997983],[-82.638174,36.063706],[-82.610789,35.965121],[-82.216449,36.156814],[-82.03571,36.118475],[-81.909741,36.304691],[-81.723525,36.353984],[-81.679709,36.589492],[-80.978661,36.562108]]]}},{type:"Feature",id:"ND",properties:{name:"North Dakota",value:98},geometry:{type:"Polygon",coordinates:[[[-97.228743,49.000239],[-97.097296,48.682577],[-97.16302,48.545653],[-97.130158,48.140359],[-97.053481,47.948667],[-96.856311,47.609096],[-96.823449,46.968294],[-96.785111,46.924479],[-96.801542,46.656109],[-96.719387,46.437031],[-96.598895,46.332969],[-96.560556,45.933153],[-104.047534,45.944106],[-104.042057,47.861036],[-104.047534,49.000239],[-97.228743,49.000239]]]}},{type:"Feature",id:"OH",properties:{name:"Ohio",value:22},geometry:{type:"Polygon",coordinates:[[[-80.518598,41.978802],[-80.518598,40.636951],[-80.666475,40.582182],[-80.595275,40.472643],[-80.600752,40.319289],[-80.737675,40.078303],[-80.830783,39.711348],[-81.219646,39.388209],[-81.345616,39.344393],[-81.455155,39.410117],[-81.57017,39.267716],[-81.685186,39.273193],[-81.811156,39.0815],[-81.783771,38.966484],[-81.887833,38.873376],[-82.03571,39.026731],[-82.221926,38.785745],[-82.172634,38.632391],[-82.293127,38.577622],[-82.331465,38.446175],[-82.594358,38.424267],[-82.731282,38.561191],[-82.846298,38.588575],[-82.890113,38.758361],[-83.032514,38.725499],[-83.142052,38.626914],[-83.519961,38.703591],[-83.678792,38.632391],[-83.903347,38.769315],[-84.215533,38.807653],[-84.231963,38.895284],[-84.43461,39.103408],[-84.817996,39.103408],[-84.801565,40.500028],[-84.807042,41.694001],[-83.454238,41.732339],[-83.065375,41.595416],[-82.933929,41.513262],[-82.835344,41.589939],[-82.616266,41.431108],[-82.479343,41.381815],[-82.013803,41.513262],[-81.739956,41.485877],[-81.444201,41.672093],[-81.011523,41.852832],[-80.518598,41.978802],[-80.518598,41.978802]]]}},{type:"Feature",id:"OK",properties:{name:"Oklahoma",value:1},geometry:{type:"Polygon",coordinates:[[[-100.087706,37.000263],[-94.616242,37.000263],[-94.616242,36.501861],[-94.430026,35.395519],[-94.484796,33.637421],[-94.868182,33.74696],[-94.966767,33.861976],[-95.224183,33.960561],[-95.289906,33.87293],[-95.547322,33.878407],[-95.602092,33.933176],[-95.8376,33.834591],[-95.936185,33.889361],[-96.149786,33.840068],[-96.346956,33.686714],[-96.423633,33.774345],[-96.631756,33.845545],[-96.850834,33.845545],[-96.922034,33.960561],[-97.173974,33.736006],[-97.256128,33.861976],[-97.371143,33.823637],[-97.458774,33.905791],[-97.694283,33.982469],[-97.869545,33.851022],[-97.946222,33.987946],[-98.088623,34.004376],[-98.170777,34.113915],[-98.36247,34.157731],[-98.488439,34.064623],[-98.570593,34.146777],[-98.767763,34.135823],[-98.986841,34.223454],[-99.189488,34.2125],[-99.260688,34.404193],[-99.57835,34.415147],[-99.698843,34.382285],[-99.923398,34.573978],[-100.000075,34.563024],[-100.000075,36.501861],[-101.812942,36.501861],[-103.001438,36.501861],[-103.001438,37.000263],[-102.042974,36.994786],[-100.087706,37.000263]]]}},{type:"Feature",id:"OR",properties:{name:"Oregon",value:87},geometry:{type:"Polygon",coordinates:[[[-123.211348,46.174138],[-123.11824,46.185092],[-122.904639,46.08103],[-122.811531,45.960537],[-122.762239,45.659305],[-122.247407,45.549767],[-121.809251,45.708598],[-121.535404,45.725029],[-121.217742,45.670259],[-121.18488,45.604536],[-120.637186,45.746937],[-120.505739,45.697644],[-120.209985,45.725029],[-119.963522,45.823614],[-119.525367,45.911245],[-119.125551,45.933153],[-118.988627,45.998876],[-116.918344,45.993399],[-116.78142,45.823614],[-116.545912,45.752413],[-116.463758,45.61549],[-116.671881,45.319735],[-116.732128,45.144473],[-116.847143,45.02398],[-116.830713,44.930872],[-116.934774,44.782995],[-117.038836,44.750133],[-117.241483,44.394132],[-117.170283,44.257209],[-116.97859,44.240778],[-116.896436,44.158624],[-117.027882,43.830007],[-117.027882,42.000709],[-118.698349,41.989755],[-120.001861,41.995232],[-121.037003,41.995232],[-122.378853,42.011663],[-123.233256,42.006186],[-124.213628,42.000709],[-124.356029,42.115725],[-124.432706,42.438865],[-124.416275,42.663419],[-124.553198,42.838681],[-124.454613,43.002989],[-124.383413,43.271359],[-124.235536,43.55616],[-124.169813,43.8081],[-124.060274,44.657025],[-124.076705,44.772041],[-123.97812,45.144473],[-123.939781,45.659305],[-123.994551,45.944106],[-123.945258,46.113892],[-123.545441,46.261769],[-123.370179,46.146753],[-123.211348,46.174138]]]}},{type:"Feature",id:"PA",properties:{name:"Pennsylvania",value:37},geometry:{type:"Polygon",coordinates:[[[-79.76278,42.252649],[-79.76278,42.000709],[-75.35932,42.000709],[-75.249781,41.863786],[-75.173104,41.869263],[-75.052611,41.754247],[-75.074519,41.60637],[-74.89378,41.436584],[-74.740426,41.431108],[-74.69661,41.359907],[-74.828057,41.288707],[-74.882826,41.179168],[-75.134765,40.971045],[-75.052611,40.866983],[-75.205966,40.691721],[-75.195012,40.576705],[-75.069042,40.543843],[-75.058088,40.417874],[-74.773287,40.215227],[-74.82258,40.127596],[-75.129289,39.963288],[-75.145719,39.88661],[-75.414089,39.804456],[-75.616736,39.831841],[-75.786521,39.722302],[-79.477979,39.722302],[-80.518598,39.722302],[-80.518598,40.636951],[-80.518598,41.978802],[-80.518598,41.978802],[-80.332382,42.033571],[-79.76278,42.269079],[-79.76278,42.252649]]]}},{type:"Feature",id:"RI",properties:{name:"Rhode Island",value:78},geometry:{type:"MultiPolygon",coordinates:[[[[-71.196845,41.67757],[-71.120168,41.496831],[-71.317338,41.474923],[-71.196845,41.67757]]],[[[-71.530939,42.01714],[-71.383061,42.01714],[-71.328292,41.781632],[-71.22423,41.710431],[-71.344723,41.726862],[-71.448785,41.578985],[-71.481646,41.370861],[-71.859555,41.321569],[-71.799309,41.414677],[-71.799309,42.006186],[-71.530939,42.01714]]]]}},{type:"Feature",id:"SC",properties:{name:"South Carolina",value:54},geometry:{type:"Polygon",coordinates:[[[-82.764143,35.066903],[-82.550543,35.160011],[-82.276696,35.198349],[-81.044384,35.149057],[-81.038907,35.044995],[-80.934845,35.105241],[-80.781491,34.935456],[-80.797922,34.820441],[-79.675149,34.80401],[-78.541422,33.851022],[-78.716684,33.80173],[-78.935762,33.637421],[-79.149363,33.380005],[-79.187701,33.171881],[-79.357487,33.007573],[-79.582041,33.007573],[-79.631334,32.887081],[-79.866842,32.755634],[-79.998289,32.613234],[-80.206412,32.552987],[-80.430967,32.399633],[-80.452875,32.328433],[-80.660998,32.246279],[-80.885553,32.032678],[-81.115584,32.120309],[-81.121061,32.290094],[-81.279893,32.558464],[-81.416816,32.629664],[-81.42777,32.843265],[-81.493493,33.007573],[-81.761863,33.160928],[-81.937125,33.347144],[-81.926172,33.462159],[-82.194542,33.631944],[-82.325988,33.81816],[-82.55602,33.94413],[-82.714851,34.152254],[-82.747713,34.26727],[-82.901067,34.486347],[-83.005129,34.469916],[-83.339222,34.683517],[-83.322791,34.787579],[-83.109191,35.00118],[-82.764143,35.066903]]]}},{type:"Feature",id:"SD",properties:{name:"South Dakota",value:0},geometry:{type:"Polygon",coordinates:[[[-104.047534,45.944106],[-96.560556,45.933153],[-96.582464,45.818137],[-96.856311,45.604536],[-96.681049,45.412843],[-96.451017,45.297827],[-96.451017,43.501391],[-96.582464,43.479483],[-96.527695,43.397329],[-96.560556,43.222067],[-96.434587,43.123482],[-96.511264,43.052282],[-96.544125,42.855112],[-96.631756,42.707235],[-96.44554,42.488157],[-96.626279,42.515542],[-96.692003,42.657942],[-97.217789,42.844158],[-97.688806,42.844158],[-97.831206,42.866066],[-97.951699,42.767481],[-98.466531,42.94822],[-98.499393,42.997512],[-101.626726,42.997512],[-103.324578,43.002989],[-104.053011,43.002989],[-104.058488,44.996596],[-104.042057,44.996596],[-104.047534,45.944106]]]}},{type:"Feature",id:"TN",properties:{name:"Tennessee",value:66},geometry:{type:"Polygon",coordinates:[[[-88.054868,36.496384],[-88.071299,36.677123],[-87.852221,36.633308],[-86.592525,36.655216],[-85.486183,36.616877],[-85.289013,36.627831],[-84.544149,36.594969],[-83.689746,36.584015],[-83.673316,36.600446],[-81.679709,36.589492],[-81.723525,36.353984],[-81.909741,36.304691],[-82.03571,36.118475],[-82.216449,36.156814],[-82.610789,35.965121],[-82.638174,36.063706],[-82.775097,35.997983],[-82.994175,35.773428],[-83.251591,35.718659],[-83.498053,35.565304],[-83.7719,35.559827],[-84.018363,35.41195],[-84.09504,35.247642],[-84.29221,35.225734],[-84.319594,34.990226],[-85.606675,34.984749],[-87.359296,35.00118],[-88.202745,34.995703],[-88.471115,34.995703],[-90.311367,34.995703],[-90.212782,35.023087],[-90.114197,35.198349],[-90.130628,35.439335],[-89.944412,35.603643],[-89.911551,35.756997],[-89.763673,35.811767],[-89.730812,35.997983],[-89.533642,36.249922],[-89.539119,36.496384],[-89.484349,36.496384],[-89.418626,36.496384],[-89.298133,36.507338],[-88.054868,36.496384]]]}},{type:"Feature",id:"TX",properties:{name:"Texas",value:29},geometry:{type:"Polygon",coordinates:[[[-101.812942,36.501861],[-100.000075,36.501861],[-100.000075,34.563024],[-99.923398,34.573978],[-99.698843,34.382285],[-99.57835,34.415147],[-99.260688,34.404193],[-99.189488,34.2125],[-98.986841,34.223454],[-98.767763,34.135823],[-98.570593,34.146777],[-98.488439,34.064623],[-98.36247,34.157731],[-98.170777,34.113915],[-98.088623,34.004376],[-97.946222,33.987946],[-97.869545,33.851022],[-97.694283,33.982469],[-97.458774,33.905791],[-97.371143,33.823637],[-97.256128,33.861976],[-97.173974,33.736006],[-96.922034,33.960561],[-96.850834,33.845545],[-96.631756,33.845545],[-96.423633,33.774345],[-96.346956,33.686714],[-96.149786,33.840068],[-95.936185,33.889361],[-95.8376,33.834591],[-95.602092,33.933176],[-95.547322,33.878407],[-95.289906,33.87293],[-95.224183,33.960561],[-94.966767,33.861976],[-94.868182,33.74696],[-94.484796,33.637421],[-94.380734,33.544313],[-94.183564,33.593606],[-94.041164,33.54979],[-94.041164,33.018527],[-94.041164,31.994339],[-93.822086,31.775262],[-93.816609,31.556184],[-93.542762,31.15089],[-93.526331,30.93729],[-93.630393,30.679874],[-93.728978,30.575812],[-93.696116,30.438888],[-93.767317,30.334826],[-93.690639,30.143133],[-93.926148,29.787132],[-93.838517,29.688547],[-94.002825,29.68307],[-94.523134,29.546147],[-94.70935,29.622824],[-94.742212,29.787132],[-94.873659,29.672117],[-94.966767,29.699501],[-95.016059,29.557101],[-94.911997,29.496854],[-94.895566,29.310638],[-95.081782,29.113469],[-95.383014,28.867006],[-95.985477,28.604113],[-96.045724,28.647929],[-96.226463,28.582205],[-96.23194,28.642452],[-96.478402,28.598636],[-96.593418,28.724606],[-96.664618,28.697221],[-96.401725,28.439805],[-96.593418,28.357651],[-96.774157,28.406943],[-96.801542,28.226204],[-97.026096,28.039988],[-97.256128,27.694941],[-97.404005,27.333463],[-97.513544,27.360848],[-97.540929,27.229401],[-97.425913,27.262263],[-97.480682,26.99937],[-97.557359,26.988416],[-97.562836,26.840538],[-97.469728,26.758384],[-97.442344,26.457153],[-97.332805,26.353091],[-97.30542,26.161398],[-97.217789,25.991613],[-97.524498,25.887551],[-97.650467,26.018997],[-97.885976,26.06829],[-98.198161,26.057336],[-98.466531,26.221644],[-98.669178,26.238075],[-98.822533,26.369522],[-99.030656,26.413337],[-99.173057,26.539307],[-99.266165,26.840538],[-99.446904,27.021277],[-99.424996,27.174632],[-99.50715,27.33894],[-99.479765,27.48134],[-99.605735,27.640172],[-99.709797,27.656603],[-99.879582,27.799003],[-99.934351,27.979742],[-100.082229,28.14405],[-100.29583,28.280974],[-100.399891,28.582205],[-100.498476,28.66436],[-100.629923,28.905345],[-100.673738,29.102515],[-100.799708,29.244915],[-101.013309,29.370885],[-101.062601,29.458516],[-101.259771,29.535193],[-101.413125,29.754271],[-101.851281,29.803563],[-102.114174,29.792609],[-102.338728,29.869286],[-102.388021,29.765225],[-102.629006,29.732363],[-102.809745,29.524239],[-102.919284,29.190146],[-102.97953,29.184669],[-103.116454,28.987499],[-103.280762,28.982022],[-103.527224,29.135376],[-104.146119,29.381839],[-104.266611,29.513285],[-104.507597,29.639255],[-104.677382,29.924056],[-104.688336,30.181472],[-104.858121,30.389596],[-104.896459,30.570335],[-105.005998,30.685351],[-105.394861,30.855136],[-105.602985,31.085167],[-105.77277,31.167321],[-105.953509,31.364491],[-106.205448,31.468553],[-106.38071,31.731446],[-106.528588,31.786216],[-106.643603,31.901231],[-106.616219,31.999816],[-103.067161,31.999816],[-103.067161,33.002096],[-103.045254,34.01533],[-103.039777,36.501861],[-103.001438,36.501861],[-101.812942,36.501861]]]}},{type:"Feature",id:"UT",properties:{name:"Utah",value:87},geometry:{type:"Polygon",coordinates:[[[-112.164359,41.995232],[-111.047063,42.000709],[-111.047063,40.998429],[-109.04798,40.998429],[-109.053457,39.125316],[-109.058934,38.27639],[-109.042503,38.166851],[-109.042503,37.000263],[-110.499369,37.00574],[-114.048427,37.000263],[-114.04295,41.995232],[-112.164359,41.995232]]]}},{type:"Feature",id:"VT",properties:{name:"Vermont",value:55},geometry:{type:"Polygon",coordinates:[[[-71.503554,45.013027],[-71.4926,44.914442],[-71.629524,44.750133],[-71.536416,44.585825],[-71.700724,44.41604],[-72.034817,44.322932],[-72.02934,44.07647],[-72.116971,43.994316],[-72.204602,43.769761],[-72.379864,43.572591],[-72.456542,43.150867],[-72.445588,43.008466],[-72.533219,42.953697],[-72.544173,42.80582],[-72.456542,42.729142],[-73.267129,42.745573],[-73.278083,42.833204],[-73.245221,43.523299],[-73.404052,43.687607],[-73.349283,43.769761],[-73.436914,44.043608],[-73.321898,44.246255],[-73.294514,44.437948],[-73.387622,44.618687],[-73.332852,44.804903],[-73.343806,45.013027],[-72.308664,45.002073],[-71.503554,45.013027]]]}},{type:"Feature",id:"VA",properties:{name:"Virginia",value:55},geometry:{type:"MultiPolygon",coordinates:[[[[-75.397659,38.013497],[-75.244304,38.029928],[-75.375751,37.860142],[-75.512674,37.799896],[-75.594828,37.569865],[-75.802952,37.197433],[-75.972737,37.120755],[-76.027507,37.257679],[-75.939876,37.564388],[-75.671506,37.95325],[-75.397659,38.013497]]],[[[-78.349729,39.464886],[-77.82942,39.130793],[-77.719881,39.322485],[-77.566527,39.306055],[-77.456988,39.223901],[-77.456988,39.076023],[-77.248864,39.026731],[-77.117418,38.933623],[-77.040741,38.791222],[-77.128372,38.632391],[-77.248864,38.588575],[-77.325542,38.446175],[-77.281726,38.342113],[-77.013356,38.374975],[-76.964064,38.216144],[-76.613539,38.15042],[-76.514954,38.024451],[-76.235631,37.887527],[-76.3616,37.608203],[-76.246584,37.389126],[-76.383508,37.285064],[-76.399939,37.159094],[-76.273969,37.082417],[-76.410893,36.961924],[-76.619016,37.120755],[-76.668309,37.065986],[-76.48757,36.95097],[-75.994645,36.923586],[-75.868676,36.551154],[-79.510841,36.5402],[-80.294043,36.545677],[-80.978661,36.562108],[-81.679709,36.589492],[-83.673316,36.600446],[-83.136575,36.742847],[-83.070852,36.852385],[-82.879159,36.890724],[-82.868205,36.978355],[-82.720328,37.044078],[-82.720328,37.120755],[-82.353373,37.268633],[-81.969987,37.537003],[-81.986418,37.454849],[-81.849494,37.285064],[-81.679709,37.20291],[-81.55374,37.208387],[-81.362047,37.339833],[-81.225123,37.235771],[-80.967707,37.290541],[-80.513121,37.482234],[-80.474782,37.421987],[-80.29952,37.509618],[-80.294043,37.690357],[-80.184505,37.849189],[-79.998289,37.997066],[-79.921611,38.177805],[-79.724442,38.364021],[-79.647764,38.594052],[-79.477979,38.457129],[-79.313671,38.413313],[-79.209609,38.495467],[-78.996008,38.851469],[-78.870039,38.763838],[-78.404499,39.169131],[-78.349729,39.464886]]]]}},{type:"Feature",id:"WA",properties:{name:"Washington",value:77},geometry:{type:"MultiPolygon",coordinates:[[[[-117.033359,49.000239],[-117.044313,47.762451],[-117.038836,46.426077],[-117.055267,46.343923],[-116.92382,46.168661],[-116.918344,45.993399],[-118.988627,45.998876],[-119.125551,45.933153],[-119.525367,45.911245],[-119.963522,45.823614],[-120.209985,45.725029],[-120.505739,45.697644],[-120.637186,45.746937],[-121.18488,45.604536],[-121.217742,45.670259],[-121.535404,45.725029],[-121.809251,45.708598],[-122.247407,45.549767],[-122.762239,45.659305],[-122.811531,45.960537],[-122.904639,46.08103],[-123.11824,46.185092],[-123.211348,46.174138],[-123.370179,46.146753],[-123.545441,46.261769],[-123.72618,46.300108],[-123.874058,46.239861],[-124.065751,46.327492],[-124.027412,46.464416],[-123.895966,46.535616],[-124.098612,46.74374],[-124.235536,47.285957],[-124.31769,47.357157],[-124.427229,47.740543],[-124.624399,47.88842],[-124.706553,48.184175],[-124.597014,48.381345],[-124.394367,48.288237],[-123.983597,48.162267],[-123.704273,48.167744],[-123.424949,48.118452],[-123.162056,48.167744],[-123.036086,48.080113],[-122.800578,48.08559],[-122.636269,47.866512],[-122.515777,47.882943],[-122.493869,47.587189],[-122.422669,47.318818],[-122.324084,47.346203],[-122.422669,47.576235],[-122.395284,47.800789],[-122.230976,48.030821],[-122.362422,48.123929],[-122.373376,48.288237],[-122.471961,48.468976],[-122.422669,48.600422],[-122.488392,48.753777],[-122.647223,48.775685],[-122.795101,48.8907],[-122.756762,49.000239],[-117.033359,49.000239]]],[[[-122.718423,48.310145],[-122.586977,48.35396],[-122.608885,48.151313],[-122.767716,48.227991],[-122.718423,48.310145]]],[[[-123.025132,48.583992],[-122.915593,48.715438],[-122.767716,48.556607],[-122.811531,48.419683],[-123.041563,48.458022],[-123.025132,48.583992]]]]}},{type:"Feature",id:"WV",properties:{name:"West Virginia",value:57},geometry:{type:"Polygon",coordinates:[[[-80.518598,40.636951],[-80.518598,39.722302],[-79.477979,39.722302],[-79.488933,39.20747],[-79.291763,39.300578],[-79.094593,39.470363],[-78.963147,39.437501],[-78.765977,39.585379],[-78.470222,39.514178],[-78.431884,39.623717],[-78.267575,39.61824],[-78.174467,39.694917],[-78.004682,39.601809],[-77.834897,39.601809],[-77.719881,39.322485],[-77.82942,39.130793],[-78.349729,39.464886],[-78.404499,39.169131],[-78.870039,38.763838],[-78.996008,38.851469],[-79.209609,38.495467],[-79.313671,38.413313],[-79.477979,38.457129],[-79.647764,38.594052],[-79.724442,38.364021],[-79.921611,38.177805],[-79.998289,37.997066],[-80.184505,37.849189],[-80.294043,37.690357],[-80.29952,37.509618],[-80.474782,37.421987],[-80.513121,37.482234],[-80.967707,37.290541],[-81.225123,37.235771],[-81.362047,37.339833],[-81.55374,37.208387],[-81.679709,37.20291],[-81.849494,37.285064],[-81.986418,37.454849],[-81.969987,37.537003],[-82.101434,37.553434],[-82.293127,37.668449],[-82.342419,37.783465],[-82.50125,37.931343],[-82.621743,38.123036],[-82.594358,38.424267],[-82.331465,38.446175],[-82.293127,38.577622],[-82.172634,38.632391],[-82.221926,38.785745],[-82.03571,39.026731],[-81.887833,38.873376],[-81.783771,38.966484],[-81.811156,39.0815],[-81.685186,39.273193],[-81.57017,39.267716],[-81.455155,39.410117],[-81.345616,39.344393],[-81.219646,39.388209],[-80.830783,39.711348],[-80.737675,40.078303],[-80.600752,40.319289],[-80.595275,40.472643],[-80.666475,40.582182],[-80.518598,40.636951]]]}},{type:"Feature",id:"WI",properties:{name:"Wisconsin",value:99},geometry:{type:"Polygon",coordinates:[[[-90.415429,46.568478],[-90.229213,46.508231],[-90.119674,46.338446],[-89.09001,46.135799],[-88.662808,45.987922],[-88.531362,46.020784],[-88.10416,45.922199],[-87.989145,45.796229],[-87.781021,45.675736],[-87.791975,45.500474],[-87.885083,45.363551],[-87.649574,45.341643],[-87.742682,45.199243],[-87.589328,45.095181],[-87.627666,44.974688],[-87.819359,44.95278],[-87.983668,44.722749],[-88.043914,44.563917],[-87.928898,44.536533],[-87.775544,44.640595],[-87.611236,44.837764],[-87.403112,44.914442],[-87.238804,45.166381],[-87.03068,45.22115],[-87.047111,45.089704],[-87.189511,44.969211],[-87.468835,44.552964],[-87.545512,44.322932],[-87.540035,44.158624],[-87.644097,44.103854],[-87.737205,43.8793],[-87.704344,43.687607],[-87.791975,43.561637],[-87.912467,43.249452],[-87.885083,43.002989],[-87.76459,42.783912],[-87.802929,42.493634],[-88.788778,42.493634],[-90.639984,42.510065],[-90.711184,42.636034],[-91.067185,42.75105],[-91.143862,42.909881],[-91.176724,43.134436],[-91.056231,43.254929],[-91.204109,43.353514],[-91.215062,43.501391],[-91.269832,43.616407],[-91.242447,43.775238],[-91.43414,43.994316],[-91.592971,44.032654],[-91.877772,44.202439],[-91.927065,44.333886],[-92.233773,44.443425],[-92.337835,44.552964],[-92.545959,44.569394],[-92.808852,44.750133],[-92.737652,45.117088],[-92.75956,45.286874],[-92.644544,45.440228],[-92.770513,45.566198],[-92.885529,45.577151],[-92.869098,45.719552],[-92.639067,45.933153],[-92.354266,46.015307],[-92.29402,46.075553],[-92.29402,46.667063],[-92.091373,46.749217],[-92.014696,46.705401],[-91.790141,46.694447],[-91.09457,46.864232],[-90.837154,46.95734],[-90.749522,46.88614],[-90.886446,46.754694],[-90.55783,46.584908],[-90.415429,46.568478]]]}},{type:"Feature",id:"WY",properties:{name:"Wyoming",value:5},geometry:{type:"Polygon",coordinates:[[[-109.080842,45.002073],[-105.91517,45.002073],[-104.058488,44.996596],[-104.053011,43.002989],[-104.053011,41.003906],[-105.728954,40.998429],[-107.919731,41.003906],[-109.04798,40.998429],[-111.047063,40.998429],[-111.047063,42.000709],[-111.047063,44.476286],[-111.05254,45.002073],[-109.080842,45.002073]]]}}]},Nr=({data:t,geoJsonNode:e,formatOptions:r,chartId:c})=>{const x=Me.useRef();let n=Lt(t),l,s,p,f=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=jt,b,_,A,R,g=0,B=1,U,W=new Map,P=new Map,D=new Map,V=Number.MAX_VALUE,$=Number.MIN_VALUE,Z=0,ce=0,ne,ae;Me.useEffect(()=>{ue()},[r,c]);const ue=()=>{({chartFormatOptions:l,svg:R,width:s,height:p}=qt(x,r)),{margins:S,chartTitleHeight:u,innerHeight:b,innerWidth:_}=ii(l,p,s),Xt(x,s,p,l),A=oa(R,S),Zt(x,u,s,l),ge(t),be(),pe(),Q()},ge=M=>{try{let h=new Set,k=new Set;M.forEach(i=>{i.data.forEach((y,T)=>{T===g&&(h.add(y.value.toString()),Z+=y.value),T===B&&(k.add(y.value.toString()),ce+=y.value)})});let o=l.colorScaleForMaps&&l.colorScaleForMaps.startColorForMaps?l.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=l.colorScaleForMaps&&l.colorScaleForMaps.endColorForMaps?l.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(h.size===1)ne=()=>o;else{const i=v.interpolateLab(o,d);ne=v.scaleOrdinal().domain(Array.from(h)).range(Array.from(h).map((y,T)=>i(T/(h.size-1))))}if(k.size===1)ae=()=>o;else{const i=v.interpolateLab(l.colorScaleForMapsBubble.startColorForMapsBubble,l.colorScaleForMapsBubble.endColorForMapsBubble);ae=v.scaleOrdinal().domain(Array.from(k)).range(Array.from(k).map((y,T)=>i(T/(k.size-1))))}}catch(h){Ae("Maps.tsx","dataPreparation",h)}},be=M=>{U=Vr},pe=()=>{try{n?.forEach(M=>{D.set(M.legend,M)}),e.mappings.forEach(M=>{P.set(M.actualName,M.mappedName)}),e.groups.forEach(M=>{M.groupedRegions.forEach(h=>{W.set(h,M.groupName)})}),U.features.forEach(M=>{const h=M.properties.name;let k;if(P.has(h)){const o=P.get(h);M.properties.displayName=o,k=o}if(W.has(h)){const o=W.get(h);M.properties.displayName=o,k=o}else k=h;if(D.has(k)){const o=D.get(k);M.properties.data=o;let d;o.data&&o.data[1]&&(d=o.data[1]?o.data[1].value:0,V=Math.min(V,d),$=Math.max($,d)),o.data&&o.data[0]&&(d=o.data[0].value,f=Math.min(f,d),L=Math.max(L,d))}else M.properties.data=void 0})}catch(M){Ae("Maps.tsx","generateDataForMaps",M)}},Q=()=>{try{let M=0;const h=v.geoAlbersUsa().fitSize([_,b],U),k=v.geoPath().projection(h),o=A.append("g").attr("class","paths");if(o.selectAll(c+" .path-group").data(U.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>G(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",l.plotArea.opacity).attr("stroke-width","0.4px").attr("d",d=>(M+=k.area(d),k(d))).on("mousemove",(d,i)=>{let y=i.properties.data;if(y){let T=y.data.map(a=>({key:a.dimension,value:qe("None",l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(a.value)}));yt([{key:"Region",value:y.properties.alias},...T],l,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{ot()}),l.plotArea.dataLabels){const d=M/U.features.length,i=l.plotArea.dataLabelName,y=l.plotArea.dataLabelValue,T=a=>l.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?k.area(a)<d*.25:!1;o.selectAll(".text-container").data(U.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>k.centroid(a)[0]-50).attr("y",a=>{const m=k.centroid(a);return i&&y?m[1]-15:m[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let m=a.properties.data;if((i||y)&&m&&!T(a)){if(T(a))return null;const N=m?.properties.alias||a.properties.displayName,re=l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/Z*100)+"%":qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let K="";return l.plotArea.dataLabelName&&(K+=`<div style=
151
151
  "text-align:center;
152
152
  font-family:${a.properties.data.properties.labelFont};
153
153
  font-size:${a.properties.data.properties.labelFontSize}px;
154
- font-weight:${a.properties.data.properties.labelFontStyle.includes(ne.bold)?ne.bold:"normal"};
155
- font-style:${a.properties.data.properties.labelFontStyle.includes(ne.italic)?ne.italic:"normal"};
156
- text-decoration:${a.properties.data.properties.labelFontStyle.includes(ne.underline)?ne.underline:"none"};
154
+ font-weight:${a.properties.data.properties.labelFontStyle.includes(oe.bold)?oe.bold:"normal"};
155
+ font-style:${a.properties.data.properties.labelFontStyle.includes(oe.italic)?oe.italic:"normal"};
156
+ text-decoration:${a.properties.data.properties.labelFontStyle.includes(oe.underline)?oe.underline:"none"};
157
157
  color:${a.properties.data.properties.labelFontColor};">
158
- ${P??""}
159
- </div>`),l.plotArea.dataLabelValue&&(Q+=`<div style=
158
+ ${N??""}
159
+ </div>`),l.plotArea.dataLabelValue&&(K+=`<div style=
160
160
  "text-align:center;
161
161
  font-family:${a.properties.data.properties.valueFont}; font-size:${a.properties.data.properties.valueFontSize}px;
162
- font-weight:${a.properties.data.properties.valueFontStyle.includes(ne.bold)?ne.bold:"normal"};
163
- font-style:${a.properties.data.properties.valueFontStyle.includes(ne.italic)?ne.italic:"normal"};
164
- text-decoration:${a.properties.data.properties.valueFontStyle.includes(ne.underline)?ne.underline:"none"};
162
+ font-weight:${a.properties.data.properties.valueFontStyle.includes(oe.bold)?oe.bold:"normal"};
163
+ font-style:${a.properties.data.properties.valueFontStyle.includes(oe.italic)?oe.italic:"normal"};
164
+ text-decoration:${a.properties.data.properties.valueFontStyle.includes(oe.underline)?oe.underline:"none"};
165
165
  color:${a.properties.data.properties.valueFontColor};">
166
- ${ie??""}
167
- </div>`),Q}return null})}if(l.bubbleformatting.showBubble){let d=Math.min(_,b);const i=T.scaleLinear().domain([N,$]).range([d*.01,d*.07]);g.selectAll("myCircles").data(K.features).join("circle").attr("cx",y=>C.centroid(y)[0]).attr("cy",y=>C.centroid(y)[1]).attr("r",y=>y.properties.data?i(y.properties.data?.data[1]?.value||0):0).attr("fill",(y,f)=>l.colorScaleForMapsBubble.showColorForMapsBubble=="2"?oe(y.properties.data&&y.properties.data.data[j]?.value||0):l.bubbleformatting.bubbleColor).attr("stroke",l.bubbleformatting&&l.bubbleformatting.bubbleBorderColor).attr("stroke-width",l.bubbleformatting&&l.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",l.bubbleformatting&&et(l.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,f){ot([{key:"Region",value:f.properties?.data?.propeties?.Alias},{key:f.properties.data?.data[1]?.dimension,value:l.toolTip.toolTipNumberFormat==",.0%"?Math.round(f.properties.data?.data[1]?.value/se*100)+"%":je(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(f.properties.data?.data[1]?.value)}],l,void 0,f.currentTarget.__data__.data.properties),T.select(this).style("r",(f.properties.data?i(f.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(y,f){rt(),T.select(this).style("r",f.properties.data?i(f.properties.data?.data[1]?.value||0):0)})}}catch(w){be("Maps.tsx","drawMap",w)}},q=w=>{try{let p=w.properties.data;switch(parseInt(l.colorScaleForMaps.showColorForMaps)){case 1:return p?p.properties.color:"#E6E6E6";case 2:return l.colorScaleForMaps.defaultColor;case 3:return w.properties.data?re(w.properties.data?.data[D]?.value):"#E6E6E6"}}catch(p){be("Maps.tsx","getMapColor",p)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{id:o,className:"chartSVG",style:{width:"100%",height:"100%"},ref:h})})},na="OrganizationChart.tsx",Sr=({data:t,formatOptions:e,legendSequence:r})=>{let o=t.LegendList??[];const h=crypto.randomUUID(),n=Te.useRef(),l=Te.useRef();let s,x,L,A=40,u=Ht,S,b=new Map,_=new Map,g=zt.left,H=[],D=0,j=0,K,J=new Map,U,V=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,$;Te.useEffect(()=>{X()},[h,t,e]);const X=()=>{({chartFormatOptions:s,svg:S,width:x,height:L}=Jt(n,e)),oe(),U=se(J),{margins:u,innerHeight,innerWidth,legendListWidth:K,chartTitleHeight:A}=Na(s,x,L,U,u),jt(n,x,L,s),_t(n,A,x,s),he(),q(H),re()},se=c=>{const d=[];c.forEach((f,a)=>{d.push(a)});const i=d.reduce((f,a)=>f.length>a.length?f:a,""),y=It(i,et(s.legends.legendFontSize),s.legends.legendFontFamily);return[y.width,y.height]},re=()=>{let c=[];J.forEach((d,i)=>{const y=`linear-gradient(90deg, ${d.join(", ")})`;c.push({properties:{...o[0],name:i,alias:i,color:y}})}),Pa(s,S,c,x,L,K,A,h,u,nt.rectangle,void 0)},oe=()=>{try{const i=e?.plotArea?.sortBy??"default";g=s.plotArea.chartDirection||zt.left;var c=0,d=0;const y={...t.ChartData,UID:void 0};let f=O(y).filter(a=>a.value!==null);i!=="default"&&(f=f.sort((a,m)=>i==="asc"?a.value-m.value:m.value-a.value)),ue(f),Le(f),H=pe(f),s.heatMap.showHeatMap&&($=T.scaleSequential().domain([N,V]).interpolator(T.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){be(na,"dataPreparation",i)}},he=()=>{try{if(s.plotArea.fitChart)j=L,D=x,l.current.style.width="calc(100% - 10px)",l.current.style.height="calc(100% - 10px)";else{let c=function(){let d=this;var i=d.scrollLeft,y=d.scrollTop;T.select(`#clipPath${h}`).select("rect").attr("x",i).attr("y",y)};D=0,H.forEach(d=>{d.label==r[r.length-1]&&(D+=p(d,!1))}),j=(r.length+1)*et(s.nodes.nodeHeight)*10+(r.length+1)*70,l.current.style.width=`${D}px`,l.current.style.height=`${j}px`,T.select(l.current).append("defs").attr("id",`defs${h}`).append("clipPath").attr("id",`clipPath${h}`).append("rect").attr("width",x-u.left-u.right).attr("height",L-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+h).addEventListener("scroll",c),T.select(l.current).attr("clip-path",`url(#clipPath${h})`)}}catch(c){be(na,"scrollWidthHeightCalculation",c)}},Le=c=>{try{c.forEach((d,i)=>{if(d.id!=0){let y=c[b.get(d.parentId)].UID;y===void 0?d.UID=d.nodeLabel:d.UID=y+"-"+d.nodeLabel}})}catch(d){be(na,"generateUID",d)}},pe=c=>{try{return o.forEach(d=>{_.set(d.name,d)}),Object.keys(c).forEach(d=>{const i=c[d],y=_.get(i.UID??i.nodeLabel)??o[0];if(c[d]={...i,styleObject:y},i.label)if(J.has(i.label)){const f=J.get(i.label);J.set(i.label,[...f,y.color??"#eedddd"])}else J.set(i.label,[y.color??"#eedddd"]);V=Math.max(V,i.value),N=Math.min(N,i.value)}),c}catch(d){be(na,"addStyleObjectToChartData",d)}},ue=c=>{try{c.forEach((d,i)=>{b.set(d.id,i)})}catch(d){be(na,"createIdIndexMap",d)}},O=c=>{try{const d=T.hierarchy(c).descendants();return d.forEach((i,y)=>{i.id=i.id||"id"+y}),d.map((i,y)=>{const f={...i.data};return delete f.children,i.parent&&(f.parentValue=i.parent.data.value||0),{...f,parentId:i.parent?.data?.id}})}catch(d){be(na,"getFlattenedData",d)}},q=c=>{try{let d=s.connector.lineType||"straight",i=s.nodes.nodeType||ei.rectangle,y=parseInt(s.connector.connectorLineThickness);T.select(l.current).selectAll("*").remove(),new hl.OrgChart().container(`#floating-${h}`).svgWidth(D).svgHeight(j).nodeHeight(a=>w(a)).nodeWidth(a=>p(a,!0)).layout(g).diagonal((a,m,P,ie={sy:0})=>{if(g=="top"||g=="bottom"||!g)switch(d){case ca.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ca.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${m.y} H ${m.x}`;case ca.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ca.s_curve:const Q=(a.y+m.y)/2;return`M ${a.x},${a.y} C ${a.x},${Q} ${m.x},${Q} ${m.x},${m.y}`;case ca.arc:const Ae=m.x-a.x,ge=m.y-a.y,we=Math.sqrt(Ae*Ae+ge*ge);return`M ${a.x},${a.y} A ${we},${we} 0 0,1 ${m.x},${m.y}`;case ca.reverse_elbow:if(g==zt.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${m.x} V ${m.y}`;if(g==zt.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${m.x} V ${m.y}`;case ca.zigzag:if(g==zt.top){const fe=(a.y+m.y)/2;return`M ${a.x},${a.y} L ${a.x},${fe-10} L ${m.x},${fe+10} L ${m.x},${m.y}`}else if(g==zt.bottom){const fe=(a.y+m.y)/2;return`
166
+ ${re??""}
167
+ </div>`),K}return null})}if(l.bubbleformatting.showBubble){let d=Math.min(_,b);const i=v.scaleLinear().domain([V,$]).range([d*.01,d*.07]);A.selectAll("myCircles").data(U.features).join("circle").attr("cx",y=>k.centroid(y)[0]).attr("cy",y=>k.centroid(y)[1]).attr("r",y=>y.properties.data?i(y.properties.data?.data[1]?.value||0):0).attr("fill",(y,T)=>l.colorScaleForMapsBubble.showColorForMapsBubble=="2"?ae(y.properties.data&&y.properties.data.data[B]?.value||0):l.bubbleformatting.bubbleColor).attr("stroke",l.bubbleformatting&&l.bubbleformatting.bubbleBorderColor).attr("stroke-width",l.bubbleformatting&&l.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",l.bubbleformatting&&rt(l.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,T){yt([{key:"Region",value:T.properties?.data?.propeties?.Alias},{key:T.properties.data?.data[1]?.dimension,value:l.toolTip.toolTipNumberFormat==",.0%"?Math.round(T.properties.data?.data[1]?.value/ce*100)+"%":qe(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(T.properties.data?.data[1]?.value)}],l,void 0,T.currentTarget.__data__.data.properties),v.select(this).style("r",(T.properties.data?i(T.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(y,T){ot(),v.select(this).style("r",T.properties.data?i(T.properties.data?.data[1]?.value||0):0)})}}catch(M){Ae("Maps.tsx","drawMap",M)}},G=M=>{try{let h=M.properties.data;switch(parseInt(l.colorScaleForMaps.showColorForMaps)){case 1:return h?h.properties.color:"#E6E6E6";case 2:return l.colorScaleForMaps.defaultColor;case 3:return M.properties.data?ne(M.properties.data?.data[g]?.value):"#E6E6E6"}}catch(h){Ae("Maps.tsx","getMapColor",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{id:c,className:"chartSVG",style:{width:"100%",height:"100%"},ref:x})})},da="OrganizationChart.tsx",Pr=({data:t,formatOptions:e,legendSequence:r})=>{let c=t.LegendList??[];const x=crypto.randomUUID(),n=Me.useRef(),l=Me.useRef();let s,p,f,L=40,u=jt,S,b=new Map,_=new Map,A=Ut.left,R=[],g=0,B=0,U,W=new Map,P,D=Number.NEGATIVE_INFINITY,V=Number.POSITIVE_INFINITY,$;Me.useEffect(()=>{Z()},[x,t,e]);const Z=()=>{({chartFormatOptions:s,svg:S,width:p,height:f}=qt(n,e)),ae(),P=ce(W),{margins:u,innerHeight,innerWidth,legendListWidth:U,chartTitleHeight:L}=$a(s,p,f,P,u),Xt(n,p,f,s),Zt(n,L,p,s),ue(),G(R),ne()},ce=o=>{const d=[];o.forEach((T,a)=>{d.push(a)});const i=d.reduce((T,a)=>T.length>a.length?T:a,""),y=zt(i,rt(s.legends.legendFontSize),s.legends.legendFontFamily);return[y.width,y.height]},ne=()=>{let o=[];W.forEach((d,i)=>{const y=`linear-gradient(90deg, ${d.join(", ")})`;o.push({properties:{...c[0],name:i,alias:i,color:y}})}),Ya(s,S,o,p,f,U,L,x,u,ct.rectangle,void 0)},ae=()=>{try{const i=e?.plotArea?.sortBy??"default";A=s.plotArea.chartDirection||Ut.left;var o=0,d=0;const y={...t.ChartData,UID:void 0};let T=Q(y).filter(a=>a.value!==null);i!=="default"&&(T=T.sort((a,m)=>i==="asc"?a.value-m.value:m.value-a.value)),pe(T),ge(T),R=be(T),s.heatMap.showHeatMap&&($=v.scaleSequential().domain([V,D]).interpolator(v.interpolateRgb(s.heatMap.heatMapMinColor,s.heatMap.heatMapMaxColor)))}catch(i){Ae(da,"dataPreparation",i)}},ue=()=>{try{if(s.plotArea.fitChart)B=f,g=p,l.current.style.width="calc(100% - 10px)",l.current.style.height="calc(100% - 10px)";else{let o=function(){let d=this;var i=d.scrollLeft,y=d.scrollTop;v.select(`#clipPath${x}`).select("rect").attr("x",i).attr("y",y)};g=0,R.forEach(d=>{d.label==r[r.length-1]&&(g+=h(d,!1))}),B=(r.length+1)*rt(s.nodes.nodeHeight)*10+(r.length+1)*70,l.current.style.width=`${g}px`,l.current.style.height=`${B}px`,v.select(l.current).append("defs").attr("id",`defs${x}`).append("clipPath").attr("id",`clipPath${x}`).append("rect").attr("width",p-u.left-u.right).attr("height",f-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+x).addEventListener("scroll",o),v.select(l.current).attr("clip-path",`url(#clipPath${x})`)}}catch(o){Ae(da,"scrollWidthHeightCalculation",o)}},ge=o=>{try{o.forEach((d,i)=>{if(d.id!=0){let y=o[b.get(d.parentId)].UID;y===void 0?d.UID=d.nodeLabel:d.UID=y+"-"+d.nodeLabel}})}catch(d){Ae(da,"generateUID",d)}},be=o=>{try{return c.forEach(d=>{_.set(d.name,d)}),Object.keys(o).forEach(d=>{const i=o[d],y=_.get(i.UID??i.nodeLabel)??c[0];if(o[d]={...i,styleObject:y},i.label)if(W.has(i.label)){const T=W.get(i.label);W.set(i.label,[...T,y.color??"#eedddd"])}else W.set(i.label,[y.color??"#eedddd"]);D=Math.max(D,i.value),V=Math.min(V,i.value)}),o}catch(d){Ae(da,"addStyleObjectToChartData",d)}},pe=o=>{try{o.forEach((d,i)=>{b.set(d.id,i)})}catch(d){Ae(da,"createIdIndexMap",d)}},Q=o=>{try{const d=v.hierarchy(o).descendants();return d.forEach((i,y)=>{i.id=i.id||"id"+y}),d.map((i,y)=>{const T={...i.data};return delete T.children,i.parent&&(T.parentValue=i.parent.data.value||0),{...T,parentId:i.parent?.data?.id}})}catch(d){Ae(da,"getFlattenedData",d)}},G=o=>{try{let d=s.connector.lineType||"straight",i=s.nodes.nodeType||ri.rectangle,y=parseInt(s.connector.connectorLineThickness);v.select(l.current).selectAll("*").remove(),new ml.OrgChart().container(`#floating-${x}`).svgWidth(g).svgHeight(B).nodeHeight(a=>M(a)).nodeWidth(a=>h(a,!0)).layout(A).diagonal((a,m,N,re={sy:0})=>{if(A=="top"||A=="bottom"||!A)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ha.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${m.y} H ${m.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ha.s_curve:const K=(a.y+m.y)/2;return`M ${a.x},${a.y} C ${a.x},${K} ${m.x},${K} ${m.x},${m.y}`;case ha.arc:const me=m.x-a.x,Le=m.y-a.y,ze=Math.sqrt(me*me+Le*Le);return`M ${a.x},${a.y} A ${ze},${ze} 0 0,1 ${m.x},${m.y}`;case ha.reverse_elbow:if(A==Ut.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${m.x} V ${m.y}`;if(A==Ut.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${m.x} V ${m.y}`;case ha.zigzag:if(A==Ut.top){const Se=(a.y+m.y)/2;return`M ${a.x},${a.y} L ${a.x},${Se-10} L ${m.x},${Se+10} L ${m.x},${m.y}`}else if(A==Ut.bottom){const Se=(a.y+m.y)/2;return`
168
168
  M ${a.x},${a.y}
169
- L ${a.x},${fe+10}
170
- L ${m.x},${fe-10}
169
+ L ${a.x},${Se+10}
170
+ L ${m.x},${Se-10}
171
171
  L ${m.x},${m.y}
172
- `}default:if(g==zt.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${m.x} V ${m.y}`;if(g=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${m.x} V ${m.y}`}}).hdiagonal((a,m,P,ie={sx:0})=>{if(g===zt.left||g===zt.right)switch(d){case ca.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ca.elbow:if(g==zt.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${m.y} H ${m.x}`;if(g==zt.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${m.y} H ${m.x}`;case ca.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ca.s_curve:const Q=(a.x+m.x)/2;return`M ${a.x},${a.y} C ${Q},${a.y} ${Q},${m.y} ${m.x},${m.y}`;case ca.arc:if(g==zt.left){const Ae=m.x-a.x,ge=m.y-a.y,we=Math.sqrt(Ae*Ae+ge*ge);return`M ${a.x},${a.y} A ${we},${we} 0 0,1 ${m.x},${m.y}`}else if(g==zt.right){const Ae=a.x-m.x,ge=m.y-a.y,we=Math.sqrt(Ae*Ae+ge*ge);return`M ${a.x},${a.y} A ${we},${we} 0 0,0 ${m.x},${m.y}`}case"reverse-elbow":if(g==zt.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${m.y} H ${m.x}`;if(g==zt.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${m.y} H ${m.x}`;case"zigzag":if(g==zt.left){const Ae=(a.x+m.x)/2;return`
172
+ `}default:if(A==Ut.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${m.x} V ${m.y}`;if(A=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${m.x} V ${m.y}`}}).hdiagonal((a,m,N,re={sx:0})=>{if(A===Ut.left||A===Ut.right)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+m.x)/2} ${a.y}, ${(a.x+m.x)/2} ${m.y}, ${m.x} ${m.y}`;case ha.elbow:if(A==Ut.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${m.y} H ${m.x}`;if(A==Ut.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${m.y} H ${m.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+m.x)/2} ${a.y} L ${(a.x+m.x)/2} ${m.y} L ${m.x} ${m.y}`;case ha.s_curve:const K=(a.x+m.x)/2;return`M ${a.x},${a.y} C ${K},${a.y} ${K},${m.y} ${m.x},${m.y}`;case ha.arc:if(A==Ut.left){const me=m.x-a.x,Le=m.y-a.y,ze=Math.sqrt(me*me+Le*Le);return`M ${a.x},${a.y} A ${ze},${ze} 0 0,1 ${m.x},${m.y}`}else if(A==Ut.right){const me=a.x-m.x,Le=m.y-a.y,ze=Math.sqrt(me*me+Le*Le);return`M ${a.x},${a.y} A ${ze},${ze} 0 0,0 ${m.x},${m.y}`}case"reverse-elbow":if(A==Ut.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${m.y} H ${m.x}`;if(A==Ut.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${m.y} H ${m.x}`;case"zigzag":if(A==Ut.left){const me=(a.x+m.x)/2;return`
173
173
  M ${a.x},${a.y}
174
- L ${Ae-10},${a.y}
175
- L ${Ae+10},${m.y}
174
+ L ${me-10},${a.y}
175
+ L ${me+10},${m.y}
176
176
  L ${m.x},${m.y}
177
- `}else{const Ae=(a.x+m.x)/2;return`
177
+ `}else{const me=(a.x+m.x)/2;return`
178
178
  M ${a.x},${a.y}
179
- L ${Ae+10},${a.y}
180
- L ${Ae-10},${m.y}
179
+ L ${me+10},${a.y}
180
+ L ${me-10},${m.y}
181
181
  L ${m.x},${m.y}
182
- `}default:return g==zt.left?`M ${a.x} ${a.y} H ${a.x-25} V ${m.y} H ${m.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${m.y} H ${m.x}`}else return`M ${a.x} ${a.y} L ${m.x} ${m.y}`}).linkUpdate(function(a){try{if(y){const m=s.plotArea.connectorType||"arrow",P=["arrow","diamond","dot"].includes(m)&&s.connector.lineType!=="reverse-elbow";T.select(this).attr("stroke-width",s.connector.connectorLineThickness).attr("stroke-dasharray",s.connector.connectorStyle===Ha.solid?0:s.connector.connectorStyle===Ha.dotted?1:4).style("stroke",s.connector.connectorLineColor).attr("marker-start",P?`url(#${m})`:null).attr("marker-end",null)}else T.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(m){be(na,"drawOrganizationChart.linkUpdate",m)}}).nodeContent((a,m)=>{try{let P=`${a.data.styleObject.borderRadius}px`,ie="",Q="",Ae="",ge="",we="";switch(i){case ei.rounded:P="10px";break;case ei.pill:P="999px";break;case ei.extra_rounded:P="20px";break;case ei.squircle:P="25%";break;default:P="1px";break}return we=`
182
+ `}default:return A==Ut.left?`M ${a.x} ${a.y} H ${a.x-25} V ${m.y} H ${m.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${m.y} H ${m.x}`}else return`M ${a.x} ${a.y} L ${m.x} ${m.y}`}).linkUpdate(function(a){try{if(y){const m=s.plotArea.connectorType||"arrow",N=["arrow","diamond","dot"].includes(m)&&s.connector.lineType!=="reverse-elbow";v.select(this).attr("stroke-width",s.connector.connectorLineThickness).attr("stroke-dasharray",s.connector.connectorStyle===Za.solid?0:s.connector.connectorStyle===Za.dotted?1:4).style("stroke",s.connector.connectorLineColor).attr("marker-start",N?`url(#${m})`:null).attr("marker-end",null)}else v.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(m){Ae(da,"drawOrganizationChart.linkUpdate",m)}}).nodeContent((a,m)=>{try{let N=`${a.data.styleObject.borderRadius}px`,re="",K="",me="",Le="",ze="";switch(i){case ri.rounded:N="10px";break;case ri.pill:N="999px";break;case ri.extra_rounded:N="20px";break;case ri.squircle:N="25%";break;default:N="1px";break}return ze=`
183
183
  border-width: ${a.data.styleObject.borderWidth}px
184
184
  border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
185
185
  border-color:${a.data.styleObject.borderColor};
186
- border-radius: ${P};
186
+ border-radius: ${N};
187
187
  `,`<div hoverId="${a.data.label}" style="
188
188
  border-width: ${a.data.styleObject.borderWidth}px;
189
189
  border-style:${s.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"} ;
190
190
  border-color:${a.data.styleObject.borderColor};
191
- border-radius: ${P};
191
+ border-radius: ${N};
192
192
  width: ${a.width}px;
193
193
  height: ${a.height}px;
194
194
  padding: 5px;
@@ -199,38 +199,38 @@ let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+
199
199
  text-align: center;
200
200
  background-color: ${s.heatMap.showHeatMap?$(a.data.value):s.nodes.nodesSingleColor?s.nodes.nodesColor:a.data.styleObject.color};
201
201
  z-index: 99;
202
- transform: ${ie};
202
+ transform: ${re};
203
203
  transition: unset;">
204
204
 
205
- ${Q}
205
+ ${K}
206
206
 
207
207
  <div style="font-family:${a.data.styleObject.labelFont};
208
208
  color:${a.data.styleObject.labelFontColor};
209
209
  font-size:${a.data.styleObject.labelFontSize}px;
210
- font-weight:${a.data.styleObject.labelFontStyle.includes(ne.bold)?"Bolder":"normal"};
211
- font-style:${a.data.styleObject.labelFontStyle.includes(ne.italic)?ne.italic:"normal"};
212
- text-decoration:${a.data.styleObject.labelFontStyle.includes(ne.underline)?ne.underline:"none"};
210
+ font-weight:${a.data.styleObject.labelFontStyle.includes(oe.bold)?"Bolder":"normal"};
211
+ font-style:${a.data.styleObject.labelFontStyle.includes(oe.italic)?oe.italic:"normal"};
212
+ text-decoration:${a.data.styleObject.labelFontStyle.includes(oe.underline)?oe.underline:"none"};
213
213
  text-overflow: ellipsis;
214
214
  overflow: hidden;
215
215
  white-space: nowrap;
216
216
  max-width: ${a.width}px;
217
217
  padding: 5px;">
218
- ${m===0?a.data.styleObject.alias:s.nodes.nodesLabelVisibility?`${a.data.label} : ${C(a.data.styleObject.alias)}`:`${C(a.data.styleObject.alias)}`}
218
+ ${m===0?a.data.styleObject.alias:s.nodes.nodesLabelVisibility?`${a.data.label} : ${k(a.data.styleObject.alias)}`:`${k(a.data.styleObject.alias)}`}
219
219
  </div>
220
220
 
221
221
  <div style="font-family:${a.data.styleObject.valueFont};
222
222
  color:${a.data.styleObject.valueFontColor};
223
- font-weight:${a.data.styleObject.valueFontStyle.includes(ne.bold)?"Bolder":"normal"};
224
- font-style:${a.data.styleObject.valueFontStyle.includes(ne.italic)?ne.italic:"normal"};
225
- text-decoration:${a.data.styleObject.valueFontStyle.includes(ne.underline)?ne.underline:"none"};
223
+ font-weight:${a.data.styleObject.valueFontStyle.includes(oe.bold)?"Bolder":"normal"};
224
+ font-style:${a.data.styleObject.valueFontStyle.includes(oe.italic)?oe.italic:"normal"};
225
+ text-decoration:${a.data.styleObject.valueFontStyle.includes(oe.underline)?oe.underline:"none"};
226
226
  font-size:${a.data.styleObject.valueFontSize}px;">
227
- ${s.nodes.dataLabelNumberFormat==",.0%"?a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":je(s.nodes.nodesDisplayUnits,s.nodes.dataLabelNumberFormat,s.nodes.dataLabelDecimalPrecision)(a.data.value)}
227
+ ${s.nodes.dataLabelNumberFormat==",.0%"?a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":qe(s.nodes.nodesDisplayUnits,s.nodes.dataLabelNumberFormat,s.nodes.dataLabelDecimalPrecision)(a.data.value)}
228
228
  <br>
229
229
  ${s.nodes.percentageVisibility?+a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":""}
230
230
  </div>
231
231
 
232
- ${Ae}
233
- </div>`}catch(P){return be(na,"drawOrganizationChart.nodeContent",P),""}}).buttonContent(({node:a,state:m})=>{try{if(y)return`
232
+ ${me}
233
+ </div>`}catch(N){return Ae(da,"drawOrganizationChart.nodeContent",N),""}}).buttonContent(({node:a,state:m})=>{try{if(y)return`
234
234
  <div
235
235
  style="
236
236
  color: black;
@@ -256,14 +256,14 @@ let g=t<200?200:S?e:t,H=e<200?200:S?t:e,D=g*.15*.8,j=Bl(l,n),K=D<j[0]+10?D:j[0]+
256
256
  font-size: 7px;
257
257
  font-weight: bold;
258
258
  ">${a.data._directSubordinates}</span>`}
259
- </div>`}catch(P){return be(na,"drawOrganizationChart.buttonContent",P),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,m)=>20).duration(0).setActiveNodeCentered(!1).data(c).compact(!1).expandAll().fit(!1).render()}catch(d){be(na,"drawOrganizationChart",d)}},w=c=>{try{let d;if(c.data.styleObject)return s.nodes.percentageVisibility?d=c.data.styleObject.nodeHeight*10+10:d=c.data.styleObject.nodeHeight*10,d}catch(d){be(na,"calculateNodeHeight",d)}},p=(c,d)=>{try{let i={};d?i=c.data:i=c;let y,f;if(s.nodes.nodesLabelVisibility?f=50:f=20,i.styleObject)return s.nodes.nodesLabelOverflow?i.id==0?y=i.styleObject.nodeWidth*10+50:y=i.styleObject.nodeWidth*10:y=f+C(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){be(na,"calculateNodeWidth",i)}},C=c=>{try{let d=c.split("-");return d[d.length-1]}catch(d){be(na,"getLabelText",d)}};return $e.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[$e.jsx("svg",{id:h,className:"chartSVG",style:{width:"100%",height:"100%"},ref:n}),$e.jsx("div",{id:`floating-div${h}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:$e.jsx("svg",{id:`floating-${h}`,className:"chartSVG",ref:l})})]})},Fr=({data:t,formatOptions:e,chartId:r,addLocalFilterFromLib:o,onElementClick:h,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=Te.useRef(h);s.current=h;const x=Te.useRef(n);x.current=n;const L=new Map((t.ChartData??[]).map((ce,me)=>[ce.legend,me]));let A=t.LegendList;const u=Te.useRef();let S,b=[0,0];const _=le.BubbleChart;let g,H,D=40,j=Ht,K,J,U,V,N=[],$=[],X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a;Te.useEffect(()=>{m()},[e,t,r]);const m=()=>{({chartFormatOptions:S,svg:V,width:g,height:H}=Jt(u,e)),b=Ia(S,A??[],"alias"),t=ke(t),Q(),{longestMeasure:c,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=_i(S,re,oe),{longestDimension:q,customXaxisIntervalValue:w,customXaxisMaxValue:p,customXaxisMinValue:C}=ji(S,X,se),{margins:j,yLabel:he,xLabel:Le,yTitle:pe,xTitle:ue,chartTitleHeight:D,legendMargin:O,innerHeight:K,innerWidth:J}=Gi(g,H,c,S,q,b),jt(u,g,H,S),U=la(V,j),mt(U,e,0,J,K,_),_t(u,D,g,S),Ae(),ge(),we(),Ji(e,!1,V,j,Le,H,ue,"Bubble",he,J,K),Zi(K,e,0,!1,V,j,pe,he),fe(),ae(),P(),Oi(V,S.legends.legendPosition,S,H,g,j,K,ue,Le,t.length)},P=()=>{try{let ce=5,me=30,Ve={minimumValue:re,maximumValue:oe};const Ye=U.append("g").attr("class","circles").attr("class","parentGroup"),te=S.animation.animationEnabled,de=Ye.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",Pe=>Pe.legendName.replace(/ /g,"-")).attr("fill",Pe=>Pe.legendColor!==De.white?Pe.legendColor:"none").append("path").attr("class","path").attr("id",function(Pe,Ce){T.select(this).attr("d",T.symbol().type(T.symbolCircle).size(ie(ce,me,Ve,Pe.measure,10)*et(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(Pe){return`translate(${f(Pe.dimension)}, ${a(Pe.measure)})`}).attr(Qe.SeriesId,Pe=>`${L.get(Pe.legendName)}_${Pe.legendName}`).attr(Qe.DimValue,Pe=>String(Pe.dimension)).attr("opacity",te?0:S.plotArea.fillOpacity).style("visibility",(Pe,Ce)=>Pe.dimension[0]===0||Pe.measure===0&&S.plotArea.hideZeroValues||Pe.dimension<C||Pe.dimension>p||Pe.measure<y||Pe.measure>i?"hidden":"visible").on("click",At(x,s,(Pe,Ce)=>({seriesId:`${L.get(Ce.legendName)}_${Ce.legendName}`,dimValue:String(Ce.dimension),legendUniqueId:`${L.get(Ce.legendName)}_${Ce.legendName}`,seriesDisplayName:Ce.legendName}))).on("mousemove",(Pe,Ce)=>{ot([{key:S.xAxisTitle.xAxisTitleText,value:je(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(Ce.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:je(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(Ce.measure)},{key:"Legend",value:Ce.legendName}],S,Pe,{alias:Ce.legendName},ht(l,String(Ce.dimension),{alias:Ce.legendName}))}).on("mouseout",()=>{rt()});te&&de.transition().duration(S.animation.animationDuration).ease(Xe[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(ce){be("BubbleChart","initCircles",ce)}};function ie(ce,me,Ve,Ye,te){try{if(Ye==null)return te;var de=Ve.minimumValue,Pe=Ve.maximumValue,Ce=me*me*2*Math.PI,Me=ce*ce*2*Math.PI,ve=te;if(de==Pe)ve=me;else{var xe=Ye,Fe=(xe-de)/(Pe-de)*(Ce-Me)+Me;Fe<Me&&(Fe=Me),ve=Math.sqrt(Fe/(Math.PI*2))}return ve}catch(ye){return be("BubbleChart","getBubbleSize",ye),te}}const Q=()=>{try{N=[],$=[],re=void 0,oe=void 0,X=void 0,se=void 0,t.forEach(ce=>{ce.measureName&&(N.push(ce.measure),(ce.measure<re||re===void 0)&&(re=ce.measure),(ce.measure>oe||oe===void 0)&&(oe=ce.measure)),ce.dimensionName&&($.push(ce.dimension),(ce.dimension<X||X===void 0)&&(X=ce.dimension),(ce.dimension>se||se===void 0)&&(se=ce.dimension))})}catch(ce){be("BubbleChart","iterateOverChartData",ce)}},Ae=()=>{try{let ce=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):X>0?0:X*1.1,me=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):se*1.1,Ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):re>0?0:re*1.1,Ye=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):oe*1.1;f=T.scaleLinear().domain([ce,me]).range([0,J]),a=T.scaleLinear().domain([Ve,Ye]).range([K,0])}catch(ce){be("BubbleChart","initScale",ce)}},ge=()=>{try{let{xAxisLabelArray:ce,customTickValue:me,autoLabelFlag:Ve}=hi(se,X,J,e,C,p,J,!1);const Ye=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(ia(e,K,0,!0)).tickValues(ce.length>0?ce:null).ticks(me).tickPadding(8).tickSizeOuter(0);Ki(U,S,0,Le,Ye,K,J,j,a)}catch(ce){be("BubbleChart","drawXAxis",ce)}},we=()=>{try{let{yAxisLabelArray:ce,customTickValue:me}=Xi(oe,re,K,e,y,i);const Ve=T.axisLeft(a).tickFormat(je(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(Pt(e,J)).tickValues(ce.length>0?ce:null).ticks(me).tickPadding(8).tickSizeOuter(0);qi(U,S,0,he,Ve,K)}catch(ce){be("BubbleChart","drawYAxis",ce)}},fe=()=>{try{if(S.plotArea.xCoordinate!=Yt.None){let ce;switch(S.plotArea.xCoordinate){case Yt.Mean:ce=T.mean(t,me=>me.dimension);break;case Yt.Median:ce=T.median(t,me=>me.dimension);break;case Yt.Custom:ce=et(S.plotArea.xscaleposition);break}U.append("line").attr("x1",f(ce)).attr("y1",0).attr("x2",f(ce)).attr("y2",K).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Yt.None){let ce;switch(S.plotArea.yCoordinate){case Yt.Mean:ce=T.mean(t,me=>me.measure);break;case Yt.Median:ce=T.median(t,me=>me.measure);break;case Yt.Custom:ce=et(S.plotArea.yscaleposition);break}U.append("line").attr("x1",0).attr("y1",a(ce)).attr("x2",J).attr("y2",a(ce)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(ce){be("BubbleChart","drawReferenceLines",ce)}},ae=()=>{try{let ce=A?.map(me=>{let Ve={...me,legendFontStyle:me.fontStyle,fontSize:me.fontSize+"px",legendFontFamily:me.fontFamily};return{legend:me.name,properties:Ve,data:{}}});Pa(S,V,ce||[],g,H,b[0],D,r,j,nt.circle,!1,o)}catch(ce){be("BubbleChart","initLegendList",ce)}},ke=ce=>{try{if(!ce||!ce.ChartData||!ce.ChartData[0])return[];const me=[];return ce.ChartData.forEach(Ye=>{Ye.data.forEach(te=>{me.push({dimension:parseFloat(te.dimension),dimensionName:Ye.legend??"Dimension",measure:te.value,measureName:Ye.legend??"Measure",legendName:Ye.legend,legendColor:Ye.properties?.color??De.black,tooltip:""})})}),me}catch(me){return console.error("BubbleChart - Data conversion failed",me),[]}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:u,id:r,style:{width:"100%",height:"100%"}})})},ua="ScatterChart.tsx",wr=({data:t,formatOptions:e,chartId:r,onElementClick:o,vfxPickModeActive:h,tooltipFormatter:n})=>{const l=Te.useRef(o);l.current=o;const s=Te.useRef(h);s.current=h;const x=t.ColorElements??[],L=t.ShapeElements??[],A=new Map(x.map((Pe,Ce)=>[Pe.name,Ce]));let u=[];const S=Te.useRef();let b,_=[0,0],g,H,D=40,j=Ht,K,J,U,V,N=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,X=Number.POSITIVE_INFINITY,se=Number.NEGATIVE_INFINITY,re=Number.POSITIVE_INFINITY,oe=Number.NEGATIVE_INFINITY,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P=new Map,ie=new Map;Te.useEffect(()=>{Q()},[e,t,r]);const Q=()=>{({chartFormatOptions:b,svg:V,width:g,height:H}=Jt(S,e));let Pe=[...L,...x];_=Ia(b,Pe,"alias"),ge(),{longestMeasure:c,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=_i(b,X,se),{longestDimension:q,customXaxisIntervalValue:w,customXaxisMaxValue:p,customXaxisMinValue:C}=ji(b,N,$),{margins:j,yLabel:he,xLabel:Le,yTitle:pe,xTitle:ue,chartTitleHeight:D,legendMargin:O,innerHeight:K,innerWidth:J}=Gi(g,H,c,b,q,_),jt(S,g,H,b),U=la(V,j),mt(U,e,0,J,K,"Scatter",r),_t(S,D,g,b),we(),fe(),ae(),Ji(e,!1,V,j,Le,H,ue,"Scatter",he,J,K),Zi(K,e,0,!1,V,j,pe,he),ke(),Ae(),ce(),me(),Oi(V,b.legends.legendPosition,b,H,g,j,K,ue,Le,u.length)},Ae=()=>{try{let Pe=function(xe){return xe=="Square"?T.symbolSquare:xe=="Circle"?T.symbolCircle:xe=="Cross"?T.symbolCross:xe=="Triangle"?T.symbolTriangle:xe=="Star"?T.symbolStar:xe=="Diamond"?T.symbolDiamond:xe=="Wye"?T.symbolWye:T.symbolCircle};const Ce=U.append("g").attr("class","circles").attr("class","parentGroup"),Me=b.animation.animationEnabled,ve=Ce.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",xe=>xe.color).attr("colorId",xe=>xe.colorName.replace(/ /g,"-")).attr("shapeId",xe=>xe.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(xe,Fe){T.select(this).attr("d",T.symbol().type(Pe(xe.shape)).size((xe.sizeValue?m(xe.sizeValue):10)*2*et(b.plotArea.scatterSizeIndex)))}).attr("transform",function(xe){return`translate(${f(xe.dimension)}, ${a(xe.measure)})`}).attr(Qe.SeriesId,xe=>`${A.get(xe.colorName)}_${xe.colorName}`).attr(Qe.DimValue,xe=>String(xe.dimension)).attr("opacity",Me?0:b.plotArea.fillOpacity).style("visibility",(xe,Fe)=>xe.dimension[0]===0||xe.measure===0&&b.plotArea.hideZeroValues||xe.dimension<C||xe.dimension>p||xe.measure<y||xe.measure>i?"hidden":"visible").on("click",At(s,l,(xe,Fe)=>({seriesId:`${A.get(Fe.colorName)}_${Fe.colorName}`,dimValue:String(Fe.dimension),legendUniqueId:`${A.get(Fe.colorName)}_${Fe.colorName}`,seriesDisplayName:Fe.colorName}))).on("mousemove",(xe,Fe)=>{ot([{key:b.xAxisTitle.xAxisTitleText,value:je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(Fe.dimension)},{key:b.yAxisTitle.yAxisTitleText,value:je(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(Fe.measure)},{key:"Color",value:Fe.colorName},...Fe.shapeName?[{key:"Shape",value:Fe.shapeName}]:[]],b,xe,{alias:Fe.colorName},ht(n,String(Fe.dimension),{alias:Fe.colorName}))}).on("mouseout",()=>{rt()});Me&&ve.transition().duration(b.animation.animationDuration).ease(Xe[b.animation.animationEffect]).attr("opacity",b.plotArea.fillOpacity)}catch(Pe){be(ua,"initCircles",Pe)}},ge=()=>{try{let Pe=function(Ce,Me,ve){X=Math.min(X,Ce.value),se=Math.max(se,Ce.value),N=Math.min(N,Ce.dimension),$=Math.max($,Ce.dimension),re=Math.min(re,Ce.value2??10),oe=Math.max(oe,Ce.value2??10),u.push({dimension:Ce.dimension,measure:Ce.value,sizeValue:Ce.value2,colorName:Me,shapeName:ve,shape:ie.get(ve)||"Circle",color:P.get(Me)||"#6ba2b8ff"})};x.forEach(Ce=>{P.set(Ce.name,Ce.color)}),L.forEach(Ce=>{ie.set(Ce.name,Ce.markerShape)}),t.ChartData.forEach(Ce=>{Ce.children&&Ce.children.length>0&&Ce.children.forEach(Me=>{Me.data.forEach(ve=>{Pe(ve,Ce.legend,Me.legend)})}),Ce.data&&Ce.data.length>0&&Ce.data.forEach(Me=>{Pe(Me,Ce.legend)})})}catch(Pe){be(ua,"iterateOverChartData",Pe)}},we=()=>{try{let Pe=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMinText!==""?parseFloat(b.yAxisLabel.yAxisMinText):X>0?0:X*1.1,Ce=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMaxText!==""?parseFloat(b.yAxisLabel.yAxisMaxText):se*1.1;a=T.scaleLinear().domain([Pe,Ce]).range([K,0]),m=T.scaleLinear().domain([re,oe]).range([1,10])}catch(Pe){be(ua,"initScale",Pe)}},fe=()=>{try{const Ce=(parseFloat(e.plotArea.ticksHeight)||100)/100*K;let{xAxisLabelArray:Me,customTickValue:ve}=hi($,N,J,e,C,p,K,!1);Me.length>0?f=T.scaleLinear().domain([Me[0],Me[Me.length-1]]).range([0,J]):f=T.scaleLinear().domain([C,p]).range([0,J]);const xe=T.axisBottom(f).tickFormat(je(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesVertical?b.xAxisLabel.xAxisPosition==="0"?-Ce:b.xAxisLabel.xAxisPosition==="1"?Ce:0:0).tickValues(Me.length>0?Me:null).ticks(ve).tickPadding(8).tickSizeOuter(0);Ki(U,b,0,Le,xe,K,J,j,a)}catch(Pe){be(ua,"drawXAxis",Pe)}},ae=()=>{try{const Ce=(parseFloat(e.plotArea.ticksWidth)||100)/100*J;let{yAxisLabelArray:Me,customTickValue:ve}=Xi(se,X,K,e,y,i);const xe=T.axisLeft(a).tickFormat(je(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesHorizontal?-Ce:0).tickValues(Me.length>0?Me:null).ticks(ve).tickPadding(8).tickSizeOuter(0);qi(U,b,0,he,xe,K)}catch(Pe){be(ua,"drawYAxis",Pe)}},ke=()=>{try{if(b.plotArea.xCoordinate!=Yt.None){let Pe;switch(b.plotArea.xCoordinate){case Yt.Mean:Pe=T.mean(u,Ce=>Ce.dimension);break;case Yt.Median:Pe=T.median(u,Ce=>Ce.dimension);break;case Yt.Custom:Pe=et(b.plotArea.xscaleposition);break}U.append("line").attr("x1",f(Pe)).attr("y1",0).attr("x2",f(Pe)).attr("y2",K).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}if(b.plotArea.yCoordinate!=Yt.None){let Pe;switch(b.plotArea.yCoordinate){case Yt.Mean:Pe=T.mean(u,Ce=>Ce.value);break;case Yt.Median:Pe=T.median(u,Ce=>Ce.value);break;case Yt.Custom:Pe=et(b.plotArea.yscaleposition);break}U.append("line").attr("x1",0).attr("y1",a(Pe)).attr("x2",J).attr("y2",a(Pe)).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}}catch(Pe){be(ua,"drawReferenceLines",Pe)}},ce=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment="Top"),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom="Start");let Pe=b.legends.legendPosition,Ce=b.legends.legendAlignment,Me=b.legends.legendAlignmentTopBottom;switch(Pe){case Be.none:break;case Be.right:Ve(x,g-O-30,D+5,O+25,H-D-10);break;case Be.top:Ve(x,5,D+5,g-10,30);break;case Be.left:Ve(x,5,D+5,O+25,H-D-10);break;case Be.bottom:Ve(x,5,H-35,g-10,30);break}}catch(Pe){be(ua,"drawColors",Pe)}},me=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment=Fa.top),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom=wa.start);let Pe=b.legends.legendPosition;if(L.length>0)switch(Pe){case Be.none:break;case Be.right:Ye(L,g-O-30,H/2+10,O+25,H-D-10);break;case Be.top:Ye(L,g/2+5,D+5,g-10,30);break;case Be.left:Ye(L,5,H/2+10,O+25,H-D-10);break;case Be.bottom:Ye(L,g/2+5,H-35,g-10,30);break}}catch(Pe){be(ua,"drawShapes",Pe)}},Ve=(Pe,Ce,Me,ve,xe)=>{try{let ye=b.legends.legendPosition,ee=b.legends.legendFontStyle,Y=V.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",Ce).attr("y",Me).attr("width",ve).attr("height",xe).style("user-select","none"),W=(ye==Be.top||ye==Be.bottom)&&L.length>0?"50%":"100%";var Fe=Y.append("xhtml:div").style("width",W).style("display","flex").style("height",ye==Be.top||ye==Be.bottom?xe-1+"px":"calc(50% - 5px)").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+r).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",ye==Be.top||ye==Be.bottom?b.legends.legendAlignmentTopBottom==wa.start?"flex-Start":b.legends.legendAlignmentTopBottom==wa.middle?"center":"flex-end":b.legends.legendAlignment==Fa.top?"flex-Start":b.legends.legendAlignment==Fa.middle?"center":"flex-end").style("flex-direction",ye==Be.top||ye==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Pe.forEach((I,v)=>{let F=Fe.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("width","fit-content").style("flex-wrap","nowrap").style("white-space","nowrap").style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).on("mousemove",function(R){b.legends.onHoverEffect&&(V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),V.selectAll('[colorId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(R){V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),V.selectAll('[colorId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(ye==Be.bottom||ye==Be.top)&&F.style("margin-right","16px").style("white-space","nowrap"),F.append("div").style("height","10px").style("width","10px").style("background",I.color).style("border-radius","1px");let z=b.legends.legendColorMode=="1"?I.color?I.color:De.black:b.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",z).attr("title",I.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",ee.includes(ne.italic)?ne.italic:"").style("text-decoration",ee.includes(ne.underline)?ne.underline:"").style("font-weight",ee.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(I.name)})}catch(ye){be(ua,"colorListWithScroll",ye)}},Ye=(Pe,Ce,Me,ve,xe)=>{try{let ye=b.legends.legendPosition,ee=b.legends.legendFontStyle,Y=V.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",Ce).attr("y",Me).attr("width",ve).attr("height",xe).style("user-select","none"),W=b.legends.legendPosition==Be.top||b.legends.legendPosition==Be.bottom?"calc(50% - 5px)":"calc(100%)";var Fe=Y.append("xhtml:div").style("width",W).style("display","flex").style("height",ye==Be.top||ye==Be.bottom?xe-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+r).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",ye==Be.top||ye==Be.bottom?b.legends.legendAlignmentTopBottom==wa.start?"flex-Start":b.legends.legendAlignmentTopBottom==wa.middle?"center":"flex-end":b.legends.legendAlignment==Fa.top?"flex-Start":b.legends.legendAlignment==Fa.middle?"center":"flex-end").style("flex-direction",ye==Be.top||ye==Be.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Pe.forEach((I,v)=>{let F=Fe.append("div").style("width","fit-content").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("mousemove",function(R){b.legends.onHoverEffect&&(V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),V.selectAll('[shapeId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(R){b.legends.onHoverEffect&&(V.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),V.selectAll('[shapeId="'+de(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(ye==Be.top||ye==Be.bottom)&&F.style("margin-right","16px").style("white-space","nowrap"),te(F,I.markerShape);let z=b.legends.legendColorMode=="1"?De.black:b.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",z).attr("title",I.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",ee.includes(ne.italic)?ne.italic:"").style("text-decoration",ee.includes(ne.underline)?ne.underline:"").style("font-weight",ee.includes(ne.bold)?ne.bold:"").style("white-space","nowrap").html(I.name)})}catch(ye){be(ua,"shapeListWithScroll",ye)}},te=(Pe,Ce)=>{try{const ve={none:T.symbolCircle,circle:T.symbolCircle,square:T.symbolSquare,triangle:T.symbolTriangle,cross:T.symbolCross,diamond:T.symbolDiamond,star:T.symbolStar,wye:T.symbolWye}[Ce?.toLowerCase()]||T.symbolCircle;Pe.append("svg").attr("width",14).attr("height",14).append("path").attr("d",T.symbol().type(ve).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(Me){be(ua,"shapesForScatterPlot",Me)}},de=(Pe="")=>{try{return Pe.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(Ce){be(ua,"getJQuerySelector",Ce)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:r,style:{width:"100%",height:"100%"}})})},Dr=({isDateType:t,formatOptions:e,data:r,isAdvancedAnalyticsWaterFall:o=!1,onElementClick:h,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=crypto.randomUUID?.();let x=0,L;const A=le.WaterfallChart,u=Te.useRef(),S=Te.useRef(h);S.current=h;const b=Te.useRef(n);b.current=n;const _=o??!1,g=_?[]:bt(r.ChartData,r.DimensionList),H=r.DimensionList,D=!1,j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q=[],Ae=[],ge,we=0;const fe=2;let ae={dimensionList:H,chartType:A,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{ke()}catch(ee){be("WaterfallChart","createWaterfallChart",ee)}},[e]);const ke=()=>{({formatOptions:e,svg:d,width:p,height:C}=kt(u,e)),ce(),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ae.yMinLeft,ae.yMaxLeft,ae.yMinRight,ae.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe}=Tt(p,C,ue,O,ae.yMaxLeft,e,ae.legendList,ae.dimensionList,ae.yMaxRight,j,K,t),Ce(V),vt(d,p,C,e),i=Ct(d,V),mt(i,e,c,q,w,A,s),Ve(),te(),Gt(i,e,c,N,m,w),Me(g,C,d,V,q),Mt(e,D,d,V,$,C,se,ae.chartType,N,q,w),St(w,e,c,D,d,V,X,N),Ut(d,j,V,e,c,w,q,pe,he),Ft(d,e,p,oe)},ce=()=>{if(_){let v=ye(r);v=v.filter(z=>z.up+z.down+z.base!=0),ae.dimensionList=v.map(z=>z.xKey),ae.legendList=ae.dimensionList,Ae=T.stack().keys(["base","dimensionTotal","up","down"])(v);const F=[];Ae.forEach(z=>z.forEach(R=>F.push(R[1]))),ae.yMaxLeft=T.max(F)??0,ae.yMinLeft=T.min(F)??0;return}g.forEach(v=>{v.data.forEach(F=>{})}),Q=JSON.parse(JSON.stringify(g)),e.plotArea.fitChart?ie=ae.dimensionList:ie=ae.dimensionList.slice(we,we+fe),e.plotArea.hideZeroValues&&(ae.hideZeroValues=!0);let ee=_?ye(r):xe(),Y=JSON.parse(JSON.stringify(ee));ee.forEach(v=>{if(!v.Dimension&&(v.Up<1e-9&&v.Up!==0||v.Down<1e-9&&v.Down!==0)){let F=Y.findIndex(z=>z.Legend===v.Legend);F!==-1&&Y.splice(F,1)}}),ee=Y,ee.forEach(v=>v.dimension?ae.legendList.push(v.dimension):ae.legendList.push(v.legend)),Ae=T.stack().keys(["base","dimensionTotal","up","down"])(ee);let W=[],I=[];Ae.forEach(v=>{v.key=="base"?v.opacity=0:v.opacity=1,v.forEach(F=>W.push(F)),!I.includes(v.dimension)&&v.dimensionTotal===0&&v.total===0&&I.push(v.dimension)}),ae.yMaxLeft=T.max(W,v=>v[1]),ae.yMinLeft=T.min(W,v=>v[1]),e.xAxisLabel.hideZeroValues&&(I.length>0&&I.forEach(v=>{ae.legendList=ae.legendList.filter(F=>F!==v)}),ae.dimensionList=ae.legendList),t?gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(v=>v):ae.dimensionList,me(ee)},me=ee=>{try{let Y=[],W=[],I=[];ee&&ee.forEach((F,z)=>{F.dimension&&(Y.push(F.dimension),W.push({dimension:F.dimension,chartDataIndex:z,selfIndex:W.length}))}),t?I=gt(e.xAxisLabel.xAxisNumberFormat,ae.dimensionList).map(F=>F):I=Y;let v=JSON.parse(JSON.stringify(ae.legendList));W.forEach((F,z)=>{v[F.chartDataIndex]=I[F.selfIndex]}),ae.legendList.forEach((F,z)=>{ae.formattedDimensionListMap.set(F,v[z])})}catch(Y){throw Y}},Ve=()=>{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U).yAxisLabelArray;ae.yMaxLeft=ee[ee.length-1],ae.yMinLeft=ee[0],y=T.scaleLinear().domain([ae.yMinLeft>=0?J!==void 0&&!Number.isNaN(J)?J:0:ae.yMinLeft<0?ae.yMinLeft*1.1:ae.yMinLeft*.9,ae.yMaxLeft<=0?0:U!==void 0&&!Number.isNaN(U)?U:ae.yMaxLeft*1.1]).range([w,0]),a=[0,q],Ye()},Ye=()=>{x=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(q/ae.legendList.length),f=T.scaleBand().domain(ae.legendList).range(a).padding(.4)},te=()=>{de();{let ee=st(U||ae.yMaxLeft,ae.yMinLeft,w,e,ae,J,U);m=T.axisLeft(y).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-q+0:0).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue).tickPadding(8).tickSizeOuter(0)}L=T.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,_?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},de=()=>{P=T.axisBottom(f).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.gridLinesVertical?-w:parseFloat(e.plotArea.ticksHeight)*(w/100)*(e.xAxisLabel.xAxisPosition=="1"?1:-1):0).tickSizeOuter(0).tickValues(Lt(ae.legendList,q))},Pe=ee=>{let Y;if(Ae.forEach((W,I)=>W.forEach(v=>v.key=W.key)),ge){let W=Q.map(I=>I.legend);Y=T.stack().keys(W)(ge),Y.forEach((I,v)=>{Y[v].color=Q[v].properties.color})}Y&&Y.forEach(W=>{W.forEach(I=>{I.Key=W.key})}),[0,1].forEach(W=>{if(W===1&&(Ae=Y),Ae){let I=i.selectAll(`.parentGroup-${W}`).data([null]);I=I.enter().append("g").attr("class",`parentGroup parentGroup-${W}`).merge(I);let v=I.selectAll(`.bar-group-${W}`).data(Ae);v=v.enter().append("g").attr("class",`bar-group-${W}`).attr("fill",M=>M.color?M.color:L(M.key)!==De.white?L(M.key):"none").attr("opacity",M=>M.opacity).merge(v);let z=v.selectAll("rect").data(M=>M,M=>M.key||M.Key);const R=e.animation.animationEnabled,E=z.enter().append("rect").attr("class","rect").attr("class",M=>M.key?M.key.replace(/ /g,"-"):M.Key.replace(/ /g,"-")).attr("x",M=>f(_?M.data.xKey:M.data.dimension||M.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${s}-clip)`).attr("height",0).attr("width",f.bandwidth()).attr("visibility",M=>W===0&&M.data.dimension&&ge?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(M,G)=>{const Z=_?Aa.base:Aa.dimensionTotal,B={markerShape:"square",markerColor:G.key===Z?e.plotArea.totalColor:G.key===Aa.down?e.plotArea.negativeColor:e.plotArea.positiveColor};ot([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():G.properties?.currentMeasure?G.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(G.key===Aa.up?"+":G.key===Aa.down?"-":"")+_e(G.key===Aa.dimensionTotal?G.data.dimensionTotal:G[1]-G[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(_?G.key!==Aa.base?G.data.xKey:Aa.total:G.Key?G.Key.includes("~$~")?G.Key.split("~$~")[1]:G.Key:G.data.legend?G.data.legend.includes("~$~")?G.data.legend.split("~$~")[1]:G.data.legend:Aa.total).trim()||""}],e,void 0,B,ht(l,String(ae.formattedDimensionListMap.get(_?G.data.xKey:G.data.dimension||G.data.legend)??(_?G.data.xKey:G.data.dimension||G.data.legend)??""),{...B,alias:G.properties?.alias??G.properties?.currentMeasure??String(G.Key??G.key??"")}))}).on("mouseout",()=>{rt()}).attr(Qe.SeriesId,M=>String(M.key??M.Key??"")).attr(Qe.DimValue,M=>String(_?M.data.xKey||"":M.data.dimension||M.data.legend||"")).on("click",At(b,S,(M,G)=>{const Z=String(G.key??G.Key??""),B=String(_?G.data.xKey||"":G.data.dimension||G.data.legend||"");return{seriesId:Z,dimValue:B,legendUniqueId:Z,seriesDisplayName:Z}}));if((R?E.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):E).attr("y",M=>M[1]?y(M[1]):0).attr("height",M=>M[1]?y(M[0])-y(M[1]):0),z.exit().remove(),z=E.merge(z),e.plotArea.plotAreaDataLabel=="2"&&W!=1){const M=v.selectAll("text").data(B=>B),G=M.enter().append("text").text(B=>_e(B[1]-B[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",B=>f(_?B.data.xKey:B.data.dimension||B.data.legend)+f.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",B=>B[1]-B[0]!==0&&y(B[1])?"visible":"hidden");(R?G.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):G).attr("y",B=>B[1]?y(B[1])-15:0),M.exit().remove()}}}),i.selectAll(".parentGroup").raise()},Ce=ee=>{q=p-ee.left-ee.right,w=C-ee.bottom-ee.top},Me=(ee,Y,W,I,v)=>{if(!e.plotArea.fitChart){const F=ee[0].data.length-fe,z=Y-20;ie=ae.dimensionList.slice(we,we+fe),Ye(),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((k,M)=>Q[M].data=k.data.filter(G=>ie.includes(G.dimension))),de(),W.append("rect").attr("x",I.left).attr("y",z).attr("width",v).attr("height",8).attr("fill","#ddd").attr("rx",4);const R=v*fe/ae.dimensionList.length,E=W.append("rect").attr("x",I.left).attr("y",z).attr("width",R).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",k=>{let M=Math.min(Math.max(k.x,I.left),I.left+v-R);E.attr("x",M),we=Math.round((M-I.left)/(v-R)*F),ie=ae.dimensionList.slice(we,we+fe),Ye(),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((G,Z)=>Q[Z].data=G.data.filter(B=>ie.includes(B.dimension))),de(),ve()}));W.on("wheel",k=>{k.preventDefault();const M=Math.abs(k.deltaX)>Math.abs(k.deltaY)?k.deltaX:k.deltaY;we+=M>0?1:-1,we=Math.max(0,Math.min(we,F));const G=I.left+(v-R)*we/F;E.attr("x",G),Ye(),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((Z,B)=>Q[B].data=Z.data.filter(Se=>ie.includes(Se.dimension))),de(),ve()})}ve()},ve=()=>{qt(i,ae,$,e,c,y,P,re,C,x,t,q,w,ae.legendList,f),Pe()},xe=()=>{try{if(g.length<1)return[];if(ae.dimensionList.length<2)return[];let ee=[],Y=[],W=[],I="";if(I.length>1){let E=I;g.forEach(k=>{E===k.properties.currentLegend?Y.push(k):W.push(k)})}Y.length>0&&(Q=Y);let v=0,F=0;for(let E=0;E<Q.length;++E)v=v+Q[E].data[0].value;let z="";for(let E=1;E<ie.length;++E){let k={};k.dimension=ie[E-1],k.total=v,k.base=0,k.dimensionTotal=v,k.up=0,k.down=0,ee.push(k);for(let M=0;M<Q.length;++M){let G={};for(let Z=0;Z<M;Z++)z=z+" ";F=Q[M].data[E].value-Q[M].data[E-1].value,F!==0&&(G.legend=z+Q[M].properties.legend,G.dimensionTotal=0,F<0?(G.base=v+F,G.down=-F,G.up=0,G.total=v-F):(G.base=v,G.down=0,G.up=F,G.total=v+F),v=v+F,ee.push(G))}}let R={};return R.dimension=ie[ie.length-1],R.dimensionTotal=v,R.base=0,R.total=v,R.up=0,R.down=0,ee.push(R),W.length>0&&(Q=W,ge=pt(ie,W,!1)),ee}catch(ee){throw ee}},Fe=ee=>ee==null||ee===""?0:Number(ee),ye=ee=>(ee[0]?.Column1==""?ee.filter(W=>W.Column1&&W.Column1!=="*"):o?ee.Data:ee).map(W=>({xKey:W.Column1||W.Dimension||W.Legend,base:Fe(W.Column3||W.Total),up:Fe(W.Column4||W.Up),down:Fe(W.Column5||W.Down),total:Fe(W.Column6||W.total),dimensionTotal:Fe(W.Column2||W.Base)}));return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:u,id:s,style:{width:"100%",height:"100%"}})})},Vr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,onElementClick:n,vfxPickModeActive:l,tooltipFormatter:s})=>{const x=crypto.randomUUID();let L=0;const A=le.TornadoChart,u=r.IsadvanceanalyticsChart??r.IsCalCSensitivity,S=Te.useRef(),b=Te.useRef(n);b.current=n;const _=Te.useRef(l);_.current=l;let g=bt(r.ChartData,r.DimensionList,!0);g=Zl(g,r,u);const H=r.DimensionList,D=!0,j=!1,K=!1;let J=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,U=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y,f,a,m,P,ie,Q,Ae,ge,we=[],fe=0,ae=2,ke=!1,ce={dimensionList:H,chartType:A,chartData:[],formatOptions:e,legendList:r.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{me()}catch(Y){be("Tornadochart","createTornadoChart",Y)}},[e]);const me=()=>{({formatOptions:e,svg:i,width:p,height:C}=kt(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ye(),{formatOptions:e}=Qt(e,g,r.DataTableData??[]),{maxNumberForPrimaryAxis:ue,maxNumberForSecondaryAxis:O}=Nt(e,ce.yMinLeft,ce.yMaxLeft,ce.yMinRight,ce.yMaxRight),{margin:V,yLabel:N,xLabel:$,yTitle:X,xTitle:se,dimensionHeightWidthArray:re,chartTitleHeight:oe,secondaryAxisTitleWidth:he,legendMargin:Le,secondaryYLabel:pe,visibleBars:ae,columnWidth:L,scrollbarVisible:ke}=Tt(p,C,ue,O,ce.yMaxLeft,e,u?ce.legendList.map(Y=>Y.alias.split(" - ")[0]):ce.legendList.map(Y=>Y.alias),ce.dimensionList,ce.yMaxRight,j,K,t,!0,ce),ve(V),vt(i,p,C,e),y=Ct(i,V),mt(y,e,d,q,w,A),te(),Ce(),Ya(e,y,$,w,q,Q),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ta(e.plotArea.fitChart,i,y,c,L,f,a,m,void 0,void 0,d,A,e,N,X,ce.dimensionList,q,P,ce.formattedDimensionListMap,x,V,w)),Mt(e,D,i,V,$,C,se,ce.chartType,N,q,w),St(w,e,d,D,i,V,X,N,q),Ut(i,j,V,e,d,w,q,pe,he),Ft(i,e,p,oe),Dt(C,i,re,oe,p,Le,e,Ve(g,ce.legendList,u,e),x,d,V,nt.rectangle),ye(g,C,p,i,V,q,ke,ae,ce,fe,!1,xe,D)},Ve=(Y,W,I,v)=>Y.map((F,z)=>{const R=W[z];if(!R)return{...F,properties:{}};let E=R.alias;I&&R.alias&&(E=R.alias.split(" - ")[0].trim());let k=R.color;return I&&E&&(E.includes("+ve")?k=v.plotArea.plotAreaCalculatedHigh:E.includes("-ve")&&(k=v.plotArea.plotAreaCalculatedLow)),{...F,properties:{...R,alias:E,color:k}}}).filter(F=>F.properties&&Object.keys(F.properties).length>0),Ye=()=>{let Y;if(u)ce.chartData=g,ce.yMaxLeft=Math.min(...g.map(I=>I.data[0].value)),ce.yMaxRight=Math.max(...g.map(I=>I.data[0].value));else{const I=g[0]?.properties?.measureUniqueId;let v=0,F=-1/0;Y=g.map((z,R)=>{const E=z.properties.measureUniqueId===I,k=z.data.map(G=>{const Z=E?-Math.abs(G.value):Math.abs(G.value);return{...G,value:Z}}),M=k.map(G=>G.value);return E?v=Math.min(v,Math.min(...M)):F=Math.max(F,Math.max(...M)),{...z,data:k}}),ce.chartData=Y,ce.yMaxLeft=v,ce.yMaxRight=F}const W=t?gt(e.xAxisLabel.xAxisNumberFormat,ce.dimensionList):ce.dimensionList;ce.dimensionList.forEach((I,v)=>{ce.formattedDimensionListMap.set(I,W[v])}),we=JSON.parse(JSON.stringify(u?g:Y)),g=we,ge=ce.dimensionList,e.plotArea.hideZeroValues&&(ce.hideZeroValues=!0)},te=()=>{let Y=ce.yMaxLeft,W=ce.yMaxRight,I=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,v,F=!1,z=!1;Y>W?(v=Y,F=!0):(v=W,z=!0);let R=e.annotation.annotationVisibility!="5"?Y/v!==1?Math.abs(Y/v)*100<10?3:0:Math.abs(W/v)*100<10?3:0:0,E=0,k=0;Y<0&&W>0?(E=Y*(1.2+(z?R:0)),k=W*(1.2+(F?R:0))):Y>=0&&W>=0?(E=0,k=W*(1.2+(F?R:0))):Y<=0&&W<=0?(E=Y*(1.2+(z?R:0)),k=0):(E=Y*1.2,k=W*1.2),E=Math.floor(E),k=Math.ceil(k),m=T.scaleLinear().domain([E,k]).range([I,q-I]),a=m,P=[0,q],de()},de=()=>{f=T.scalePoint().domain(ge).range([w,0]).padding(.5)},Pe=()=>{ie=T.axisLeft(f).tickSize(Pt(e,q-m(0),0)).tickSizeOuter(0).tickValues(Lt(ge,w)),Ae=T.axisRight(f).tickSize(Pt(e,m(0),0)).tickSizeOuter(0).tickValues(Lt(ge,q))},Ce=()=>{Q=T.axisBottom(m).tickFormat(Y=>_e(Y,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision,!0)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.ticksHeight=="100"?-w:-e.plotArea.ticksHeight*(w/100):0).tickValues(st(ce.yMaxRight,ce.yMaxLeft,w,e,ce,J,U,D,q).yAxisLabelArray).ticks(st(U||ce.yMaxLeft,ce.yMinLeft,w,e,ce,J,U,D,q).customTickValue??q/30).tickPadding(8).tickSizeOuter(0)},Me=()=>{y.selectAll(".parentGroup").remove();const Y=e.plotArea.plotAreaCalculatedHigh,W=e.plotArea.plotAreaCalculatedLow,I=y.append("g").attr("class","parentGroup"),v=e.animation.animationEnabled,F=I.selectAll("rect").data(we.flatMap(R=>R.data.map(E=>({...E,legendText:u?R.legend.split("ve) - ")[1]?.trim()??R.legend:ce.dimensionList[0]==le.TornadoDefaultEntry?pi.default:R.legend.split("-")[1]?.trim()??R.legend,properties:R.properties})))).enter().append("rect").attr("class","rect").attr("y",R=>(R.legendText?f(R.legendText):f(le.TornadoDefaultEntry))-L/2).attr("height",L).attr("x",a(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",R=>R.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",R=>`${R.properties.stackBorderWidth}px`).attr("hoverId",R=>((u?R.legend.split(" - ")[0]:R.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",R=>R.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?R.properties.stackBorderColor:"none").style("fill",R=>u?R.value>0?Y!==De.white?Y:"none":W!==De.white?W:"none":R.properties.color).on("mousemove",(R,E)=>{ot([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():r.IsCalCSensitivity?E.properties.currentMeasure.split("~$~")[1]:E.dimension},{key:"Legend",value:E.legendText},{key:"Value",value:_e(Math.abs(E.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,R,r.IsCalCSensitivity?E.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:E.properties,ht(s,String(ce.formattedDimensionListMap.get(E.legend)??E.legend??""),E.properties))}).on("mouseout",rt).attr(Qe.SeriesId,R=>String(R.properties?.legendUniqueId??"")).attr(Qe.DimValue,R=>String(R.legend??R.legendText??"")).on("click",At(_,b,(R,E)=>({seriesId:String(E.properties?.legendUniqueId??""),dimValue:String(E.legend??E.legendText??""),legendUniqueId:String(E.properties?.legendUniqueId??""),seriesDisplayName:String(E.properties?.alias||E.properties?.name||E.legendText||"")})));(v?F.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]):F).attr("x",R=>R.value>=0?a(0):a(R.value)).attr("width",R=>Math.abs(a(R.value)-a(0)))},ve=Y=>{q=p-Y.left-Y.right,w=C-Y.bottom-Y.top},xe=(Y,W,I)=>{we=W,ge=Y,ae=I,ee()};function Fe(Y){const W=new Map;return Y.forEach(I=>{let v=W.get(I.properties.legendUniqueId);if(v){let F=v.data??[];F.push(I.data[0]),W.set(I.properties.legendUniqueId,{...v,data:F})}else v={...I,data:[I.data[0]]},W.set(I.properties.legendUniqueId,v)}),W.size>0?Array.from(W.keys()).map(I=>W.get(I)):Y}function ye(Y,W,I,v,F,z,R,E,k,M,G,Z,B=!1){const Se=(ze,Ie,Oe,lt,ut)=>{try{if(ut&&(ze=M+ze),!k||!Array.isArray(k.dimensionList)||!Array.isArray(Y))return;ze=ze==null?0:Number(ze),Ie=Ie==null?0:Number(Ie),Oe=Oe==null?0:Number(Oe),M=Ba(Math.round(ze),0,Math.max(0,Ie)),E=typeof E=="number"?E:0;const tt=M,Re=tt+E;let He=k.dimensionList.slice(tt,Re);const it=He[0]==le.TornadoDefaultEntry;let Je=JSON.parse(JSON.stringify(Y||[]));Je=Je.filter(Ke=>it?!0:He.includes(Ke.legend.split(" - ")[1]));const Ze=F?.left??0,Ge=F?.top??0,Ee=Number(z)||0,Ne=Number(w)||0,Ue=Number(Oe)||0,xt=Ie===0?1:Ie;if(B){const Ke=Ge+(Ne-Ue)*(Ie===0?0:M)/xt;lt&&typeof lt.attr=="function"&&lt.attr("y",Ke)}else{const Ke=Ze+(Ee-Ue)*(Ie===0?0:M)/xt;lt&&typeof lt.attr=="function"&&lt.attr("x",Ke)}Z(He,Je,E)}catch(tt){typeof be=="function"&&be("ColumnChart","updateFromScrollPosition",tt)}};if(R){const ze=W-F.top-F.bottom,Ie=Math.max(0,H.length-E),Oe=W-8;v.append("rect").attr("id","scrollbarTrack").attr("x",B?I-8:F.left).attr("y",B?F.top:Oe).attr("width",B?8:z).attr("height",B?ze:8).attr("fill","#ccc");const lt=(B?ze:z)*E/k.dimensionList.length,ut=v.append("rect").attr("x",B?I-8:F.left).attr("y",B?F.top:Oe).attr("width",B?8:lt).attr("height",B?lt:8).attr("fill","#999").style("cursor",B?"ns-resize":"ew-resize");ut.call(T.drag().on("drag",tt=>{if(B){const He=(Ba(tt.y,F.top,F.top+ze-lt)-F.top)/(ze-lt)*(Ie||1);Se(He,Ie,lt,ut,!1),ut.attr("y",F.top+(ze-lt)*(Ie===0?0:M)/(Ie===0?1:Ie))}else{const He=(Ba(tt.x,F.left,F.left+z-lt)-F.left)/(z-lt)*(Ie||1);Se(He,Ie,lt,ut,!1),ut.attr("x",F.left+(z-lt)*(Ie===0?0:M)/(Ie===0?1:Ie))}})),v.on("wheel",tt=>{tt.preventDefault();const He=(Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?tt.deltaX:tt.deltaY)>0?1:-1;if(Se(He,Ie,lt,ut,!0),B){const it=F.top+(ze-lt)*(Ie===0?0:M)/(Ie===0?1:Ie);ut.attr("y",it)}else{const it=F.left+(z-lt)*(Ie===0?0:M)/(Ie===0?1:Ie);ut.attr("x",it)}})}else v.on("wheel",null);Se(0,0,0,null,!0)}const ee=()=>{de(),Pe(),Ua(e,y,$,w,q,ie,Ae,a,ce.yMaxLeft,ge,A,t,p,re,L,f),Me();const Y=Fe(we);Da(Y??[],f,a,null,V,dt,[],[],e,A,C,p,q,ge,w,x,i,h,f,L,o,u,D,u)};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:S,id:x,style:{width:"100%",height:"100%"}})})},Nr=({isDateType:t,formatOptions:e,data:r,isReportEditable:o,onDataLabelCoordinatesChange:h,addLocalFilterFromLib:n,tooltipFormatter:l})=>{const s=crypto.randomUUID();let x=0;const L=le.DotPlot,A=Te.useRef(),u=bt(r.ChartData,r.DimensionList),S=r.DimensionList,b=!0,_=!1;let g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,j,K,J,U,V,N,$,X,se,re,oe,he,Le,pe,ue,O,q,w,p,C,c,d,i,y=[],f=0,a=2,m=!1,P=[];const ie=!1;let Q={dimensionList:S,chartType:L,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Te.useEffect(()=>{try{Ae()}catch(Me){be("StackStackHorizontalBarchart","createDotPlot",Me)}},[e]);const Ae=()=>{({formatOptions:e,svg:O,width:pe,height:ue}=kt(A,e)),ge(),{maxNumberForPrimaryAxis:re,maxNumberForSecondaryAxis:oe}=Nt(e,Q.yMinLeft,Q.yMaxLeft,Q.yMinRight,Q.yMaxRight),{margin:D,yLabel:j,xLabel:K,yTitle:J,xTitle:U,dimensionHeightWidthArray:V,chartTitleHeight:N,secondaryAxisTitleWidth:$,legendMargin:X,secondaryYLabel:se,visibleBars:a,columnWidth:x,scrollbarVisible:m}=Tt(pe,ue,re,oe,Q.yMaxLeft,e,Q.legendList,Q.dimensionList,Q.yMaxRight,_,ie,t,b,Q),me(D),vt(O,pe,ue,e),q=Ct(O,D),mt(q,e,0,he,Le,L),we(),ae(),Ya(e,q,j,Le,he,c),Mt(e,b,O,D,K,ue,U,Q.chartType,j,he,Le),St(Le,e,0,b,O,D,J,j),Ft(O,e,pe,N),Dt(ue,O,V,N,pe,X,e,u,s,0,D,nt.rectangle,L,n),Bt(u,ue,pe,O,D,he,m,a,Q,f,!1,Ve,b)},ge=()=>{const Me=[],ve=[];let xe=[],Fe=-1/0,ye=1/0,ee=-1/0,Y=1/0;u.forEach(W=>{ve.push(W.properties.legendUniqueId),W.data.forEach(I=>{Me.push(I),Fe=Math.max(Fe,I.value),ye=Math.min(ye,I.value)})}),Q.chartData=Me,Q.legendList=ve,Q.yMaxLeft=Fe,Q.yMinLeft=ye>0?0:ye,Q.yMaxRight=ee,Q.yMinRight=Y,xe=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(W=>W):Q.dimensionList,xe=t?gt(e.xAxisLabel.xAxisNumberFormat,Q.dimensionList).map(W=>W):Q.dimensionList,Q.dimensionList.forEach((W,I)=>{Q.formattedDimensionListMap.set(W,xe[I]),Q.formattedDimensionListMap.set(W,xe[I])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=Q.dimensionList:i=Q.dimensionList.slice(f,f+a),e.plotArea.hideZeroValues&&(Q.hideZeroValues=!0)},we=()=>{let Me=st(H||Q.yMaxLeft,Q.yMinLeft,Le,e,Q,g,H,b,he).yAxisLabelArray;Q.yMaxLeft=Me[Me.length-1],Q.yMinLeft=Me[0],w=T.scaleLinear().domain([Q.yMinLeft>=0?g!==void 0&&!Number.isNaN(g)?g:0:Q.yMinLeft<0?Q.yMinLeft*1.1:Q.yMinLeft*.9,Q.yMaxLeft<=0?0:H!==void 0&&!Number.isNaN(H)?H:Q.yMaxLeft*1.1]).range([0,he]),C=[Le,0],fe()},fe=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,x]).paddingInner(Q.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),p=T.scalePoint().domain(i).range(C).padding(.5)},ae=()=>{ke();{let Me=st(H||Q.yMaxLeft,Q.yMinLeft,Le,e,Q,g,H,b,he);c=T.axisBottom(w).tickFormat(ve=>_e(ve,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-Le:0).tickValues(Me.autoLabelFlag?void 0:Me.yAxisLabelArray).ticks(Me.customTickValue).tickPadding(8).tickSizeOuter(0)}},ke=()=>{d=T.axisLeft(p).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*he*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(Lt(i,Le))},ce=Me=>{Me.forEach(ye=>{ye.data.forEach(ee=>{ee.markerShape=ye.properties.markerShape||"Circle",ee.markerSize=ye.properties.markerSize||6,ee.markerColor=ye.properties.markerColor||ye.properties.color,ee.alias=ye.properties.alias,ee.lineStyle=ye.properties.lineStyle,ee.lineWidth=ye.properties.lineWidth,ee.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const ve=T.group(Me.flatMap(ye=>ye.data.map(ee=>({...ee,color:ye.properties.color}))),ye=>ye.dimension),xe=q.selectAll(".cleveland-line-group").data(Array.from(ve),([ye])=>ye);xe.enter().append("g").attr("class","cleveland-line-group").append("line").merge(xe.select("line")).attr("y1",([ye])=>p(ye)).attr("y2",([ye])=>p(ye)).attr("x1",([,ye])=>w(Math.min(ye[0]?.value??0,ye[1]?.value??0))).attr("x2",([,ye])=>w(Math.max(ye[0]?.value??0,ye[1]?.value??0))).attr("stroke",ye=>ye[1][0].lineColor).attr("stroke-width",ye=>ye[1][0].lineStyle!=="None"?ye[1][0].lineWidth:0).attr("stroke-dasharray",ye=>{switch(ye[1][0].lineStyle){case yt.dotted:return"1,4";case yt.dashed:return ba;default:return""}}).attr("stroke-linecap",ye=>ye[1][0].lineStyle===yt.dotted?sa.round:""),xe.exit().remove(),Me.forEach(ye=>{let ee=q.selectAll(".parentGroup").data([ye],F=>F.properties.legendUniqueId);ee=ee.enter().append("g").attr("class","parentGroup").attr("hoverId",(ye.properties.alias||ye.properties.name||"Legend").replace(/\s+/g,"-")).merge(ee);let Y=ee.selectAll(".column-group").data(ye.data,F=>F.dimension),W=Y.enter().append("g").attr("class","column-group");const I=e.animation.animationEnabled,v=W.append("path").attr("class","cleveland-dot").attr("opacity",I?0:.9);v.merge(Y.select("path")).attr("d",F=>T.symbol().type(zi(F.markerShape)).size((F.markerSize||6)*70)()).attr("transform",F=>{const z=w(F.value),R=p(F.dimension);return`translate(${z},${R})`}).attr("fill",F=>ye.properties.color).attr("data-series-id",()=>ye.properties.legendUniqueId??ye.properties.alias).attr("data-dim-value",F=>String(F.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(F,z)=>{ot([{key:e.xAxisTitle.xAxisTitleText,value:Q.formattedDimensionListMap.get(z.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:_e(z.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:z.alias}],e,F,ye.properties,ht(l,String(z.dimension??""),{...ye.properties,formattedDimensionValue:String(Q.formattedDimensionListMap.get(z.dimension)??z.dimension??"")}))}).on("mouseout",()=>{T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll(".halo").remove(),rt()}),I&&v.transition().duration(e.animation.animationDuration).ease(Xe[e.animation.animationEffect]).attr("opacity",.9),Y.exit().remove()}),q.selectAll(".parentGroup").raise()},me=Me=>{he=pe-Me.left-Me.right,Le=ue-Me.bottom-Me.top},Ve=(Me,ve,xe)=>{y=ve,i=Me,a=xe,Ye()},Ye=()=>{fe(),ke(),Ua(e,q,K,Le,he,d,void 0,w,Q.yMaxLeft,i,L,t,pe,V,x,p),te(),ce(y),Da(y,p,w,void 0,D,dt,[],[],e,L,ue,pe,he,i,Le,s,O,h,p,x,o,!1,b),de()},te=()=>{let Me=pt(i,y,ie);P=T.stack().keys(Q.legendList).offset(T.stackOffsetDiverging)(Me),y.forEach((xe,Fe)=>xe.data.forEach((ye,ee)=>{ye[0]=P[Fe][ee][0],ye[1]=P[Fe][ee][1]}));let ve=e.annotation.annotationSetLabelColor;P.forEach((xe,Fe)=>xe.forEach(ye=>{ye.key=xe.key,xe.color=JSON.parse(JSON.stringify(u[Fe].properties.color)),ye.data.labelPosition=u[Fe].properties.dataLabelPosition,ye.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[Fe].properties.color)):u[Fe].properties.labelColor,ye.hideZero=JSON.parse(JSON.stringify(u[Fe].properties.hideZeroValues))}))},de=()=>{try{const Me=Number(e.connector?.connectorVisibility);if(!e.connector||Me===2)return;const ve=[],xe=[],Fe=[];let ye;const ee=[];if(Me===1)ye=1;else if(Me===3){const R=Number(e.connector.connectorFollow);R===1?ye=Number(e.connector.connectorStepSize):R===2&&((e.connector.connectorExclude||[]).forEach(E=>Fe.push(E)),ye=1)}const Y=[],W=[],I=[],v=e.connector?.connectorCustomRange||[];Fe.forEach(R=>{const E=R.split("-");E.length&&Y.push(E[0])});const z=(P?.[0]||[]).map((R,E)=>({Dimension:R.data.Dimension,Total:R.data.Total,CustomTotal:R.data.Total-(I[E]??0),Index:E}));if(ye!=null){for(let R=0;R<z.length;R++)(ye===1||R%ye===0&&ye!==1)&&ve.push(z[R]);for(let R=ye;R<z.length;R+=ye){const E=Math.min(R+ye,z.length);let k=-1/0;for(let M=R;M<E;M++)z[M].Total>k&&(k=z[M].Total);k!==-1/0&&ee.push(k)}for(let R=1;R<ve.length;R++)xe.push(ve[R])}else{const R=[];(v||[]).forEach(E=>{if(E?.from&&E?.to){const k=z.some(G=>G.Dimension===E.from),M=z.some(G=>G.Dimension===E.to);k&&M&&R.push({from:E.from,to:E.to})}}),R.forEach(E=>{const k=z.findIndex(G=>G.Dimension===E.from),M=z.findIndex(G=>G.Dimension===E.to);if(k>=0&&M>=0){const G=Math.min(k,M),Z=Math.max(k,M);ve.push(z[G]);let B=z[G]?.Total??-1/0;for(let Se=G;Se<=Z;Se++)z[Se].Total>B&&(B=z[Se].Total);B!==-1/0&&ee.push(B),xe.push(z[Z])}})}q.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==De.white?e.connector.connectorMarkerColor:"none"),Pe(ve,ee,xe,ye,Y),Ce(ve,ee,xe,ye,Y)}catch(Me){console.error(Me)}},Pe=(Me,ve,xe,Fe,ye)=>{try{q.append("g").selectAll("path").data(Me).enter().filter((ee,Y)=>Fe!=null?Y<Me.length-1:Y<Me.length).append("path").attr("d",(ee,Y)=>e.total.totalVisibility?`M ${w(ee.Total)+50},
260
- ${p(ee.Dimension)+p.bandwidth()/2-5}
261
- H ${60+Math.max(w(ve[Y]),w(xe[Y].Total),w(ee.Total))}
262
- V ${p(xe[Y].Dimension)+p.bandwidth()/2+5}
263
- H ${30+w(xe[Y].Total)}`:`M ${w(ee.Total)+30},
264
- ${p(ee.Dimension)+p.bandwidth()/2-5}
265
- H ${45+Math.max(w(ve[Y]),w(xe[Y].Total),w(ee.Total))}
266
- V ${p(xe[Y].Dimension)+p.bandwidth()/2+5}
267
- H ${10+w(xe[Y].Total)}
268
- `).style("stroke",e.connector.connectorLineColor!==De.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",ee=>ye.includes(ee.Dimension)||ee.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}},Ce=(Me,ve,xe,Fe,ye)=>{try{let ee=e.connector.connectorFontStyle,Y=e.connector.connectorNumberFormat,W=Le/30<i.length?Math.round(Le/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(Y=".2s"),q.append("g").selectAll("text1").data(Me).enter().filter((I,v)=>Fe!=null?v<Me.length-1:v<Me.length).append("text").attr("y",(I,v)=>Fe==null?p(xe[v].Dimension)/2+p(I.Dimension)/2+15:Fe==1?W<6&&p.bandwidth()>40?p(xe[v].Dimension)+p.bandwidth()/2+p.bandwidth()/2+13:p(xe[v].Dimension)+p.bandwidth()/2+p.bandwidth()/2+7:p(xe[v].Dimension)+p.bandwidth()/2+p.bandwidth()/2*Fe+12).attr("x",(I,v)=>e.total.totalVisibility?70+Math.max(w(ve[v]),w(xe[v].Total),w(I.Total)):50+Math.max(w(ve[v]),w(xe[v].Total),w(I.Total))).text((I,v)=>(I.CustomTotal==0&&xe[v].CustomTotal!=0&&(I.CustomTotal=1),ui(xe[v].Total,I.Total,parseInt(e.connector.connectorDecimalPrecision),Y,parseInt(I.Dimension),parseInt(xe[v].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==De.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",ee.includes("Italic")?"Italic":"").style("text-decoration",ee.includes("Underline")?"Underline":"").style("font-weight",ee.includes("Bold")?"Bold":"").style("visibility",I=>ye.includes(I.Dimension)||I.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ee){console.error(ee)}};return $e.jsx("div",{style:{width:"100%",height:"100%"},children:$e.jsx("svg",{className:"chartSVG",ref:A,id:s,style:{width:"100%",height:"100%"}})})},Kt=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function xa(t,e=1){const r=t.replace("#",""),o=parseInt(r.substring(0,2),16),h=parseInt(r.substring(2,4),16),n=parseInt(r.substring(4,6),16);return isNaN(o)||isNaN(h)||isNaN(n)?t:`rgba(${o},${h},${n},${e})`}function tl(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function pa(t,e,r,o=Kt){const{ChartData:h,DimensionList:n,LegendList:l}=t,s=n?.length?n:h[0]?.data?.map(L=>L.dimension)??[],x=Number(r.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?Ir(h,s,x,o,l):e==="scatter"?Er(h,o):e==="bubble"?Rr(h,o):Pr(h,s,e,r,x,o)}function Pr(t,e,r,o,h,n){const l=t.map((s,x)=>{const L=s.properties?.color??n[x%n.length],A=s.properties?.opacity??1,u=new Map;s.data?.forEach(H=>u.set(H.dimension,H.value));const S=e.map(H=>u.get(H)??0),b=s.Axis==="Secondary"||s.properties?.axis==="Secondary"?"y1":"y",_=Number(s.properties?.lineWidth??o.plotArea?.lineWidth??2);return r==="line"||r==="area"?{type:"line",label:s.properties.alias,data:S,borderColor:L,backgroundColor:r==="area"?xa(L,h*A):xa(L,.1),fill:r==="area",borderWidth:_,borderDash:tl(s.properties?.lineStyle),pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3,tension:Number(o.cjsOptions?.cjsTension??.4),yAxisID:b}:r==="radar"?{label:s.properties.alias,data:S,borderColor:L,backgroundColor:xa(L,h*A),fill:!0,borderWidth:_,pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3}:{type:"bar",label:s.properties.alias,data:S,backgroundColor:xa(L,h*A),borderColor:L,borderWidth:Number(s.properties?.stackBorderWidth??0),borderRadius:Number(o.cjsOptions?.cjsBorderRadius??o.plotArea?.cornerRadius??0),yAxisID:b}});return{labels:e,datasets:l}}function Ir(t,e,r,o,h){const l=(t.length?t:[]).map(s=>{const x=e.map(A=>s.data?.find(S=>S.dimension===A)?.value??0),L=e.map((A,u)=>{const S=h?.[u]?.color;return xa(S??o[u%o.length],r)});return{label:s.properties.alias,data:x,backgroundColor:L,borderColor:L.map(A=>A.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:l}}function Er(t,e){return{datasets:t.map((o,h)=>{const n=o.properties?.color??e[h%e.length],l=o.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||h,y:s.value??0}))??[];return{label:o.properties.alias,data:l,backgroundColor:xa(n,.7),borderColor:n,pointRadius:5}})}}function Rr(t,e){return{datasets:t.map((o,h)=>{const n=o.properties?.color??e[h%e.length],l=o.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||h,y:s.value??0,r:Number(s.markerSize??o.properties?.markerSize??8)}))??[];return{label:o.properties.alias,data:l,backgroundColor:xa(n,.6),borderColor:n}})}}function ti(t,e,r,o=Kt){const{ChartData:h,DimensionList:n}=t,l=n?.length?n:h[0]?.data?.map(A=>A.dimension)??[],s=new Map;l.forEach(A=>{const u=h.reduce((S,b)=>{const _=b.data?.find(g=>g.dimension===A);return S+Math.abs(_?.value??0)},0);s.set(A,u)});const x=Number(r.plotArea?.fillOpacity??.8),L=h.map((A,u)=>{const S=A.properties?.color??o[u%o.length],b=A.properties?.opacity??1,_=new Map;A.data?.forEach(D=>_.set(D.dimension,D.value));const g=l.map(D=>{const j=_.get(D)??0,K=s.get(D)??0;return K>0?parseFloat((j/K*100).toFixed(4)):0}),H=Number(A.properties?.lineWidth??r.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:A.properties.alias,data:g,borderColor:S,backgroundColor:e==="area"?xa(S,x*b):xa(S,.1),fill:e==="area",borderWidth:H,borderDash:tl(A.properties?.lineStyle),pointRadius:r.marker?.markerVisibility?Number(r.marker?.markerSize??4):3,tension:Number(r.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:A.properties.alias,data:g,backgroundColor:xa(S,x*b),borderColor:S,borderWidth:Number(A.properties?.stackBorderWidth??0),borderRadius:Number(r.cjsOptions?.cjsBorderRadius??r.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:l,datasets:L}}function Ra(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function ai(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function zr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function $r(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function al(t,e,r){const o=parseInt(r??"0",10);return e==="Thousands"?(t/1e3).toFixed(o)+"K":e==="Millions"?(t/1e6).toFixed(o)+"M":e==="Billions"?(t/1e9).toFixed(o)+"B":t.toFixed(o)}function Yr(t,e){return t.find(r=>r.alias==e)}function Zt(t,e,r=!1,o,h){const n=e==="pie"||e==="doughnut"||e==="polarArea",l=e==="horizontalBar";let s=0;const x=300,L=t.plotArea?.gridLinesColor??"#e0e0e0",A=t.legends?.legendFontColor??"#333333",u={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:$r(t.legends?.legendPosition),labels:{color:A,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??qe,style:Ra(t.legends?.legendFontStyle),weight:ai(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,b,_){if(o){const g=new Date().getTime();if(g-s<x){const D=Yr(h,b.text);D&&o(D),s=0}else s=g}}},tooltip:{enabled:t.toolTip?.toolTipVisibility!==!1,backgroundColor:t.toolTip?.toolTipTheme==="Dark"?"#222222":"#ffffff",titleColor:t.toolTip?.toolTipTheme==="Dark"?"#ffffff":"#333333",bodyColor:t.toolTip?.toolTipTheme==="Dark"?"#cccccc":"#555555",borderColor:L,borderWidth:1,padding:10,callbacks:{label(S){const b=typeof S.raw=="number"?S.raw:S.raw?.y??0,_=_e(b,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${_}`}}},datalabels:Ur(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:zr(t.animation?.animationEffect)}:!1};if(!n){const S={display:!0,title:{display:t.xAxisTitle?.xAxisTitleVisibility!==!1,text:t.xAxisTitle?.xAxisTitleText??"Dimension",color:t.xAxisTitle?.xAxisTitleColor??"#000000",font:{size:parseInt(t.xAxisTitle?.xAxisTitleFontSize??"11",10),family:t.xAxisTitle?.xAxisTitleFontFamily??qe,style:Ra(t.xAxisTitle?.xAxisTitleFontStyle)}},ticks:{display:t.xAxisLabel?.xAxisLabelVisibility!==!1,color:t.xAxisLabel?.xAxisLabelColor??"#000000",font:{size:parseInt(t.xAxisLabel?.xAxisLabelFontSize??"11",10),family:t.xAxisLabel?.xAxisLabelFontFamily??qe,style:Ra(t.xAxisLabel?.xAxisLabelFontStyle),weight:ai(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:L},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")}},b={display:!0,position:"left",title:{display:t.yAxisTitle?.yAxisTitleVisibility!==!1,text:t.yAxisTitle?.yAxisTitleText??"Measure",color:t.yAxisTitle?.yAxisTitleColor??"#000000",font:{size:parseInt(t.yAxisTitle?.yAxisTitleFontSize??"11",10),family:t.yAxisTitle?.yAxisTitleFontFamily??qe,style:Ra(t.yAxisTitle?.yAxisTitleFontStyle)}},ticks:{display:t.yAxisLabel?.yAxisLabelVisibility!==!1,color:t.yAxisLabel?.yAxisLabelColor??"#000000",font:{size:parseInt(t.yAxisLabel?.yAxisLabelFontSize??"11",10),family:t.yAxisLabel?.yAxisLabelFontFamily??qe,style:Ra(t.yAxisLabel?.yAxisLabelFontStyle),weight:ai(t.yAxisLabel?.yAxisLabelFontStyle)},callback(g){return al(g,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:L},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};l?(u.scales={x:{...b,position:"bottom"},y:{...S,position:"left",reverse:!0}},u.scales.x.title&&(u.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),u.scales.y.title&&(u.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):u.scales={x:S,y:b},r&&(u.scales.y1={display:!0,position:"right",title:{display:t.secondaryYAxisTitle?.secondaryYAxisTitleVisibility!==!1,text:t.secondaryYAxisTitle?.secondaryYAxisTitleText??"",color:t.secondaryYAxisTitle?.secondaryYAxisTitleColor??"#000000",font:{size:parseInt(t.secondaryYAxisTitle?.secondaryYAxisTitleFontSize??"11",10),family:t.secondaryYAxisTitle?.secondaryYAxisTitleFontFamily??qe}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??qe,style:Ra(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:ai(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(g){return al(g,t.secondaryYAxisLabel?.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel?.secondaryYAxisLabelDecimalPrecision)}},grid:{drawOnChartArea:!1},border:{color:t.secondaryYAxisLabel?.secondaryYAxisColor??"#000000",width:parseFloat(t.secondaryYAxisLabel?.secondaryYAxisWidth??"0.5")}}),e.toLowerCase().includes("stack")&&(u.scales?.x&&(u.scales.x.stacked=!0),u.scales?.y&&(u.scales.y.stacked=!0))}return u}function il(t){if(typeof t=="number")return t;if(t!==null&&typeof t=="object"){if(typeof t.y=="number")return t.y;if(typeof t.x=="number")return t.x}return parseFloat(t)||0}function Ur(t,e="bar"){const r=t.annotation,o=e==="pie"||e==="doughnut"||e==="polarArea",h=e==="horizontalBar",n=r?.annotationVisibility??"5";if(n==="5"||!n)return{display:!1};const l=r?.annotationPosition??"1",s=r?.annotationHideZeroValues!==!1,x=parseInt(r?.annotationFontSize??"9",10)||9,L=r?.annotationFontFamily??qe,A=Ra(r?.annotationFontStyle),u=ai(r?.annotationFontStyle),S=r?.annotationColor??"#000000",b=r?.annotationSetLabelColor==="2",_=r?.annotationDecimalPrecision??"2",g=r?.annotationNumberFormat??",",H=r?.annotationDisplayUnits??"None";function D(V){const N=V.dataset?.data?.length??0,$=V.dataIndex??0;switch(n){case"1":return!0;case"2":return $===0;case"3":return $===N-1;case"4":return $===0||$===N-1;default:return!1}}function j(V){const N=V.dataset?.data?.[V.dataIndex];return il(N)}function K(V){if(o)return l==="2"?"center":"end";const N=j(V);switch(l){case"2":return"center";case"3":return N<0?"end":"start";case"1":return N>0?"end":"start";case"4":default:return N>0?"end":"start"}}function J(V){if(o)return l==="2"?"center":"end";const N=j(V);if(h)switch(l){case"2":return"center";case"3":return"right";case"1":case"4":default:return N<0?"left":"right"}switch(l){case"2":return"center";case"3":return N>0?"top":"bottom";case"1":case"4":default:return N<0?"bottom":"top"}}function U(V,N){const $=il(V);if(s&&$===0)return null;const X=_e($,H,g,_);if(o){const se=N?.chart?.data?.labels?.[N.dataIndex]??"";return se?`${se}
269
- ${X}`:X}return X}return{display:D,anchor:K,align:J,offset:o?l==="2"?0:8:l==="2"?0:4,color:b?V=>{const N=V.dataset?.backgroundColor,$=V.dataset?.borderColor,X=Array.isArray(N)?N[V.dataIndex]:N;return typeof X=="string"&&X?X:typeof $=="string"&&$?$:S}:S,font:{size:x,family:L,style:A,weight:u},formatter:U,clip:!1}}ft.Chart.register(ft.BarController,ft.LineController,ft.PieController,ft.DoughnutController,ft.ScatterController,ft.BubbleController,ft.RadarController,ft.PolarAreaController,ft.CategoryScale,ft.LinearScale,ft.RadialLinearScale,ft.PointElement,ft.BarElement,ft.LineElement,ft.ArcElement,ft.Title,ft.Tooltip,ft.Legend,ft.Filler,xl);const Xt=({chartType:t,data:e,options:r,formatOptions:o,clientWidth:h,clientHeight:n,className:l,isChartStacked:s})=>{const x=Te.useRef(null),L=Te.useRef(null),A=Te.useRef(!1);Te.useEffect(()=>{if(x.current)return L.current?.destroy(),L.current=new ft.Chart(x.current,{type:t,data:e,options:r}),A.current=!0,()=>{L.current?.destroy(),L.current=null}},[t,s]),Te.useEffect(()=>{if(A.current){A.current=!1;return}const j=L.current;j&&(j.data=e,j.options=r,j.update())},[e,r]);const u=o.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(o.chartTitle?.chartTitleFontStyle)?o.chartTitle.chartTitleFontStyle:[],b=o.chartTitle?.chartTitleColor&&o.chartTitle.chartTitleColor!=="#ffffff"&&o.chartTitle.chartTitleColor!=="#FFFFFF00"?o.chartTitle.chartTitleColor:"rgba(119,119,119)",_=o.chartTitle?.chartTitleFontSize?`${o.chartTitle.chartTitleFontSize}px`:"16px",g=o.chartTitle?.dynamicTitleText||o.chartTitle?.chartTitleText||"",H=o.chartTitle?.chartTitleHTML||g,D=o.chartTitle?.chartTitleVisibility!==!1;return $e.jsxs("div",{className:l,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[D&&g&&$e.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:o.chartTitle?.chartTitleText,style:{color:b,fontSize:_,fontFamily:o.chartTitle?.chartTitleFontFamily,fontStyle:S.includes("Italic")?"italic":"normal",fontWeight:S.includes("Bold")?"bold":"normal",textDecoration:S.includes("Underline")?"underline":"none",whiteSpace:"pre",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"1.3em",userSelect:"none",padding:"2px 4px",flexShrink:0},dangerouslySetInnerHTML:{__html:H}}),$e.jsx("div",{style:{flex:1,minHeight:0},children:$e.jsx("canvas",{ref:x,style:{width:"100%",height:"100%"}})})]})},ll=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"bar",x,l,s);return h&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"bar",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Br=t=>$e.jsx(ll,{...t,isChartStacked:!0}),rl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n=Kt,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"bar",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"horizontalBar",x,l,s);return u.indexAxis="y",h&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"bar",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Wr=t=>$e.jsx(rl,{...t,isChartStacked:!0}),nl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n=Kt,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"line",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"line",x,l,s);return h&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"line",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Hr=t=>$e.jsx(nl,{...t,isChartStacked:!0}),sl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,isChartStacked:h,colorBank:n,addLocalFilterFromLib:l})=>{const s=Te.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),x=Te.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),L=Te.useMemo(()=>pa(t,"area",e,n),[t,e,n]),A=Te.useMemo(()=>{const u=Zt(e,"area",x,l,s);return h&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,x,h]);return $e.jsx(Xt,{chartType:"line",data:L,options:A,formatOptions:e,clientWidth:r,clientHeight:o})},Gr=t=>$e.jsx(sl,{...t,isChartStacked:!0}),_r=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"pie",e,h),[t,e,h]),x=Te.useMemo(()=>Zt(e,"pie",!1,n,l),[e]);return $e.jsx(Xt,{chartType:"pie",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},jr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"doughnut",e,h),[t,e,h]),x=Te.useMemo(()=>{const L=Zt(e,"doughnut",!1,n,l),A=e.plotArea?.innerRadius;return A!=null&&(L.cutout=`${A}%`),L},[e]);return $e.jsx(Xt,{chartType:"doughnut",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Jr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt})=>{const n=Te.useMemo(()=>pa(t,"scatter",e,h),[t,e,h]),l=Te.useMemo(()=>Zt(e,"scatter",!1),[e]);return $e.jsx(Xt,{chartType:"scatter",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:o})},Zr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Te.useMemo(()=>pa(t,"bubble",e,h),[t,e,h]),x=Te.useMemo(()=>Zt(e,"bubble",!1,n,l),[e]);return $e.jsx(Xt,{chartType:"bubble",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Xr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt})=>{const n=Te.useMemo(()=>pa(t,"radar",e,h),[t,e,h]),l=Te.useMemo(()=>{const s=Zt(e,"radar",!1);return delete s.scales,s.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0"},ticks:{color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe}}}},s},[e]);return $e.jsx(Xt,{chartType:"radar",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:o})},qr=({data:t,formatOptions:e,clientWidth:r,clientHeight:o,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.LegendList??[],[t]),s=Te.useMemo(()=>pa(t,"polarArea",e,h),[t,e,h]),x=Te.useMemo(()=>{const L=Zt(e,"polarArea",!1,n,l);delete L.scales;const A=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(A)?A.includes("Italic")||A.includes("italic"):!1;return L.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0",display:e.plotArea?.gridLinesVisibility!==!1},ticks:{display:e.xAxisLabel?.xAxisLabelVisibility!==!1,color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??qe,style:u?"italic":"normal"}}}},L},[e]);return $e.jsx(Xt,{chartType:"polarArea",data:s,options:x,formatOptions:e,clientWidth:r,clientHeight:o})},Kr=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"bar",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"bar",!1,n,l);return A.scales??={},A.scales.x??={},A.scales.y??={},A.scales.x.stacked=!0,A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"bar",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})},Qr=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"horizontalBar",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"horizontalBar",!1,n,l);return A.indexAxis="y",A.scales??={},A.scales.x??={},A.scales.y??={},A.scales.x.stacked=!0,A.scales.y.stacked=!0,A.scales.x.min=x?-100:0,A.scales.x.max=100,A.scales.x.ticks={...A.scales.x.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"bar",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})},Or=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"line",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"line",!1,n,l);return A.scales??={},A.scales.y??={},A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"line",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})},en=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:o=0,colorBank:h=Kt,addLocalFilterFromLib:n})=>{const l=Te.useMemo(()=>t.ChartData?.map(A=>A.properties),[t]),s=Te.useMemo(()=>ti(t,"area",e,h),[t,e,h]),x=Te.useMemo(()=>s.datasets.some(A=>A.data.some(u=>u<0)),[s]),L=Te.useMemo(()=>{const A=Zt(e,"area",!1,n,l);return A.scales??={},A.scales.y??={},A.scales.y.stacked=!0,A.scales.y.min=x?-100:0,A.scales.y.max=100,A.scales.y.ticks={...A.scales.y.ticks,callback:u=>`${u}%`},A},[e,x]);return $e.jsx(Xt,{chartType:"line",data:s,options:L,formatOptions:e,clientWidth:r,clientHeight:o})};We.AreaChart=dr,We.BubbleChart=Fr,We.CJSAreaChart=sl,We.CJSBubbleChart=Zr,We.CJSColumnChart=ll,We.CJSDonutChart=jr,We.CJSHorizontalBarChart=rl,We.CJSLineChart=nl,We.CJSNormalizedStackAreaChart=en,We.CJSNormalizedStackColumnChart=Kr,We.CJSNormalizedStackHorizontalBarChart=Qr,We.CJSNormalizedStackLineChart=Or,We.CJSPieChart=_r,We.CJSPolarAreaChart=qr,We.CJSRadarChart=Xr,We.CJSScatterChart=Jr,We.CJSStackAreaChart=Gr,We.CJSStackColumnChart=Br,We.CJSStackHorizontalBarChart=Wr,We.CJSStackLineChart=Hr,We.CJS_DEFAULT_COLORS=Kt,We.ChartJSWrapper=Xt,We.ColumnChart=Xl,We.ColumnHistogramChart=tr,We.CustomColumnChart=ql,We.DonutChart=pr,We.DotPlot=Nr,We.HorizontalBarChart=rr,We.HorizontalHistogramChart=cr,We.LayeredColumnChart=Kl,We.LayeredHorizontalBarChart=or,We.LineChart=ar,We.Maps=Mr,We.NormalizedStackAreaChart=ur,We.NormalizedStackColumnChart=Ol,We.NormalizedStackHorizontalBarChart=sr,We.NormalizedStackLineChart=lr,We.OrganizationChart=Sr,We.PieChart=xr,We.PieofPie=gr,We.ProgressChart=Lr,We.PyramidChart=Ar,We.RadialBarChart=fr,We.SankeyChart=kr,We.ScatterChart=wr,We.Speedometer=mr,We.StackAreaChart=yr,We.StackColumnChart=Ql,We.StackHorizontalBarChart=nr,We.StackLineChart=ir,We.TornadoChart=Vr,We.Treemap=br,We.VennChart=vr,We.WaterfallChart=Dr,We.WordCloud=Tr,We.hexToRgba=xa,We.mapFormatOptionsToChartJS=Zt,We.transformToChartJSData=pa,We.transformToNormalizedChartJSData=ti,Object.defineProperty(We,Symbol.toStringTag,{value:"Module"})}));
259
+ </div>`}catch(N){return Ae(da,"drawOrganizationChart.buttonContent",N),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,m)=>20).duration(0).setActiveNodeCentered(!1).data(o).compact(!1).expandAll().fit(!1).render()}catch(d){Ae(da,"drawOrganizationChart",d)}},M=o=>{try{let d;if(o.data.styleObject)return s.nodes.percentageVisibility?d=o.data.styleObject.nodeHeight*10+10:d=o.data.styleObject.nodeHeight*10,d}catch(d){Ae(da,"calculateNodeHeight",d)}},h=(o,d)=>{try{let i={};d?i=o.data:i=o;let y,T;if(s.nodes.nodesLabelVisibility?T=50:T=20,i.styleObject)return s.nodes.nodesLabelOverflow?i.id==0?y=i.styleObject.nodeWidth*10+50:y=i.styleObject.nodeWidth*10:y=T+k(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,y}catch(i){Ae(da,"calculateNodeWidth",i)}},k=o=>{try{let d=o.split("-");return d[d.length-1]}catch(d){Ae(da,"getLabelText",d)}};return Ge.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[Ge.jsx("svg",{id:x,className:"chartSVG",style:{width:"100%",height:"100%"},ref:n}),Ge.jsx("div",{id:`floating-div${x}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:Ge.jsx("svg",{id:`floating-${x}`,className:"chartSVG",ref:l})})]})},Ir=({data:t,formatOptions:e,chartId:r,addLocalFilterFromLib:c,onElementClick:x,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=Me.useRef(x);s.current=x;const p=Me.useRef(n);p.current=n;const f=new Map((t.ChartData??[]).map((ye,fe)=>[ye.legend,fe]));let L=t.LegendList;const u=Me.useRef();let S,b=[0,0];const _=se.BubbleChart;let A,R,g=40,B=jt,U,W,P,D,V=[],$=[],Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a;Me.useEffect(()=>{m()},[e,t,r]);const m=()=>{({chartFormatOptions:S,svg:D,width:A,height:R}=qt(u,e)),b=Ua(S,L??[],"alias"),t=De(t),K(),{longestMeasure:o,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=Qi(S,ne,ae),{longestDimension:G,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=Oi(S,Z,ce),{margins:B,yLabel:ue,xLabel:ge,yTitle:be,xTitle:pe,chartTitleHeight:g,legendMargin:Q,innerHeight:U,innerWidth:W}=Ki(A,R,o,S,G,b),Xt(u,A,R,S),P=oa(D,B),vt(P,e,0,W,U,_),Zt(u,g,A,S),me(),Le(),ze(),el(e,!1,D,B,ge,R,pe,"Bubble",ue,W,U),tl(U,e,0,!1,D,B,be,ue),Se(),ie(),N(),nl(D,S.legends.legendPosition,S,R,A,B,U,pe,ge,t.length)},N=()=>{try{let ye=5,fe=30,$e={minimumValue:ne,maximumValue:ae};const Ue=P.append("g").attr("class","circles").attr("class","parentGroup"),Ye=S.animation.animationEnabled,Pe=Ue.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",Ee=>Ee.legendName.replace(/ /g,"-")).attr("fill",Ee=>Ee.legendColor!==Re.white?Ee.legendColor:"none").append("path").attr("class","path").attr("id",function(Ee,we){v.select(this).attr("d",v.symbol().type(v.symbolCircle).size(re(ye,fe,$e,Ee.measure,10)*rt(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(Ee){return`translate(${T(Ee.dimension)}, ${a(Ee.measure)})`}).attr(lt.SeriesId,Ee=>`${f.get(Ee.legendName)}_${Ee.legendName}`).attr(lt.DimValue,Ee=>String(Ee.dimension)).attr("opacity",Ye?0:S.plotArea.fillOpacity).style("visibility",(Ee,we)=>Ee.dimension[0]===0||Ee.measure===0&&S.plotArea.hideZeroValues||Ee.dimension<k||Ee.dimension>h||Ee.measure<y||Ee.measure>i?"hidden":"visible").on("click",Tt(p,s,(Ee,we)=>({seriesId:`${f.get(we.legendName)}_${we.legendName}`,dimValue:String(we.dimension),legendUniqueId:`${f.get(we.legendName)}_${we.legendName}`,seriesDisplayName:we.legendName}))).on("mousemove",(Ee,we)=>{yt([{key:S.xAxisTitle.xAxisTitleText,value:qe(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(we.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:qe(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(we.measure)},{key:"Legend",value:we.legendName}],S,Ee,{alias:we.legendName},gt(l,String(we.dimension),{alias:we.legendName}))}).on("mouseout",()=>{ot()});Ye&&Pe.transition().duration(S.animation.animationDuration).ease(et[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(ye){Ae("BubbleChart","initCircles",ye)}};function re(ye,fe,$e,Ue,Ye){try{if(Ue==null)return Ye;var Pe=$e.minimumValue,Ee=$e.maximumValue,we=fe*fe*2*Math.PI,Ce=ye*ye*2*Math.PI,ve=Ye;if(Pe==Ee)ve=fe;else{var F=Ue,le=(F-Pe)/(Ee-Pe)*(we-Ce)+Ce;le<Ce&&(le=Ce),ve=Math.sqrt(le/(Math.PI*2))}return ve}catch(he){return Ae("BubbleChart","getBubbleSize",he),Ye}}const K=()=>{try{V=[],$=[],ne=void 0,ae=void 0,Z=void 0,ce=void 0,t.forEach(ye=>{ye.measureName&&(V.push(ye.measure),(ye.measure<ne||ne===void 0)&&(ne=ye.measure),(ye.measure>ae||ae===void 0)&&(ae=ye.measure)),ye.dimensionName&&($.push(ye.dimension),(ye.dimension<Z||Z===void 0)&&(Z=ye.dimension),(ye.dimension>ce||ce===void 0)&&(ce=ye.dimension))})}catch(ye){Ae("BubbleChart","iterateOverChartData",ye)}},me=()=>{try{let ye=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):Z>0?0:Z*1.1,fe=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):ce*1.1,$e=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):ne>0?0:ne*1.1,Ue=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):ae*1.1;T=v.scaleLinear().domain([ye,fe]).range([0,W]),a=v.scaleLinear().domain([$e,Ue]).range([U,0])}catch(ye){Ae("BubbleChart","initScale",ye)}},Le=()=>{try{let{xAxisLabelArray:ye,customTickValue:fe,autoLabelFlag:$e}=Li(ce,Z,W,e,k,h,W,!1);const Ue=v.axisBottom(T).tickFormat(qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(sa(e,U,0,!0)).tickValues(ye.length>0?ye:null).ticks(fe).tickPadding(8).tickSizeOuter(0);ll(P,S,0,ge,Ue,U,W,B,a)}catch(ye){Ae("BubbleChart","drawXAxis",ye)}},ze=()=>{try{let{yAxisLabelArray:ye,customTickValue:fe}=al(ae,ne,U,e,y,i);const $e=v.axisLeft(a).tickFormat(qe(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(Rt(e,W)).tickValues(ye.length>0?ye:null).ticks(fe).tickPadding(8).tickSizeOuter(0);il(P,S,0,ue,$e,U)}catch(ye){Ae("BubbleChart","drawYAxis",ye)}},Se=()=>{try{if(S.plotArea.xCoordinate!=Wt.None){let ye;switch(S.plotArea.xCoordinate){case Wt.Mean:ye=v.mean(t,fe=>fe.dimension);break;case Wt.Median:ye=v.median(t,fe=>fe.dimension);break;case Wt.Custom:ye=rt(S.plotArea.xscaleposition);break}P.append("line").attr("x1",T(ye)).attr("y1",0).attr("x2",T(ye)).attr("y2",U).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Wt.None){let ye;switch(S.plotArea.yCoordinate){case Wt.Mean:ye=v.mean(t,fe=>fe.measure);break;case Wt.Median:ye=v.median(t,fe=>fe.measure);break;case Wt.Custom:ye=rt(S.plotArea.yscaleposition);break}P.append("line").attr("x1",0).attr("y1",a(ye)).attr("x2",W).attr("y2",a(ye)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(ye){Ae("BubbleChart","drawReferenceLines",ye)}},ie=()=>{try{let ye=L?.map(fe=>{let $e={...fe,legendFontStyle:fe.fontStyle,fontSize:fe.fontSize+"px",legendFontFamily:fe.fontFamily};return{legend:fe.name,properties:$e,data:{}}});Ya(S,D,ye||[],A,R,b[0],g,r,B,ct.circle,!1,c)}catch(ye){Ae("BubbleChart","initLegendList",ye)}},De=ye=>{try{if(!ye||!ye.ChartData||!ye.ChartData[0])return[];const fe=[];return ye.ChartData.forEach(Ue=>{Ue.data.forEach(Ye=>{fe.push({dimension:parseFloat(Ye.dimension),dimensionName:Ue.legend??"Dimension",measure:Ye.value,measureName:Ue.legend??"Measure",legendName:Ue.legend,legendColor:Ue.properties?.color??Re.black,tooltip:""})})}),fe}catch(fe){return console.error("BubbleChart - Data conversion failed",fe),[]}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:r,style:{width:"100%",height:"100%"}})})},ba="ScatterChart.tsx",Er=({data:t,formatOptions:e,chartId:r,onElementClick:c,vfxPickModeActive:x,tooltipFormatter:n})=>{const l=Me.useRef(c);l.current=c;const s=Me.useRef(x);s.current=x;const p=t.ColorElements??[],f=t.ShapeElements??[],L=new Map(p.map((Ee,we)=>[Ee.name,we]));let u=[];const S=Me.useRef();let b,_=[0,0],A,R,g=40,B=jt,U,W,P,D,V=Number.POSITIVE_INFINITY,$=Number.NEGATIVE_INFINITY,Z=Number.POSITIVE_INFINITY,ce=Number.NEGATIVE_INFINITY,ne=Number.POSITIVE_INFINITY,ae=Number.NEGATIVE_INFINITY,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N=new Map,re=new Map;Me.useEffect(()=>{K()},[e,t,r]);const K=()=>{({chartFormatOptions:b,svg:D,width:A,height:R}=qt(S,e));let Ee=[...f,...p];_=Ua(b,Ee,"alias"),Le(),{longestMeasure:o,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=Qi(b,Z,ce),{longestDimension:G,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=Oi(b,V,$),{margins:B,yLabel:ue,xLabel:ge,yTitle:be,xTitle:pe,chartTitleHeight:g,legendMargin:Q,innerHeight:U,innerWidth:W}=Ki(A,R,o,b,G,_),Xt(S,A,R,b),P=oa(D,B),vt(P,e,0,W,U,"Scatter",r),Zt(S,g,A,b),ze(),Se(),ie(),el(e,!1,D,B,ge,R,pe,"Scatter",ue,W,U),tl(U,e,0,!1,D,B,be,ue),De(),me(),ye(),fe(),nl(D,b.legends.legendPosition,b,R,A,B,U,pe,ge,u.length)},me=()=>{try{let Ee=function(F){return F=="Square"?v.symbolSquare:F=="Circle"?v.symbolCircle:F=="Cross"?v.symbolCross:F=="Triangle"?v.symbolTriangle:F=="Star"?v.symbolStar:F=="Diamond"?v.symbolDiamond:F=="Wye"?v.symbolWye:v.symbolCircle};const we=P.append("g").attr("class","circles").attr("class","parentGroup"),Ce=b.animation.animationEnabled,ve=we.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",F=>F.color).attr("colorId",F=>F.colorName.replace(/ /g,"-")).attr("shapeId",F=>F.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(F,le){v.select(this).attr("d",v.symbol().type(Ee(F.shape)).size((F.sizeValue?m(F.sizeValue):10)*2*rt(b.plotArea.scatterSizeIndex)))}).attr("transform",function(F){return`translate(${T(F.dimension)}, ${a(F.measure)})`}).attr(lt.SeriesId,F=>`${L.get(F.colorName)}_${F.colorName}`).attr(lt.DimValue,F=>String(F.dimension)).attr("opacity",Ce?0:b.plotArea.fillOpacity).style("visibility",(F,le)=>F.dimension[0]===0||F.measure===0&&b.plotArea.hideZeroValues||F.dimension<k||F.dimension>h||F.measure<y||F.measure>i?"hidden":"visible").on("click",Tt(s,l,(F,le)=>({seriesId:`${L.get(le.colorName)}_${le.colorName}`,dimValue:String(le.dimension),legendUniqueId:`${L.get(le.colorName)}_${le.colorName}`,seriesDisplayName:le.colorName}))).on("mousemove",(F,le)=>{yt([{key:b.xAxisTitle.xAxisTitleText,value:qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(le.dimension)},{key:b.yAxisTitle.yAxisTitleText,value:qe(b.toolTip.toolTipDisplayUnits,b.toolTip.toolTipNumberFormat,b.toolTip.toolTipDecimalPrecision)(le.measure)},{key:"Color",value:le.colorName},...le.shapeName?[{key:"Shape",value:le.shapeName}]:[]],b,F,{alias:le.colorName},gt(n,String(le.dimension),{alias:le.colorName}))}).on("mouseout",()=>{ot()});Ce&&ve.transition().duration(b.animation.animationDuration).ease(et[b.animation.animationEffect]).attr("opacity",b.plotArea.fillOpacity)}catch(Ee){Ae(ba,"initCircles",Ee)}},Le=()=>{try{let Ee=function(we,Ce,ve){Z=Math.min(Z,we.value),ce=Math.max(ce,we.value),V=Math.min(V,we.dimension),$=Math.max($,we.dimension),ne=Math.min(ne,we.value2??10),ae=Math.max(ae,we.value2??10),u.push({dimension:we.dimension,measure:we.value,sizeValue:we.value2,colorName:Ce,shapeName:ve,shape:re.get(ve)||"Circle",color:N.get(Ce)||"#6ba2b8ff"})};p.forEach(we=>{N.set(we.name,we.color)}),f.forEach(we=>{re.set(we.name,we.markerShape)}),t.ChartData.forEach(we=>{we.children&&we.children.length>0&&we.children.forEach(Ce=>{Ce.data.forEach(ve=>{Ee(ve,we.legend,Ce.legend)})}),we.data&&we.data.length>0&&we.data.forEach(Ce=>{Ee(Ce,we.legend)})})}catch(Ee){Ae(ba,"iterateOverChartData",Ee)}},ze=()=>{try{let Ee=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMinText!==""?parseFloat(b.yAxisLabel.yAxisMinText):Z>0?0:Z*1.1,we=b.yAxisLabel.yAxisIntervalsVisibility&&b.yAxisLabel.yAxisMaxText!==""?parseFloat(b.yAxisLabel.yAxisMaxText):ce*1.1;a=v.scaleLinear().domain([Ee,we]).range([U,0]),m=v.scaleLinear().domain([ne,ae]).range([1,10])}catch(Ee){Ae(ba,"initScale",Ee)}},Se=()=>{try{const we=(parseFloat(e.plotArea.ticksHeight)||100)/100*U;let{xAxisLabelArray:Ce,customTickValue:ve}=Li($,V,W,e,k,h,U,!1);Ce.length>0?T=v.scaleLinear().domain([Ce[0],Ce[Ce.length-1]]).range([0,W]):T=v.scaleLinear().domain([k,h]).range([0,W]);const F=v.axisBottom(T).tickFormat(qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesVertical?b.xAxisLabel.xAxisPosition==="0"?-we:b.xAxisLabel.xAxisPosition==="1"?we:0:0).tickValues(Ce.length>0?Ce:null).ticks(ve).tickPadding(8).tickSizeOuter(0);ll(P,b,0,ge,F,U,W,B,a)}catch(Ee){Ae(ba,"drawXAxis",Ee)}},ie=()=>{try{const we=(parseFloat(e.plotArea.ticksWidth)||100)/100*W;let{yAxisLabelArray:Ce,customTickValue:ve}=al(ce,Z,U,e,y,i);const F=v.axisLeft(a).tickFormat(qe(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(b.plotArea.gridLinesVisibility&&b.plotArea.gridLinesHorizontal?-we:0).tickValues(Ce.length>0?Ce:null).ticks(ve).tickPadding(8).tickSizeOuter(0);il(P,b,0,ue,F,U)}catch(Ee){Ae(ba,"drawYAxis",Ee)}},De=()=>{try{if(b.plotArea.xCoordinate!=Wt.None){let Ee;switch(b.plotArea.xCoordinate){case Wt.Mean:Ee=v.mean(u,we=>we.dimension);break;case Wt.Median:Ee=v.median(u,we=>we.dimension);break;case Wt.Custom:Ee=rt(b.plotArea.xscaleposition);break}P.append("line").attr("x1",T(Ee)).attr("y1",0).attr("x2",T(Ee)).attr("y2",U).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}if(b.plotArea.yCoordinate!=Wt.None){let Ee;switch(b.plotArea.yCoordinate){case Wt.Mean:Ee=v.mean(u,we=>we.value);break;case Wt.Median:Ee=v.median(u,we=>we.value);break;case Wt.Custom:Ee=rt(b.plotArea.yscaleposition);break}P.append("line").attr("x1",0).attr("y1",a(Ee)).attr("x2",W).attr("y2",a(Ee)).attr("stroke",b.plotArea.refLineBorderColor).attr("stroke-width",b.plotArea.refLineBorderThickness)}}catch(Ee){Ae(ba,"drawReferenceLines",Ee)}},ye=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment="Top"),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom="Start");let Ee=b.legends.legendPosition,we=b.legends.legendAlignment,Ce=b.legends.legendAlignmentTopBottom;switch(Ee){case je.none:break;case je.right:$e(p,A-Q-30,g+5,Q+25,R-g-10);break;case je.top:$e(p,5,g+5,A-10,30);break;case je.left:$e(p,5,g+5,Q+25,R-g-10);break;case je.bottom:$e(p,5,R-35,A-10,30);break}}catch(Ee){Ae(ba,"drawColors",Ee)}},fe=()=>{try{b.legends.legendAlignment===void 0&&(b.legends.legendAlignment=Ia.top),b.legends.legendAlignmentTopBottom===void 0&&(b.legends.legendAlignmentTopBottom=Ea.start);let Ee=b.legends.legendPosition;if(f.length>0)switch(Ee){case je.none:break;case je.right:Ue(f,A-Q-30,R/2+10,Q+25,R-g-10);break;case je.top:Ue(f,A/2+5,g+5,A-10,30);break;case je.left:Ue(f,5,R/2+10,Q+25,R-g-10);break;case je.bottom:Ue(f,A/2+5,R-35,A-10,30);break}}catch(Ee){Ae(ba,"drawShapes",Ee)}},$e=(Ee,we,Ce,ve,F)=>{try{let he=b.legends.legendPosition,te=b.legends.legendFontStyle,O=D.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",we).attr("y",Ce).attr("width",ve).attr("height",F).style("user-select","none"),X=(he==je.top||he==je.bottom)&&f.length>0?"50%":"100%";var le=O.append("xhtml:div").style("width",X).style("display","flex").style("height",he==je.top||he==je.bottom?F-1+"px":"calc(50% - 5px)").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+r).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",he==je.top||he==je.bottom?b.legends.legendAlignmentTopBottom==Ea.start?"flex-Start":b.legends.legendAlignmentTopBottom==Ea.middle?"center":"flex-end":b.legends.legendAlignment==Ia.top?"flex-Start":b.legends.legendAlignment==Ia.middle?"center":"flex-end").style("flex-direction",he==je.top||he==je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Ee.forEach((H,E)=>{let Y=le.append("div").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("width","fit-content").style("flex-wrap","nowrap").style("white-space","nowrap").style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).on("mousemove",function(z){b.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[colorId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(z){D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[colorId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(he==je.bottom||he==je.top)&&Y.style("margin-right","16px").style("white-space","nowrap"),Y.append("div").style("height","10px").style("width","10px").style("background",H.color).style("border-radius","1px");let ee=b.legends.legendColorMode=="1"?H.color?H.color:Re.black:b.legends.legendSelectedUnicolor;Y.append("div").style("margin-left","5px").style("color",ee).attr("title",H.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",te.includes(oe.italic)?oe.italic:"").style("text-decoration",te.includes(oe.underline)?oe.underline:"").style("font-weight",te.includes(oe.bold)?oe.bold:"").style("white-space","nowrap").html(H.name)})}catch(he){Ae(ba,"colorListWithScroll",he)}},Ue=(Ee,we,Ce,ve,F)=>{try{let he=b.legends.legendPosition,te=b.legends.legendFontStyle,O=D.append("foreignObject").attr("visibility",b.legends.legendVisibility?"visible":"hidden").attr("x",we).attr("y",Ce).attr("width",ve).attr("height",F).style("user-select","none"),X=b.legends.legendPosition==je.top||b.legends.legendPosition==je.bottom?"calc(50% - 5px)":"calc(100%)";var le=O.append("xhtml:div").style("width",X).style("display","flex").style("height",he==je.top||he==je.bottom?F-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",b.legends.legendBorder?`${b.legends.legendBorderThickness+"px solid"+b.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+r).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",he==je.top||he==je.bottom?b.legends.legendAlignmentTopBottom==Ea.start?"flex-Start":b.legends.legendAlignmentTopBottom==Ea.middle?"center":"flex-end":b.legends.legendAlignment==Ia.top?"flex-Start":b.legends.legendAlignment==Ia.middle?"center":"flex-end").style("flex-direction",he==je.top||he==je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");Ee.forEach((H,E)=>{let Y=le.append("div").style("width","fit-content").style("display","inline-flex").style("justify-content","flex-start").style("align-items","center").style("margin","3px 0px").style("flex-wrap","nowrap").style("white-space","nowrap").on("mousemove",function(z){b.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[shapeId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(z){b.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[shapeId="'+Pe(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(he==je.top||he==je.bottom)&&Y.style("margin-right","16px").style("white-space","nowrap"),Ye(Y,H.markerShape);let ee=b.legends.legendColorMode=="1"?Re.black:b.legends.legendSelectedUnicolor;Y.append("div").style("margin-left","5px").style("color",ee).attr("title",H.name).style("font-size",b.legends.legendFontSize+"px").style("font-family",b.legends.legendFontFamily).style("font-style",te.includes(oe.italic)?oe.italic:"").style("text-decoration",te.includes(oe.underline)?oe.underline:"").style("font-weight",te.includes(oe.bold)?oe.bold:"").style("white-space","nowrap").html(H.name)})}catch(he){Ae(ba,"shapeListWithScroll",he)}},Ye=(Ee,we)=>{try{const ve={none:v.symbolCircle,circle:v.symbolCircle,square:v.symbolSquare,triangle:v.symbolTriangle,cross:v.symbolCross,diamond:v.symbolDiamond,star:v.symbolStar,wye:v.symbolWye}[we?.toLowerCase()]||v.symbolCircle;Ee.append("svg").attr("width",14).attr("height",14).append("path").attr("d",v.symbol().type(ve).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(Ce){Ae(ba,"shapesForScatterPlot",Ce)}},Pe=(Ee="")=>{try{return Ee.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(we){Ae(ba,"getJQuerySelector",we)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:r,style:{width:"100%",height:"100%"}})})},Rr=({isDateType:t,formatOptions:e,data:r,isAdvancedAnalyticsWaterFall:c=!1,onElementClick:x,vfxPickModeActive:n,tooltipFormatter:l})=>{const s=crypto.randomUUID?.();let p=0,f;const L=se.WaterfallChart,u=Me.useRef(),S=Me.useRef(x);S.current=x;const b=Me.useRef(n);b.current=n;const _=c??!1,A=_?[]:Lt(r.ChartData,r.DimensionList),R=r.DimensionList,g=!1,B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K=[],me=[],Le,ze=0;const Se=2;let ie={dimensionList:R,chartType:L,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{De()}catch(te){Ae("WaterfallChart","createWaterfallChart",te)}},[e]);const De=()=>{({formatOptions:e,svg:d,width:h,height:k}=St(u,e)),ye(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,ie.yMinLeft,ie.yMaxLeft,ie.yMinRight,ie.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be}=Ct(h,k,pe,Q,ie.yMaxLeft,e,ie.legendList,ie.dimensionList,ie.yMaxRight,B,U,t),we(D),Mt(d,h,k,e),i=Ft(d,D),vt(i,e,o,G,M,L,s),$e(),Ye(),Jt(i,e,o,V,m,M),Ce(A,k,d,D,G),wt(e,g,d,D,$,k,ce,ie.chartType,V,G,M),Dt(M,e,o,g,d,D,Z,V),Ht(d,B,D,e,o,M,G,be,ue),Vt(d,e,h,ae)},ye=()=>{if(_){let E=he(r);E=E.filter(ee=>ee.up+ee.down+ee.base!=0),ie.dimensionList=E.map(ee=>ee.xKey),ie.legendList=ie.dimensionList,me=v.stack().keys(["base","dimensionTotal","up","down"])(E);const Y=[];me.forEach(ee=>ee.forEach(z=>Y.push(z[1]))),ie.yMaxLeft=v.max(Y)??0,ie.yMinLeft=v.min(Y)??0;return}A.forEach(E=>{E.data.forEach(Y=>{})}),K=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?re=ie.dimensionList:re=ie.dimensionList.slice(ze,ze+Se),e.plotArea.hideZeroValues&&(ie.hideZeroValues=!0);let te=_?he(r):F(),O=JSON.parse(JSON.stringify(te));te.forEach(E=>{if(!E.Dimension&&(E.Up<1e-9&&E.Up!==0||E.Down<1e-9&&E.Down!==0)){let Y=O.findIndex(ee=>ee.Legend===E.Legend);Y!==-1&&O.splice(Y,1)}}),te=O,te.forEach(E=>E.dimension?ie.legendList.push(E.dimension):ie.legendList.push(E.legend)),me=v.stack().keys(["base","dimensionTotal","up","down"])(te);let X=[],H=[];me.forEach(E=>{E.key=="base"?E.opacity=0:E.opacity=1,E.forEach(Y=>X.push(Y)),!H.includes(E.dimension)&&E.dimensionTotal===0&&E.total===0&&H.push(E.dimension)}),ie.yMaxLeft=v.max(X,E=>E[1]),ie.yMinLeft=v.min(X,E=>E[1]),e.xAxisLabel.hideZeroValues&&(H.length>0&&H.forEach(E=>{ie.legendList=ie.legendList.filter(Y=>Y!==E)}),ie.dimensionList=ie.legendList),t?ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(E=>E):ie.dimensionList,fe(te)},fe=te=>{try{let O=[],X=[],H=[];te&&te.forEach((Y,ee)=>{Y.dimension&&(O.push(Y.dimension),X.push({dimension:Y.dimension,chartDataIndex:ee,selfIndex:X.length}))}),t?H=ft(e.xAxisLabel.xAxisNumberFormat,ie.dimensionList).map(Y=>Y):H=O;let E=JSON.parse(JSON.stringify(ie.legendList));X.forEach((Y,ee)=>{E[Y.chartDataIndex]=H[Y.selfIndex]}),ie.legendList.forEach((Y,ee)=>{ie.formattedDimensionListMap.set(Y,E[ee])})}catch(O){throw O}},$e=()=>{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P).yAxisLabelArray;ie.yMaxLeft=te[te.length-1],ie.yMinLeft=te[0],y=v.scaleLinear().domain([ie.yMinLeft>=0?W!==void 0&&!Number.isNaN(W)?W:0:ie.yMinLeft<0?ie.yMinLeft*1.1:ie.yMinLeft*.9,ie.yMaxLeft<=0?0:P!==void 0&&!Number.isNaN(P)?P:ie.yMaxLeft*1.1]).range([M,0]),a=[0,G],Ue()},Ue=()=>{p=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(G/ie.legendList.length),T=v.scaleBand().domain(ie.legendList).range(a).padding(.4)},Ye=()=>{Pe();{let te=dt(P||ie.yMaxLeft,ie.yMinLeft,M,e,ie,W,P);m=v.axisLeft(y).tickFormat(O=>Ze(O,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-G+0:0).tickValues(te.autoLabelFlag?void 0:te.yAxisLabelArray).ticks(te.customTickValue).tickPadding(8).tickSizeOuter(0)}f=v.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,_?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},Pe=()=>{N=v.axisBottom(T).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.gridLinesVertical?-M:parseFloat(e.plotArea.ticksHeight)*(M/100)*(e.xAxisLabel.xAxisPosition=="1"?1:-1):0).tickSizeOuter(0).tickValues(bt(ie.legendList,G))},Ee=te=>{let O;if(me.forEach((X,H)=>X.forEach(E=>E.key=X.key)),Le){let X=K.map(H=>H.legend);O=v.stack().keys(X)(Le),O.forEach((H,E)=>{O[E].color=K[E].properties.color})}O&&O.forEach(X=>{X.forEach(H=>{H.Key=X.key})}),[0,1].forEach(X=>{if(X===1&&(me=O),me){let H=i.selectAll(`.parentGroup-${X}`).data([null]);H=H.enter().append("g").attr("class",`parentGroup parentGroup-${X}`).merge(H);let E=H.selectAll(`.bar-group-${X}`).data(me);E=E.enter().append("g").attr("class",`bar-group-${X}`).attr("fill",C=>C.color?C.color:f(C.key)!==Re.white?f(C.key):"none").attr("opacity",C=>C.opacity).merge(E);let ee=E.selectAll("rect").data(C=>C,C=>C.key||C.Key);const z=e.animation.animationEnabled,I=ee.enter().append("rect").attr("class","rect").attr("class",C=>C.key?C.key.replace(/ /g,"-"):C.Key.replace(/ /g,"-")).attr("x",C=>T(_?C.data.xKey:C.data.dimension||C.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${s}-clip)`).attr("height",0).attr("width",T.bandwidth()).attr("visibility",C=>X===0&&C.data.dimension&&Le?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(C,q)=>{const J=_?va.base:va.dimensionTotal,j={markerShape:"square",markerColor:q.key===J?e.plotArea.totalColor:q.key===va.down?e.plotArea.negativeColor:e.plotArea.positiveColor};yt([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():q.properties?.currentMeasure?q.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(q.key===va.up?"+":q.key===va.down?"-":"")+Ze(q.key===va.dimensionTotal?q.data.dimensionTotal:q[1]-q[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(_?q.key!==va.base?q.data.xKey:va.total:q.Key?q.Key.includes("~$~")?q.Key.split("~$~")[1]:q.Key:q.data.legend?q.data.legend.includes("~$~")?q.data.legend.split("~$~")[1]:q.data.legend:va.total).trim()||""}],e,void 0,j,gt(l,String(ie.formattedDimensionListMap.get(_?q.data.xKey:q.data.dimension||q.data.legend)??(_?q.data.xKey:q.data.dimension||q.data.legend)??""),{...j,alias:q.properties?.alias??q.properties?.currentMeasure??String(q.Key??q.key??"")}))}).on("mouseout",()=>{ot()}).attr(lt.SeriesId,C=>String(C.key??C.Key??"")).attr(lt.DimValue,C=>String(_?C.data.xKey||"":C.data.dimension||C.data.legend||"")).on("click",Tt(b,S,(C,q)=>{const J=String(q.key??q.Key??""),j=String(_?q.data.xKey||"":q.data.dimension||q.data.legend||"");return{seriesId:J,dimValue:j,legendUniqueId:J,seriesDisplayName:J}}));if((z?I.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):I).attr("y",C=>C[1]?y(C[1]):0).attr("height",C=>C[1]?y(C[0])-y(C[1]):0),ee.exit().remove(),ee=I.merge(ee),e.plotArea.plotAreaDataLabel=="2"&&X!=1){const C=E.selectAll("text").data(j=>j),q=C.enter().append("text").text(j=>Ze(j[1]-j[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",j=>T(_?j.data.xKey:j.data.dimension||j.data.legend)+T.bandwidth()/2).attr("y",y(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",j=>j[1]-j[0]!==0&&y(j[1])?"visible":"hidden");(z?q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):q).attr("y",j=>j[1]?y(j[1])-15:0),C.exit().remove()}}}),i.selectAll(".parentGroup").raise()},we=te=>{G=h-te.left-te.right,M=k-te.bottom-te.top},Ce=(te,O,X,H,E)=>{if(!e.plotArea.fitChart){const Y=te[0].data.length-Se,ee=O-20;re=ie.dimensionList.slice(ze,ze+Se),Ue(),K=JSON.parse(JSON.stringify(te)),K.forEach((w,C)=>K[C].data=w.data.filter(q=>re.includes(q.dimension))),Pe(),X.append("rect").attr("x",H.left).attr("y",ee).attr("width",E).attr("height",8).attr("fill","#ddd").attr("rx",4);const z=E*Se/ie.dimensionList.length,I=X.append("rect").attr("x",H.left).attr("y",ee).attr("width",z).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",w=>{let C=Math.min(Math.max(w.x,H.left),H.left+E-z);I.attr("x",C),ze=Math.round((C-H.left)/(E-z)*Y),re=ie.dimensionList.slice(ze,ze+Se),Ue(),K=JSON.parse(JSON.stringify(te)),K.forEach((q,J)=>K[J].data=q.data.filter(j=>re.includes(j.dimension))),Pe(),ve()}));X.on("wheel",w=>{w.preventDefault();const C=Math.abs(w.deltaX)>Math.abs(w.deltaY)?w.deltaX:w.deltaY;ze+=C>0?1:-1,ze=Math.max(0,Math.min(ze,Y));const q=H.left+(E-z)*ze/Y;I.attr("x",q),Ue(),K=JSON.parse(JSON.stringify(te)),K.forEach((J,j)=>K[j].data=J.data.filter(Te=>re.includes(Te.dimension))),Pe(),ve()})}ve()},ve=()=>{Ot(i,ie,$,e,o,y,N,ne,k,p,t,G,M,ie.legendList,T),Ee()},F=()=>{try{if(A.length<1)return[];if(ie.dimensionList.length<2)return[];let te=[],O=[],X=[],H="";if(H.length>1){let I=H;A.forEach(w=>{I===w.properties.currentLegend?O.push(w):X.push(w)})}O.length>0&&(K=O);let E=0,Y=0;for(let I=0;I<K.length;++I)E=E+K[I].data[0].value;let ee="";for(let I=1;I<re.length;++I){let w={};w.dimension=re[I-1],w.total=E,w.base=0,w.dimensionTotal=E,w.up=0,w.down=0,te.push(w);for(let C=0;C<K.length;++C){let q={};for(let J=0;J<C;J++)ee=ee+" ";Y=K[C].data[I].value-K[C].data[I-1].value,Y!==0&&(q.legend=ee+K[C].properties.legend,q.dimensionTotal=0,Y<0?(q.base=E+Y,q.down=-Y,q.up=0,q.total=E-Y):(q.base=E,q.down=0,q.up=Y,q.total=E+Y),E=E+Y,te.push(q))}}let z={};return z.dimension=re[re.length-1],z.dimensionTotal=E,z.base=0,z.total=E,z.up=0,z.down=0,te.push(z),X.length>0&&(K=X,Le=At(re,X,!1)),te}catch(te){throw te}},le=te=>te==null||te===""?0:Number(te),he=te=>(te[0]?.Column1==""?te.filter(X=>X.Column1&&X.Column1!=="*"):c?te.Data:te).map(X=>({xKey:X.Column1||X.Dimension||X.Legend,base:le(X.Column3||X.Total),up:le(X.Column4||X.Up),down:le(X.Column5||X.Down),total:le(X.Column6||X.total),dimensionTotal:le(X.Column2||X.Base)}));return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:s,style:{width:"100%",height:"100%"}})})},zr=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,onElementClick:n,vfxPickModeActive:l,tooltipFormatter:s})=>{const p=crypto.randomUUID();let f=0;const L=se.TornadoChart,u=r.IsadvanceanalyticsChart??r.IsCalCSensitivity,S=Me.useRef(),b=Me.useRef(n);b.current=n;const _=Me.useRef(l);_.current=l;let A=Lt(r.ChartData,r.DimensionList,!0);A=er(A,r,u);const R=r.DimensionList,g=!0,B=!1,U=!1;let W=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,P=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y,T,a,m,N,re,K,me,Le,ze=[],Se=0,ie=2,De=!1,ye={dimensionList:R,chartType:L,chartData:[],formatOptions:e,legendList:r.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{fe()}catch(O){Ae("Tornadochart","createTornadoChart",O)}},[e]);const fe=()=>{({formatOptions:e,svg:i,width:h,height:k}=St(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ue(),{formatOptions:e}=ta(e,A,r.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:Q}=Et(e,ye.yMinLeft,ye.yMaxLeft,ye.yMinRight,ye.yMaxRight),{margin:D,yLabel:V,xLabel:$,yTitle:Z,xTitle:ce,dimensionHeightWidthArray:ne,chartTitleHeight:ae,secondaryAxisTitleWidth:ue,legendMargin:ge,secondaryYLabel:be,visibleBars:ie,columnWidth:f,scrollbarVisible:De}=Ct(h,k,pe,Q,ye.yMaxLeft,e,u?ye.legendList.map(O=>O.alias.split(" - ")[0]):ye.legendList.map(O=>O.alias),ye.dimensionList,ye.yMaxRight,B,U,t,!0,ye),ve(D),Mt(i,h,k,e),y=Ft(i,D),vt(y,e,d,G,M,L),Ye(),we(),ra(e,y,$,M,G,K),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ia(e.plotArea.fitChart,i,y,o,f,T,a,m,void 0,void 0,d,L,e,V,Z,ye.dimensionList,G,N,ye.formattedDimensionListMap,p,D,M)),wt(e,g,i,D,$,k,ce,ye.chartType,V,G,M),Dt(M,e,d,g,i,D,Z,V,G),Ht(i,B,D,e,d,M,G,be,ue),Vt(i,e,h,ae),Pt(k,i,ne,ae,h,ge,e,$e(A,ye.legendList,u,e),p,d,D,ct.rectangle),he(A,k,h,i,D,G,De,ie,ye,Se,!1,F,g)},$e=(O,X,H,E)=>O.map((Y,ee)=>{const z=X[ee];if(!z)return{...Y,properties:{}};let I=z.alias;H&&z.alias&&(I=z.alias.split(" - ")[0].trim());let w=z.color;return H&&I&&(I.includes("+ve")?w=E.plotArea.plotAreaCalculatedHigh:I.includes("-ve")&&(w=E.plotArea.plotAreaCalculatedLow)),{...Y,properties:{...z,alias:I,color:w}}}).filter(Y=>Y.properties&&Object.keys(Y.properties).length>0),Ue=()=>{let O;if(u)ye.chartData=A,ye.yMaxLeft=Math.min(...A.map(H=>H.data[0].value)),ye.yMaxRight=Math.max(...A.map(H=>H.data[0].value));else{const H=A[0]?.properties?.measureUniqueId;let E=0,Y=-1/0;O=A.map((ee,z)=>{const I=ee.properties.measureUniqueId===H,w=ee.data.map(q=>{const J=I?-Math.abs(q.value):Math.abs(q.value);return{...q,value:J}}),C=w.map(q=>q.value);return I?E=Math.min(E,Math.min(...C)):Y=Math.max(Y,Math.max(...C)),{...ee,data:w}}),ye.chartData=O,ye.yMaxLeft=E,ye.yMaxRight=Y}const X=t?ft(e.xAxisLabel.xAxisNumberFormat,ye.dimensionList):ye.dimensionList;ye.dimensionList.forEach((H,E)=>{ye.formattedDimensionListMap.set(H,X[E])}),ze=JSON.parse(JSON.stringify(u?A:O)),A=ze,Le=ye.dimensionList,e.plotArea.hideZeroValues&&(ye.hideZeroValues=!0)},Ye=()=>{let O=ye.yMaxLeft,X=ye.yMaxRight,H=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,E,Y=!1,ee=!1;O>X?(E=O,Y=!0):(E=X,ee=!0);let z=e.annotation.annotationVisibility!="5"?O/E!==1?Math.abs(O/E)*100<10?3:0:Math.abs(X/E)*100<10?3:0:0,I=0,w=0;O<0&&X>0?(I=O*(1.2+(ee?z:0)),w=X*(1.2+(Y?z:0))):O>=0&&X>=0?(I=0,w=X*(1.2+(Y?z:0))):O<=0&&X<=0?(I=O*(1.2+(ee?z:0)),w=0):(I=O*1.2,w=X*1.2),I=Math.floor(I),w=Math.ceil(w),m=v.scaleLinear().domain([I,w]).range([H,G-H]),a=m,N=[0,G],Pe()},Pe=()=>{T=v.scalePoint().domain(Le).range([M,0]).padding(.5)},Ee=()=>{re=v.axisLeft(T).tickSize(Rt(e,G-m(0),0)).tickSizeOuter(0).tickValues(bt(Le,M)),me=v.axisRight(T).tickSize(Rt(e,m(0),0)).tickSizeOuter(0).tickValues(bt(Le,G))},we=()=>{K=v.axisBottom(m).tickFormat(O=>Ze(O,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision,!0)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?e.plotArea.ticksHeight=="100"?-M:-e.plotArea.ticksHeight*(M/100):0).tickValues(dt(ye.yMaxRight,ye.yMaxLeft,M,e,ye,W,P,g,G).yAxisLabelArray).ticks(dt(P||ye.yMaxLeft,ye.yMinLeft,M,e,ye,W,P,g,G).customTickValue??G/30).tickPadding(8).tickSizeOuter(0)},Ce=()=>{y.selectAll(".parentGroup").remove();const O=e.plotArea.plotAreaCalculatedHigh,X=e.plotArea.plotAreaCalculatedLow,H=y.append("g").attr("class","parentGroup"),E=e.animation.animationEnabled,Y=H.selectAll("rect").data(ze.flatMap(z=>z.data.map(I=>({...I,legendText:u?z.legend.split("ve) - ")[1]?.trim()??z.legend:ye.dimensionList[0]==se.TornadoDefaultEntry?fi.default:z.legend.split("-")[1]?.trim()??z.legend,properties:z.properties})))).enter().append("rect").attr("class","rect").attr("y",z=>(z.legendText?T(z.legendText):T(se.TornadoDefaultEntry))-f/2).attr("height",f).attr("x",a(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",z=>z.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",z=>`${z.properties.stackBorderWidth}px`).attr("hoverId",z=>((u?z.legend.split(" - ")[0]:z.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",z=>z.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?z.properties.stackBorderColor:"none").style("fill",z=>u?z.value>0?O!==Re.white?O:"none":X!==Re.white?X:"none":z.properties.color).on("mousemove",(z,I)=>{yt([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():r.IsCalCSensitivity?I.properties.currentMeasure.split("~$~")[1]:I.dimension},{key:"Legend",value:I.legendText},{key:"Value",value:Ze(Math.abs(I.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,z,r.IsCalCSensitivity?I.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:I.properties,gt(s,String(ye.formattedDimensionListMap.get(I.legend)??I.legend??""),I.properties))}).on("mouseout",ot).attr(lt.SeriesId,z=>String(z.properties?.legendUniqueId??"")).attr(lt.DimValue,z=>String(z.legend??z.legendText??"")).on("click",Tt(_,b,(z,I)=>({seriesId:String(I.properties?.legendUniqueId??""),dimValue:String(I.legend??I.legendText??""),legendUniqueId:String(I.properties?.legendUniqueId??""),seriesDisplayName:String(I.properties?.alias||I.properties?.name||I.legendText||"")})));(E?Y.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Y).attr("x",z=>z.value>=0?a(0):a(z.value)).attr("width",z=>Math.abs(a(z.value)-a(0)))},ve=O=>{G=h-O.left-O.right,M=k-O.bottom-O.top},F=(O,X,H)=>{ze=X,Le=O,ie=H,te()};function le(O){const X=new Map;return O.forEach(H=>{let E=X.get(H.properties.legendUniqueId);if(E){let Y=E.data??[];Y.push(H.data[0]),X.set(H.properties.legendUniqueId,{...E,data:Y})}else E={...H,data:[H.data[0]]},X.set(H.properties.legendUniqueId,E)}),X.size>0?Array.from(X.keys()).map(H=>X.get(H)):O}function he(O,X,H,E,Y,ee,z,I,w,C,q,J,j=!1){const Te=(xe,de,Fe,Ve,ke)=>{try{if(ke&&(xe=C+xe),!w||!Array.isArray(w.dimensionList)||!Array.isArray(O))return;xe=xe==null?0:Number(xe),de=de==null?0:Number(de),Fe=Fe==null?0:Number(Fe),C=ja(Math.round(xe),0,Math.max(0,de)),I=typeof I=="number"?I:0;const Be=C,at=Be+I;let it=w.dimensionList.slice(Be,at);const ga=it[0]==se.TornadoDefaultEntry;let Ha=JSON.parse(JSON.stringify(O||[]));Ha=Ha.filter(Oe=>ga?!0:it.includes(Oe.legend.split(" - ")[1]));const Pa=Y?.left??0,Fi=Y?.top??0,We=Number(ee)||0,Xe=Number(M)||0,st=Number(Fe)||0,Ke=de===0?1:de;if(j){const Oe=Fi+(Xe-st)*(de===0?0:C)/Ke;Ve&&typeof Ve.attr=="function"&&Ve.attr("y",Oe)}else{const Oe=Pa+(We-st)*(de===0?0:C)/Ke;Ve&&typeof Ve.attr=="function"&&Ve.attr("x",Oe)}J(it,Ha,I)}catch(Be){typeof Ae=="function"&&Ae("ColumnChart","updateFromScrollPosition",Be)}};if(z){const xe=X-Y.top-Y.bottom,de=Math.max(0,R.length-I),Fe=X-8;E.append("rect").attr("id","scrollbarTrack").attr("x",j?H-8:Y.left).attr("y",j?Y.top:Fe).attr("width",j?8:ee).attr("height",j?xe:8).attr("fill","#ccc");const Ve=(j?xe:ee)*I/w.dimensionList.length,ke=E.append("rect").attr("x",j?H-8:Y.left).attr("y",j?Y.top:Fe).attr("width",j?8:Ve).attr("height",j?Ve:8).attr("fill","#999").style("cursor",j?"ns-resize":"ew-resize");ke.call(v.drag().on("drag",Be=>{if(j){const it=(ja(Be.y,Y.top,Y.top+xe-Ve)-Y.top)/(xe-Ve)*(de||1);Te(it,de,Ve,ke,!1),ke.attr("y",Y.top+(xe-Ve)*(de===0?0:C)/(de===0?1:de))}else{const it=(ja(Be.x,Y.left,Y.left+ee-Ve)-Y.left)/(ee-Ve)*(de||1);Te(it,de,Ve,ke,!1),ke.attr("x",Y.left+(ee-Ve)*(de===0?0:C)/(de===0?1:de))}})),E.on("wheel",Be=>{Be.preventDefault();const it=(Math.abs(Be.deltaX)>Math.abs(Be.deltaY)?Be.deltaX:Be.deltaY)>0?1:-1;if(Te(it,de,Ve,ke,!0),j){const ga=Y.top+(xe-Ve)*(de===0?0:C)/(de===0?1:de);ke.attr("y",ga)}else{const ga=Y.left+(ee-Ve)*(de===0?0:C)/(de===0?1:de);ke.attr("x",ga)}})}else E.on("wheel",null);Te(0,0,0,null,!0)}const te=()=>{Pe(),Ee(),na(e,y,$,M,G,re,me,a,ye.yMaxLeft,Le,L,t,h,ne,f,T),Ce();const O=le(ze);Ra(O??[],T,a,null,D,xt,[],[],e,L,k,h,G,Le,M,p,i,x,T,f,c,u,g,u)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:p,style:{width:"100%",height:"100%"}})})},$r=({isDateType:t,formatOptions:e,data:r,isReportEditable:c,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:n,tooltipFormatter:l})=>{const s=crypto.randomUUID();let p=0;const f=se.DotPlot,L=Me.useRef(),u=Lt(r.ChartData,r.DimensionList),S=r.DimensionList,b=!0,_=!1;let A=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,R=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,g,B,U,W,P,D,V,$,Z,ce,ne,ae,ue,ge,be,pe,Q,G,M,h,k,o,d,i,y=[],T=0,a=2,m=!1,N=[];const re=!1;let K={dimensionList:S,chartType:f,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Me.useEffect(()=>{try{me()}catch(Ce){Ae("StackStackHorizontalBarchart","createDotPlot",Ce)}},[e]);const me=()=>{({formatOptions:e,svg:Q,width:be,height:pe}=St(L,e)),Le(),{maxNumberForPrimaryAxis:ne,maxNumberForSecondaryAxis:ae}=Et(e,K.yMinLeft,K.yMaxLeft,K.yMinRight,K.yMaxRight),{margin:g,yLabel:B,xLabel:U,yTitle:W,xTitle:P,dimensionHeightWidthArray:D,chartTitleHeight:V,secondaryAxisTitleWidth:$,legendMargin:Z,secondaryYLabel:ce,visibleBars:a,columnWidth:p,scrollbarVisible:m}=Ct(be,pe,ne,ae,K.yMaxLeft,e,K.legendList,K.dimensionList,K.yMaxRight,_,re,t,b,K),fe(g),Mt(Q,be,pe,e),G=Ft(Q,g),vt(G,e,0,ue,ge,f),ze(),ie(),ra(e,G,B,ge,ue,o),wt(e,b,Q,g,U,pe,P,K.chartType,B,ue,ge),Dt(ge,e,0,b,Q,g,W,B),Vt(Q,e,be,V),Pt(pe,Q,D,V,be,Z,e,u,s,0,g,ct.rectangle,f,n),Gt(u,pe,be,Q,g,ue,m,a,K,T,!1,$e,b)},Le=()=>{const Ce=[],ve=[];let F=[],le=-1/0,he=1/0,te=-1/0,O=1/0;u.forEach(X=>{ve.push(X.properties.legendUniqueId),X.data.forEach(H=>{Ce.push(H),le=Math.max(le,H.value),he=Math.min(he,H.value)})}),K.chartData=Ce,K.legendList=ve,K.yMaxLeft=le,K.yMinLeft=he>0?0:he,K.yMaxRight=te,K.yMinRight=O,F=t?ft(e.xAxisLabel.xAxisNumberFormat,K.dimensionList).map(X=>X):K.dimensionList,F=t?ft(e.xAxisLabel.xAxisNumberFormat,K.dimensionList).map(X=>X):K.dimensionList,K.dimensionList.forEach((X,H)=>{K.formattedDimensionListMap.set(X,F[H]),K.formattedDimensionListMap.set(X,F[H])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=K.dimensionList:i=K.dimensionList.slice(T,T+a),e.plotArea.hideZeroValues&&(K.hideZeroValues=!0)},ze=()=>{let Ce=dt(R||K.yMaxLeft,K.yMinLeft,ge,e,K,A,R,b,ue).yAxisLabelArray;K.yMaxLeft=Ce[Ce.length-1],K.yMinLeft=Ce[0],M=v.scaleLinear().domain([K.yMinLeft>=0?A!==void 0&&!Number.isNaN(A)?A:0:K.yMinLeft<0?K.yMinLeft*1.1:K.yMinLeft*.9,K.yMaxLeft<=0?0:R!==void 0&&!Number.isNaN(R)?R:K.yMaxLeft*1.1]).range([0,ue]),k=[ge,0],Se()},Se=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,p]).paddingInner(K.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),h=v.scalePoint().domain(i).range(k).padding(.5)},ie=()=>{De();{let Ce=dt(R||K.yMaxLeft,K.yMinLeft,ge,e,K,A,R,b,ue);o=v.axisBottom(M).tickFormat(ve=>Ze(ve,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-ge:0).tickValues(Ce.autoLabelFlag?void 0:Ce.yAxisLabelArray).ticks(Ce.customTickValue).tickPadding(8).tickSizeOuter(0)}},De=()=>{d=v.axisLeft(h).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*ue*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(bt(i,ge))},ye=Ce=>{Ce.forEach(he=>{he.data.forEach(te=>{te.markerShape=he.properties.markerShape||"Circle",te.markerSize=he.properties.markerSize||6,te.markerColor=he.properties.markerColor||he.properties.color,te.alias=he.properties.alias,te.lineStyle=he.properties.lineStyle,te.lineWidth=he.properties.lineWidth,te.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const ve=v.group(Ce.flatMap(he=>he.data.map(te=>({...te,color:he.properties.color}))),he=>he.dimension),F=G.selectAll(".cleveland-line-group").data(Array.from(ve),([he])=>he);F.enter().append("g").attr("class","cleveland-line-group").append("line").merge(F.select("line")).attr("y1",([he])=>h(he)).attr("y2",([he])=>h(he)).attr("x1",([,he])=>M(Math.min(he[0]?.value??0,he[1]?.value??0))).attr("x2",([,he])=>M(Math.max(he[0]?.value??0,he[1]?.value??0))).attr("stroke",he=>he[1][0].lineColor).attr("stroke-width",he=>he[1][0].lineStyle!=="None"?he[1][0].lineWidth:0).attr("stroke-dasharray",he=>{switch(he[1][0].lineStyle){case pt.dotted:return"1,4";case pt.dashed:return fa;default:return""}}).attr("stroke-linecap",he=>he[1][0].lineStyle===pt.dotted?ya.round:""),F.exit().remove(),Ce.forEach(he=>{let te=G.selectAll(".parentGroup").data([he],Y=>Y.properties.legendUniqueId);te=te.enter().append("g").attr("class","parentGroup").attr("hoverId",(he.properties.alias||he.properties.name||"Legend").replace(/\s+/g,"-")).merge(te);let O=te.selectAll(".column-group").data(he.data,Y=>Y.dimension),X=O.enter().append("g").attr("class","column-group");const H=e.animation.animationEnabled,E=X.append("path").attr("class","cleveland-dot").attr("opacity",H?0:.9);E.merge(O.select("path")).attr("d",Y=>v.symbol().type(Gi(Y.markerShape)).size((Y.markerSize||6)*70)()).attr("transform",Y=>{const ee=M(Y.value),z=h(Y.dimension);return`translate(${ee},${z})`}).attr("fill",Y=>he.properties.color).attr("data-series-id",()=>he.properties.legendUniqueId??he.properties.alias).attr("data-dim-value",Y=>String(Y.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(Y,ee)=>{yt([{key:e.xAxisTitle.xAxisTitleText,value:K.formattedDimensionListMap.get(ee.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:Ze(ee.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ee.alias}],e,Y,he.properties,gt(l,String(ee.dimension??""),{...he.properties,formattedDimensionValue:String(K.formattedDimensionListMap.get(ee.dimension)??ee.dimension??"")}))}).on("mouseout",()=>{v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll(".halo").remove(),ot()}),H&&E.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("opacity",.9),O.exit().remove()}),G.selectAll(".parentGroup").raise()},fe=Ce=>{ue=be-Ce.left-Ce.right,ge=pe-Ce.bottom-Ce.top},$e=(Ce,ve,F)=>{y=ve,i=Ce,a=F,Ue()},Ue=()=>{Se(),De(),na(e,G,U,ge,ue,d,void 0,M,K.yMaxLeft,i,f,t,be,D,p,h),Ye(),ye(y),Ra(y,h,M,void 0,g,xt,[],[],e,f,pe,be,ue,i,ge,s,Q,x,h,p,c,!1,b),Pe()},Ye=()=>{let Ce=At(i,y,re);N=v.stack().keys(K.legendList).offset(v.stackOffsetDiverging)(Ce),y.forEach((F,le)=>F.data.forEach((he,te)=>{he[0]=N[le][te][0],he[1]=N[le][te][1]}));let ve=e.annotation.annotationSetLabelColor;N.forEach((F,le)=>F.forEach(he=>{he.key=F.key,F.color=JSON.parse(JSON.stringify(u[le].properties.color)),he.data.labelPosition=u[le].properties.dataLabelPosition,he.data.labelColor=ve=="2"?JSON.parse(JSON.stringify(u[le].properties.color)):u[le].properties.labelColor,he.hideZero=JSON.parse(JSON.stringify(u[le].properties.hideZeroValues))}))},Pe=()=>{try{const Ce=Number(e.connector?.connectorVisibility);if(!e.connector||Ce===2)return;const ve=[],F=[],le=[];let he;const te=[];if(Ce===1)he=1;else if(Ce===3){const z=Number(e.connector.connectorFollow);z===1?he=Number(e.connector.connectorStepSize):z===2&&((e.connector.connectorExclude||[]).forEach(I=>le.push(I)),he=1)}const O=[],X=[],H=[],E=e.connector?.connectorCustomRange||[];le.forEach(z=>{const I=z.split("-");I.length&&O.push(I[0])});const ee=(N?.[0]||[]).map((z,I)=>({Dimension:z.data.Dimension,Total:z.data.Total,CustomTotal:z.data.Total-(H[I]??0),Index:I}));if(he!=null){for(let z=0;z<ee.length;z++)(he===1||z%he===0&&he!==1)&&ve.push(ee[z]);for(let z=he;z<ee.length;z+=he){const I=Math.min(z+he,ee.length);let w=-1/0;for(let C=z;C<I;C++)ee[C].Total>w&&(w=ee[C].Total);w!==-1/0&&te.push(w)}for(let z=1;z<ve.length;z++)F.push(ve[z])}else{const z=[];(E||[]).forEach(I=>{if(I?.from&&I?.to){const w=ee.some(q=>q.Dimension===I.from),C=ee.some(q=>q.Dimension===I.to);w&&C&&z.push({from:I.from,to:I.to})}}),z.forEach(I=>{const w=ee.findIndex(q=>q.Dimension===I.from),C=ee.findIndex(q=>q.Dimension===I.to);if(w>=0&&C>=0){const q=Math.min(w,C),J=Math.max(w,C);ve.push(ee[q]);let j=ee[q]?.Total??-1/0;for(let Te=q;Te<=J;Te++)ee[Te].Total>j&&(j=ee[Te].Total);j!==-1/0&&te.push(j),F.push(ee[J])}})}G.append("defs").append("marker").attr("id","arrow").attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerWidth",10).attr("markerHeight",7).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",e.connector.connectorMarkerColor!==Re.white?e.connector.connectorMarkerColor:"none"),Ee(ve,te,F,he,O),we(ve,te,F,he,O)}catch(Ce){console.error(Ce)}},Ee=(Ce,ve,F,le,he)=>{try{G.append("g").selectAll("path").data(Ce).enter().filter((te,O)=>le!=null?O<Ce.length-1:O<Ce.length).append("path").attr("d",(te,O)=>e.total.totalVisibility?`M ${M(te.Total)+50},
260
+ ${h(te.Dimension)+h.bandwidth()/2-5}
261
+ H ${60+Math.max(M(ve[O]),M(F[O].Total),M(te.Total))}
262
+ V ${h(F[O].Dimension)+h.bandwidth()/2+5}
263
+ H ${30+M(F[O].Total)}`:`M ${M(te.Total)+30},
264
+ ${h(te.Dimension)+h.bandwidth()/2-5}
265
+ H ${45+Math.max(M(ve[O]),M(F[O].Total),M(te.Total))}
266
+ V ${h(F[O].Dimension)+h.bandwidth()/2+5}
267
+ H ${10+M(F[O].Total)}
268
+ `).style("stroke",e.connector.connectorLineColor!==Re.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",te=>he.includes(te.Dimension)||te.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(te){console.error(te)}},we=(Ce,ve,F,le,he)=>{try{let te=e.connector.connectorFontStyle,O=e.connector.connectorNumberFormat,X=ge/30<i.length?Math.round(ge/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(O=".2s"),G.append("g").selectAll("text1").data(Ce).enter().filter((H,E)=>le!=null?E<Ce.length-1:E<Ce.length).append("text").attr("y",(H,E)=>le==null?h(F[E].Dimension)/2+h(H.Dimension)/2+15:le==1?X<6&&h.bandwidth()>40?h(F[E].Dimension)+h.bandwidth()/2+h.bandwidth()/2+13:h(F[E].Dimension)+h.bandwidth()/2+h.bandwidth()/2+7:h(F[E].Dimension)+h.bandwidth()/2+h.bandwidth()/2*le+12).attr("x",(H,E)=>e.total.totalVisibility?70+Math.max(M(ve[E]),M(F[E].Total),M(H.Total)):50+Math.max(M(ve[E]),M(F[E].Total),M(H.Total))).text((H,E)=>(H.CustomTotal==0&&F[E].CustomTotal!=0&&(H.CustomTotal=1),Ai(F[E].Total,H.Total,parseInt(e.connector.connectorDecimalPrecision),O,parseInt(H.Dimension),parseInt(F[E].Dimension),e))).attr("text-anchor","start").style("font-size",e.connector.connectorFontSize).style("font-family",e.connector.connectorFontFamily).style("font-style",e.connector.connectorFontStyle).style("fill",e.connector.connectorFontColor!==Re.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",te.includes("Italic")?"Italic":"").style("text-decoration",te.includes("Underline")?"Underline":"").style("font-weight",te.includes("Bold")?"Bold":"").style("visibility",H=>he.includes(H.Dimension)||H.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(te){console.error(te)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:L,id:s,style:{width:"100%",height:"100%"}})})},ea=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function La(t,e=1){const r=t.replace("#",""),c=parseInt(r.substring(0,2),16),x=parseInt(r.substring(2,4),16),n=parseInt(r.substring(4,6),16);return isNaN(c)||isNaN(x)||isNaN(n)?t:`rgba(${c},${x},${n},${e})`}function ol(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function ma(t,e,r,c=ea){const{ChartData:x,DimensionList:n,LegendList:l}=t,s=n?.length?n:x[0]?.data?.map(f=>f.dimension)??[],p=Number(r.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?Ur(x,s,p,c,l):e==="scatter"?Br(x,c):e==="bubble"?Wr(x,c):Yr(x,s,e,r,p,c)}function Yr(t,e,r,c,x,n){const l=t.map((s,p)=>{const f=s.properties?.color??n[p%n.length],L=s.properties?.opacity??1,u=new Map;s.data?.forEach(R=>u.set(R.dimension,R.value));const S=e.map(R=>u.get(R)??0),b=s.Axis==="Secondary"||s.properties?.axis==="Secondary"?"y1":"y",_=Number(s.properties?.lineWidth??c.plotArea?.lineWidth??2);return r==="line"||r==="area"?{type:"line",label:s.properties.alias,data:S,borderColor:f,backgroundColor:r==="area"?La(f,x*L):La(f,.1),fill:r==="area",borderWidth:_,borderDash:ol(s.properties?.lineStyle),pointRadius:c.marker?.markerVisibility?Number(c.marker?.markerSize??4):3,tension:Number(c.cjsOptions?.cjsTension??.4),yAxisID:b}:r==="radar"?{label:s.properties.alias,data:S,borderColor:f,backgroundColor:La(f,x*L),fill:!0,borderWidth:_,pointRadius:c.marker?.markerVisibility?Number(c.marker?.markerSize??4):3}:{type:"bar",label:s.properties.alias,data:S,backgroundColor:La(f,x*L),borderColor:f,borderWidth:Number(s.properties?.stackBorderWidth??0),borderRadius:Number(c.cjsOptions?.cjsBorderRadius??c.plotArea?.cornerRadius??0),yAxisID:b}});return{labels:e,datasets:l}}function Ur(t,e,r,c,x){const l=(t.length?t:[]).map(s=>{const p=e.map(L=>s.data?.find(S=>S.dimension===L)?.value??0),f=e.map((L,u)=>{const S=x?.[u]?.color;return La(S??c[u%c.length],r)});return{label:s.properties.alias,data:p,backgroundColor:f,borderColor:f.map(L=>L.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:l}}function Br(t,e){return{datasets:t.map((c,x)=>{const n=c.properties?.color??e[x%e.length],l=c.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||x,y:s.value??0}))??[];return{label:c.properties.alias,data:l,backgroundColor:La(n,.7),borderColor:n,pointRadius:5}})}}function Wr(t,e){return{datasets:t.map((c,x)=>{const n=c.properties?.color??e[x%e.length],l=c.data?.map(s=>({x:typeof s[0]=="number"?s[0]:parseFloat(s.dimension)||x,y:s.value??0,r:Number(s.markerSize??c.properties?.markerSize??8)}))??[];return{label:c.properties.alias,data:l,backgroundColor:La(n,.6),borderColor:n}})}}function ni(t,e,r,c=ea){const{ChartData:x,DimensionList:n}=t,l=n?.length?n:x[0]?.data?.map(L=>L.dimension)??[],s=new Map;l.forEach(L=>{const u=x.reduce((S,b)=>{const _=b.data?.find(A=>A.dimension===L);return S+Math.abs(_?.value??0)},0);s.set(L,u)});const p=Number(r.plotArea?.fillOpacity??.8),f=x.map((L,u)=>{const S=L.properties?.color??c[u%c.length],b=L.properties?.opacity??1,_=new Map;L.data?.forEach(g=>_.set(g.dimension,g.value));const A=l.map(g=>{const B=_.get(g)??0,U=s.get(g)??0;return U>0?parseFloat((B/U*100).toFixed(4)):0}),R=Number(L.properties?.lineWidth??r.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:L.properties.alias,data:A,borderColor:S,backgroundColor:e==="area"?La(S,p*b):La(S,.1),fill:e==="area",borderWidth:R,borderDash:ol(L.properties?.lineStyle),pointRadius:r.marker?.markerVisibility?Number(r.marker?.markerSize??4):3,tension:Number(r.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:L.properties.alias,data:A,backgroundColor:La(S,p*b),borderColor:S,borderWidth:Number(L.properties?.stackBorderWidth??0),borderRadius:Number(r.cjsOptions?.cjsBorderRadius??r.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:l,datasets:f}}function Wa(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function si(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function Hr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function Gr(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function cl(t,e,r){const c=parseInt(r??"0",10);return e==="Thousands"?(t/1e3).toFixed(c)+"K":e==="Millions"?(t/1e6).toFixed(c)+"M":e==="Billions"?(t/1e9).toFixed(c)+"B":t.toFixed(c)}function _r(t,e){return t.find(r=>r.alias==e)}function Kt(t,e,r=!1,c,x){const n=e==="pie"||e==="doughnut"||e==="polarArea",l=e==="horizontalBar";let s=0;const p=300,f=t.plotArea?.gridLinesColor??"#e0e0e0",L=t.legends?.legendFontColor??"#333333",u={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:Gr(t.legends?.legendPosition),labels:{color:L,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??tt,style:Wa(t.legends?.legendFontStyle),weight:si(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,b,_){if(c){const A=new Date().getTime();if(A-s<p){const g=_r(x,b.text);g&&c(g),s=0}else s=A}}},tooltip:{enabled:t.toolTip?.toolTipVisibility!==!1,backgroundColor:t.toolTip?.toolTipTheme==="Dark"?"#222222":"#ffffff",titleColor:t.toolTip?.toolTipTheme==="Dark"?"#ffffff":"#333333",bodyColor:t.toolTip?.toolTipTheme==="Dark"?"#cccccc":"#555555",borderColor:f,borderWidth:1,padding:10,callbacks:{label(S){const b=typeof S.raw=="number"?S.raw:S.raw?.y??0,_=Ze(b,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${_}`}}},datalabels:jr(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:Hr(t.animation?.animationEffect)}:!1};if(!n){const S={display:!0,title:{display:t.xAxisTitle?.xAxisTitleVisibility!==!1,text:t.xAxisTitle?.xAxisTitleText??"Dimension",color:t.xAxisTitle?.xAxisTitleColor??"#000000",font:{size:parseInt(t.xAxisTitle?.xAxisTitleFontSize??"11",10),family:t.xAxisTitle?.xAxisTitleFontFamily??tt,style:Wa(t.xAxisTitle?.xAxisTitleFontStyle)}},ticks:{display:t.xAxisLabel?.xAxisLabelVisibility!==!1,color:t.xAxisLabel?.xAxisLabelColor??"#000000",font:{size:parseInt(t.xAxisLabel?.xAxisLabelFontSize??"11",10),family:t.xAxisLabel?.xAxisLabelFontFamily??tt,style:Wa(t.xAxisLabel?.xAxisLabelFontStyle),weight:si(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:f},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")}},b={display:!0,position:"left",title:{display:t.yAxisTitle?.yAxisTitleVisibility!==!1,text:t.yAxisTitle?.yAxisTitleText??"Measure",color:t.yAxisTitle?.yAxisTitleColor??"#000000",font:{size:parseInt(t.yAxisTitle?.yAxisTitleFontSize??"11",10),family:t.yAxisTitle?.yAxisTitleFontFamily??tt,style:Wa(t.yAxisTitle?.yAxisTitleFontStyle)}},ticks:{display:t.yAxisLabel?.yAxisLabelVisibility!==!1,color:t.yAxisLabel?.yAxisLabelColor??"#000000",font:{size:parseInt(t.yAxisLabel?.yAxisLabelFontSize??"11",10),family:t.yAxisLabel?.yAxisLabelFontFamily??tt,style:Wa(t.yAxisLabel?.yAxisLabelFontStyle),weight:si(t.yAxisLabel?.yAxisLabelFontStyle)},callback(A){return cl(A,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:f},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};l?(u.scales={x:{...b,position:"bottom"},y:{...S,position:"left",reverse:!0}},u.scales.x.title&&(u.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),u.scales.y.title&&(u.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):u.scales={x:S,y:b},r&&(u.scales.y1={display:!0,position:"right",title:{display:t.secondaryYAxisTitle?.secondaryYAxisTitleVisibility!==!1,text:t.secondaryYAxisTitle?.secondaryYAxisTitleText??"",color:t.secondaryYAxisTitle?.secondaryYAxisTitleColor??"#000000",font:{size:parseInt(t.secondaryYAxisTitle?.secondaryYAxisTitleFontSize??"11",10),family:t.secondaryYAxisTitle?.secondaryYAxisTitleFontFamily??tt}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??tt,style:Wa(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:si(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(A){return cl(A,t.secondaryYAxisLabel?.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel?.secondaryYAxisLabelDecimalPrecision)}},grid:{drawOnChartArea:!1},border:{color:t.secondaryYAxisLabel?.secondaryYAxisColor??"#000000",width:parseFloat(t.secondaryYAxisLabel?.secondaryYAxisWidth??"0.5")}}),e.toLowerCase().includes("stack")&&(u.scales?.x&&(u.scales.x.stacked=!0),u.scales?.y&&(u.scales.y.stacked=!0))}return u}function dl(t){if(typeof t=="number")return t;if(t!==null&&typeof t=="object"){if(typeof t.y=="number")return t.y;if(typeof t.x=="number")return t.x}return parseFloat(t)||0}function jr(t,e="bar"){const r=t.annotation,c=e==="pie"||e==="doughnut"||e==="polarArea",x=e==="horizontalBar",n=r?.annotationVisibility??"5";if(n==="5"||!n)return{display:!1};const l=r?.annotationPosition??"1",s=r?.annotationHideZeroValues!==!1,p=parseInt(r?.annotationFontSize??"9",10)||9,f=r?.annotationFontFamily??tt,L=Wa(r?.annotationFontStyle),u=si(r?.annotationFontStyle),S=r?.annotationColor??"#000000",b=r?.annotationSetLabelColor==="2",_=r?.annotationDecimalPrecision??"2",A=r?.annotationNumberFormat??",",R=r?.annotationDisplayUnits??"None";function g(D){const V=D.dataset?.data?.length??0,$=D.dataIndex??0;switch(n){case"1":return!0;case"2":return $===0;case"3":return $===V-1;case"4":return $===0||$===V-1;default:return!1}}function B(D){const V=D.dataset?.data?.[D.dataIndex];return dl(V)}function U(D){if(c)return l==="2"?"center":"end";const V=B(D);switch(l){case"2":return"center";case"3":return V<0?"end":"start";case"1":return V>0?"end":"start";case"4":default:return V>0?"end":"start"}}function W(D){if(c)return l==="2"?"center":"end";const V=B(D);if(x)switch(l){case"2":return"center";case"3":return"right";case"1":case"4":default:return V<0?"left":"right"}switch(l){case"2":return"center";case"3":return V>0?"top":"bottom";case"1":case"4":default:return V<0?"bottom":"top"}}function P(D,V){const $=dl(D);if(s&&$===0)return null;const Z=Ze($,R,A,_);if(c){const ce=V?.chart?.data?.labels?.[V.dataIndex]??"";return ce?`${ce}
269
+ ${Z}`:Z}return Z}return{display:g,anchor:U,align:W,offset:c?l==="2"?0:8:l==="2"?0:4,color:b?D=>{const V=D.dataset?.backgroundColor,$=D.dataset?.borderColor,Z=Array.isArray(V)?V[D.dataIndex]:V;return typeof Z=="string"&&Z?Z:typeof $=="string"&&$?$:S}:S,font:{size:p,family:f,style:L,weight:u},formatter:P,clip:!1}}kt.Chart.register(kt.BarController,kt.LineController,kt.PieController,kt.DoughnutController,kt.ScatterController,kt.BubbleController,kt.RadarController,kt.PolarAreaController,kt.CategoryScale,kt.LinearScale,kt.RadialLinearScale,kt.PointElement,kt.BarElement,kt.LineElement,kt.ArcElement,kt.Title,kt.Tooltip,kt.Legend,kt.Filler,fl);const Qt=({chartType:t,data:e,options:r,formatOptions:c,clientWidth:x,clientHeight:n,className:l,isChartStacked:s})=>{const p=Me.useRef(null),f=Me.useRef(null),L=Me.useRef(!1);Me.useEffect(()=>{if(p.current)return f.current?.destroy(),f.current=new kt.Chart(p.current,{type:t,data:e,options:r}),L.current=!0,()=>{f.current?.destroy(),f.current=null}},[t,s]),Me.useEffect(()=>{if(L.current){L.current=!1;return}const B=f.current;B&&(B.data=e,B.options=r,B.update())},[e,r]);const u=c.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(c.chartTitle?.chartTitleFontStyle)?c.chartTitle.chartTitleFontStyle:[],b=c.chartTitle?.chartTitleColor&&c.chartTitle.chartTitleColor!=="#ffffff"&&c.chartTitle.chartTitleColor!=="#FFFFFF00"?c.chartTitle.chartTitleColor:"rgba(119,119,119)",_=c.chartTitle?.chartTitleFontSize?`${c.chartTitle.chartTitleFontSize}px`:"16px",A=c.chartTitle?.dynamicTitleText||c.chartTitle?.chartTitleText||"",R=c.chartTitle?.chartTitleHTML||A,g=c.chartTitle?.chartTitleVisibility!==!1;return Ge.jsxs("div",{className:l,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[g&&A&&Ge.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:c.chartTitle?.chartTitleText,style:{color:b,fontSize:_,fontFamily:c.chartTitle?.chartTitleFontFamily,fontStyle:S.includes("Italic")?"italic":"normal",fontWeight:S.includes("Bold")?"bold":"normal",textDecoration:S.includes("Underline")?"underline":"none",whiteSpace:"pre",textOverflow:"ellipsis",overflow:"hidden",lineHeight:"1.3em",userSelect:"none",padding:"2px 4px",flexShrink:0},dangerouslySetInnerHTML:{__html:R}}),Ge.jsx("div",{style:{flex:1,minHeight:0},children:Ge.jsx("canvas",{ref:p,style:{width:"100%",height:"100%"}})})]})},yl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"bar",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"bar",p,l,s);return x&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"bar",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},Jr=t=>Ge.jsx(yl,{...t,isChartStacked:!0}),ul=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n=ea,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"bar",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"horizontalBar",p,l,s);return u.indexAxis="y",x&&(u.scales??={},u.scales.x??={},u.scales.y??={},u.scales.x.stacked=!0,u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"bar",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},Zr=t=>Ge.jsx(ul,{...t,isChartStacked:!0}),hl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n=ea,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"line",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"line",p,l,s);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"line",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},Xr=t=>Ge.jsx(hl,{...t,isChartStacked:!0}),xl=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,isChartStacked:x,colorBank:n,addLocalFilterFromLib:l})=>{const s=Me.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Me.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),f=Me.useMemo(()=>ma(t,"area",e,n),[t,e,n]),L=Me.useMemo(()=>{const u=Kt(e,"area",p,l,s);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Qt,{chartType:"line",data:f,options:L,formatOptions:e,clientWidth:r,clientHeight:c})},qr=t=>Ge.jsx(xl,{...t,isChartStacked:!0}),Kr=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.LegendList??[],[t]),s=Me.useMemo(()=>ma(t,"pie",e,x),[t,e,x]),p=Me.useMemo(()=>Kt(e,"pie",!1,n,l),[e]);return Ge.jsx(Qt,{chartType:"pie",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},Qr=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.LegendList??[],[t]),s=Me.useMemo(()=>ma(t,"doughnut",e,x),[t,e,x]),p=Me.useMemo(()=>{const f=Kt(e,"doughnut",!1,n,l),L=e.plotArea?.innerRadius;return L!=null&&(f.cutout=`${L}%`),f},[e]);return Ge.jsx(Qt,{chartType:"doughnut",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},Or=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea})=>{const n=Me.useMemo(()=>ma(t,"scatter",e,x),[t,e,x]),l=Me.useMemo(()=>Kt(e,"scatter",!1),[e]);return Ge.jsx(Qt,{chartType:"scatter",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:c})},en=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(f=>f.properties),[t]),s=Me.useMemo(()=>ma(t,"bubble",e,x),[t,e,x]),p=Me.useMemo(()=>Kt(e,"bubble",!1,n,l),[e]);return Ge.jsx(Qt,{chartType:"bubble",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},tn=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea})=>{const n=Me.useMemo(()=>ma(t,"radar",e,x),[t,e,x]),l=Me.useMemo(()=>{const s=Kt(e,"radar",!1);return delete s.scales,s.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0"},ticks:{color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt}}}},s},[e]);return Ge.jsx(Qt,{chartType:"radar",data:n,options:l,formatOptions:e,clientWidth:r,clientHeight:c})},an=({data:t,formatOptions:e,clientWidth:r,clientHeight:c,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.LegendList??[],[t]),s=Me.useMemo(()=>ma(t,"polarArea",e,x),[t,e,x]),p=Me.useMemo(()=>{const f=Kt(e,"polarArea",!1,n,l);delete f.scales;const L=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(L)?L.includes("Italic")||L.includes("italic"):!1;return f.scales={r:{grid:{color:e.plotArea?.gridLinesColor??"#e0e0e0",display:e.plotArea?.gridLinesVisibility!==!1},ticks:{display:e.xAxisLabel?.xAxisLabelVisibility!==!1,color:e.xAxisLabel?.xAxisLabelColor??"#666666",backdropColor:"transparent",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"10",10),family:e.xAxisLabel?.xAxisLabelFontFamily??tt,style:u?"italic":"normal"}}}},f},[e]);return Ge.jsx(Qt,{chartType:"polarArea",data:s,options:p,formatOptions:e,clientWidth:r,clientHeight:c})},ln=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"bar",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"bar",!1,n,l);return L.scales??={},L.scales.x??={},L.scales.y??={},L.scales.x.stacked=!0,L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"bar",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})},rn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"horizontalBar",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"horizontalBar",!1,n,l);return L.indexAxis="y",L.scales??={},L.scales.x??={},L.scales.y??={},L.scales.x.stacked=!0,L.scales.y.stacked=!0,L.scales.x.min=p?-100:0,L.scales.x.max=100,L.scales.x.ticks={...L.scales.x.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"bar",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})},nn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"line",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"line",!1,n,l);return L.scales??={},L.scales.y??={},L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"line",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})},sn=({data:t,formatOptions:e,clientWidth:r=0,clientHeight:c=0,colorBank:x=ea,addLocalFilterFromLib:n})=>{const l=Me.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),s=Me.useMemo(()=>ni(t,"area",e,x),[t,e,x]),p=Me.useMemo(()=>s.datasets.some(L=>L.data.some(u=>u<0)),[s]),f=Me.useMemo(()=>{const L=Kt(e,"area",!1,n,l);return L.scales??={},L.scales.y??={},L.scales.y.stacked=!0,L.scales.y.min=p?-100:0,L.scales.y.max=100,L.scales.y.ticks={...L.scales.y.ticks,callback:u=>`${u}%`},L},[e,p]);return Ge.jsx(Qt,{chartType:"line",data:s,options:f,formatOptions:e,clientWidth:r,clientHeight:c})};Je.AreaChart=br,Je.BubbleChart=Ir,Je.CJSAreaChart=xl,Je.CJSBubbleChart=en,Je.CJSColumnChart=yl,Je.CJSDonutChart=Qr,Je.CJSHorizontalBarChart=ul,Je.CJSLineChart=hl,Je.CJSNormalizedStackAreaChart=sn,Je.CJSNormalizedStackColumnChart=ln,Je.CJSNormalizedStackHorizontalBarChart=rn,Je.CJSNormalizedStackLineChart=nn,Je.CJSPieChart=Kr,Je.CJSPolarAreaChart=an,Je.CJSRadarChart=tn,Je.CJSScatterChart=Or,Je.CJSStackAreaChart=qr,Je.CJSStackColumnChart=Jr,Je.CJSStackHorizontalBarChart=Zr,Je.CJSStackLineChart=Xr,Je.CJS_DEFAULT_COLORS=ea,Je.ChartJSWrapper=Qt,Je.ColumnChart=tr,Je.ColumnHistogramChart=sr,Je.CustomColumnChart=ar,Je.DonutChart=fr,Je.DotPlot=$r,Je.HorizontalBarChart=yr,Je.HorizontalHistogramChart=pr,Je.LayeredColumnChart=ir,Je.LayeredHorizontalBarChart=xr,Je.LineChart=or,Je.Maps=Nr,Je.NormalizedStackAreaChart=Ar,Je.NormalizedStackColumnChart=rr,Je.NormalizedStackHorizontalBarChart=hr,Je.NormalizedStackLineChart=dr,Je.OrganizationChart=Pr,Je.PieChart=mr,Je.PieofPie=vr,Je.ProgressChart=Cr,Je.PyramidChart=kr,Je.RadialBarChart=Sr,Je.SankeyChart=Dr,Je.ScatterChart=Er,Je.Speedometer=Mr,Je.StackAreaChart=gr,Je.StackColumnChart=lr,Je.StackHorizontalBarChart=ur,Je.StackLineChart=cr,Je.TornadoChart=zr,Je.Treemap=Tr,Je.VennChart=wr,Je.WaterfallChart=Rr,Je.WordCloud=Fr,Je.hexToRgba=La,Je.mapFormatOptionsToChartJS=Kt,Je.transformToChartJSData=ma,Je.transformToNormalizedChartJSData=ni,Object.defineProperty(Je,Symbol.toStringTag,{value:"Module"})}));