pace-chart-lib 1.0.83 → 1.0.84

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(Ze,Ce){typeof exports=="object"&&typeof module<"u"?Ce(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"],Ce):(Ze=typeof globalThis<"u"?globalThis:Ze||self,Ce(Ze["pace-chart-lib"]={},Ze.React,Ze.d3,Ze.d3Annotation,Ze.d3Cloud,Ze.venn,Ze.d3Sankey,Ze.OrgChart,Ze.Chart,Ze.ChartDataLabels))})(this,(function(Ze,Ce,yi,Ll,ml,fl,Tl,vl,Ct,kl){"use strict";function ui(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const v=ui(yi),pt=ui(Ll),Cl=ui(fl),Ni=ui(Tl);var xi={exports:{}},Qa={};/**
2
+ (function(Xe,Ne){typeof exports=="object"&&typeof module<"u"?Ne(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"],Ne):(Xe=typeof globalThis<"u"?globalThis:Xe||self,Ne(Xe["pace-chart-lib"]={},Xe.React,Xe.d3,Xe.d3Annotation,Xe.d3Cloud,Xe.venn,Xe.d3Sankey,Xe.OrgChart,Xe.Chart,Xe.ChartDataLabels))})(this,(function(Xe,Ne,ui,fl,Tl,vl,kl,Cl,Mt,Ml){"use strict";function xi(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const l in t)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(t,l);Object.defineProperty(e,l,s.get?s:{enumerable:!0,get:()=>t[l]})}}return e.default=t,Object.freeze(e)}const T=xi(ui),bt=xi(fl),Sl=xi(vl),Pi=xi(kl);var hi={exports:{}},Oa={};/**
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 Pi;function Ml(){if(Pi)return Qa;Pi=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(o,x,l){var r=null;if(l!==void 0&&(r=""+l),x.key!==void 0&&(r=""+x.key),"key"in x){l={};for(var c in x)c!=="key"&&(l[c]=x[c])}else l=x;return x=l.ref,{$$typeof:t,type:o,key:r,ref:x!==void 0?x:null,props:l}}return Qa.Fragment=e,Qa.jsx=n,Qa.jsxs=n,Qa}var Oa={};/**
10
+ */var Ii;function Fl(){if(Ii)return Oa;Ii=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function l(s,u,r){var n=null;if(r!==void 0&&(n=""+r),u.key!==void 0&&(n=""+u.key),"key"in u){r={};for(var o in u)o!=="key"&&(r[o]=u[o])}else r=u;return u=r.ref,{$$typeof:t,type:s,key:n,ref:u!==void 0?u:null,props:r}}return Oa.Fragment=e,Oa.jsx=l,Oa.jsxs=l,Oa}var ei={};/**
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 Ii;function Sl(){return Ii||(Ii=1,process.env.NODE_ENV!=="production"&&(function(){function t(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===ye?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case A:return"Fragment";case b:return"Profiler";case E:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case K: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 W:return"Portal";case Y:return(h.displayName||"Context")+".Provider";case U:return(h._context.displayName||"Context")+".Consumer";case H:var k=h.render;return h=h.displayName,h||(h=k.displayName||k.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case w:return k=h.displayName||null,k!==null?k:t(h.type)||"Memo";case z:k=h._payload,h=h._init;try{return t(h(k))}catch{}}return null}function e(h){return""+h}function n(h){try{e(h);var k=!1}catch{k=!0}if(k){k=console;var s=k.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return s.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 o(h){if(h===A)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===z)return"<...>";try{var k=t(h);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function x(){var h=se.A;return h===null?null:h.getOwner()}function l(){return Error("react-stack-top-frame")}function r(h){if(te.call(h,"key")){var k=Object.getOwnPropertyDescriptor(h,"key").get;if(k&&k.isReactWarning)return!1}return h.key!==void 0}function c(h,k){function s(){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)",k))}s.isReactWarning=!0,Object.defineProperty(h,"key",{get:s,configurable:!0})}function p(){var h=t(this.type);return he[h]||(he[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 m(h,k,s,d,i,y,T,a){return s=y.ref,h={$$typeof:g,type:h,key:k,props:y,_owner:i},(s!==void 0?s: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,s,d,i,y,T,a){var f=k.children;if(f!==void 0)if(d)if(xe(f)){for(d=0;d<f.length;d++)u(f[d]);Object.freeze&&Object.freeze(f)}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(f);if(te.call(k,"key")){f=t(h);var N=Object.keys(k).filter(function(Z){return Z!=="key"});d=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",M[f+d]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ */var Ei;function wl(){return Ei||(Ei=1,process.env.NODE_ENV!=="production"&&(function(){function t(x){if(x==null)return null;if(typeof x=="function")return x.$$typeof===le?null:x.displayName||x.name||null;if(typeof x=="string")return x;switch(x){case L:return"Fragment";case b:return"Profiler";case Y:return"StrictMode";case I:return"Suspense";case D:return"SuspenseList";case X:return"Activity"}if(typeof x=="object")switch(typeof x.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),x.$$typeof){case Z:return"Portal";case B:return(x.displayName||"Context")+".Provider";case H:return(x._context.displayName||"Context")+".Consumer";case G:var k=x.render;return x=x.displayName,x||(x=k.displayName||k.name||"",x=x!==""?"ForwardRef("+x+")":"ForwardRef"),x;case N:return k=x.displayName||null,k!==null?k:t(x.type)||"Memo";case R:k=x._payload,x=x._init;try{return t(x(k))}catch{}}return null}function e(x){return""+x}function l(x){try{e(x);var k=!1}catch{k=!0}if(k){k=console;var c=k.error,d=typeof Symbol=="function"&&Symbol.toStringTag&&x[Symbol.toStringTag]||x.constructor.name||"Object";return c.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",d),e(x)}}function s(x){if(x===L)return"<>";if(typeof x=="object"&&x!==null&&x.$$typeof===R)return"<...>";try{var k=t(x);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function u(){var x=te.A;return x===null?null:x.getOwner()}function r(){return Error("react-stack-top-frame")}function n(x){if(Q.call(x,"key")){var k=Object.getOwnPropertyDescriptor(x,"key").get;if(k&&k.isReactWarning)return!1}return x.key!==void 0}function o(x,k){function c(){Te||(Te=!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))}c.isReactWarning=!0,Object.defineProperty(x,"key",{get:c,configurable:!0})}function p(){var x=t(this.type);return he[x]||(he[x]=!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.")),x=this.props.ref,x!==void 0?x:null}function m(x,k,c,d,i,h,v,a){return c=h.ref,x={$$typeof:A,type:x,key:k,props:h,_owner:i},(c!==void 0?c:null)!==null?Object.defineProperty(x,"ref",{enumerable:!1,get:p}):Object.defineProperty(x,"ref",{enumerable:!1,value:null}),x._store={},Object.defineProperty(x._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(x,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(x,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:v}),Object.defineProperty(x,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(x.props),Object.freeze(x)),x}function f(x,k,c,d,i,h,v,a){var g=k.children;if(g!==void 0)if(d)if(de(g)){for(d=0;d<g.length;d++)y(g[d]);Object.freeze&&Object.freeze(g)}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 y(g);if(Q.call(k,"key")){g=t(x);var P=Object.keys(k).filter(function(z){return z!=="key"});d=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",M[g+d]||(P=0<P.length?"{"+P.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,f,N,f),M[f+d]=!0)}if(f=null,s!==void 0&&(n(s),f=""+s),r(k)&&(n(k.key),f=""+k.key),"key"in k){s={};for(var ne in k)ne!=="key"&&(s[ne]=k[ne])}else s=k;return f&&c(s,typeof h=="function"?h.displayName||h.name||"Unknown":h),m(h,f,y,i,x(),s,T,a)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===g&&h._store&&(h._store.validated=1)}var S=Ce,g=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),ye=Symbol.for("react.client.reference"),se=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=Object.prototype.hasOwnProperty,xe=Array.isArray,ge=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(h){return h()}};var pe,he={},O=S["react-stack-bottom-frame"].bind(S,l)(),X=ge(o(l)),M={};Oa.Fragment=A,Oa.jsx=function(h,k,s,d,i){var y=1e4>se.recentlyCreatedOwnerStacks++;return L(h,k,s,!1,d,i,y?Error("react-stack-top-frame"):O,y?ge(o(h)):X)},Oa.jsxs=function(h,k,s,d,i){var y=1e4>se.recentlyCreatedOwnerStacks++;return L(h,k,s,!0,d,i,y?Error("react-stack-top-frame"):O,y?ge(o(h)):X)}})()),Oa}var Ei;function Fl(){return Ei||(Ei=1,process.env.NODE_ENV==="production"?xi.exports=Ml():xi.exports=Sl()),xi.exports}var Ge=Fl();function me(t,e,n){console.error(t,e,n)}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||{}),Yt=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))(Yt||{}),bt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(bt||{}),ya=(t=>(t.butt="butt",t.round="round",t.square="square",t))(ya||{}),Qe=(t=>(t.primary="Primary",t.secondary="Secondary",t))(Qe||{}),Et=(t=>(t.visible="visible",t.hidden="hidden",t))(Et||{});const fa="20,10,5,5,5,10",wl={1:"",2:v.curveLinear,3:v.curveStep},Dl={1:pt.annotationLabel,2:pt.annotationLabel,3:pt.annotationCallout,4:pt.annotationCalloutElbow,5:pt.annotationCalloutCurve};var Je=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(Je||{}),ei=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(ei||{}),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||{}),hi=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(hi||{}),Wt=(t=>(t.start="1",t.middle="2",t.end="3",t))(Wt||{}),Fa=(t=>(t.top="1",t.bottom="2",t))(Fa||{});const Ta={none:"1",discrete:"2",colorTheme:"3"},jt={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var ti=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(ti||{});const Vl={singleColor:"2",multiColor:"1"},ce={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Ea=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Ea||{}),Ra=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(Ra||{});const Ht={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var Ie=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(Ie||{});const tt="Calibri";var Ci=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(Ci||{}),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},Ri={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:Ie.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:Ie.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:tt,chartTitleFontStyle:[],chartTitleColor:Ie.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:Ie.black,xAxisColorInverted:Ie.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:tt,xAxisLabelFontStyle:[],xAxisLabelColor:Ie.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:"",xAxisTicksMode:"Auto",xAxisTicksCount:"3",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:Ie.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:Ie.transparent,yAxisColorInverted:Ie.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:tt,yAxisLabelFontStyle:[],yAxisLabelColor:Ie.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:"",yAxisTicksMode:"Auto",yAxisTicksCount:"3",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:tt,yAxisTitleFontStyle:[],yAxisTitleColor:Ie.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:Ie.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:tt,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:Ie.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:Ie.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:Ie.black,vennLabelColor:Ie.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:Ie.black},plotArea:{plotAreaColor:Ie.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:Ie.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:Ie.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:Ie.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:tt,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:Ie.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:Ie.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:Ie.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:Ie.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:Ie.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:Ie.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:Ie.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:Ie.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:Ie.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:tt,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:Ie.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:Ie.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:tt,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:Ie.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:Ie.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:Ie.black,connectorFontColor:Ie.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:Ie.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:tt,footerNoteFontStyle:[],footerNoteFontColor:Ie.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:Ie.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:Ie.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:tt,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:Ie.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:tt,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:Ie.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:Ie.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:Ie.black,bubbleBorderColor:Ie.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:Ie.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:Ie.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:tt,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:Ie.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:tt,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:Ie.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 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 pi={1:"",2:v.curveLinear,3:v.curveStep},Nl=[le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart],wa={auto:"Auto",custom:"Custom"};function za(t,e,n){const o=Math.max(2,parseInt(n)||3),x=(e-t)/(o-1),l=[];for(let r=0;r<o;r++)l.push(parseFloat((t+r*x).toFixed(6)));return l}const Pl=[le.ColumnChart,le.StackColumnChart,le.NormalizedStackColumnChart,le.LayeredColumnChart,le.CustomColumnChart,le.ColumnHistogramChart,le.HorizontalBarChart,le.StackHorizontalBarChart,le.NormalizedStackHorizontalBarChart,le.LayeredHorizontalBarChart,le.HorizontalHistogramChart,le.LineChart,le.StackLineChart,le.NormalizedStackLineChart,le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.WaterfallChart,le.DotPlot],zi=[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 Pt(t,e,n,o,x){var l=document.createElement("div");l.style.visibility="hidden",l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",l.style.fontSize=e==null?"":e+"px",l.style.fontFamily=n??"",l.style.margin="0",l.style.padding="1px",l.style.border="none",x?(l.style.width=x+"px",l.style.whiteSpace="normal",l.style.overflowWrap="break-word"):l.style.whiteSpace="nowrap",l.innerHTML=t,document.body.appendChild(l);var r=l.getBoundingClientRect(),c=r.width,p=r.height;return o!=null?(l.style.transform=`rotate(${o}deg)`,r=l.getBoundingClientRect(),l.remove(),[c,p,r.width,r.height]):(l.remove(),[r.width,r.height])}function Il(t,e){let n=t.dataTableProperties&&t.dataTableProperties.dataTable,o=n?e*7<50?50:e*7>100?100:e*7:0;return n&&o<30&&(o=30),o}function Mi(t,e,n,o,x,l,r,c,p,m,L,u,S,g=[]){let W=l.dataTableProperties&&l.dataTableProperties.dataTable&&l.xAxisLabel.xAxisPosition=="0"&&!S,A=!1;//!formatOptions.plotArea.fitChart;
24
- let E=t<200?200:S?e:t,b=e<200?200:S?t:e,U=E*.15*.8,Y=Ol(r,l),H=U<Y[0]+10?U:Y[0]+10,I=u?Tt(l.xAxisLabel.xAxisNumberFormat,c).map(k=>k):c,D=I?I[0]+"":"",w=D.length;I&&I.forEach(k=>{k=k+"";let s=k.trim()?.length||0;s>w&&(w=s,D=k.trim())});let z=Pt(D,l.xAxisLabel.xAxisLabelFontSize,l.xAxisLabel.xAxisLabelFontFamily,l.xAxisLabel.xAxisLabelRotation),K=z[0]+5,ye=z[3]+10,se;l.xAxisLabel.labelTextWrap?l.xAxisLabel.multiLineLabelWrap?se=l.xAxisLabel.maxXAxisLabelWidth:se=ye<b*.15?ye:b*.15:se=ye;let te=l.xAxisTitle.xAxisTitleVisibility?l.xAxisTitle.xAxisDynamicTitleText.length!==0?Pt(l.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:Pt(l.xAxisTitle.xAxisTitleText,"13",tt)[1]:W?5:0;te=te>b*.1?b*.1:te;let xe=W?0:l.xAxisLabel.xAxisLabelVisibility?se:0,ge=l.yAxisTitle.yAxisTitleVisibility?l.yAxisTitle.yAxisDynamicTitleText.length!==0?Pt(l.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:Pt(l.yAxisTitle.yAxisTitleText,"13",tt)[1]:0;ge=ge>E*.1?E*.1:ge;const pe=n*1.1,he=x*1.1;let O=l.yAxisLabel.yAxisLabelVisibility?Ui(pe,he,l,!1,L)+5:g.length?Il(l,v.max(g,k=>k?.length||0)||0)+10:0,X=l.secondaryYAxisLabel.secondaryYAxisLabelVisibility?Ui(o,p,l,!0,L):0,M=l.secondaryYAxisTitle.secondaryYAxisTitleVisibility?l.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?Pt(l.secondaryYAxisTitle.secondaryYAxisTitleHTML,l.secondaryYAxisTitle.secondaryYAxisTitleFontSize,l.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:Pt(l.secondaryYAxisTitle.secondaryYAxisTitleText,l.secondaryYAxisTitle.secondaryYAxisTitleFontSize,l.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;M=M>E*.1?E*.1:M;let h=l.chartTitle.chartTitleVisibility?l.chartTitle.dynamicTitleText.length!==0?Pt(l.chartTitle.chartTitleHTML,void 0,void 0)[1]:Pt(l.chartTitle.chartTitleText,"16",tt)[1]:0;return h=h>b*.1?b*.1:h,{width:E,height:b,isChartScrollable:A,legendMargin:H,dimensionHeightWidthArray:z,actualDimesionWidth:K,maxDimensionWidth:ye,xTitle:te,xLabel:xe,yTitle:ge,yLabel:O,secondaryYLabel:X,secondaryAxisTitleWidth:M,chartTitleHeight:h}}function El(t,e,n,o,x,l,r,c,p,m,L,u,S,g){try{const W=g??Mi(t,e,n,o,x,l,r,c,p,m,L,u,S),A=S?W.xTitle+W.xLabel:W.yTitle+W.yLabel,E=l.legends.legendPosition,b=l.legends.legendVisibility,U=l.xAxisLabel.xAxisPosition=="1"&&S;let Y=0,H=0;const I=m&&!S?W.secondaryYLabel+W.secondaryAxisTitleWidth:0;switch(E){case Je.none:case Je.none:H=15+I,Y=A+5;break;case Je.top:H=U?A+5:15+I,Y=U?5+I+W.xTitle:A+5;break;case Je.right:H=U?A+5+W.legendMargin:W.legendMargin+I+20,Y=U?5+I+W.xTitle+W.legendMargin:A+5;break;case Je.bottom:H=U?A+5:15+I,Y=U?5+I+W.xTitle:A+5;break;case Je.left:Y=W.legendMargin+A+33,H=15+I;break;default:H=15+I,Y=A+5}const D=l.chartPadding?.paddingArrayLTRB;return D&&(Y+=D[0],H+=D[2]),l.dataTableProperties&&l.dataTableProperties.dataTable&&L&&!S&&(Y=Y+35),{left:Y,right:H,yLabel:W.yLabel,yTitle:W.yTitle,xLabel:W.xLabel,xTitle:W.xTitle,dimensionHeightWidthArray:W.dimensionHeightWidthArray,chartTitleHeight:W.chartTitleHeight,legendMargin:W.legendMargin,secondaryYLabel:W.secondaryYLabel,secondaryAxisTitleWidth:W.secondaryAxisTitleWidth}}catch(W){throw W}}function Rl(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{const A=g??Mi(t,e,n,o,x,l,r,c,p,m,L,u,S),b=l.legends.legendVisibility?l.legends.legendPosition:Je.none,U=W&&!S?12:0,Y=S?A.yTitle+A.yLabel:A.xTitle+A.xLabel;let H=0,I=0;switch(b){case Je.none:H=A.chartTitleHeight+5,I=Y+5+U;break;case Je.top:H=35+A.chartTitleHeight,I=Y+U;break;case Je.right:H=A.chartTitleHeight+5,I=Y+5+U;break;case Je.bottom:I=30+Y+U,H=A.chartTitleHeight+5;break;case Je.left:H=A.chartTitleHeight+5,I=Y+5+U;break;default:H=A.chartTitleHeight+5,I=Y+5+U}l.xAxisLabel.xAxisPosition&&!S&&l.xAxisLabel.xAxisPosition=="1"&&(I=I-A.xLabel,H=H+A.xLabel),L&&!S&&(H=H+12);const D=m&&S?A.secondaryYLabel+A.secondaryAxisTitleWidth:0;D&&(H=H+D);const w=l.chartPadding?.paddingArrayLTRB;return w&&(H+=w[1],I+=w[3]),{top:H,bottom:I,chartTitleHeight:A.chartTitleHeight,xAxisRelatedMargin:Y,xLabel:A.xLabel,xTitle:A.xTitle}}catch(A){throw A}}function Mt(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{const A=Mi(t,e,n,o,x,l,r,c,p,m,L,u,S,W),E=El(t,e,n,o,x,l,r,c,p,m,L,u,S,A),b=Rl(t,e,n,o,x,l,r,c,p,m,L,u,S,A,!0);let U,Y=t-E.left-E.right,H=e-b.top-b.bottom,I,D=!1;({visibleBars:U,columnWidth:I,scrollbarVisible:D}=Xl(S?H:Y,l,g));const w={top:b.top,bottom:b.bottom,left:E.left,right:E.right};if(S){const z=L?30:0;w.right=w.right+z}return l.connector.connectorVisibility!="2"&&g?.chartType==le.StackColumnChart&&(w.top=w.top+20),l.connector.connectorVisibility!="2"&&g?.chartType==le.StackHorizontalBarChart&&(w.right=w.top+20),{margin:w,yLabel:E.yLabel,xLabel:E.xLabel,yTitle:E.yTitle,xTitle:E.xTitle,dimensionHeightWidthArray:E.dimensionHeightWidthArray,chartTitleHeight:E.chartTitleHeight,legendMargin:E.legendMargin,secondaryYLabel:E.secondaryYLabel,secondaryAxisTitleWidth:E.secondaryAxisTitleWidth,visibleBars:U,columnWidth:I,scrollbarVisible:D}}catch(A){throw A}}function St(t,e,n,o){t.attr("viewBox","0 0 "+e+" "+n);const{chartAreaColor:x,chartAreaBorder:l}=o.chartArea;if(t.style("background-color",x),l){const r=o.chartArea.chartAreaBorderColor,c=o.chartArea.chartAreaBorderThickness,p=o.chartArea.chartAreaBorderStyle.toString(),m=p==="1"?"solid":p==="2"?"dashed":"dotted";t.style("outline",`${c}px ${m} ${r}`).style("outline-offset",`-${c}px`)}else t.style("outline","none").style("outline-offset",null)}const Ft=(t,e)=>{let n=v.select(t.current);n.selectAll("*").remove();let o=$i(Ri,e),x=t.current.getBoundingClientRect(),l=x.width,r=x.height;return{formatOptions:o,svg:n,width:l,height:r}},ea=(t,e,n)=>{let o=[];if(!t.dataTableProperties.dataTable)return{formatOptions:t,dataTableLegendsList:o};let x=!1;return e.forEach(l=>{l?.properties?.showInDataTable==!0&&(x=!0,o.push(l.properties.alias))}),n.forEach(l=>{l?.properties?.showInDataTable==!0&&(x=!0,o.push(l.properties.alias))}),x||(t.dataTableProperties.dataTable=!1),t.dataTableProperties.dataTableLegends||(o=[]),{formatOptions:t,dataTableLegendsList:o}};function $i(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(n=>{const o=t[n],x=Object.prototype.hasOwnProperty.call(e,n),l=e[n];if(!x||l===void 0){e[n]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const r=Yi(o),c=Yi(l);r&&c&&$i(o,l)}),e}function Yi(t){return Object.prototype.toString.call(t)==="[object Object]"}function Rt(t,e,n,o,x){parseFloat(t.yAxisLabel.yAxisIntervalText);let l=parseFloat(t.yAxisLabel.yAxisMaxText),r=parseFloat(t.yAxisLabel.yAxisMinText),c=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"),r=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let Y=t.yAxisLabel.yAxisMaxText;l=String(Y).length>0?parseFloat(Y):n,l&&(n=l),parseFloat(t.yAxisLabel.yAxisIntervalText)<n&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else l=void 0,r=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<x&&(p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),c=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):x,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(c=void 0,p=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){c=void 0,p=void 0;const Y=l!==void 0&&!Number.isNaN(l)?l:n,H=Math.max(Y,x);n=H,x=H,l!==void 0&&!Number.isNaN(l)&&(l=H)}let m=e?Xe(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,L=n?Xe(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,u=o?Xe(o,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=x?Xe(x,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,g=l?Xe(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,W=r?Xe(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,A=c?Xe(c,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,E=p?Xe(p,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=m<L||m===L?n:e;if(r){let Y=W<L?n:r;b=b<Y?Y:b}if(l){let Y=g>m?l:e;b=b<Y?Y:b}l&&r&&(b=g>W?l:r);let U=u<S?x:o;if(p){let Y=E<S?x:p;U=U<Y?Y:U}if(c){let Y=A>S?c:x;U=U<Y?Y:U}return c&&p&&(U=A>E?c:p),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:U,customYaxisMaxValue:n,secondaryCustomYaxisMaxValue:x}}function Xe(t,e,n,o,x){try{let l,r="",c=o,p;if(e==="Auto")return zl(t);switch(e!=ei.none&&(e==ei.thousands&&(l=1e3,r="K"),e==ei.millions&&(l=1e6,r="M"),e==ei.billions&&(l=1e9,r="B"),t=t/l),x&&t<0&&(t=-t),n){case Aa.percentage:return p=`.${c}%`,v.format(p)(t);case Aa.general:return p=`.${c}f`,v.format(p)(t)+r;case Aa.scientific:let m=Number(c);return p=`.${m==0?1:(m+1).toString()}n`,v.format(p)(t)+r;case Aa.currency_USD:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"$"+v.format(p)(t)+r;case Aa.currency_CAD:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"C$"+v.format(p)(t)+r;case Aa.currency_EUR:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"€"+v.format(p)(t)+r;case Aa.currency_CHF:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"CHF"+v.format(p)(t)+r;case Aa.currency_UK:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"£"+v.format(p)(t)+r;case Aa.currency_INR:if(p=`,.${c}f`,t<0){const L=Math.abs(t);return"-$"+v.format(p)(L)+r}return"₹"+v.format(p)(t)+r;case Aa.commaSeparated:return p=`,.${c}f`,v.format(p)(t)+r;default:return p=".2f",v.format(p)(t)+r}}catch(l){throw l}}function zl(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 n=v.format(".2f")(t);return+n===Math.floor(t)?v.format(".0f")(t):n}else return e>=.01?v.format(".2f")(t):e>0?v.format(".2e")(t):"0"}function Ui(t,e,n,o,x){try{{let l,r,c=o?n.secondaryYAxisLabel.secondaryYAxisDisplayUnits:n.yAxisLabel.yAxisDisplayUnits,p=o?n.secondaryYAxisLabel.secondaryYAxisNumberFormat:n.yAxisLabel.yAxisNumberFormat,m=o?n.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:n.yAxisLabel.yAxisLabelDecimalPrecision,L=o?n.secondaryYAxisLabel.secondaryYAxisLabelFontSize:n.yAxisLabel.yAxisLabelFontSize,u=o?n.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:n.yAxisLabel.yAxisLabelFontFamily;if(c!="None")return l=Xe(Math.floor(t)||Math.floor(e),c,p,m??"2").toString(),r=Pt(l,L,u)[0],r<30?30:r+5;try{return l=Xe(Math.floor(t)||Math.floor(e),c,p,m??"2").toString(),x&&(l="-100%"),r=Pt(l,L,u)[0],r<30?30:r+5}catch{}}}catch(l){throw l}}function wt(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(n){throw n}}function kt(t,e,n,o,x,l,r){try{let c=r??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",c+"-clip").append("rect").attr("width",o).attr("height",n>0?x-n:x),t.append("rect").attr("width",o).attr("height",n>0?x-n:x).attr("stroke",e.plotArea.plotAreaBorder&&!zi.includes(l)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==Ie.white&&!zi.includes(l)?e.plotArea.plotAreaColor:"none")}catch(c){throw c}}function $l(t,e){const n=t.yPosition,o=t.yPosition+t.height,x=e.yPosition,l=e.yPosition+e.height;return n<l&&o>x}function yt(t,e,n,o,x,l,r,c,p){try{let m=o.yAxisLabel.yAxisIntervalsVisibility,L=!1,u=m?parseFloat(o.yAxisLabel.yAxisIntervalText):void 0,S=[],g;if(x.chartType===le.TornadoChart){const A=Math.max(Math.abs(e),Math.abs(t)),E=r||A,b=l||e;if(u&&u>0){for(let U=b;U<=E+1e-6;U+=u)S.push(parseFloat(U.toFixed(6)));g=S.length}else if(o.yAxisLabel.yAxisTicksMode===wa.custom)S=za(b,E,o.yAxisLabel.yAxisTicksCount),g=S.length;else{L=!0;const U=6,H=(E-b)/U;for(let I=0;I<=U;I++){const D=b+I*H;S.push(parseFloat(D.toFixed(6)))}g=c?p/80:n/80}return{yAxisLabelArray:S,customTickValue:g,autoLabelFlag:L}}if(!r&&t>0){const E=(t-e)*.05;t=t+E}if(u&&u!==0&&u!==void 0){let A=l||l==0?l:e,E=r||r==0?r:t;A<0?g=Math.floor((E-A)/u):g=Math.floor(E/u);let b=18;(r||r==0)&&(t=r);let U=l||l==0?l:e<0?Math.round(e):0;if(S.push(U),g>100){let Y="Tick count cannot exceed more than 100.";A<0?u=(E-U)/100:u=E/100}if(g=g<100?g:100,g>b)for(let Y=0;Y<parseInt(g)&&(U+=u,parseFloat(U.toFixed(5))<=t);Y++)S.push(U);else for(let Y=0;Y<b&&(U+=u,U<=t);Y++)S.push(U)}else if(o.yAxisLabel.yAxisTicksMode===wa.custom&&Pl.includes(x.chartType)){const A=l||l==0?l:e;S=za(A,t,o.yAxisLabel.yAxisTicksCount),g=S.length}else{L=!0;let A=Pt((r||x.yMaxLeft).toString(),o.yAxisLabel.yAxisLabelFontSize,o.yAxisLabel.yAxisLabelFontFamily,0);S=Bi(l||x.yMinLeft,t,c?p:n,c?A[1]:A[0]),g=c?p/80:n/80}return{yAxisLabelArray:S,customTickValue:g,autoLabelFlag:L}}catch(m){throw m}}function Bi(t,e,n,o=80){const x=e-t;if(!isFinite(x)||Math.abs(x)<1e-12)return[Number(t.toFixed(12))];const l=x<10?10:Math.max(2,Math.floor(n/o)),r=x/l,c=Math.pow(10,Math.floor(Math.log10(r))),p=[1,1.5,2,2.5,5,10];let m=p.map(W=>W*c).find(W=>Math.ceil(x/W)<=l);m||(m=p.at(-1)*c);const L=Math.floor(t/m)*m,u=Math.ceil(e/m)*m,S=Math.round((u-L)/m),g=new Array(S+1);for(let W=0;W<=S;W++)g[W]=Number((L+W*m).toFixed(12));return g}function Zt(t,e,n,o,x,l){try{let r=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",n>0?l-n:l).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Ie.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const c=t.append("g").call(x);c.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),c.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Ie.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",r.includes("Italic")?"Italic":"").style("text-decoration",r.includes("Underline")?"Underline":"").style("font-weight",r.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),c.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(r){throw r}}function bi(t,e,n,o,x,l,r){let c=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${r},0)`).attr("height",n>0?l-n:l).attr("width",o).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Ie.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const p=t.append("g").call(x).attr("transform",`translate(${r},0)`);p.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==Ie.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",c.includes("Italic")?"Italic":"").style("text-decoration",c.includes("Underline")?"Underline":"").style("font-weight",c.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 Yl(t,e){if(!t||t.length===0)return[];const n=Math.max(2,parseInt(e)||3);if(n>=t.length)return[...t];const o=t.length-1,x=new Set;for(let l=0;l<n;l++)x.add(Math.round(l*o/(n-1)));return Array.from(x).sort((l,r)=>l-r).map(l=>t[l])}function gt(t,e,n){return n.xAxisLabel.xAxisTicksMode===wa.custom?Yl(t,n.xAxisLabel.xAxisTicksCount):Ul(t,e)}function Ul(t,e){try{let n=[],o=e/30<t.length?Math.round(e/30):t.length;if(o>=t.length)return n=t,n;let x=Math.round(t.length/o);(t.length-1)%x!=0&&(t.length-1)%(x+1)==0&&(x=x+1),n.push(t[0]);let l;for(let r=1;r<t.length-1;r++){const c=r*x;if(c>t.length)break;n.push(t[c]),l=c}if(!n.includes(t[t.length-1])){let r=l>=Math.round(t.length-t.length*.02);n.push(t[t.length-1])}return n=n.filter(r=>r)}catch(n){throw n}}function ta(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{let A=e.chartType!==le.ColumnHistogramChart?gt(g,u,o):[],E=[],b=c[3]+10;e.chartType!=le.ColumnHistogramChart?E=L?Tt(o.xAxisLabel.xAxisNumberFormat,A.map(O=>O)).map(O=>O):A:A.forEach(O=>{E.push(e.formattedDimensionListMap.get(O))});let U=!o.plotArea.fitChart&&(e.chartType==le.AreaChart||e.chartType==le.StackAreaChart||e.chartType==le.NormalizedStackAreaChart);t||(t=t);let Y=o.xAxisLabel.xAxisLabelFontStyle,H="rotate("+-o.xAxisLabel.xAxisLabelRotation+")";o.dataTableProperties&&o.dataTableProperties.dataTable&&Nl.includes(e.chartType)&&o.xAxisLabel.xAxisPosition!="1"&&(o.xAxisLabel.xAxisLabelVisibility=!1);let I=o.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const D=t.append("g").attr("id","x-axis");D.append("rect").attr("transform",`translate(1,${I==="0"?x>0?S-x:S:I==="1"?-n:l(0)})`).attr("height",n).attr("width",u).attr("fill",o.xAxisLabel.xAxisLabelVisibility&&o.xAxisLabel.xAxisBackgroundColor?o.xAxisLabel.xAxisBackgroundColor!==Ie.white?o.xAxisLabel.xAxisBackgroundColor:"none":o.chartArea.chartAreaColor);const w=D.append("g").attr("transform",`translate(0,${I=="0"?x>0?S-x:S:I=="1"?0:l(0)})`).call(r);let z=I==="1"?"5":"0",K;o.xAxisLabel.labelTextWrap?o.xAxisLabel.multiLineLabelWrap?K=o.xAxisLabel.maxXAxisLabelWidth:K=b<p*.15?b:p*.15:K=o.xAxisLabel.xAxisLabelRotation==0?m:b;const ye=typeof W.step=="function"?W.step():m,se=parseInt(o.xAxisLabel.xAxisLabelFontSize)*1.2,te=Math.floor(ye/se),xe=o.xAxisLabel.xAxisLabelRotation==0;let ge=w.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(K)).style("height",ye+"px").attr("transform",(O,X)=>`rotate(${I==="1"?-o.xAxisLabel.xAxisLabelRotation:o.xAxisLabel.xAxisLabelRotation!=0?180-o.xAxisLabel.xAxisLabelRotation:0}) translate (${o.xAxisLabel.xAxisLabelRotation!=0?z+`, -${X==0&&U?15:ye/2}`:-K/2+" , "+(I==="1"?"-15":"8")})`);xe||ge.style("overflow","visible"),Wi()==="safari"&&ge.attr("width",o.xAxisLabel.labelTextWrap?b<p*.125?b:p*.125:n).attr("height","20px");let he=ge.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",xe?"center":"end").style("align-items",xe?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Wi()==="safari"||I==="1"?"":o.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(o.xAxisLabel.labelTextWrap&&!o.xAxisLabel.multiLineLabelWrap||!o.xAxisLabel.labelTextWrap)&&he.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),o.xAxisLabel.labelTextWrap&&o.xAxisLabel.multiLineLabelWrap&&he.style("-webkit-line-clamp",te.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),he.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",Y.includes("Italic")?"Italic":"").style("text-decoration",Y.includes("Underline")?"Underline":"").style("font-weight",Y.includes("Bold")?"Bold":"").style("visibility",o.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===le.ColumnHistogramChart?he.attr("title",(O,X)=>Xe(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((O,X)=>Xe(O,o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision,!1)):he.attr("title",(O,X)=>(""+E[X]).trim()).html((O,X)=>(""+E[X]).trim()),w.selectAll("text").style("visibility",(o.xAxisLabel.xAxisLabelVisibility,"hidden")),w.selectAll("line").style("stroke",o.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",o.xAxisLabel.xAxisLabelVisibility||o.plotArea.gridLinesVertical?"visible":"hidden"),w.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(A){throw A}}function Wi(){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 Hi={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"]},Bl=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const n=Math.floor(e-25569),o=new Date(n*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"),Hl=(t,e,n,o)=>{const x=Hi.short[e],l=Hi.long[e],r=String(t).padStart(2,"0"),c=String(e+1).padStart(2,"0"),p=Wl(n),m=String(n);switch(o){case"Month":return l;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${m}`;case"Year":return m;case"Default":return`${r}-${x}-${m}`;case"DD-MM-YYYY":return`${r}-${c}-${m}`;case"MM-DD-YYYY":return`${c}-${r}-${m}`;case"DD-MM":return`${r}-${c}`;case"YYYY-MM-DD":return`${m}-${c}-${r}`;case"YYYY-MM":return`${m}-${c}`;case"YYYY":return m;case"MM-YYYY":return`${c}-${m}`;case"MMM-YY":return`${x}-${p}`;case"YY-MMM":return`${p}-${x}`;case"MMMM-YY":return`${l}-${p}`;case"MMMM-YYYY":return`${l}-${m}`;case"DD-MMM":return`${r}-${x}`;case"DD-MMM-YY":return`${r}-${x}-${p}`;case"DD-MMM-YYYY":return`${r}-${x}-${m}`;default:return`${r}-${x}-${m}`}},Tt=(t,e)=>{try{return e.map(n=>{const o=Bl(n);if(!o)return n;const{day:x,month:l,year:r}=o;return Hl(x,l,r,t)})}catch(n){throw n}};function ja(t,e,n){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let o=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(n).enter().filter(l=>l.isVisible).append("g").attr("class","seriesLabels").attr("transform",l=>`translate(${l.xPosition}, ${l.yPosition})`).append("foreignObject").attr("width",l=>l.width).attr("height",l=>l.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(l=>l.seriesValue)}}function Gl(t,e,n,o,x,l){const r=n.xAxisLabel.xAxisPosition!="1"?e.left-20-x:5;return t?`rotate(-90) translate(-${e.top+o},${r})`:`translate(${e.left},${e.top+o+(n?.xAxisLabel?.xAxisPosition=="1"?0:t?l:x)})`}function Dt(t,e,n,o,x,l,r,c,p,m,L){try{let u=n.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",Gl(e,o,t,L,x,p)).attr("class","xAxisTitle").attr("width",e?L:m).attr("height",r+"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 Vt(t,e,n,o,x,l,r,c,p,m,L){try{let u=n>0?t-n:t,S=x.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",o?l.left:`-${l.top+u}`).attr("y",o?l.top+u+c:l.left-r-c).attr("class","yAxisTitle").attr("transform",o?"":"rotate(-90)").attr("width",o?p:u).attr("height",r+"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 Gt(t,e,n,o,x,l,r,c,p,m=!1){let L=t.append("foreignObject").attr("visibility",e&&o.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",m?`${n.left}`:`-${n.top+(x>0?l-x:l)}`).attr("y",m?`${n.top-c-p-2}`:`${n.left+r+c-2}`).attr("class","yAxisTitleSecondary").attr("transform",m?"rotate(0)":"rotate(-90)").attr("width",m?r:x>0?l-x:l).attr("height",p+"px");o.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?L.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.secondaryYAxisTitle.secondaryYAxisTitleText).html(o.secondaryYAxisTitle.secondaryYAxisTitleHTML?o.secondaryYAxisTitle.secondaryYAxisTitleHTML:o.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",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 Nt(t,e,n,o){let x=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",n-4).attr("height",o+"px");const l=p=>{const m=document.createElement("div");return m.innerHTML=p,m.textContent||m.innerText||""},c=!!e.chartTitle.chartTitleHTML?l(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?x.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",c).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 ft(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 _l(t){const e=t.indexOf(" - ");return e==-1?Ci.default:t.slice(e+3)}const ka=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function Ja(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Ut(t,e,n){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:o,minVal:x,maxVal:l}=e.annotation.annotationRangeFilter;return t.filter(r=>{const c=n(r);switch(o){case"lt":return c<=l;case"gt":return c>=x;case"in":return c>=x&&c<=l;case"not-in":return c<x||c>l;default:return!0}})}function $a(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H,I,D,w){try{const z=m===le.TornadoChart;let K=new Map,ye=p.annotation.annotationType??"1",se=p.annotation.annotationPosition.toString()!="4"?p.annotation.annotationPosition:null,te=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const xe=p.annotation.connectorType?.toLowerCase()==="curve";if(p.annotation.annotationVisibility){let ge=[ye=="1"?"connector":""],pe=[],he=l.annotation(),O=p.annotation.connectorType,X=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=Si(h,p,m);let s=[],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}),X){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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"1":for(let a=0;a<t[0].data.length;a++)t.forEach(f=>{f.data[a]&&pe.push({Dimension:f.data[a].dimension,Measure:f.data[a].value,Legend:f.data[a].legend,LabelPosition:se||f.properties.annotationPosition,Labelcolor:f.properties[te],hoverText:ka(f,w),Axis:f.properties.axis,LegendUniqueId:f.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]&&pe.push({Dimension:a.data[N].dimension,Measure:a.data[N].value,Legend:a.data[N].legend,LabelPosition:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),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:se||a.properties.annotationPosition,Labelcolor:a.properties[te],hoverText:ka(a,w),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;pe.forEach((a,f)=>{i<a.Measure&&(i=a.Measure)});let y=i*.1;pe.forEach((a,f)=>{let N={note:{label:a.Measure>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":Xe(m===le.TornadoChart?Math.abs(a.Measure):a.Measure,p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:D&&m!==le.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":m===le.TornadoChart?"end":"middle"},data:D?{y:z?_l(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:pi[p.annotation.connectorCurve],points:xe?Ja(0,0):[[0,0],[0,0]]},disable:ge,subject:{height:15,width:15},color:a.Labelcolor,type:gi(l,parseFloat(ye)),height:L,width:u};if(D){let ne=a.Axis===Qe.primary?n:o;(gt(g,W,p).includes(a.Dimension)||m===le.TornadoChart)&&!r.includes(a.Legend)&&ne(a.Measure)<=S&&ne(a.Measure)>=0&&s.push(N)}else gt(g,S,p).includes(a.Dimension)&&!r.includes(a.Legend)&&(a.Axis==Qe.primary?n(a.Measure)<=W&&n(a.Measure)>=0:o(a.Measure)<=W&&o(a.Measure)>=0)&&s.push(N)}),p.annotation.annotationHideZeroValues&&(s=s.filter(a=>D?a.data.x.measure!==0:a.data.y.measure!==0)),s=Ut(s,p,a=>D?a.data.x.measure:a.data.y.measure),h.length===0?(h=s,K=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}]))):K=new Map(h.map(a=>[a.legendUniqueId,a])),s.forEach(a=>{const f=a.data.legendUniqueId;if(h.length!=0){const N=K.get(f);N&&(a.dx=N.dx,a.dy=N.dy,a.data.isVisible=N.isVisible??!0,N?.connectorPoints&&N.connectorPoints.length>=(xe?3:2)?a.connector.points=N.connectorPoints:a.connector.points=xe?Ja(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),he.editMode(p.annotation.annotationDraggable&&H).accessors({x:function(a){if(D){let f=a.x.axis===Qe.primary?n:o,N=a.x.axis;return Gi(p,a.x.measure?a.x.measure:0,a.position,f,y,void 0,m,I,N)}else if(m===le.ColumnChart){const f=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=U(f);return N!=null?e(a.x)+N-(Y-U.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==Qe.primary)return ai(a.y.measure,parseFloat(a.position),n,y,a.prevValue,m);if(D){const f=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,N=U&&m!==le.DotPlot?U(f):0;return z?U(a.y)+U.bandwidth()/2:U?e(a.y)+N-(Y-U.bandwidth())/2-5:e(a.y)-5}else return ai(a.y.measure,parseFloat(a.position),o,y,a.prevValue,m)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,h.forEach(f=>{f.data.x==a.data.x&&f.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"),f.data.isVisible=!0)})),d.forEach(f=>{(f.data?.legendUniqueId==a.data.legendUniqueId||f.legendUniqueId==a.data.legendUniqueId)&&(f.dx=a._dx*u/f.width,f.dy=a._dy*L/f.height,f.connectorPoints=a.connector?.points?.map(N=>[...N])||[])}),b){const f=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}));b(f)}T.selectAll(".connector").attr("hoverId",f=>f.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[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",f=>f.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[p.annotation.connectorStyle.toLowerCase()]).filter(f=>f._dx==0&&f._dy==0).remove(),T.selectAll(".annotation-note-label").filter(f=>f.data&&f.data.isVisible).style("display","block")}).on("noteclick",function(a){p.annotation.annotationDraggable&&H&&(a.data.isVisible=!1,h.forEach(f=>{f.data.x==a.data.x&&f.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"),f.data.isVisible=!1)}),T.selectAll(".annotation-note-label").filter(f=>f.data&&!f.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>n.invert(a.y)}).notePadding(0).annotations(d),p.plotArea.fitChart&&E.selectAll(".annotation-group").remove();let T=wi(E,p,x,M,he,k,D);if(p.animation?.animationEnabled){const a=p.animation.animationDuration,f=et[p.animation.animationEffect],N=he.accessors(),ne=m===le.LineChart,Z=m===le.DotPlot,fe=(Re,Te=0)=>{const Me=N.x(Re.data),J=N.y(Re.data);return`translate(${Me+Te}, ${J})`};if(Z)T.selectAll(".annotation").attr("opacity",0).attr("transform",Re=>fe(Re,-15)).transition().duration(a).ease(f).attr("opacity",1).attr("transform",Re=>fe(Re));else if(ne){const Re=e.range?e.range():[0,1],Te=Math.min(Re[0],Re[1]),Me=Math.max(Re[0],Re[1])-Te,J=(Ee,Le=100)=>{for(let Ue=0;Ue<=Le;Ue++){const ve=Ue/Le;if((f??v.easeLinear)(ve)>=Ee)return ve}return 1};T.selectAll(".annotation").attr("opacity",0).each(function(Ee){const Le=N.x(Ee.data)??Te,Ue=Me>0?Math.max(0,Math.min(1,(Le-Te)/Me)):0,ve=J(Ue)*a;v.select(this).transition().delay(ve).duration(0).attr("opacity",1)})}else T.selectAll(".annotation").attr("transform",function(Re){if(D){const Te=n?n(0):0,Me=N.y(Re.data);return`translate(${Te}, ${Me})`}else{const Te=N.x(Re.data),Me=Re.data?.y?.axis===Qe.primary?n:o??n,J=Me?Me(0):0;return`translate(${Te}, ${J})`}}).transition().duration(a).ease(f).attr("transform",function(Re){const Te=N.x(Re.data),Me=N.y(Re.data);return`translate(${Te}, ${Me})`})}}}catch(z){throw z}}function jl(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H,I){try{let D=u.annotation.annotationType??"1";if(u.annotation.annotationVisibility){let w=[D=="1"?"connector":""],z=[],K=new Map,ye=l.annotation(),se=u.annotation.connectorType,te=u.annotation.annotationVisibility,xe=u.annotation.annotationFontStyle,ge=[],pe=[],he=u.annotation.connectorType?u.annotation.connectorType.toLowerCase():"None";const O=u.annotation.connectorType?.toLowerCase()==="curve";let X=JSON.parse(JSON.stringify(u.plotArea.dataLabelsCoordinates));X=Si(X,u,le.CustomColumnChart);let M=[],h=[];X.length!=0&&X.forEach(i=>{i.dx=i.dx*g/i.width,i.dy=i.dy*S/i.height,i.width=g,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(te){case"2":t.forEach((i,y)=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(T=>z.push(T[0]));break;case le.StackAreaChart:c.forEach(T=>z.push(T[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(y=>z.push(y[y.length-1]));break;case le.StackAreaChart:c.forEach(y=>z.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:z.push({...i.data[0],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(T=>z.push(T[0]));break;case le.StackAreaChart:c.forEach(T=>z.push(T[0]));break}}),t.forEach(i=>{switch(i.properties.type){case le.ColumnChart:case le.LineChart:case le.AreaChart:z.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case le.StackColumnChart:r.forEach(y=>z.push(y[y.length-1]));break;case le.StackAreaChart:c.forEach(y=>z.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=>z.push({...a,alias:i.properties?.alias}));break;case le.StackColumnChart:let y=r.findIndex(a=>a.key===i.properties.legend);y!==-1&&r[y].forEach(a=>z.push(a));break;case le.StackAreaChart:let T=c.findIndex(a=>a.key===i.properties.legend);T!==-1&&c[T].forEach(a=>z.push(a));break}});break;case"5":break;case"6":t.forEach((i,y)=>{let T=i.properties.annotation.toString();switch(i.properties.type){case le.ColumnChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)z.push(i.data[N]);break;case"2":break;case"3":z.push(i.data[0]);break;case"4":z.push(i.data[i.data.length-1]);break;case"5":z.push(i.data[0]),z.push(i.data[i.data.length-1]);break}break;case le.AreaChart:case le.LineChart:switch(T){case"1":for(let N=0;N<t[y].data.length;N++)z.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":z.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":z.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":z.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}),z.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=r.findIndex(N=>N.key===i.properties.legend);a!==-1&&r[a].forEach((N,ne)=>{switch(String(r[a].individualAnnotationVisibility)){case"1":z.push(r[a][ne]);break;case"2":break;case"3":let Z=r[a][0];z.find(Me=>Me.key==Z.key)||z.push(Z);break;case"4":let fe=r[a][r[0].length-1];z.find(Me=>Me.key==fe.key)||z.push(fe);break;case"5":let Re=r[a][0],Te=r[a][r[0].length-1];if(!z.find(Me=>Me.key==Re.key||Me.key==Te.key)){z.push(r[a][0]),z.push(r[a][r[0].length-1]);break}}});break;case le.StackAreaChart:const f=c.findIndex(N=>N.key===i.properties.legend);f!=-1&&c[f].forEach((N,ne)=>{switch(String(c[f].individualAnnotationVisibility)){case"1":z.push(c[f][ne]);break;case"2":break;case"3":let Z=c[f][0];z.find(Me=>Me.key==Z.key)||z.push(Z);break;case"4":let fe=c[f][c[0].length-1];z.find(Me=>Me.key==fe.key)||z.push(fe);break;case"5":let Re=c[f][0],Te=c[f][c[0].length-1];if(!z.find(Me=>Me.key==Re.key||Me.key==Te.key)){z.push(Re),z.push(Te);break}}});break}});break}let k=0;z.forEach((i,y)=>{k<i.value&&(k=i.value)});let s=k*.1;z.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":Xe(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":Xe(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:he,curve:pi[u.annotation.connectorCurve],points:O?Ja(0,0):[[0,0],[0,0]]},disable:w,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:gi(l,parseFloat(D)),height:S,width:g};i.legend&&i.dimension?!p.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==Qe.primary?n(i.value)<=E&&n(i.value)>=0:o(i.value)<=E&&o(i.value)>=0)&&M.push(T):!p.includes(i.key)&&(i.data.axis==Qe.primary?n(i[1])<=E&&n(i[1])>=0:o(i[1])<=E&&o(i[1])>=0)&&M.push(T)}),u.annotation.annotationHideZeroValues&&(M=M.filter(i=>i.data.y!==0)),M=Ut(M,u,i=>i.data.y),X.length===0?(X=M,K=new Map(X.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}]))):K=new Map(X.map(i=>[i.legendUniqueId,i])),M.forEach(i=>{const y=i.data.legendUniqueId;if(X.length!=0){const T=K.get(y);T&&(i.dx=T.dx,i.dy=T.dy,i.data.isVisible=T.isVisible??!0,T?.connectorPoints&&T.connectorPoints.length>=(O?3:2)?i.connector.points=T.connectorPoints:i.connector.points=O?Ja(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)}),ye.editMode(u.annotation.annotationDraggable&&I).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)+H(i.x.stacklegend)-(L-H.bandwidth())/2;case le.StackAreaChart:case le.LineChart:case le.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)+H(T)-(L-H.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const y=i.type??i.x.type;return i.x.axis==Qe.primary?ai(i.y,parseFloat(i.position),n,s,i.prevValue,y):ai(i.y,parseFloat(i.position),o,s,i.prevValue,y)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,X.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*g/y.width,y.dy=i._dy*S/y.height,y.connectorPoints=i.connector?.points?.map(T=>[...T])||[])}),Y){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}));Y(y)}d.selectAll(".connector").attr("hoverId",y=>y.data.currentLegend).style("stroke",u.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[u.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${he}`).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",Yt[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&&I&&(i.data.isVisible=!1,X.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?n.invert(i.y):o.invert(i.y)}).notePadding(0).annotations(h),u.plotArea.fitChart||U.selectAll(".annotation-group").remove();let d=wi(U,u,x,xe,ye,he,!1);if(u.animation?.animationEnabled){const i=u.animation.animationDuration,y=et[u.animation.animationEffect],T=ye.accessors();d.selectAll(".annotation").attr("transform",function(a){const f=T.x(a.data),N=a.data.type||a.type,Z=(a.data?.x?.axis||a.data?.axis)===Qe.primary?n:o;let fe;return N===le.StackColumnChart||N===le.StackAreaChart?fe=Z(a.data.prevValue??0):fe=Z(0),`translate(${f}, ${fe})`}).transition().duration(i).ease(y).attr("transform",function(a){const f=T.x(a.data),N=T.y(a.data);return`translate(${f}, ${N})`})}}}catch(D){throw D}}const Si=(t,e,n)=>{try{let o=[le.PieChart,le.DonutChart].includes(n)?"plotArea":"annotation";return t=e[o].annotationDraggable&&!!1?t??[]:[],t}catch(o){throw o}},gi=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(n){throw n}},ai=(t,e,n,o,x,l)=>{try{let r=[le.LineChart,le.StackLineChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.NormalizedStackLineChart,le.StackAreaChart];switch(x||(x=0),e){case 1:let c;switch(l){case le.LineChart:case le.HorizontalBarChart:case le.ColumnChart:case le.AreaChart:case le.StackAreaChart:c=t<0?n(t)+7:n(t)-15;break;case le.StackHorizontalBarChart:case le.NormalizedStackLineChart:case le.StackLineChart:case le.NormalizedStackAreaChart:case le.StackAreaChart:case le.StackColumnChart:c=t<0?n(t)+5:n(t)-15;break;case le.TornadoChart:c=n(t)+n.bandwidth()/2;break;default:c=t<0?n(x)+5:n(t)-15}return c;case 2:return r.includes(l)?n(t):t===0?l==="stack"?"":n(0)-15:n(x+(t-x)/2);case 3:return r.includes(l)?t===-1||t<0?n(t)-10:n(t)+10:l.includes("stack")?t===-1&&x===0?n(0)+10:t===1&&x!==0?n(x)-10:x<0?n(x)+10:x===0&&t<0?n(0)+10:x===0&&t>0?n(0)-10:n(x)-10:t<0?n(0)+10:n(0)-10}}catch(r){throw r}},ia=(t,e,n,o,x,l)=>{try{const r=l?.DataTableData??[];let c=[],p=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){const m=t.dataTableProperties.dataTableLegends;t.dataTableProperties.dataTableAxisLabel?p=Fi(x[0],void 0,t):p=0;const L=[...o,...r];t.xAxisLabel.xAxisLabelVisibility=!1;const S=!t.dataTableProperties.disableLegendIcon?35:0;let g=e+n-S;L.forEach((W,A)=>{if(W?.properties?.showInDataTable??!0){let E={data:W.data.filter(b=>x.includes(b.dimension)),properties:{legend:W.properties.alias,color:W.properties.color,markerColor:W.properties.markerColor,markerShape:W.properties.markerShape,lineStyle:W.properties.lineStyle,height:m?Fi(W.properties.alias.includes("~$~")?W.properties.alias.split("~$~")[1]:W.properties.alias,g,t):20}};p+=E.properties.height,c.push(E)}})}else p=0,c=[];return c.length==0&&(p=0,c=[],t.dataTableProperties.dataTable=!1),{dataTable:c,dataTableHeight:p}}catch{}},Fi=(t,e,n)=>{try{let o=20,x=Pt(t,n.dataTableProperties.dataTableFontSize,n.dataTableProperties.dataTableFontFamily)[0];return o=Pt(t,n.dataTableProperties.dataTableFontSize,n.dataTableProperties.dataTableFontFamily,void 0,x>e&&!n.dataTableProperties.legendsWrapText?e:void 0)[1],o}catch(o){throw o}};function ua(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H,I){try{let D=function(T,a,f,N){a===0&&T.append("foreignObject").attr("x",-H.left).attr("y",xe).attr("class","blankClass").attr("width",H.left).attr("height",y).append("xhtml:div").style("width",H.left).style("height",`${y}px`).style("border-width",O?`0px 0px ${w.dataTableAxisLabel?M:0}px 0px`:"0px 0px 0px 0px").style("border-style",O?`solid ${h} ${h} solid`:"solid solid solid solid").style("border-color",O?`black ${X} ${X} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const Z=T.append("foreignObject").attr("x",-H.left).attr("y",xe+he).attr("width",H.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",te).style("height",`${N}px`).style("padding-left",w.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>Da(S,a,void 0,K,ye,"width")).style("border-style",()=>Da(S,a,void 0,K,ye,"style")).style("border-color",()=>Da(S,a,void 0,K,ye,"color"));if(!w.disableLegendIcon)switch(u){case le.ColumnChart:case le.StackColumnChart:case le.NormalizedStackColumnChart:Z.append("xhtml:div").style("height","10px").style("width","15px").style("background",f.properties.color).style("border-radius","1px");break;case le.LineChart:case le.StackLineChart:case le.NormalizedStackLineChart:Ki(f,Z,S);break;case le.AreaChart:case le.StackAreaChart:case le.NormalizedStackAreaChart:Qi(f,Z,S);break}const fe=f.properties.legend,Re=S?.legends?.legendColorMode=="1"?f?.properties?.color:S?.legends?.legendSelectedUnicolor,Te=Z.append("xhtml:div").style("max-width",te).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",Re??"black").style("width",w.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",fe).text(fe);w.legendsWrapText&&Te.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const w=S.dataTableProperties,z=w.dataTableFontStyle,K=A.length,ye=o.length,se=b[0]?b[0]:0,te=typeof r.step=="function"?r.step():x,xe=I-L,ge=2;let pe=20,he=0;const O=S.dataTableOuterBorder.borderButtonVisibility,X=S.dataTableOuterBorder.lineColor,M=S.dataTableOuterBorder.lineWidth,h=S.dataTableOuterBorder.lineStyle,k=T=>T===0?te+ge+se/2:T===K-1?te+ge-se/2:te,s=T=>Xe(u.includes("100stack")?T.TooltipMeasure/T.TotalMeasure:T.TooltipMeasure||T.value,w.dataTableDisplayUnits,w.dataTableNumberFormat,w.dataTableDecimalPrecision),d=T=>T.style("font-size",w.dataTableFontSize+"px").style("font-family",w.dataTableFontFamily).style("font-style",z.includes("Italic")?"Italic":"").style("text-decoration",z.includes("Underline")?"Underline":"").style("font-weight",z.includes("Bold")?"Bold":"");v.selectAll("#dataTableG"+Y).remove();const i=n.append("g").attr("id","dataTableG"+Y);let y=0;w.dataTableAxisLabel&&(y=Fi(A[0],void 0,S),pe=y),o.forEach((T,a)=>{he+=!w.dataTableAxisLabel&&a===0?0:pe,pe=T.properties.height,w.dataTableLegends&&D(i,a,T,pe);const f=i.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+Y+" .foreignObject").data(()=>T.data).enter().filter(N=>r(N.dimension)).append("g").attr("fill",Ie.transparent).attr("transform",(N,ne)=>`translate(${ne===0?0:r(N.dimension)-te/2},0)`);a===0&&w.dataTableAxisLabel&&f.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",xe).attr("id",(N,ne)=>ne).attr("width",(N,ne)=>k(ne)).attr("height",`${y}px`).append("xhtml:div").style("width",(N,ne)=>k(ne)).style("height",`${y}px`).style("border-width",(N,ne)=>Da(S,ne,void 0,K,ye,"width","colHeaders")).style("border-style",(N,ne)=>Da(S,ne,void 0,K,ye,"style","colHeaders")).style("border-color",(N,ne)=>Da(S,ne,void 0,K,ye,"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=>U.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)).text(N=>U.get(Array.isArray(N.dimension)?N.dimension[0]:N.dimension)),f.append("foreignObject").attr("x",0).attr("y",xe+he).attr("width",(N,ne)=>k(ne)).attr("height",pe).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(N,ne)=>k(ne)).style("height",`${pe}px`).style("line-height",`${pe}px`).style("border-width",(N,ne)=>Da(S,a,ne,K,ye,"width")).style("border-style",(N,ne)=>Da(S,a,ne,K,ye,"style")).style("border-color",(N,ne)=>Da(S,a,ne,K,ye,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(d).style("color",w.dataTableLabelColor).attr("title",N=>s(N)).text(N=>s(N))})}catch(D){throw D}}function Da(t,e,n,o,x,l,r){try{const c=t.dataTableOuterBorder,p=t.dataTableInnerBorder,m=c.borderButtonVisibility,L=p.horizontalBorderLineButton,u=p.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,g={w:c.lineWidth,s:c.lineStyle,c:c.lineColor},W={w:p.horizontalBorderLineWidth,s:p.horizontalBorderLineStyle,c:p.horizontalBorderLineColor},A={w:p.verticalBorderLineWidth,s:p.verticalBorderLineStyle,c:p.verticalBorderLineColor},E={w:"0",s:"solid",c:"black"},b=m?g:E,U=L?W:E,Y=u?A:E,H=o-1,I=x-1;let D=E,w=E,z=E,K=E;switch(r?(D=b,z=U,K=e===0?b:E,w=e===H?b:Y):n===void 0?(K=b,w=E,D=e===0&&!S?b:E,z=e===I?b:U):(D=e===0&&!S?b:E,z=e===I?b:U,K=n===0?Y:E,w=n===H?b:Y),l){case"width":return`${D.w}px ${w.w}px ${z.w}px ${K.w}px`;case"style":return`${D.s} ${w.s} ${z.s} ${K.s}`;case"color":return`${D.c} ${w.c} ${z.c} ${K.c}`}}catch(c){throw c}}function Lt(t,e,n){let o=[];for(let x=0;x<t.length;x++){const l=t[x];let r={},c=0,p=0,m=0;for(let L=0;L<e.length;L++){let u=e[L].data.find(S=>S.dimension===t[x])?.value||0;r[e[L].properties.legend]=u,c=c+(n?Math.abs(u):u),p+=u>0?u:0,m+=u}r.total=c,r.dimension=l,r.absoluteTotal=p,r.displayTotal=m,o.push(r)}return o}function la(t,e,n,o,x,l,r,c){try{let p=n.seriesLabel.seriesLabelApplySeries,m=n.seriesLabel.seriesLabelPosition,L=[],u=o[0].legend,S=Pt(u,n.seriesLabel.seriesLabelFontSize,n.seriesLabel.seriesLabelFontFamily);return o.forEach(g=>{let W=!1;if(p=="1"?W=!0:W=g.properties.seriesLabelVisibility,W){let A={},E=m=="Right"?g.data[g.data.length-1]:g.data[0],b=c?E.value>0?E[1]:E[0]:E.value;g.properties.axis==Qe.primary||!x?A.yPosition=e(b):l&&x&&(A.yPosition=x(b)),(A.yPosition<0||A.yPosition>r)&&(W=!1),A.yPosition=A.yPosition-S[1]/2,A.isVisible=W,A.seriesValue=g.properties.alias,A.height=S[1],A.width=S[0];let U=!1;L.length>0&&L.some(Y=>{U||(U=$l(Y,A))}),W&&!U&&L.push(A)}else return}),u="",L.forEach(g=>{g.seriesValue.length>u.length&&(u=g.seriesValue)}),S=Pt(u,n.seriesLabel.seriesLabelFontSize,n.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,L.forEach(g=>{g.height=S[1],g.width=S[0],g.xPosition=m=="Right"?t+(l?10:0)-S[0]:5}),{labelArray:L,heightWidth:S}}catch(p){throw p}}function Ya(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E,b,U,Y,H){try{let I=p.annotation.annotationType??"1";if(p.annotation.annotationVisibility){let D=[I=="1"?"connector":""],w=[],z=new Map,K=l.annotation(),ye=p.annotation.connectorType,se=p.annotation.annotationVisibility,te=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",xe=p.annotation.annotationFontStyle,ge=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";const pe=p.annotation.connectorType?.toLowerCase()==="curve";let he=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates));he=Si(he,p,m);let O=[],X=[];switch(he.length!=0&&he.forEach(s=>{s.dx=s.dx*u/s.width,s.dy=s.dy*L/s.height,s.width=u,s.height=L}),se){case"2":t.forEach(s=>w.push(s[0]));break;case"3":t.forEach(s=>w.push(s[s.length-1]));break;case"4":t.forEach(s=>w.push(s[0])),t.forEach(s=>w.push(s[s.length-1]));break;case"1":for(let s=0;s<t[0].length;s++)t.forEach(d=>w.push(d[s]));break;case"5":break;case"6":t.forEach(s=>{switch(s[0]?.properties?.annotation?.toString()){case"1":for(let i=0;i<t[0].length;i++)w.push(s[i]);break;case"2":break;case"3":w.push(s[0]);break;case"4":w.push(s[t[0].length-1]);break;case"5":w.push(s[0]),w.push(s[t[0].length-1]);break}});break}let M=0;w.forEach((s,d)=>{M<s.Measure&&(M=s.Measure)});let h=M*.1;p.annotation.annotationHideZeroValues&&(w=w.filter(s=>(s[1]<0&&s[0]<0?s[0]-s[1]:s[1]===0&&s[0]<0?s[1]+s[0]:s[1]-s[0])!==0)),w.forEach((s,d)=>{let i={note:{label:s[1]-s[0]>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(s[1]-s[0]/1e9)+"B":Xe(s[1]<0&&s[0]<0?s[0]-s[1]:s[1]===0&&s[0]<0?s[1]+s[0]:s[1]-s[0],p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:H?s.data.labelPosition==2?"middle":"start":"middle"},data:H?{y:s.data.dimension,x:s[1]>0?s[1]:s[0],prevValue:s[0]>=0?s[0]:s[1],position:p.annotation.annotationPosition=="4"?s.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:s.key.includes("~$~")?s.key.split("~$~")[1]:s.key,isVisible:!0,hoverId:s.properties.alias?Xa(s.properties.alias):Xa(s.key),legendUniqueId:s.properties.legendUniqueId+"~$~"+s.data.dimension+"~$~"+(s.key.includes("~$~")?s.key.split("~$~")[1]:s.key)+"~$~"+(s[1]>0?s[1]:s[0])}:{x:s.data.dimension,y:s[1]>0?s[1]:s[0],prevValue:s[0]>=0?s[0]:s[1],position:p.annotation.annotationPosition=="4"?s.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:s.key.includes("~$~")?s.key.split("~$~")[1]:s.key,isVisible:!0,hoverId:s.properties?.alias?Xa(s.properties.alias):Xa(s.key),legendUniqueId:s.properties.legendUniqueId+"~$~"+s.data.dimension+"~$~"+(s.key.includes("~$~")?s.key.split("~$~")[1]:s.key)+"~$~"+(s[1]>0?s[1]:s[0])},dx:0,dy:0,connector:{end:ge,curve:pi[p.annotation.connectorCurve],points:pe?Ja(0,0):[[0,0],[0,0]]},disable:D,subject:{height:15,width:15},color:s.properties&&s.properties[te]?s.properties[te]:s.data.labelColor,type:gi(l,parseFloat(I)),height:L,width:u};g.includes(s.data.dimension)&&Jl(W,S,H,s,n)&&O.push(i)}),O=Ut(O,p,s=>H?s.data.x-s.data.prevValue:s.data.y-s.data.prevValue),he.length===0?(he=O,z=new Map(he.map(s=>[s.data.legendUniqueId,{measure:H?s.data.x:s.data.y,dimension:H?s.data.y:s.data.x,legendUniqueId:s.data.legendUniqueId,dx:s.dx,dy:s.dy,connectorPoints:s.connector?.points||[],isVisible:s.data.isVisible??!0,width:s.width,height:s.height}]))):z=new Map(he.map(s=>[s.legendUniqueId,s])),O.forEach(s=>{const d=s.data.legendUniqueId;if(he.length!=0){const i=z.get(d);i&&(s.dx=i.dx,s.dy=i.dy,s.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(pe?3:2)?s.connector.points=i.connectorPoints:s.connector.points=pe?Ja(s.dx,s.dy):[[0,0],[0,0]])}X.push(s)}),K.editMode(p.annotation.annotationDraggable&&Y).accessors({x:function(s){return H?Gi(p,s.x,parseFloat(s.position),n,h,s.prevValue,m):e(s.x)+e.bandwidth()/2},y:function(s){return H?e(s.y)+e.bandwidth()/2:ai(s.y,parseFloat(s.position),n,h,s.prevValue,m)}}).on("dragend",function(s){if(s.data.isVisible||(s.data.isVisible=!0,he.forEach(d=>{d.data.x==s.data.x&&d.data.y==s.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==s.data.x&&i.data.y==s.data.y).attr("display","block"),d.data.isVisible=!0)})),X.forEach(d=>{(d.data?.legendUniqueId==s.data.legendUniqueId||d.legendUniqueId==s.data.legendUniqueId)&&(d.dx=s._dx*u/d.width,d.dy=s._dy*L/d.height,d.connectorPoints=s.connector?.points?.map(i=>[...i])||[])}),b){const d=X.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}));b(d)}k.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[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",Yt[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(s){p.annotation.annotationDraggable&&Y&&(s.data.isVisible=!1,he.forEach(d=>{d.data.x==s.data.x&&d.data.y==s.data.y&&(k.selectAll(".annotation-note-label").filter(i=>i.data.x==s.data.x&&i.data.y==s.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:s=>e.invert(s.x),y:s=>n.invert(s.y)}).notePadding(0).annotations(X),E.selectAll(".annotation-group").remove();let k=wi(E,p,x,xe,K,ge,H);if(p.animation?.animationEnabled){const s=p.animation.animationDuration,d=et[p.animation.animationEffect],i=K.accessors();if(m===le.StackLineChart||m===le.NormalizedStackLineChart){const T=e.range?e.range():[0,1],a=Math.min(T[0],T[1]),f=Math.max(T[0],T[1])-a,N=(ne,Z=100)=>{for(let fe=0;fe<=Z;fe++){const Re=fe/Z;if((d??v.easeLinear)(Re)>=ne)return Re}return 1};k.selectAll(".annotation").attr("opacity",0).each(function(ne){const Z=i.x(ne.data)??a,fe=f>0?Math.max(0,Math.min(1,(Z-a)/f)):0,Re=N(fe)*s;v.select(this).transition().delay(Re).duration(0).attr("opacity",1)})}else k.selectAll(".annotation").attr("transform",function(T){if(H){const a=n?n(0):0,f=i.y(T.data);return`translate(${a}, ${f})`}else{const a=i.x(T.data),f=n?n(0):0;return`translate(${a}, ${f})`}}).transition().duration(s).ease(d).attr("transform",function(T){const a=i.x(T.data),f=i.y(T.data);return`translate(${a}, ${f})`})}}}catch(I){throw I}}function Jl(t,e,n,o,x){const l=x(o[1]>0?o[1]:o[0]);return n?l>=0&&l<=e:l<=t&&l>=0}const wi=(t,e,n,o,x,l,r)=>{t.selectAll(".annotation-group").remove();let c=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${n.left},${n.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(x);return c.selectAll("rect").style("visibility","hidden"),c.selectAll(".annotation-subject").remove(),c.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.annotation.connectorStyle.toLowerCase()]).style("visibility",p=>(r?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),c.selectAll(`.connector-${l}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",p=>(r?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),c.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.annotation.connectorStyle.toLowerCase()]).filter(p=>p._dx==0&&p._dy==0).remove(),c.selectAll(".connector-end").filter(p=>p.connector.end=="dot"&&p._dx==0&&p._dy==0).remove(),c.selectAll(".annotation-note-label").filter(p=>p.data&&!p.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&c.selectAll(".annotation-note-content").attr("transform",function(){const m=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(m)return`translate(${r?0:parseFloat(m[1])}, 0)`}),c.selectAll("text").style("text-anchor",p=>r&&p.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==Ie.white?e.annotation.annotationColor:"none"),c.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"),c},ra=(t,e,n,o,x,l)=>{try{let r=t.yAxisLabel.yAxisLabelFontStyle,c="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${o})`).attr("height",n+10).attr("width",x).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==Ie.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const p=e.append("g").call(l).attr("transform",`translate(0,${o})`);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",c=="rotate(0)"?"middle":"end").attr("dx",c=="rotate(0)"?".2em":"-.1em").attr("dy",c=="rotate(0)"?"1em":".15em").attr("transform",c).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==Ie.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",r.includes("Italic")?"Italic":"").style("text-decoration",r.includes("Underline")?"Underline":"").style("font-weight",r.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(r){throw r}};function Zl(t,e,n,o,x,l,r,c){return t?`rotate(${90-n.xAxisLabel.xAxisLabelRotation})
25
- translate(${-(o(x*.01)+l)} ,${-c/2})`:`rotate(${90-n.xAxisLabel.xAxisLabelRotation})
26
- translate(${n.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-l},${-c/2}`:-r/2+" ,2"})`}const na=(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A,E)=>{try{const b=L===le.TornadoChart;let U=t.xAxisLabel.xAxisLabelFontStyle,Y=parseInt(t.xAxisLabel.xAxisPosition),H=gt(m,o,t),I=u?Tt(t.xAxisLabel.xAxisNumberFormat,H.map(he=>he)).map(he=>he):H;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let D;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?D=t.xAxisLabel.maxXAxisLabelWidth:D=n;let w=A.step();const z=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,K=Math.floor(w/z),ye=t.xAxisLabel.xAxisLabelRotation==0;let se=e.append("rect").attr("id","yAxisRect").attr("transform",L===le.TornadoChart?`translate(${-D-1},0)`:`translate(${Y===0?-D-5:Y===1?x:c(0)+(-D-5)},0)`).attr("height",o).attr("width",L===le.TornadoChart?D:D+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==Ie.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const te=e.append("g").attr("id","yAxisG").attr("transform",b?`translate(${c(0)},0)`:`translate(${Y===0?0:Y===1?x:c(0)},0)`).call(l);let pe=te.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",D).attr("height",w+"px").attr("transform",Zl(b,Y,t,c,p,D,n,w)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",ye?"center":"start").style("align-items",ye?"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",K.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",U.includes("Italic")?"Italic":"").style("text-decoration",U.includes("Underline")?"Underline":"").style("font-weight",U.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(he,O)=>I[O]).html((he,O)=>I[O]),L===le.TornadoChart){if(r){const he=e.append("g").attr("transform",`translate(${c(0)},0)`).call(r);he.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),he.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),he.selectAll("text").style("visibility","hidden")}te.selectAll("text").style("visibility","hidden")}else te.selectAll("text").style("visibility","hidden");te.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),te.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(b){throw b}},Gi=(t,e,n,o,x,l,r,c,p)=>{try{l=l??0;const m=Xe(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,r===le.TornadoChart),L=String(m).length,u=o(e),S=o(l),g=o(0),W=r??"",A=W.includes("stack"),E=W==="100%stackBar";switch(n){case 1:return E?e<0&&e!==-1?u-20:e===-1||e>0&&e!==1?u+10:u-10:e<0||c&&p==="positive"?u-L*5:u+5;case 2:return e===0?A?"":g+15:o(l+(e-l)/2);case 3:return A?l<0?S-L*5:l===0&&e<0?g-L*5:l===0&&e>0?g+10:S+10:e<0?g-L*5:g+10;default:return u}}catch(m){throw m}},Ai=(t,e,n,o,x)=>{try{let l=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-n})`).attr("height",n).attr("width",x).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==Ie.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const r=e.append("g").call(o).attr("transform","translate(0,0)");r.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),r.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==Ie.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",l.includes("Italic")?"Italic":"").style("text-decoration",l.includes("Underline")?"Underline":"").style("font-weight",l.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),r.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(l){throw l}},Di=(t,e)=>e*(1+t),_i=(t,e)=>e/(1+t);function Xl(t,e,n){const o=t>0?t:0,x=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,l=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,r=Array.isArray(n?.dimensionList)?n.dimensionList.length:0;let c=0,p=0,m=!1;if(r>0&&o>0){const L=o/r,u=_i(l,L);if(u>=x||e.plotArea.fitChart)p=u,c=r,m=!1;else{const S=Di(l,x),g=Math.floor(o/S);g<=1?(c=1,p=_i(l,o),m=r>1):(c=g,p=x,m=c<r)}}else c=0,p=0,m=!1;return{visibleBars:c,columnWidth:p,scrollbarVisible:m}}const Za=(t,e,n)=>Math.max(e,Math.min(n,t)),_t=(t,e,n,o,x,l,r,c,p,m,L,u,S=!1)=>{const g=(W,A,E,b,U)=>{try{if(U&&(W=m+W),!p||!Array.isArray(p.dimensionList)||!Array.isArray(t))return;W=W==null?0:Number(W),A=A==null?0:Number(A),E=E==null?0:Number(E),m=Za(Math.round(W),0,Math.max(0,A)),c=typeof c=="number"?c:0;const Y=m,H=Y+c;let I=p.dimensionList.slice(Y,H),D=JSON.parse(JSON.stringify(t||[]));D.forEach((xe,ge)=>{const pe=Array.isArray(xe?.data)?xe.data:[];D[ge].data=pe.filter(he=>I.includes(he?.dimension))});const w=x?.left??0,z=x?.top??0,K=Number(l)||0,ye=Number(innerHeight)||0,se=Number(E)||0,te=A===0?1:A;if(S){const xe=z+(ye-se)*(A===0?0:m)/te;b&&typeof b.attr=="function"&&b.attr("y",xe)}else{const xe=w+(K-se)*(A===0?0:m)/te;b&&typeof b.attr=="function"&&b.attr("x",xe)}u(I,D,c)}catch(Y){typeof me=="function"&&me("ColumnChart","updateFromScrollPosition",Y)}};if(r){const W=e-x.top-x.bottom,A=Math.max(0,t[0].data.length-c),E=e-8;o.append("rect").attr("id","scrollbarTrack").attr("x",S?n-8:x.left).attr("y",S?x.top:E).attr("width",S?8:l).attr("height",S?W:8).attr("fill","#ccc");const b=(S?W:l)*c/p.dimensionList.length,U=o.append("rect").attr("x",S?n-8:x.left).attr("y",S?x.top:E).attr("width",S?8:b).attr("height",S?b:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");U.call(v.drag().on("drag",Y=>{if(S){const I=(Za(Y.y,x.top,x.top+W-b)-x.top)/(W-b)*(A||1);g(I,A,b,U,!1),U.attr("y",x.top+(W-b)*(A===0?0:m)/(A===0?1:A))}else{const I=(Za(Y.x,x.left,x.left+l-b)-x.left)/(l-b)*(A||1);g(I,A,b,U,!1),U.attr("x",x.left+(l-b)*(A===0?0:m)/(A===0?1:A))}})),o.on("wheel",Y=>{Y.preventDefault();const I=(S?Y.deltaY:Y.deltaX)>0?1:-1;if(g(I,A,b,U,!0),S){const D=x.top+(W-b)*(A===0?0:m)/(A===0?1:A);U.attr("y",D)}else{const D=x.left+(l-b)*(A===0?0:m)/(A===0?1:A);U.attr("x",D)}})}else o.on("wheel",null);g(0,0,0,null,!0)};function ii(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W){try{if(r.total.totalVisibility){const A=r.annotation.annotationVisibility!="5"?10:0;let E=r.total.annotationType??"1",b=[E=="1"?"connector":""],U=x.annotation(),Y=r.total.connectorType,H=r.total.totalFontStyle,I=r.total.connectorType?r.total.connectorType.toLowerCase():"None";l=[];let D=[],w=Array.from(t,([K,ye])=>({Dimension:K,Measure:ye}));r.total.totalHideZeroValues&&(w=w.filter(K=>K.Measure!==0)),w.forEach((K,ye)=>{let se={note:{label:K.Measure>=1e9&&r.total.totalNumberFormat===".2s"?Math.round(K.Measure/1e9)+"B":Xe(K.Measure,r.total.totalDisplayUnits||r.plotArea.plotAreaDisplayUnits,r.total.totalNumberFormat,r.total.totalDecimalPrecision)},data:{y:K.Measure,x:K.Dimension},dx:0,dy:0,connector:{end:I,curve:pi[r.total.connectorCurve]},disable:b,subject:{height:15,width:15},color:r.total.totalColor,type:gi(x,parseFloat(E)),height:p,width:m};D.push(se)}),U.editMode(r.total.annotationDraggable&&u).accessors({x:function(K){if(!S)return e(K.x);if(K.y>=0){const se=W?.get(K.x)??K.y;return n(se)+25}const ye=g?.get(K.x)??K.y;return n(ye)-25},y:function(K){if(S){const se=parseFloat(r.total.totalFontSize)||12;return r.annotation.annotationVisibility!=="5"?e(K.x)-se-4:e(K.x)-se/2}if(K.y>=0){const se=W?.get(K.x)??K.y;return n(se)-A-15}const ye=g?.get(K.x)??K.y;return n(ye)+A+5}}).on("dragend",function(K){z.selectAll(".connector").style("stroke",r.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Yt[r.total.connectorStyle.toLowerCase()]),z.selectAll(`.connector-${I}`).attr("fill",r.total.connectorColor||"#ccc").style("stroke",r.total.connectorColor||"#ccc"),z.selectAll(".note-line").attr("hoverId",ye=>ye.data.currentLegend).style("stroke",r.total.connectorColor||"#ccc").attr("stroke-dasharray",Yt[r.total.connectorStyle.toLowerCase()]).filter(ye=>ye._dx==0&&ye._dy==0).remove()}).accessorsInverse({x:K=>e.invert(K.x),y:K=>n.invert(K.y)}).notePadding(0).annotations(D);let z=ql(L,r,o,H,U,I);r.animation?.animationEnabled&&z.selectAll(".annotation").each(function(K){const ye=v.select(this),te=ye.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!te)return;const xe=parseFloat(te[1]),ge=parseFloat(te[2]);if(S){const pe=n(0);ye.attr("transform",`translate(${pe},${ge})`).transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`translate(${xe},${ge})`)}else{const pe=n(0);ye.attr("transform",`translate(${xe},${pe})`).transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`translate(${xe},${ge})`)}})}}catch(A){throw A}}const ql=(t,e,n,o,x,l)=>{t.selectAll(".total-annotation-group").remove();let r=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${n.left},${n.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(x);return r.selectAll("rect").style("visibility","hidden"),r.selectAll(".annotation-subject").remove(),r.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.total.connectorStyle.toLowerCase()]),r.selectAll(`.connector-${l}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),r.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Yt[e.total.connectorStyle.toLowerCase()]).filter(c=>c._dx==0&&c._dy==0).remove(),r.selectAll(".connector-end").filter(c=>c.connector.end=="dot"&&c._dx==0&&c._dy==0).remove(),e.total.annotationType=="1"&&r.selectAll(".annotation-note-content").attr("transform",function(){const p=v.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(p)return`translate(${parseFloat(p[1])}, 0)`}),r.selectAll("text").append("text").style("fill",e.total.totalColor!==Ie.white?e.total.totalColor:"none"),r};function li(t,e,n){e.clear(),n&&n.length>0&&n.forEach(o=>{e.set(o,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(o=>{o.data.forEach((x,l)=>{if(e.has(x.dimension)){let r=e.get(x.dimension)||0;r+=x.value||0,e.set(x.dimension,r)}})})}function sa(t,e,n,o=!1){const x=o&&t.xAxisLabel.xAxisPosition=="1"?-1:1,l=n>0?n:0,r=parseFloat(t.plotArea.ticksHeight)||100,c=(e-l)*r/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-c*x:0}function zt(t,e,n=0){const o=parseFloat(t.plotArea.ticksWidth)||100,x=(e-n)*o/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-x:0}const ji={color:"defaultColor",name:"",type:"Line",axis:Qe.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:tt,labelColor:Ie.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:Ie.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:Ie.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 Kl="11px",Ql="1.6";function vt(t,e,n){return(o,x)=>{!t.current||!e.current||e.current(n(o,x))}}function At(t,e,n){return t?.(e,n)??void 0}const xt="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 It(t,e,n,o,x,l,r,c,p,m,L,u,S,g){try{let W=r.legends.legendPosition,A=r.legends.legendAlignmentTopBottom,E=r.legends.legendAlignment;if(r.legends.legendVisibility)switch(W){case Je.none:break;case Je.right:let b=r.plotArea.fitChart?t-o-10:t-o-20;xa(e,c,x-(l+15),o+5,l+5,b,W,E,u,r,p,!1,g);break;case Je.top:xa(e,c,7,o,x-10,30,W,A,u,r,p,!1,g);break;case Je.left:let U=r.plotArea.fitChart?t-o-10:t-o-20;const Y=m?m+L.bottom:0;xa(e,c,7,o+5,l+5,U-Y,W,E,u,r,p,!1,g);break;case Je.bottom:xa(e,c,7,t-35,x-10,30,W,A,u,r,p,!1,g);break}}catch(W){me(xt,"drawLegends",W)}}function Ol(t,e){try{let n=0,o=t[0];return t.forEach(x=>{if(x!==void 0){let l=x.includes("~$~")?x.split("~$~")[1]:x.includes("-")?x.slice(x.indexOf("-")+1):x,r=l.length;n<r&&(n=r,o=l)}}),Pt(o,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(n){me(xt,"calculateMaxLegendWidth",n)}}function Va(t,e,n,o,x,l,r,c,p,m,L,u,S,g,W,A=!1){try{const E=(I,D)=>A?[D,I]:[I,D];let b=c.plotArea.hideZeroValues;c.plotArea.plotAreaHideLineAndMarkers===void 0&&(c.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(I=>I.data.forEach(D=>{D.markerShape=[le.CombinationLine,le.CombinationArea].includes(n)&&!c.plotArea.plotAreaHideLineAndMarkers?"None":I.properties.markerShape?I.properties.markerShape:"Circle",D.currentMeasure=I.properties.currentMeasure,D.markerColor=I.properties.markerColor?I.properties.markerColor:"Blue",D.alias=I.properties.alias,D.markerSize=I.properties.markerShape!="None"&&I.properties.markerSize&&I.properties.markerShape!="None"?n==="Area"?c.plotArea.plotAreaHideLineAndMarkers?I.properties.markerSize:0:I.properties.markerSize:0}));let U=t.selectAll(".lineGroup").data(e,I=>I.legend);U.enter().append("g").attr("class","parentGroup").attr("hoverId",I=>(I.properties.alias||I.properties.name||"Legend").replace(/\s+/g,"-")).merge(U).each(function(I){let w=v.select(this).selectAll("path").data(I.data);const K=w.enter().append("path").attr("fill",ye=>ye.markerColor).merge(w).attr("d",ye=>v.symbol().type(Ji(ye.markerShape)).size(ye.markerSize*50)()).attr("visibility",ye=>{const se=!o(ye.dimension)&&o(ye.dimension)!==0,te=c.marker.markerVisibility?er(e,ye,n,b,l,u,S)?Et.hidden:[le.NormalizedStackLineChart,le.CombinationLine,le.CombinationArea].includes(n)||[le.StackAreaChart,le.AreaChart,le.CombinationStackArea].includes(n)?c.plotArea.plotAreaHideLineAndMarkers?Et.visible:Et.hidden:Et.visible:[le.CombinationLine,le.CombinationArea].includes(n)||["Area"].includes(n)&&c.plotArea.plotAreaHideLineAndMarkers?Et.visible:Et.hidden;return se?Et.hidden:te}).attr("transform",ye=>{let se=ye.axis==Qe.primary?x:l;const te=o(ye.dimension),xe=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?ye[1]>0?se(ye[1]):se(ye[0]):se(ye.value),[ge,pe]=E(te,xe);return`translate(${ge},${pe})`}).on("mousemove",function(ye,se){const te=se,xe=se,ge=v.select(this.parentNode),pe=Array.isArray(te.dimension)?te.dimension[0]:te.dimension,he=String(p.formattedDimensionListMap.get(pe)??""),O=W?.(String(pe??""),{...se,formattedDimensionValue:he})??void 0;ut([{key:c.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(c.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():c.xAxisTitle.xAxisTitleText,value:p.formattedDimensionListMap.get(Array.isArray(te.dimension)?te.dimension[0]:te.dimension)},{key:c.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(c.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():se.properties?.currentMeasure?se.properties.currentMeasure:c.yAxisTitle.yAxisTitleText||te.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(n)?te[1]-te[0]:te.value,c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormat,c.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:xe.alias.includes("~$~")?xe.alias.split("~$~")[1]:xe.alias}],c,ye,se,O),ge.selectAll(".hoverHighlight").remove();const X=o(te.dimension),M=()=>{const s=te.axis===Qe.primary?x:l;return[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?te[1]>0?s(te[1]):s(te[0]):s(te.value)},[h,k]=E(X,M());ge.insert("circle",":first-child").attr("class","hoverHighlight").attr("cx",h).attr("cy",k).attr("fill",xe.markerColor).attr("opacity",.5).attr("r",xe.markerSize*10),v.select(this).transition().duration(100).attr("transform",()=>{const s=te.axis===Qe.primary?x:l,d=o(te.dimension),i=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?te[1]>0?s(te[1]):s(te[0]):s(te.value),[y,T]=E(d,i);return`translate(${y},${T}) scale(1.3)`})}).on("mouseout",function(ye,se){const te=se,xe=v.select(this.parentNode);ot(),xe.selectAll(".hoverHighlight").remove(),v.select(this).transition().duration(100).attr("transform",()=>{const ge=te.axis===Qe.primary?x:l,pe=o(te.dimension),he=[le.NormalizedStackAreaChart,le.StackAreaChart,le.StackLineChart,le.NormalizedStackLineChart,le.CombinationStackArea].includes(n)?te[1]>0?ge(te[1]):ge(te[0]):ge(te.value),[O,X]=E(pe,he);return`translate(${O},${X}) scale(1)`})});if(c.animation.animationEnabled){const ye=c.animation.animationDuration,se=et[c.animation.animationEffect]??v.easeLinear;if([le.AreaChart,le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationArea,le.CombinationStackArea].includes(n)){const xe=[le.StackAreaChart,le.NormalizedStackAreaChart,le.CombinationStackArea];K.each(function(ge){const pe=ge.axis===Qe.primary?x:l,he=o(ge.dimension),O=xe.includes(n)?ge[1]>0?pe(ge[1]):pe(ge[0]):pe(ge.value),X=x(0),[M,h]=E(he,X),[k,s]=E(he,O);v.select(this).attr("transform",`translate(${M},${h})`).transition().duration(ye).ease(se).attr("transform",`translate(${k},${s})`)})}else{const xe=o.range(),ge=Math.min(xe[0],xe[1]),pe=Math.max(xe[0],xe[1])-ge,he=(O,X=100)=>{for(let M=0;M<=X;M++){const h=M/X;if(se(h)>=O)return h}return 1};K.attr("opacity",0).each(function(O){const X=o(O.dimension)??ge,M=pe>0?Math.max(0,Math.min(1,(X-ge)/pe)):0,h=he(M)*ye;v.select(this).transition().delay(h).duration(0).attr("opacity",1)})}}})}catch(E){me(xt,"lineMarkers",E)}}function Ji(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 er=(t,e,n,o,x,l,r)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?o&&e.value==0||e.value>x.domain()[1]||e.value<x.domain()[0]:n.includes("Stack")?e.value>0?o&&e[1]==0||e[1]<l||e[1]>r:o&&e[0]==0||e[0]<l||e[0]>r:o&&e.value==0||e.value<l||e.value>r}catch(c){me(xt,"checkVisibleConditions",c)}};function Li(t,e,n,o,x,l,r,c,p,m=!1){try{let L=function(S){try{let g=v.pointer(S),W=1e99,A,E=null;const b=m?g[1]:g[0],U=m?g[0]:g[1];for(let H=0;H<u.length;H++){let I=Math.abs(b-l(u[H]));I<W&&(W=I,E=H)}let Y=1e99;for(let H=0;H<x.length;H++){const I=p?x[H].data[E].value>0?x[H].data[E][1]:x[H].data[E][0]:x[H].data[E].value;let D=Math.abs(U-r(I));D<Y&&(Y=D,A=H)}n.attr("transform",tr(x[A],E,l,r,p,m)).append("circle").attr("r",x[A].properties.markerSize*2.5).attr("id","tooltip").attr("fill",x[A].properties.markerColor).text(ut([{key:t.xAxisTitle.xAxisTitleText,value:x[A].data[E].dimension},{key:x[A].properties.currentMeasure?x[A].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:Xe(c===le.NormalizedStackAreaChart?A===0?x[A].data[E].value:x[A].data[E].value-x[A-1].data[E].value:x[A].data[E].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:x[A].data[E].legend.includes("~$~")?x[A].data[E].legend.split("~$~")[1]:x[A].data[E].legend}],t,void 0,x[A].properties))}catch(g){me(xt,"onHoverMarkerForAreaChartFamily.mousemove",g)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){n.style("display",null)}).on("mousemove",L).on("mouseout",function(){n.style("display","none"),ot()});let u=o}catch(L){me(xt,"onHoverMarkerForAreaChartFamily",L)}}const tr=(t,e,n,o,x,l=!1)=>{try{const r=x?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value,c=n(t.data[e].dimension),p=o(r);return l?`translate(${p},${c})`:`translate(${c},${p})`}catch(r){me(xt,"getCoordinates",r)}};function $t(t,e,n,o,x){try{const l=document.createElement("div");Object.assign(l.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(l),l.style.transform="",l.style.width="",l.style.whiteSpace="nowrap",l.style.overflowWrap="",e!=null&&(l.style.fontSize=`${e}px`),n!=null&&(l.style.fontFamily=n),x!=null,l.textContent=t;const r=l.getBoundingClientRect(),c=r.width,p=r.height;if(o&&o!==0){l.style.transform=`rotate(${o}deg)`;const m=l.getBoundingClientRect();return l.remove(),{width:c,height:p,rotatedWidth:m.width,rotatedHeight:m.height}}return l.remove(),{width:c,height:p,rotatedWidth:0,rotatedHeight:0}}catch(l){me(xt,"preCalculateTextDimensions",l)}}function Zi(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(n=>{const o=t[n],x=Object.prototype.hasOwnProperty.call(e,n),l=e[n];if(!x||l===void 0){e[n]=Array.isArray(o)?[...o]:typeof o=="object"&&o!==null?{...o}:o;return}const r=Xi(o),c=Xi(l);r&&c&&Zi(o,l)}),e}catch(n){me(xt,"addUndefinedDefaults",n)}}function Xi(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){me(xt,"isPlainObject",e)}}function Ke(t,e,n){try{let o=1,x="",l=n,r;return function(c){try{let p=c??0;if(t==="Auto")return ar(p);switch(t&&t!=="None"&&(t==="Thousands"&&(o=1e3,x="K"),t==="Millions"&&(o=1e6,x="M"),t==="Billions"&&(o=1e9,x="B"),p=p/o),e){case",.0%":return r=`.${l}%`,v.format(r)(p);case"":return r=`.${l}f`,v.format(r)(p)+x;case".2n":return r=`.${l==0?1:parseFloat(l)+1}n`,v.format(r)(p)+x;case".2$":return r=`,.${l}f`,"$"+v.format(r)(p)+x;case".2c":return r=`,.${l}f`,"C$"+v.format(r)(p)+x;case".2ē":return r=`,.${l}f`,"€"+v.format(r)(p)+x;case".2ch":return r=`,.${l}f`,"CHF"+v.format(r)(p)+x;case".2£":return r=`,.${l}f`,"£"+v.format(r)(p)+x;case".2₹":return r=`,.${l}f`,"₹"+v.format(r)(p)+x;case",":return r=`,.${l}f`,v.format(r)(p)+x;default:return r=".2f",v.format(r)(p)+x}}catch(p){me(xt,"getNumberWithFormatFunction.inner",p)}}}catch(o){me(xt,"getNumberWithFormatFunction",o)}}function ar(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 ut(t,e,n,o,x){try{const l=o?.color??o?.markerColor??"blue",r=o?.markerShape?.toLowerCase()??"circle",c=e.toolTip.toolTipTheme==="Light",p=c?"rgba(255, 255, 255)":"#272729ff",m=c?"black":Ie.white,L=c?"gray":"#d1d5db",u=(w,z=6)=>{if(!w)return"";const K=w.split(" ");let ye="";for(let se=0;se<K.length;se+=z)ye+=K.slice(se,se+z).join(" ")+"<br/>";return ye};v.selectAll(".chartTooltip").style("visibility",Et.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),g=v.select("#chartTooltipDiv").html("").append("div").attr("class",c?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",m).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":c?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),W=n||window.event,A=W.pageX,E=W.pageY,b=t.reduce((w,z)=>{const K=(()=>{switch(r){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 w+=`
23
+ <%s key={someKey} {...props} />`,d,g,P,g),M[g+d]=!0)}if(g=null,c!==void 0&&(l(c),g=""+c),n(k)&&(l(k.key),g=""+k.key),"key"in k){c={};for(var ce in k)ce!=="key"&&(c[ce]=k[ce])}else c=k;return g&&o(c,typeof x=="function"?x.displayName||x.name||"Unknown":x),m(x,g,h,i,u(),c,v,a)}function y(x){typeof x=="object"&&x!==null&&x.$$typeof===A&&x._store&&(x._store.validated=1)}var S=Ne,A=Symbol.for("react.transitional.element"),Z=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),B=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),le=Symbol.for("react.client.reference"),te=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=Object.prototype.hasOwnProperty,de=Array.isArray,Le=console.createTask?console.createTask:function(){return null};S={"react-stack-bottom-frame":function(x){return x()}};var Te,he={},q=S["react-stack-bottom-frame"].bind(S,r)(),J=Le(s(r)),M={};ei.Fragment=L,ei.jsx=function(x,k,c,d,i){var h=1e4>te.recentlyCreatedOwnerStacks++;return f(x,k,c,!1,d,i,h?Error("react-stack-top-frame"):q,h?Le(s(x)):J)},ei.jsxs=function(x,k,c,d,i){var h=1e4>te.recentlyCreatedOwnerStacks++;return f(x,k,c,!0,d,i,h?Error("react-stack-top-frame"):q,h?Le(s(x)):J)}})()),ei}var Ri;function Dl(){return Ri||(Ri=1,process.env.NODE_ENV==="production"?hi.exports=Fl():hi.exports=wl()),hi.exports}var je=Dl();function Ce(t,e,l){console.error(t,e,l)}var dt=(t=>(t.rectangle="rectangle",t.circle="circle",t.hollowCircle="hollowCircle",t.areaWithLine="areaWithLine",t.line="line",t.custom="custom",t.none="none",t))(dt||{}),Bt=(t=>(t.solid="unset",t[t.dotted=2]="dotted",t[t.dashed=7]="dashed",t))(Bt||{}),gt=(t=>(t.none="None",t.solid="Solid",t.dotted="Dotted",t.dashed="Dashed",t))(gt||{}),xa=(t=>(t.butt="butt",t.round="round",t.square="square",t))(xa||{}),Oe=(t=>(t.primary="Primary",t.secondary="Secondary",t))(Oe||{}),Rt=(t=>(t.visible="visible",t.hidden="hidden",t))(Rt||{});const Ta="20,10,5,5,5,10",Vl={1:"",2:T.curveLinear,3:T.curveStep},Nl={1:bt.annotationLabel,2:bt.annotationLabel,3:bt.annotationCallout,4:bt.annotationCalloutElbow,5:bt.annotationCalloutCurve};var Ze=(t=>(t.left="Left",t.right="Right",t.top="Top",t.bottom="Bottom",t.none="None",t))(Ze||{}),ti=(t=>(t.thousands="Thousands",t.millions="Millions",t.billions="Billions",t.none="None",t))(ti||{}),La=(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))(La||{}),pi=(t=>(t.top="1",t.bottom="3",t.middle="2",t))(pi||{}),_t=(t=>(t.start="1",t.middle="2",t.end="3",t))(_t||{}),wa=(t=>(t.top="1",t.bottom="2",t))(wa||{});const va={none:"1",discrete:"2",colorTheme:"3"},qt={automatic:"1",startOnly:"2",endOnly:"3",startAndEndBoth:"4",none:"5"};var ai=(t=>(t.PointerValue="1",t.Absolute="2",t.CAGR="3",t.PercentageGrowth="4",t))(ai||{});const Pl={singleColor:"2",multiColor:"1"},ie={underline:"Underline",bold:"Bold",italic:"Italic",normal:"Normal"};var Ea=(t=>(t.top="Top",t.middle="Middle",t.bottom="Bottom",t))(Ea||{}),Ra=(t=>(t.start="Start",t.middle="Middle",t.end="End",t))(Ra||{});const jt={None:"None",Mean:"Mean",Median:"Median",Custom:"Custom"};var ze=(t=>(t.white="#ffffff",t.black="#000000",t.transparent="#FFFFFF00",t))(ze||{});const at="Calibri";var Mi=(t=>(t.positive="Positive",t.negative="Negative",t.default="defaultEntry",t))(Mi||{}),ka=(t=>(t.total="Total",t.base="base",t.dimensionTotal="dimensionTotal",t.up="up",t.down="down",t))(ka||{});const tt={easeLinear:T.easeLinear,easeCubicIn:T.easeCubicIn,easeCubicOut:T.easeCubicOut,easeCubicInOut:T.easeCubicInOut,easeBounceOut:T.easeBounceOut,easeElasticOut:T.easeElasticOut,easeBackOut:T.easeBackOut},zi={chartDescription:{chartDescriptionVisibility:!1,chartDescriptionText:"",chartDescriptionId:""},chartArea:{chartAreaColor:ze.white,chartAreaBorder:!1,chartAreaBorderThickness:"1",chartAreaBorderColor:ze.black,chartAreaBorderStyle:"1"},chartTitle:{chartTitleVisibility:!0,chartTitleFontSize:"15",chartTitleFontFamily:at,chartTitleFontStyle:[],chartTitleColor:ze.black,chartTitleText:"Chart Title Here",dynamicTitleText:"",chartTitleHTML:""},xAxisLabel:{xAxisLabelVisibility:!0,xAxisColor:ze.black,xAxisColorInverted:ze.transparent,xAxisWidth:"0.5",xAxisLabelFontSize:"11",xAxisLabelFontFamily:at,xAxisLabelFontStyle:[],xAxisLabelColor:ze.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:"",xAxisTicksMode:"Auto",xAxisTicksCount:"3",hideZeroValues:!1,xAxisSortBy:"0",customSort:[],labelTextWrap:!0,multiLineLabelWrap:!1,maxXAxisLabelWidth:100},xAxisScale:{absoluteXAxisScale:!1,customScale:"0"},xAxisTitle:{xAxisTitleVisibility:!0,xAxisTitleFontSize:"11",xAxisTitleFontFamily:at,xAxisTitleFontStyle:[],xAxisTitleColor:ze.black,xAxisTitleText:"Dimension",xAxisDynamicTitleText:"",xAxisTitleHTML:""},yAxisScale:{absoluteYAxisScale:!0,customScale:"0"},yAxisLabel:{yAxisLabelVisibility:!0,yAxisColor:ze.transparent,yAxisColorInverted:ze.black,yAxisWidth:"0.5",yAxisLabelFontSize:"11",yAxisLabelFontFamily:at,yAxisLabelFontStyle:[],yAxisLabelColor:ze.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:"",yAxisTicksMode:"Auto",yAxisTicksCount:"3",hideZeroValues:!1,yAxisSortBy:"0",customSort:[]},yAxisTitle:{yAxisTitleVisibility:!0,yAxisTitleFontSize:"11",yAxisTitleFontFamily:at,yAxisTitleFontStyle:[],yAxisTitleColor:ze.black,yAxisTitleText:"Measure",yAxisDynamicTitleText:"",yAxisTitleHTML:""},secondaryYAxisLabel:{secondaryYAxisLabelVisibility:!0,secondaryYAxisColor:ze.black,secondaryYAxisWidth:"0.5",secondaryYAxisLabelFontSize:"11",secondaryYAxisLabelFontFamily:at,secondaryYAxisLabelFontStyle:[],secondaryYAxisLabelColor:ze.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:at,secondaryYAxisTitleFontStyle:[],secondaryYAxisTitleColor:ze.black,secondaryYAxisTitleText:"Measure",secondaryYAxisDynamicTitleText:"",secondaryYAxisTitleHTML:""},legends:{legendVisibility:!0,primaryTitleVisibility:!0,primaryTitleText:"Primary Axis",primaryTitleFontSize:"11",primaryTitleFontFamily:at,primaryTitleFontStyle:[],secondaryTitleVisibility:!0,secondaryTitleText:"Secondary Axis",secondaryTitleFontSize:"11",secondaryTitleFontFamily:at,secondaryTitleFontStyle:[],legendPosition:"Top",legendAlignment:"Top",legendAlignmentTopBottom:"Start",legendFontSize:"11",legendFontFamily:at,legendFontStyle:[],legendBorder:!1,legendBorderThickness:"1",legendBorderColor:ze.black,vennLabelColor:ze.black,onHoverEffect:!0,legendColorMode:"1",legendSelectedUnicolor:ze.black},plotArea:{plotAreaColor:ze.white,plotAreaBorder:!1,plotAreaBorderThickness:"1",plotAreaBorderColor:ze.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:ze.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:at,dataLabelValueFontStyle:[],dataLabelNumberFormat:",",dataLabelNumberFormatProgress:",.0%",axialAxis:!0,axialAxisDataLabelColor:ze.black,axialAxisDataLabelFontSize:"11",axialAxisDataLabelFontFamily:at,axialAxisDataLabelFontStyle:[],axialAxisDataLabelNumberFormat:",",axialAxisDataLabelDecimalPrecision:"2",dataLabelDecimalPrecision:"2",dataLabelNameColor:ze.black,dataLabelNameFontSize:"11",dataLabelNameFontFamily:at,dataLabelNameFontStyle:[],fillOpacity:"0.7",innerRadius:"50",cornerRadius:"0",axialGrid:!0,arcPadding:"5",axialTicks:"10",arcTransition:!0,innerRadiusForSpeedometer:"30",ticks:"3",pointerColor:ze.black,pointerHeadLength:"8",totalColor:"#41a5b4",positiveColor:"#9fb700",negativeColor:"#e25a42",dotPlotLineColor:"#c7c7c7",dataLabelValue:!0,plotAreaAbsoluteValue:!1,dataLabelName:!0,bubbleSizeIndex:"1",scatterSizeIndex:"4",hideZeroValues:!1,boxLineColor:ze.black,boxLineWidth:"1",boxOutlier:!1,boxOutlierRadius:"3",plotAreaShowTrendLine:!1,plotAreaTrendLine:"Linear",plotAreaTrendLineWidth:"1",plotAreaTrendLineColor:ze.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:ze.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:ze.black},annotation:{annotationDraggable:!1,annotationType:"1",connectorCurve:"1",connectorType:"None",connectorColor:"#ccc",connectorStyle:"solid",annotationVisibility:"5",annotationPosition:"1",annotationNumberFormat:",",annotationColor:ze.black,annotationFontSize:"9",annotationFontFamily:at,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:ze.black,totalFontSize:"9",totalFontFamily:at,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:ze.black,nodeBorderStyle:"solid",nodesLabelVisibility:!0,nodesLabelFontSize:"11",nodesLabelFontFamily:at,nodesLabelFontStyle:[],nodeLabelNumberFormat:",",nodeLabelDecimalPrecision:"2",nodesLabelColor:ze.black,nodesLabelDisplayUnits:"None",nodesLabelOverlap:!1,nodesLabelWrap:!0,nodeHeight:"5",nodeWidth:"12",nodeType:"rectangle",nodesBorderRadius:"1",dataLabelValueColor:ze.black,dataLabelValueFontSize:"11",dataLabelValueFontFamily:at,dataLabelNumberFormat:",",dataLabelDecimalPrecision:"2",dataLabelValueStyle:[],nodesLabelFontColor:ze.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:ze.black,binsBorderOpacity:"0.5"},connector:{connectorVisibility:"2",connectorFollow:"1",connectorStepSize:"1",connectorExclude:[],connectorCustomRange:[],connectorFontSize:"11",connectorFontFamily:at,connectorFontStyle:[],connectorKPI:"1",connectorNumberFormat:",",connectorLineThickness:"1",connectorLineColor:"#080808",connectorMarkerColor:ze.black,connectorFontColor:ze.black,connectorDecimalPrecision:"2",connectorDisplayUnits:"None",connectorStyle:"solid",lineType:"straight",connectorType:"straight",connectorColorOption:"Discrete",connectorUniformLineColor:ze.black},footerNote:{footerNoteVisibility:!1,footerNotePosition:"1",footerNoteFontSize:"11",footerNoteFontFamily:at,footerNoteFontStyle:[],footerNoteFontColor:ze.black,footerNoteBorder:!1,footerNoteBorderThickness:"1",footerNoteBorderColor:ze.black},pieofPie:{pieOfPieDataLabels:!0,pieOfPieDataLabelValue:!0,pieOfPieAbsoluteValue:!1,pieOfPieValueColor:ze.black,pieOfPieValueFontSize:"11",pieOfPieValueFontFamily:at,pieOfPieValueFontStyle:[],pieOfPieNumberFormat:",",pieOfPieName:!0,pieOfPieNameColor:ze.black,pieOfPieNameFontSize:"11",pieOfPieNameFontFamily:at,pieOfPieNameFontStyle:[],pieOfPieRadius:90,pieOfPieLineWidth:"1",pieOfPieLineColor:ze.black,pointerValueDecimalPrecision:"2",displayUnits:"None"},text:{textFontFamily:at,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:at,pointerValueFontStyle:[],pointerValueColor:ze.black,pointerValueAlias:!1,pointerValueAliasText:""},customTextAnnotations:{customTextAnnotationObject:[],hiddenProperty:[]},dataLabelOverlappingToggle:{dataLabelOverlap:!0},widgetIndexing:{widgetVisibility:!1,widgetIndex:0},bubbleformatting:{showBubble:!0,bubbleColor:ze.black,bubbleBorderColor:ze.black,bubbleBorderWidth:"1",bubbleOpacity:"4"},colorScaleForMapsBubble:{showColorForMapsBubble:"2",startColorForMapsBubble:"#c1d8f3",endColorForMapsBubble:"#4c6ba5"},columnBreakLine:{breakLineVisibility:!0,breakLineColor:ze.black,breakLineWidth:"1",breakLineStyle:"Double"},undoRedo:{isFromUndo:!1,isFromOnChange:!1},switchChartType:{allowChartTypeSwitch:!1},column:{stackBorderVisibility:!1,stackBorderWidth:"1",stackBorderColor:ze.black,stackBorderStyle:"0"},line:{interpolationType:"1",smoothType:"1",cardinalTension:"1",stepPosition:"2"},seriesLabel:{seriesLabelVisibility:!1,seriesLabelApplySeries:"1",seriesLabelFontFamily:at,seriesLabelFontSize:"11",seriesLabelFontStyle:[],seriesLabelBackgroundColor:ze.transparent,seriesLabelPosition:"Right"},dataTableProperties:{dataTable:!1,dataTableFontSize:"11",dataTableFontFamily:at,dataTableFontStyle:[],dataTableNumberFormat:",",dataTableDecimalPrecision:"2",dataTableDisplayUnits:"None",dataTableLabelColor:ze.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}},Kt={top:0,right:0,bottom:0,left:0};var ee=(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))(ee||{});const bi={1:"",2:T.curveLinear,3:T.curveStep},Il=[ee.ColumnChart,ee.StackColumnChart,ee.NormalizedStackColumnChart,ee.LineChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.AreaChart,ee.StackAreaChart,ee.NormalizedStackAreaChart],Da={auto:"Auto",custom:"Custom"};function za(t,e,l){const s=Math.max(2,parseInt(l)||3),u=(e-t)/(s-1),r=[];for(let n=0;n<s;n++)r.push(parseFloat((t+n*u).toFixed(6)));return r}const El=[ee.ColumnChart,ee.StackColumnChart,ee.NormalizedStackColumnChart,ee.LayeredColumnChart,ee.CustomColumnChart,ee.ColumnHistogramChart,ee.HorizontalBarChart,ee.StackHorizontalBarChart,ee.NormalizedStackHorizontalBarChart,ee.LayeredHorizontalBarChart,ee.HorizontalHistogramChart,ee.LineChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.AreaChart,ee.StackAreaChart,ee.NormalizedStackAreaChart,ee.WaterfallChart,ee.DotPlot],$i=[ee.PieChart,ee.PieofPie,ee.DonutChart,ee.PyramidChart,ee.OrganizationChart,ee.VennChart,ee.ProgressChart,ee.Maps,ee.WordCloud,ee.SankeyChart,ee.Speedometer,ee.RadialBarChart];function It(t,e,l,s,u){var r=document.createElement("div");r.style.visibility="hidden",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.fontSize=e==null?"":e+"px",r.style.fontFamily=l??"",r.style.margin="0",r.style.padding="1px",r.style.border="none",u?(r.style.width=u+"px",r.style.whiteSpace="normal",r.style.overflowWrap="break-word"):r.style.whiteSpace="nowrap",r.innerHTML=t,document.body.appendChild(r);var n=r.getBoundingClientRect(),o=n.width,p=n.height;return s!=null?(r.style.transform=`rotate(${s}deg)`,n=r.getBoundingClientRect(),r.remove(),[o,p,n.width,n.height]):(r.remove(),[n.width,n.height])}function Yi(t,e){let l=t.dataTableProperties&&t.dataTableProperties.dataTable,s=l?e*7<50?50:e*7>100?100:e*7:0;return l&&s<30&&(s=30),s}function Si(t,e,l,s,u,r,n,o,p,m,f,y,S,A=[]){let Z=r.dataTableProperties&&r.dataTableProperties.dataTable&&r.xAxisLabel.xAxisPosition=="0"&&!S,L=!1;//!formatOptions.plotArea.fitChart;
24
+ let Y=t<200?200:S?e:t,b=e<200?200:S?t:e,H=Y*.15*.8,B=er(n,r),G=H<B[0]+10?H:B[0]+10,I=y?vt(r.xAxisLabel.xAxisNumberFormat,o).map(i=>i):o,D=I?I[0]+"":"",N=D.length;I&&I.forEach(i=>{i=i+"";let h=i.trim()?.length||0;h>N&&(N=h,D=i.trim())});let R=It(D,r.xAxisLabel.xAxisLabelFontSize,r.xAxisLabel.xAxisLabelFontFamily,r.xAxisLabel.xAxisLabelRotation),X=R[0]+5,le=R[3]+10,te;r.xAxisLabel.labelTextWrap?r.xAxisLabel.multiLineLabelWrap?te=r.xAxisLabel.maxXAxisLabelWidth:te=le<b*.15?le:b*.15:te=le;let Q=r.xAxisTitle.xAxisTitleVisibility?r.xAxisTitle.xAxisDynamicTitleText.length!==0?It(r.xAxisTitle.xAxisTitleHTML,void 0,void 0)[1]:It(r.xAxisTitle.xAxisTitleText,"13",at)[1]:Z?5:0;Q=Q>b*.1?b*.1:Q;let de=Z?0:r.xAxisLabel.xAxisLabelVisibility?te:A.length&&S?Yi(r,T.max(A,i=>i?.length||0)||0)+10:0,Le=r.yAxisTitle.yAxisTitleVisibility?r.yAxisTitle.yAxisDynamicTitleText.length!==0?It(r.yAxisTitle.yAxisTitleHTML,void 0,void 0)[1]:It(r.yAxisTitle.yAxisTitleText,"13",at)[1]:0;Le=Le>Y*.1?Y*.1:Le;const Te=l*1.1,he=u*1.1,q=5,J=10,x=(()=>{if(r.yAxisLabel.yAxisLabelVisibility)return Hi(Te,he,r,!1,f)+q;if(!A.length)return 0;if(S)return J;const i=T.max(A,h=>h?.length??0)??0;return Yi(r,i)+J})();let k=r.secondaryYAxisLabel.secondaryYAxisLabelVisibility?Hi(s,p,r,!0,f):0,c=r.secondaryYAxisTitle.secondaryYAxisTitleVisibility?r.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?It(r.secondaryYAxisTitle.secondaryYAxisTitleHTML,r.secondaryYAxisTitle.secondaryYAxisTitleFontSize,r.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:It(r.secondaryYAxisTitle.secondaryYAxisTitleText,r.secondaryYAxisTitle.secondaryYAxisTitleFontSize,r.secondaryYAxisTitle.secondaryYAxisTitleFontFamily)[1]:0;c=c>Y*.1?Y*.1:c;let d=r.chartTitle.chartTitleVisibility?r.chartTitle.dynamicTitleText.length!==0?It(r.chartTitle.chartTitleHTML,void 0,void 0)[1]:It(r.chartTitle.chartTitleText,"16",at)[1]:0;return d=d>b*.1?b*.1:d,{width:Y,height:b,isChartScrollable:L,legendMargin:G,dimensionHeightWidthArray:R,actualDimesionWidth:X,maxDimensionWidth:le,xTitle:Q,xLabel:de,yTitle:Le,yLabel:x,secondaryYLabel:k,secondaryAxisTitleWidth:c,chartTitleHeight:d}}function Rl(t,e,l,s,u,r,n,o,p,m,f,y,S,A){try{const Z=A??Si(t,e,l,s,u,r,n,o,p,m,f,y,S),L=S?Z.xTitle+Z.xLabel:Z.yTitle+Z.yLabel,Y=r.legends.legendPosition,b=r.legends.legendVisibility,H=r.xAxisLabel.xAxisPosition=="1"&&S;let B=0,G=0;const I=m&&!S?Z.secondaryYLabel+Z.secondaryAxisTitleWidth:0;switch(Y){case Ze.none:case Ze.none:G=15+I,B=L+5;break;case Ze.top:G=H?L+5:15+I,B=H?5+I+Z.xTitle:L+5;break;case Ze.right:G=H?L+5+Z.legendMargin:Z.legendMargin+I+20,B=H?5+I+Z.xTitle+Z.legendMargin:L+5;break;case Ze.bottom:G=H?L+5:15+I,B=H?5+I+Z.xTitle:L+5;break;case Ze.left:B=Z.legendMargin+L+33,G=15+I;break;default:G=15+I,B=L+5}const D=r.chartPadding?.paddingArrayLTRB;return D&&(B+=D[0],G+=D[2]),r.dataTableProperties&&r.dataTableProperties.dataTable&&f&&!S&&(B=B+35),{left:B,right:G,yLabel:Z.yLabel,yTitle:Z.yTitle,xLabel:Z.xLabel,xTitle:Z.xTitle,dimensionHeightWidthArray:Z.dimensionHeightWidthArray,chartTitleHeight:Z.chartTitleHeight,legendMargin:Z.legendMargin,secondaryYLabel:Z.secondaryYLabel,secondaryAxisTitleWidth:Z.secondaryAxisTitleWidth}}catch(Z){throw Z}}function zl(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z){try{const L=A??Si(t,e,l,s,u,r,n,o,p,m,f,y,S),b=r.legends.legendVisibility?r.legends.legendPosition:Ze.none,H=Z&&!S?12:0,B=S?L.yTitle+L.yLabel:L.xTitle+L.xLabel;let G=0,I=0;switch(b){case Ze.none:G=L.chartTitleHeight+5,I=B+5+H;break;case Ze.top:G=35+L.chartTitleHeight,I=B+H;break;case Ze.right:G=L.chartTitleHeight+5,I=B+5+H;break;case Ze.bottom:I=30+B+H,G=L.chartTitleHeight+5;break;case Ze.left:G=L.chartTitleHeight+5,I=B+5+H;break;default:G=L.chartTitleHeight+5,I=B+5+H}r.xAxisLabel.xAxisPosition&&!S&&r.xAxisLabel.xAxisPosition=="1"&&(I=I-L.xLabel,G=G+L.xLabel),f&&!S&&(G=G+12);const D=m&&S?L.secondaryYLabel+L.secondaryAxisTitleWidth:0;D&&(G=G+D);const N=r.chartPadding?.paddingArrayLTRB;return N&&(G+=N[1],I+=N[3]),{top:G,bottom:I,chartTitleHeight:L.chartTitleHeight,xAxisRelatedMargin:B,xLabel:L.xLabel,xTitle:L.xTitle}}catch(L){throw L}}function St(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z){try{const L=Si(t,e,l,s,u,r,n,o,p,m,f,y,S,Z),Y=Rl(t,e,l,s,u,r,n,o,p,m,f,y,S,L),b=zl(t,e,l,s,u,r,n,o,p,m,f,y,S,L,!0);let H,B=t-Y.left-Y.right,G=e-b.top-b.bottom,I,D=!1;({visibleBars:H,columnWidth:I,scrollbarVisible:D}=ql(S?G:B,r,A));const N={top:b.top,bottom:b.bottom,left:Y.left,right:Y.right};if(S){const R=f?30:0;N.right=N.right+R}return r.connector.connectorVisibility!="2"&&A?.chartType==ee.StackColumnChart&&(N.top=N.top+20),r.connector.connectorVisibility!="2"&&A?.chartType==ee.StackHorizontalBarChart&&(N.right=N.top+20),{margin:N,yLabel:Y.yLabel,xLabel:Y.xLabel,yTitle:Y.yTitle,xTitle:Y.xTitle,dimensionHeightWidthArray:Y.dimensionHeightWidthArray,chartTitleHeight:Y.chartTitleHeight,legendMargin:Y.legendMargin,secondaryYLabel:Y.secondaryYLabel,secondaryAxisTitleWidth:Y.secondaryAxisTitleWidth,visibleBars:H,columnWidth:I,scrollbarVisible:D}}catch(L){throw L}}function Ft(t,e,l,s){t.attr("viewBox","0 0 "+e+" "+l);const{chartAreaColor:u,chartAreaBorder:r}=s.chartArea;if(t.style("background-color",u),r){const n=s.chartArea.chartAreaBorderColor,o=s.chartArea.chartAreaBorderThickness,p=s.chartArea.chartAreaBorderStyle.toString(),m=p==="1"?"solid":p==="2"?"dashed":"dotted";t.style("outline",`${o}px ${m} ${n}`).style("outline-offset",`-${o}px`)}else t.style("outline","none").style("outline-offset",null)}const wt=(t,e)=>{let l=T.select(t.current);l.selectAll("*").remove();let s=Ui(zi,e),u=t.current.getBoundingClientRect(),r=u.width,n=u.height;return{formatOptions:s,svg:l,width:r,height:n}},zt=(t,e,l)=>{let s=[];if(!t.dataTableProperties.dataTable)return{formatOptions:t,dataTableLegendsList:s};let u=!1;return e.forEach(r=>{r?.properties?.showInDataTable==!0&&(u=!0,s.push(r.properties.alias))}),l.forEach(r=>{r?.properties?.showInDataTable==!0&&(u=!0,s.push(r.properties.alias))}),u||(t.dataTableProperties.dataTable=!1),t.dataTableProperties.dataTableLegends||(s=[]),{formatOptions:t,dataTableLegendsList:s}};function Ui(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(l=>{const s=t[l],u=Object.prototype.hasOwnProperty.call(e,l),r=e[l];if(!u||r===void 0){e[l]=Array.isArray(s)?[...s]:typeof s=="object"&&s!==null?{...s}:s;return}const n=Bi(s),o=Bi(r);n&&o&&Ui(s,r)}),e}function Bi(t){return Object.prototype.toString.call(t)==="[object Object]"}function $t(t,e,l,s,u){parseFloat(t.yAxisLabel.yAxisIntervalText);let r=parseFloat(t.yAxisLabel.yAxisMaxText),n=parseFloat(t.yAxisLabel.yAxisMinText),o=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"),n=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):void 0;let B=t.yAxisLabel.yAxisMaxText;r=String(B).length>0?parseFloat(B):l,r&&(l=r),parseFloat(t.yAxisLabel.yAxisIntervalText)<l&&parseFloat(t.yAxisLabel.yAxisIntervalText)}else r=void 0,n=void 0;if(t.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?(parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)<u&&(p=parseFloat(t.secondaryYAxisLabel.secondaryYAxisMinText)),o=t.secondaryYAxisLabel.secondaryYAxisMaxText&&t.secondaryYAxisLabel.secondaryYAxisMaxText!==""?parseFloat(t.secondaryYAxisLabel.secondaryYAxisMaxText):u,t.secondaryYAxisLabel.secondaryYAxisIntervalText!==""&&parseFloat(t.secondaryYAxisLabel.secondaryYAxisIntervalText)):(o=void 0,p=void 0),t.secondaryYAxisLabel.secondaryYAxisSyncWithPrimaryLabel){o=void 0,p=void 0;const B=r!==void 0&&!Number.isNaN(r)?r:l,G=Math.max(B,u);l=G,u=G,r!==void 0&&!Number.isNaN(r)&&(r=G)}let m=e?qe(e,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,f=l?qe(l,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,y=s?qe(s,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,S=u?qe(u,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,A=r?qe(r,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,Z=n?qe(n,t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2").toString().length:0,L=o?qe(o,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,Y=p?qe(p,t.secondaryYAxisLabel.secondaryYAxisDisplayUnits,t.secondaryYAxisLabel.secondaryYAxisNumberFormat,t.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision??"2").toString().length:0,b=m<f||m===f?l:e;if(n){let B=Z<f?l:n;b=b<B?B:b}if(r){let B=A>m?r:e;b=b<B?B:b}r&&n&&(b=A>Z?r:n);let H=y<S?u:s;if(p){let B=Y<S?u:p;H=H<B?B:H}if(o){let B=L>S?o:u;H=H<B?B:H}return o&&p&&(H=L>Y?o:p),{maxNumberForPrimaryAxis:b,maxNumberForSecondaryAxis:H,customYaxisMaxValue:l,secondaryCustomYaxisMaxValue:u}}function qe(t,e,l,s,u){try{let r,n="",o=s,p;if(e==="Auto")return $l(t);switch(e!=ti.none&&(e==ti.thousands&&(r=1e3,n="K"),e==ti.millions&&(r=1e6,n="M"),e==ti.billions&&(r=1e9,n="B"),t=t/r),u&&t<0&&(t=-t),l){case La.percentage:return p=`.${o}%`,T.format(p)(t);case La.general:return p=`.${o}f`,T.format(p)(t)+n;case La.scientific:let m=Number(o);return p=`.${m==0?1:(m+1).toString()}n`,T.format(p)(t)+n;case La.currency_USD:if(p=`,.${o}f`,t<0){const f=Math.abs(t);return"-$"+T.format(p)(f)+n}return"$"+T.format(p)(t)+n;case La.currency_CAD:if(p=`,.${o}f`,t<0){const f=Math.abs(t);return"-$"+T.format(p)(f)+n}return"C$"+T.format(p)(t)+n;case La.currency_EUR:if(p=`,.${o}f`,t<0){const f=Math.abs(t);return"-$"+T.format(p)(f)+n}return"€"+T.format(p)(t)+n;case La.currency_CHF:if(p=`,.${o}f`,t<0){const f=Math.abs(t);return"-$"+T.format(p)(f)+n}return"CHF"+T.format(p)(t)+n;case La.currency_UK:if(p=`,.${o}f`,t<0){const f=Math.abs(t);return"-$"+T.format(p)(f)+n}return"£"+T.format(p)(t)+n;case La.currency_INR:if(p=`,.${o}f`,t<0){const f=Math.abs(t);return"-$"+T.format(p)(f)+n}return"₹"+T.format(p)(t)+n;case La.commaSeparated:return p=`,.${o}f`,T.format(p)(t)+n;default:return p=".2f",T.format(p)(t)+n}}catch(r){throw r}}function $l(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 l=T.format(".2f")(t);return+l===Math.floor(t)?T.format(".0f")(t):l}else return e>=.01?T.format(".2f")(t):e>0?T.format(".2e")(t):"0"}function Hi(t,e,l,s,u){try{{let r,n,o=s?l.secondaryYAxisLabel.secondaryYAxisDisplayUnits:l.yAxisLabel.yAxisDisplayUnits,p=s?l.secondaryYAxisLabel.secondaryYAxisNumberFormat:l.yAxisLabel.yAxisNumberFormat,m=s?l.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision:l.yAxisLabel.yAxisLabelDecimalPrecision,f=s?l.secondaryYAxisLabel.secondaryYAxisLabelFontSize:l.yAxisLabel.yAxisLabelFontSize,y=s?l.secondaryYAxisLabel.secondaryYAxisLabelFontFamily:l.yAxisLabel.yAxisLabelFontFamily;if(o!="None")return r=qe(Math.floor(t)||Math.floor(e),o,p,m??"2").toString(),n=It(r,f,y)[0],n<30?30:n+5;try{return r=qe(Math.floor(t)||Math.floor(e),o,p,m??"2").toString(),u&&(r="-100%"),n=It(r,f,y)[0],n<30?30:n+5}catch{}}}catch(r){throw r}}function Dt(t,e){try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(l){throw l}}function Ct(t,e,l,s,u,r,n){try{let o=n??crypto.randomUUID().toUpperCase();t.append("defs").append("clipPath").attr("id",o+"-clip").append("rect").attr("width",s).attr("height",l>0?u-l:u),t.append("rect").attr("width",s).attr("height",l>0?u-l:u).attr("stroke",e.plotArea.plotAreaBorder&&!$i.includes(r)?e.plotArea.plotAreaBorderColor:"none").attr("stroke-width",e.plotArea.plotAreaBorderThickness).attr("fill",e.plotArea.plotAreaColor!==ze.white&&!$i.includes(r)?e.plotArea.plotAreaColor:"none")}catch(o){throw o}}function Yl(t,e){const l=t.yPosition,s=t.yPosition+t.height,u=e.yPosition,r=e.yPosition+e.height;return l<r&&s>u}function ut(t,e,l,s,u,r,n,o,p){try{let m=s.yAxisLabel.yAxisIntervalsVisibility,f=!1,y=m?parseFloat(s.yAxisLabel.yAxisIntervalText):void 0,S=[],A;if(u.chartType===ee.TornadoChart){const L=Math.max(Math.abs(e),Math.abs(t)),Y=n||L,b=r||e;if(y&&y>0){for(let H=b;H<=Y+1e-6;H+=y)S.push(parseFloat(H.toFixed(6)));A=S.length}else if(s.yAxisLabel.yAxisTicksMode===Da.custom)S=za(b,Y,s.yAxisLabel.yAxisTicksCount),A=S.length;else{f=!0;const H=6,G=(Y-b)/H;for(let I=0;I<=H;I++){const D=b+I*G;S.push(parseFloat(D.toFixed(6)))}A=o?p/80:l/80}return{yAxisLabelArray:S,customTickValue:A,autoLabelFlag:f}}if(!n&&t>0){const Y=(t-e)*.05;t=t+Y}if(y&&y!==0&&y!==void 0){let L=r||r==0?r:e,Y=n||n==0?n:t;L<0?A=Math.floor((Y-L)/y):A=Math.floor(Y/y);let b=18;(n||n==0)&&(t=n);let H=r||r==0?r:e<0?Math.round(e):0;if(S.push(H),A>100){let B="Tick count cannot exceed more than 100.";L<0?y=(Y-H)/100:y=Y/100}if(A=A<100?A:100,A>b)for(let B=0;B<parseInt(A)&&(H+=y,parseFloat(H.toFixed(5))<=t);B++)S.push(H);else for(let B=0;B<b&&(H+=y,H<=t);B++)S.push(H)}else if(s.yAxisLabel.yAxisTicksMode===Da.custom&&El.includes(u.chartType)){const L=r||r==0?r:e;S=za(L,t,s.yAxisLabel.yAxisTicksCount),A=S.length}else{f=!0;let L=It((n||u.yMaxLeft).toString(),s.yAxisLabel.yAxisLabelFontSize,s.yAxisLabel.yAxisLabelFontFamily,0);S=Wi(r||u.yMinLeft,t,o?p:l,o?L[1]:L[0]),A=o?p/80:l/80}return{yAxisLabelArray:S,customTickValue:A,autoLabelFlag:f}}catch(m){throw m}}function Wi(t,e,l,s=80){const u=e-t;if(!isFinite(u)||Math.abs(u)<1e-12)return[Number(t.toFixed(12))];const r=u<10?10:Math.max(2,Math.floor(l/s)),n=u/r,o=Math.pow(10,Math.floor(Math.log10(n))),p=[1,1.5,2,2.5,5,10];let m=p.map(Z=>Z*o).find(Z=>Math.ceil(u/Z)<=r);m||(m=p.at(-1)*o);const f=Math.floor(t/m)*m,y=Math.ceil(e/m)*m,S=Math.round((y-f)/m),A=new Array(S+1);for(let Z=0;Z<=S;Z++)A[Z]=Number((f+Z*m).toFixed(12));return A}function Qt(t,e,l,s,u,r){try{let n=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-s},0)`).attr("height",l>0?r-l:r).attr("width",s).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==ze.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const o=t.append("g").call(u);o.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),o.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==ze.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",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.includes("Bold")?"Bold":"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),o.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth??e.plotArea.plotAreaBorderThickness)}catch(n){throw n}}function gi(t,e,l,s,u,r,n){let o=e.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${n},0)`).attr("height",l>0?r-l:r).attr("width",s).attr("fill",e.secondaryYAxisLabel.secondaryYAxisLabelVisibility&&e.secondaryYAxisLabel.secondaryYAxisBackgroundColor?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==ze.white?e.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const p=t.append("g").call(u).attr("transform",`translate(${n},0)`);p.selectAll("text").style("fill",e.secondaryYAxisLabel.secondaryYAxisLabelColor!==ze.white?e.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",e.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",e.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",o.includes("Italic")?"Italic":"").style("text-decoration",o.includes("Underline")?"Underline":"").style("font-weight",o.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 Ul(t,e){if(!t||t.length===0)return[];const l=Math.max(2,parseInt(e)||3);if(l>=t.length)return[...t];const s=t.length-1,u=new Set;for(let r=0;r<l;r++)u.add(Math.round(r*s/(l-1)));return Array.from(u).sort((r,n)=>r-n).map(r=>t[r])}function At(t,e,l){return l.xAxisLabel.xAxisTicksMode===Da.custom?Ul(t,l.xAxisLabel.xAxisTicksCount):Bl(t,e)}function Bl(t,e){try{let l=[],s=e/30<t.length?Math.round(e/30):t.length;if(s>=t.length)return l=t,l;let u=Math.round(t.length/s);(t.length-1)%u!=0&&(t.length-1)%(u+1)==0&&(u=u+1),l.push(t[0]);let r;for(let n=1;n<t.length-1;n++){const o=n*u;if(o>t.length)break;l.push(t[o]),r=o}if(!l.includes(t[t.length-1])){let n=r>=Math.round(t.length-t.length*.02);l.push(t[t.length-1])}return l=l.filter(n=>n)}catch(l){throw l}}function la(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z){try{let L=e.chartType!==ee.ColumnHistogramChart?At(A,y,s):[],Y=[],b=o[3]+10;e.chartType!=ee.ColumnHistogramChart?Y=f?vt(s.xAxisLabel.xAxisNumberFormat,L.map(q=>q)).map(q=>q):L:L.forEach(q=>{Y.push(e.formattedDimensionListMap.get(q))});let H=!s.plotArea.fitChart&&(e.chartType==ee.AreaChart||e.chartType==ee.StackAreaChart||e.chartType==ee.NormalizedStackAreaChart);t||(t=t);let B=s.xAxisLabel.xAxisLabelFontStyle,G="rotate("+-s.xAxisLabel.xAxisLabelRotation+")";s.dataTableProperties&&s.dataTableProperties.dataTable&&Il.includes(e.chartType)&&s.xAxisLabel.xAxisPosition!="1"&&(s.xAxisLabel.xAxisLabelVisibility=!1);let I=s.xAxisLabel.xAxisPosition;t.selectAll("#x-axis").remove();const D=t.append("g").attr("id","x-axis");D.append("rect").attr("transform",`translate(1,${I==="0"?u>0?S-u:S:I==="1"?-l:r(0)})`).attr("height",l).attr("width",y).attr("fill",s.xAxisLabel.xAxisLabelVisibility&&s.xAxisLabel.xAxisBackgroundColor?s.xAxisLabel.xAxisBackgroundColor!==ze.white?s.xAxisLabel.xAxisBackgroundColor:"none":s.chartArea.chartAreaColor);const N=D.append("g").attr("transform",`translate(0,${I=="0"?u>0?S-u:S:I=="1"?0:r(0)})`).call(n);let R=I==="1"?"5":"0",X;s.xAxisLabel.labelTextWrap?s.xAxisLabel.multiLineLabelWrap?X=s.xAxisLabel.maxXAxisLabelWidth:X=b<p*.15?b:p*.15:X=s.xAxisLabel.xAxisLabelRotation==0?m:b;const le=typeof Z.step=="function"?Z.step():m,te=parseInt(s.xAxisLabel.xAxisLabelFontSize)*1.2,Q=Math.floor(le/te),de=s.xAxisLabel.xAxisLabelRotation==0;let Le=N.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(X)).style("height",le+"px").attr("transform",(q,J)=>`rotate(${I==="1"?-s.xAxisLabel.xAxisLabelRotation:s.xAxisLabel.xAxisLabelRotation!=0?180-s.xAxisLabel.xAxisLabelRotation:0}) translate (${s.xAxisLabel.xAxisLabelRotation!=0?R+`, -${J==0&&H?15:le/2}`:-X/2+" , "+(I==="1"?"-15":"8")})`);de||Le.style("overflow","visible"),Gi()==="safari"&&Le.attr("width",s.xAxisLabel.labelTextWrap?b<p*.125?b:p*.125:l).attr("height","20px");let he=Le.append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",de?"center":"end").style("align-items",de?"start":"center").style("overflow","visible").style("text-align","center").append("xhtml:div").style("transform",Gi()==="safari"||I==="1"?"":s.xAxisLabel.xAxisLabelRotation!=0?"rotate(180deg)":"0");return(s.xAxisLabel.labelTextWrap&&!s.xAxisLabel.multiLineLabelWrap||!s.xAxisLabel.labelTextWrap)&&he.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),s.xAxisLabel.labelTextWrap&&s.xAxisLabel.multiLineLabelWrap&&he.style("-webkit-line-clamp",Q.toString()).style("display","-webkit-box").style("-webkit-box-orient","vertical").style("overflow","hidden").style("word-break","break-word").style("white-space","normal"),he.style("text-align",s.xAxisLabel.xAxisLabelRotation!=0?"start":"center").style("user-select","none").style("margin",0).style("padding","0 1px").style("font-family",s.xAxisLabel.xAxisLabelFontFamily).style("color",s.xAxisLabel.xAxisLabelColor).style("font-size",s.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",s.xAxisLabel.xAxisLabelVisibility?"visible":"hidden"),e.chartType===ee.ColumnHistogramChart?he.attr("title",(q,J)=>qe(q,s.xAxisLabel.xAxisDisplayUnits,s.xAxisLabel.xAxisNumberFormat,s.xAxisLabel.xAxisLabelDecimalPrecision,!1)).html((q,J)=>qe(q,s.xAxisLabel.xAxisDisplayUnits,s.xAxisLabel.xAxisNumberFormat,s.xAxisLabel.xAxisLabelDecimalPrecision,!1)):he.attr("title",(q,J)=>(""+Y[J]).trim()).html((q,J)=>(""+Y[J]).trim()),N.selectAll("text").style("visibility",(s.xAxisLabel.xAxisLabelVisibility,"hidden")),N.selectAll("line").style("stroke",s.plotArea.gridLinesColor).style("shape-rendering","crispEdges").attr("visibility",s.xAxisLabel.xAxisLabelVisibility||s.plotArea.gridLinesVertical?"visible":"hidden"),N.select(".domain").style("stroke",s.xAxisLabel.xAxisColor).attr("stroke-width",s.xAxisLabel.xAxisWidth?s.xAxisLabel.xAxisWidth:s.plotArea.plotAreaBorderThickness).style("shape-rendering","crispEdges").attr("visibility",s.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").raise(),t}catch(L){throw L}}function Gi(){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 _i={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"]},Hl=t=>{const e=Number(t);if(!Number.isFinite(e))return null;const l=Math.floor(e-25569),s=new Date(l*86400*1e3);return Number.isNaN(s.getTime())?null:{day:s.getUTCDate(),month:s.getUTCMonth(),year:s.getUTCFullYear()}},Wl=t=>String(t%100).padStart(2,"0"),Gl=(t,e,l,s)=>{const u=_i.short[e],r=_i.long[e],n=String(t).padStart(2,"0"),o=String(e+1).padStart(2,"0"),p=Wl(l),m=String(l);switch(s){case"Month":return r;case"Quarter":return`Quarter${Math.floor(e/3)+1}-${m}`;case"Year":return m;case"Default":return`${n}-${u}-${m}`;case"DD-MM-YYYY":return`${n}-${o}-${m}`;case"MM-DD-YYYY":return`${o}-${n}-${m}`;case"DD-MM":return`${n}-${o}`;case"YYYY-MM-DD":return`${m}-${o}-${n}`;case"YYYY-MM":return`${m}-${o}`;case"YYYY":return m;case"MM-YYYY":return`${o}-${m}`;case"MMM-YY":return`${u}-${p}`;case"YY-MMM":return`${p}-${u}`;case"MMMM-YY":return`${r}-${p}`;case"MMMM-YYYY":return`${r}-${m}`;case"DD-MMM":return`${n}-${u}`;case"DD-MMM-YY":return`${n}-${u}-${p}`;case"DD-MMM-YYYY":return`${n}-${u}-${m}`;default:return`${n}-${u}-${m}`}},vt=(t,e)=>{try{return e.map(l=>{const s=Hl(l);if(!s)return l;const{day:u,month:r,year:n}=s;return Gl(u,r,n,t)})}catch(l){throw l}};function Ja(t,e,l){if(t.seriesLabel.seriesLabelVisibility){e.selectAll(".seriesLabels").remove();let s=t.seriesLabel.seriesLabelFontStyle;e.selectAll(".seriesLabels").data(l).enter().filter(r=>r.isVisible).append("g").attr("class","seriesLabels").attr("transform",r=>`translate(${r.xPosition}, ${r.yPosition})`).append("foreignObject").attr("width",r=>r.width).attr("height",r=>r.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",s.includes("Italic")?"italic":"").style("text-decoration",s.includes("Underline")?"underline":"").style("font-weight",s.includes("Bold")?"bold":"").style("color","black").text(r=>r.seriesValue)}}function _l(t,e,l,s,u,r){const n=l.xAxisLabel.xAxisPosition!="1"?e.left-20-u:5;return t?`rotate(-90) translate(-${e.top+s},${n})`:`translate(${e.left},${e.top+s+(l?.xAxisLabel?.xAxisPosition=="1"?0:t?r:u)})`}function Vt(t,e,l,s,u,r,n,o,p,m,f){try{let y=l.append("foreignObject").attr("visibility",t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",_l(e,s,t,f,u,p)).attr("class","xAxisTitle").attr("width",e?f:m).attr("height",n+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?y.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):y.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(y){throw y}}function Nt(t,e,l,s,u,r,n,o,p,m,f){try{let y=s?t:l>0?t-l:t,S=u.append("foreignObject").attr("visibility",e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",s?r.left:`-${r.top+y}`).attr("y",s?r.top+y+o:r.left-n-o).attr("class","yAxisTitle").attr("transform",s?"":"rotate(-90)").attr("width",s?p:y).attr("height",n+"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),u}catch(y){throw y}}function Jt(t,e,l,s,u,r,n,o,p,m=!1){let f=t.append("foreignObject").attr("visibility",e&&s.secondaryYAxisTitle.secondaryYAxisTitleVisibility?"visible":"hidden").attr("x",m?`${l.left}`:`-${l.top+(u>0?r-u:r)}`).attr("y",m?`${l.top-o-p-2}`:`${l.left+n+o-2}`).attr("class","yAxisTitleSecondary").attr("transform",m?"rotate(0)":"rotate(-90)").attr("width",m?n:u>0?r-u:r).attr("height",p+"px");s.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length!==0?f.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s.secondaryYAxisTitle.secondaryYAxisTitleText).html(s.secondaryYAxisTitle.secondaryYAxisTitleHTML?s.secondaryYAxisTitle.secondaryYAxisTitleHTML:s.secondaryYAxisTitle.secondaryYAxisTitleText):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("padding-top","3px").style("text-anchor","middle").style("color","rgba(119,119,119)").style("font-size",s.secondaryYAxisTitle.secondaryYAxisTitleFontSize+"px").style("font-family",s.secondaryYAxisTitle.secondaryYAxisTitleFontFamily).style("font-style",s.secondaryYAxisTitle.secondaryYAxisTitleFontStyle).attr("title",s.secondaryYAxisTitle.secondaryYAxisTitleText).html(s.secondaryYAxisTitle.secondaryYAxisTitleText)}function Pt(t,e,l,s){let u=t.append("foreignObject").attr("visibility",e.chartTitle.chartTitleVisibility?"visible":"hidden").attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",l-4).attr("height",s+"px");const r=p=>{const m=document.createElement("div");return m.innerHTML=p,m.textContent||m.innerText||""},o=!!e.chartTitle.chartTitleHTML?r(e.chartTitle.chartTitleHTML):e.chartTitle.chartTitleText;e.chartTitle.dynamicTitleText.length!==0?u.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o).style("white-space","pre").style("text-overflow","ellipsis").html(e.chartTitle.chartTitleHTML?e.chartTitle.chartTitleHTML:e.chartTitle.chartTitleText):u.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 Tt(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 jl(t){const e=t.indexOf(" - ");return e==-1?Mi.default:t.slice(e+3)}const Ca=(t,e)=>e?t?.legend?.split(" - ")[0]:t?.properties?.alias||t?.properties?.name||"Legend";function Za(t,e){return[[0,0],[t/2,e/2],[t,e]]}function Ht(t,e,l){if(!e.annotation.annotationRangeFilter?.enabled)return t;const{condition:s,minVal:u,maxVal:r}=e.annotation.annotationRangeFilter;return t.filter(n=>{const o=l(n);switch(s){case"lt":return o<=r;case"gt":return o>=u;case"in":return o>=u&&o<=r;case"not-in":return o<u||o>r;default:return!0}})}function $a(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z,L,Y,b,H,B,G,I,D,N){try{const R=m===ee.TornadoChart;let X=new Map,le=p.annotation.annotationType??"1",te=p.annotation.annotationPosition.toString()!="4"?p.annotation.annotationPosition:null,Q=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor";const de=p.annotation.connectorType?.toLowerCase()==="curve";if(p.annotation.annotationVisibility){let Le=[le=="1"?"connector":""],Te=[],he=r.annotation(),q=p.annotation.connectorType,J=p.annotation.annotationVisibility,M=p.annotation.annotationFontStyle,x=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates)),k=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";x=Fi(x,p,m);let c=[],d=[];switch(x.length!=0&&x.forEach(a=>{a.dx=a.dx*y/a.width,a.dy=a.dy*f/a.height,a.width=y,a.height=f}),J){case"2":t.forEach(a=>{a.data[0]&&Te.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"3":t.forEach(a=>{a.data[a.data.length-1]&&Te.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:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})});break;case"4":t.forEach(a=>{a.data[0]&&Te.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId})}),t.forEach(a=>{a.data[a.data.length-1]&&Te.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:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(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(g=>{g.data[a]&&Te.push({Dimension:g.data[a].dimension,Measure:g.data[a].value,Legend:g.data[a].legend,LabelPosition:te||g.properties.annotationPosition,Labelcolor:g.properties[Q],hoverText:Ca(g,N),Axis:g.properties.axis,LegendUniqueId:g.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]&&Te.push({Dimension:a.data[P].dimension,Measure:a.data[P].value,Legend:a.data[P].legend,LabelPosition:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"2":break;case"3":a.data[0]&&Te.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"4":a.data[a.data.length-1]&&Te.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:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break;case"5":a.data[0]&&Te.push({Dimension:a.data[0].dimension,Measure:a.data[0].value,Legend:a.data[0].legend,LabelPosition:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId}),a.data[a.data.length-1]&&Te.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:te||a.properties.annotationPosition,Labelcolor:a.properties[Q],hoverText:Ca(a,N),Axis:a.properties.axis,LegendUniqueId:a.properties.legendUniqueId});break}});break}let i=0;Te.forEach((a,g)=>{i<a.Measure&&(i=a.Measure)});let h=i*.1;Te.forEach((a,g)=>{let P={note:{label:a.Measure>=1e9&&p.annotation.annotationNumberFormat===".2s"?Math.round(a.Measure/1e9)+"B":qe(m===ee.TornadoChart?Math.abs(a.Measure):a.Measure,p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:D&&m!==ee.TornadoChart?parseInt(a.LabelPosition)===2?"middle":"start":m===ee.TornadoChart?"end":"middle"},data:D?{y:R?jl(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:bi[p.annotation.connectorCurve],points:de?Za(0,0):[[0,0],[0,0]]},disable:Le,subject:{height:15,width:15},color:a.Labelcolor,type:Ai(r,parseFloat(le)),height:f,width:y};if(D){let ce=a.Axis===Oe.primary?l:s;(At(A,Z,p).includes(a.Dimension)||m===ee.TornadoChart)&&!n.includes(a.Legend)&&ce(a.Measure)<=S&&ce(a.Measure)>=0&&c.push(P)}else At(A,S,p).includes(a.Dimension)&&!n.includes(a.Legend)&&(a.Axis==Oe.primary?l(a.Measure)<=Z&&l(a.Measure)>=0:s(a.Measure)<=Z&&s(a.Measure)>=0)&&c.push(P)}),p.annotation.annotationHideZeroValues&&(c=c.filter(a=>D?a.data.x.measure!==0:a.data.y.measure!==0)),c=Ht(c,p,a=>D?a.data.x.measure:a.data.y.measure),x.length===0?(x=c,X=new Map(x.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}]))):X=new Map(x.map(a=>[a.legendUniqueId,a])),c.forEach(a=>{const g=a.data.legendUniqueId;if(x.length!=0){const P=X.get(g);P&&(a.dx=P.dx,a.dy=P.dy,a.data.isVisible=P.isVisible??!0,P?.connectorPoints&&P.connectorPoints.length>=(de?3:2)?a.connector.points=P.connectorPoints:a.connector.points=de?Za(a.dx,a.dy):[[0,0],[0,0]])}d.push(a)}),he.editMode(p.annotation.annotationDraggable&&G).accessors({x:function(a){if(D){let g=a.x.axis===Oe.primary?l:s,P=a.x.axis;return ji(p,a.x.measure?a.x.measure:0,a.position,g,h,void 0,m,I,P)}else if(m===ee.ColumnChart){const g=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=H(g);return P!=null?e(a.x)+P-(B-H.bandwidth())/2:e(a.x)}else return e(a.x)},y:function(a){if(a.y?.axis==Oe.primary)return ii(a.y.measure,parseFloat(a.position),l,h,a.prevValue,m);if(D){const g=a.legendUniqueId.includes("~$~")?a.legendUniqueId.split("~$~")[0]:a.legendUniqueId,P=H&&m!==ee.DotPlot?H(g):0;return R?H(a.y)+H.bandwidth()/2:H?e(a.y)+P-(B-H.bandwidth())/2-5:e(a.y)-5}else return ii(a.y.measure,parseFloat(a.position),s,h,a.prevValue,m)}}).on("dragend",function(a){if(a.data.isVisible||(a.data.isVisible=!0,x.forEach(g=>{g.data.x==a.data.x&&g.data.y.measure==a.data.y.measure&&(v.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","block"),g.data.isVisible=!0)})),d.forEach(g=>{(g.data?.legendUniqueId==a.data.legendUniqueId||g.legendUniqueId==a.data.legendUniqueId)&&(g.dx=a._dx*y/g.width,g.dy=a._dy*f/g.height,g.connectorPoints=a.connector?.points?.map(P=>[...P])||[])}),b){const g=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}));b(g)}v.selectAll(".connector").attr("hoverId",g=>g.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[p.annotation.connectorStyle.toLowerCase()]),v.selectAll(`.connector-${k}`).attr("fill",p.annotation.connectorColor||"#ccc").style("stroke",p.annotation.connectorColor||"#ccc"),v.selectAll(".note-line").attr("hoverId",g=>g.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[p.annotation.connectorStyle.toLowerCase()]).filter(g=>g._dx==0&&g._dy==0).remove(),v.selectAll(".annotation-note-label").filter(g=>g.data&&g.data.isVisible).style("display","block")}).on("noteclick",function(a){p.annotation.annotationDraggable&&G&&(a.data.isVisible=!1,x.forEach(g=>{g.data.x==a.data.x&&g.data.y.measure==a.data.y.measure&&(v.selectAll(".annotation-note-label").filter(P=>P.data.x==a.data.x&&P.data.y.measure==a.data.y.measure).attr("display","none"),g.data.isVisible=!1)}),v.selectAll(".annotation-note-label").filter(g=>g.data&&!g.data.isVisible).style("display","none"))}).accessorsInverse({x:a=>e.invert(a.x),y:a=>l.invert(a.y)}).notePadding(0).annotations(d),p.plotArea.fitChart&&Y.selectAll(".annotation-group").remove();let v=Di(Y,p,u,M,he,k,D);if(p.animation?.animationEnabled){const a=p.animation.animationDuration,g=tt[p.animation.animationEffect],P=he.accessors(),ce=m===ee.LineChart,z=m===ee.DotPlot,me=(ve,Me=0)=>{const Pe=P.x(ve.data),ne=P.y(ve.data);return`translate(${Pe+Me}, ${ne})`};if(z)v.selectAll(".annotation").attr("opacity",0).attr("transform",ve=>me(ve,-15)).transition().duration(a).ease(g).attr("opacity",1).attr("transform",ve=>me(ve));else if(ce){const ve=e.range?e.range():[0,1],Me=Math.min(ve[0],ve[1]),Pe=Math.max(ve[0],ve[1])-Me,ne=(Be,ye=100)=>{for(let Ye=0;Ye<=ye;Ye++){const O=Ye/ye;if((g??T.easeLinear)(O)>=Be)return O}return 1};v.selectAll(".annotation").attr("opacity",0).each(function(Be){const ye=P.x(Be.data)??Me,Ye=Pe>0?Math.max(0,Math.min(1,(ye-Me)/Pe)):0,O=ne(Ye)*a;T.select(this).transition().delay(O).duration(0).attr("opacity",1)})}else v.selectAll(".annotation").attr("transform",function(ve){if(D){const Me=l?l(0):0,Pe=P.y(ve.data);return`translate(${Me}, ${Pe})`}else{const Me=P.x(ve.data),Pe=ve.data?.y?.axis===Oe.primary?l:s??l,ne=Pe?Pe(0):0;return`translate(${Me}, ${ne})`}}).transition().duration(a).ease(g).attr("transform",function(ve){const Me=P.x(ve.data),Pe=P.y(ve.data);return`translate(${Me}, ${Pe})`})}}}catch(R){throw R}}function Jl(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z,L,Y,b,H,B,G,I){try{let D=y.annotation.annotationType??"1";if(y.annotation.annotationVisibility){let N=[D=="1"?"connector":""],R=[],X=new Map,le=r.annotation(),te=y.annotation.connectorType,Q=y.annotation.annotationVisibility,de=y.annotation.annotationFontStyle,Le=[],Te=[],he=y.annotation.connectorType?y.annotation.connectorType.toLowerCase():"None";const q=y.annotation.connectorType?.toLowerCase()==="curve";let J=JSON.parse(JSON.stringify(y.plotArea.dataLabelsCoordinates));J=Fi(J,y,ee.CustomColumnChart);let M=[],x=[];J.length!=0&&J.forEach(i=>{i.dx=i.dx*A/i.width,i.dy=i.dy*S/i.height,i.width=A,i.height=S});for(let i=0;i<t.length;i++)t.forEach(h=>{h.properties.type&&h.properties.type!=ee.ColumnChart&&!Te.includes(h.properties.type)&&Te.push(h.properties.type)});switch(Q){case"2":t.forEach((i,h)=>{switch(i.properties.type){case ee.ColumnChart:case ee.LineChart:case ee.AreaChart:R.push({...i.data[0],alias:i.properties?.alias});break;case ee.StackColumnChart:n.forEach(v=>R.push(v[0]));break;case ee.StackAreaChart:o.forEach(v=>R.push(v[0]));break}});break;case"3":t.forEach(i=>{switch(i.properties.type){case ee.ColumnChart:case ee.LineChart:case ee.AreaChart:R.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case ee.StackColumnChart:n.forEach(h=>R.push(h[h.length-1]));break;case ee.StackAreaChart:o.forEach(h=>R.push(h[h.length-1]));break}});break;case"4":t.forEach((i,h)=>{switch(i.properties.type){case ee.ColumnChart:case ee.LineChart:case ee.AreaChart:R.push({...i.data[0],alias:i.properties?.alias});break;case ee.StackColumnChart:n.forEach(v=>R.push(v[0]));break;case ee.StackAreaChart:o.forEach(v=>R.push(v[0]));break}}),t.forEach(i=>{switch(i.properties.type){case ee.ColumnChart:case ee.LineChart:case ee.AreaChart:R.push({...i.data[i.data.length-1],alias:i.properties?.alias});break;case ee.StackColumnChart:n.forEach(h=>R.push(h[h.length-1]));break;case ee.StackAreaChart:o.forEach(h=>R.push(h[h.length-1]));break}});break;case"1":t.forEach(i=>{switch(i.properties.type){case ee.ColumnChart:case ee.LineChart:case ee.AreaChart:i.data.forEach(a=>R.push({...a,alias:i.properties?.alias}));break;case ee.StackColumnChart:let h=n.findIndex(a=>a.key===i.properties.legend);h!==-1&&n[h].forEach(a=>R.push(a));break;case ee.StackAreaChart:let v=o.findIndex(a=>a.key===i.properties.legend);v!==-1&&o[v].forEach(a=>R.push(a));break}});break;case"5":break;case"6":t.forEach((i,h)=>{let v=i.properties.annotation.toString();switch(i.properties.type){case ee.ColumnChart:switch(v){case"1":for(let P=0;P<t[h].data.length;P++)R.push(i.data[P]);break;case"2":break;case"3":R.push(i.data[0]);break;case"4":R.push(i.data[i.data.length-1]);break;case"5":R.push(i.data[0]),R.push(i.data[i.data.length-1]);break}break;case ee.AreaChart:case ee.LineChart:switch(v){case"1":for(let P=0;P<t[h].data.length;P++)R.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":R.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":R.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":R.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}),R.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 ee.StackColumnChart:const a=n.findIndex(P=>P.key===i.properties.legend);a!==-1&&n[a].forEach((P,ce)=>{switch(String(n[a].individualAnnotationVisibility)){case"1":R.push(n[a][ce]);break;case"2":break;case"3":let z=n[a][0];R.find(Pe=>Pe.key==z.key)||R.push(z);break;case"4":let me=n[a][n[0].length-1];R.find(Pe=>Pe.key==me.key)||R.push(me);break;case"5":let ve=n[a][0],Me=n[a][n[0].length-1];if(!R.find(Pe=>Pe.key==ve.key||Pe.key==Me.key)){R.push(n[a][0]),R.push(n[a][n[0].length-1]);break}}});break;case ee.StackAreaChart:const g=o.findIndex(P=>P.key===i.properties.legend);g!=-1&&o[g].forEach((P,ce)=>{switch(String(o[g].individualAnnotationVisibility)){case"1":R.push(o[g][ce]);break;case"2":break;case"3":let z=o[g][0];R.find(Pe=>Pe.key==z.key)||R.push(z);break;case"4":let me=o[g][o[0].length-1];R.find(Pe=>Pe.key==me.key)||R.push(me);break;case"5":let ve=o[g][0],Me=o[g][o[0].length-1];if(!R.find(Pe=>Pe.key==ve.key||Pe.key==Me.key)){R.push(ve),R.push(Me);break}}});break}});break}let k=0;R.forEach((i,h)=>{k<i.value&&(k=i.value)});let c=k*.1;R.forEach((i,h)=>{let v={note:{label:i.value||i.value==0?i.value>=1e9&&y.annotation.annotationNumberFormat===".2s"?Math.round(i.value/1e9)+"B":qe(i.value,y.annotation.annotationDisplayUnits||y.plotArea.plotAreaDisplayUnits,y.annotation.annotationNumberFormat,y.annotation.annotationDecimalPrecision):i[1]-i[0]>=1e9&&y.annotation.annotationNumberFormat===".2s"?Math.round(i[1]-i[0]/1e9)+"B":qe(i[1]-i[0],y.annotation.annotationDisplayUnits||y.plotArea.plotAreaDisplayUnits,y.annotation.annotationNumberFormat,y.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!=ee.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!=ee.StackColumnChart?i[1]?i[1]:0:i[1]>0?i[1]:i[0])},dx:0,dy:0,connector:{end:he,curve:bi[y.annotation.connectorCurve],points:q?Za(0,0):[[0,0],[0,0]]},disable:N,subject:{height:15,width:15},color:i.labelColor||i.data.labelColor,type:Ai(r,parseFloat(D)),height:S,width:A};i.legend&&i.dimension?!p.includes(i.legend.includes("~$~")?i.legend.split("~$~")[1]:i.legend)&&(i.axis==Oe.primary?l(i.value)<=Y&&l(i.value)>=0:s(i.value)<=Y&&s(i.value)>=0)&&M.push(v):!p.includes(i.key)&&(i.data.axis==Oe.primary?l(i[1])<=Y&&l(i[1])>=0:s(i[1])<=Y&&s(i[1])>=0)&&M.push(v)}),y.annotation.annotationHideZeroValues&&(M=M.filter(i=>i.data.y!==0)),M=Ht(M,y,i=>i.data.y),J.length===0?(J=M,X=new Map(J.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(J.map(i=>[i.legendUniqueId,i])),M.forEach(i=>{const h=i.data.legendUniqueId;if(J.length!=0){const v=X.get(h);v&&(i.dx=v.dx,i.dy=v.dy,i.data.isVisible=v.isVisible??!0,v?.connectorPoints&&v.connectorPoints.length>=(q?3:2)?i.connector.points=v.connectorPoints:i.connector.points=q?Za(i.dx,i.dy):[[0,0],[0,0]],y.annotation.annotationType=="5"&&i.dx==0&&i.dy==0&&(i.connector.points=[[0,0],[0,0]]))}i.data.labelPosition!=4&&x.push(i)}),le.editMode(y.annotation.annotationDraggable&&I).accessors({x:function(i){const h=i.x.type||i.type;if(Te.includes(h))switch(h){case ee.StackColumnChart:return e(i.x.dimension)+G(i.x.stacklegend)-(f-G.bandwidth())/2;case ee.StackAreaChart:case ee.LineChart:case ee.AreaChart:return e(i.x.dimension)}else{if(i.x.legend){const v=i.legendUniqueId.includes("~$~")?i.legendUniqueId.split("~$~")[0]:i.legendUniqueId;return e(i.x.dimension)+G(v)-(f-G.bandwidth())/2}return e(i.x.dimension)}},y:function(i){const h=i.type??i.x.type;return i.x.axis==Oe.primary?ii(i.y,parseFloat(i.position),l,c,i.prevValue,h):ii(i.y,parseFloat(i.position),s,c,i.prevValue,h)}}).on("dragend",function(i){if(i.data.isVisible||(i.data.isVisible=!0,J.forEach(h=>{h.data.x.dimension==i.data.x.dimension&&h.data.x.legend==i.data.x.legend&&h.data.x.type==i.data.x.type&&h.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(v=>v.data.x.dimension==i.data.x.dimension&&v.data.x.legend==i.data.x.legend&&v.data.x.type==i.data.x.type&&v.data.prevValue==i.data.prevValue).attr("display","block"),h.data.isVisible=!0)})),x.forEach(h=>{(h.data?.legendUniqueId==i.data.legendUniqueId||h.legendUniqueId==i.data.legendUniqueId)&&(h.dx=i._dx*A/h.width,h.dy=i._dy*S/h.height,h.connectorPoints=i.connector?.points?.map(v=>[...v])||[])}),B){const h=x.map(v=>({legendUniqueId:v.data?.legendUniqueId||v.legendUniqueId,dx:v.dx,dy:v.dy,connectorPoints:v.connector.points||v.connectorPoints||[],isVisible:(v.data?.isVisible||v.isVisible)??!0,width:v.width,height:v.height}));B(h)}d.selectAll(".connector").attr("hoverId",h=>h.data.currentLegend).style("stroke",y.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[y.annotation.connectorStyle.toLowerCase()]),d.selectAll(`.connector-${he}`).attr("fill",y.annotation.connectorColor||"#ccc").style("stroke",y.annotation.connectorColor||"#ccc"),d.selectAll(".note-line").attr("hoverId",h=>h.data.currentLegend).style("stroke",y.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[y.annotation.connectorStyle.toLowerCase()]).filter(h=>h._dx==0&&h._dy==0).remove(),d.selectAll(".annotation-note-label").filter(h=>h.data&&h.data.isVisible).style("display","block")}).on("noteclick",function(i){y.annotation.annotationDraggable&&I&&(i.data.isVisible=!1,J.forEach(h=>{h.data.x.dimension==i.data.x.dimension&&h.data.x.legend==i.data.x.legend&&h.data.x.type==i.data.x.type&&h.data.prevValue==i.data.prevValue&&(d.selectAll(".annotation-note-label").filter(v=>v.data.x.dimension==i.data.x.dimension&&v.data.x.legend==i.data.x.legend&&v.data.x.type==i.data.x.type&&v.data.prevValue==i.data.prevValue).attr("display","none"),h.data.isVisible=!1)}),d.selectAll(".annotation-note-label").filter(h=>h.data&&!h.data.isVisible).style("display","none"))}).accessorsInverse({x:i=>e.invert(i.x),y:i=>i.x.axis==Oe.primary?l.invert(i.y):s.invert(i.y)}).notePadding(0).annotations(x),y.plotArea.fitChart||H.selectAll(".annotation-group").remove();let d=Di(H,y,u,de,le,he,!1);if(y.animation?.animationEnabled){const i=y.animation.animationDuration,h=tt[y.animation.animationEffect],v=le.accessors();d.selectAll(".annotation").attr("transform",function(a){const g=v.x(a.data),P=a.data.type||a.type,z=(a.data?.x?.axis||a.data?.axis)===Oe.primary?l:s;let me;return P===ee.StackColumnChart||P===ee.StackAreaChart?me=z(a.data.prevValue??0):me=z(0),`translate(${g}, ${me})`}).transition().duration(i).ease(h).attr("transform",function(a){const g=v.x(a.data),P=v.y(a.data);return`translate(${g}, ${P})`})}}}catch(D){throw D}}const Fi=(t,e,l)=>{try{let s=[ee.PieChart,ee.DonutChart].includes(l)?"plotArea":"annotation";return t=e[s].annotationDraggable&&!!1?t??[]:[],t}catch(s){throw s}},Ai=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(l){throw l}},ii=(t,e,l,s,u,r)=>{try{let n=[ee.LineChart,ee.StackLineChart,ee.StackAreaChart,ee.NormalizedStackAreaChart,ee.NormalizedStackLineChart,ee.StackAreaChart];switch(u||(u=0),e){case 1:let o;switch(r){case ee.LineChart:case ee.HorizontalBarChart:case ee.ColumnChart:case ee.AreaChart:case ee.StackAreaChart:o=t<0?l(t)+7:l(t)-15;break;case ee.StackHorizontalBarChart:case ee.NormalizedStackLineChart:case ee.StackLineChart:case ee.NormalizedStackAreaChart:case ee.StackAreaChart:case ee.StackColumnChart:o=t<0?l(t)+5:l(t)-15;break;case ee.TornadoChart:o=l(t)+l.bandwidth()/2;break;default:o=t<0?l(u)+5:l(t)-15}return o;case 2:return n.includes(r)?l(t):t===0?r==="stack"?"":l(0)-15:l(u+(t-u)/2);case 3:return n.includes(r)?t===-1||t<0?l(t)-10:l(t)+10:r.includes("stack")?t===-1&&u===0?l(0)+10:t===1&&u!==0?l(u)-10:u<0?l(u)+10:u===0&&t<0?l(0)+10:u===0&&t>0?l(0)-10:l(u)-10:t<0?l(0)+10:l(0)-10}}catch(n){throw n}},Wt=(t,e,l,s,u,r)=>{try{const n=t?.swapAxis?.swapAxisEnabled??!1,o=r?.DataTableData??[];let p=[],m=20;if(t.dataTableProperties&&t.dataTableProperties.dataTable){const f=t.dataTableProperties.dataTableLegends;t.dataTableProperties.dataTableAxisLabel?m=wi(u[0],void 0,t):m=0;const y=[...s,...o];n||(t.xAxisLabel.xAxisLabelVisibility=!1);const A=!t.dataTableProperties.disableLegendIcon?35:0;let Z=e+l-A;y.forEach((L,Y)=>{if(L?.properties?.showInDataTable??!0){let b={data:L.data.filter(H=>u.includes(H.dimension)),properties:{legend:L.properties.alias,color:L.properties.color,markerColor:L.properties.markerColor,markerShape:L.properties.markerShape,lineStyle:L.properties.lineStyle,height:f?wi(L.properties.alias.includes("~$~")?L.properties.alias.split("~$~")[1]:L.properties.alias,Z,t):20}};m+=b.properties.height,p.push(b)}})}else m=0,p=[];return p.length==0&&(m=0,p=[],t.dataTableProperties.dataTable=!1),{dataTable:p,dataTableHeight:m}}catch{}},wi=(t,e,l)=>{try{let s=20,u=It(t,l.dataTableProperties.dataTableFontSize,l.dataTableProperties.dataTableFontFamily)[0];return s=It(t,l.dataTableProperties.dataTableFontSize,l.dataTableProperties.dataTableFontFamily,void 0,u>e&&!l.dataTableProperties.legendsWrapText?e:void 0)[1],s}catch(s){throw s}};function Zt(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z,L,Y,b,H,B,G,I,D){try{let N=function(a,g,P,ce){g===0&&a.append("foreignObject").attr("x",-G.left).attr("y",Le).attr("class","blankClass").attr("width",G.left).attr("height",v).append("xhtml:div").style("width",G.left).style("height",`${v}px`).style("border-width",J?`0px 0px ${R.dataTableAxisLabel?x:0}px 0px`:"0px 0px 0px 0px").style("border-style",J?`solid ${k} ${k} solid`:"solid solid solid solid").style("border-color",J?`black ${M} ${M} black`:"black black black black").style("text-align","center").style("vertical-align","middle").text("");const me=a.append("foreignObject").attr("x",-G.left).attr("y",Le+q).attr("width",G.left).attr("height",ce).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",de).style("height",`${ce}px`).style("padding-left",R.disableLegendIcon?"2px":"5px").style("padding-right","3px").style("border-width",()=>Va(S,g,void 0,le,te,"width")).style("border-style",()=>Va(S,g,void 0,le,te,"style")).style("border-color",()=>Va(S,g,void 0,le,te,"color"));if(!R.disableLegendIcon)switch(y){case ee.ColumnChart:case ee.StackColumnChart:case ee.NormalizedStackColumnChart:me.append("xhtml:div").style("height","10px").style("width","15px").style("background",P.properties.color).style("border-radius","1px");break;case ee.LineChart:case ee.StackLineChart:case ee.NormalizedStackLineChart:Oi(P,me,S);break;case ee.AreaChart:case ee.StackAreaChart:case ee.NormalizedStackAreaChart:el(P,me,S);break}const ve=P.properties.legend,Me=S?.legends?.legendColorMode=="1"?P?.properties?.color:S?.legends?.legendSelectedUnicolor,Pe=me.append("xhtml:div").style("max-width",de).attr("class","legendsColumn").style("text-align","left").style("vertical-align","middle").call(i).style("padding-left","5px").style("white-space","normal").style("overflow-wrap","break-word").style("color",Me??"black").style("width",R.disableLegendIcon?"100%":"calc(100% - 30px)").attr("title",ve).text(ve);R.legendsWrapText&&Pe.style("white-space","nowrap").style("overflow","hidden").style("text-overflow","ellipsis")};const R=S.dataTableProperties,X=R.dataTableFontStyle,le=L.length,te=s.length,Q=b[0]?b[0]:0,de=typeof n.step=="function"?n.step():u,Le=D??I-f,Te=2;let he=20,q=0;const J=S.dataTableOuterBorder.borderButtonVisibility,M=S.dataTableOuterBorder.lineColor,x=S.dataTableOuterBorder.lineWidth,k=S.dataTableOuterBorder.lineStyle,c=a=>a===0?de+Te+Q/2:a===le-1?de+Te-Q/2:de,d=a=>qe(y.includes("100stack")?a.TooltipMeasure/a.TotalMeasure:a.TooltipMeasure||a.value,R.dataTableDisplayUnits,R.dataTableNumberFormat,R.dataTableDecimalPrecision),i=a=>a.style("font-size",R.dataTableFontSize+"px").style("font-family",R.dataTableFontFamily).style("font-style",X.includes("Italic")?"Italic":"").style("text-decoration",X.includes("Underline")?"Underline":"").style("font-weight",X.includes("Bold")?"Bold":"");T.selectAll("#dataTableG"+B).remove();const h=l.append("g").attr("id","dataTableG"+B);let v=0;R.dataTableAxisLabel&&(v=wi(L[0],void 0,S),he=v),s.forEach((a,g)=>{q+=!R.dataTableAxisLabel&&g===0?0:he,he=a.properties.height,R.dataTableLegends&&N(h,g,a,he);const P=h.append("g").attr("class","dataTableBorder").selectAll("#scaling-svg"+B+" .foreignObject").data(()=>a.data).enter().filter(ce=>n(ce.dimension)).append("g").attr("fill",ze.transparent).attr("transform",(ce,z)=>`translate(${z===0?0:n(ce.dimension)-de/2},0)`);g===0&&R.dataTableAxisLabel&&P.append("foreignObject").attr("class","dataTableColHeaders").attr("x",0).attr("y",Le).attr("id",(ce,z)=>z).attr("width",(ce,z)=>c(z)).attr("height",`${v}px`).append("xhtml:div").style("width",(ce,z)=>c(z)).style("height",`${v}px`).style("border-width",(ce,z)=>Va(S,z,void 0,le,te,"width","colHeaders")).style("border-style",(ce,z)=>Va(S,z,void 0,le,te,"style","colHeaders")).style("border-color",(ce,z)=>Va(S,z,void 0,le,te,"color","colHeaders")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-left","3px").call(i).style("color",S.xAxisLabel.xAxisLabelColor??"black").attr("title",ce=>H.get(Array.isArray(ce.dimension)?ce.dimension[0]:ce.dimension)).text(ce=>H.get(Array.isArray(ce.dimension)?ce.dimension[0]:ce.dimension)),P.append("foreignObject").attr("x",0).attr("y",Le+q).attr("width",(ce,z)=>c(z)).attr("height",he).style("justify-content","center").append("xhtml:div").attr("class","middlepart").style("width",(ce,z)=>c(z)).style("height",`${he}px`).style("line-height",`${he}px`).style("border-width",(ce,z)=>Va(S,g,z,le,te,"width")).style("border-style",(ce,z)=>Va(S,g,z,le,te,"style")).style("border-color",(ce,z)=>Va(S,g,z,le,te,"color")).style("text-align","center").style("white-space","nowrap").style("text-overflow","ellipsis").style("overflow","hidden").style("padding-inline","3px").call(i).style("color",R.dataTableLabelColor).attr("title",ce=>d(ce)).text(ce=>d(ce))})}catch(N){throw N}}function Va(t,e,l,s,u,r,n){try{const o=t.dataTableOuterBorder,p=t.dataTableInnerBorder,m=o.borderButtonVisibility,f=p.horizontalBorderLineButton,y=p.verticalBorderLineButton,S=t.dataTableProperties.dataTableAxisLabel,A={w:o.lineWidth,s:o.lineStyle,c:o.lineColor},Z={w:p.horizontalBorderLineWidth,s:p.horizontalBorderLineStyle,c:p.horizontalBorderLineColor},L={w:p.verticalBorderLineWidth,s:p.verticalBorderLineStyle,c:p.verticalBorderLineColor},Y={w:"0",s:"solid",c:"black"},b=m?A:Y,H=f?Z:Y,B=y?L:Y,G=s-1,I=u-1;let D=Y,N=Y,R=Y,X=Y;switch(n?(D=b,R=H,X=e===0?b:Y,N=e===G?b:B):l===void 0?(X=b,N=Y,D=e===0&&!S?b:Y,R=e===I?b:H):(D=e===0&&!S?b:Y,R=e===I?b:H,X=l===0?B:Y,N=l===G?b:B),r){case"width":return`${D.w}px ${N.w}px ${R.w}px ${X.w}px`;case"style":return`${D.s} ${N.s} ${R.s} ${X.s}`;case"color":return`${D.c} ${N.c} ${R.c} ${X.c}`}}catch(o){throw o}}function mt(t,e,l){let s=[];for(let u=0;u<t.length;u++){const r=t[u];let n={},o=0,p=0,m=0;for(let f=0;f<e.length;f++){let y=e[f].data.find(S=>S.dimension===t[u])?.value||0;n[e[f].properties.legend]=y,o=o+(l?Math.abs(y):y),p+=y>0?y:0,m+=y}n.total=o,n.dimension=r,n.absoluteTotal=p,n.displayTotal=m,s.push(n)}return s}function na(t,e,l,s,u,r,n,o){try{let p=l.seriesLabel.seriesLabelApplySeries,m=l.seriesLabel.seriesLabelPosition,f=[],y=s[0].legend,S=It(y,l.seriesLabel.seriesLabelFontSize,l.seriesLabel.seriesLabelFontFamily);return s.forEach(A=>{let Z=!1;if(p=="1"?Z=!0:Z=A.properties.seriesLabelVisibility,Z){let L={},Y=m=="Right"?A.data[A.data.length-1]:A.data[0],b=o?Y.value>0?Y[1]:Y[0]:Y.value;A.properties.axis==Oe.primary||!u?L.yPosition=e(b):r&&u&&(L.yPosition=u(b)),(L.yPosition<0||L.yPosition>n)&&(Z=!1),L.yPosition=L.yPosition-S[1]/2,L.isVisible=Z,L.seriesValue=A.properties.alias,L.height=S[1],L.width=S[0];let H=!1;f.length>0&&f.some(B=>{H||(H=Yl(B,L))}),Z&&!H&&f.push(L)}else return}),y="",f.forEach(A=>{A.seriesValue.length>y.length&&(y=A.seriesValue)}),S=It(y,l.seriesLabel.seriesLabelFontSize,l.seriesLabel.seriesLabelFontFamily),S[0]=S[0]+20,f.forEach(A=>{A.height=S[1],A.width=S[0],A.xPosition=m=="Right"?t+(r?10:0)-S[0]:5}),{labelArray:f,heightWidth:S}}catch(p){throw p}}function Ya(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z,L,Y,b,H,B,G){try{let I=p.annotation.annotationType??"1";if(p.annotation.annotationVisibility){let D=[I=="1"?"connector":""],N=[],R=new Map,X=r.annotation(),le=p.annotation.connectorType,te=p.annotation.annotationVisibility,Q=p?.annotation?.annotationSetLabelColor=="2"?"color":"labelColor",de=p.annotation.annotationFontStyle,Le=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None";const Te=p.annotation.connectorType?.toLowerCase()==="curve";let he=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates));he=Fi(he,p,m);let q=[],J=[];switch(he.length!=0&&he.forEach(c=>{c.dx=c.dx*y/c.width,c.dy=c.dy*f/c.height,c.width=y,c.height=f}),te){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 M=0;N.forEach((c,d)=>{M<c.Measure&&(M=c.Measure)});let x=M*.1;p.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&&p.annotation.annotationNumberFormat===".2s"?Math.round(c[1]-c[0]/1e9)+"B":qe(c[1]<0&&c[0]<0?c[0]-c[1]:c[1]===0&&c[0]<0?c[1]+c[0]:c[1]-c[0],p.annotation.annotationDisplayUnits||p.plotArea.plotAreaDisplayUnits,p.annotation.annotationNumberFormat,p.annotation.annotationDecimalPrecision),align:G?c.data.labelPosition==2?"middle":"start":"middle"},data:G?{y:c.data.dimension,x:c[1]>0?c[1]:c[0],prevValue:c[0]>=0?c[0]:c[1],position:p.annotation.annotationPosition=="4"?c.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:c.key.includes("~$~")?c.key.split("~$~")[1]:c.key,isVisible:!0,hoverId:c.properties.alias?qa(c.properties.alias):qa(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:p.annotation.annotationPosition=="4"?c.data.labelPosition:JSON.parse(p.annotation.annotationPosition),currentLegend:c.key.includes("~$~")?c.key.split("~$~")[1]:c.key,isVisible:!0,hoverId:c.properties?.alias?qa(c.properties.alias):qa(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:bi[p.annotation.connectorCurve],points:Te?Za(0,0):[[0,0],[0,0]]},disable:D,subject:{height:15,width:15},color:c.properties&&c.properties[Q]?c.properties[Q]:c.data.labelColor,type:Ai(r,parseFloat(I)),height:f,width:y};A.includes(c.data.dimension)&&Zl(Z,S,G,c,l)&&q.push(i)}),q=Ht(q,p,c=>G?c.data.x-c.data.prevValue:c.data.y-c.data.prevValue),he.length===0?(he=q,R=new Map(he.map(c=>[c.data.legendUniqueId,{measure:G?c.data.x:c.data.y,dimension:G?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}]))):R=new Map(he.map(c=>[c.legendUniqueId,c])),q.forEach(c=>{const d=c.data.legendUniqueId;if(he.length!=0){const i=R.get(d);i&&(c.dx=i.dx,c.dy=i.dy,c.data.isVisible=i.isVisible??!0,i?.connectorPoints&&i.connectorPoints.length>=(Te?3:2)?c.connector.points=i.connectorPoints:c.connector.points=Te?Za(c.dx,c.dy):[[0,0],[0,0]])}J.push(c)}),X.editMode(p.annotation.annotationDraggable&&B).accessors({x:function(c){return G?ji(p,c.x,parseFloat(c.position),l,x,c.prevValue,m):e(c.x)+e.bandwidth()/2},y:function(c){return G?e(c.y)+e.bandwidth()/2:ii(c.y,parseFloat(c.position),l,x,c.prevValue,m)}}).on("dragend",function(c){if(c.data.isVisible||(c.data.isVisible=!0,he.forEach(d=>{d.data.x==c.data.x&&d.data.y==c.data.y&&(k.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)})),J.forEach(d=>{(d.data?.legendUniqueId==c.data.legendUniqueId||d.legendUniqueId==c.data.legendUniqueId)&&(d.dx=c._dx*y/d.width,d.dy=c._dy*f/d.height,d.connectorPoints=c.connector?.points?.map(i=>[...i])||[])}),b){const d=J.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}));b(d)}k.selectAll(".connector").attr("hoverId",d=>d.data.currentLegend).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[p.annotation.connectorStyle.toLowerCase()]),k.selectAll(`.connector-${Le}`).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",Bt[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(c){p.annotation.annotationDraggable&&B&&(c.data.isVisible=!1,he.forEach(d=>{d.data.x==c.data.x&&d.data.y==c.data.y&&(k.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)}),k.selectAll(".annotation-note-label").filter(d=>d.data&&!d.data.isVisible).style("display","none"))}).accessorsInverse({x:c=>e.invert(c.x),y:c=>l.invert(c.y)}).notePadding(0).annotations(J),Y.selectAll(".annotation-group").remove();let k=Di(Y,p,u,de,X,Le,G);if(p.animation?.animationEnabled){const c=p.animation.animationDuration,d=tt[p.animation.animationEffect],i=X.accessors();if(m===ee.StackLineChart||m===ee.NormalizedStackLineChart){const v=e.range?e.range():[0,1],a=Math.min(v[0],v[1]),g=Math.max(v[0],v[1])-a,P=(ce,z=100)=>{for(let me=0;me<=z;me++){const ve=me/z;if((d??T.easeLinear)(ve)>=ce)return ve}return 1};k.selectAll(".annotation").attr("opacity",0).each(function(ce){const z=i.x(ce.data)??a,me=g>0?Math.max(0,Math.min(1,(z-a)/g)):0,ve=P(me)*c;T.select(this).transition().delay(ve).duration(0).attr("opacity",1)})}else k.selectAll(".annotation").attr("transform",function(v){if(G){const a=l?l(0):0,g=i.y(v.data);return`translate(${a}, ${g})`}else{const a=i.x(v.data),g=l?l(0):0;return`translate(${a}, ${g})`}}).transition().duration(c).ease(d).attr("transform",function(v){const a=i.x(v.data),g=i.y(v.data);return`translate(${a}, ${g})`})}}}catch(I){throw I}}function Zl(t,e,l,s,u){const r=u(s[1]>0?s[1]:s[0]);return l?r>=0&&r<=e:r<=t&&r>=0}const Di=(t,e,l,s,u,r,n)=>{t.selectAll(".annotation-group").remove();let o=t.append("g").attr("id","annotationGroup").attr("class","annotation-group parentGroup").attr("transform",`translate(${l.left},${l.top})`).style("fill",e.annotation.annotationColor).style("font-family",e.annotation.annotationFontFamily).style("font-size",e.annotation.annotationFontSize).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").call(u);return o.selectAll("rect").style("visibility","hidden"),o.selectAll(".annotation-subject").remove(),o.selectAll(".connector").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[e.annotation.connectorStyle.toLowerCase()]).style("visibility",p=>(n?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),o.selectAll(`.connector-${r}`).attr("fill",e.annotation.connectorColor||"#ccc").style("stroke",e.annotation.connectorColor||"#ccc").style("visibility",p=>(n?parseFloat(p.data.x)==0:parseFloat(p.data.y)==0)&&e.annotation.annotationHideZeroValues?"hidden":"visible"),o.selectAll(".note-line").style("stroke",e.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[e.annotation.connectorStyle.toLowerCase()]).filter(p=>p._dx==0&&p._dy==0).remove(),o.selectAll(".connector-end").filter(p=>p.connector.end=="dot"&&p._dx==0&&p._dy==0).remove(),o.selectAll(".annotation-note-label").filter(p=>p.data&&!p.data.isVisible).style("display","none"),e.annotation.annotationType=="1"&&o.selectAll(".annotation-note-content").attr("transform",function(){const m=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(m)return`translate(${n?0:parseFloat(m[1])}, 0)`}),o.selectAll("text").style("text-anchor",p=>n&&p.data.position=="2"?"middle":"start").append("text").style("fill",e.annotation.annotationColor!==ze.white?e.annotation.annotationColor:"none"),o.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"),o},sa=(t,e,l,s,u,r)=>{try{let n=t.yAxisLabel.yAxisLabelFontStyle,o="rotate("+-t.yAxisLabel.yAxisLabelRotation+")";e.append("rect").attr("transform",`translate(0,${s})`).attr("height",l+10).attr("width",u).attr("fill",t.yAxisLabel.yAxisLabelVisibility&&t.yAxisLabel.yAxisBackgroundColor?t.yAxisLabel.yAxisBackgroundColor!==ze.white?t.yAxisLabel.yAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const p=e.append("g").call(r).attr("transform",`translate(0,${s})`);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",o=="rotate(0)"?"middle":"end").attr("dx",o=="rotate(0)"?".2em":"-.1em").attr("dy",o=="rotate(0)"?"1em":".15em").attr("transform",o).attr("transform","rotate(-90) translate(-5,-5)").style("text-anchor","end").style("fill",t.yAxisLabel.yAxisLabelColor!==ze.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",n.includes("Italic")?"Italic":"").style("text-decoration",n.includes("Underline")?"Underline":"").style("font-weight",n.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(n){throw n}};function Xl(t,e,l,s,u,r,n,o){return t?`rotate(${90-l.xAxisLabel.xAxisLabelRotation})
25
+ translate(${-(s(u*.01)+r)} ,${-o/2})`:`rotate(${90-l.xAxisLabel.xAxisLabelRotation})
26
+ translate(${l.xAxisLabel.xAxisLabelRotation!=0?`${e===1?10:-r},${-o/2}`:-n/2+" ,2"})`}const oa=(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z,L,Y)=>{try{const b=f===ee.TornadoChart;let H=t.xAxisLabel.xAxisLabelFontStyle,B=parseInt(t.xAxisLabel.xAxisPosition),G=At(m,s,t),I=y?vt(t.xAxisLabel.xAxisNumberFormat,G.map(he=>he)).map(he=>he):G;e.selectAll("#yAxisRect").remove(),e.selectAll("#yAxisG").remove();let D;t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap?D=t.xAxisLabel.maxXAxisLabelWidth:D=l;let N=L.step();const R=parseInt(t.xAxisLabel.xAxisLabelFontSize)*1.2,X=Math.floor(N/R),le=t.xAxisLabel.xAxisLabelRotation==0;let te=e.append("rect").attr("id","yAxisRect").attr("transform",f===ee.TornadoChart?`translate(${-D-1},0)`:`translate(${B===0?-D-5:B===1?u:o(0)+(-D-5)},0)`).attr("height",s).attr("width",f===ee.TornadoChart?D:D+5).attr("fill",t.xAxisLabel.xAxisLabelVisibility&&t.xAxisLabel.xAxisBackgroundColor?t.xAxisLabel.xAxisBackgroundColor!==ze.white?t.xAxisLabel.xAxisBackgroundColor:"none":t.chartArea.chartAreaColor);const Q=e.append("g").attr("id","yAxisG").attr("transform",b?`translate(${o(0)},0)`:`translate(${B===0?0:B===1?u:o(0)},0)`).call(r);let Te=Q.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("align-content","center").attr("width",D).attr("height",N+"px").attr("transform",Xl(b,B,t,o,p,D,l,N)).append("xhtml:div").style("width","100%").style("height","100%").style("display","flex").style("justify-content",le?"center":"start").style("align-items",le?"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)&&Te.style("white-space","pre").style("text-overflow","ellipsis").style("overflow","hidden"),t.xAxisLabel.labelTextWrap&&t.xAxisLabel.multiLineLabelWrap&&Te.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"),Te.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",H.includes("Italic")?"Italic":"").style("text-decoration",H.includes("Underline")?"Underline":"").style("font-weight",H.includes("Bold")?"Bold":"").style("visibility",t.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(he,q)=>I[q]).html((he,q)=>I[q]),f===ee.TornadoChart){if(n){const he=e.append("g").attr("transform",`translate(${o(0)},0)`).call(n);he.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.xAxisLabel.xAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),he.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.xAxisLabel.xAxisColor).attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness),he.selectAll("text").style("visibility","hidden")}Q.selectAll("text").style("visibility","hidden")}else Q.selectAll("text").style("visibility","hidden");Q.selectAll("line").style("shape-rendering","crispEdges").style("stroke",t.plotArea.gridLinesColor).attr("visibility",t.yAxisLabel.yAxisLabelVisibility||t.plotArea.gridLinesVertical?"visible":"hidden"),Q.select(".domain").style("shape-rendering","crispEdges").attr("stroke-width",t.xAxisLabel.xAxisWidth??t.plotArea.plotAreaBorderThickness).style("stroke",t.xAxisLabel.xAxisColor)}catch(b){throw b}},ji=(t,e,l,s,u,r,n,o,p)=>{try{r=r??0;const m=qe(e,t.plotArea.plotAreaDisplayUnits,t.annotation.annotationNumberFormat,t.annotation.annotationDecimalPrecision,n===ee.TornadoChart),f=String(m).length,y=s(e),S=s(r),A=s(0),Z=n??"",L=Z.includes("stack"),Y=Z==="100%stackBar";switch(l){case 1:return Y?e<0&&e!==-1?y-20:e===-1||e>0&&e!==1?y+10:y-10:e<0||o&&p==="positive"?y-f*5:y+5;case 2:return e===0?L?"":A+15:s(r+(e-r)/2);case 3:return L?r<0?S-f*5:r===0&&e<0?A-f*5:r===0&&e>0?A+10:S+10:e<0?A-f*5:A+10;default:return y}}catch(m){throw m}},Li=(t,e,l,s,u)=>{try{let r=t.secondaryYAxisLabel.secondaryYAxisLabelFontStyle;e.append("rect").attr("transform",`translate(0,${-l})`).attr("height",l).attr("width",u).attr("fill",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor!==ze.white?t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:"none":t.secondaryYAxisLabel.secondaryYAxisBackgroundColor:t.chartArea.chartAreaColor);const n=e.append("g").call(s).attr("transform","translate(0,0)");n.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",t.plotArea.gridLinesColor).attr("stroke-width","0.05em").attr("stroke-opacity",t.plotArea.fitChart?"1":"0"),n.selectAll("text").attr("transform","rotate(270) translate(5,5)").style("text-anchor","start").style("fill",t.secondaryYAxisLabel.secondaryYAxisLabelColor!==ze.white?t.secondaryYAxisLabel.secondaryYAxisLabelColor:"none").style("font-size",t.secondaryYAxisLabel.secondaryYAxisLabelFontSize).style("font-family",t.secondaryYAxisLabel.secondaryYAxisLabelFontFamily).style("font-style",r.includes("Italic")?"Italic":"").style("text-decoration",r.includes("Underline")?"Underline":"").style("font-weight",r.includes("Bold")?"Bold":"").attr("visibility",t.secondaryYAxisLabel.secondaryYAxisLabelVisibility?"visible":"hidden"),n.select(".domain").style("shape-rendering","crispEdges").style("stroke",t.secondaryYAxisLabel.secondaryYAxisColor).attr("stroke-width",t.secondaryYAxisLabel.secondaryYAxisWidth)}catch(r){throw r}},Vi=(t,e)=>e*(1+t),Ji=(t,e)=>e/(1+t);function ql(t,e,l){const s=t>0?t:0,u=parseFloat(e?.plotArea?.plotAreaBarWidth)??25,r=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e?.plotArea?.plotAreaGapWidth)/100,n=Array.isArray(l?.dimensionList)?l.dimensionList.length:0;let o=0,p=0,m=!1;if(n>0&&s>0){const f=s/n,y=Ji(r,f);if(y>=u||e.plotArea.fitChart)p=y,o=n,m=!1;else{const S=Vi(r,u),A=Math.floor(s/S);A<=1?(o=1,p=Ji(r,s),m=n>1):(o=A,p=u,m=o<n)}}else o=0,p=0,m=!1;return{visibleBars:o,columnWidth:p,scrollbarVisible:m}}const Xa=(t,e,l)=>Math.max(e,Math.min(l,t)),Xt=(t,e,l,s,u,r,n,o,p,m,f,y,S=!1)=>{const A=(Z,L,Y,b,H)=>{try{if(H&&(Z=m+Z),!p||!Array.isArray(p.dimensionList)||!Array.isArray(t))return;Z=Z==null?0:Number(Z),L=L==null?0:Number(L),Y=Y==null?0:Number(Y),m=Xa(Math.round(Z),0,Math.max(0,L)),o=typeof o=="number"?o:0;const B=m,G=B+o;let I=p.dimensionList.slice(B,G),D=JSON.parse(JSON.stringify(t||[]));D.forEach((de,Le)=>{const Te=Array.isArray(de?.data)?de.data:[];D[Le].data=Te.filter(he=>I.includes(he?.dimension))});const N=u?.left??0,R=u?.top??0,X=Number(r)||0,le=Number(innerHeight)||0,te=Number(Y)||0,Q=L===0?1:L;if(S){const de=R+(le-te)*(L===0?0:m)/Q;b&&typeof b.attr=="function"&&b.attr("y",de)}else{const de=N+(X-te)*(L===0?0:m)/Q;b&&typeof b.attr=="function"&&b.attr("x",de)}y(I,D,o)}catch(B){typeof Ce=="function"&&Ce("ColumnChart","updateFromScrollPosition",B)}};if(n){const Z=e-u.top-u.bottom,L=Math.max(0,t[0].data.length-o),Y=e-8;s.append("rect").attr("id","scrollbarTrack").attr("x",S?l-8:u.left).attr("y",S?u.top:Y).attr("width",S?8:r).attr("height",S?Z:8).attr("fill","#ccc");const b=(S?Z:r)*o/p.dimensionList.length,H=s.append("rect").attr("x",S?l-8:u.left).attr("y",S?u.top:Y).attr("width",S?8:b).attr("height",S?b:8).attr("fill","#999").style("cursor",S?"ns-resize":"ew-resize");H.call(T.drag().on("drag",B=>{if(S){const I=(Xa(B.y,u.top,u.top+Z-b)-u.top)/(Z-b)*(L||1);A(I,L,b,H,!1),H.attr("y",u.top+(Z-b)*(L===0?0:m)/(L===0?1:L))}else{const I=(Xa(B.x,u.left,u.left+r-b)-u.left)/(r-b)*(L||1);A(I,L,b,H,!1),H.attr("x",u.left+(r-b)*(L===0?0:m)/(L===0?1:L))}})),s.on("wheel",B=>{B.preventDefault();const I=(S?B.deltaY:B.deltaX)>0?1:-1;if(A(I,L,b,H,!0),S){const D=u.top+(Z-b)*(L===0?0:m)/(L===0?1:L);H.attr("y",D)}else{const D=u.left+(r-b)*(L===0?0:m)/(L===0?1:L);H.attr("x",D)}})}else s.on("wheel",null);A(0,0,0,null,!0)};function li(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z){try{if(n.total.totalVisibility){const L=n.annotation.annotationVisibility!="5"?10:0;let Y=n.total.annotationType??"1",b=[Y=="1"?"connector":""],H=u.annotation(),B=n.total.connectorType,G=n.total.totalFontStyle,I=n.total.connectorType?n.total.connectorType.toLowerCase():"None";r=[];let D=[],N=Array.from(t,([X,le])=>({Dimension:X,Measure:le}));n.total.totalHideZeroValues&&(N=N.filter(X=>X.Measure!==0)),N.forEach((X,le)=>{let te={note:{label:X.Measure>=1e9&&n.total.totalNumberFormat===".2s"?Math.round(X.Measure/1e9)+"B":qe(X.Measure,n.total.totalDisplayUnits||n.plotArea.plotAreaDisplayUnits,n.total.totalNumberFormat,n.total.totalDecimalPrecision)},data:{y:X.Measure,x:X.Dimension},dx:0,dy:0,connector:{end:I,curve:bi[n.total.connectorCurve]},disable:b,subject:{height:15,width:15},color:n.total.totalColor,type:Ai(u,parseFloat(Y)),height:p,width:m};D.push(te)}),H.editMode(n.total.annotationDraggable&&y).accessors({x:function(X){if(!S)return e(X.x);if(X.y>=0){const te=Z?.get(X.x)??X.y;return l(te)+25}const le=A?.get(X.x)??X.y;return l(le)-25},y:function(X){if(S){const te=parseFloat(n.total.totalFontSize)||12;return n.annotation.annotationVisibility!=="5"?e(X.x)-te-4:e(X.x)-te/2}if(X.y>=0){const te=Z?.get(X.x)??X.y;return l(te)-L-15}const le=A?.get(X.x)??X.y;return l(le)+L+5}}).on("dragend",function(X){R.selectAll(".connector").style("stroke",n.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[n.total.connectorStyle.toLowerCase()]),R.selectAll(`.connector-${I}`).attr("fill",n.total.connectorColor||"#ccc").style("stroke",n.total.connectorColor||"#ccc"),R.selectAll(".note-line").attr("hoverId",le=>le.data.currentLegend).style("stroke",n.total.connectorColor||"#ccc").attr("stroke-dasharray",Bt[n.total.connectorStyle.toLowerCase()]).filter(le=>le._dx==0&&le._dy==0).remove()}).accessorsInverse({x:X=>e.invert(X.x),y:X=>l.invert(X.y)}).notePadding(0).annotations(D);let R=Kl(f,n,s,G,H,I);n.animation?.animationEnabled&&R.selectAll(".annotation").each(function(X){const le=T.select(this),Q=le.attr("transform")?.match(/translate\(([^,]+),\s*([^)]+)\)/);if(!Q)return;const de=parseFloat(Q[1]),Le=parseFloat(Q[2]);if(S){const Te=l(0);le.attr("transform",`translate(${Te},${Le})`).transition().duration(n.animation.animationDuration).ease(tt[n.animation.animationEffect]).attr("transform",`translate(${de},${Le})`)}else{const Te=l(0);le.attr("transform",`translate(${de},${Te})`).transition().duration(n.animation.animationDuration).ease(tt[n.animation.animationEffect]).attr("transform",`translate(${de},${Le})`)}})}}catch(L){throw L}}const Kl=(t,e,l,s,u,r)=>{t.selectAll(".total-annotation-group").remove();let n=t.append("g").attr("id","annotationGroup").attr("class","total-annotation-group").attr("transform",`translate(${l.left},${l.top})`).style("fill",e.total.totalColor).style("font-family",e.total.totalFontFamily).style("font-size",e.total.totalFontSize).style("font-style",s.includes("Italic")?"Italic":"").style("text-decoration",s.includes("Underline")?"Underline":"").style("font-weight",s.includes("Bold")?"Bold":"").call(u);return n.selectAll("rect").style("visibility","hidden"),n.selectAll(".annotation-subject").remove(),n.selectAll(".connector").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Bt[e.total.connectorStyle.toLowerCase()]),n.selectAll(`.connector-${r}`).attr("fill",e.total.connectorColor||"#ccc").style("stroke",e.total.connectorColor||"#ccc"),n.selectAll(".note-line").style("stroke",e.total.connectorColor||"#ccc").attr("stroke-dasharray",Bt[e.total.connectorStyle.toLowerCase()]).filter(o=>o._dx==0&&o._dy==0).remove(),n.selectAll(".connector-end").filter(o=>o.connector.end=="dot"&&o._dx==0&&o._dy==0).remove(),e.total.annotationType=="1"&&n.selectAll(".annotation-note-content").attr("transform",function(){const p=T.select(this).attr("transform").match(/translate\(([^,]+),([^,]+)\)/);if(p)return`translate(${parseFloat(p[1])}, 0)`}),n.selectAll("text").append("text").style("fill",e.total.totalColor!==ze.white?e.total.totalColor:"none"),n};function ri(t,e,l){e.clear(),l&&l.length>0&&l.forEach(s=>{e.set(s,0)}),t.ChartData&&t.ChartData.length>0&&t.ChartData.forEach(s=>{s.data.forEach((u,r)=>{if(e.has(u.dimension)){let n=e.get(u.dimension)||0;n+=u.value||0,e.set(u.dimension,n)}})})}function ca(t,e,l,s=!1){const u=s&&t.xAxisLabel.xAxisPosition=="1"?-1:1,r=l>0?l:0,n=parseFloat(t.plotArea.ticksHeight)||100,o=(e-r)*n/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesVertical?-o*u:0}function Yt(t,e,l=0){const s=parseFloat(t.plotArea.ticksWidth)||100,u=(e-l)*s/100;return t.plotArea.gridLinesVisibility&&t.plotArea.gridLinesHorizontal?-u:0}const Zi={color:"defaultColor",name:"",type:"Line",axis:Oe.primary,alias:"",fontSize:11,fontStyle:[],fontFamily:at,labelColor:ze.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:at,labelFontColor:"black",valueFontSize:11,valueFontStyle:[],valueFont:at,valueFontColor:"black",backgroundColor:ze.white,nodeHeight:5,nodeWidth:12,setColorScale:!1,startColor:"#FFFF00",endColor:"#FF0000",disableDataLabelPosition:!0,dataLabelPosition:1,actualChartType:"chartType",secondaryAxisBgColor:"#e5e5e5",stackBorderWidth:1,stackBorderColor:ze.black,stackBorderStyle:0,seriesLabelVisibility:!0,individualAnnotationVisibility:"1",currentMeasure:"Measure",legend:"",currentLegend:"",tooltip:"",tooltipMeasure:""};var rt=(t=>(t.SeriesId="data-series-id",t.DimValue="data-dim-value",t))(rt||{});const Ql="11px",Ol="1.6";function kt(t,e,l){return(s,u)=>{!t.current||!e.current||e.current(l(s,u))}}function Lt(t,e,l){return t?.(e,l)??void 0}const ht="CommonFunctions.ts";ee.ColumnChart,ee.StackColumnChart,ee.NormalizedStackColumnChart,ee.LineChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.AreaChart,ee.StackAreaChart,ee.NormalizedStackAreaChart,ee.PieChart,ee.PieofPie,ee.DonutChart,ee.PyramidChart,ee.OrganizationChart,ee.VennChart,ee.ProgressChart,ee.Maps,ee.WordCloud,ee.SankeyChart,ee.Speedometer,ee.RadialBarChart;function Et(t,e,l,s,u,r,n,o,p,m,f,y,S,A){try{let Z=n.legends.legendPosition,L=n.legends.legendAlignmentTopBottom,Y=n.legends.legendAlignment;if(n.legends.legendVisibility)switch(Z){case Ze.none:break;case Ze.right:let b=n.plotArea.fitChart?t-s-10:t-s-20;ha(e,o,u-(r+15),s+5,r+5,b,Z,Y,y,n,p,!1,A);break;case Ze.top:ha(e,o,7,s,u-10,30,Z,L,y,n,p,!1,A);break;case Ze.left:let H=n.plotArea.fitChart?t-s-10:t-s-20;const B=m?m+f.bottom:0;ha(e,o,7,s+5,r+5,H-B,Z,Y,y,n,p,!1,A);break;case Ze.bottom:ha(e,o,7,t-35,u-10,30,Z,L,y,n,p,!1,A);break}}catch(Z){Ce(ht,"drawLegends",Z)}}function er(t,e){try{let l=0,s=t[0];return t.forEach(u=>{if(u!==void 0){let r=u.includes("~$~")?u.split("~$~")[1]:u.includes("-")?u.slice(u.indexOf("-")+1):u,n=r.length;l<n&&(l=n,s=r)}}),It(s,e.legends.legendFontSize,e.legends.legendFontFamily)}catch(l){Ce(ht,"calculateMaxLegendWidth",l)}}function Na(t,e,l,s,u,r,n,o,p,m,f,y,S,A,Z,L=!1){try{const Y=(I,D)=>L?[D,I]:[I,D];let b=o.plotArea.hideZeroValues;o.plotArea.plotAreaHideLineAndMarkers===void 0&&(o.plotArea.plotAreaHideLineAndMarkers=!0),e.forEach(I=>I.data.forEach(D=>{D.markerShape=[ee.CombinationLine,ee.CombinationArea].includes(l)&&!o.plotArea.plotAreaHideLineAndMarkers?"None":I.properties.markerShape?I.properties.markerShape:"Circle",D.currentMeasure=I.properties.currentMeasure,D.markerColor=I.properties.markerColor?I.properties.markerColor:"Blue",D.alias=I.properties.alias,D.markerSize=I.properties.markerShape!="None"&&I.properties.markerSize&&I.properties.markerShape!="None"?l==="Area"?o.plotArea.plotAreaHideLineAndMarkers?I.properties.markerSize:0:I.properties.markerSize:0}));let H=t.selectAll(".lineMarkerGroup").data(e,I=>I.legend);H.exit().remove(),H.enter().append("g").attr("class","lineMarkerGroup parentGroup").attr("hoverId",I=>(I.properties.alias||I.properties.name||"Legend").replace(/\s+/g,"-")).merge(H).each(function(I){let N=T.select(this).selectAll("path").data(I.data,le=>String(le.dimension));N.exit().remove();const X=N.enter().append("path").attr("fill",le=>le.markerColor).merge(N).attr("d",le=>T.symbol().type(Xi(le.markerShape)).size(le.markerSize*50)()).attr("visibility",le=>{const te=!s(le.dimension)&&s(le.dimension)!==0,Q=o.marker.markerVisibility?tr(e,le,l,b,r,y,S)?Rt.hidden:[ee.NormalizedStackLineChart,ee.CombinationLine,ee.CombinationArea].includes(l)||[ee.StackAreaChart,ee.AreaChart,ee.CombinationStackArea].includes(l)?o.plotArea.plotAreaHideLineAndMarkers?Rt.visible:Rt.hidden:Rt.visible:[ee.CombinationLine,ee.CombinationArea].includes(l)||["Area"].includes(l)&&o.plotArea.plotAreaHideLineAndMarkers?Rt.visible:Rt.hidden;return te?Rt.hidden:Q}).attr("transform",le=>{let te=le.axis==Oe.primary?u:r;const Q=s(le.dimension),de=[ee.NormalizedStackAreaChart,ee.StackAreaChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.CombinationStackArea].includes(l)?le[1]>0?te(le[1]):te(le[0]):te(le.value),[Le,Te]=Y(Q,de);return`translate(${Le},${Te})`}).on("mousemove",function(le,te){const Q=te,de=te,Le=T.select(this.parentNode),Te=Array.isArray(Q.dimension)?Q.dimension[0]:Q.dimension,he=String(p.formattedDimensionListMap.get(Te)??""),q=Z?.(String(Te??""),{...te,formattedDimensionValue:he})??void 0;xt([{key:o.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(o.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():o.xAxisTitle.xAxisTitleText,value:p.formattedDimensionListMap.get(Array.isArray(Q.dimension)?Q.dimension[0]:Q.dimension)},{key:o.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(o.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():te.properties?.currentMeasure?te.properties.currentMeasure:o.yAxisTitle.yAxisTitleText||Q.value,value:qe([ee.NormalizedStackLineChart,ee.NormalizedStackAreaChart,""].includes(l)?Q[1]-Q[0]:Q.value,o.toolTip.toolTipDisplayUnits,o.toolTip.toolTipNumberFormat,o.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:de.alias.includes("~$~")?de.alias.split("~$~")[1]:de.alias}],o,le,te,q),Le.selectAll(".hoverHighlight").remove();const J=s(Q.dimension),M=()=>{const c=Q.axis===Oe.primary?u:r;return[ee.NormalizedStackAreaChart,ee.StackAreaChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.CombinationStackArea].includes(l)?Q[1]>0?c(Q[1]):c(Q[0]):c(Q.value)},[x,k]=Y(J,M());Le.insert("circle",":first-child").attr("class","hoverHighlight").attr("cx",x).attr("cy",k).attr("fill",de.markerColor).attr("opacity",.5).attr("r",de.markerSize*10),T.select(this).transition().duration(100).attr("transform",()=>{const c=Q.axis===Oe.primary?u:r,d=s(Q.dimension),i=[ee.NormalizedStackAreaChart,ee.StackAreaChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.CombinationStackArea].includes(l)?Q[1]>0?c(Q[1]):c(Q[0]):c(Q.value),[h,v]=Y(d,i);return`translate(${h},${v}) scale(1.3)`})}).on("mouseout",function(le,te){const Q=te,de=T.select(this.parentNode);ct(),de.selectAll(".hoverHighlight").remove(),T.select(this).transition().duration(100).attr("transform",()=>{const Le=Q.axis===Oe.primary?u:r,Te=s(Q.dimension),he=[ee.NormalizedStackAreaChart,ee.StackAreaChart,ee.StackLineChart,ee.NormalizedStackLineChart,ee.CombinationStackArea].includes(l)?Q[1]>0?Le(Q[1]):Le(Q[0]):Le(Q.value),[q,J]=Y(Te,he);return`translate(${q},${J}) scale(1)`})});if(o.animation.animationEnabled){const le=o.animation.animationDuration,te=tt[o.animation.animationEffect]??T.easeLinear;if([ee.AreaChart,ee.StackAreaChart,ee.NormalizedStackAreaChart,ee.CombinationArea,ee.CombinationStackArea].includes(l)){const de=[ee.StackAreaChart,ee.NormalizedStackAreaChart,ee.CombinationStackArea];X.each(function(Le){const Te=Le.axis===Oe.primary?u:r,he=s(Le.dimension),q=de.includes(l)?Le[1]>0?Te(Le[1]):Te(Le[0]):Te(Le.value),J=u(0),[M,x]=Y(he,J),[k,c]=Y(he,q);T.select(this).attr("transform",`translate(${M},${x})`).transition().duration(le).ease(te).attr("transform",`translate(${k},${c})`)})}else{const de=s.range(),Le=Math.min(de[0],de[1]),Te=Math.max(de[0],de[1])-Le,he=(q,J=100)=>{for(let M=0;M<=J;M++){const x=M/J;if(te(x)>=q)return x}return 1};X.attr("opacity",0).each(function(q){const J=s(q.dimension)??Le,M=Te>0?Math.max(0,Math.min(1,(J-Le)/Te)):0,x=he(M)*le;T.select(this).transition().delay(x).duration(0).attr("opacity",1)})}}})}catch(Y){Ce(ht,"lineMarkers",Y)}}function Xi(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 tr=(t,e,l,s,u,r,n)=>{try{return t[0].properties.axis&&t[0].properties.axis==="Secondary"?s&&e.value==0||e.value>u.domain()[1]||e.value<u.domain()[0]:l.includes("Stack")?e.value>0?s&&e[1]==0||e[1]<r||e[1]>n:s&&e[0]==0||e[0]<r||e[0]>n:s&&e.value==0||e.value<r||e.value>n}catch(o){Ce(ht,"checkVisibleConditions",o)}};function mi(t,e,l,s,u,r,n,o,p,m=!1){try{let f=function(S){try{let A=T.pointer(S),Z=1e99,L,Y=null;const b=m?A[1]:A[0],H=m?A[0]:A[1];for(let G=0;G<y.length;G++){let I=Math.abs(b-r(y[G]));I<Z&&(Z=I,Y=G)}let B=1e99;for(let G=0;G<u.length;G++){const I=p?u[G].data[Y].value>0?u[G].data[Y][1]:u[G].data[Y][0]:u[G].data[Y].value;let D=Math.abs(H-n(I));D<B&&(B=D,L=G)}l.attr("transform",ar(u[L],Y,r,n,p,m)).append("circle").attr("r",u[L].properties.markerSize*2.5).attr("id","tooltip").attr("fill",u[L].properties.markerColor).text(xt([{key:t.xAxisTitle.xAxisTitleText,value:u[L].data[Y].dimension},{key:u[L].properties.currentMeasure?u[L].properties.currentMeasure:this.basestyle.YAxisTitle.YAxisTitleText,value:qe(o===ee.NormalizedStackAreaChart?L===0?u[L].data[Y].value:u[L].data[Y].value-u[L-1].data[Y].value:u[L].data[Y].value,t.toolTip.toolTipDisplayUnits,t.toolTip.toolTipNumberFormat,t.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:u[L].data[Y].legend.includes("~$~")?u[L].data[Y].legend.split("~$~")[1]:u[L].data[Y].legend}],t,void 0,u[L].properties))}catch(A){Ce(ht,"onHoverMarkerForAreaChartFamily.mousemove",A)}};t.plotArea.plotAreaHideLineAndMarkers||e.on("mouseover",function(){l.style("display",null)}).on("mousemove",f).on("mouseout",function(){l.style("display","none"),ct()});let y=s}catch(f){Ce(ht,"onHoverMarkerForAreaChartFamily",f)}}const ar=(t,e,l,s,u,r=!1)=>{try{const n=u?t.data[e].value>0?t.data[e][1]:t.data[e][0]:t.data[e].value,o=l(t.data[e].dimension),p=s(n);return r?`translate(${p},${o})`:`translate(${o},${p})`}catch(n){Ce(ht,"getCoordinates",n)}};function Ut(t,e,l,s,u){try{const r=document.createElement("div");Object.assign(r.style,{position:"absolute",visibility:"hidden",top:"0",left:"0",margin:"0",padding:"0",border:"none",whiteSpace:"nowrap",overflowWrap:"",transform:""}),document.body.appendChild(r),r.style.transform="",r.style.width="",r.style.whiteSpace="nowrap",r.style.overflowWrap="",e!=null&&(r.style.fontSize=`${e}px`),l!=null&&(r.style.fontFamily=l),u!=null,r.textContent=t;const n=r.getBoundingClientRect(),o=n.width,p=n.height;if(s&&s!==0){r.style.transform=`rotate(${s}deg)`;const m=r.getBoundingClientRect();return r.remove(),{width:o,height:p,rotatedWidth:m.width,rotatedHeight:m.height}}return r.remove(),{width:o,height:p,rotatedWidth:0,rotatedHeight:0}}catch(r){Ce(ht,"preCalculateTextDimensions",r)}}function qi(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(l=>{const s=t[l],u=Object.prototype.hasOwnProperty.call(e,l),r=e[l];if(!u||r===void 0){e[l]=Array.isArray(s)?[...s]:typeof s=="object"&&s!==null?{...s}:s;return}const n=Ki(s),o=Ki(r);n&&o&&qi(s,r)}),e}catch(l){Ce(ht,"addUndefinedDefaults",l)}}function Ki(t){try{return Object.prototype.toString.call(t)==="[object Object]"}catch(e){Ce(ht,"isPlainObject",e)}}function Qe(t,e,l){try{let s=1,u="",r=l,n;return function(o){try{let p=o??0;if(t==="Auto")return ir(p);switch(t&&t!=="None"&&(t==="Thousands"&&(s=1e3,u="K"),t==="Millions"&&(s=1e6,u="M"),t==="Billions"&&(s=1e9,u="B"),p=p/s),e){case",.0%":return n=`.${r}%`,T.format(n)(p);case"":return n=`.${r}f`,T.format(n)(p)+u;case".2n":return n=`.${r==0?1:parseFloat(r)+1}n`,T.format(n)(p)+u;case".2$":return n=`,.${r}f`,"$"+T.format(n)(p)+u;case".2c":return n=`,.${r}f`,"C$"+T.format(n)(p)+u;case".2ē":return n=`,.${r}f`,"€"+T.format(n)(p)+u;case".2ch":return n=`,.${r}f`,"CHF"+T.format(n)(p)+u;case".2£":return n=`,.${r}f`,"£"+T.format(n)(p)+u;case".2₹":return n=`,.${r}f`,"₹"+T.format(n)(p)+u;case",":return n=`,.${r}f`,T.format(n)(p)+u;default:return n=".2f",T.format(n)(p)+u}}catch(p){Ce(ht,"getNumberWithFormatFunction.inner",p)}}}catch(s){Ce(ht,"getNumberWithFormatFunction",s)}}function ir(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 xt(t,e,l,s,u){try{const r=s?.color??s?.markerColor??"blue",n=s?.markerShape?.toLowerCase()??"circle",o=e.toolTip.toolTipTheme==="Light",p=o?"rgba(255, 255, 255)":"#272729ff",m=o?"black":ze.white,f=o?"gray":"#d1d5db",y=(N,R=6)=>{if(!N)return"";const X=N.split(" ");let le="";for(let te=0;te<X.length;te+=R)le+=X.slice(te,te+R).join(" ")+"<br/>";return le};T.selectAll(".chartTooltip").style("visibility",Rt.hidden);const S=document.getElementById("chartTooltipDiv")?.getAttribute("data-dynamic-tooltip"),A=T.select("#chartTooltipDiv").html("").append("div").attr("class",o?"tooltipParentLight chartTooltip":"tooltipParentDark chartTooltip").style("color",m).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":o?"0px 4px 10px #240808ff":"0px 4px 12px rgba(0,0,0,0.6)").style("transition","transform 0.1s ease, opacity 0.2s ease"),Z=l||window.event,L=Z.pageX,Y=Z.pageY,b=t.reduce((N,R)=>{const X=(()=>{switch(n){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+=`
27
27
  <div style="
28
28
  display:flex;
29
29
  align-items:flex-start;
@@ -42,17 +42,17 @@ let E=t<200?200:S?e:t,b=e<200?200:S?t:e,U=E*.15*.8,Y=Ol(r,l),H=U<Y[0]+10?U:Y[0]+
42
42
  <span style="
43
43
  width:6px;
44
44
  height:6px;
45
- background:${l};
45
+ background:${r};
46
46
  margin-top:5px;
47
47
  border-radius:50%;
48
48
  "></span>
49
49
 
50
50
  <span style="
51
51
  font-size:11px;
52
- color:${L};
52
+ color:${f};
53
53
  white-space:nowrap;
54
54
  ">
55
- ${z.key||""}
55
+ ${R.key||""}
56
56
  </span>
57
57
  </div>
58
58
 
@@ -66,129 +66,129 @@ let E=t<200?200:S?e:t,b=e<200?200:S?t:e,U=E*.15*.8,Y=Ol(r,l),H=U<Y[0]+10?U:Y[0]+
66
66
  word-break:break-word;
67
67
  line-height:1.4;
68
68
  ">
69
- ${u(String(z.value),6)}
69
+ ${y(String(R.value),6)}
70
70
  </div>
71
71
 
72
72
  </div>
73
- `,w},"");g.html(x?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${Kl}; color:${m}; line-height:${Ql};">${x}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${b}</div>`);const U=g.node(),Y=U.offsetWidth,H=U.offsetHeight;let I=A+15,D=E+15;I+Y>window.innerWidth&&(I=A-Y-10),D+H>window.innerHeight&&(D=E-H-10),g.style("left",`${I}px`).style("top",`${D}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(l){console.error("Tooltip Error:",l)}}function ot(){try{v.select("#chartTooltipDiv").html("").style("visibility",Et.hidden)}catch(t){me(xt,"hideTooltipOnMouseOut",t)}}const Xt=(t,e,n,o)=>{try{let l=v.select(t.current).append("foreignObject").attr("visibility",o.chartTitle.chartTitleVisibility?Et.visible:Et.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",n).attr("height",e+"px");o.chartTitle.dynamicTitleText.length!==0?l.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",o.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",Et.visible).style("line-height","1.3em").html(o.chartTitle.chartTitleHTML?o.chartTitle.chartTitleHTML:o.chartTitle.chartTitleText):l.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",Et.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(x){me(xt,"drawChartTitle",x)}},qi=(t,e)=>{try{return t.reduce((n,o)=>{const x=typeof o=="string"?o:e&&typeof o=="object"&&o[e]||"";return x.length>n.length?x:n},"")}catch(n){me(xt,"findStringWithLongestLength",n)}},xa=(t,e,n,o,x,l,r,c,p,m,L,u=!1,S)=>{try{if(m.legends.legendVisibility){let W="",A="";r==Je.left||r==Je.right?(A="column",W=c==Ea.top?"start":c==Ea.middle?"center":"end"):(A="row",W=c==Ra.start?"start":c==Ra.middle?"center":"end");var g=t.append("foreignObject").attr("x",n).attr("y",o).style("pointer-events","auto").attr("width",x+"px").attr("height",l+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+L).attr("class","legendsBoxWrapper").style("width",x+"px").style("display","flex").style("height",l-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+W).style("flex-direction",A).style("outline-offset","-"+m.legends.legendBorderThickness+"px").style("outline",m.legends.legendBorder?`${m.legends.legendBorderThickness+"px solid"+m.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",A).style("flex-wrap","nowrap").style("padding-left","3px");(r==Je.top||r==Je.bottom)&&g.style("flex-direction","row"),e.forEach((b,U)=>{let Y=g.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(b?.properties)}).on("mousemove",function(){if(m.legends.onHoverEffect){const w=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),t.selectAll(`[hoverId="${w}"]`).classed("highlight",!0).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!0)}}).on("mouseout",function(){if(m.legends.onHoverEffect){const w=this.textContent.replace(/\s+/g,"-");t.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),t.selectAll(`[hoverId="${w}"]`).classed("highlight",!1).classed("unhighlight",!1),t.selectAll(".cleveland-line-group").classed("highlight",!1).classed("unhighlight",!1)}});(r==Je.top||r==Je.bottom)&&Y.style("margin-right",u?"0px":"16px").style("white-space","nowrap");let H;if(!p){let w=b.properties.type;w==le.ColumnChart||w==le.StackColumnChart?H=ct.rectangle:w==le.LineChart||w==le.StackLineChart?H=ct.line:(w==le.AreaChart||w==le.StackAreaChart)&&(H=ct.areaWithLine)}(p||H)==ct.circle?ir(b,Y):(p||H)==ct.hollowCircle?lr(b,Y):(p||H)==ct.line?Ki(b,Y,m):(p||H)==ct.areaWithLine?Qi(b,Y,m):(p||H)==ct.rectangle&&rr(b,Y);let I=u&&(r==Je.bottom||r==Je.top)&&U!=e.length-1?" |":"",D=u?m.legends.legendSelectedUnicolor:m.legends.legendColorMode==Vl.multiColor?b.properties.color?b.properties.color:Ie.black:m.legends.legendSelectedUnicolor;Y.append("div").style("margin-left","5px").style("color",D).style("background",b.properties.axis==Qe.secondary&&m.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(u?m.legends.legendFontSize:b.properties.fontSize)+"px").style("font-family",u?m.legends.legendFontFamily:b.properties.fontFamily).style("font-style",()=>(u?m.legends.legendFontStyle:b.properties.fontStyle).includes(ce.italic)?ce.italic:"").style("text-decoration",()=>(u?m.legends.legendFontStyle:b.properties.fontStyle).includes(ce.underline)?ce.underline:"").style("font-weight",()=>(u?m.legends.legendFontStyle:b.properties.fontStyle).includes(ce.bold)?ce.bold:"").style("white-space","nowrap").attr("title",u?b.legendDisplay+" : "+b.actualValue:b.properties.alias).html(u?b.legendDisplay+" : "+b.actualValue+I:b.properties.alias)})}}catch(W){me(xt,"legendsWithScroll",W)}};function ir(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(n){me(xt,"getCircleShape",n)}}function lr(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(n){me(xt,"getHollowCircleShape",n)}}function Ki(t,e,n){try{const o=t.properties?.lineStyle?.toLowerCase()||"solid";let x=e.append("div").style("height","2px").style("width",o=="dashed"?"25px":"20px").style("background",Ie.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(n.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(o){me(xt,"getLineShape",o)}}function Qi(t,e,n){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(n.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){me(xt,"getAreaShape",o)}}function rr(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(n){me(xt,"getReactShape",n)}}const qt=(t,e,n,o)=>{try{let x=t.current;x.setAttribute("viewBox",`0 0 ${e} ${n}`);const{chartAreaColor:l,chartAreaBorder:r}=o.chartArea;if(x.style.backgroundColor=l,r){let p=o.chartArea.chartAreaBorderColor,m=o.chartArea.chartAreaBorderThickness+"px",L=rt(o.chartArea.chartAreaBorderStyle),u=L==1?"solid":L==2?"dashed":"dotted";x.style.outline=`${m} ${u} ${p}`,x.style.outlineOffset=`-${m}`}else x.style.outline="unset"}catch(x){me(xt,"initSvg",x)}},oa=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(n){me(xt,"initChartArea",n)}},Kt=(t,e)=>{try{let n=v.select(t.current);n.selectAll("*").remove();let o=Zi(Ri,e),x=t.current.getBoundingClientRect(),l=x.width,r=x.height;return{chartFormatOptions:o,svg:n,width:l,height:r}}catch(n){me(xt,"firstFunctionBeforeRender",n)}},Ua=(t,e,n,o,x,l=!1)=>{try{let r=t.legends.legendPosition;r=t.legends.legendVisibility?t.legends.legendPosition:Je.none;let c=e*.15*.8,p=l?o[0]:c<o[0]+15?c:o[0]+15,m=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?$t(t.chartTitle.chartTitleHTML,void 0,void 0).height:$t(t.chartTitle.chartTitleText,16,tt).height:5;switch(r){case Je.none:x.top=m+10,x.bottom=15,x.right=15,x.left=15;break;case Je.top:x.top=m+50,x.bottom=15,x.right=15,x.left=15;break;case Je.right:x.right=p+50,x.top=m+15,x.bottom=15,x.left=15;break;case Je.bottom:x.bottom=45,x.top=m+15,x.right=15,x.left=15;break;case Je.left:x.left=p+50,x.top=m+15,x.bottom=15,x.right=15}let L=n-x.top-x.bottom,u=e-x.left-x.right;return{margins:x,innerHeight:L,innerWidth:u,legendListWidth:p,chartTitleHeight:m}}catch(r){me(xt,"marginCalculationsForChartsWithoutAxis",r)}},Wa=(t,e,n,o,x,l,r,c,p,m,L=!0,u)=>{try{let S=t.legends.legendPosition,g=t.total.totalPosition,W=t.total.totalAlignment,A=t.total.totalVisibility&&L,E=t.legends.legendAlignmentTopBottom,b=t.legends.legendAlignment;switch(S){case Je.none:break;case Je.right:xa(e,n,o-l-25,r+5+(A&&g==Fa.top&&W==Wt.end?10:0),l+15,x-r-10-(A?g==Fa.top&&W==Wt.end?10:g==Fa.bottom&&W==Wt.start?25:0:0),S,b,m,t,c,!1,u);break;case Je.top:xa(e,n,5,r+5,o-10,30,S,E,m,t,c,!1,u);break;case Je.left:xa(e,n,5,p.top+(A&&g==Fa.top&&W==Wt.start?10:0),l+15,x-r-10-(A?g==Fa.top&&W==Wt.start?10:g==Fa.bottom&&W==Wt.start?25:0:0),S,b,m,t,c,!1,u);break;case Je.bottom:xa(e,n,5,x-35,o-10,30,S,E,m,t,c,!1,u);break}}catch(S){me(xt,"initLegendListWithTotalValueAllowance",S)}},Ha=(t,e,n="legend")=>{try{let o=$t(qi(e,n),rt(t.legends.legendFontSize),t.legends.legendFontFamily);return[o.width,o.height]}catch(o){me(xt,"calculateLegendsMaxPossibleWidth",o)}},ri=(t,e,n,o=!1)=>{try{let x=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?$t(t.chartTitle.chartTitleHTML,void 0,void 0).height:$t(t.chartTitle.chartTitleText,16,tt).height:5,l={top:t.chartTitle.chartTitleVisibility?x:20,bottom:o&&t.colorScale.showColor==Ta.colorTheme?40:20,left:20,right:20};return innerHeight=e-l.top-l.bottom,innerWidth=n-l.left-l.right,{margins:l,chartTitleHeight:x,innerHeight,innerWidth}}catch(x){me(xt,"marginCalculationsForChartsWithoutLegends",x)}},rt=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const n=parseFloat(e);return isNaN(n)?t:n}catch(e){me(xt,"convertStringToNumber",e)}};function mt(t,e,n=!1){try{return t.map(o=>{let x;o.properties?x={...ji,...o.properties}:x={...ji,legend:o.legend,currentLegend:o.legend,alias:o.legend,name:o.legend};const l=e&&e.length!==0?e.map(r=>{const c=o.data.find(p=>p.dimension===r);return c?{...c}:{dimension:r,legend:o.legend,value:0}}):o.data.map(r=>({...r}));return{...o,properties:x,data:n?o.data:l}})}catch(o){me(xt,"generalizedChartData",o)}}const mi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){me(xt,"getJQuerySelector",e)}},fi=(t,e,n,o,x,l,r)=>{try{let c=t-e,p=l-x,m=parseInt(r.connector.connectorKPI),L,u;switch(m){case 1:if(L=`.${n}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return v.format(L)(t);c=Math.abs(c);break;case 3:return L=`.${n}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(c=Math.round(t/e*100-100)/100,u=v.format(L)(c),u);case 2:return x.toString().length!==4&&(p=NaN),L=`.${n}%`,e==0&&t==0?"0%":e==0&&t!=0?v.format(L)(t):(c=Math.pow(t/e,1/p)-1,u=v.format(L)(c),u)}if(e==0)return"N/A";{let S,g="",W=r.connector.connectorDisplayUnits;switch(W!="None"&&W!=null&&(W=="Thousands"&&(S=1e3,g="K"),W=="Millions"&&(S=1e6,g="M"),W=="Billions"&&(S=1e9,g="B"),c=c/S),isNaN(c)&&(c=0),o){case",.0%":return L=`.${n}%`,v.format(L)(c);case"":return L=`.${n}f`,v.format(L)(c)+g;case".2n":return L=`.${n}n`,v.format(L)(c)+g;case".2$":return L=`,.${n}f`,"$"+v.format(L)(c)+g;case".2c":return L=`,.${n}f`,"C$"+v.format(L)(c)+g;case".2ē":return L=`,.${n}f`,"€"+v.format(L)(c)+g;case".2ch":return L=`,.${n}f`,"CHF"+v.format(L)(c)+g;case",":return L=`,.${n}f`,v.format(L)(c)+g;case".2£":return L=`,.${n}f`,"£"+v.format(L)(c)+g;case".2₹":return L=`,.${n}f`,"₹"+v.format(L)(c)+g;default:return L=".2f",v.format(L)(c)+g}}}catch{}},Xa=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function nr(t,e,n){try{let o=function(l){const r=l.split(" - ");return r.length>1?r[0]:l};const x=new Map;return e?.LegendList?.forEach(l=>{x.set(n?o(l?.name):l.measureUniqueId,l)}),t.map(l=>({...l,properties:x.get(n?o(l.legend):l.properties.measureUniqueId)??l.properties})).filter(l=>l.data[0].value!==0)}catch{return t}}const sr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let L=0,u=!1;const S=le.ColumnChart,g=Ce.useRef(),W=Ce.useRef(r);W.current=r;const A=Ce.useRef(c);A.current=c;const E=Ce.useRef(p);E.current=p;const b=mt(n.ChartData,n.DimensionList),U=n.DimensionList,Y=!1;let H=!1;const I=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,w=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,K=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue=[],ve=0,Pe=0,Ye=[];const We=new Map;let be={dimensionList:U,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{ze()}catch(ee){me("Columnchart","createColumnChart",ee)}},[e]);const ze=()=>{({formatOptions:e,svg:f,width:i,height:y}=Ft(g,e)),{formatOptions:e,dataTableLegendsList:Ye}=ea(e,b,n.DataTableData??[]),ke(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:w,secondaryCustomYaxisMaxValue:K}=Rt(e,be.yMinLeft,be.yMaxLeft,be.yMinRight,be.yMaxRight),{margin:ye,yLabel:se,xLabel:te,yTitle:xe,xTitle:ge,dimensionHeightWidthArray:pe,chartTitleHeight:he,secondaryAxisTitleWidth:O,legendMargin:X,secondaryYLabel:M,visibleBars:Pe,columnWidth:L,scrollbarVisible:u}=Mt(i,y,h,k,be.yMaxLeft,e,be.legendList,be.dimensionList,be.yMaxRight,H,I,t,!1,be,Ye),_(ye),{dataTable:T,dataTableHeight:a}=ia(e,se,xe,b,be.dimensionList,n),St(f,i,y,e),N=wt(f,ye),kt(N,e,a,s,d,S,m),Se(),$(),Zt(N,e,a,se,Me,d),H&&bi(N,e,a,M,Ee,d,s),Dt(e,Y,f,ye,te,y,ge,be.chartType,se,s,d),Vt(d,e,a,Y,f,ye,xe,se),Gt(f,H,ye,e,a,d,s,M,O),Nt(f,e,i,he),It(y,f,pe,he,i,X,e,b,m,a,ye,ct.rectangle,S,l),_t(b,y,i,f,ye,s,u,Pe,be,ve,!1,G)},ke=()=>{const ee=[],F=[];let q=[],ue=-1/0,B=1/0,V=-1/0,P=1/0,C=1/0,re=-1/0;b.forEach(j=>{F.push(j.properties.legendUniqueId),re=-1/0,C=1/0,j.data.forEach(ie=>{ee.push(ie),j.properties.axis==="Secondary"?(H=!0,V=Math.max(V,ie.value),P=Math.min(P,ie.value)):(ue=Math.max(ue,ie.value),B=Math.min(B,ie.value)),re=Math.max(re,ie.value),C=Math.min(C,ie.value)}),j.properties.setColorScale&&We.set(j.properties.legendUniqueId,v.scaleSequential().domain([C,re]).interpolator(yi.interpolateRgb(j.properties.startColor,j.properties.endColor)))}),be.chartData=ee,be.legendList=F,be.yMaxLeft=ue,be.yMinLeft=B>0?0:B,be.yMaxRight=V,be.yMinRight=P>0?0:P,q=t?Tt(e.xAxisLabel.xAxisNumberFormat,be.dimensionList).map(j=>j):be.dimensionList,be.dimensionList.forEach((j,ie)=>{be.formattedDimensionListMap.set(j,q[ie])}),Ue=JSON.parse(JSON.stringify(b)),Le=be.dimensionList,e.plotArea.hideZeroValues&&(be.hideZeroValues=!0)},Se=()=>{let ee=yt(w||be.yMaxLeft,be.yMinLeft,d,e,be,D,w).yAxisLabelArray;if(be.yMaxLeft=ee[ee.length-1],be.yMinLeft=ee[0],ne=v.scaleLinear().domain([be.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:be.yMinLeft<0?be.yMinLeft*1.1:be.yMinLeft*.9,be.yMaxLeft<=0?0:w!==void 0&&!Number.isNaN(w)?w:be.yMaxLeft*1.1]).range([a>0?d-a:d,0]),H){let F=yt(K||be.yMaxRight,be.yMinRight,d,e,be,z,K).yAxisLabelArray;be.yMaxRight=F[F.length-1],be.yMinRight=F[0],Z=v.scaleLinear().domain([be.yMinRight>=0?(z||z==0)&&!Number.isNaN(z)?z:0:(z||z==0)&&!Number.isNaN(z)?z:be.yMinRight*1.1,be.yMaxRight<=0?K||0:K||be.yMaxRight*1.1]).range([a>0?d-a:d,0])}Te=[0,s],oe()},oe=()=>{Re=v.scaleBand().domain(be.legendList).range([0,L]).paddingInner(be.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),fe=v.scalePoint().domain(Le).range(Te).padding(.5)},$=()=>{{let ee=yt(w||be.yMaxLeft,be.yMinLeft,d,e,be,D,w);Me=v.axisLeft(ne).tickFormat(F=>Xe(F,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,s)).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(H){let ee=yt(K||be.yMaxRight,z||be.yMinRight,d,e,be,z,K);Ee=v.axisRight(Z).tickFormat(F=>Xe(F,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(ee.autoLabelFlag?void 0:ee.yAxisLabelArray).ticks(ee.customTickValue??d/30).tickSize(zt(e,s)).tickPadding(8).tickSizeOuter(0)}},R=()=>{J=(parseInt(e.xAxisLabel.xAxisPosition)==1?v.axisTop(fe):v.axisBottom(fe)).tickSize(sa(e,d,a)).tickSizeOuter(0).tickValues(gt(Le,s,e))},ae=ee=>{ee.forEach(F=>{F.data.forEach(q=>{q.hideZero=F.properties.hideZeroValues,q.axis=F.properties.axis,q.legendUniqueId=F.properties.legendUniqueId})}),Le.forEach(F=>{N.append("rect").attr("id",`dim-background-${F}`).attr("class","dimension-background").attr("x",fe(F)-fe.step()/2).attr("width",fe.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),ee.forEach(F=>{let q=N.selectAll(".parentGroup").data([F],C=>C.properties.legendUniqueId);q=q.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(q);let ue=q.selectAll(".column-group").data(F.data,C=>C.legend+C.dimension),B=ue.enter().append("g").attr("class","column-group").attr("hoverId",(F.properties.alias||F.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",C=>`translate(${fe(C.dimension)-L/2}, 0)`);ue.attr("transform",C=>`translate(${fe(C.dimension)-L/2}, 0)`),B.merge(ue).attr("transform",C=>`translate(${fe(C.dimension)-L/2}, 0)`);const V=B.append("rect").attr("x",C=>Re(C.legendUniqueId)).attr("width",Re.bandwidth()).attr("y",C=>(F.properties.axis===Qe.primary?ne:Z)(0)).attr("height",0).attr("fill",C=>We.get(F.properties.legendUniqueId)?.(C.value)??F.properties.color).attr("stroke-dasharray",C=>F.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",C=>`${F.properties.stackBorderWidth}px`).attr("stroke",C=>F.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?F.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,()=>F.properties.legendUniqueId).attr(lt.DimValue,C=>Array.isArray(C.dimension)?String(C.dimension[0]):String(C.dimension));(e.animation.animationEnabled?V.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):V).attr("y",C=>{const re=F.properties.axis===Qe.primary?ne:Z;return C.value>0?re(C.value):re(0)}).attr("height",C=>{const re=F.properties.axis===Qe.primary?ne:Z;return Math.abs(re(C.value)-re(0))}),B.merge(ue).on("mousemove",(C,re)=>{(F.properties.alias||F.properties.name||"Legend").replace(/ /g,"-");const j=Array.isArray(re.dimension)?re.dimension[0]:re.dimension,ie=String(be.formattedDimensionListMap.get(j)??j??""),we=At(W.current,String(j??""),{...F.properties,formattedDimensionValue:ie});ut([{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},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():re.properties?.currentMeasure?re.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||re.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(S)?re[1]-re[0]:re.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:F.properties.alias}],e,C,F.properties,we)}).on("mouseout",(C,re)=>{(F.properties.alias||F.properties.name||"Legend").replace(/ /g,"-"),ot()}),B.merge(ue).on("click",vt(E,A,(C,re)=>({seriesId:F.properties.legendUniqueId,dimValue:Array.isArray(re.dimension)?String(re.dimension[0]):String(re.dimension),legendUniqueId:F.properties.legendUniqueId,seriesDisplayName:F.properties.alias||F.properties.name||""}))),ue.exit().remove()}),N.selectAll(".parentGroup").raise()},_=ee=>{s=i-ee.left-ee.right,d=y-ee.bottom-ee.top},G=(ee,F,q)=>{Ue=F,Le=ee,Pe=q,Q()},Q=()=>{oe(),R(),ta(N,be,te,e,a,ne,J,pe,y,L,t,s,d,Le,fe),ae(Ue),$a(b,fe,ne,Z,ye,pt,[],[],e,S,y,i,s,Le,d,m,f,x,Re,L,o),ua(e.plotArea.fitChart,f,N,T,L,ne,fe,Re,void 0,void 0,a,S,e,se,xe,be.dimensionList,s,Te,be.formattedDimensionListMap,m,ye,d)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:g,id:m,style:{width:"100%",height:"100%"}})})},or=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0,u=!1,S=[];const g=le.CustomColumnChart,W=Ce.useRef(),A=Ce.useRef(r);A.current=r;const E=Ce.useRef(c);E.current=c;const b=mt(n.ChartData,n.DimensionList),U=n.DimensionList,Y=!!e.swapAxis?.swapAxisEnabled;let H=!1;const I=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,w=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,K=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me=[],J=[],Ee=[],Le=[],Ue=[],ve=[],Pe=[],Ye=[],We,be,ze,ke=new Map,Se,oe,$,R,ae,_,G,Q=[],ee=[],F=0,q,ue=[],B={dimensionList:U,chartType:g,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{V()}catch(Be){me("CustomColumnchart","createCustomColumnChart",Be)}},[e]);const V=()=>{({formatOptions:e,svg:f,width:i,height:y}=Ft(W,e)),P(),{formatOptions:e,dataTableLegendsList:ue}=ea(e,b,n.DataTableData??[]),vi(),{maxNumberForPrimaryAxis:h,maxNumberForSecondaryAxis:k,customYaxisMaxValue:w,secondaryCustomYaxisMaxValue:K}=Rt(e,B.yMinLeft,B.yMaxLeft,B.yMinRight,B.yMaxRight),{margin:ye,yLabel:se,xLabel:te,yTitle:xe,xTitle:ge,dimensionHeightWidthArray:pe,chartTitleHeight:he,secondaryAxisTitleWidth:O,legendMargin:X,secondaryYLabel:M,visibleBars:q,columnWidth:L,scrollbarVisible:u}=Mt(i,y,h,k,B.yMaxLeft,e,B.legendList,B.dimensionList,B.yMaxRight,H,I,t,Y,B,ue),it(ye),{dataTable:T,dataTableHeight:a}=ia(e,se,xe,b,B.dimensionList,n),Y&&(T=[],a=0),St(f,i,y,e),N=wt(f,ye),kt(N,e,a,s,d,g,m),re(),ie(),Y?(ra(e,N,se,d,s,R),H&&Ai(e,N,M,ae,s)):(Zt(N,e,a,se,We,d),H&&bi(N,e,a,M,ze,d,s)),Dt(e,Y,f,ye,te,y,ge,B.chartType,se,s,d),Vt(d,e,a,Y,f,ye,xe,se,s),Gt(f,H,ye,e,a,d,s,M,O,Y),Nt(f,e,i,he),It(y,f,pe,he,i,X,e,b,m,a,ye,null,g,l),_t(b,y,i,f,ye,s,u,q,B,F,!1,nt,Y)},P=()=>{const Be=[];let qe=[],dt=-1/0,Oe=1/0,at=-1/0,je=1/0,Ne=[];b.forEach((Ve,He)=>{[le.StackColumnChart,le.StackAreaChart].includes(Ve.properties.type)?le.StackColumnChart===Ve.properties.type&&(Be.includes(le.StackColumnChart)||Be.push(le.StackColumnChart)):(Ne.push(Ve),Ve.properties.type!==le.LineChart&&Ve.properties.type!==le.AreaChart&&Be.push(Ve.properties.legendUniqueId)),Ve.properties.axis==="Secondary"&&(J.push(Ve),Ve.properties.type==le.StackColumnChart&&ve.push(Ve),Ve.properties.type==le.StackAreaChart&&Ue.push(Ve)),Ve.properties.axis===Qe.primary&&(Me.push(Ve),Ve.properties.type==le.StackColumnChart&&Le.push(Ve),Ve.properties.type==le.StackAreaChart&&Ee.push(Ve)),Ve.data=Ve.data.map(ht=>{const st={...ht,type:Ve.properties.type,axis:Ve.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ve.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ve.properties.labelColor,legendUniqueId:Ve.properties.legendUniqueId};return st.axis==="Secondary"?(H=!0,at=Math.max(at,st.value),je=Math.min(je,st.value)):(dt=Math.max(dt,st.value),Oe=Math.min(Oe,st.value)),st})}),Q=JSON.parse(JSON.stringify(b)),B.chartData=Ne,B.legendList=Be,B.yMaxLeft=dt,B.yMinLeft=Oe>0?0:Oe,B.yMaxRight=at,B.yMinRight=je>0?0:je,qe=t?Tt(e.xAxisLabel.xAxisNumberFormat,B.dimensionList).map(Ve=>Ve):B.dimensionList,B.dimensionList.forEach((Ve,He)=>{B.formattedDimensionListMap.set(Ve,qe[He])}),e.plotArea.fitChart?G=B.dimensionList:G=B.dimensionList.slice(F,F+q),e.plotArea.hideZeroValues&&(B.hideZeroValues=!0),C(Ee,Le,Ue,ve,b)},C=(Be,qe,dt,Oe,at)=>{const je=Lt(G,Be,!1),Ne=Lt(G,dt,!1),Ve=Lt(G,qe,!1),He=Lt(G,Oe,!1);ee=[];const ht=[];if(Be.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:je,data:Be})}),dt.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:Ne,data:dt})}),qe.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:Ve,data:qe})}),Oe.forEach(st=>{ht.push({properties:{axis:st.properties.axis,type:st.properties.type,legend:st.properties.legend,annotation:st.properties.annotation,alias:st.properties.alias},stackData:He,data:Oe})}),ht.push(...B.chartData),at.length){const st=[];at.forEach(ki=>{st.push(...ht.filter(Al=>Al.properties?.type===ki.properties.type&&Al.properties.legend===ki.legend))}),ee.push(...st)}else ee.push(...ht)},re=()=>{const Be=Y?[0,a>0?s-a:s]:[a>0?d-a:d,0];{const qe=v.scaleLinear().domain([B.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:B.yMinLeft<0?B.yMinLeft*1.1:B.yMinLeft*.9,B.yMaxLeft<=0?0:w!==void 0&&!Number.isNaN(w)?w:B.yMaxLeft*1.1]).range(Be);Y?oe=qe:ne=qe}if(H){const qe=v.scaleLinear().domain([B.yMinRight>=0?(z||z==0)&&!Number.isNaN(z)?z:0:(z||z==0)&&!Number.isNaN(z)?z:B.yMinRight*1.1,B.yMaxRight<=0?(K||K==0)&&!Number.isNaN(K)?K:0:(K||K==0)&&!Number.isNaN(K)?K:B.yMaxRight*1.1]).range(Be);Y?$=qe:Z=qe}Te=Y?[d,0]:[0,s]},j=()=>{Re=v.scaleBand().domain(B.legendList).range([0,L]).paddingInner(B.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0);const Be=v.scalePoint().domain(G).range(Te).padding(.5);Y?Se=Be:fe=Be},ie=()=>{{let Be=yt(w||B.yMaxLeft,B.yMinLeft,d,e,B,D,w,Y,s);Y?R=v.axisBottom(oe).tickFormat(qe=>Xe(qe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??s/50).tickPadding(8).tickSizeOuter(0):We=v.axisLeft(ne).tickFormat(qe=>Xe(qe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,s)).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(H){let Be=yt(w||B.yMaxRight,B.yMinRight,d,e,B,D,w);Y?ae=v.axisTop($).tickFormat(qe=>Xe(qe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??s/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0):ze=v.axisRight(Z).tickFormat(qe=>Xe(qe,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(Be.autoLabelFlag?void 0:Be.yAxisLabelArray).ticks(Be.customTickValue??d/30).tickSize(zt(e,s)).tickPadding(8).tickSizeOuter(0)}},we=()=>{Y?_=v.axisLeft(Se).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*s*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(G,d,e)):be=v.axisBottom(fe).tickSize(sa(e,d,a,!0)).tickSizeOuter(0).tickValues(gt(G,s,e))},de=Be=>{Be.forEach(Oe=>{switch(Oe.properties.type){default:case le.ColumnChart:Ae(Oe);break;case le.LineChart:break;case le.AreaChart:break;case le.StackColumnChart:Pe=Ia(Oe),_e();break;case le.StackAreaChart:Ye=Ia(Oe),Fe(Oe);break}});const qe=Q.filter(Oe=>Oe.properties.type===le.LineChart);qe.length&&De(qe);const dt=Q.filter(Oe=>Oe.properties.type===le.AreaChart);dt.length&&$e(dt),N.selectAll(".parentGroup").raise()},Ae=Be=>{let qe=N.selectAll(".parentGroup").data([Be],Ne=>Ne.properties?.legendUniqueId);qe=qe.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(qe);let dt=qe.selectAll(".column-group").data(Be.data,Ne=>Ne.legendUniqueId),Oe=dt.enter().append("g").attr("class","column-group").attr("hoverId",Ne=>(Be.properties.alias||Be.properties.name).includes("-")?(Be.properties.alias||Be.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(Be.properties.alias||Be.properties.name).replace(/ /g,"-")).attr("transform",Ne=>Y?`translate(0, ${Se(Ne.dimension)})`:`translate(${fe(Ne.dimension)}, 0)`);Oe.merge(dt).attr("transform",Ne=>Y?`translate(0, ${Se(Ne.dimension)-L/2})`:`translate(${fe(Ne.dimension)-L/2}, 0)`);const at=(Y?Oe.append("rect").attr("y",Ne=>Re(Ne.legendUniqueId)).attr("height",Re.bandwidth()).attr("x",()=>(Be.properties.axis===Qe.primary?oe:$)(0)).attr("width",0):Oe.append("rect").attr("x",Ne=>Re(Ne.legendUniqueId)).attr("width",Re.bandwidth()).attr("y",()=>(Be.properties.axis===Qe.primary?ne:Z)(0)).attr("height",0)).attr("fill",Be.properties.color).attr("stroke-dasharray",Ne=>Be.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ne=>`${Be.properties.stackBorderWidth}px`).attr("stroke",Ne=>Be.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Be.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",Ne=>Ne.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>Be.properties.legendUniqueId).attr(lt.DimValue,Ne=>Array.isArray(Ne.dimension)?String(Ne.dimension[0]):String(Ne.dimension)).on("mousemove",(Ne,Ve)=>{ut([{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.formattedDimensionListMap.get(Array.isArray(Ve.dimension)?Ve.dimension[0]:Ve.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ve.properties?.currentMeasure?Ve.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ve.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(g)?Ve[1]-Ve[0]:Ve.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ve.legend.includes("~$~")?Ve.legend.split("~$~")[1]:Ve.legend}],e,Ne,b.filter(He=>He.legend===Ve.legend)[0].properties,(()=>{const He=Array.isArray(Ve.dimension)?Ve.dimension[0]:Ve.dimension,ht=b.filter(st=>st.legend===Ve.legend)[0].properties;return At(p,String(He??""),{...ht,formattedDimensionValue:String(B.formattedDimensionListMap.get(He)??He??"")})})())}).on("mouseout",ot).on("click",vt(E,A,(Ne,Ve)=>({seriesId:Be.properties.legendUniqueId,dimValue:Array.isArray(Ve.dimension)?String(Ve.dimension[0]):String(Ve.dimension),legendUniqueId:Be.properties.legendUniqueId,seriesDisplayName:Be.properties.alias||Be.properties.name||""}))),je=e.animation.animationEnabled?at.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):at;Y?je.attr("x",Ne=>{const Ve=Be.properties.axis===Qe.primary?oe:$;return Ne.value>0?Ve(0):Ve(Ne.value)}).attr("width",Ne=>{const Ve=Be.properties.axis===Qe.primary?oe:$;return Math.abs(Ve(Ne.value)-Ve(0))}):je.attr("y",Ne=>{const Ve=Be.properties.axis===Qe.primary?ne:Z;return Ne.value>0?Ve(Ne.value):Ve(0)}).attr("height",Ne=>{const Ve=Be.properties.axis===Qe.primary?ne:Z;return Math.abs(Ve(Ne.value)-Ve(0))}),dt.exit().remove()},De=Be=>{Be.forEach(je=>{je.data.forEach(Ne=>{Ne.hideZero=je.properties.hideZeroValues,Ne.axis=je.properties.axis,Ne.legendUniqueId=je.properties.legendUniqueId})});const qe=Y?v.line().y(je=>{const Ne=Se(je.dimension);return Ne??0}).x(je=>je.axis==Qe.primary?oe(je.value):$(je.value)).defined(je=>e?.plotArea?.hideZeroValues?!!je.value:!0).curve(ft(e)):v.line().x(je=>fe(je.dimension)?fe(je.dimension):null).y(je=>je.axis==Qe.primary?ne(je.value):Z(je.value)).defined(je=>e?.plotArea?.hideZeroValues?!!je.value:!0).curve(ft(e));let dt=N.selectAll(".lines.parentGroup").data([1]);dt=dt.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(dt);let Oe=dt.selectAll(".line-group").data(Be,je=>je.properties.legendUniqueId),at=Oe.enter().append("g").attr("class","line-group");at.attr("hoverId",je=>(je.properties.alias||je.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),at.merge(Oe).select("path").attr("d",je=>qe(je.data)).attr("stroke",je=>je.properties.color!==Ie.white?je.properties.color:"none").attr("stroke-dasharray",je=>{switch(je.properties.lineStyle){case bt.dotted:return"0,3";case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",je=>je.properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",je=>je.properties.lineStyle!=="None"?je.properties.lineWidth:"0"),e.animation.animationEnabled&&at.merge(Oe).select("path").each(function(){const je=v.select(this),Ne=this.getTotalLength();je.attr("stroke-dasharray",Ne+" "+Ne).attr("stroke-dashoffset",Ne),je.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),Oe.exit().remove(),Va(dt,Be,le.CombinationLine,Y?Se:fe,Y?oe:ne,Y?$:Z,null,e,B,K,z,D,w,!1,p,Y)},$e=Be=>{Be.forEach(He=>{He.data.forEach(ht=>{ht.hideZero=He.properties.hideZeroValues,ht.axis=He.properties.axis,ht.legendUniqueId=He.properties.legendUniqueId})});const qe=Y?v.area().y(He=>{const ht=Se(He.dimension);return ht??0}).x0(()=>oe(0)).x1(He=>oe(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)):v.area().x(He=>fe(He.dimension)?fe(He.dimension):null).y0(()=>ne(0)).y1(He=>ne(He.value)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)),dt=Y?v.area().y(He=>{const ht=Se(He.dimension);return ht??0}).x0(()=>oe(0)).x1(()=>oe(0)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)):v.area().x(He=>fe(He.dimension)?fe(He.dimension):null).y0(()=>ne(0)).y1(()=>ne(0)).defined(He=>He.hideZero?!!He.value:!0).curve(ft(e)),Oe=e.animation.animationEnabled;let at=N.selectAll(".areas.parentGroup").data([1]),je=N.append("g").attr("class","focusClass");at=at.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(at);let Ne=at.selectAll(".area-group").data(Be,He=>He.legend),Ve=Ne.enter().append("g").attr("class","area-group");Ve.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!==Ie.white?He.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",He=>Oe?dt(He.data):qe(He.data)).each(function(He){Oe&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",qe(He.data))}),Ne.select("path").attr("d",He=>qe(He.data)),Ve.merge(Ne).select("path").attr("stroke",He=>He.properties.areaBorderColor!==Ie.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"),Li(e,at,je,G,Be,Y?Se:fe,Y?oe:ne,g,!1,Y),Ne.exit().remove(),Va(at,Be,le.CombinationArea,Y?Se:fe,Y?oe:ne,Y?$:Z,null,e,B,K,z,D,w,!1,void 0,Y)},Fe=Be=>{Be.data.forEach(Ve=>{Ve.data.forEach(He=>{He.hideZero=Ve.properties.hideZeroValues,He.axis=Ve.properties.axis,He.legendUniqueId=Ve.properties.legendUniqueId})});const qe=Y?v.area().y(Ve=>{const He=Se(Ve.data.dimension);return He??0}).x0(Ve=>Ve.data.axis===Qe.primary?oe(Ve[0]):$(Ve[0])).x1(Ve=>Ve.data.axis===Qe.primary?oe(Ve[1]):$(Ve[1])).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)):v.area().x(Ve=>fe(Ve.data.dimension)?fe(Ve.data.dimension):null).y0(Ve=>Ve.data.axis===Qe.primary?ne(Ve[0]):Z(Ve[0])).y1(Ve=>Ve.data.axis===Qe.primary?ne(Ve[1]):Z(Ve[1])).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)),dt=Y?v.area().y(Ve=>{const He=Se(Ve.data.dimension);return He??0}).x0(()=>oe(0)).x1(()=>oe(0)).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)):v.area().x(Ve=>fe(Ve.data.dimension)?fe(Ve.data.dimension):null).y0(()=>ne(0)).y1(()=>ne(0)).defined(Ve=>Ve.hideZero?!!Ve.key:!0).curve(ft(e)),Oe=e.animation.animationEnabled;let at=N.selectAll(".parentGroup").data([Ye]);N.append("g").attr("class","focusClass"),at=at.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(at);let je=at.selectAll(".area-group").data(Ve=>Ve),Ne=je.enter().append("g").attr("class",Ve=>"area-group "+Ve.key.replace(/ /g,"-"));Ne.append("path").attr("hoverId",Ve=>(Be.data.filter(He=>He.legend===Ve.key)[0].properties.alias||Be.data.filter(He=>He.legend===Ve.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ve=>Ve.color!==Ie.white?Ve.color:"none").attr("d",Ve=>Oe?dt(Ve):qe(Ve)).each(function(Ve){Oe&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",qe(Ve))}),je.select("path").attr("d",Ve=>qe(Ve)),Ne.merge(je).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ve=>Ve.color!==Ie.white?Ve.color:"none").attr("stroke-dasharray",(Ve,He)=>b[He].properties.lineStyle==="dotted"?"0,3":b[He].properties.lineStyle==="dashed"?fa:"").attr("stroke-linecap",(Ve,He)=>b[He].properties.lineStyle==="dotted"?ya.round:"").attr("stroke-width",(Ve,He)=>b[He].properties.lineStyle!=="None"?b[He].properties.lineWidth:"0"),je.exit().remove(),Va(at,Be.data,le.CombinationStackArea,Y?Se:fe,Y?oe:ne,Y?$:Z,null,e,B,K,z,D,w,!1,void 0,Y)},_e=()=>{let Be=N.selectAll(".parentGroup").data([Pe]);Be=Be.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Be);let qe=Be.selectAll(".stackcolumns-group").data(Ne=>Ne);qe=qe.enter().append("g").attr("class",Ne=>"stackcolumns-group ").merge(qe);let Oe=qe.selectAll("rect").data(Ne=>Ne);Y?Oe.attr("x",Ne=>Ne.data.axis===Qe.primary?oe(Ne[0]):$(Ne[0])).attr("width",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?oe(w)-oe(Ne[0]):oe(Ne[1])-oe(Ne[0]):K&&Ne[1]>K?$(K)-$(Ne[0]):$(Ne[1])-$(Ne[0])):Oe.attr("y",Ne=>Ne.data.axis===Qe.primary?ne(Ne[1]):Z(Ne[1])).attr("height",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?ne(Ne[0])-ne(w):ne(Ne[0])-ne(Ne[1]):K&&Ne[1]>K?Z(Ne[0])-Z(K):Z(Ne[0])-Z(Ne[1]));const at=Y?Oe.enter().append("rect").attr("transform",Ne=>`translate(0, ${Se(Ne.data.dimension)-L/2})`).attr("x",Ne=>Ne.data.axis===Qe.primary?oe(0):$(0)).attr("width",0):Oe.enter().append("rect").attr("transform",Ne=>`translate(${fe(Ne.data.dimension)-L/2},0)`).attr("y",Ne=>Ne.data.axis===Qe.primary?ne(0):Z(0)).attr("height",0);at.merge(Oe).attr("hoverId",Ne=>Ne.alias.includes("~$~")?Ne.alias.split("~$~")[1].replace(/ /g,"-"):Ne.alias.replace(/ /g,"-")).attr(Y?"y":"x",Ne=>Re(le.StackColumnChart)).attr(Y?"height":"width",Re.bandwidth()).attr("fill",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(st=>st.legend===Ne.key);return b[ht]?.properties?.color||"gray"}).attr("stroke",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(ki=>ki.legend===Ne.key),st=b[ht]?.properties;return st?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?st.stackBorderColor:"none"}).attr("stroke-dasharray",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(st=>st.legend===Ne.key);return b[ht]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ne,Ve,He)=>{const ht=Array.from(b).findIndex(st=>st.legend===Ne.key);return(b[ht]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ne,Ve)=>{ut([{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.formattedDimensionListMap.get(Ve.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ve.properties?.currentMeasure?Ve.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ve.value,value:Xe(Ve.data[Ve.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ve.key.includes("~$~")?Ve.key.split("~$~")[1]:Ve.key}],e,Ne,b.filter(He=>He.legend===Ve.key)[0].properties,(()=>{const He=b.filter(ht=>ht.legend===Ve.key)[0].properties;return At(p,String(Ve.data.dimension??""),{...He,formattedDimensionValue:String(B.formattedDimensionListMap.get(Ve.data.dimension)??Ve.data.dimension??"")})})())}).on("mouseout",ot).attr(lt.SeriesId,Ne=>Ne.key??"").attr(lt.DimValue,Ne=>Array.isArray(Ne.data.dimension)?String(Ne.data.dimension[0]):String(Ne.data.dimension)).on("click",vt(E,A,(Ne,Ve)=>({seriesId:Ve.key??"",dimValue:Array.isArray(Ve.data.dimension)?String(Ve.data.dimension[0]):String(Ve.data.dimension),legendUniqueId:Ve.key??"",seriesDisplayName:Ve.alias||Ve.key||""})));const je=e.animation.animationEnabled?at.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):at;Y?je.attr("x",Ne=>Ne.data.axis===Qe.primary?oe(Ne[0]):$(Ne[0])).attr("width",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?oe(w)-oe(Ne[0]):oe(Ne[1])-oe(Ne[0]):K&&Ne[1]>K?$(K)-$(Ne[0]):$(Ne[1])-$(Ne[0])):je.attr("y",Ne=>Ne.data.axis===Qe.primary?ne(Ne[1]):Z(Ne[1])).attr("height",Ne=>Ne.data.axis===Qe.primary?w&&Ne[1]>w?ne(Ne[0])-ne(w):ne(Ne[0])-ne(Ne[1]):K&&Ne[1]>K?Z(Ne[0])-Z(K):Z(Ne[0])-Z(Ne[1])),qe.exit().remove()},it=Be=>{s=i-Be.left-Be.right,d=y-Be.bottom-Be.top},nt=(Be,qe,dt)=>{Q=qe,G=Be,q=dt,Ba(n,ke,G),C(Ee,Le,Ue,ve,qe),Q=JSON.parse(JSON.stringify(ee)),Q.forEach((Oe,at)=>{Oe.properties.type===le.StackColumnChart||Oe.properties.type===le.StackAreaChart?Oe.data.forEach((je,Ne)=>Q[at].data[Ne].data=je.data.filter(Ve=>G.includes(Ve.dimension))):Q[at].data=Oe.data.filter(je=>G.includes(je.dimension))}),di()};function Ba(Be,qe,dt){qe.clear(),dt&&dt.length>0&&dt.forEach(Oe=>{qe.set(Oe,0)}),Be.ChartData&&Be.ChartData.length>0&&Be.ChartData.forEach(Oe=>{Oe.properties.type.includes("Stack")&&Oe.data.forEach((at,je)=>{if(qe.has(at.dimension)){let Ne=qe.get(at.dimension)||0;Ne+=at.value||0,qe.set(at.dimension,Ne)}})})}const di=()=>{j(),we(),de(Q),Y?na(e,N,te,d,s,_,ae,oe,B.yMaxLeft,G,g,t,i,pe,L,Se):ta(N,B,te,e,a,ne,be,pe,y,L,t,s,d,G,fe);const Be=()=>{Y||jl(Q,fe,ne,Z,ye,pt,Pe,Ye,[],[],L,e,y,i,s,G,d,m,f,x,Re,o),ii(ke,Y?Se:fe,Y?oe:ne,ye,pt,[],e,g,y,i,f,o,Y)};Y||ua(e.plotArea.fitChart,f,N,T,L,ne,fe,Re,void 0,void 0,a,g,e,se,xe,B.dimensionList,s,Te,B.formattedDimensionListMap,m,ye,d),f.selectAll(".annotation-group").remove(),Be()},Ia=Be=>{let qe=Be.data.map(Oe=>Oe.legend);S=v.stack().keys(qe).offset(v.stackOffsetDiverging)(Be.stackData),Be.data.forEach((Oe,at)=>Oe.data.forEach((je,Ne)=>{je[0]=S[at][Ne][0],je[1]=S[at][Ne][1]}));let dt=e.annotation.annotationSetLabelColor;return S.forEach((Oe,at)=>{Oe.forEach(je=>{je.key=Oe.key,je.alias=Be.data[at].properties.alias,Oe.alias=Be.data[at].properties.alias,Oe.color=JSON.parse(JSON.stringify(Be.data[at].properties.color)),Oe.individualAnnotationVisibility=JSON.parse(JSON.stringify(Be.data[at].properties.annotation)),je.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?Be.data[at].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),je.data.labelColor=dt=="2"?JSON.parse(JSON.stringify(Be.data[at].properties.color)):JSON.parse(JSON.stringify(Be.data[at].properties.labelColor)),je.hideZero=JSON.parse(JSON.stringify(Be.data[at].properties.hideZeroValues)),je.data.axis=JSON.parse(JSON.stringify(Be.data[at].properties.axis)),je.data.color=JSON.parse(JSON.stringify(Be.data[at].properties.color)),je.data.legend=Be.properties.type,je.data.type=JSON.parse(JSON.stringify(Be.data[at].properties.type))})}),S},vi=()=>{if(Me.length>0){const qe=(Le.length>0?Lt(G,Le,!1):Lt(G,Ee,!1)).map(dt=>dt.total);B.yMaxLeft=Math.max(B.yMaxLeft,...qe),B.yMinLeft=Math.min(B.yMinLeft,...qe)}if(J.length>0){const qe=(ve.length>0?Lt(G,ve,!1):Lt(G,Ue,!1)).map(dt=>dt.total);B.yMaxRight=Math.max(B.yMaxRight,...qe),B.yMinRight=Math.min(B.yMinRight,...qe)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:W,id:m,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.LayeredColumnChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!1,U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=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,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te=[];const Me=new Map;let J=0,Ee=2,Le=!1,Ue=[],ve={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Pe()}catch(ae){me("LayeredColumnchart","createLayeredColumnChart",ae)}},[e]);const Pe=()=>{({formatOptions:e,svg:y,width:k,height:s}=Ft(S,e)),Ye(),{formatOptions:e,dataTableLegendsList:Ue}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:X,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:D}=Rt(e,ve.yMinLeft,ve.yMaxLeft,ve.yMinRight,ve.yMaxRight),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:Ee,columnWidth:L,scrollbarVisible:Le}=Mt(k,s,O,X,ve.yMaxLeft,e,ve.legendList,ve.dimensionList,ve.yMaxRight,U,Y,t,!1,ve,Ue),oe(w),{dataTable:d,dataTableHeight:i}=ia(e,z,ye,A,ve.dimensionList,n),St(y,k,s,e),T=wt(y,w),kt(T,e,i,M,h,u,m),We(),ze(),Zt(T,e,i,z,Z,h),Dt(e,b,y,w,K,s,se,ve.chartType,z,M,h),Vt(h,e,i,b,y,w,ye,z),Gt(y,U,w,e,i,h,M,he,ge),Nt(y,e,k,xe),It(s,y,te,xe,k,pe,e,A,m,i,w,ct.rectangle,u,l),_t(A,s,k,y,w,M,Le,Ee,ve,J,!1,R)},Ye=()=>{const ae=[],_=[];let G=[],Q=-1/0,ee=1/0,F=-1/0,q=1/0,ue=-1/0,B=1/0;A.forEach(V=>{_.push(V.properties.legendUniqueId),ue=-1/0,B=1/0,V.data.forEach(P=>{ae.push(P),ue=Math.max(ue,P.value),B=Math.min(B,P.value),Q=Math.max(Q,P.value),ee=Math.min(ee,P.value)}),V.properties.setColorScale&&Me.set(V.properties.legendUniqueId,v.scaleSequential().domain([B,ue]).interpolator(v.interpolateRgb(V.properties.startColor,V.properties.endColor)))}),ve.chartData=ae,ve.legendList=_,ve.yMaxLeft=Q,ve.yMinLeft=ee>0?0:ee,ve.yMaxRight=F,ve.yMinRight=q>0?0:q,G=t?Tt(e.xAxisLabel.xAxisNumberFormat,ve.dimensionList).map(V=>V):ve.dimensionList,ve.dimensionList.forEach((V,P)=>{ve.formattedDimensionListMap.set(V,G[P])}),Te=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Re=ve.dimensionList:Re=ve.dimensionList.slice(J,J+Ee),e.plotArea.hideZeroValues&&(ve.hideZeroValues=!0)},We=()=>{let ae=yt(I||ve.yMaxLeft,ve.yMinLeft,h,e,ve,H,I).yAxisLabelArray;ve.yMaxLeft=ae[ae.length-1],ve.yMinLeft=ae[0],a=v.scaleLinear().domain([ve.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:ve.yMinLeft<0?ve.yMinLeft*1.1:ve.yMinLeft*.9,ve.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:ve.yMaxLeft*1.1]).range([i>0?h-i:h,0]),ne=[0,M]},be=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(ve.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(Re).range(ne).padding(.5)},ze=()=>{ke();{let ae=yt(I||ve.yMaxLeft,ve.yMinLeft,h,e,ve,H,I);Z=v.axisLeft(a).tickFormat(_=>Xe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,M)).tickValues(ae.autoLabelFlag?void 0:ae.yAxisLabelArray).ticks(ae.customTickValue).tickPadding(8).tickSizeOuter(0)}},ke=()=>{fe=v.axisBottom(N).tickSize(sa(e,h,i)).tickSizeOuter(0).tickValues(gt(Re,M,e))},Se=ae=>{ae.forEach(_=>{_.data.forEach(G=>{G.hideZero=_.properties.hideZeroValues,G.properties=_.properties,G.axis=_.properties.axis})}),ae.forEach((_,G)=>{let Q=T.selectAll(".parentGroup").filter(B=>B?.properties?.legendUniqueId===_.properties.legendUniqueId).data([_],B=>B.properties.legendUniqueId);Q=Q.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",_.properties.legendUniqueId).attr("clip-path",`url(#${m}-clip)`).merge(Q);let ee=Q.selectAll(".column-group").data(_.data,B=>B.dimension+"_"+_.properties.legendUniqueId),F=ee.enter().append("g").attr("class","column-group").attr("hoverId",(_.properties.alias||_.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",B=>G===0?`translate(${N(B.dimension)-L/2}, 0)`:`translate(${N(B.dimension)-L/(2+G*2)}, 0)`);ee.attr("transform",B=>G===0?`translate(${N(B.dimension)-L/2}, 0)`:`translate(${N(B.dimension)-L/(2+G*2)}, 0)`),F.merge(ee).attr("transform",B=>G===0?`translate(${N(B.dimension)-L/2}, 0)`:`translate(${N(B.dimension)-L/(2+G*2)}, 0)`);const q=F.append("rect").attr("x",()=>0).attr("width",G===0?L:L/2+G*2).attr("y",B=>(_.properties.axis===Qe.primary?a:f)(0)).attr("height",0).attr("fill",B=>Me.get(_.properties.legendUniqueId)?.(B.value)??_.properties.color).attr("stroke-dasharray",()=>_.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${_.properties.stackBorderWidth}px`).attr("stroke",()=>_.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?_.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",B=>B.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>_.properties.legendUniqueId).attr(lt.DimValue,B=>Array.isArray(B.dimension)?String(B.dimension[0]):String(B.dimension));(e.animation.animationEnabled?q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):q).attr("y",B=>{const V=_.properties.axis===Qe.primary?a:f;return B.value>0?V(B.value):V(0)}).attr("height",B=>{const V=_.properties.axis===Qe.primary?a:f;return Math.abs(V(B.value)-V(0))}),ee.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("y",B=>{const V=_.properties.axis===Qe.primary?a:f;return B.value>0?V(B.value):V(0)}).attr("height",B=>{const V=_.properties.axis===Qe.primary?a:f;return Math.abs(V(B.value)-V(0))}),F.merge(ee).on("mousemove",(B,V)=>{ut([{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(Array.isArray(V.dimension)?V.dimension[0]:V.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():V.properties?.currentMeasure?V.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||V.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?V[1]-V[0]:V.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:V.properties.alias}],e,B,V.properties,(()=>{const C=Array.isArray(V.dimension)?V.dimension[0]:V.dimension;return At(p,String(C??""),{...V.properties,formattedDimensionValue:String(ve.formattedDimensionListMap.get(C)??C??"")})})());let P=(_.properties.alias||_.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),v.selectAll('[hoverId="'+P+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(B,V)=>{let P=(_.properties.alias||_.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+P+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}),F.merge(ee).on("click",vt(W,g,(B,V)=>({seriesId:_.properties.legendUniqueId,dimValue:Array.isArray(V.dimension)?String(V.dimension[0]):String(V.dimension),legendUniqueId:_.properties.legendUniqueId,seriesDisplayName:_.properties.alias||_.properties.name||""}))),ee.exit().remove()}),T.selectAll(".parentGroup").raise()},oe=ae=>{M=k-ae.left-ae.right,h=s-ae.bottom-ae.top},$=()=>{be(),ke(),ta(T,ve,K,e,i,a,fe,te,s,L,t,M,h,Re,N),Se(Te),$a(A,N,a,void 0,w,pt,[],[],e,u,s,k,M,Re,h,m,y,x,void 0,L,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,le.ColumnChart,e,z,ye,ve.dimensionList,M,ne,ve.formattedDimensionListMap,m,w,h))},R=(ae,_,G)=>{Te=_,Re=ae,Ee=G,$()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let L=0,u=!1;const S=le.StackColumnChart,g=Ce.useRef(),W=Ce.useRef(c);W.current=c;const A=Ce.useRef(p);A.current=p;const E=n.DimensionList,b=(mt(n.ChartData,n.DimensionList)||[]).reverse(),U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=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,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N;const ne=new Map;let Z,fe,Re,Te=[],Me=0,J,Ee=[],Le=[],Ue=new Map;const ve=!1;let Pe={dimensionList:E,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ye()}catch(F){me("StackStackColumnchart","createStackColumnChart",F)}},[e]);const Ye=()=>{({formatOptions:e,svg:i,width:h,height:k}=Ft(g,e)),We(),{formatOptions:e,dataTableLegendsList:Ee}=ea(e,b,n.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,Pe.yMinLeft,Pe.yMaxLeft,Pe.yMinRight,Pe.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe,visibleBars:J,columnWidth:L,scrollbarVisible:u}=Mt(h,k,he,O,Pe.yMaxLeft,e,Pe.legendList,Pe.dimensionList,Pe.yMaxRight,Y,ve,t,!1,Pe,Ee),$(D),{dataTable:s,dataTableHeight:d}=ia(e,w,K,b,Pe.dimensionList,n),St(i,h,k,e),y=wt(i,D),kt(y,e,d,X,M,S,m),be(),ke(),Zt(y,e,d,w,Z,M),Dt(e,U,i,D,z,k,ye,Pe.chartType,w,X,M),Vt(M,e,d,U,i,D,K,w),Gt(i,Y,D,e,d,M,X,pe,xe),Nt(i,e,h,te),It(k,i,se,te,h,ge,e,[...b].reverse(),m,d,D,ct.rectangle,S,l),_t(b,k,h,i,D,X,u,J,Pe,Me,!1,R)},We=()=>{const F=[],q=[];let ue=-1/0,B=1/0;b.forEach((ie,we)=>{const de=`${we}~$~${ie.properties.legend}`;ie.properties.legend=de,q.push(de),ue=-1/0,B=1/0;for(const Ae of ie.data)ue=Math.max(ue,Ae.value),B=Math.min(B,Ae.value),F.push(Ae);ie.properties.setColorScale&&ne.set(ie.properties.legendUniqueId,v.scaleSequential().domain([B,ue]).interpolator(yi.interpolateRgb(ie.properties.startColor,ie.properties.endColor)))}),Pe.chartData=F,Pe.legendList=q,Te=JSON.parse(JSON.stringify(b));let V=Lt(Pe.dimensionList,b,ve);Re=Pe.dimensionList;const P=v.stack().keys(Pe.legendList).offset(v.stackOffsetDiverging)(V);_();let C=1/0,re=-1/0;for(const ie of P)for(const[we,de]of ie)C=Math.min(C,we),re=Math.max(re,de);Pe.yMinLeft=C>0?0:C,Pe.yMaxLeft=re;let j=t?Tt(e.xAxisLabel.xAxisNumberFormat,Pe.dimensionList).map(ie=>ie):Pe.dimensionList;Pe.dimensionList.forEach((ie,we)=>{Pe.formattedDimensionListMap.set(ie,j[we])}),e.plotArea.hideZeroValues&&(Pe.hideZeroValues=!0)},be=()=>{T=v.scaleLinear().domain([Pe.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:Pe.yMinLeft<0?Pe.yMinLeft*1.1:Pe.yMinLeft*.9,Pe.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:Pe.yMaxLeft*1.1]).range([d>0?M-d:M,0]),N=[0,X]},ze=()=>{f=v.scalePoint().domain(Re).range([0,X]).padding(.5)},ke=()=>{{const F=yt(I||Pe.yMaxLeft,Pe.yMinLeft,M,e,Pe,H,I);Z=v.axisLeft(T).tickFormat(q=>Xe(q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,X)).tickValues(F.autoLabelFlag?void 0:F.yAxisLabelArray).ticks(F.customTickValue).tickPadding(8).tickSizeOuter(0)}},Se=()=>{fe=v.axisBottom(f).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(gt(Re,X,e))},oe=F=>{F.forEach(j=>{j.data.forEach(ie=>{ie.hideZero=j.properties.hideZeroValues,ie.axis=j.properties.axis})}),Re.forEach(j=>{y.append("rect").attr("id",`dim-background-${j}`).attr("class","dimension-background").attr("x",f(j)-f.step()/2).attr("width",f.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let q=y.selectAll(".parentGroup").data([Le]);q=q.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(q);let ue=q.selectAll(".column-group").data(j=>j);ue=ue.enter().append("g").attr("class",j=>"column-group "+j.key.replace(/ /g,"-")).attr("hoverId",j=>j[0]?.properties.alias?Xa(j[0]?.properties.alias):Xa(j.key)).merge(ue);let V=ue.selectAll("rect").data(j=>j);const P=(j,ie)=>{const we=Array.from(ue.nodes()).indexOf(j[ie].parentNode);return{props:b[we]?.properties,groupIndex:we}},C=V.enter().append("rect").merge(V).attr("x",j=>f(j.data.dimension)-L/2).attr("width",L).attr("y",j=>T(0)).attr("height",0).attr("fill",(j,ie,we)=>{const{props:de}=P(we,ie);return ne.get(de.legendUniqueId)?.(j.data[j.key])??de?.color??"gray"}).attr("stroke",(j,ie,we)=>{const{props:de}=P(we,ie);return de?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?de.stackBorderColor:"none"}).attr("stroke-dasharray",(j,ie,we)=>{const{props:de}=P(we,ie);return de?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(j,ie,we)=>{const{props:de}=P(we,ie);return(de?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(j,ie,we)=>{const{props:de}=P(we,ie);return j.data[j.key]==0&&de?.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,ie)=>{const we=String(Pe.formattedDimensionListMap.get(ie.data.dimension)??ie.data.dimension??""),de=At(r,String(ie.data.dimension??""),{...ie.properties,formattedDimensionValue:we});ut([{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:Pe.formattedDimensionListMap.get(ie.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ie.properties?.currentMeasure?ie.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||ie.value,value:Xe(ie.data[ie.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:ie.properties.alias}],e,j,ie.properties,de)}).on("mouseout",(j,ie)=>{ot()}).on("click",vt(A,W,(j,ie)=>({seriesId:ie.key??"",dimValue:Array.isArray(ie.data.dimension)?String(ie.data.dimension[0]):String(ie.data.dimension),legendUniqueId:ie.key??"",seriesDisplayName:ie.properties?.alias||ie.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]))),ue.exit().remove(),y.selectAll(".parentGroup").raise()},$=F=>{X=h-F.left-F.right,M=k-F.bottom-F.top},R=(F,q,ue)=>{Te=q,Re=F,J=ue,li(n,Ue,Re),ae()},ae=()=>{ze(),Se(),ta(y,Pe,z,e,d,T,fe,se,k,L,t,X,M,Re,f),_();const F=new Map;Re.forEach((q,ue)=>{let B=0;Le.forEach(V=>{const P=V[ue]?.[0]??0;P<B&&(B=P)}),F.set(q,B)}),oe(Te),Ya(Le,f,T,a,D,pt,[],[],e,S,k,h,X,Re,M,m,i,x,d,o),ii(Ue,f,T,D,pt,[],e,S,k,h,i,o,!1,F),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,i,y,s,L,T,f,void 0,void 0,void 0,d,S,e,w,K,Re,X,N,Pe.formattedDimensionListMap,m,D,M)),G()},_=()=>{let F=Lt(Re,Te,ve);Le=v.stack().keys(Pe.legendList).offset(v.stackOffsetDiverging)(F),Te.forEach((ue,B)=>ue.data.forEach((V,P)=>{V[0]=Le[B][P][0],V[1]=Le[B][P][1]}));let q=e.annotation.annotationSetLabelColor;Le.forEach((ue,B)=>ue.forEach(V=>{V.key=ue.key,ue.color=JSON.parse(JSON.stringify(b[B].properties.color)),V.data.labelPosition=b[B].properties.dataLabelPosition,V.data.labelColor=q=="2"?JSON.parse(JSON.stringify(b[B].properties.color)):b[B].properties.labelColor,V.hideZero=JSON.parse(JSON.stringify(b[B].properties.hideZeroValues)),V.properties=b[B].properties}))},G=()=>{try{const F=e?.connector,q=Number(F?.connectorVisibility);if(!F||q===2)return;let ue,B=[];q===1?ue=1:q===3&&(Number(F.connectorFollow)===1?ue=Number(F.connectorStepSize)||void 0:Number(F.connectorFollow)===2&&(B=F.connectorExclude??[],ue=1));const V=(B||[]).map(ie=>String(ie).split("-")[0]),P=(Le[0]??[]).map((ie,we)=>({Dimension:ie.data.dimension,Total:ie.data.total,CustomTotal:ie.data.total,Index:we})),C=[],re=[];let j=[];if(ue){if(ue===1)C.push(...P);else for(const ie of P)ie.Index%ue===0&&C.push(ie);for(let ie=ue;ie<P.length;ie+=ue){const we=Math.min(ie+ue,P.length);let de=P[ie]?.Total??Number.NEGATIVE_INFINITY;for(let Ae=ie;Ae<we;Ae++)P[Ae].Total>de&&(de=P[Ae].Total);Number.isFinite(de)&&re.push(de)}j=C.slice(1)}else{const ie=F.connectorCustomRange??[],we=new Map;P.forEach(de=>we.set(String(de.Dimension),de.Index));for(const de of ie){if(!de?.from||!de?.to)continue;const Ae=we.get(String(de.from)),De=we.get(String(de.to));if(Ae!=null&&De!=null){C.push(P[Ae]);const $e=Math.min(Ae,De),Fe=Math.max(Ae,De);let _e=P[$e]?.Total??Number.NEGATIVE_INFINITY;for(let it=$e;it<=Fe;it++)P[it].Total>_e&&(_e=P[it].Total);Number.isFinite(_e)&&re.push(_e)}}for(const de of ie){if(!de?.from||!de?.to)continue;const Ae=we.get(String(de.to));Ae!=null&&j.push(P[Ae])}}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",F.connectorMarkerColor!==Ie.white?F.connectorMarkerColor:"none"),Q(C,re,j,ue,V),ee(C,re,j,ue,V)}catch{}},Q=(F,q,ue,B,V)=>{try{const P=F.filter((ie,we)=>B!=null?we<F.length-1:we<F.length);let C=y.selectAll("path.connector-path").data(P,ie=>String(ie.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",(ie,we)=>e.total.totalVisibility?`M ${f(ie.Dimension)+f.bandwidth()/2+5}, ${T(ie.Total)-25} V ${-35+Math.min(T(q[we]),T(ue[we].Total),T(ie.Total))} H ${f(ue[we].Dimension)+f.bandwidth()/2-10} V ${-27+T(ue[we].Total)}`:`M ${f(ie.Dimension)+f.bandwidth()/2+5}, ${T(ie.Total)-5} V ${-30+Math.min(T(ue[we].Total),T(ie.Total))} H ${f(ue[we].Dimension)+f.bandwidth()/2-10} V ${-10+T(ue[we].Total)}`).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",ie=>V.includes(ie.Dimension)||ie.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},ee=(F,q,ue,B,V)=>{try{let P,C=e.connector.connectorFontStyle,re=e.connector.connectorNumberFormat,j=X/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(re=".2s");const ie=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,we=Di(ie,L),de=we*(typeof f.padding=="function"?f.padding():0),Ae=F.map((_e,it)=>({d:_e,i:it})).filter(_e=>B!=null?_e.i<F.length-1:_e.i<F.length);let De=y.selectAll("text.connector-text").data(Ae,_e=>String(_e.d.Dimension));De.exit().remove(),De.enter().append("text").attr("class","connector-text").attr("text-anchor","middle").merge(De).attr("x",_e=>{const it=_e.d,nt=_e.i,Ba=ue[nt];return f(Ba.Dimension)-we*B/2}).attr("y",_e=>{const it=_e.d,nt=_e.i,Ba=q[nt],di=ue[nt],Ia=Math.min(T(di?.Total??0),T(it.Total));return e.total.totalVisibility?j<8?-40+Ia:-41+Ia:j<8?-35+Ia:-40+Ia}).style("text-anchor","middle").text(_e=>{const it=_e.d,nt=_e.i;return ue[nt]?(it.CustomTotal==0&&ue[nt].CustomTotal!=0&&(it.CustomTotal=1),fi(ue[nt].Total,it.Total,parseInt(e.connector.connectorDecimalPrecision),re,parseInt(it.Dimension),parseInt(ue[nt].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!==Ie.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",_e=>{const it=_e.d;return V.includes(it.Dimension)||it.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:g,id:m,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.NormalizedStackColumnChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList).reverse(),E=n.DimensionList,b=!1,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,w,z,K,ye,se,te,xe,ge,pe,he,O=!1,X,M,h,k,s,d,i,y,T,a,f,N;const ne=new Map;let Z,fe,Re,Te=[],Me=0,J=0,Ee=[],Le=[];const Ue=!0;let ve={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Pe()}catch(_){me("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",_)}},[e]);const Pe=()=>{({formatOptions:e,svg:i,width:h,height:k}=Ft(S,e)),Ye(),{formatOptions:e,dataTableLegendsList:Ee}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:he}=Rt(e,ve.yMinLeft,ve.yMaxLeft,ve.yMinRight,ve.yMaxRight),{margin:I,yLabel:D,xLabel:w,yTitle:z,xTitle:K,dimensionHeightWidthArray:ye,chartTitleHeight:se,secondaryAxisTitleWidth:te,legendMargin:xe,secondaryYLabel:ge,visibleBars:J,columnWidth:L,scrollbarVisible:O}=Mt(h,k,pe,he,ve.yMaxLeft,e,ve.legendList,ve.dimensionList,ve.yMaxRight,U,Ue,t,!1,ve,Ee),oe(I),{dataTable:s,dataTableHeight:d}=ia(e,D,z,A,ve.dimensionList,n),St(i,h,k,e),y=wt(i,I),kt(y,e,d,X,M,u),We(),ze(),Zt(y,e,d,D,Z,M),Dt(e,b,i,I,w,k,K,ve.chartType,D,X,M),Vt(M,e,d,b,i,I,z,D),Gt(i,U,I,e,d,M,X,ge,te),Nt(i,e,h,se),It(k,i,ye,se,h,xe,e,[...A].reverse(),m,d,I,ct.rectangle,u,l),_t(A,k,h,i,I,X,O,J,ve,Me,!1,$)},Ye=()=>{const _=[],G=[];let Q=-1/0,ee=1/0;A.forEach((V,P)=>{const C=`${P}~$~${V.properties.legend}`;V.properties.legend=C,G.push(C),Q=-1/0,ee=1/0;for(const re of V.data)Q=Math.max(Q,re.value),ee=Math.min(ee,re.value),_.push(re);V.properties.setColorScale&&ne.set(V.properties.legendUniqueId,v.scaleSequential().domain([ee,Q]).interpolator(v.interpolateRgb(V.properties.startColor,V.properties.endColor)))}),ve.chartData=_,ve.legendList=G,Te=JSON.parse(JSON.stringify(A));let F=Lt(ve.dimensionList,A,Ue);Re=ve.dimensionList;const q=v.stack().keys(ve.legendList).offset(v.stackOffsetDiverging)(F);ae();let ue=1/0;for(const V of q)for(const[P]of V)ue=Math.min(ue,P);ve.yMinLeft=ue>0?0:ue,ve.yMaxLeft=1;let B=t?Tt(e.xAxisLabel.xAxisNumberFormat,ve.dimensionList).map(V=>V):ve.dimensionList;ve.dimensionList.forEach((V,P)=>{ve.formattedDimensionListMap.set(V,B[P])}),e.plotArea.hideZeroValues&&(ve.hideZeroValues=!0)},We=()=>{let _=yt(H||ve.yMaxLeft,ve.yMinLeft,M,e,ve,Y,H).yAxisLabelArray;if(ve.yMaxLeft=_[_.length-1],ve.yMinLeft=_[0],T=v.scaleLinear().domain([ve.yMinLeft<0?-1:0,1]).range([d>0?M-d:M,0]),N=[0,X],e.seriesLabel.seriesLabelVisibility){let G=la(X,T,e,Te,void 0,U,M,!0);G.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&G.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?N=[0,X-G.heightWidth[0]]:N=[G.heightWidth[0],X]}},be=()=>{f=v.scalePoint().domain(Re).range(N).padding(.5)},ze=()=>{{const _=e.yAxisLabel.yAxisTicksMode===wa.custom,G=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0;Z=v.axisLeft(T).tickFormat(v.format(`.${G}%`)).tickSize(zt(e,X)).tickValues(_?za(ve.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null).ticks(d>0?(M-d)/80:M/80).tickPadding(8).tickSizeOuter(0)}},ke=()=>{fe=v.axisBottom(f).tickSize(sa(e,M,d,!0)).tickSizeOuter(0).tickValues(gt(Re,X,e))},Se=_=>{Le.forEach((P,C)=>P.forEach((re,j)=>{_[C].data[j]&&_[C].data[j][0]!==void 0&&_[C].data[j][1]!==void 0&&(_[C].data[j][0]=re[0]=re.data.total===0?0:re[0]/re.data.total,_[C].data[j][1]=re[1]=re.data.total===0?0:re[1]/re.data.total)})),_.forEach(P=>{P.data.forEach(C=>{C.hideZero=P.properties.hideZeroValues,C.axis=P.properties.axis})}),Re.forEach(P=>{y.append("rect").attr("id",`dim-background-${P}`).attr("class","dimension-background").attr("x",f(P)-f.step()/2).attr("width",f.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let G=y.selectAll(".parentGroup").data([Le]);G=G.enter().append("g").attr("class","columns parentGroup").merge(G);let Q=G.selectAll(".column-group").data(P=>P);Q=Q.enter().append("g").attr("class",P=>"column-group "+P.key.replace(/ /g,"-")).attr("hoverId",P=>(_[P.index].properties.alias||_[P.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(Q);let F=Q.selectAll("rect").data(P=>P);const q=(P,C)=>{const re=Array.from(Q.nodes()).indexOf(P[C].parentNode);return{props:A[re]?.properties,groupIndex:re}},ue=F.enter().append("rect").attr("x",P=>f(P.data.dimension)-L/2).attr("width",L).attr("y",T(0)).attr("height",0).attr("fill",(P,C,re)=>{const{props:j}=q(re,C);return ne.get(j.legendUniqueId)?.(P.data[P.key])??j?.color??"gray"}).attr("stroke",(P,C,re)=>{const{props:j}=q(re,C);return j?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?j.stackBorderColor:"none"}).attr("stroke-dasharray",(P,C,re)=>{const{props:j}=q(re,C);return j?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(P,C,re)=>{const{props:j}=q(re,C);return(j?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(P,C,re)=>{const{props:j}=q(re,C);return P.data[P.key]===0&&j?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,P=>P.key??"").attr(lt.DimValue,P=>Array.isArray(P.data.dimension)?String(P.data.dimension[0]):String(P.data.dimension)),B=e.animation.animationEnabled;(P=>B?P.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):P)(ue).attr("y",P=>P[1]>=P[0]?T(P[1]):T(P[0])).attr("height",P=>Math.abs(T(P[0])-T(P[1]))),ue.merge(F).on("mousemove",(P,C)=>{ut([{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(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:Xe(C[1]-C[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:C.properties.alias}],e,P,C.properties,At(p,String(C.data.dimension??""),{...C.properties,formattedDimensionValue:String(ve.formattedDimensionListMap.get(C.data.dimension)??C.data.dimension??"")}))}).on("mouseout",(P,C)=>{ot()}).on("click",vt(W,g,(P,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||""}))),Q.exit().remove(),y.selectAll(".parentGroup").raise()},oe=_=>{X=h-_.left-_.right,M=k-_.bottom-_.top},$=(_,G,Q)=>{Te=G,Re=_,J=Q,R()},R=()=>{be(),ke(),ae(),ta(y,ve,w,e,d,T,fe,ye,k,L,t,X,M,Re,f),Se(Te),Ya(Le,f,T,a,I,pt,[],[],e,u,k,h,X,Re,M,m,i,x,d,o),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,i,y,s,f.bandwidth(),T,f,void 0,void 0,void 0,d,u,e,D,z,ve.dimensionList,X,N,ve.formattedDimensionListMap,m,I,M))},ae=()=>{let _=Lt(Re,Te,Ue);Le=v.stack().keys(ve.legendList).offset(v.stackOffsetDiverging)(_),Te.forEach((Q,ee)=>Q.data.forEach((F,q)=>{F[0]=Le[ee][q][0],F[1]=Le[ee][q][1]}));let G=e.annotation.annotationSetLabelColor;Le.forEach((Q,ee)=>Q.forEach(F=>{F.key=Q.key,Q.color=JSON.parse(JSON.stringify(A[ee].properties.color)),Q.individualAnnotationVisibility=JSON.parse(JSON.stringify(A[ee].properties.individualAnnotationVisibility)),F.data.labelPosition=A[ee].properties.dataLabelPosition,F.data.labelColor=G=="2"?JSON.parse(JSON.stringify(A[ee].properties.color)):A[ee].properties.labelColor,F.hideZero=JSON.parse(JSON.stringify(A[ee].properties.hideZeroValues)),F.properties=A[ee].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ca="ChartsWithoutAxisFunctions.ts";function Oi(t,e,n){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:o,minVal:x,maxVal:l}=e.plotArea.plotAreaRangeFilter;return t.filter(r=>{const c=n(r);switch(o){case"lt":return c<=l;case"gt":return c>=x;case"in":return c>=x&&c<=l;case"not-in":return c<x||c>l;default:return!0}})}function el(t,e,n,o,x,l){try{o.xAxisLabel.xAxisDateFormat=o.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":o.xAxisLabel.xAxisDateFormat;let r={top:0,left:0,right:0,bottom:0},c=t*.15*.8,p=l[0],m=c<p+10?c:p+10,L=o.plotArea.numberOfBubbles?20:0;const u=Ke(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisNumberFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString();let g=Pt(u,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,o.xAxisLabel.xAxisLabelRotation)[3]+10,W=o.xAxisTitle.xAxisTitleVisibility?o.xAxisTitle.xAxisDynamicTitleText.length!==0?$t(o.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:$t(o.xAxisTitle.xAxisTitleText,13,tt).height:0;W=W>e*.1?e*.1:W;let A=o.xAxisLabel.xAxisLabelVisibility?g:0,E=o.yAxisTitle.yAxisTitleVisibility?o.yAxisTitle.yAxisDynamicTitleText.length!==0?$t(o.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:$t(o.yAxisTitle.yAxisTitleText,13,tt).height:0;E=E>t*.1?t*.1:E;let b=o.yAxisLabel.yAxisLabelVisibility?$t(Ke(o.yAxisLabel.yAxisDisplayUnits,o.yAxisLabel.yAxisNumberFormat,o.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString(),rt(o.yAxisLabel.yAxisLabelFontSize),o.yAxisLabel.yAxisLabelFontFamily,o.yAxisLabel.yAxisLabelRotation).width+10:0,U=o.chartTitle.chartTitleVisibility?o.chartTitle.dynamicTitleText.length!==0?$t(o.chartTitle.chartTitleHTML,void 0,void 0).height:$t(o.chartTitle.chartTitleText,16,tt).height:0;U=U>e*.1?e*.1:U;let Y=o.legends.legendPosition,H=o.legends.legendVisibility,I=!1;switch(H||(Y="None"),Y){case Je.none:r.top=U+5,r.bottom=W+A+5+L,r.right=15,r.left=E+b+5;break;case Je.top:r.top=40+U,r.bottom=W+A+5+L,r.right=15,r.left=E+b+5;break;case Je.right:r.right=m+35,r.top=U+5,r.bottom=W+A+5+L,r.left=E+b+5;break;case Je.bottom:r.bottom=40+A+W+L,r.top=U+5,r.right=15,r.left=E+b+5;break;case Je.left:r.left=m+E+b+33,r.top=U+5,r.bottom=W+A+5+L,r.right=15}o.xAxisLabel.xAxisPosition&&o.xAxisLabel.xAxisPosition=="1"&&(r.bottom=r.bottom-A,r.top=r.top+A);let D=o.chartPadding.paddingArrayLTRB;D&&(r.top+=D[1],r.bottom+=D[3],r.right+=D[2],r.left+=D[0]);let w=e-r.top-r.bottom,z=t-r.left-r.right;return{margins:r,yLabel:b,xLabel:A,yTitle:E,xTitle:W,chartTitleHeight:U,legendMargin:m,innerHeight:w,innerWidth:z}}catch(r){Ma(Ca,"marginCalculationForBubbleScatter",r)}}function tl(t,e,n){try{let o=parseFloat(t.yAxisLabel.yAxisIntervalText),x=parseFloat(t.yAxisLabel.yAxisMaxText),l=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){l=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let u=t.yAxisLabel.yAxisMaxText;x=u.length>0?parseFloat(u):n,x&&(n=x)}else x=n,l=e,o=void 0;let r=e?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,c=n?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(n).toString().length:0,p=x?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(x).toString().length:0,m=l?Ke(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(l).toString().length:0,L=r<c?n:e;if(l){let u=m<c?n:l;L=L<u?u:L}if(x){let u=p>r?x:e;L=L<u?u:L}return x&&l&&(L=p>m?x:l),{longestMeasure:L,customYaxisIntervalValue:o,customYaxisMaxValue:x,customYaxisMinValue:l}}catch(o){Ma(Ca,"customYscaleLabelFormatting",o)}}function al(t,e,n){try{let o=parseFloat(t.xAxisLabel.xAxisIntervalText),x=parseFloat(t.xAxisLabel.xAxisMaxText),l=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){l=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let u=t.xAxisLabel.xAxisMaxText.toString();x=u.length>0?parseFloat(u):n,x&&(n=x)}else x=n,l=e,o=void 0;let r=e?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,c=n?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(n).toString().length:0,p=x?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(x).toString().length:0,m=l?Ke(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(l).toString().length:0,L=r<c?n:e;if(l){let u=m<c?n:l;L=L<u?u:L}if(x){let u=p>r?x:e;L=L<u?u:L}return x&&l&&(L=p>m?x:l),{longestDimension:L,customXaxisIntervalValue:o,customXaxisMaxValue:x,customXaxisMinValue:l}}catch(o){Ma(Ca,"customXscaleLabelFormatting",o)}}function il(t,e,n,o,x,l,r,c,p,m,L){try{let u=t.xAxisLabel.xAxisPosition,S=!0,W=n.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+L+(t?.xAxisLabel?.xAxisPosition=="1"?0:x)})`:!t.plotArea.fitChart&&!1?`translate(${o.left},${l-r-5})`:`translate(${o.left},${o.top+L+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:x:c=="tornado"?x+5:p+5)})`).attr("class","xAxisTitle").attr("width",m).attr("height",r+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?W.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):W.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 ll(t,e,n,o,x,l,r,c){try{let p=n>0?t-n:t,m=x.append("foreignObject").attr("visibility",o?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${l.top+p}`).attr("y",l.left-r-c+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",p).attr("height",r+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?m.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):m.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 rl(t,e,n,o,x,l){try{let r=parseFloat(o.yAxisLabel.yAxisIntervalText),c=[],p;if(r&&r!==0&&r!==void 0){let m=x||x==0?x:e,L=l||l==0?l:t;m<0?p=Math.floor((L-m)/r):p=Math.floor(L/r);let u=18;(l||l==0)&&(t=l);let S=x||x==0?x:e<0?Math.round(e):0;if(c.push(S),p>100){let g="Tick count cannot exceed more than 100.";m<0?r=(L-S)/100:r=L/100}if(p=p<100?p:100,p>u)for(let g=0;g<parseInt(p)&&(S+=r,parseFloat(S.toFixed(5))<=t);g++)c.push(S);else for(let g=0;g<u&&(S+=r,S<=t);g++)c.push(S)}else if(o.yAxisLabel.yAxisTicksMode===wa.custom){let m=x||x==0?x:e;c=za(m,t,o.yAxisLabel.yAxisTicksCount),p=c.length}else p=n/60;return{yAxisLabelArray:c,customTickValue:p}}catch(r){Ma(Ca,"responsiveYaxisLabel",r)}}function Ti(t,e,n,o,x,l,r,c){try{let p=!0,m=parseFloat(o.xAxisLabel.xAxisIntervalText),L=[],u;if(m&&m!==0&&m!==void 0){let S=x||x==0?x:e,g=l||l==0?l:t;S<0?u=Math.floor((g-S)/m):u=Math.floor(g/m);let W=18;(l||l==0)&&(t=l);let A=x||x==0?x:e<0?Math.round(e):0;if(L.push(A),p=!1,u>100){let E="Tick count cannot exceed more than 100.";S<0?m=(g-A)/100:m=g/100}if(u=u<100?u:100,u>W)for(let E=0;E<parseInt(u)&&(A+=m,parseFloat(A.toFixed(5))<=t);E++)L.push(A);else for(let E=0;E<W&&(A+=m,A<=t);E++)L.push(A)}else if(o.xAxisLabel.xAxisTicksMode===wa.custom){let S=x||x==0?x:e,g=l||l==0?l:t;L=za(S,g,o.xAxisLabel.xAxisTicksCount),p=!1,u=L.length}else{const S=Ke(o.xAxisLabel.xAxisDisplayUnits,o.xAxisLabel.xAxisDateFormat,o.xAxisLabel.xAxisLabelDecimalPrecision??"2")(l||t).toString();let g=Pt(S,o.xAxisLabel.xAxisLabelFontSize,o.xAxisLabel.xAxisLabelFontFamily,0);L=Bi(x||e,l||t,c?r:n,g[0]),u=n/30}return{xAxisLabelArray:L,customTickValue:u,autoLabelFlag:p}}catch(p){Ma(Ca,"responsiveXaxisLabel",p)}}function nl(t,e,n,o,x,l){try{let r=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-o},0)`).attr("height",n>0?l-n:l).attr("width",o).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==Ie.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const c=t.append("g").call(x);c.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),c.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==Ie.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",r.includes(ce.italic)?ce.italic:"").style("text-decoration",r.includes(ce.underline)?ce.underline:"").style("font-weight",r.includes(ce.bold)?ce.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),c.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(r){Ma(Ca,"initYaxis",r)}}function sl(t,e,n,o,x,l,r,c,p){try{let m=e.xAxisLabel.xAxisLabelFontStyle,L=e.xAxisLabel.xAxisPosition,u=e.xAxisLabel.xAxisLabelRotation;u=parseInt(u),t.append("rect").attr("transform",`translate(1,${L==="0"?n>0?l-n:l:L==="1"?-o:p(0)})`).attr("height",o).attr("width",r).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==Ie.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${L==="0"?l:L==="1"?0:p(0)})`).call(x);let g=L==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(o)).style("height","20px").attr("transform",(A,E)=>`rotate(${L==="1"?-u:u!=0?180-u:0}) translate (${u!=0?g+", -5":-o/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",m.includes(ce.italic)?ce.italic:"").style("text-decoration",m.includes(ce.underline)?ce.underline:"").style("font-weight",m.includes(ce.bold)?ce.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(A,E)=>Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(A)).html((A,E)=>Ke(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(m){Ma(Ca,"initXaxis",m)}}function ol(t,e,n,o,x,l,r,c,p,m,L){try{if(!n.annotation.annotationVisibility)return;const u=n.plotArea.annotationType??"1",S=[u==="1"?"connector":""],g=n.plotArea.connectorType?.toLowerCase()??"none",W=u==="5",A=n.plotArea.rotation??0,E=x===le.PieChart?1.06:1.1,b={1:"",2:v.curveLinear,3:v.curveStep},U=(O,X)=>[[0,0],[O/2,X/2],[O,X]],Y={solid:"unset",dotted:"2,2",dashed:"6,4"};let H=t.annotation(),I=JSON.parse(JSON.stringify(n.plotArea.dataLabelsCoordinates||[]));I=I.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??p,data:O.data,width:l,height:r}));const D=e.reduce((O,X)=>O+(X?.data?.data?.[0]?.value??0),0),w=D===0?1:D,z=(O,X)=>{const M=O.data.data[0].value,h=(O.x0+O.x1)/2,k=O.x1-O.x0;return{note:{title:n.plotArea.dataLabelName?O.data.legend:"",label:n.plotArea.dataLabelValue&&M!==0?n.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(M/w)*100).toFixed(rt(n.plotArea.dataLabelDecimalPrecision))+"%":Ke(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(M):"",align:"middle",wrap:1e3},data:{x:{legend:O.data.legend},y:{value:M},midAngle:h,isVisible:!0,hoverId:O?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:O.data.legend,dx:0,dy:0,connector:{end:g,curve:b[n.plotArea.connectorCurve],points:W?U(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:ur(t,u),color:n.plotArea.connectorColor??"#ccc",width:l,height:r,index:X}};let K=e.filter(O=>O.x1-O.x0>1e-4).map(z);const ye=O=>(O.data.y?.value??0)!==0;K=K.filter(ye),K=Ut(K,n,O=>O.data.y.value);let se=new Map(I.map(O=>[O.data?.x?.legend,O])),te=[];K.forEach(O=>{const X=O.data.x.legend,M=se.get(X);if(M){if(M.ratioDistance!=null&&M.ratioAngle!=null){const h=M.ratioDistance*p;O.dx=Math.cos(M.ratioAngle)*h,O.dy=Math.sin(M.ratioAngle)*h}else{const h=p/(M.radius||p);O.dx=M.dx*h,O.dy=M.dy*h}O.data.isVisible=M.data?.isVisible??!0,M.connectorPoints?.length>=(W?3:2)?O.connector.points=M.connectorPoints:O.connector.points=W?U(O.dx,O.dy):[[0,0],[0,0]]}te.push(O)}),H.editMode(n.plotArea.annotationDraggable&&m).accessors({x(O){return Math.cos(O.midAngle-Math.PI/2)*(p-p*.35)},y(O){return Math.sin(O.midAngle-Math.PI/2)*(p-p*.35)}}).on("dragend",function(O){te.forEach(M=>{if(M.data.x.legend===O.data.x.legend){const h=O._dx,k=O._dy,s=Math.sqrt(h*h+k*k),d=Math.atan2(k,h);M.dx=h,M.dy=k,M.ratioDistance=s/p,M.ratioAngle=d,M.width=l,M.height=r,M.connectorPoints=O.connector?.points||[]}});const X=te.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:l,height:r,radius:p}));L&&L(X)}).annotations(te);const xe=c.append("g").attr("class","annotation-group parentGroup").attr("transform",o).call(H),ge=n.plotArea.dataLabelNameFontStyle??[];xe.selectAll(".annotation-note-title").style("font-family",n.plotArea.dataLabelNameFontFamily).style("font-size",`${n.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",n.plotArea.dataLabelNameColor??"#000");const pe=n.plotArea.dataLabelValueFontStyle??[];if(xe.selectAll(".annotation-note-label").style("font-family",n.plotArea.dataLabelValueFontFamily).style("font-size",`${n.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",n.plotArea.dataLabelValueColor??"#000"),n.plotArea.plotAreaAbsoluteValue&&xe.selectAll(".annotation-note-label").each(function(O){const X=v.select(this),M=v.format(".2s")(Math.abs(O.data.y.value));X.append("tspan").attr("x",X.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",n.plotArea.dataLabelValueFontFamily).style("font-size",`${n.plotArea.dataLabelValueFontSize}px`).style("fill",n.plotArea.dataLabelValueColor??"#000").text(M)}),g==="diamond"){const O=n.plotArea.connectorColor??"#ccc",X=5;xe.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,${-X} ${X},0 0,${X} ${-X},0`).style("fill",O).style("stroke",O)})}if(xe.selectAll("rect,.annotation-subject").remove(),n.animation?.animationEnabled){const O=n.animation.animationDuration,X=et[n.animation.animationEffect],M=xe.selectAll(".annotation-note-label");M.interrupt().style("opacity",0),setTimeout(()=>{M.transition().delay((h,k)=>k*30).duration(O).ease(X).style("opacity",1)},50)}const he=n.plotArea.connectorColor??"#ccc";xe.selectAll(".connector").style("stroke",he).attr("hoverId",O=>O.data.hoverId).attr("stroke-dasharray",Y[n.plotArea.connectorStyle?.toLowerCase()]),xe.selectAll(".connector-end").attr("hoverId",O=>O.data.hoverId).style("fill",he).style("stroke",he),xe.selectAll(".annotation-note-title").attr("hoverId",O=>O.data.hoverId),xe.selectAll(".annotation-note-label").attr("hoverId",O=>O.data.hoverId).filter(O=>!O.data.isVisible).style("display","none"),xe.selectAll(".annotation-note-label").filter(O=>n.plotArea.hideInsignificantValue&&O.data.x1-O.data.x0<.09).style("visibility","hidden")}catch(u){throw u}}const ur=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(n){throw n}},cl=(t,e,n,o,x,l,r,c,p,m)=>{try{if(n.plotArea.numberOfBubbles){let L=e=="Bottom"?o-55:o-25;t.append("foreignObject").attr("transform",`translate(${l.left},${L})`).attr("width",x).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",Ie.black).style("font-size","12px ").style("text-overflow","ellipsis").html((n.plotArea.totalAlias?n.plotArea.totalAliasText:"Total count : ")+m)}}catch(L){Ma(Ca,"setnumberOfBubbles",L)}};function Ma(t,e,n){console.error(`[${t}] [${e}]`,n)}const xr=({isDateType:t,formatOptions:e,data:n})=>{const o=crypto.randomUUID(),x=0,l=le.ColumnHistogramChart,r=Ce.useRef(),c=n.ChartData,p=n.DimensionList,m=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,W=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,E,b,U,Y,H,I,D,w,z,K,ye,se,te,xe,ge,pe=[],he=[],O,X,M,h,k,s,d,i,y,T,a,f,N,ne=[],Z=0;const fe=2;let Re=[],Te={dimensionList:p,chartType:l,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Me()}catch(ke){me("Columnchart","createColumnChart",ke)}},[e]);const Me=()=>{({formatOptions:e,svg:k,width:O,height:X}=Ft(r,e)),{formatOptions:e,dataTableLegendsList:Re}=ea(e,c,n.DataTableData??[]),J(),{maxNumberForPrimaryAxis:ye,maxNumberForSecondaryAxis:se}=Rt(e,Te.yMinLeft,Te.yMaxLeft,Te.yMinRight,Te.yMaxRight),{margin:E,yLabel:b,xLabel:U,yTitle:Y,xTitle:H,dimensionHeightWidthArray:I,chartTitleHeight:D,secondaryAxisTitleWidth:w,legendMargin:z,secondaryYLabel:K}=Mt(O,X,ye,se,Te.yMaxLeft,e,Te.legendList,Te.dimensionList,Te.yMaxRight,L,u,t,m,Te,Re),We(E),{dataTable:M,dataTableHeight:h}=ia(e,b,Y,c,Te.dimensionList),St(k,O,X,e),s=wt(k,E),kt(s,e,h,te,xe,l),Ee(),Ue(),ve(),Zt(s,e,h,b,a,xe),be(c,X,k,E,te),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,k,s,M,x,d,i,y,void 0,void 0,h,l,e,b,Y,Te.dimensionList,te,T,Te.formattedDimensionListMap,o,E,xe)),Dt(e,m,k,E,U,X,H,Te.chartType,b,te,xe),Vt(xe,e,h,m,k,E,Y,b),Gt(k,L,E,e,h,xe,te,K,w),Nt(k,e,O,D),It(X,k,I,D,O,z,e,c,o,h,E,ct.rectangle)},J=()=>{const ke=[],Se=[];let oe=[],$=-1/0,R=1/0;c.forEach(G=>{Se.push(G.legend),G.data.forEach(Q=>{ke.push(Q),$=Math.max($,Q.value),R=Math.min(R,Q.value)})}),Te.chartData=ke,Te.legendList=Se,Te.yMaxLeft=$,Te.yMinLeft=R>0?0:R,ne=JSON.parse(JSON.stringify(c)),ne.forEach(G=>G.data.forEach(Q=>oe.push(Q.value)));let ae=S||S==0?S:0,_=g||g==0?g:ne[0]?.data?.length;if(Te.yMaxLeft=parseFloat((ae+"").length>(_+"").length?ae+"":_+""),Te.xMax=v.max(oe),Te.xMin=v.min(oe),Te.xMin===Te.xMax){const G=Te.xMax===0?1:Math.abs(Te.xMax*.1);Te.xMin-=G,Te.xMax+=G}},Ee=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=te/50;break;case"Number of Bins":Le(!1);break;case"Bin Width":Le(!0)}},Le=ke=>{ne.forEach(R=>R.data.sort(function(ae,_){return ae.value-_.value}));let Se=Te.xMax-Te.xMin,oe;ke?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),oe=Se/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),oe=Se/parseFloat(e.bins.binsCalculationValue));let $=Te.xMin;if(ke)for(pe=[$];$<Te.xMax;)$+=oe,pe.push($);else for(pe=[$];Math.round($)<Math.round(Te.xMax);)$+=oe,pe.push(Math.round($))},Ue=()=>{i=v.scaleLinear().domain([Te.xMin,Te.xMax]).range([0,te]);const ke=pe.length>0?pe:i.ticks(ge);let Se=v.bin().value($=>$).domain(i.domain()).thresholds(ke);ne.forEach($=>{let R=Se($.data.map(ae=>ae.value));he.push(R)}),ne.forEach(($,R)=>he[R].forEach(ae=>{ae.name=$.properties.legend,ae.color=$.properties.color,ae.opacity=$.properties.opacity}));let oe=[];he.forEach($=>$.forEach(R=>oe.push(R.length))),Te.yMaxLeft=v.max(oe),Te.yMinLeft=v.min(oe),d=v.scaleLinear().range([xe,0]).domain([S||S==0?S:0,g||g==0?g:Te.yMaxLeft+.2*Te.yMaxLeft])},ve=()=>{Pe();{let ke=yt(Te.yMaxLeft,Te.yMinLeft,xe,e,Te,S,g,!1,te);a=v.axisLeft(d).tickFormat(Se=>Xe(Se,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,te)).tickValues(ke.autoLabelFlag?void 0:ke.yAxisLabelArray).ticks(ke.customTickValue).tickPadding(8).tickSizeOuter(0)}},Pe=()=>{let ke=parseInt(e.xAxisLabel.xAxisPosition);Ti(Te.xMax,Te.xMin,te,e,W,A,xe,!1).xAxisLabelArray.shift(),f=(ke==1?v.axisTop(i):v.axisBottom(i)).tickFormat(oe=>Xe(oe,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(sa(e,xe,h)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?f.ticks(ge):f.tickValues(pe).ticks(te/50)},Ye=ke=>{const Se=e.animation.animationEnabled,oe=s.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(he).enter().append("g").selectAll("rect").data(R=>R).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(R){return"translate("+i(R.x0)+","+xe+")"}).attr("width",function(R){return i(R.x1)-i(R.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(R.x1)-i(R.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",R=>R.color!==Ie.white?R.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(R,ae)=>{ut([{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.x0}-${ae.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ae.properties?.currentMeasure?ae.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:Xe(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(ae.length/ne[0].data.length):ae.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,R)}).on("mouseout",ot);(Se?oe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):oe).attr("transform",function(R){return"translate("+i(R.x0)+","+(d(R.length)>0?d(R.length):0)+")"}).attr("height",function(R){return xe-d(R.length)}),s.selectAll(".parentGroup").raise()},We=ke=>{te=O-ke.left-ke.right,xe=X-ke.bottom-ke.top},be=(ke,Se,oe,$,R)=>{if(!e.plotArea.fitChart){const ae=ke[0].data.length-fe,_=Se-20;N=Te.dimensionList.slice(Z,Z+fe),ne=JSON.parse(JSON.stringify(ke)),ne.forEach((ee,F)=>ne[F].data=ee.data.filter(q=>N.includes(q.dimension))),oe.append("rect").attr("x",$.left).attr("y",_).attr("width",R).attr("height",8).attr("fill","#ddd").attr("rx",4);const G=R*fe/Te.dimensionList.length,Q=oe.append("rect").attr("x",$.left).attr("y",_).attr("width",G).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",ee=>{let F=Math.min(Math.max(ee.x,$.left),$.left+R-G);Q.attr("x",F),Z=Math.round((F-$.left)/(R-G)*ae),N=Te.dimensionList.slice(Z,Z+fe),ne=JSON.parse(JSON.stringify(ke)),ne.forEach((q,ue)=>ne[ue].data=q.data.filter(B=>N.includes(B.dimension))),Pe(),ze()}));oe.on("wheel",ee=>{ee.preventDefault();const F=Math.abs(ee.deltaX)>Math.abs(ee.deltaY)?ee.deltaX:ee.deltaY;Z+=F>0?1:-1,Z=Math.max(0,Math.min(Z,ae));const q=$.left+(R-G)*Z/ae;Q.attr("x",q),ne=JSON.parse(JSON.stringify(ke)),ne.forEach((ue,B)=>ne[B].data=ue.data.filter(V=>N.includes(V.dimension))),Pe(),ze()})}ze()},ze=()=>{ta(s,Te,U,e,h,d,f,I,X,x,t,te,xe,N,i),Ye()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:r,id:o,style:{width:"100%",height:"100%"}})})},hr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID(),L=0,u=le.LineChart,S=Ce.useRef(),g=Ce.useRef(c);g.current=c;const W=Ce.useRef(p);W.current=p;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled;let U=!1;const Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h=!1,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye,We,be=[],ze=0,ke=0,Se=0,oe=[],$={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(V){me("Linechart","createLineChart",V)}},[e]);const R=()=>{({formatOptions:e,svg:a,width:d,height:i}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:oe}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:X,maxNumberForSecondaryAxis:M,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:w}=Rt(e,$.yMinLeft,$.yMaxLeft,$.yMinRight,$.yMaxRight),{margin:z,yLabel:K,xLabel:ye,yTitle:se,xTitle:te,dimensionHeightWidthArray:xe,chartTitleHeight:ge,secondaryAxisTitleWidth:pe,legendMargin:he,secondaryYLabel:O,visibleBars:ke,columnWidth:Se,scrollbarVisible:h}=Mt(d,i,X,M,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,Y,t,b,$,oe),ue(z),{dataTable:y,dataTableHeight:T}=ia(e,K,se,A,$.dimensionList,n),b&&(y=[],T=0),St(a,d,i,e),f=wt(a,z),kt(f,e,T,k,s,u,m),_(),ee(),b?(ra(e,f,K,s,k,ve),U&&Ai(e,f,O,Pe,k)):(Zt(f,e,T,K,Te,s),U&&bi(f,e,T,O,J,s,k)),Dt(e,b,a,z,ye,i,te,$.chartType,K,k,s),Vt(s,e,T,b,a,z,se,K,k),U&&Gt(a,U,z,e,T,s,k,O,pe,b),Nt(a,e,d,ge),It(i,a,xe,ge,d,he,e,A,m,T,z,ct.line,u,l),_t(A,i,d,a,z,k,h,ke,$,ze,!1,G,b)},ae=()=>{const V=[],P=[];let C=[],re=-1/0,j=1/0,ie=-1/0,we=1/0;e.plotArea.hideZeroValues&&($.hideZeroValues=!0),A.forEach(de=>{P.push(de.properties.alias?de.properties.alias:de.legend),de.data.forEach(Ae=>{V.push(Ae),de.properties.axis==="Secondary"?(U=!0,ie=Math.max(ie,Ae.value),we=Math.min(we,Ae.value)):(re=Math.max(re,Ae.value),j=Math.min(j,Ae.value))})}),$.chartData=V,$.legendList=P,$.yMaxLeft=re,$.yMinLeft=j,$.yMaxRight=ie,$.yMinRight=we,C=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(de=>de):$.dimensionList,$.dimensionList.forEach((de,Ae)=>{$.formattedDimensionListMap.set(de,C[Ae])}),be=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?We=$.dimensionList:We=$.dimensionList.slice(ze,ze+ke)},_=()=>{let V=yt(I||$.yMaxLeft,$.yMinLeft,s,e,$,H,I,b,k).yAxisLabelArray;$.yMaxLeft=V[V.length-1],$.yMinLeft=V[0];const P=b?[0,T>0?k-T:k]:[T>0?s-T:s,0];{const C=v.scaleLinear().domain([$.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:$.yMinLeft*.9:$.yMinLeft<0?$.yMinLeft*1.1:$.yMinLeft*.9,$.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:$.yMaxLeft*1.1]).range(P);b?Le=C:N=C}if(U){const C=v.scaleLinear().domain([$.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:$.yMinRight*1.1,$.yMaxRight<=0?w||0:w||$.yMaxRight*1.1]).range(P);b?Ue=C:ne=C}if(fe=b?[s,0]:[0,k],!b&&e.seriesLabel.seriesLabelVisibility){let C=la(k,N,e,be,ne,U,s,!1);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Re=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?fe=[0,k-C.heightWidth[0]]:fe=[C.heightWidth[0],k]}},G=(V,P,C)=>{be=P,We=V,ke=C,B()},Q=()=>{const V=v.scalePoint().domain(We).range(fe).padding(.5);b?Ee=V:Z=V},ee=()=>{{let V=yt(I||$.yMaxLeft,$.yMinLeft,s,e,$,H,I,b,k);b?ve=v.axisBottom(Le).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-s:0).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/50).tickPadding(8).tickSizeOuter(0):Te=v.axisLeft(N).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,k,Re)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue).tickPadding(8).tickSizeOuter(0)}if(U){let V=yt(w||$.yMaxRight,D||$.yMinRight,s,e,$,D,w);b?Pe=v.axisTop(Ue).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/50).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-s:0).tickPadding(8).tickSizeOuter(0):J=v.axisRight(ne).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue).tickSize(zt(e,k,Re)).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?Ye=v.axisLeft(Ee).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*k*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(We,s,e)):Me=v.axisBottom(Z).tickSize(sa(e,s,T,!0)).tickSizeOuter(0).tickValues(gt(We,k,e))},q=V=>{const P=[...V].reverse();P.forEach(Ae=>{Ae.data.forEach(De=>{De.hideZero=Ae.properties.hideZeroValues,De.axis=Ae.properties.axis})});const C=b?v.line().y(Ae=>{const De=Ee(Ae.dimension);return De??0}).x(Ae=>Ae.axis===Qe.primary?Le(Ae.value):Ue(Ae.value)).defined(Ae=>Ae.hideZero||$.hideZeroValues?!!Ae.value:!0).curve(ft(e)):v.line().x(Ae=>{const De=Z(Ae.dimension);return De??0}).y(Ae=>Ae.axis===Qe.primary?N(Ae.value):ne(Ae.value)).defined(Ae=>Ae.hideZero||$.hideZeroValues?!!Ae.value:!0).curve(ft(e)),re=e.animation.animationEnabled,j=Ae=>re?Ae.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Ae;let ie=f.selectAll(".parentGroup").data([P]);ie=ie.enter().append("g").attr("class","lines parentGroup").merge(ie);let we=ie.selectAll(".line-group").data(Ae=>Ae),de=we.enter().append("g").attr("class","line-group");de.append("path").attr("class","visibleLine").attr("fill","none"),de.merge(we).each(function(Ae){const $e=v.select(this).selectAll("path.visibleLine").data([Ae]).join("path").attr("class","visibleLine").attr("d",Fe=>C(Fe.data)).attr("stroke",Fe=>Fe.properties.color!==Ie.white?Fe.properties.color:"none").attr("stroke-dasharray",Fe=>{const _e=parseInt(Fe.properties.lineWidth);switch(Fe.properties.lineStyle){case bt.dotted:return`0,${_e+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",Fe=>Fe.properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",Fe=>Fe.properties.lineStyle!=="None"?Fe.properties.lineWidth:0).attr("hoverId",(Ae.properties.alias||Ae.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${m}-clip)`).attr("d",Fe=>C(Fe.data)).attr(lt.SeriesId,Fe=>Fe.properties.legendUniqueId).attr(lt.DimValue,Fe=>Fe.properties.alias||Fe.properties.name||"").on("click",vt(W,g,(Fe,_e)=>({seriesId:_e.properties.legendUniqueId,dimValue:_e.properties.alias||_e.properties.name||"",legendUniqueId:_e.properties.legendUniqueId,seriesDisplayName:_e.properties.alias||_e.properties.name||""})));re&&$e.each(function(){const Fe=v.select(this),_e=this.getTotalLength();Fe.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",_e),j(Fe).attr("stroke-dashoffset",0)})}),we.exit().remove(),Va(ie,P,"None",b?Ee:Z,b?Le:N,b?Ue:ne,null,e,$,w,D,H,I,!1,r,b),f.selectAll(".parentGroup").raise()},ue=V=>{k=d-V.left-V.right,s=i-V.bottom-V.top},B=()=>{if(Q(),F(),b?na(e,f,ye,s,k,Ye,Pe,Le,$.yMaxLeft,We,u,t,d,xe,Se,Ee):ta(f,$,ye,e,T,N,Me,xe,i,k/We.length,t,k,s,We,Z),q(be),$a(A,b?Ee:Z,b?Le:N,b?Ue:ne,z,pt,[],[],e,u,i,d,k,We,s,m,a,x,void 0,void 0,o,!1,b),!b){let V=la(k,N,e,be,ne,U,s,!1).labelArray;ja(e,f,V),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,a,f,y,L,N,Z,void 0,void 0,void 0,T,u,e,K,se,$.dimensionList,k,fe,$.formattedDimensionListMap,m,z,s))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},pr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.StackLineChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=n.DimensionList,E=(mt(n.ChartData,n.DimensionList)||[]).reverse(),b=!!e.swapAxis?.swapAxisEnabled,U=new Map,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye=[],We=0,be=2,ze=!1,ke=0,Se=[],oe=[];const $=!1;let R={dimensionList:A,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{ae()}catch(C){me("StackLinechart","createStackLineChart",C)}},[e]);const ae=()=>{({formatOptions:e,svg:T,width:s,height:d}=Ft(S,e)),_(),{formatOptions:e,dataTableLegendsList:Se}=ea(e,E,n.DataTableData??[]),{maxNumberForPrimaryAxis:X,maxNumberForSecondaryAxis:M}=Rt(e,R.yMinLeft,R.yMaxLeft,R.yMinRight,R.yMaxRight),{margin:z,yLabel:K,xLabel:ye,yTitle:se,xTitle:te,dimensionHeightWidthArray:xe,chartTitleHeight:ge,secondaryAxisTitleWidth:pe,legendMargin:he,secondaryYLabel:O,visibleBars:be,columnWidth:ke,scrollbarVisible:ze}=Mt(s,d,X,M,R.yMaxLeft,e,R.legendList,R.dimensionList,R.yMaxRight,Y,$,t,b,R,Se),ue(z),{dataTable:i,dataTableHeight:y}=ia(e,K,se,E,R.dimensionList,n),b&&(i=[],y=0),St(T,s,d,e),a=wt(T,z),kt(a,e,y,h,k,u,m),G(),ee(),b?ra(e,a,K,k,h,Le):Zt(a,e,y,K,Re,k),Dt(e,b,T,z,ye,d,te,R.chartType,K,h,k),Vt(k,e,y,b,T,z,se,K,h),Gt(T,Y,z,e,y,k,h,O,pe,b),Nt(T,e,s,ge),It(d,T,xe,ge,s,he,e,[...E].reverse(),m,y,z,ct.line,u,l),_t(E,d,s,T,z,h,ze,be,R,We,!1,P,b),ii(U,b?Me:ne,b?J:f,z,pt,[],e,u,d,s,T,o,b)},_=()=>{const C=[],re=[];e.plotArea.hideZeroValues&&(R.hideZeroValues=!0),E.forEach((De,$e)=>{const Fe=`${$e}~$~${De.properties.alias?De.properties.alias:De.legend}`;De.properties.legend=Fe,re.push(Fe);for(const _e of De.data)C.push(_e)}),R.chartData=C,R.legendList=re,Ye=JSON.parse(JSON.stringify(E));let j=Lt(R.dimensionList,E,$);e.plotArea.fitChart?Pe=R.dimensionList:(Pe=R.dimensionList.slice(We,We+be),Ye.forEach((De,$e)=>Ye[$e].data=De.data.filter(Fe=>Pe.includes(Fe.dimension))));const ie=v.stack().keys(R.legendList).offset(v.stackOffsetDiverging)(j);V();let we=1/0,de=-1/0;for(const De of ie)for(const[$e,Fe]of De)we=Math.min(we,$e),de=Math.max(de,Fe);R.yMinLeft=we>0?0:we,R.yMaxLeft=de;let Ae=t?Tt(e.xAxisLabel.xAxisNumberFormat,R.dimensionList).map(De=>De):R.dimensionList;R.dimensionList.forEach((De,$e)=>{R.formattedDimensionListMap.set(De,Ae[$e])})},G=()=>{let C=yt(I||R.yMaxLeft,R.yMinLeft,k,e,R,H,I,b,h).yAxisLabelArray;R.yMaxLeft=C[C.length-1],R.yMinLeft=C[0];const re=b?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const j=v.scaleLinear().domain([R.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:R.yMinLeft<0?R.yMinLeft*1.1:R.yMinLeft*.9,R.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:R.yMaxLeft*1.1]).range(re);b?J=j:f=j}if(Z=b?[k,0]:[0,h],!b&&e.seriesLabel.seriesLabelVisibility){let j=la(h,f,e,Ye,void 0,Y,k,!0);j.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(fe=j.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Z=[0,h-j.heightWidth[0]]:Z=[j.heightWidth[0],h]}Q()},Q=()=>{const C=v.scalePoint().domain(Pe).range(Z).padding(.5);b?Me=C:ne=C},ee=()=>{F();{let C=yt(I||R.yMaxLeft,R.yMinLeft,k,e,R,H,I,b,h);b?Le=v.axisBottom(J).tickFormat(re=>Xe(re,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):Re=v.axisLeft(f).tickFormat(re=>Xe(re,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,h,fe)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?ve=v.axisLeft(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Pe,k,e)):Te=v.axisBottom(ne).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(gt(Pe,h,e))},q=C=>{C.forEach(de=>{de.data.forEach(Ae=>{Ae.hideZero=de.properties.hideZeroValues,Ae.axis=de.properties.axis})});const re=b?v.line().y(de=>{const Ae=Me(de.data.dimension);return Ae??0}).x(de=>de[1]>0?J(de[1]):J(de[0])).defined(de=>{const Ae=de;return Ae.hideZero||R.hideZeroValues?Ae.data[Ae.key]:!0}).curve(ft(e)):v.line().x(de=>{const Ae=ne(de.data.dimension);return Ae??0}).y(de=>de[1]>0?f(de[1]):f(de[0])).defined(de=>{const Ae=de;return Ae.hideZero||R.hideZeroValues?Ae.data[Ae.key]:!0}).curve(ft(e));let j=a.selectAll(".parentGroup").data([oe]);j=j.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(j);let ie=j.selectAll(".line-group").data(de=>de);const we=ie.enter().append("g").attr("class",de=>"line-group "+de.key.replace(/ /g,"-"));we.append("path").attr("class","line").attr("fill","none"),we.merge(ie).each(function(de,Ae){const De=v.select(this),$e=De.selectAll("path.visibleLine").data([de]).join("path").attr("class","visibleLine").attr("hoverId",it=>(E[Ae]?.properties?.alias||E[Ae]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",re(de)).attr("stroke",de.color!==Ie.white?de.color:"none").attr("stroke-dasharray",it=>{const nt=parseInt(E[Ae].properties.lineWidth.toString());switch(E[Ae].properties.lineStyle){case bt.dotted:return`0,${nt+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",E[Ae].properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",E[Ae].properties.lineStyle!==bt.none?E[Ae].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,E[Ae].properties.legendUniqueId).attr(lt.DimValue,E[Ae].properties.alias||E[Ae].properties.name||"").on("click",vt(W,g,()=>({seriesId:E[Ae].properties.legendUniqueId,dimValue:E[Ae].properties.alias||E[Ae].properties.name||"",legendUniqueId:E[Ae].properties.legendUniqueId,seriesDisplayName:E[Ae].properties.alias||E[Ae].properties.name||""}))),Fe=e.animation.animationEnabled,_e=$e.node().getTotalLength();Fe?$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",_e).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",0),De.selectAll("path.hoverLine").data([de]).join("path").attr("class","hoverLine").attr("d",re(de)).attr("stroke",Ie.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="'+mi(E[Ae].properties.alias||E[Ae].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),ie.exit().remove(),Va(j,C,u,b?Me:ne,b?J:f,b?Ee:N,null,e,R,w,D,H,I,!1,p,b)},ue=C=>{h=s-C.left-C.right,k=d-C.bottom-C.top},B=()=>{if(Q(),F(),b?na(e,a,ye,k,h,ve,Ue,J,R.yMaxLeft,Pe,u,t,s,xe,ke,Me):ta(a,R,ye,e,y,f,Te,xe,d,L,t,h,k,Pe,ne),V(),q(Ye),Ya(oe,b?Me:ne,b?J:f,b?Ee:N,z,pt,[],[],e,u,d,s,h,Pe,k,m,T,x,y,o,b),!b){let C=la(h,f,e,Ye,void 0,Y,k,!0).labelArray;ja(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,T,a,i,L,f,ne,void 0,void 0,void 0,y,le.LineChart,e,K,se,R.dimensionList,h,Z,R.formattedDimensionListMap,m,z,k))}},V=()=>{let C=Lt(Pe,Ye,$);oe=v.stack().keys(R.legendList).offset(v.stackOffsetDiverging)(C),Ye.forEach((j,ie)=>j.data.forEach((we,de)=>{we[0]=oe[ie][de][0],we[1]=oe[ie][de][1]}));let re=e.annotation.annotationSetLabelColor;oe.forEach((j,ie)=>j.forEach(we=>{we.key=j.key,j.color=JSON.parse(JSON.stringify(E[ie].properties.color)),j.individualAnnotationVisibility=JSON.parse(JSON.stringify(E[ie].properties.individualAnnotationVisibility)),we.data.labelPosition=E[ie].properties.dataLabelPosition,we.data.labelColor=re=="2"?JSON.parse(JSON.stringify(E[ie].properties.color)):E[ie].properties.labelColor,we.hideZero=JSON.parse(JSON.stringify(E[ie].properties.hideZeroValues)),we.properties=E[ie].properties}))},P=(C,re,j)=>{Ye=re,Pe=C,be=j,li(n,U,Pe),B()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},br=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.NormalizedStackLineChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse()||[],E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe=[],Ye=0,We,be=0,ze=!1,ke=[],Se=[];const oe=!0;let $={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(C){me("NormalizedLinechart","createNormalizedLinechart",C)}},[e]);const R=()=>{({formatOptions:e,svg:y,width:k,height:s}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:ke}=ea(e,A,n.DataTableData??[]),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:We,columnWidth:be,scrollbarVisible:ze}=Mt(k,s,O,X,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,oe,t,b,$,ke),ue(w),{dataTable:d,dataTableHeight:i}=ia(e,z,ye,A,$.dimensionList,n),b&&(d=[],i=0),St(y,k,s,e),T=wt(y,w),kt(T,e,i,M,h,u,m),_(),ee(),b?ra(e,T,z,h,M,Ee):Zt(T,e,i,z,fe,h),Dt(e,b,y,w,K,s,se,$.chartType,z,M,h),Vt(h,e,i,b,y,w,ye,z,M),Gt(y,U,w,e,i,h,M,he,ge,b),Nt(y,e,k,xe),It(s,y,te,xe,k,pe,e,[...A].reverse(),m,i,w,ct.line,u,l),_t(A,s,k,y,w,M,ze,We,$,Ye,!1,B,b)},ae=()=>{const C=[],re=[];e.plotArea.hideZeroValues&&($.hideZeroValues=!0,A.forEach(Ae=>{Ae.data=Ae.data.filter(De=>De.value!==0)})),A.forEach((Ae,De)=>{const $e=`${De}~$~${Ae.properties.legend}`;Ae.properties.legend=$e,re.push($e);for(const Fe of Ae.data)C.push(Fe)}),$.chartData=C,$.legendList=re,Pe=JSON.parse(JSON.stringify(A)),ve=$.dimensionList;const j=Lt($.dimensionList,A,oe),ie=v.stack().keys($.legendList).offset(v.stackOffsetDiverging)(j);P();let we=1/0;for(const Ae of ie)for(const[De]of Ae)we=Math.min(we,De);$.yMinLeft=we>0?0:we,$.yMaxLeft=1;const de=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(Ae=>Ae):$.dimensionList;$.formattedDimensionListMap=new Map($.dimensionList.map((Ae,De)=>[Ae,de[De]]))},_=()=>{const C=b?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const re=v.scaleLinear().domain([$.yMinLeft<0?-1:0,1]).range(C);b?Me=re:a=re}if(ne=b?[h,0]:[0,M],!b&&e.seriesLabel.seriesLabelVisibility){Q(Se,Pe);let re=la(M,a,e,Pe,void 0,U,h,!0);re.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Z=re.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ne=[0,M-re.heightWidth[0]]:ne=[re.heightWidth[0],M]}},G=()=>{const C=v.scalePoint().domain(ve).range(ne).padding(.5);b?Te=C:N=C};function Q(C,re){C.forEach((j,ie)=>j.forEach((we,de)=>{re[ie]&&re[ie].data[de]&&(re[ie].data[de][0]=we[0]=we.data.total===0?0:we[0]/we.data.total,re[ie].data[de][1]=we[1]=we.data.total===0?0:we[1]/we.data.total)}))}const ee=()=>{{const C=e.yAxisLabel.yAxisTicksMode===wa.custom,re=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0,j=C?za($.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null;b?Ee=v.axisBottom(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).tickValues(j).tickFormat(v.format(`.${re}%`)).ticks(i>0?(M-i)/80:M/80).tickPadding(8).tickSizeOuter(0):fe=v.axisLeft(a).tickSize(zt(e,M,Z)).tickValues(j).tickFormat(v.format(`.${re}%`)).ticks(i>0?(h-i)/80:h/80).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?Ue=v.axisLeft(Te).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(ve,h,e)):Re=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(gt(ve,M,e))},q=C=>{Q(Se,Pe),C.forEach(de=>{de.data.forEach(Ae=>{Ae.hideZero=de.properties.hideZeroValues,Ae.axis=de.properties.axis})});const re=b?v.line().y(de=>{const Ae=Te(de.data.dimension);return Ae??0}).x(de=>de[1]>0?Me(de[1]):Me(de[0])).curve(ft(e)):v.line().x(de=>N(de.data.dimension)?N(de.data.dimension):null).y(de=>de[1]>0?a(de[1]):a(de[0])).curve(ft(e));let j=T.selectAll(".parentGroup").data([Se]);j=j.enter().append("g").attr("class","lines parentGroup").merge(j);let ie=j.selectAll(".line-group").data(de=>de),we=ie.enter().append("g").attr("class",de=>"line-group "+de.key.replace(/ /g,"-"));we.attr("hoverId",de=>(C[de.index]?.properties?.alias||C[de.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),we.merge(ie).each(function(de,Ae){const De=v.select(this),$e=De.selectAll("path.visibleLine").data([de]).join("path").attr("class","visibleLine").attr("d",re(de)).attr("stroke",de.color!==Ie.white?de.color:"none").attr("stroke-dasharray",it=>{const nt=parseInt(A[Ae].properties.lineWidth.toString());switch(A[Ae].properties.lineStyle){case bt.dotted:return`0,${nt+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",A[Ae].properties.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",A[Ae].properties.lineStyle!==bt.none?A[Ae].properties.lineWidth:0).attr("fill","none").attr(lt.SeriesId,A[Ae].properties.legendUniqueId).attr(lt.DimValue,A[Ae].properties.alias||A[Ae].properties.name||"").on("click",vt(W,g,()=>({seriesId:A[Ae].properties.legendUniqueId,dimValue:A[Ae].properties.alias||A[Ae].properties.name||"",legendUniqueId:A[Ae].properties.legendUniqueId,seriesDisplayName:A[Ae].properties.alias||A[Ae].properties.name||""}))),Fe=e.animation.animationEnabled,_e=$e.node().getTotalLength();Fe?$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",_e).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("stroke-dashoffset",0):$e.attr("stroke-dasharray",_e+" "+_e).attr("stroke-dashoffset",0),De.selectAll("path.hoverLine").data([de]).join("path").attr("class","hoverLine").attr("d",re(de)).attr("stroke",Ie.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(it,nt){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),y.selectAll('[hoverId="'+mi(C[nt.index]?.properties?.alias||C[nt.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(it,nt){y.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),y.selectAll('[hoverId="'+mi(C[nt.index]?.properties?.alias||nt[nt.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),ie.exit().remove(),Va(j,C,u,b?Te:N,b?Me:a,b?J:f,null,e,$,D,I,Y,H,!0,p,b)},ue=C=>{M=k-C.left-C.right,h=s-C.bottom-C.top},B=(C,re,j)=>{Pe=re,ve=C,We=j,V()},V=()=>{if(G(),P(),F(),b?na(e,T,K,h,M,Ue,Le,Me,$.yMaxLeft,ve,u,t,k,te,be,Te):ta(T,$,K,e,i,a,Re,te,s,L,t,M,h,ve,N),q(Pe),Ya(Se,b?Te:N,b?Me:a,b?J:f,w,pt,[],[],e,u,s,k,M,ve,h,m,y,x,i,o,b),!b){let C=la(M,a,e,Pe,void 0,U,h,!0).labelArray;ja(e,T,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,le.LineChart,e,z,ye,$.dimensionList,M,ne,$.formattedDimensionListMap,m,w,h))}},P=()=>{let C=Lt(ve,Pe,oe);Se=v.stack().keys($.legendList).offset(v.stackOffsetDiverging)(C),Pe.forEach((j,ie)=>j.data.forEach((we,de)=>{we[0]=Se[ie][de][0],we[1]=Se[ie][de][1]}));let re=e.annotation.annotationSetLabelColor;Se.forEach((j,ie)=>j.forEach(we=>{we.key=j.key,j.color=JSON.parse(JSON.stringify(A[ie].properties.color)),we.data.labelPosition=A[ie].properties.dataLabelPosition,we.data.labelColor=re=="2"?JSON.parse(JSON.stringify(A[ie].properties.color)):A[ie].properties.labelColor,we.hideZero=JSON.parse(JSON.stringify(A[ie].properties.hideZeroValues)),we.properties=A[ie].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},gr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let L=0;const u=le.HorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(c);g.current=c;const W=Ce.useRef(p);W.current=p;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!0;let U=!1;const Y=!1,H=new Map;let I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,z=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k=new Map,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le=[],Ue=0,ve=2,Pe=!1,Ye={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{We()}catch(G){me("HorizontalBarchart","createHorizontalBarChart",G)}},[e]);const We=()=>{({formatOptions:e,svg:a,width:i,height:y}=Ft(S,e)),be(),{maxNumberForPrimaryAxis:M,maxNumberForSecondaryAxis:h,customYaxisMaxValue:D,secondaryCustomYaxisMaxValue:z}=Rt(e,Ye.yMinLeft,Ye.yMaxLeft,Ye.yMinRight,Ye.yMaxRight),{margin:K,yLabel:ye,xLabel:se,yTitle:te,xTitle:xe,dimensionHeightWidthArray:ge,chartTitleHeight:pe,secondaryAxisTitleWidth:he,legendMargin:O,secondaryYLabel:X,visibleBars:ve,columnWidth:L,scrollbarVisible:Pe}=Mt(i,y,M,h,Ye.yMaxLeft,e,Ye.legendList,Ye.dimensionList,Ye.yMaxRight,U,Y,t,b,Ye),R(K),St(a,i,y,e),f=wt(a,K),kt(f,e,T,s,d,u,m),ze(),Se(),ra(e,f,ye,d,s,Te),U&&Ai(e,f,X,Me,s),Dt(e,b,a,K,se,y,xe,Ye.chartType,ye,s,d),Vt(d,e,T,b,a,K,te,ye,s),Gt(a,U,K,e,T,d,s,X,he,b),Nt(a,e,i,pe),It(y,a,ge,pe,i,O,e,A,m,T,K,ct.rectangle,u,l),_t(A,y,i,a,K,s,Pe,ve,Ye,Ue,!1,ae,b)},be=()=>{const G=[],Q=[];let ee=[],F=-1/0,q=1/0,ue=-1/0,B=1/0,V=1/0,P=-1/0;A.forEach(C=>{Q.push(C.properties.legendUniqueId),P=-1/0,V=1/0,C.data.forEach(re=>{G.push(re),C.properties.axis==="Secondary"?(U=!0,ue=Math.max(ue,re.value),B=Math.min(B,re.value)):(F=Math.max(F,re.value),q=Math.min(q,re.value)),P=Math.max(P,re.value),V=Math.min(V,re.value)}),C.properties.setColorScale&&H.set(C.properties.legendUniqueId,v.scaleSequential().domain([V,P]).interpolator(yi.interpolateRgb(C.properties.startColor,C.properties.endColor)))}),Ye.chartData=G,Ye.legendList=Q,Ye.yMaxLeft=F,Ye.yMinLeft=q>0?0:q,Ye.yMaxRight=ue,Ye.yMinRight=B>0?0:B,ee=t?Tt(e.xAxisLabel.xAxisNumberFormat,Ye.dimensionList).map(C=>C):Ye.dimensionList,Ye.dimensionList.forEach((C,re)=>{Ye.formattedDimensionListMap.set(C,ee[re])}),Le=JSON.parse(JSON.stringify(A)),Ee=Ye.dimensionList,e.plotArea.hideZeroValues&&(Ye.hideZeroValues=!0)},ze=()=>{let G=yt(Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,I,D,b,s).yAxisLabelArray;Ye.yMaxLeft=G[G.length-1],Ye.yMinLeft=G[0],Z=v.scaleLinear().domain([Ye.yMinLeft>=0?I!==void 0&&!Number.isNaN(I)?I: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,s]),U&&(fe=v.scaleLinear().domain([Ye.yMinRight>=0?(w||w==0)&&!Number.isNaN(w)?w:0:(w||w==0)&&!Number.isNaN(w)?w:Ye.yMinRight*1.1,Ye.yMaxRight<=0?z||0:z||Ye.yMaxRight*1.1]).range([0,s])),Re=[d,0]},ke=()=>{ne=v.scaleBand().domain(Ye.legendList).range([0,L]).paddingInner(Ye.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),N=v.scalePoint().domain(Ee).range(Re).padding(.5)},Se=()=>{{let G=yt(D||Ye.yMaxLeft,Ye.yMinLeft,d,e,Ye,I,D,b,s);Te=v.axisBottom(Z).tickFormat(Q=>Xe(Q,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(G.autoLabelFlag?void 0:G.yAxisLabelArray).ticks(G.customTickValue).tickPadding(8).tickSizeOuter(0)}if(U){let G=yt(z||Ye.yMaxRight,w||Ye.yMinRight,d,e,Ye,w,z);Me=v.axisTop(fe).tickFormat(Q=>Xe(Q,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(G.autoLabelFlag?void 0:G.yAxisLabelArray).ticks(G.customTickValue).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0)}},oe=()=>{J=v.axisLeft(N).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*s*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Ee,d,e))},$=G=>{G.forEach(Q=>{Q.data.forEach(ee=>{ee.hideZero=Q.properties.hideZeroValues,ee.axis=Q.properties.axis,ee.legendUniqueId=Q.properties.legendUniqueId})}),Ee.forEach(Q=>{f.append("rect").attr("id",`dim-background-${Q}`).attr("class","dimension-background").attr("y",N(Q)-L/2).attr("height",L).attr("x",0).attr("width",s).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),G.forEach(Q=>{let ee=f.selectAll(".parentGroup").data([Q],V=>V.properties.legendUniqueId);ee=ee.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(ee);let F=ee.selectAll(".column-group").data(Q.data.map(V=>({...V,properties:Q.properties})),V=>V.legend+V.dimension),q=F.enter().append("g").attr("class","column-group").attr("hoverId",(Q.properties.alias||Q.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",V=>`translate(0, ${N(V.dimension)-L/2})`);F.attr("transform",V=>`translate(0, ${N(V.dimension)-L/2})`),q.merge(F).attr("transform",V=>`translate(0, ${N(V.dimension)-L/2})`);const ue=q.append("rect").attr("y",V=>ne(V.legendUniqueId)).attr("height",ne.bandwidth()).attr("x",V=>{const P=Q.properties.axis===Qe.primary?Z:fe;return V.value>=0,P(0)}).attr("width",0).attr("fill",V=>H.get(Q.properties.legendUniqueId)?.(V.value)??Q.properties.color).attr("stroke-dasharray",V=>V.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",V=>`${V.properties.stackBorderWidth}px`).attr("stroke",V=>Q.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?Q.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",V=>V.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>Q.properties.legendUniqueId).attr(lt.DimValue,V=>Array.isArray(V.dimension)?String(V.dimension[0]):String(V.dimension));(e.animation.animationEnabled?ue.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ue).attr("x",V=>{const P=Q.properties.axis===Qe.primary?Z:fe;return V.value>=0?P(0):P(V.value)}).attr("width",V=>{const P=Q.properties.axis===Qe.primary?Z:fe,C=Q.properties.axis===Qe.primary?D:z;return V.value>=0?C&&V.value>C?P(C)-P(0):P(V.value)-P(0):Math.abs(P(0)-P(V.value))}),q.merge(F).on("mousemove",(V,P)=>{(Q.properties.alias||Q.properties.name||"Legend").replace(/ /g,"-");const C=Array.isArray(P.dimension)?P.dimension[0]:P.dimension,re=String(Ye.formattedDimensionListMap.get(C)??C??""),j=At(r,String(C??""),{...Q.properties,formattedDimensionValue:re});ut([{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(P.dimension)?P.dimension[0]:P.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():P.properties?.currentMeasure?P.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||P.value,value:Xe([le.NormalizedStackLineChart,le.NormalizedStackAreaChart,""].includes(u)?P[1]-P[0]:P.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:P.properties.alias}],e,V,Q.properties,j)}).on("mouseout",(V,P)=>{(Q.properties.alias||Q.properties.name||"Legend").replace(/ /g,"-"),ot()}).on("click",vt(W,g,(V,P)=>({seriesId:Q.properties.legendUniqueId,dimValue:Array.isArray(P.dimension)?String(P.dimension[0]):String(P.dimension),legendUniqueId:Q.properties.legendUniqueId,seriesDisplayName:Q.properties.alias||Q.properties.name||""}))),F.exit().remove()}),f.selectAll(".parentGroup").raise()},R=G=>{s=i-G.left-G.right,d=y-G.bottom-G.top},ae=(G,Q,ee)=>{Le=Q,Ee=G,ve=ee,li(n,k,Ee),e.xAxisLabel.hideZeroValues&&(Ee=Ee.filter(F=>k.get(F)!==0)),_()},_=()=>{ke(),oe(),na(e,f,se,d,s,J,Me,Z,Ye.yMaxLeft,Ee,u,t,i,ge,L,N),$(Le),$a(Le,N,Z,fe,K,pt,[],[],e,u,y,i,s,Ee,d,m,a,x,ne,L,o,!1,b)};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ar=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.StackHorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse(),E=n.DimensionList,b=!0,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,w,z,K,ye,se,te,xe,ge,pe,he;const O=new Map;let X,M,h,k,s,d,i,y,T,a,f,N,ne=[],Z=0,fe=2,Re=!1,Te=[];const Me=!1;let J=new Map,Ee={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Le()}catch(_){me("StackStackHorizontalBarchart","createStackHorizontalBarChart",_)}},[e]);const Le=()=>{({formatOptions:e,svg:s,width:h,height:k}=Ft(S,e)),Ue(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:he}=Rt(e,Ee.yMinLeft,Ee.yMaxLeft,Ee.yMinRight,Ee.yMaxRight),{margin:I,yLabel:D,xLabel:w,yTitle:z,xTitle:K,dimensionHeightWidthArray:ye,chartTitleHeight:se,secondaryAxisTitleWidth:te,legendMargin:xe,secondaryYLabel:ge,visibleBars:fe,columnWidth:L,scrollbarVisible:Re}=Mt(h,k,pe,he,Ee.yMaxLeft,e,Ee.legendList,Ee.dimensionList,Ee.yMaxRight,U,Me,t,b,Ee),ze(I),St(s,h,k,e),d=wt(s,I),kt(d,e,0,X,M,u,m),ve(),Ye(),ra(e,d,D,M,X,a),Dt(e,b,s,I,w,k,K,Ee.chartType,D,X,M),Vt(M,e,0,b,s,I,z,D,h),Nt(s,e,h,se),It(k,s,ye,se,h,xe,e,[...A].reverse(),m,0,I,ct.rectangle,u,l),_t(A,k,h,s,I,X,Re,fe,Ee,Z,!1,ke,b)},Ue=()=>{const _=[],G=[];let Q=-1/0,ee=1/0;A.forEach((P,C)=>{const re=`${C}~$~${P.properties.legend}`;P.properties.legend=re,G.push(re),Q=-1/0,ee=1/0;for(const j of P.data)Q=Math.max(Q,j.value),ee=Math.min(ee,j.value),_.push(j);P.properties.setColorScale&&O.set(P.properties.legendUniqueId,v.scaleSequential().domain([ee,Q]).interpolator(v.interpolateRgb(P.properties.startColor,P.properties.endColor)))}),Ee.chartData=_,Ee.legendList=G,ne=JSON.parse(JSON.stringify(A));let F=Lt(Ee.dimensionList,A,Me);e.plotArea.fitChart?N=Ee.dimensionList:(N=Ee.dimensionList.slice(Z,Z+fe),ne.forEach((P,C)=>ne[C].data=P.data.filter(re=>N.includes(re.dimension))));const q=v.stack().keys(Ee.legendList).offset(v.stackOffsetDiverging)(F);oe();let ue=1/0,B=-1/0;for(const P of q)for(const[C,re]of P)ue=Math.min(ue,C),B=Math.max(B,re);Ee.yMinLeft=ue>0?0:ue,Ee.yMaxLeft=B;let V=t?Tt(e.xAxisLabel.xAxisNumberFormat,Ee.dimensionList).map(P=>P):Ee.dimensionList;Ee.dimensionList.forEach((P,C)=>{Ee.formattedDimensionListMap.set(P,V[C])}),e.plotArea.hideZeroValues&&(Ee.hideZeroValues=!0)},ve=()=>{let _=yt(Ee.yMaxLeft,Ee.yMinLeft,M,e,Ee,Y,H,b,X).yAxisLabelArray;Ee.yMaxLeft=_[_.length-1],Ee.yMinLeft=_[0],i=v.scaleLinear().domain([Ee.yMinLeft>=0?Y!==void 0&&!Number.isNaN(Y)?Y:0:Ee.yMinLeft<0?Ee.yMinLeft*1.1:Ee.yMinLeft*.9,Ee.yMaxLeft<=0?0:H!==void 0&&!Number.isNaN(H)?H:Ee.yMaxLeft*1.1]).range([0,X]),T=[M,0]},Pe=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Ye=()=>{{let _=yt(H||Ee.yMaxLeft,Ee.yMinLeft,M,e,Ee,Y,H,b,X);a=v.axisBottom(i).tickFormat(G=>Xe(G,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-M:0).tickValues(_.autoLabelFlag?void 0:_.yAxisLabelArray).ticks(_.customTickValue).tickPadding(8).tickSizeOuter(0)}},We=()=>{f=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*X*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(N,M,e))},be=_=>{_.forEach(V=>{V.data.forEach(P=>{P.hideZero=V.properties.hideZeroValues,P.axis=V.properties.axis})}),N.forEach(V=>{d.append("rect").attr("id",`dim-background-${V}`).attr("class","dimension-background").attr("y",y(V)-L/2).attr("height",L).attr("x",0).attr("width",X).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let G=d.selectAll(".parentGroup").data([Te]);G=G.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(G);let Q=G.selectAll(".column-group").data(V=>V);Q=Q.enter().append("g").attr("class",V=>"column-group "+V.key.replace(/ /g,"-")).attr("hoverId",V=>(_[V.index].properties.alias||_[V.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(Q);let F=Q.selectAll("rect").data(V=>V);const q=(V,P)=>{const C=Array.from(Q.nodes()).indexOf(V[P].parentNode);return{props:A[C]?.properties,groupIndex:C}},ue=F.enter().append("rect").merge(F).attr("y",V=>y(V.data.dimension)-L/2).attr("height",L).attr("fill",(V,P,C)=>{const{props:re}=q(C,P);return O.get(re.legendUniqueId)?.(V.data[V.key])??re?.color??"gray"}).attr("stroke",(V,P,C)=>{const re=q(C,P).props;return re?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?re.stackBorderColor:"none"}).attr("stroke-dasharray",(V,P,C)=>q(C,P).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(V,P,C)=>(q(C,P).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",V=>Math.min(i(V[0]),i(V[1]))).attr("width",0).attr("visibility",(V,P,C)=>{const re=q(C,P).props;return V.data[V.key]===0&&re?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,V=>V.key??"").attr(lt.DimValue,V=>Array.isArray(V.data.dimension)?String(V.data.dimension[0]):String(V.data.dimension)).on("mousemove",(V,P)=>{const C=P.data.dimension;ut([{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:Ee.formattedDimensionListMap.get(C)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():P.properties?.currentMeasure?P.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||P.value,value:Xe(P.data[P.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:P.properties.alias}],e,V,P.properties,At(p,String(C??""),{...P.properties,formattedDimensionValue:String(Ee.formattedDimensionListMap.get(C)??C??"")}))}).on("mouseout",(V,P)=>{P.data.dimension,ot()}).on("click",vt(W,g,(V,P)=>({seriesId:P.key,dimValue:Array.isArray(P.data.dimension)?String(P.data.dimension[0]):String(P.data.dimension),legendUniqueId:P.key,seriesDisplayName:P.properties?.alias||P.properties?.name||""})));ue.attr("x",V=>i(0)),(e.animation.animationEnabled?ue.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ue).attr("x",V=>Math.min(i(V[0]),i(V[1]))).attr("width",V=>Math.abs(i(V[1])-i(V[0]))),Q.exit().remove(),d.selectAll(".parentGroup").raise()},ze=_=>{X=h-_.left-_.right,M=k-_.bottom-_.top},ke=(_,G,Q)=>{ne=G,N=_,fe=Q,li(n,J,N),oe(),Se()},Se=()=>{Pe(),We(),na(e,d,w,M,X,f,void 0,i,Ee.yMaxLeft,N,u,t,h,ye,L,y);const _=new Map;N.forEach((G,Q)=>{let ee=0;Te.forEach(F=>{const q=F[Q]?.[0]??0;q<ee&&(ee=q)}),_.set(G,ee)}),be(ne),Ya(Te,y,i,void 0,I,pt,[],[],e,u,k,h,X,N,M,m,s,x,0,o,b),ii(J,y,i,I,pt,[],e,u,k,h,s,o,b,_),$(),d.selectAll(".connectors").raise()},oe=()=>{let _=Lt(N,ne,Me);Te=v.stack().keys(Ee.legendList).offset(v.stackOffsetDiverging)(_),ne.forEach((Q,ee)=>Q.data.forEach((F,q)=>{F[0]=Te[ee][q][0],F[1]=Te[ee][q][1]}));let G=e.annotation.annotationSetLabelColor;Te.forEach((Q,ee)=>Q.forEach(F=>{F.key=Q.key,Q.color=JSON.parse(JSON.stringify(A[ee].properties.color)),F.data.labelPosition=A[ee].properties.dataLabelPosition,F.data.labelColor=G=="2"?JSON.parse(JSON.stringify(A[ee].properties.color)):A[ee].properties.labelColor,F.hideZero=JSON.parse(JSON.stringify(A[ee].properties.hideZeroValues)),F.properties=A[ee].properties}))},$=()=>{try{const _=Number(e.connector?.connectorVisibility);if(!e.connector||_===2)return;const G=[],Q=[],ee=[];let F;const q=[];if(_===1)F=1;else if(_===3){const j=Number(e.connector.connectorFollow);j===1?F=Number(e.connector.connectorStepSize):j===2&&((e.connector.connectorExclude||[]).forEach(ie=>ee.push(ie)),F=1)}const ue=[],B=[],V=[],P=e.connector?.connectorCustomRange||[];ee.forEach(j=>{const ie=j.split("-");ie.length&&ue.push(ie[0])});const re=(Te?.[0]||[]).map((j,ie)=>({Dimension:j.data.dimension,Total:j.data.total,CustomTotal:j.data.total-(V[ie]??0),Index:ie}));if(F!=null){for(let j=0;j<re.length;j++)(F===1||j%F===0&&F!==1)&&G.push(re[j]);for(let j=F;j<re.length;j+=F){const ie=Math.min(j+F,re.length);let we=-1/0;for(let de=j;de<ie;de++)re[de].Total>we&&(we=re[de].Total);we!==-1/0&&q.push(we)}for(let j=1;j<G.length;j++)Q.push(G[j])}else{const j=[];(P||[]).forEach(ie=>{if(ie?.from&&ie?.to){const we=re.some(Ae=>Ae.Dimension===ie.from),de=re.some(Ae=>Ae.Dimension===ie.to);we&&de&&j.push({from:ie.from,to:ie.to})}}),j.forEach(ie=>{const we=re.findIndex(Ae=>Ae.Dimension===ie.from),de=re.findIndex(Ae=>Ae.Dimension===ie.to);if(we>=0&&de>=0){const Ae=Math.min(we,de),De=Math.max(we,de);G.push(re[Ae]);let $e=re[Ae]?.Total??-1/0;for(let Fe=Ae;Fe<=De;Fe++)re[Fe].Total>$e&&($e=re[Fe].Total);$e!==-1/0&&q.push($e),Q.push(re[De])}})}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!==Ie.white?e.connector.connectorMarkerColor:"none"),R(G,q,Q,F,ue),ae(G,q,Q,F,ue)}catch(_){console.error(_)}},R=(_,G,Q,ee,F)=>{try{const q=y.bandwidth()??0,ue=d.selectAll(".connector-paths").data([0]),B=ue.enter().append("g").attr("class","connector-paths connectors").merge(ue),V=_.filter((re,j)=>ee!=null?j<_.length-1:j<_.length),P=B.selectAll("path.connector-path").data(V,(re,j)=>re?.Dimension??j);P.exit().remove(),P.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(P).attr("d",(re,j)=>{const ie=Q?.[j]??{Total:0,Dimension:re.Dimension},we=re?.Total??0,de=typeof ie.Total=="number"?i(ie.Total):0,Ae=typeof we=="number"?i(we):0,De=Math.max(de,Ae);return e.total.totalVisibility?`M ${Ae+50},
74
- ${y(re.Dimension)+q/2-5}
75
- H ${60+De}
76
- V ${y(ie.Dimension)+q/2+5}
77
- H ${30+de}`:`M ${Ae+30},
78
- ${y(re.Dimension)+q/2-5}
79
- H ${45+De}
80
- V ${y(ie.Dimension)+q/2+5}
81
- H ${10+de}`}).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(re,j)=>F.includes(re.Dimension)||re.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(q){console.error(q)}},ae=(_,G,Q,ee,F)=>{try{const q=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,ue=Di(q,L);let B=e.connector.connectorFontStyle,V=e.connector.connectorNumberFormat,P=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(V=".2s");const C=_.filter((de,Ae)=>ee!=null?Ae<_.length-1:Ae<_.length),re=d.selectAll(".connector-texts").data([0]),ie=re.enter().append("g").attr("class","connector-texts connectors").merge(re).selectAll("text.connector-text").data(C,de=>de?.Dimension??de);ie.exit().remove(),ie.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(ie).attr("y",(de,Ae)=>{const De=Q?.[Ae]??{Dimension:de.Dimension,Total:0},$e=y(de.Dimension)??0;return(y(De.Dimension)??$e)+ee*ue/2}).attr("x",(de,Ae)=>{const De=Q?.[Ae]??{Total:0},$e=de?.Total??0,Fe=Math.max(i(De.Total),i($e));return e.total.totalVisibility?70+Fe:50+Fe}).text((de,Ae)=>{const De=Q?.[Ae]??{Total:0,CustomTotal:0,Dimension:de.Dimension};return de.CustomTotal==0&&De.CustomTotal!=0&&(de.CustomTotal=1),fi(De.Total,de.Total,parseInt(e.connector.connectorDecimalPrecision),V,parseInt(de.Dimension),parseInt(De.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!==Ie.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",B.includes("Italic")?"Italic":"").style("text-decoration",B.includes("Underline")?"Underline":"").style("font-weight",B.includes("Bold")?"Bold":"").style("visibility",(de,Ae)=>F.includes(de.Dimension)||de.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(q){console.error(q)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Lr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.NormalizedStackHorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse(),E=n.DimensionList,b=!0,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h;const k=new Map;let s,d,i,y,T,a,f,N,ne=[],Z=0,fe,Re=!1,Te=[];const Me=!0;let J={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(oe){me("StackNormalizedStackBarchart","createNormalizedStackBarChart",oe)}},[e]);const Ee=()=>{({formatOptions:e,svg:s,width:M,height:h}=Ft(S,e)),Le(),{maxNumberForPrimaryAxis:pe,maxNumberForSecondaryAxis:he}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:I,yLabel:D,xLabel:w,yTitle:z,xTitle:K,dimensionHeightWidthArray:ye,chartTitleHeight:se,secondaryAxisTitleWidth:te,legendMargin:xe,secondaryYLabel:ge,visibleBars:fe,columnWidth:L,scrollbarVisible:Re}=Mt(M,h,pe,he,J.yMaxLeft,e,J.legendList,J.dimensionList,J.yMaxRight,U,Me,t,b,J),be(I),St(s,M,h,e),d=wt(s,I),kt(d,e,0,O,X,u),Ue(),Pe(),ra(e,d,D,X,O,a),Dt(e,b,s,I,w,h,K,J.chartType,D,O,X),Vt(X,e,0,b,s,I,z,D,O),Nt(s,e,M,se),It(h,s,ye,se,M,xe,e,[...A].reverse(),m,0,I,ct.rectangle,u,l),_t(A,h,M,s,I,O,Re,fe,J,Z,!1,Se,b)},Le=()=>{const oe=[],$=[];let R=-1/0,ae=1/0;A.forEach((F,q)=>{const ue=`${q}~$~${F.properties.legend}`;F.properties.legend=ue,$.push(ue),R=-1/0,ae=1/0;for(const B of F.data)R=Math.max(R,B.value),ae=Math.min(ae,B.value),oe.push(B);F.properties.setColorScale&&k.set(F.properties.legendUniqueId,v.scaleSequential().domain([ae,R]).interpolator(v.interpolateRgb(F.properties.startColor,F.properties.endColor)))}),J.chartData=oe,J.legendList=$,ne=JSON.parse(JSON.stringify(A));let _=Lt(J.dimensionList,A,Me);e.plotArea.fitChart?N=J.dimensionList:(N=J.dimensionList.slice(Z,Z+fe),ne.forEach((F,q)=>ne[q].data=F.data.filter(ue=>N.includes(ue.dimension))));const G=v.stack().keys(J.legendList).offset(v.stackOffsetDiverging)(_);ke();let Q=1/0;for(const F of G)for(const[q,ue]of F)Q=Math.min(Q,q);J.yMinLeft=Q>0?0:Q,J.yMaxLeft=1;let ee=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(F=>F):J.dimensionList;J.dimensionList.forEach((F,q)=>{J.formattedDimensionListMap.set(F,ee[q])}),e.plotArea.hideZeroValues&&(J.hideZeroValues=!0)},Ue=()=>{let oe=yt(H||J.yMaxLeft,J.yMinLeft,X,e,J,Y,H,b,O).yAxisLabelArray;J.yMaxLeft=oe[oe.length-1],J.yMinLeft=oe[0],i=v.scaleLinear().domain([J.yMinLeft<0?-1:0,1]).range([0,O]),T=[X,0]},ve=()=>{y=v.scalePoint().domain(N).range(T).padding(.5)},Pe=()=>{{const oe=e.yAxisLabel.yAxisTicksMode===wa.custom,$=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0;a=v.axisBottom(i).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-X:0).tickValues(oe?za(J.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null).tickFormat(v.format(`.${$}%`)).ticks(O/80).tickPadding(8).tickSizeOuter(0)}},Ye=()=>{f=v.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(gt(N,X,e))},We=oe=>{Te.forEach((F,q)=>F.forEach((ue,B)=>{oe[q].data[B][0]=ue[0]=ue.data.total===0?0:ue[0]/ue.data.total,oe[q].data[B][1]=ue[1]=ue.data.total===0?0:ue[1]/ue.data.total})),oe.forEach(F=>{F.data.forEach(q=>{q.hideZero=F.properties.hideZeroValues,q.axis=F.properties.axis})}),N.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 $=d.selectAll(".parentGroup").data([Te]);$=$.enter().append("g").attr("class","columns parentGroup").merge($);let R=$.selectAll(".column-group").data(F=>F);R=R.enter().append("g").attr("class",F=>"column-group "+F.key.replace(/ /g,"-")).attr("hoverId",F=>(oe[F.index].properties.alias||oe[F.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(R);let _=R.selectAll("rect").data(F=>F);const G=(F,q)=>{const ue=Array.from(R.nodes()).indexOf(F[q].parentNode);return{props:A[ue]?.properties,groupIndex:ue}},Q=_.enter().append("rect").merge(_).attr("y",F=>y(F.data.dimension)-L/2).attr("height",L).attr("fill",(F,q,ue)=>{const{props:B}=G(ue,q);return k.get(B.legendUniqueId)?.(F.data[F.key])??B?.color??"gray"}).attr("stroke",(F,q,ue)=>{const B=G(ue,q).props;return B?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?B.stackBorderColor:"none"}).attr("stroke-dasharray",(F,q,ue)=>G(ue,q).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(F,q,ue)=>(G(ue,q).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,q,ue)=>{const B=G(ue,q).props;return F.data[F.key]===0&&B?.hideZeroValues?"hidden":"visible"}).attr(lt.SeriesId,F=>F.key??"").attr(lt.DimValue,F=>Array.isArray(F.data.dimension)?String(F.data.dimension[0]):String(F.data.dimension)).on("mousemove",(F,q)=>{const ue=q.data.dimension;ut([{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.formattedDimensionListMap.get(ue)},{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:Xe(q[1]-q[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:q.properties.alias}],e,F,q.properties,At(p,String(ue??""),{...q.properties,formattedDimensionValue:String(J.formattedDimensionListMap.get(ue)??ue??"")}))}).on("mouseout",(F,q)=>{let ue=(q.properties.alias||q.properties.name||"Legend").replace(/ /g,"-");v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+ue+'"]').classed("highlight",!1).classed("unhighlight",!1),ot()}).on("click",vt(W,g,(F,q)=>({seriesId:q.key,dimValue:Array.isArray(q.data.dimension)?String(q.data.dimension[0]):String(q.data.dimension),legendUniqueId:q.key,seriesDisplayName:q.properties?.alias||q.properties?.name||""})));(e.animation.animationEnabled?Q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Q).attr("x",F=>Math.min(i(F[0]),i(F[1]))).attr("width",F=>Math.abs(i(F[1])-i(F[0]))),R.exit().remove(),d.selectAll(".parentGroup").raise()},be=oe=>{O=M-oe.left-oe.right,X=h-oe.bottom-oe.top},ze=()=>{ve(),Ye(),na(e,d,w,X,O,f,void 0,i,J.yMaxLeft,N,u,t,M,ye,L,y),We(ne),Ya(Te,y,i,void 0,I,pt,[],[],e,u,h,M,O,N,X,m,s,x,0,o,b)},ke=()=>{let oe=Lt(N,ne,Me);Te=v.stack().keys(J.legendList).offset(v.stackOffsetDiverging)(oe),ne.forEach((R,ae)=>R.data.forEach((_,G)=>{_[0]=Te[ae][G][0],_[1]=Te[ae][G][1]}));let $=e.annotation.annotationSetLabelColor;Te.forEach((R,ae)=>R.forEach(_=>{_.key=R.key,R.color=JSON.parse(JSON.stringify(A[ae].properties.color)),_.data.labelPosition=A[ae].properties.dataLabelPosition,_.data.labelColor=$=="2"?JSON.parse(JSON.stringify(A[ae].properties.color)):A[ae].properties.labelColor,_.hideZero=JSON.parse(JSON.stringify(A[ae].properties.hideZeroValues)),_.properties=A[ae].properties}))},Se=(oe,$,R)=>{ne=$,N=oe,fe=R,ke(),ze()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},mr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID();let L=0;const u=le.LayeredHorizontalBarChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!0,U=!1,Y=new Map;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne=[],Z=0,fe=2,Re=!1,Te=[];const Me=!1;let J={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(ae){me("StackStackHorizontalBarchart","createStackHorizontalBarChart",ae)}},[e]);const Ee=()=>{({formatOptions:e,svg:s,width:h,height:k}=Ft(S,e)),Le(),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe,visibleBars:fe,columnWidth:L,scrollbarVisible:Re}=Mt(h,k,he,O,J.yMaxLeft,e,J.legendList,J.dimensionList,J.yMaxRight,U,Me,t,b,J),be(D),St(s,h,k,e),d=wt(s,D),kt(d,e,0,X,M,u,m),Ue(),Pe(),ra(e,d,w,M,X,a),Dt(e,b,s,D,z,k,ye,J.chartType,w,X,M),Vt(M,e,0,b,s,D,K,w),Nt(s,e,h,te),It(k,s,se,te,h,ge,e,A,m,0,D,ct.rectangle,u,l),_t(A,k,h,s,D,X,Re,fe,J,Z,!1,ze,b)},Le=()=>{const ae=[],_=[];let G=[],Q=-1/0,ee=1/0,F=-1/0,q=1/0,ue=-1/0,B=1/0;A.forEach(V=>{_.push(V.properties.legendUniqueId),ue=-1/0,B=1/0,V.data.forEach(P=>{ae.push(P),ue=Math.max(ue,P.value),B=Math.min(B,P.value),Q=Math.max(Q,P.value),ee=Math.min(ee,P.value)}),V.properties.setColorScale&&Y.set(V.properties.legendUniqueId,v.scaleSequential().domain([B,ue]).interpolator(v.interpolateRgb(V.properties.startColor,V.properties.endColor)))}),J.chartData=ae,J.legendList=_,J.yMaxLeft=Q,J.yMinLeft=ee>0?0:ee,J.yMaxRight=F,J.yMinRight=q,G=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(V=>V):J.dimensionList,G=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(V=>V):J.dimensionList,J.dimensionList.forEach((V,P)=>{J.formattedDimensionListMap.set(V,G[P]),J.formattedDimensionListMap.set(V,G[P])}),ne=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?N=J.dimensionList:N=J.dimensionList.slice(Z,Z+fe),e.plotArea.hideZeroValues&&(J.hideZeroValues=!0)},Ue=()=>{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I,b,X).yAxisLabelArray;J.yMaxLeft=ae[ae.length-1],J.yMinLeft=ae[0],i=v.scaleLinear().domain([J.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:J.yMinLeft<0?J.yMinLeft*1.1:J.yMinLeft*.9,J.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:J.yMaxLeft*1.1]).range([0,X]),T=[M,0],ve()},ve=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,L]).paddingInner(J.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),y=v.scalePoint().domain(N).range(T).padding(.5)},Pe=()=>{Ye();{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I,b,X);a=v.axisBottom(i).tickFormat(_=>Xe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-M:0).tickValues(ae.autoLabelFlag?void 0:ae.yAxisLabelArray).ticks(ae.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ye=()=>{f=v.axisLeft(y).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*X*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(N,M,e))},We=ae=>{ae.forEach(_=>{_.data.forEach(G=>{G.hideZero=_.properties.hideZeroValues,G.axis=_.properties.axis,G.properties=_.properties})}),ae.forEach((_,G)=>{let Q=d.selectAll(".parentGroup").filter(B=>B?.properties?.legendUniqueId===_.properties.legendUniqueId).data([_],B=>B.properties.legendUniqueId);Q=Q.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",_.properties.legendUniqueId).attr("clip-path",`url(#${m}-clip)`).merge(Q);let ee=Q.selectAll(".column-group").data(_.data,B=>B.dimension+"_"+_.properties.legendUniqueId),F=ee.enter().append("g").attr("class","column-group").attr("hoverId",(_.properties.alias||_.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",B=>G===0?`translate(0, ${y(B.dimension)-L/2})`:`translate(0, ${y(B.dimension)-L/(2+G*2)})`);ee.attr("transform",B=>G===0?`translate(0, ${y(B.dimension)-L/2})`:`translate(0, ${y(B.dimension)-L/(2+G*2)})`),F.merge(ee).attr("transform",B=>G===0?`translate(0, ${y(B.dimension)-L/2})`:`translate(0, ${y(B.dimension)-L/(2+G*2)})`);const q=F.append("rect").attr("y",0).attr("height",G===0?L:L/2).attr("x",()=>i(0)).attr("width",0).attr("fill",B=>Y.get(_.properties.legendUniqueId)?.(B.value)??_.properties.color).attr("stroke-dasharray",()=>_.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${_.properties.stackBorderWidth}px`).attr("stroke",()=>_.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?_.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",B=>B.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(lt.SeriesId,()=>_.properties.legendUniqueId).attr(lt.DimValue,B=>Array.isArray(B.dimension)?String(B.dimension[0]):String(B.dimension));(e.animation.animationEnabled?q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):q).attr("x",B=>B.value>0?i(0):i(B.value)).attr("width",B=>B.value>0?i(B.value)-i(0):Math.abs(i(0)-i(B.value))),ee.select("rect").transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("x",B=>B.value>0?i(0):i(B.value)).attr("width",B=>B.value>0?i(B.value)-i(0):Math.abs(i(0)-i(B.value))),F.merge(ee).on("mousemove",(B,V)=>{ut([{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.formattedDimensionListMap.get(V.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():V.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||V.value,value:Xe(V.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:_.properties.alias}],e,B,_.properties,At(p,String(V.dimension??""),{..._.properties,formattedDimensionValue:String(J.formattedDimensionListMap.get(V.dimension)??V.dimension??"")}))}).on("mouseout",()=>{ot()}).on("click",vt(W,g,(B,V)=>({seriesId:_.properties.legendUniqueId,dimValue:Array.isArray(V.dimension)?String(V.dimension[0]):String(V.dimension),legendUniqueId:_.properties.legendUniqueId,seriesDisplayName:_.properties.alias||_.properties.name||""}))),ee.exit().remove()}),d.selectAll(".parentGroup").raise()},be=ae=>{X=h-ae.left-ae.right,M=k-ae.bottom-ae.top},ze=(ae,_,G)=>{ne=_,N=ae,fe=G,ke()},ke=()=>{ve(),Ye(),na(e,d,z,M,X,f,void 0,i,J.yMaxLeft,N,u,t,h,se,L,y),Se(),We(ne),$a(ne,y,i,void 0,D,pt,[],[],e,u,k,h,X,N,M,m,s,x,void 0,L,o,!1,b),oe()},Se=()=>{let ae=Lt(N,ne,Me);Te=v.stack().keys(J.legendList).offset(v.stackOffsetDiverging)(ae),ne.forEach((G,Q)=>G.data.forEach((ee,F)=>{ee[0]=Te[Q][F][0],ee[1]=Te[Q][F][1]}));let _=e.annotation.annotationSetLabelColor;Te.forEach((G,Q)=>G.forEach(ee=>{ee.key=G.key,G.color=JSON.parse(JSON.stringify(A[Q].properties.color)),ee.data.labelPosition=A[Q].properties.dataLabelPosition,ee.data.labelColor=_=="2"?JSON.parse(JSON.stringify(A[Q].properties.color)):A[Q].properties.labelColor,ee.hideZero=JSON.parse(JSON.stringify(A[Q].properties.hideZeroValues))}))},oe=()=>{try{const ae=Number(e.connector?.connectorVisibility);if(!e.connector||ae===2)return;const _=[],G=[],Q=[];let ee;const F=[];if(ae===1)ee=1;else if(ae===3){const re=Number(e.connector.connectorFollow);re===1?ee=Number(e.connector.connectorStepSize):re===2&&((e.connector.connectorExclude||[]).forEach(j=>Q.push(j)),ee=1)}const q=[],ue=[],B=[],V=e.connector?.connectorCustomRange||[];Q.forEach(re=>{const j=re.split("-");j.length&&q.push(j[0])});const C=(Te?.[0]||[]).map((re,j)=>({Dimension:re.data.Dimension,Total:re.data.Total,CustomTotal:re.data.Total-(B[j]??0),Index:j}));if(ee!=null){for(let re=0;re<C.length;re++)(ee===1||re%ee===0&&ee!==1)&&_.push(C[re]);for(let re=ee;re<C.length;re+=ee){const j=Math.min(re+ee,C.length);let ie=-1/0;for(let we=re;we<j;we++)C[we].Total>ie&&(ie=C[we].Total);ie!==-1/0&&F.push(ie)}for(let re=1;re<_.length;re++)G.push(_[re])}else{const re=[];(V||[]).forEach(j=>{if(j?.from&&j?.to){const ie=C.some(de=>de.Dimension===j.from),we=C.some(de=>de.Dimension===j.to);ie&&we&&re.push({from:j.from,to:j.to})}}),re.forEach(j=>{const ie=C.findIndex(de=>de.Dimension===j.from),we=C.findIndex(de=>de.Dimension===j.to);if(ie>=0&&we>=0){const de=Math.min(ie,we),Ae=Math.max(ie,we);_.push(C[de]);let De=C[de]?.Total??-1/0;for(let $e=de;$e<=Ae;$e++)C[$e].Total>De&&(De=C[$e].Total);De!==-1/0&&F.push(De),G.push(C[Ae])}})}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!==Ie.white?e.connector.connectorMarkerColor:"none"),$(_,F,G,ee,q),R(_,F,G,ee,q)}catch(ae){console.error(ae)}},$=(ae,_,G,Q,ee)=>{try{d.append("g").selectAll("path").data(ae).enter().filter((F,q)=>Q!=null?q<ae.length-1:q<ae.length).append("path").attr("d",(F,q)=>e.total.totalVisibility?`M ${i(F.Total)+50},
82
- ${y(F.Dimension)+y.bandwidth()/2-5}
83
- H ${60+Math.max(i(_[q]),i(G[q].Total),i(F.Total))}
84
- V ${y(G[q].Dimension)+y.bandwidth()/2+5}
85
- H ${30+i(G[q].Total)}`:`M ${i(F.Total)+30},
86
- ${y(F.Dimension)+y.bandwidth()/2-5}
87
- H ${45+Math.max(i(_[q]),i(G[q].Total),i(F.Total))}
88
- V ${y(G[q].Dimension)+y.bandwidth()/2+5}
89
- H ${10+i(G[q].Total)}
90
- `).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",F=>ee.includes(F.Dimension)||F.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}},R=(ae,_,G,Q,ee)=>{try{let F=e.connector.connectorFontStyle,q=e.connector.connectorNumberFormat,ue=M/30<N.length?Math.round(M/30):N.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(q=".2s"),d.append("g").selectAll("text1").data(ae).enter().filter((B,V)=>Q!=null?V<ae.length-1:V<ae.length).append("text").attr("y",(B,V)=>Q==null?y(G[V].Dimension)/2+y(B.Dimension)/2+15:Q==1?ue<6&&y.bandwidth()>40?y(G[V].Dimension)+y.bandwidth()/2+y.bandwidth()/2+13:y(G[V].Dimension)+y.bandwidth()/2+y.bandwidth()/2+7:y(G[V].Dimension)+y.bandwidth()/2+y.bandwidth()/2*Q+12).attr("x",(B,V)=>e.total.totalVisibility?70+Math.max(i(_[V]),i(G[V].Total),i(B.Total)):50+Math.max(i(_[V]),i(G[V].Total),i(B.Total))).text((B,V)=>(B.CustomTotal==0&&G[V].CustomTotal!=0&&(B.CustomTotal=1),fi(G[V].Total,B.Total,parseInt(e.connector.connectorDecimalPrecision),q,parseInt(B.Dimension),parseInt(G[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!==Ie.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",B=>ee.includes(B.Dimension)||B.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(F){console.error(F)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},fr=({isDateType:t,formatOptions:e,data:n})=>{const o=crypto.randomUUID(),x=0,l=le.ColumnHistogramChart,r=Ce.useRef(),c=n.ChartData,p=n.DimensionList,m=!1,L=!1,u=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,g=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,W=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,A=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,E,b,U,Y,H,I,D,w,z,K,ye,se,te,xe,ge,pe=[],he=[],O,X,M,h,k,s,d,i,y,T,a,f=[],N=0;const ne=2;let Z={dimensionList:p,chartType:l,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{fe()}catch(We){me("HorizontalHistogramChart","createHorizontalChart",We)}},[e]);const fe=()=>{({formatOptions:e,svg:k,width:O,height:X}=Ft(r,e)),Re(),{formatOptions:e}=ea(e,c,n.DataTableData??[]),{maxNumberForPrimaryAxis:ye,maxNumberForSecondaryAxis:se}=Rt(e,Z.yMinLeft,Z.yMaxLeft,Z.yMinRight,Z.yMaxRight),{margin:E,yLabel:b,xLabel:U,yTitle:Y,xTitle:H,dimensionHeightWidthArray:I,chartTitleHeight:D,secondaryAxisTitleWidth:w,legendMargin:z,secondaryYLabel:K}=Mt(O,X,ye,se,Z.yMaxLeft,e,Z.legendList,Z.dimensionList,Z.yMaxRight,L,u,t),ve(E),{dataTable:M,dataTableHeight:h}=ia(e,b,Y,c,Z.dimensionList),St(k,O,X,e),s=wt(k,E),kt(s,e,h,te,xe,l),Te(),J(),Ee(),ta(s,Z,U,e,h,d,T,I,X,x,t,te,xe,a,d),Zt(s,e,h,b,y,xe),Pe(c,X,k,E,te),Dt(e,m,k,E,U,X,H,Z.chartType,b,te,xe),Vt(xe,e,h,m,k,E,Y,b),Gt(k,L,E,e,h,xe,te,K,w),Nt(k,e,O,D),It(X,k,I,D,O,z,e,c,o,h,E,ct.rectangle)},Re=()=>{const We=[],be=[];let ze=[],ke=-1/0,Se=1/0;c.forEach(R=>{be.push(R.legend),R.data.forEach(ae=>{We.push(ae),ke=Math.max(ke,ae.value),Se=Math.min(Se,ae.value)})}),Z.chartData=We,Z.legendList=be,Z.yMaxLeft=ke,Z.yMinLeft=Se>0?0:Se,f=JSON.parse(JSON.stringify(c)),f.forEach(R=>R.data.forEach(ae=>ze.push(ae.value)));let oe=S||S==0?S:0,$=g||g==0?g:f[0]?.data?.length;if(Z.yMaxLeft=parseFloat((oe+"").length>($+"").length?oe+"":$+""),Z.xMax=v.max(ze),Z.xMin=v.min(ze),Z.xMin===Z.xMax){const R=Z.xMax===0?1:Math.abs(Z.xMax*.1);Z.xMin-=R,Z.xMax+=R}},Te=()=>{switch(e.bins.binsCalculation){case"Automatic":ge=xe/50;break;case"Number of Bins":Me(!1);break;case"Bin Width":Me(!0)}},Me=We=>{f.forEach(Se=>Se.data.sort((oe,$)=>oe.value-$.value));let be=Z.xMax-Z.xMin,ze;We?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ze=be/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ze=be/parseFloat(e.bins.binsCalculationValue));let ke=Z.xMin;if(We)for(pe=[ke];ke<Z.xMax;)ke+=ze,pe.push(ke);else for(pe=[ke];Math.round(ke)<Math.round(Z.xMax);)ke+=ze,pe.push(Math.round(ke))},J=()=>{d=v.scaleLinear().domain([Z.xMin,Z.xMax]).range([xe,0]);const We=pe.length>0?pe:d.ticks(ge);let be=v.bin().value(ke=>ke).domain(d.domain()).thresholds(We);f.forEach(ke=>{let Se=be(ke.data.map(oe=>oe.value));he.push(Se)}),f.forEach((ke,Se)=>he[Se].forEach(oe=>{oe.name=ke.properties.legend,oe.color=ke.properties.color,oe.opacity=ke.properties.opacity}));let ze=[];he.forEach(ke=>ke.forEach(Se=>ze.push(Se.length))),Z.yMaxLeft=v.max(ze),Z.yMinLeft=v.min(ze),i=v.scaleLinear().domain([W||W==0?W:0,A||A==0?A:Z.yMaxLeft+.2*Z.yMaxLeft]).range([0,te])},Ee=()=>{Le();{let We=yt(Z.yMaxLeft,Z.yMinLeft,te,e,Z,S,g,!1,xe);T=v.axisBottom(i).tickFormat(be=>Xe(be,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-xe+0:0).tickValues(We.autoLabelFlag?void 0:We.yAxisLabelArray).ticks(We.customTickValue).tickPadding(8).tickSizeOuter(0)}},Le=()=>{Ti(Z.xMax,Z.xMin,xe,e,W,A,te,!1).xAxisLabelArray.shift(),y=v.axisLeft(d).tickFormat(be=>Xe(be,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-te:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?y.ticks(ge):y.tickValues(pe).ticks(xe/50)},Ue=We=>{const be=e.animation.animationEnabled,ze=s.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+o+" .rect").data(he).enter().append("g").selectAll("rect").data(Se=>Se).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",Se=>{const oe=d(Se.x0),$=d(Se.x1);return Math.min(oe,$)}).attr("height",Se=>{const oe=d(Se.x0),$=d(Se.x1),R=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs($-oe)-R)}).attr("width",0).style("fill",Se=>Se.color!==Ie.white?Se.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(Se,oe)=>{ut([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():oe.properties?.currentMeasure?oe.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${oe.x0}-${oe.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:Xe(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(oe.length/f[0].data.length):oe.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,Se)}).on("mouseout",ot);(be?ze.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):ze).attr("width",Se=>i(Se.length)),s.selectAll(".parentGroup").raise()},ve=We=>{te=O-We.left-We.right,xe=X-We.bottom-We.top},Pe=(We,be,ze,ke,Se)=>{if(!e.plotArea.fitChart){const oe=We[0].data.length-ne,$=be-20;a=Z.dimensionList.slice(N,N+ne),f=JSON.parse(JSON.stringify(We)),f.forEach((_,G)=>f[G].data=_.data.filter(Q=>a.includes(Q.dimension))),ze.append("rect").attr("x",ke.left).attr("y",$).attr("width",Se).attr("height",8).attr("fill","#ddd").attr("rx",4);const R=Se*ne/Z.dimensionList.length,ae=ze.append("rect").attr("x",ke.left).attr("y",$).attr("width",R).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",_=>{let G=Math.min(Math.max(_.x,ke.left),ke.left+Se-R);ae.attr("x",G),N=Math.round((G-ke.left)/(Se-R)*oe),a=Z.dimensionList.slice(N,N+ne),f=JSON.parse(JSON.stringify(We)),f.forEach((Q,ee)=>f[ee].data=Q.data.filter(F=>a.includes(F.dimension))),Le(),Ye()}));ze.on("wheel",_=>{_.preventDefault();const G=Math.abs(_.deltaX)>Math.abs(_.deltaY)?_.deltaX:_.deltaY;N+=G>0?1:-1,N=Math.max(0,Math.min(N,oe));const Q=ke.left+(Se-R)*N/oe;ae.attr("x",Q),f=JSON.parse(JSON.stringify(We)),f.forEach((ee,F)=>f[F].data=ee.data.filter(q=>a.includes(q.dimension))),Le(),Ye()})}Ye()},Ye=()=>{Zt(s,e,h,b,y,xe),Ue()};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"className",ref:r,id:o,style:{width:"100%",height:"100%"}})})},Tr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r,onElementClick:c,vfxPickModeActive:p})=>{const m=crypto.randomUUID(),L=0,u=le.AreaChart,S=Ce.useRef(),g=Ce.useRef(c);g.current=c;const W=Ce.useRef(p);W.current=p;const A=mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled;let U=!1;const Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,w=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye,We=[],be=0,ze,ke,Se,oe=[],$={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(V){me("Linechart","createLineChart",V)}},[e]);const R=()=>{({formatOptions:e,svg:T,width:s,height:d}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:oe}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:X,maxNumberForSecondaryAxis:M,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:w}=Rt(e,$.yMinLeft,$.yMaxLeft,$.yMinRight,$.yMaxRight),{margin:z,yLabel:K,xLabel:ye,yTitle:se,xTitle:te,dimensionHeightWidthArray:xe,chartTitleHeight:ge,secondaryAxisTitleWidth:pe,legendMargin:he,secondaryYLabel:O,visibleBars:ze,columnWidth:ke,scrollbarVisible:Se}=Mt(s,d,X,M,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,Y,t,b,$,oe),q(z),{dataTable:i,dataTableHeight:y}=ia(e,K,se,A,$.dimensionList,n),b&&(i=[],y=0),St(T,s,d,e),a=wt(T,z),kt(a,e,y,h,k,u,m),_(),Q(),b?(ra(e,a,K,k,h,Ue),U&&Ai(e,a,O,ve,h)):(Zt(a,e,y,K,Re,k),U&&bi(a,e,y,O,Me,k,h)),Dt(e,b,T,z,ye,d,te,$.chartType,K,h,k),Vt(k,e,y,b,T,z,se,K,h),Gt(T,U,z,e,y,k,h,O,pe,b),Nt(T,e,s,ge),It(d,T,xe,ge,s,he,e,A,m,y,z,ct.areaWithLine,u,l),_t(A,d,s,T,z,h,Se,ze,$,be,!1,ue,b)},ae=()=>{const V=[],P=[];let C=[],re=-1/0,j=1/0,ie=-1/0,we=1/0;e.plotArea.hideZeroValues&&($.hideZeroValues=!0,A.forEach(de=>{de.data=de.data.filter(Ae=>Ae.value!==0)})),A.forEach(de=>{P.push(de.properties.alias?de.properties.alias:de.legend),de.data.forEach(Ae=>{V.push(Ae),de.properties.axis==="Secondary"?(U=!0,ie=Math.max(ie,Ae.value),we=Math.min(we,Ae.value)):(re=Math.max(re,Ae.value),j=Math.min(j,Ae.value))})}),$.chartData=V,$.legendList=P,$.yMaxLeft=re,$.yMinLeft=j>0?0:j,$.yMaxRight=ie,$.yMinRight=we>0?0:we,C=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(de=>de):$.dimensionList,$.dimensionList.forEach((de,Ae)=>{$.formattedDimensionListMap.set(de,C[Ae])}),We=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?Ye=$.dimensionList:Ye=$.dimensionList.slice(be,be+ze)},_=()=>{let V=yt(I||$.yMaxLeft,$.yMinLeft,k,e,$,H,I,b,h).yAxisLabelArray;$.yMaxLeft=V[V.length-1],$.yMinLeft=V[0];const P=b?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const C=v.scaleLinear().domain([$.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:$.yMinLeft<0?$.yMinLeft*1.1:$.yMinLeft*.9,$.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:$.yMaxLeft*1.1]).range(P);b?Ee=C:f=C}if(U){const C=v.scaleLinear().domain([$.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:$.yMinRight*1.1,$.yMaxRight<=0?w||0:w||$.yMaxRight*1.1]).range(P);b?Le=C:N=C}if(Z=b?[k,0]:[0,h],!b&&e.seriesLabel.seriesLabelVisibility){let C=la(h,f,e,We,void 0,U,k);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(fe=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Z=[0,h-C.heightWidth[0]]:Z=[C.heightWidth[0],h]}},G=()=>{const V=v.scalePoint().domain(Ye).range(Z).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?J=V:ne=V},Q=()=>{ee();{let V=yt(I||$.yMaxLeft,$.yMinLeft,k,e,$,H,I,b,h);b?Ue=v.axisBottom(Ee).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??h/50).tickPadding(8).tickSizeOuter(0):Re=v.axisLeft(f).tickFormat(P=>Xe(P,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,h,fe)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/30).tickPadding(8).tickSizeOuter(0)}if(U){let V=yt(w||$.yMaxRight,D||$.yMinRight,k,e,$,D,w);b?ve=v.axisTop(Le).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??h/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-k:0).tickSizeOuter(0):Me=v.axisRight(N).tickFormat(P=>Xe(P,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-h:0).tickSizeOuter(0)}},ee=()=>{b?Pe=v.axisLeft(J).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Ye,k,e)):Te=v.axisBottom(ne).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(gt(Ye,h,e))},F=V=>{const P=e.plotArea.plotAreaHideLineAndMarkers;V.forEach(De=>{De.data.forEach($e=>{$e.hideZero=De.properties.hideZeroValues,$e.axis=De.properties.axis})});const C=b?v.area().y(De=>{const $e=J(De.dimension);return $e??0}).x0(De=>De.axis===Qe.primary?Ee(0):Le(0)).x1(De=>De.axis===Qe.primary?Ee(De.value):Le(De.value)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)):v.area().x(De=>ne(De.dimension)?ne(De.dimension):null).y0(De=>De.axis===Qe.primary?f(0):N(0)).y1(De=>De.axis===Qe.primary?f(De.value):N(De.value)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)),re=b?v.area().y(De=>{const $e=J(De.dimension);return $e??0}).x0(()=>Ee(0)).x1(()=>Ee(0)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)):v.area().x(De=>ne(De.dimension)?ne(De.dimension):null).y0(()=>f(0)).y1(()=>f(0)).defined(De=>De.hideZero?!!De.value:!0).curve(ft(e)),j=e.animation.animationEnabled;let ie=a.selectAll(".parentGroup").data([V]),we=a.append("g").attr("class","focusClass");ie=ie.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(ie);let de=ie.selectAll(".area-group").data(De=>De),Ae=de.enter().append("g").attr("class","area-group");Ae.append("path").attr("class","area parentGroup").attr("fill",De=>De.properties.color!==Ie.white?De.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",De=>(De.properties?.alias||De.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",De=>re(De.data)).attr(lt.SeriesId,De=>De.properties.legendUniqueId).attr(lt.DimValue,De=>De.properties.alias||De.properties.name||"").on("click",vt(W,g,(De,$e)=>({seriesId:$e.properties.legendUniqueId,dimValue:$e.properties.alias||$e.properties.name||"",legendUniqueId:$e.properties.legendUniqueId,seriesDisplayName:$e.properties.alias||$e.properties.name||""}))).each(function(De){j?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(De.data)):v.select(this).attr("d",C(De.data))}),Ae.merge(de).each(function(De){const $e=v.select(this);$e.selectAll("path.visibleLine").data([De]).join("path").attr("class","visibleLine parentGroup").attr("d",Fe=>j?re(Fe.data):C(Fe.data)).attr("stroke",Fe=>Fe.properties.areaBorderColor!==Ie.white?Fe.properties.areaBorderColor:"none").attr("stroke-dasharray",Fe=>{const _e=parseInt(Fe.properties.lineWidth);switch(Fe.properties.lineStyle){case bt.dotted:return`0,${_e+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",Fe=>Fe.properties.lineStyle===bt.dotted?ya.round:ya.butt).attr("stroke-width",Fe=>P?Fe.properties.lineStyle!==bt.none&&e.plotArea.plotAreaHideLineAndMarkers?Fe.properties.lineWidth:"0":0).attr("fill","none").each(function(Fe){j&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",C(Fe.data))}),$e.selectAll("path.hoverLine").data([De]).join("path").attr("class","hoverLine").attr("d",Fe=>C(Fe.data)).attr("fill",Ie.transparent).attr("stroke","none").style("pointer-events","all").raise(),Li(e,ie,we,Ye,V,b?J:ne,b?Ee:f,u,!1,b)}),de.exit().remove(),Va(ie,V,u,b?J:ne,b?Ee:f,b?Le:N,null,e,$,w,D,H,I,!1,r,b),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},q=V=>{h=s-V.left-V.right,k=d-V.bottom-V.top},ue=(V,P,C)=>{We=P,Ye=V,ze=C,B()},B=()=>{if(G(),ee(),$a(A,b?J:ne,b?Ee:f,b?Le:N,z,pt,[],[],e,u,d,s,h,Ye,k,m,T,x,void 0,void 0,o,!1,b),b?na(e,a,ye,k,h,Pe,ve,Ee,$.yMaxLeft,Ye,u,t,s,xe,ke,J):ta(a,$,ye,e,y,f,Te,xe,d,L,t,h,k,Ye,ne),F(We),!b){let V=la(h,f,e,We,void 0,U,k).labelArray;ja(e,a,V),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,T,a,i,L,f,ne,void 0,void 0,void 0,y,u,e,K,se,Ye,h,Z,$.formattedDimensionListMap,m,z,k))}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},vr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.StackAreaChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse()||[],E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M=new Map,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe,Ye=[],We=0,be,ze,ke,Se=[],oe=[];const $=!1;let R={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{ae()}catch(C){me("StackAreaChart","createAreaChart",C)}},[e]);const ae=()=>{({formatOptions:e,svg:T,width:s,height:d}=Ft(S,e)),_(),{formatOptions:e,dataTableLegendsList:Se}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:O,maxNumberForSecondaryAxis:X}=Rt(e,R.yMinLeft,R.yMaxLeft,R.yMinRight,R.yMaxRight),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:be,columnWidth:ze,scrollbarVisible:ke}=Mt(s,d,O,X,R.yMaxLeft,e,R.legendList,R.dimensionList,R.yMaxRight,U,$,t,b,R,Se),ue(w),{dataTable:i,dataTableHeight:y}=ia(e,z,ye,A,R.dimensionList,n),b&&(i=[],y=0),St(T,s,d,e),a=wt(T,w),kt(a,e,y,h,k,u,m),G(),ee(),b?ra(e,a,z,k,h,Le):Zt(a,e,y,z,Re,k),Dt(e,b,T,w,K,d,se,R.chartType,z,h,k),Vt(k,e,y,b,T,w,ye,z,h),Gt(T,U,w,e,y,k,h,he,ge,b),Nt(T,e,s,xe),It(d,T,te,xe,s,pe,e,[...A].reverse(),m,y,w,ct.areaWithLine,u,l),_t(A,d,s,T,w,h,ke,be,R,We,!1,B,b)},_=()=>{const C=[],re=[];e.plotArea.hideZeroValues&&(R.hideZeroValues=!0,A.forEach(De=>{De.data=De.data.filter($e=>$e.value!==0)})),A.forEach((De,$e)=>{const Fe=`${$e}~$~${De.properties.alias}`;De.properties.legend=Fe,re.push(Fe);for(const _e of De.data)C.push(_e)}),R.chartData=C,R.legendList=re,Ye=JSON.parse(JSON.stringify(A));let j=Lt(R.dimensionList,A,$);e.plotArea.fitChart?Pe=R.dimensionList:(Pe=R.dimensionList.slice(We,We+be),Ye.forEach((De,$e)=>Ye[$e].data=De.data.filter(Fe=>Pe.includes(Fe.dimension))));const ie=v.stack().keys(R.legendList).offset(v.stackOffsetDiverging)(j);P();let we=1/0,de=-1/0;for(const De of ie)for(const[$e,Fe]of De)we=Math.min(we,$e),de=Math.max(de,Fe);R.yMinLeft=we>0?0:we,R.yMaxLeft=de;let Ae=t?Tt(e.xAxisLabel.xAxisNumberFormat,R.dimensionList).map(De=>De):R.dimensionList;R.dimensionList.forEach((De,$e)=>{R.formattedDimensionListMap.set(De,Ae[$e])})},G=()=>{let C=yt(H||R.yMaxLeft,R.yMinLeft,k,e,R,Y,H,b,h).yAxisLabelArray;R.yMaxLeft=C[C.length-1],R.yMinLeft=C[0];const re=b?[0,y>0?h-y:h]:[y>0?k-y:k,0];{const j=v.scaleLinear().domain([R.yMinLeft>=0?Y!==void 0&&!Number.isNaN(Y)?Y:0:R.yMinLeft<0?R.yMinLeft*1.1:R.yMinLeft*.9,R.yMaxLeft<=0?0:H!==void 0&&!Number.isNaN(H)?H:R.yMaxLeft*1.1]).range(re);b?J=j:f=j}if(Z=b?[k,0]:[0,h],!b&&e.seriesLabel.seriesLabelVisibility){let j=la(h,f,e,A,void 0,U,k,!0);j.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(fe=j.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?Z=[0,h-j.heightWidth[0]]:Z=[j.heightWidth[0],h]}},Q=()=>{const C=v.scalePoint().domain(Pe).range(Z).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?Me=C:ne=C},ee=()=>{{let C=yt(H||R.yMaxLeft,R.yMinLeft,k,e,R,Y,H,b,h);b?Le=v.axisBottom(J).tickFormat(re=>Xe(re,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):Re=v.axisLeft(f).tickFormat(re=>Xe(re,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(zt(e,h,fe)).tickValues(C.autoLabelFlag?void 0:C.yAxisLabelArray).ticks(C.customTickValue).tickPadding(8).tickSizeOuter(0)}},F=()=>{b?ve=v.axisLeft(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*h*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(Pe,k,e)):Te=v.axisBottom(ne).tickSize(sa(e,k,y,!0)).tickSizeOuter(0).tickValues(gt(Pe,h,e))},q=C=>{const re=e.animation.animationEnabled,j=e.plotArea.plotAreaHideLineAndMarkers;C.forEach(Fe=>{Fe.data.forEach(_e=>{_e.hideZero=Fe.properties.hideZeroValues,_e.axis=Fe.properties.axis})});const ie=b?v.area().y(Fe=>{const _e=Me(Fe.data.dimension);return _e??0}).x0(Fe=>J(Fe[0])).x1(Fe=>J(Fe[1])).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e)):v.area().x(Fe=>ne(Fe.data.dimension)?ne(Fe.data.dimension):null).y0(Fe=>f(Fe[0])).y1(Fe=>f(Fe[1])).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e)),we=b?v.area().y(Fe=>{const _e=Me(Fe.data.dimension);return _e??0}).x0(()=>J(0)).x1(()=>J(0)).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e)):v.area().x(Fe=>ne(Fe.data.dimension)?ne(Fe.data.dimension):null).y0(()=>f(0)).y1(()=>f(0)).defined(Fe=>Fe.data.hideZero?!!Fe.data.key:!0).curve(ft(e));let de=a.selectAll(".lineGroup").data([oe]),Ae=a.append("g").attr("class","focusClass");de=de.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(de);let De=de.selectAll(".area-group").data(Fe=>Fe),$e=De.enter().append("g").attr("class",Fe=>"area-group "+Fe.key.replace(/ /g,"-"));$e.append("path").attr("hoverId",Fe=>(C[Fe.index].properties.alias||C[Fe.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Fe=>Fe.color!==Ie.white?Fe.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Fe=>we(Fe)).attr(lt.SeriesId,Fe=>A[Fe.index]?.properties?.legendUniqueId??Fe.key).attr(lt.DimValue,Fe=>A[Fe.index]?.properties?.alias||A[Fe.index]?.properties?.name||"").on("click",vt(W,g,(Fe,_e)=>{const it=A[_e.index]?.properties?.legendUniqueId??_e.key,nt=A[_e.index]?.properties?.alias||A[_e.index]?.properties?.name||"";return{seriesId:it,dimValue:nt,legendUniqueId:it,seriesDisplayName:nt}})).each(function(Fe){re?v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",ie(Fe)):v.select(this).attr("d",ie(Fe))}),$e.merge(De).each(function(Fe,_e){const it=v.select(this);it.selectAll("path.visibleLine").data([Fe]).join("path").attr("class","visibleLine parentGroup").attr("d",nt=>re?we(nt):ie(nt)).attr("stroke",nt=>nt.color!==Ie.white?A[_e].properties.areaBorderColor:"none").attr("stroke-dasharray",nt=>{const Ba=parseInt(A[_e].properties.lineWidth.toString());switch(A[_e].properties.lineStyle){case bt.dotted:return`0,${Ba+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[_e]?.properties?.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",()=>j?A[_e].properties.lineStyle!==bt.none?A[_e].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(nt){re&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",ie(nt))}),it.selectAll("path.hoverLine").data([Fe]).join("path").attr("class","hoverLine").attr("d",nt=>ie(nt)).attr("fill",Ie.transparent).attr("stroke","none").style("pointer-events","all").raise(),T.selectAll('[hoverId="'+(A[Fe.index].properties.alias||A[Fe.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),De.exit().remove(),Li(e,de,Ae,Pe,C,b?Me:ne,b?J:f,u,!0,b),Va(de,C,u,b?Me:ne,b?J:f,b?Ee:N,null,e,R,D,I,Y,H,!1,p,b),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise()},ue=C=>{h=s-C.left-C.right,k=d-C.bottom-C.top},B=(C,re,j)=>{Ye=re,Pe=C,be=j,li(n,M,Pe),P(),V()},V=()=>{if(Q(),F(),b?na(e,a,K,k,h,ve,Ue,J,R.yMaxLeft,Pe,u,t,s,te,ze,Me):ta(a,R,K,e,y,f,Te,te,d,L,t,h,k,Pe,ne),q(Ye),Ya(oe,b?Me:ne,b?J:f,b?Ee:N,w,pt,[],[],e,u,d,s,h,Pe,k,m,T,x,y,o,b),ii(M,b?Me:ne,b?J:f,w,pt,[],e,u,d,s,T,o,b),!b){let C=la(h,f,e,Ye,void 0,U,k,!0).labelArray;ja(e,a,C),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,T,a,i,L,f,ne,void 0,void 0,void 0,y,u,e,z,ye,R.dimensionList,h,Z,R.formattedDimensionListMap,m,w,k))}},P=()=>{let C=Lt(Pe,Ye,$);oe=v.stack().keys(R.legendList).offset(v.stackOffsetDiverging)(C),Ye.forEach((j,ie)=>j.data.forEach((we,de)=>{we[0]=oe[ie][de][0],we[1]=oe[ie][de][1]}));let re=e.annotation.annotationSetLabelColor;oe.forEach((j,ie)=>j.forEach(we=>{we.key=j.key,j.color=JSON.parse(JSON.stringify(A[ie].properties.color)),we.data.labelPosition=A[ie].properties.dataLabelPosition,we.data.labelColor=re=="2"?JSON.parse(JSON.stringify(A[ie].properties.color)):A[ie].properties.labelColor,we.hideZero=JSON.parse(JSON.stringify(A[ie].properties.hideZeroValues)),we.properties=A[ie].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},kr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=crypto.randomUUID(),L=0,u=le.NormalizedStackAreaChart,S=Ce.useRef(),g=Ce.useRef(r);g.current=r;const W=Ce.useRef(c);W.current=c;const A=mt(n.ChartData,n.DimensionList)?.reverse()||[],E=n.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,U=!1;let Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le,Ue,ve,Pe=[],Ye=0,We,be,ze,ke=[],Se=[];const oe=!0;let $={dimensionList:E,chartType:u,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{R()}catch(P){me("NormalizedLinechart","createLineChart",P)}},[e]);const R=()=>{({formatOptions:e,svg:y,width:k,height:s}=Ft(S,e)),ae(),{formatOptions:e,dataTableLegendsList:ke}=ea(e,A,n.DataTableData??[]),{margin:w,yLabel:z,xLabel:K,yTitle:ye,xTitle:se,dimensionHeightWidthArray:te,chartTitleHeight:xe,secondaryAxisTitleWidth:ge,legendMargin:pe,secondaryYLabel:he,visibleBars:We,columnWidth:ze,scrollbarVisible:be}=Mt(k,s,O,X,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,U,oe,t,b,$,ke),q(w),{dataTable:d,dataTableHeight:i}=ia(e,z,ye,A,$.dimensionList,n),b&&(d=[],i=0),St(y,k,s,e),T=wt(y,w),kt(T,e,i,M,h,u),_(),Q(),b?ra(e,T,z,h,M,Ee):Zt(T,e,i,z,fe,h),Dt(e,b,y,w,K,s,se,$.chartType,z,M,h),Vt(h,e,i,b,y,w,ye,z,M),Gt(y,U,w,e,i,h,M,he,ge,b),Nt(y,e,k,xe),It(s,y,te,xe,k,pe,e,[...A].reverse(),m,i,w,ct.areaWithLine,u,l),_t(A,s,k,y,w,M,be,We,$,Ye,!1,ue,b)},ae=()=>{const P=[],C=[];e.plotArea.hideZeroValues&&($.hideZeroValues=!0,A.forEach(de=>{de.data=de.data.filter(Ae=>Ae.value!==0)})),A.forEach((de,Ae)=>{const De=`${Ae}~$~${de.properties.alias}`;de.properties.legend=De,C.push(De);for(const $e of de.data)P.push($e)}),$.chartData=P,$.legendList=C,Pe=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?ve=$.dimensionList:(ve=$.dimensionList.slice(Ye,Ye+We),Pe.forEach(de=>{de.data=de.data.filter(Ae=>ve.includes(Ae.dimension))}));const re=Lt($.dimensionList,A,oe),j=v.stack().keys($.legendList).offset(v.stackOffsetDiverging)(re);V();let ie=1/0;for(const de of j)for(const[Ae]of de)ie=Math.min(ie,Ae);$.yMinLeft=ie>0?0:ie,$.yMaxLeft=1;const we=t?Tt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(de=>de):$.dimensionList;$.formattedDimensionListMap=new Map($.dimensionList.map((de,Ae)=>[de,we[Ae]]))},_=()=>{const P=b?[0,i>0?M-i:M]:[i>0?h-i:h,0];{const C=v.scaleLinear().domain([$.yMinLeft<0?-1:0,1]).range(P);b?Me=C:a=C}if(ne=b?[h,0]:[0,M],!b&&e.seriesLabel.seriesLabelVisibility){let C=la(M,a,e,A,void 0,U,h,!0);C.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Z=C.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ne=[0,M-C.heightWidth[0]]:ne=[C.heightWidth[0],M]}},G=()=>{const P=v.scalePoint().domain(ve).range(ne).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?Te=P:N=P},Q=()=>{{const P=e.yAxisLabel.yAxisTicksMode===wa.custom,C=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0,re=P?za($.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null;b?Ee=v.axisBottom(Me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-h:0).tickValues(re).tickFormat(v.format(`.${C}%`)).ticks(i>0?(M-i)/80:M/80).tickPadding(8).tickSizeOuter(0):fe=v.axisLeft(a).tickSize(zt(e,M,Z)).tickValues(re).tickFormat(v.format(`.${C}%`)).ticks(i>0?(h-i)/80:h/80).tickPadding(8).tickSizeOuter(0)}},ee=()=>{b?Ue=v.axisLeft(Te).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(ve,h,e)):Re=v.axisBottom(N).tickSize(sa(e,h,i,!0)).tickSizeOuter(0).tickValues(gt(ve,M,e))},F=P=>{const C=e.animation.animationEnabled,re=e.plotArea.plotAreaHideLineAndMarkers;Se.forEach(($e,Fe)=>$e.forEach((_e,it)=>{const nt=_e.data.total;P[Fe].data[it]&&(P[Fe].data[it][0]=_e[0]=nt===0?0:_e[0]/nt,P[Fe].data[it][1]=_e[1]=nt===0?0:_e[1]/nt)})),P.forEach($e=>{$e.data.forEach(Fe=>{Fe.hideZero=$e.properties.hideZeroValues,Fe.axis=$e.properties.axis})});const j=b?v.area().y($e=>{const Fe=Te($e.data.dimension);return Fe??0}).x0($e=>Me($e[0])).x1($e=>Me($e[1])).defined($e=>$e.data.hideZero?!!$e[0]:!0).curve(v.curveLinear):v.area().x($e=>N($e.data.dimension)?N($e.data.dimension):null).y0($e=>a($e[0])).y1($e=>a($e[1])).defined($e=>$e.data.hideZero?!!$e[0]:!0).curve(v.curveLinear),ie=b?v.area().y($e=>{const Fe=Te($e.data.dimension);return Fe??0}).x0(()=>Me(0)).x1(()=>Me(0)).defined($e=>$e.data.hideZero?!!$e.data.key:!0).curve(ft(e)):v.area().x($e=>N($e.data.dimension)?N($e.data.dimension):null).y0(()=>a(0)).y1(()=>a(0)).defined($e=>$e.data.hideZero?!!$e.data.key:!0).curve(ft(e));let we=T.selectAll(".lineGroup").data([Se]),de=T.append("g").attr("class","focusClass");we=we.enter().append("g").attr("class","areas lineGroup").merge(we);let Ae=we.selectAll(".area-group").data($e=>$e),De=Ae.enter().append("g").attr("class",$e=>"area-group "+$e.key.replace(/ /g,"-"));De.append("path").attr("hoverId",$e=>(P[$e.index]?.properties?.alias||P[$e.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",$e=>$e.color!==Ie.white?$e.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",$e=>ie($e)).attr(lt.SeriesId,$e=>A[$e.index]?.properties?.legendUniqueId??$e.key).attr(lt.DimValue,$e=>A[$e.index]?.properties?.alias||A[$e.index]?.properties?.name||"").on("click",vt(W,g,($e,Fe)=>{const _e=A[Fe.index]?.properties?.legendUniqueId??Fe.key,it=A[Fe.index]?.properties?.alias||A[Fe.index]?.properties?.name||"";return{seriesId:_e,dimValue:it,legendUniqueId:_e,seriesDisplayName:it}})).each(function($e){const Fe=v.select(this);C?Fe.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j($e)):Fe.attr("d",j($e))}),De.merge(Ae).each(function($e,Fe){const _e=v.select(this);_e.selectAll("path.visibleLine").data([$e]).join("path").attr("class","visibleLine parentGroup").attr("d",it=>C?ie(it):j(it)).attr("stroke",it=>it.color!==Ie.white?A[Fe].properties.areaBorderColor:"none").attr("stroke-dasharray",it=>{const nt=parseInt(A[Fe].properties.lineWidth.toString());switch(A[Fe].properties.lineStyle){case bt.dotted:return`0,${nt+2}`;case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",()=>A[Fe]?.properties?.lineStyle===bt.dotted?ya.round:"").attr("stroke-width",()=>re?A[Fe].properties.lineStyle!==bt.none?A[Fe].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(it){C&&v.select(this).transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("d",j(it))}),_e.selectAll("path.hoverLine").data([$e]).join("path").attr("class","hoverLine").attr("d",it=>j(it)).attr("fill",Ie.transparent).style("pointer-events","all").raise(),y.selectAll('[hoverId="'+mi((P[$e.index]?.properties?.alias||P[$e.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),Ae.exit().remove(),Li(e,we,de,ve,P,b?Te:N,b?Me:a,u,!0,b),T.selectAll(".parentGroup").raise(),T.selectAll(".hoverLine").raise(),Va(we,P,u,b?Te:N,b?Me:a,b?J:f,null,e,$,D,I,Y,H,!0,p,b),!b&&e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),ua(e.plotArea.fitChart,y,T,d,L,a,N,void 0,void 0,void 0,i,u,e,z,ye,$.dimensionList,M,ne,$.formattedDimensionListMap,m,w,h))},q=P=>{M=k-P.left-P.right,h=s-P.bottom-P.top},ue=(P,C,re)=>{Pe=C,ve=P,We=re,V(),B()},B=()=>{if(G(),ee(),b?na(e,T,K,h,M,Ue,Le,Me,$.yMaxLeft,ve,u,t,k,te,ze,Te):ta(T,$,K,e,i,a,Re,te,s,L,t,M,h,ve,N),F(Pe),Ya(Se,b?Te:N,b?Me:a,b?J:f,w,pt,[],[],e,u,s,k,M,ve,h,m,y,x,i,o,b),!b){let P=la(M,a,e,Pe,void 0,U,h,!0).labelArray;ja(e,T,P)}},V=()=>{let P=Lt(ve,Pe,oe);Se=v.stack().keys($.legendList).offset(v.stackOffsetDiverging)(P),Pe.forEach((re,j)=>re.data.forEach((ie,we)=>{Se[j][we]&&(ie[0]=Se[j][we][0],ie[1]=Se[j][we][1])}));let C=e.annotation.annotationSetLabelColor;Se.forEach((re,j)=>re.forEach(ie=>{ie.key=re.key,re.color=JSON.parse(JSON.stringify(A[j].properties.color)),ie.data.labelPosition=A[j].properties.dataLabelPosition,ie.data.labelColor=C=="2"?JSON.parse(JSON.stringify(A[j].properties.color)):A[j].properties.labelColor,ie.hideZero=JSON.parse(JSON.stringify(A[j].properties.hideZeroValues)),ie.properties=A[j].properties}))};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},ni={left:"Left",right:"Right",center:"Center"},Bt={left:"left",right:"right",top:"top",bottom:"bottom"},qa={solid:"solid",dashed:"Dashed",dotted:"Dotted"},si={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"},dl="PieFamilyCommonFunctions.ts",Cr=(t,e,n,o)=>{try{let x=t.total.totalPosition,l=t.total.totalAlignment,r=t.legends.legendPosition,c=0;switch(x){case Fa.top:switch(c=r=="Top"?35:0,l){case Wt.start:return{x:5,y:e+c+10};case Wt.middle:return{x:n/2,y:e+c+10};case Wt.end:return{x:n-20,y:e+c+10}}break;case Fa.bottom:switch(c=r=="Bottom"?30:0,l){case Wt.start:return{x:10,y:o-c-10};case Wt.middle:return{x:n/2,y:o-c-10};case Wt.end:return{x:n-20,y:o-c-10}}break}}catch(x){me(dl,"getTotalValueCords",x)}},Vi=(t,e,n,o,x,l)=>{try{if(t.total&&t.total.totalVisibility){let r=t.total.totalFontStyle,c=t.total.totalAlignment,p=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":Ke(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),m=Cr(t,n,x,l);const L=o.append("g").attr("transform",`translate(${m.x}, ${m.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!==Ie.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",r.includes(ce.italic)?ce.italic:"").style("text-decoration",r.includes(ce.underline)?ce.underline:"").style("font-weight",r.includes(ce.bold)?ce.bold:"").attr("text-anchor",c===Wt.start?"start":c===Wt.middle?"middle":c===Wt.end?"end":""),t.animation?.animationEnabled&&L.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(et[t.animation.animationEffect]).attr("opacity",1)}}catch(r){me(dl,"drawTotalValue",r)}},Ga="PieChart.tsx",Mr=({data:t,formatOptions:e,chartId:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=Ce.useRef(),L=Ce.useRef(r);L.current=r;const u=Ce.useRef(c);u.current=c;const S=mt(t.ChartData);let g,W,A,E=40,b=Jt,U=[0,0],Y,H,I,D,w,z,K,ye,se=!1;Ce.useEffect(()=>{te()},[e]);const te=()=>{({chartFormatOptions:g,svg:w,width:A,height:W}=Kt(m,e)),xe(),U=Ha(g,S),{margins:b,innerHeight:Y,innerWidth:H,legendListWidth:ye,chartTitleHeight:E}=Ua(g,A,W,U,b),ge(),qt(m,A,W,g),D=oa(w,b),Xt(m,E,A,g),Wa(g,w,S,A,W,ye,E,n,b,ct.circle,void 0,l),pe(),he(),g.plotArea.annotationDraggable&&g.plotArea.dataLabels?ol(pt,z,g,O(),le.PieChart,A,W,D,Math.min(Y*.5,H*.5),o,x):M(),Vi(g,K,E,w,A,W)},xe=()=>{try{K=0,t.ChartData.forEach(h=>{h.properties.dataLabelPosition=="2"&&(se=!0),K+=h.data[0].value})}catch(h){me(Ga,"loopOverSeriesData",h)}},ge=()=>{try{I=Math.min(Y*.5,H*.5),se&&(I=I*.9)}catch(h){me(Ga,"defineChartRadius",h)}},pe=()=>{try{let h=rt(g.plotArea.rotation);const k=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;z=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:I,depth:2}))}catch(h){me(Ga,"initPieChartData",h)}},he=()=>{try{const h=v.arc().innerRadius(0).outerRadius(I),k=v.arc().innerRadius(0).outerRadius(I+10),s=D.append("g").attr("class","parentGroup").attr("fill-opacity",g.plotArea.opacity).attr("transform",`${O()}`).selectAll("path").data(z).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!==Ie.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",vt(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=>{ut([{key:g.yAxisTitle.yAxisTitleText,value:g.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/K)*100).toFixed(rt(g.toolTip.toolTipDecimalPrecision))+"%":Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],g,void 0,d.currentTarget.__data__.data.properties,At(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()});g.animation.animationEnabled?s.transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attrTween("d",function(d){const i=v.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return y=>h(i(y))}):s.attr("d",d=>h(d))}catch(h){me(Ga,"drawPieChart",h)}},O=()=>{try{return`translate(${H/2},${Y/2})`}catch(h){return me(Ga,"getPiePosition",h),""}},X=(h,k)=>{try{if(k)return"translate(0 0)";{const s=(h.startAngle+h.endAngle)/2,d=Math.cos(s-Math.PI/2)*(I*.65),i=Math.sin(s-Math.PI/2)*(I*.65);let y=s*180/Math.PI%360,T=0;return y>180&&y<360?T=90:T=-90,y+=T,`translate(${d},${i}) rotate(${y})`}}catch(s){return me(Ga,"getDataLabelTransformString",s),""}},M=()=>{try{if(g.plotArea.dataLabels){const h=z&&z.length===1;D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="1"),g,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??Ie.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",d=>d.data.properties?.labelFont??tt).attr("transform",d=>X(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}=g;return i.dataLabelName?d.data.properties?.alias||d.data.legend:""}),D.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="1"),g,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??Ie.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??tt).attr("transform",d=>X(d,h)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",g.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(g.plotArea.dataLabelValue){const i=d.data.data[0].value;return g.plotArea.dataLabelValue&&i!==void 0?g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/K)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",g.plotArea.dataLabelValue?g.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return g.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+I/7:0).outerRadius(d=>d.depth>1?d.y1-1+I/7:0),s=v.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>2?d.y0:0).outerRadius(d=>d.y1+I/1.5);D.selectAll("polyline.pie-label-connector").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="2"),g,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",O()).style("stroke",d=>g.connector.connectorColorOption=="Uniform"?g.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",g.connector.connectorStyle===qa.solid?0:g.connector.connectorStyle===qa.dotted?1:4).style("stroke-width",g.connector.connectorLineThickness).attr("points",d=>{const i=s.centroid(d),y=k.centroid(d);let T=d.x0+(d.x1-d.x0)/2;T=T%(2*Math.PI);const a=I*1.1*(T<Math.PI?1:-1),f=y[1];return[i,y,[a,f]].map(N=>N.join(",")).join(" ")}),D.append("g").attr("class","pie-label-group").attr("transform",O()).selectAll("foreignObject").data(Ut(z.filter(d=>d.data.properties.dataLabelPosition=="2"),g,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 I*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=g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/K)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision))+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let y="";return g.plotArea.dataLabelName&&(y+=`<span style="
73
+ `,N},"");A.html(u?`<div class="tooltipInner" style="display:flex; flex-direction:column; font-size:${Ql}; color:${m}; line-height:${Ol};">${u}</div>`:`<div class="arrow-placeholder"></div><div class="tooltipInner" style="display:flex; flex-direction:column;">${b}</div>`);const H=A.node(),B=H.offsetWidth,G=H.offsetHeight;let I=L+15,D=Y+15;I+B>window.innerWidth&&(I=L-B-10),D+G>window.innerHeight&&(D=Y-G-10),A.style("left",`${I}px`).style("top",`${D}px`).style("visibility",e.toolTip.toolTipVisibility?"visible":"hidden")}catch(r){console.error("Tooltip Error:",r)}}function ct(){try{T.select("#chartTooltipDiv").html("").style("visibility",Rt.hidden)}catch(t){Ce(ht,"hideTooltipOnMouseOut",t)}}const Ot=(t,e,l,s)=>{try{let r=T.select(t.current).append("foreignObject").attr("visibility",s.chartTitle.chartTitleVisibility?Rt.visible:Rt.hidden).attr("transform","translate(2,2)").attr("class","chartTitle").attr("width",l).attr("height",e+"px");s.chartTitle.dynamicTitleText.length!==0?r.append("xhtml:div").style("color","rgba(119,119,119)").attr("title",s.chartTitle.chartTitleText).style("white-space","pre").style("text-overflow","ellipsis").style("overflow",Rt.visible).style("line-height","1.3em").html(s.chartTitle.chartTitleHTML?s.chartTitle.chartTitleHTML:s.chartTitle.chartTitleText):r.append("xhtml:div").style("white-space","pre").style("user-select","none").style("text-overflow","ellipsis").style("overflow",Rt.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",s.chartTitle.chartTitleFontFamily).attr("title",s.chartTitle.chartTitleText).html(s.chartTitle.chartTitleText)}catch(u){Ce(ht,"drawChartTitle",u)}},Qi=(t,e)=>{try{return t.reduce((l,s)=>{const u=typeof s=="string"?s:e&&typeof s=="object"&&s[e]||"";return u.length>l.length?u:l},"")}catch(l){Ce(ht,"findStringWithLongestLength",l)}},ha=(t,e,l,s,u,r,n,o,p,m,f,y=!1,S)=>{try{if(m.legends.legendVisibility){let Z="",L="";n==Ze.left||n==Ze.right?(L="column",Z=o==Ea.top?"start":o==Ea.middle?"center":"end"):(L="row",Z=o==Ra.start?"start":o==Ra.middle?"center":"end");var A=t.append("foreignObject").attr("x",l).attr("y",s).style("pointer-events","auto").attr("width",u+"px").attr("height",r+"px").style("user-select","none").append("xhtml:div").attr("id","legendObject"+f).attr("class","legendsBoxWrapper").style("width",u+"px").style("display","flex").style("height",r-1+"px").style("overflow","auto").style("pointer-events","auto").style("justify-content","safe "+Z).style("flex-direction",L).style("outline-offset","-"+m.legends.legendBorderThickness+"px").style("outline",m.legends.legendBorder?`${m.legends.legendBorderThickness+"px solid"+m.legends.legendBorderColor}`:"none").append("div").attr("class","scrollbar").style("display","flex").style("flex-direction",L).style("flex-wrap","nowrap").style("padding-left","3px");(n==Ze.top||n==Ze.bottom)&&A.style("flex-direction","row"),e.forEach((b,H)=>{let B=A.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(b?.properties)}).on("mousemove",function(){if(m.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(m.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)}});(n==Ze.top||n==Ze.bottom)&&B.style("margin-right",y?"0px":"16px").style("white-space","nowrap");let G;if(!p){let N=b.properties.type;N==ee.ColumnChart||N==ee.StackColumnChart?G=dt.rectangle:N==ee.LineChart||N==ee.StackLineChart?G=dt.line:(N==ee.AreaChart||N==ee.StackAreaChart)&&(G=dt.areaWithLine)}(p||G)==dt.circle?lr(b,B):(p||G)==dt.hollowCircle?rr(b,B):(p||G)==dt.line?Oi(b,B,m):(p||G)==dt.areaWithLine?el(b,B,m):(p||G)==dt.rectangle&&nr(b,B);let I=y&&(n==Ze.bottom||n==Ze.top)&&H!=e.length-1?" |":"",D=y?m.legends.legendSelectedUnicolor:m.legends.legendColorMode==Pl.multiColor?b.properties.color?b.properties.color:ze.black:m.legends.legendSelectedUnicolor;B.append("div").style("margin-left","5px").style("color",D).style("background",b.properties.axis==Oe.secondary&&m.secondaryYAxisLabel.secondaryYAxisBackgroundColor).style("font-size",(y?m.legends.legendFontSize:b.properties.fontSize)+"px").style("font-family",y?m.legends.legendFontFamily:b.properties.fontFamily).style("font-style",()=>(y?m.legends.legendFontStyle:b.properties.fontStyle).includes(ie.italic)?ie.italic:"").style("text-decoration",()=>(y?m.legends.legendFontStyle:b.properties.fontStyle).includes(ie.underline)?ie.underline:"").style("font-weight",()=>(y?m.legends.legendFontStyle:b.properties.fontStyle).includes(ie.bold)?ie.bold:"").style("white-space","nowrap").attr("title",y?b.legendDisplay+" : "+b.actualValue:b.properties.alias).html(y?b.legendDisplay+" : "+b.actualValue+I:b.properties.alias)})}}catch(Z){Ce(ht,"legendsWithScroll",Z)}};function lr(t,e){try{e.append("div").style("height","12px").style("width","12px").style("border-radius","50%").style("background",t.properties.color)}catch(l){Ce(ht,"getCircleShape",l)}}function rr(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(l){Ce(ht,"getHollowCircleShape",l)}}function Oi(t,e,l){try{const s=t.properties?.lineStyle?.toLowerCase()||"solid";let u=e.append("div").style("height","2px").style("width",s=="dashed"?"25px":"20px").style("background",ze.transparent).style("position","relative").style("border-top",s=="none"?"unset":s=="dotted"?"2px dotted "+t.properties.color:s=="dashed"?"2px dashed "+t.properties.color:"2px solid "+t.properties.color);if(l.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":u.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":u.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":u.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":u.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":u.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":u.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":u.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(s){Ce(ht,"getLineShape",s)}}function el(t,e,l){try{let s=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(l.marker.markerVisibility)switch(t.properties.markerShape.toLowerCase()){case"circle":s.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":s.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":s.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":s.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":s.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":s.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":s.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":s.append("div").style("height","20%").style("width","100%").style("background",t.properties.markerColor);break;default:break}s.append("div").style("height","20%").style("width","100%").style("background","white"),s.append("div").style("height","60%").style("width","100%").style("background",t.properties.color).style("border-radius","1px")}catch(s){Ce(ht,"getAreaShape",s)}}function nr(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(l){Ce(ht,"getReactShape",l)}}const ea=(t,e,l,s)=>{try{let u=t.current;u.setAttribute("viewBox",`0 0 ${e} ${l}`);const{chartAreaColor:r,chartAreaBorder:n}=s.chartArea;if(u.style.backgroundColor=r,n){let p=s.chartArea.chartAreaBorderColor,m=s.chartArea.chartAreaBorderThickness+"px",f=nt(s.chartArea.chartAreaBorderStyle),y=f==1?"solid":f==2?"dashed":"dotted";u.style.outline=`${m} ${y} ${p}`,u.style.outlineOffset=`-${m}`}else u.style.outline="unset"}catch(u){Ce(ht,"initSvg",u)}},da=(t,e)=>{try{return t.append("g").attr("transform",`translate(${e.left},${e.top})`).attr("font-color","#ccc")}catch(l){Ce(ht,"initChartArea",l)}},ta=(t,e)=>{try{let l=T.select(t.current);l.selectAll("*").remove();let s=qi(zi,e),u=t.current.getBoundingClientRect(),r=u.width,n=u.height;return{chartFormatOptions:s,svg:l,width:r,height:n}}catch(l){Ce(ht,"firstFunctionBeforeRender",l)}},Ua=(t,e,l,s,u,r=!1)=>{try{let n=t.legends.legendPosition;n=t.legends.legendVisibility?t.legends.legendPosition:Ze.none;let o=e*.15*.8,p=r?s[0]:o<s[0]+15?o:s[0]+15,m=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?Ut(t.chartTitle.chartTitleHTML,void 0,void 0).height:Ut(t.chartTitle.chartTitleText,16,at).height:5;switch(n){case Ze.none:u.top=m+10,u.bottom=15,u.right=15,u.left=15;break;case Ze.top:u.top=m+50,u.bottom=15,u.right=15,u.left=15;break;case Ze.right:u.right=p+50,u.top=m+15,u.bottom=15,u.left=15;break;case Ze.bottom:u.bottom=45,u.top=m+15,u.right=15,u.left=15;break;case Ze.left:u.left=p+50,u.top=m+15,u.bottom=15,u.right=15}let f=l-u.top-u.bottom,y=e-u.left-u.right;return{margins:u,innerHeight:f,innerWidth:y,legendListWidth:p,chartTitleHeight:m}}catch(n){Ce(ht,"marginCalculationsForChartsWithoutAxis",n)}},Ha=(t,e,l,s,u,r,n,o,p,m,f=!0,y)=>{try{let S=t.legends.legendPosition,A=t.total.totalPosition,Z=t.total.totalAlignment,L=t.total.totalVisibility&&f,Y=t.legends.legendAlignmentTopBottom,b=t.legends.legendAlignment;switch(S){case Ze.none:break;case Ze.right:ha(e,l,s-r-25,n+5+(L&&A==wa.top&&Z==_t.end?10:0),r+15,u-n-10-(L?A==wa.top&&Z==_t.end?10:A==wa.bottom&&Z==_t.start?25:0:0),S,b,m,t,o,!1,y);break;case Ze.top:ha(e,l,5,n+5,s-10,30,S,Y,m,t,o,!1,y);break;case Ze.left:ha(e,l,5,p.top+(L&&A==wa.top&&Z==_t.start?10:0),r+15,u-n-10-(L?A==wa.top&&Z==_t.start?10:A==wa.bottom&&Z==_t.start?25:0:0),S,b,m,t,o,!1,y);break;case Ze.bottom:ha(e,l,5,u-35,s-10,30,S,Y,m,t,o,!1,y);break}}catch(S){Ce(ht,"initLegendListWithTotalValueAllowance",S)}},Wa=(t,e,l="legend")=>{try{let s=Ut(Qi(e,l),nt(t.legends.legendFontSize),t.legends.legendFontFamily);return[s.width,s.height]}catch(s){Ce(ht,"calculateLegendsMaxPossibleWidth",s)}},ni=(t,e,l,s=!1)=>{try{let u=t.chartTitle.chartTitleVisibility?t.chartTitle.dynamicTitleText.length!==0?Ut(t.chartTitle.chartTitleHTML,void 0,void 0).height:Ut(t.chartTitle.chartTitleText,16,at).height:5,r={top:t.chartTitle.chartTitleVisibility?u:20,bottom:s&&t.colorScale.showColor==va.colorTheme?40:20,left:20,right:20};return innerHeight=e-r.top-r.bottom,innerWidth=l-r.left-r.right,{margins:r,chartTitleHeight:u,innerHeight,innerWidth}}catch(u){Ce(ht,"marginCalculationsForChartsWithoutLegends",u)}},nt=t=>{try{if(typeof t!="string")return t;const e=t.trim();if(e==="")return t;const l=parseFloat(e);return isNaN(l)?t:l}catch(e){Ce(ht,"convertStringToNumber",e)}};function ft(t,e,l=!1){try{return t.map(s=>{let u;s.properties?u={...Zi,...s.properties}:u={...Zi,legend:s.legend,currentLegend:s.legend,alias:s.legend,name:s.legend};const r=e&&e.length!==0?e.map(n=>{const o=s.data.find(p=>p.dimension===n);return o?{...o}:{dimension:n,legend:s.legend,value:0}}):s.data.map(n=>({...n}));return{...s,properties:u,data:l?s.data:r}})}catch(s){Ce(ht,"generalizedChartData",s)}}const fi=(t="")=>{try{return t.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(e){Ce(ht,"getJQuerySelector",e)}},Ti=(t,e,l,s,u,r,n)=>{try{let o=t-e,p=r-u,m=parseInt(n.connector.connectorKPI),f,y;switch(m){case 1:if(f=`.${l}f`,e==0&&t==0)return"0";if(e==0&&t!=0)return T.format(f)(t);o=Math.abs(o);break;case 3:return f=`.${l}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(f)(t):(o=Math.round(t/e*100-100)/100,y=T.format(f)(o),y);case 2:return u.toString().length!==4&&(p=NaN),f=`.${l}%`,e==0&&t==0?"0%":e==0&&t!=0?T.format(f)(t):(o=Math.pow(t/e,1/p)-1,y=T.format(f)(o),y)}if(e==0)return"N/A";{let S,A="",Z=n.connector.connectorDisplayUnits;switch(Z!="None"&&Z!=null&&(Z=="Thousands"&&(S=1e3,A="K"),Z=="Millions"&&(S=1e6,A="M"),Z=="Billions"&&(S=1e9,A="B"),o=o/S),isNaN(o)&&(o=0),s){case",.0%":return f=`.${l}%`,T.format(f)(o);case"":return f=`.${l}f`,T.format(f)(o)+A;case".2n":return f=`.${l}n`,T.format(f)(o)+A;case".2$":return f=`,.${l}f`,"$"+T.format(f)(o)+A;case".2c":return f=`,.${l}f`,"C$"+T.format(f)(o)+A;case".2ē":return f=`,.${l}f`,"€"+T.format(f)(o)+A;case".2ch":return f=`,.${l}f`,"CHF"+T.format(f)(o)+A;case",":return f=`,.${l}f`,T.format(f)(o)+A;case".2£":return f=`,.${l}f`,"£"+T.format(f)(o)+A;case".2₹":return f=`,.${l}f`,"₹"+T.format(f)(o)+A;default:return f=".2f",T.format(f)(o)+A}}}catch{}},qa=t=>{try{return t.includes("~$~")?t.split("~$~")[1].replace(/ /g,"-"):t.replace(/\s+/g,"-")}catch{return t}};function sr(t,e,l){try{let s=function(r){const n=r.split(" - ");return n.length>1?n[0]:r};const u=new Map;return e?.LegendList?.forEach(r=>{u.set(l?s(r?.name):r.measureUniqueId,r)}),t.map(r=>({...r,properties:u.get(l?s(r.legend):r.properties.measureUniqueId)??r.properties})).filter(r=>r.data[0].value!==0)}catch{return t}}const or=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,tooltipFormatter:n,onElementClick:o,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let f=0,y=!1;const S=ee.ColumnChart,A=Ne.useRef(),Z=Ne.useRef(n);Z.current=n;const L=Ne.useRef(o);L.current=o;const Y=Ne.useRef(p);Y.current=p;const b=ft(l.ChartData,l.DimensionList),H=l.DimensionList,B=!1;let G=!1;const I=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,R=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,X=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye=[],O=0,Fe=0,We=[];const Ue=new Map;let xe={dimensionList:H,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{ke()}catch(K){Ce("Columnchart","createColumnChart",K)}},[e]);const ke=()=>{({formatOptions:e,svg:g,width:i,height:h}=wt(A,e)),{formatOptions:e,dataTableLegendsList:We}=zt(e,b,l.DataTableData??[]),De(),{maxNumberForPrimaryAxis:x,maxNumberForSecondaryAxis:k,customYaxisMaxValue:N,secondaryCustomYaxisMaxValue:X}=$t(e,xe.yMinLeft,xe.yMaxLeft,xe.yMinRight,xe.yMaxRight),{margin:le,yLabel:te,xLabel:Q,yTitle:de,xTitle:Le,dimensionHeightWidthArray:Te,chartTitleHeight:he,secondaryAxisTitleWidth:q,legendMargin:J,secondaryYLabel:M,visibleBars:Fe,columnWidth:f,scrollbarVisible:y}=St(i,h,x,k,xe.yMaxLeft,e,xe.legendList,xe.dimensionList,xe.yMaxRight,G,I,t,!1,xe,We),se(le),{dataTable:v,dataTableHeight:a}=Wt(e,te,de,b,xe.dimensionList,l),Ft(g,i,h,e),P=Dt(g,le),Ct(P,e,a,c,d,S,m),$e(),we(),Qt(P,e,a,te,Pe,d),G&&gi(P,e,a,M,Be,d,c),Vt(e,B,g,le,Q,h,Le,xe.chartType,te,c,d),Nt(d,e,a,B,g,le,de,te),Jt(g,G,le,e,a,d,c,M,q),Pt(g,e,i,he),Et(h,g,Te,he,i,J,e,b,m,a,le,dt.rectangle,S,r),Xt(b,h,i,g,le,c,y,Fe,xe,O,!1,Se)},De=()=>{const K=[],w=[];let _=[],ae=-1/0,re=1/0,$=-1/0,V=1/0,U=1/0,F=-1/0;b.forEach(E=>{w.push(E.properties.legendUniqueId),F=-1/0,U=1/0,E.data.forEach(W=>{K.push(W),E.properties.axis==="Secondary"?(G=!0,$=Math.max($,W.value),V=Math.min(V,W.value)):(ae=Math.max(ae,W.value),re=Math.min(re,W.value)),F=Math.max(F,W.value),U=Math.min(U,W.value)}),E.properties.setColorScale&&Ue.set(E.properties.legendUniqueId,T.scaleSequential().domain([U,F]).interpolator(ui.interpolateRgb(E.properties.startColor,E.properties.endColor)))}),xe.chartData=K,xe.legendList=w,xe.yMaxLeft=ae,xe.yMinLeft=re>0?0:re,xe.yMaxRight=$,xe.yMinRight=V>0?0:V,_=t?vt(e.xAxisLabel.xAxisNumberFormat,xe.dimensionList).map(E=>E):xe.dimensionList,xe.dimensionList.forEach((E,W)=>{xe.formattedDimensionListMap.set(E,_[W])}),Ye=JSON.parse(JSON.stringify(b)),ye=xe.dimensionList,e.plotArea.hideZeroValues&&(xe.hideZeroValues=!0)},$e=()=>{let K=ut(N||xe.yMaxLeft,xe.yMinLeft,d,e,xe,D,N).yAxisLabelArray;if(xe.yMaxLeft=K[K.length-1],xe.yMinLeft=K[0],ce=T.scaleLinear().domain([xe.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:xe.yMinLeft<0?xe.yMinLeft*1.1:xe.yMinLeft*.9,xe.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:xe.yMaxLeft*1.1]).range([a>0?d-a:d,0]),G){let w=ut(X||xe.yMaxRight,xe.yMinRight,d,e,xe,R,X).yAxisLabelArray;xe.yMaxRight=w[w.length-1],xe.yMinRight=w[0],z=T.scaleLinear().domain([xe.yMinRight>=0?(R||R==0)&&!Number.isNaN(R)?R:0:(R||R==0)&&!Number.isNaN(R)?R:xe.yMinRight*1.1,xe.yMaxRight<=0?X||0:X||xe.yMaxRight*1.1]).range([a>0?d-a:d,0])}Me=[0,c],ge()},ge=()=>{ve=T.scaleBand().domain(xe.legendList).range([0,f]).paddingInner(xe.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),me=T.scalePoint().domain(ye).range(Me).padding(.5)},we=()=>{{let K=ut(N||xe.yMaxLeft,xe.yMinLeft,d,e,xe,D,N);Pe=T.axisLeft(ce).tickFormat(w=>qe(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,c)).tickValues(K.autoLabelFlag?void 0:K.yAxisLabelArray).ticks(K.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(G){let K=ut(X||xe.yMaxRight,R||xe.yMinRight,d,e,xe,R,X);Be=T.axisRight(z).tickFormat(w=>qe(w,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(K.autoLabelFlag?void 0:K.yAxisLabelArray).ticks(K.customTickValue??d/30).tickSize(Yt(e,c)).tickPadding(8).tickSizeOuter(0)}},C=()=>{ne=(parseInt(e.xAxisLabel.xAxisPosition)==1?T.axisTop(me):T.axisBottom(me)).tickSize(ca(e,d,a)).tickSizeOuter(0).tickValues(At(ye,c,e))},j=K=>{K.forEach(w=>{w.data.forEach(_=>{_.hideZero=w.properties.hideZeroValues,_.axis=w.properties.axis,_.legendUniqueId=w.properties.legendUniqueId})}),ye.forEach(w=>{P.append("rect").attr("id",`dim-background-${w}`).attr("class","dimension-background").attr("x",me(w)-me.step()/2).attr("width",me.step()).attr("y",0).attr("height",d).attr("fill","#f3f4f6").attr("visibility","hidden").lower()}),K.forEach(w=>{let _=P.selectAll(".parentGroup").data([w],U=>U.properties.legendUniqueId);_=_.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(_);let ae=_.selectAll(".column-group").data(w.data,U=>U.legend+U.dimension),re=ae.enter().append("g").attr("class","column-group").attr("hoverId",(w.properties.alias||w.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",U=>`translate(${me(U.dimension)-f/2}, 0)`);ae.attr("transform",U=>`translate(${me(U.dimension)-f/2}, 0)`),re.merge(ae).attr("transform",U=>`translate(${me(U.dimension)-f/2}, 0)`);const $=re.append("rect").attr("x",U=>ve(U.legendUniqueId)).attr("width",ve.bandwidth()).attr("y",U=>(w.properties.axis===Oe.primary?ce:z)(0)).attr("height",0).attr("fill",U=>Ue.get(w.properties.legendUniqueId)?.(U.value)??w.properties.color).attr("stroke-dasharray",U=>w.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",U=>`${w.properties.stackBorderWidth}px`).attr("stroke",U=>w.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?w.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",U=>U.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(rt.SeriesId,()=>w.properties.legendUniqueId).attr(rt.DimValue,U=>Array.isArray(U.dimension)?String(U.dimension[0]):String(U.dimension));(e.animation.animationEnabled?$.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):$).attr("y",U=>{const F=w.properties.axis===Oe.primary?ce:z;return U.value>0?F(U.value):F(0)}).attr("height",U=>{const F=w.properties.axis===Oe.primary?ce:z;return Math.abs(F(U.value)-F(0))}),re.merge(ae).on("mousemove",(U,F)=>{(w.properties.alias||w.properties.name||"Legend").replace(/ /g,"-");const E=Array.isArray(F.dimension)?F.dimension[0]:F.dimension,W=String(xe.formattedDimensionListMap.get(E)??E??""),Ae=Lt(Z.current,String(E??""),{...w.properties,formattedDimensionValue:W});xt([{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:W},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():F.properties?.currentMeasure?F.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||F.value,value:qe([ee.NormalizedStackLineChart,ee.NormalizedStackAreaChart,""].includes(S)?F[1]-F[0]:F.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:w.properties.alias}],e,U,w.properties,Ae)}).on("mouseout",(U,F)=>{(w.properties.alias||w.properties.name||"Legend").replace(/ /g,"-"),ct()}),re.merge(ae).on("click",kt(Y,L,(U,F)=>({seriesId:w.properties.legendUniqueId,dimValue:Array.isArray(F.dimension)?String(F.dimension[0]):String(F.dimension),legendUniqueId:w.properties.legendUniqueId,seriesDisplayName:w.properties.alias||w.properties.name||""}))),ae.exit().remove()}),P.selectAll(".parentGroup").raise()},se=K=>{c=i-K.left-K.right,d=h-K.bottom-K.top},Se=(K,w,_)=>{Ye=w,ye=K,Fe=_,pe()},pe=()=>{ge(),C(),la(P,xe,Q,e,a,ce,ne,Te,h,f,t,c,d,ye,me),j(Ye),$a(b,me,ce,z,le,bt,[],[],e,S,h,i,c,ye,d,m,g,u,ve,f,s),Zt(e.plotArea.fitChart,g,P,v,f,ce,me,ve,void 0,void 0,a,S,e,te,de,xe.dimensionList,c,Me,xe.formattedDimensionListMap,m,le,d)};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:A,id:m,style:{width:"100%",height:"100%"}})})},cr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID();let f=0,y=!1,S=[];const A=ee.CustomColumnChart,Z=Ne.useRef(),L=Ne.useRef(n);L.current=n;const Y=Ne.useRef(o);Y.current=o;const b=ft(l.ChartData,l.DimensionList),H=l.DimensionList,B=!!e.swapAxis?.swapAxisEnabled;let G=!1;const I=!1;let D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,N=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,R=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,X=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g=0,P,ce,z,me,ve,Me,Pe,ne=[],Be=[],ye=[],Ye=[],O=[],Fe=[],We=[],Ue=[],xe,ke,De,$e=new Map,ge,we,C,j,se,Se,pe,K=[],w=[],_=0,ae,re=[],$={dimensionList:H,chartType:A,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{V()}catch(He){Ce("CustomColumnchart","createCustomColumnChart",He)}},[e]);const V=()=>{({formatOptions:e,svg:P,width:i,height:h}=wt(Z,e)),U(),{formatOptions:e,dataTableLegendsList:re}=zt(e,b,l.DataTableData??[]),ki(),{maxNumberForPrimaryAxis:x,maxNumberForSecondaryAxis:k,customYaxisMaxValue:N,secondaryCustomYaxisMaxValue:X}=$t(e,$.yMinLeft,$.yMaxLeft,$.yMinRight,$.yMaxRight),{margin:le,yLabel:te,xLabel:Q,yTitle:de,xTitle:Le,dimensionHeightWidthArray:Te,chartTitleHeight:he,secondaryAxisTitleWidth:q,legendMargin:J,secondaryYLabel:M,visibleBars:ae,columnWidth:f,scrollbarVisible:y}=St(i,h,x,k,$.yMaxLeft,e,$.legendList,$.dimensionList,$.yMaxRight,G,I,t,B,$,re),{dataTable:v,dataTableHeight:a}=Wt(e,B?Q:te,B?Le:de,b,$.dimensionList,l),B&&v.length>0&&(g=a,le.bottom+=g,a=0),it(le),Ft(P,i,h,e),ce=Dt(P,le),Ct(ce,e,a,c,d+g,A,m),E(),Ae(),B?(sa(e,ce,te,d,c,j),G&&Li(e,ce,M,se,c)):(Qt(ce,e,a,te,xe,d),G&&gi(ce,e,a,M,De,d,c)),Vt(e,B,P,le,Q,h,Le,$.chartType,te,c,d),Nt(d+g,e,a,B,P,le,de,te,c),Jt(P,G,le,e,a,d,c,M,q,B),Pt(P,e,i,he),Et(h,P,Te,he,i,J,e,b,m,a,le,null,A,r),Xt(b,h,i,P,le,c,y,ae,$,_,!1,st,B)},U=()=>{const He=[];let Ke=[],yt=-1/0,et=1/0,lt=-1/0,Je=1/0,Ee=[];b.forEach((Ie,_e)=>{[ee.StackColumnChart,ee.StackAreaChart].includes(Ie.properties.type)?ee.StackColumnChart===Ie.properties.type&&(He.includes(ee.StackColumnChart)||He.push(ee.StackColumnChart)):(Ee.push(Ie),Ie.properties.type!==ee.LineChart&&Ie.properties.type!==ee.AreaChart&&He.push(Ie.properties.legendUniqueId)),Ie.properties.axis==="Secondary"&&(Be.push(Ie),Ie.properties.type==ee.StackColumnChart&&Fe.push(Ie),Ie.properties.type==ee.StackAreaChart&&O.push(Ie)),Ie.properties.axis===Oe.primary&&(ne.push(Ie),Ie.properties.type==ee.StackColumnChart&&Ye.push(Ie),Ie.properties.type==ee.StackAreaChart&&ye.push(Ie)),Ie.data=Ie.data.map(pt=>{const ot={...pt,type:Ie.properties.type,axis:Ie.properties.axis,labelPosition:e?.annotation?.annotationPosition.toString()==="4"?Ie.properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),labelColor:Ie.properties.labelColor,legendUniqueId:Ie.properties.legendUniqueId};return ot.axis==="Secondary"?(G=!0,lt=Math.max(lt,ot.value),Je=Math.min(Je,ot.value)):(yt=Math.max(yt,ot.value),et=Math.min(et,ot.value)),ot})}),K=JSON.parse(JSON.stringify(b)),$.chartData=Ee,$.legendList=He,$.yMaxLeft=yt,$.yMinLeft=et>0?0:et,$.yMaxRight=lt,$.yMinRight=Je>0?0:Je,Ke=t?vt(e.xAxisLabel.xAxisNumberFormat,$.dimensionList).map(Ie=>Ie):$.dimensionList,$.dimensionList.forEach((Ie,_e)=>{$.formattedDimensionListMap.set(Ie,Ke[_e])}),e.plotArea.fitChart?pe=$.dimensionList:pe=$.dimensionList.slice(_,_+ae),e.plotArea.hideZeroValues&&($.hideZeroValues=!0),F(ye,Ye,O,Fe,b)},F=(He,Ke,yt,et,lt)=>{const Je=mt(pe,He,!1),Ee=mt(pe,yt,!1),Ie=mt(pe,Ke,!1),_e=mt(pe,et,!1);w=[];const pt=[];if(He.forEach(ot=>{pt.push({properties:{axis:ot.properties.axis,type:ot.properties.type,legend:ot.properties.legend,annotation:ot.properties.annotation,alias:ot.properties.alias},stackData:Je,data:He})}),yt.forEach(ot=>{pt.push({properties:{axis:ot.properties.axis,type:ot.properties.type,legend:ot.properties.legend,annotation:ot.properties.annotation,alias:ot.properties.alias},stackData:Ee,data:yt})}),Ke.forEach(ot=>{pt.push({properties:{axis:ot.properties.axis,type:ot.properties.type,legend:ot.properties.legend,annotation:ot.properties.annotation,alias:ot.properties.alias},stackData:Ie,data:Ke})}),et.forEach(ot=>{pt.push({properties:{axis:ot.properties.axis,type:ot.properties.type,legend:ot.properties.legend,annotation:ot.properties.annotation,alias:ot.properties.alias},stackData:_e,data:et})}),pt.push(...$.chartData),lt.length){const ot=[];lt.forEach(Ci=>{ot.push(...pt.filter(ml=>ml.properties?.type===Ci.properties.type&&ml.properties.legend===Ci.legend))}),w.push(...ot)}else w.push(...pt)},E=()=>{const He=B?[0,a>0?c-a:c]:[a>0?d-a:d,0];{const Ke=T.scaleLinear().domain([$.yMinLeft>=0?D!==void 0&&!Number.isNaN(D)?D:0:$.yMinLeft<0?$.yMinLeft*1.1:$.yMinLeft*.9,$.yMaxLeft<=0?0:N!==void 0&&!Number.isNaN(N)?N:$.yMaxLeft*1.1]).range(He);B?we=Ke:z=Ke}if(G){const Ke=T.scaleLinear().domain([$.yMinRight>=0?(R||R==0)&&!Number.isNaN(R)?R:0:(R||R==0)&&!Number.isNaN(R)?R:$.yMinRight*1.1,$.yMaxRight<=0?(X||X==0)&&!Number.isNaN(X)?X:0:(X||X==0)&&!Number.isNaN(X)?X:$.yMaxRight*1.1]).range(He);B?C=Ke:me=Ke}Pe=B?[d,0]:[0,c]},W=()=>{Me=T.scaleBand().domain($.legendList).range([0,f]).paddingInner($.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0);const He=T.scalePoint().domain(pe).range(Pe).padding(.5);B?ge=He:ve=He},Ae=()=>{{let He=ut(N||$.yMaxLeft,$.yMinLeft,d,e,$,D,N,B,c);B?j=T.axisBottom(we).tickFormat(Ke=>qe(Ke,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-d:0).tickValues(He.autoLabelFlag?void 0:He.yAxisLabelArray).ticks(He.customTickValue??c/50).tickPadding(8).tickSizeOuter(0):xe=T.axisLeft(z).tickFormat(Ke=>qe(Ke,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,c)).tickValues(He.autoLabelFlag?void 0:He.yAxisLabelArray).ticks(He.customTickValue??d/30).tickPadding(8).tickSizeOuter(0)}if(G){let He=ut(N||$.yMaxRight,$.yMinRight,d,e,$,D,N);B?se=T.axisTop(C).tickFormat(Ke=>qe(Ke,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(He.autoLabelFlag?void 0:He.yAxisLabelArray).ticks(He.customTickValue??c/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-d:0).tickPadding(8).tickSizeOuter(0):De=T.axisRight(me).tickFormat(Ke=>qe(Ke,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(He.autoLabelFlag?void 0:He.yAxisLabelArray).ticks(He.customTickValue??d/30).tickSize(Yt(e,c)).tickPadding(8).tickSizeOuter(0)}},ue=()=>{B?Se=T.axisLeft(ge).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*c*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(pe,d,e)):ke=T.axisBottom(ve).tickSize(ca(e,d,a,!0)).tickSizeOuter(0).tickValues(At(pe,c,e))},oe=He=>{He.forEach(et=>{switch(et.properties.type){default:case ee.ColumnChart:fe(et);break;case ee.LineChart:break;case ee.AreaChart:break;case ee.StackColumnChart:We=yi(et),Ge();break;case ee.StackAreaChart:Ue=yi(et),be(et);break}});const Ke=K.filter(et=>et.properties.type===ee.LineChart);Ke.length&&Re(Ke);const yt=K.filter(et=>et.properties.type===ee.AreaChart);yt.length&&Ve(yt),ce.selectAll(".parentGroup").raise()},fe=He=>{let Ke=ce.selectAll(".parentGroup").data([He],Ee=>Ee.properties?.legendUniqueId);Ke=Ke.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(Ke);let yt=Ke.selectAll(".column-group").data(He.data,Ee=>Ee.legendUniqueId),et=yt.enter().append("g").attr("class","column-group").attr("hoverId",Ee=>(He.properties.alias||He.properties.name).includes("-")?(He.properties.alias||He.properties.name).replace("-","`").split("`")[1].replace(/ /g,"-"):(He.properties.alias||He.properties.name).replace(/ /g,"-")).attr("transform",Ee=>B?`translate(0, ${ge(Ee.dimension)})`:`translate(${ve(Ee.dimension)}, 0)`);et.merge(yt).attr("transform",Ee=>B?`translate(0, ${ge(Ee.dimension)-f/2})`:`translate(${ve(Ee.dimension)-f/2}, 0)`);const lt=(B?et.append("rect").attr("y",Ee=>Me(Ee.legendUniqueId)).attr("height",Me.bandwidth()).attr("x",()=>(He.properties.axis===Oe.primary?we:C)(0)).attr("width",0):et.append("rect").attr("x",Ee=>Me(Ee.legendUniqueId)).attr("width",Me.bandwidth()).attr("y",()=>(He.properties.axis===Oe.primary?z:me)(0)).attr("height",0)).attr("fill",He.properties.color).attr("stroke-dasharray",Ee=>He.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",Ee=>`${He.properties.stackBorderWidth}px`).attr("stroke",Ee=>He.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?He.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(rt.SeriesId,()=>He.properties.legendUniqueId).attr(rt.DimValue,Ee=>Array.isArray(Ee.dimension)?String(Ee.dimension[0]):String(Ee.dimension)).on("mousemove",(Ee,Ie)=>{xt([{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:$.formattedDimensionListMap.get(Array.isArray(Ie.dimension)?Ie.dimension[0]:Ie.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ie.properties?.currentMeasure?Ie.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ie.value,value:qe([ee.NormalizedStackLineChart,ee.NormalizedStackAreaChart,""].includes(A)?Ie[1]-Ie[0]:Ie.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ie.legend.includes("~$~")?Ie.legend.split("~$~")[1]:Ie.legend}],e,Ee,b.filter(_e=>_e.legend===Ie.legend)[0].properties,(()=>{const _e=Array.isArray(Ie.dimension)?Ie.dimension[0]:Ie.dimension,pt=b.filter(ot=>ot.legend===Ie.legend)[0].properties;return Lt(p,String(_e??""),{...pt,formattedDimensionValue:String($.formattedDimensionListMap.get(_e)??_e??"")})})())}).on("mouseout",ct).on("click",kt(Y,L,(Ee,Ie)=>({seriesId:He.properties.legendUniqueId,dimValue:Array.isArray(Ie.dimension)?String(Ie.dimension[0]):String(Ie.dimension),legendUniqueId:He.properties.legendUniqueId,seriesDisplayName:He.properties.alias||He.properties.name||""}))),Je=e.animation.animationEnabled?lt.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):lt;B?Je.attr("x",Ee=>{const Ie=He.properties.axis===Oe.primary?we:C;return Ee.value>0?Ie(0):Ie(Ee.value)}).attr("width",Ee=>{const Ie=He.properties.axis===Oe.primary?we:C;return Math.abs(Ie(Ee.value)-Ie(0))}):Je.attr("y",Ee=>{const Ie=He.properties.axis===Oe.primary?z:me;return Ee.value>0?Ie(Ee.value):Ie(0)}).attr("height",Ee=>{const Ie=He.properties.axis===Oe.primary?z:me;return Math.abs(Ie(Ee.value)-Ie(0))}),yt.exit().remove()},Re=He=>{He.forEach(Je=>{Je.data.forEach(Ee=>{Ee.hideZero=Je.properties.hideZeroValues,Ee.axis=Je.properties.axis,Ee.legendUniqueId=Je.properties.legendUniqueId})});const Ke=B?T.line().y(Je=>{const Ee=ge(Je.dimension);return Ee??0}).x(Je=>Je.axis==Oe.primary?we(Je.value):C(Je.value)).defined(Je=>e?.plotArea?.hideZeroValues?!!Je.value:!0).curve(Tt(e)):T.line().x(Je=>ve(Je.dimension)?ve(Je.dimension):null).y(Je=>Je.axis==Oe.primary?z(Je.value):me(Je.value)).defined(Je=>e?.plotArea?.hideZeroValues?!!Je.value:!0).curve(Tt(e));let yt=ce.selectAll(".lines.parentGroup").data([1]);yt=yt.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(yt);let et=yt.selectAll(".line-group").data(He,Je=>Je.properties.legendUniqueId),lt=et.enter().append("g").attr("class","line-group");lt.attr("hoverId",Je=>(Je.properties.alias||Je.properties.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),lt.merge(et).select("path").attr("d",Je=>Ke(Je.data)).attr("stroke",Je=>Je.properties.color!==ze.white?Je.properties.color:"none").attr("stroke-dasharray",Je=>{switch(Je.properties.lineStyle){case gt.dotted:return"0,3";case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",Je=>Je.properties.lineStyle===gt.dotted?xa.round:"").attr("stroke-width",Je=>Je.properties.lineStyle!=="None"?Je.properties.lineWidth:"0"),e.animation.animationEnabled&&lt.merge(et).select("path").each(function(){const Je=T.select(this),Ee=this.getTotalLength();Je.attr("stroke-dasharray",Ee+" "+Ee).attr("stroke-dashoffset",Ee),Je.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("stroke-dashoffset",0)}),et.exit().remove(),Na(yt,He,ee.CombinationLine,B?ge:ve,B?we:z,B?C:me,null,e,$,X,R,D,N,!1,p,B)},Ve=He=>{He.forEach(_e=>{_e.data.forEach(pt=>{pt.hideZero=_e.properties.hideZeroValues,pt.axis=_e.properties.axis,pt.legendUniqueId=_e.properties.legendUniqueId})});const Ke=B?T.area().y(_e=>{const pt=ge(_e.dimension);return pt??0}).x0(()=>we(0)).x1(_e=>we(_e.value)).defined(_e=>_e.hideZero?!!_e.value:!0).curve(Tt(e)):T.area().x(_e=>ve(_e.dimension)?ve(_e.dimension):null).y0(()=>z(0)).y1(_e=>z(_e.value)).defined(_e=>_e.hideZero?!!_e.value:!0).curve(Tt(e)),yt=B?T.area().y(_e=>{const pt=ge(_e.dimension);return pt??0}).x0(()=>we(0)).x1(()=>we(0)).defined(_e=>_e.hideZero?!!_e.value:!0).curve(Tt(e)):T.area().x(_e=>ve(_e.dimension)?ve(_e.dimension):null).y0(()=>z(0)).y1(()=>z(0)).defined(_e=>_e.hideZero?!!_e.value:!0).curve(Tt(e)),et=e.animation.animationEnabled;let lt=ce.selectAll(".areas.parentGroup").data([1]),Je=ce.append("g").attr("class","focusClass");lt=lt.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(lt);let Ee=lt.selectAll(".area-group").data(He,_e=>_e.legend),Ie=Ee.enter().append("g").attr("class","area-group");Ie.append("path").attr("hoverId",_e=>(_e.properties.alias||_e.properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",_e=>_e.properties.color!==ze.white?_e.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).attr("d",_e=>et?yt(_e.data):Ke(_e.data)).each(function(_e){et&&T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",Ke(_e.data))}),Ee.select("path").attr("d",_e=>Ke(_e.data)),Ie.merge(Ee).select("path").attr("stroke",_e=>_e.properties.areaBorderColor!==ze.white?_e.properties.areaBorderColor:"none").attr("stroke-dasharray",_e=>{switch(_e.properties.lineStyle){case"dotted":return"0,3";case"dashed":return Ta;default:return""}}).attr("stroke-linecap",_e=>_e.properties.lineStyle==="dotted"?xa.round:"").attr("stroke-width",_e=>_e.properties.lineStyle!=="None"&&e.plotArea.plotAreaHideLineAndMarkers?_e.properties.lineWidth:"0"),mi(e,lt,Je,pe,He,B?ge:ve,B?we:z,A,!1,B),Ee.exit().remove(),Na(lt,He,ee.CombinationArea,B?ge:ve,B?we:z,B?C:me,null,e,$,X,R,D,N,!1,void 0,B)},be=He=>{He.data.forEach(Ie=>{Ie.data.forEach(_e=>{_e.hideZero=Ie.properties.hideZeroValues,_e.axis=Ie.properties.axis,_e.legendUniqueId=Ie.properties.legendUniqueId})});const Ke=B?T.area().y(Ie=>{const _e=ge(Ie.data.dimension);return _e??0}).x0(Ie=>Ie.data.axis===Oe.primary?we(Ie[0]):C(Ie[0])).x1(Ie=>Ie.data.axis===Oe.primary?we(Ie[1]):C(Ie[1])).defined(Ie=>Ie.hideZero?!!Ie.key:!0).curve(Tt(e)):T.area().x(Ie=>ve(Ie.data.dimension)?ve(Ie.data.dimension):null).y0(Ie=>Ie.data.axis===Oe.primary?z(Ie[0]):me(Ie[0])).y1(Ie=>Ie.data.axis===Oe.primary?z(Ie[1]):me(Ie[1])).defined(Ie=>Ie.hideZero?!!Ie.key:!0).curve(Tt(e)),yt=B?T.area().y(Ie=>{const _e=ge(Ie.data.dimension);return _e??0}).x0(()=>we(0)).x1(()=>we(0)).defined(Ie=>Ie.hideZero?!!Ie.key:!0).curve(Tt(e)):T.area().x(Ie=>ve(Ie.data.dimension)?ve(Ie.data.dimension):null).y0(()=>z(0)).y1(()=>z(0)).defined(Ie=>Ie.hideZero?!!Ie.key:!0).curve(Tt(e)),et=e.animation.animationEnabled;let lt=ce.selectAll(".parentGroup").data([Ue]);ce.append("g").attr("class","focusClass"),lt=lt.enter().append("g").attr("class","areas parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(lt);let Je=lt.selectAll(".area-group").data(Ie=>Ie),Ee=Je.enter().append("g").attr("class",Ie=>"area-group "+Ie.key.replace(/ /g,"-"));Ee.append("path").attr("hoverId",Ie=>(He.data.filter(_e=>_e.legend===Ie.key)[0].properties.alias||He.data.filter(_e=>_e.legend===Ie.key)[0].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ie=>Ie.color!==ze.white?Ie.color:"none").attr("d",Ie=>et?yt(Ie):Ke(Ie)).each(function(Ie){et&&T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",Ke(Ie))}),Je.select("path").attr("d",Ie=>Ke(Ie)),Ee.merge(Je).select("path").style("opacity",e.plotArea.fillOpacity).attr("stroke",Ie=>Ie.color!==ze.white?Ie.color:"none").attr("stroke-dasharray",(Ie,_e)=>b[_e].properties.lineStyle==="dotted"?"0,3":b[_e].properties.lineStyle==="dashed"?Ta:"").attr("stroke-linecap",(Ie,_e)=>b[_e].properties.lineStyle==="dotted"?xa.round:"").attr("stroke-width",(Ie,_e)=>b[_e].properties.lineStyle!=="None"?b[_e].properties.lineWidth:"0"),Je.exit().remove(),Na(lt,He.data,ee.CombinationStackArea,B?ge:ve,B?we:z,B?C:me,null,e,$,X,R,D,N,!1,void 0,B)},Ge=()=>{let He=ce.selectAll(".parentGroup").data([We]);He=He.enter().append("g").attr("class","stackcolumns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(He);let Ke=He.selectAll(".stackcolumns-group").data(Ee=>Ee);Ke=Ke.enter().append("g").attr("class",Ee=>"stackcolumns-group ").merge(Ke);let et=Ke.selectAll("rect").data(Ee=>Ee);B?et.attr("x",Ee=>Ee.data.axis===Oe.primary?we(Ee[0]):C(Ee[0])).attr("width",Ee=>Ee.data.axis===Oe.primary?N&&Ee[1]>N?we(N)-we(Ee[0]):we(Ee[1])-we(Ee[0]):X&&Ee[1]>X?C(X)-C(Ee[0]):C(Ee[1])-C(Ee[0])):et.attr("y",Ee=>Ee.data.axis===Oe.primary?z(Ee[1]):me(Ee[1])).attr("height",Ee=>Ee.data.axis===Oe.primary?N&&Ee[1]>N?z(Ee[0])-z(N):z(Ee[0])-z(Ee[1]):X&&Ee[1]>X?me(Ee[0])-me(X):me(Ee[0])-me(Ee[1]));const lt=B?et.enter().append("rect").attr("transform",Ee=>`translate(0, ${ge(Ee.data.dimension)-f/2})`).attr("x",Ee=>Ee.data.axis===Oe.primary?we(0):C(0)).attr("width",0):et.enter().append("rect").attr("transform",Ee=>`translate(${ve(Ee.data.dimension)-f/2},0)`).attr("y",Ee=>Ee.data.axis===Oe.primary?z(0):me(0)).attr("height",0);lt.merge(et).attr("hoverId",Ee=>Ee.alias.includes("~$~")?Ee.alias.split("~$~")[1].replace(/ /g,"-"):Ee.alias.replace(/ /g,"-")).attr(B?"y":"x",Ee=>Me(ee.StackColumnChart)).attr(B?"height":"width",Me.bandwidth()).attr("fill",(Ee,Ie,_e)=>{const pt=Array.from(b).findIndex(ot=>ot.legend===Ee.key);return b[pt]?.properties?.color||"gray"}).attr("stroke",(Ee,Ie,_e)=>{const pt=Array.from(b).findIndex(Ci=>Ci.legend===Ee.key),ot=b[pt]?.properties;return ot?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ot.stackBorderColor:"none"}).attr("stroke-dasharray",(Ee,Ie,_e)=>{const pt=Array.from(b).findIndex(ot=>ot.legend===Ee.key);return b[pt]?.properties.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(Ee,Ie,_e)=>{const pt=Array.from(b).findIndex(ot=>ot.legend===Ee.key);return(b[pt]?.properties.stackBorderWidth||0)+"px"}).on("mousemove",(Ee,Ie)=>{xt([{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:$.formattedDimensionListMap.get(Ie.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():Ie.properties?.currentMeasure?Ie.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||Ie.value,value:qe(Ie.data[Ie.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:Ie.key.includes("~$~")?Ie.key.split("~$~")[1]:Ie.key}],e,Ee,b.filter(_e=>_e.legend===Ie.key)[0].properties,(()=>{const _e=b.filter(pt=>pt.legend===Ie.key)[0].properties;return Lt(p,String(Ie.data.dimension??""),{..._e,formattedDimensionValue:String($.formattedDimensionListMap.get(Ie.data.dimension)??Ie.data.dimension??"")})})())}).on("mouseout",ct).attr(rt.SeriesId,Ee=>Ee.key??"").attr(rt.DimValue,Ee=>Array.isArray(Ee.data.dimension)?String(Ee.data.dimension[0]):String(Ee.data.dimension)).on("click",kt(Y,L,(Ee,Ie)=>({seriesId:Ie.key??"",dimValue:Array.isArray(Ie.data.dimension)?String(Ie.data.dimension[0]):String(Ie.data.dimension),legendUniqueId:Ie.key??"",seriesDisplayName:Ie.alias||Ie.key||""})));const Je=e.animation.animationEnabled?lt.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):lt;B?Je.attr("x",Ee=>Ee.data.axis===Oe.primary?we(Ee[0]):C(Ee[0])).attr("width",Ee=>Ee.data.axis===Oe.primary?N&&Ee[1]>N?we(N)-we(Ee[0]):we(Ee[1])-we(Ee[0]):X&&Ee[1]>X?C(X)-C(Ee[0]):C(Ee[1])-C(Ee[0])):Je.attr("y",Ee=>Ee.data.axis===Oe.primary?z(Ee[1]):me(Ee[1])).attr("height",Ee=>Ee.data.axis===Oe.primary?N&&Ee[1]>N?z(Ee[0])-z(N):z(Ee[0])-z(Ee[1]):X&&Ee[1]>X?me(Ee[0])-me(X):me(Ee[0])-me(Ee[1])),Ke.exit().remove()},it=He=>{c=i-He.left-He.right,d=h-He.bottom-He.top},st=(He,Ke,yt)=>{K=Ke,pe=He,ae=yt,ja(l,$e,pe),F(ye,Ye,O,Fe,Ke),K=JSON.parse(JSON.stringify(w)),K.forEach((et,lt)=>{et.properties.type===ee.StackColumnChart||et.properties.type===ee.StackAreaChart?et.data.forEach((Je,Ee)=>K[lt].data[Ee].data=Je.data.filter(Ie=>pe.includes(Ie.dimension))):K[lt].data=et.data.filter(Je=>pe.includes(Je.dimension))}),Ba()};function ja(He,Ke,yt){Ke.clear(),yt&&yt.length>0&&yt.forEach(et=>{Ke.set(et,0)}),He.ChartData&&He.ChartData.length>0&&He.ChartData.forEach(et=>{et.properties.type.includes("Stack")&&et.data.forEach((lt,Je)=>{if(Ke.has(lt.dimension)){let Ee=Ke.get(lt.dimension)||0;Ee+=lt.value||0,Ke.set(lt.dimension,Ee)}})})}const Ba=()=>{W(),ue(),oe(K),B?oa(e,ce,Q,d,c,Se,se,we,$.yMaxLeft,pe,A,t,i,Te,f,ge):la(ce,$,Q,e,a,z,ke,Te,h,f,t,c,d,pe,ve);const He=()=>{B||Jl(K,ve,z,me,le,bt,We,Ue,[],[],f,e,h,i,c,pe,d,m,P,u,Me,s),li($e,B?ge:ve,B?we:z,le,bt,[],e,A,h,i,P,s,B)};if(!B||e.dataTableProperties&&e.dataTableProperties.dataTable){const Ke=B?T.scalePoint().domain(pe).range([0,c]).padding(.5):void 0;Zt(e.plotArea.fitChart,P,ce,v,f,B?we:z,Ke??ve,B?void 0:Me,void 0,void 0,g||a,A,e,te,de,$.dimensionList,c,Ke?[0,c]:Pe,$.formattedDimensionListMap,m,le,d,g>0?d+te:void 0)}P.selectAll(".annotation-group").remove(),He()},yi=He=>{let Ke=He.data.map(et=>et.legend);S=T.stack().keys(Ke).offset(T.stackOffsetDiverging)(He.stackData),He.data.forEach((et,lt)=>et.data.forEach((Je,Ee)=>{Je[0]=S[lt][Ee][0],Je[1]=S[lt][Ee][1]}));let yt=e.annotation.annotationSetLabelColor;return S.forEach((et,lt)=>{et.forEach(Je=>{Je.key=et.key,Je.alias=He.data[lt].properties.alias,et.alias=He.data[lt].properties.alias,et.color=JSON.parse(JSON.stringify(He.data[lt].properties.color)),et.individualAnnotationVisibility=JSON.parse(JSON.stringify(He.data[lt].properties.annotation)),Je.data.labelPosition=e?.annotation?.annotationPosition.toString()==="4"?He.data[lt].properties.annotationPosition.toString():e?.annotation?.annotationPosition.toString(),Je.data.labelColor=yt=="2"?JSON.parse(JSON.stringify(He.data[lt].properties.color)):JSON.parse(JSON.stringify(He.data[lt].properties.labelColor)),Je.hideZero=JSON.parse(JSON.stringify(He.data[lt].properties.hideZeroValues)),Je.data.axis=JSON.parse(JSON.stringify(He.data[lt].properties.axis)),Je.data.color=JSON.parse(JSON.stringify(He.data[lt].properties.color)),Je.data.legend=He.properties.type,Je.data.type=JSON.parse(JSON.stringify(He.data[lt].properties.type))})}),S},ki=()=>{if(ne.length>0){const Ke=(Ye.length>0?mt(pe,Ye,!1):mt(pe,ye,!1)).map(yt=>yt.total);$.yMaxLeft=Math.max($.yMaxLeft,...Ke),$.yMinLeft=Math.min($.yMinLeft,...Ke)}if(Be.length>0){const Ke=(Fe.length>0?mt(pe,Fe,!1):mt(pe,O,!1)).map(yt=>yt.total);$.yMaxRight=Math.max($.yMaxRight,...Ke),$.yMinRight=Math.min($.yMinRight,...Ke)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:Z,id:m,style:{width:"100%",height:"100%"}})})},dr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID();let f=0;const y=ee.LayeredColumnChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList),Y=l.DimensionList,b=!1,H=!1,B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=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,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g,P,ce,z,me,ve,Me=[];const Pe=new Map;let ne=0,Be=2,ye=!1,Ye=[],O={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Fe()}catch(j){Ce("LayeredColumnchart","createLayeredColumnChart",j)}},[e]);const Fe=()=>{({formatOptions:e,svg:h,width:k,height:c}=wt(S,e)),We(),{formatOptions:e,dataTableLegendsList:Ye}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:J,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:D}=$t(e,O.yMinLeft,O.yMaxLeft,O.yMinRight,O.yMaxRight),{margin:N,yLabel:R,xLabel:X,yTitle:le,xTitle:te,dimensionHeightWidthArray:Q,chartTitleHeight:de,secondaryAxisTitleWidth:Le,legendMargin:Te,secondaryYLabel:he,visibleBars:Be,columnWidth:f,scrollbarVisible:ye}=St(k,c,q,J,O.yMaxLeft,e,O.legendList,O.dimensionList,O.yMaxRight,H,B,t,!1,O,Ye),ge(N),{dataTable:d,dataTableHeight:i}=Wt(e,R,le,L,O.dimensionList,l),Ft(h,k,c,e),v=Dt(h,N),Ct(v,e,i,M,x,y,m),Ue(),ke(),Qt(v,e,i,R,z,x),Vt(e,b,h,N,X,c,te,O.chartType,R,M,x),Nt(x,e,i,b,h,N,le,R),Jt(h,H,N,e,i,x,M,he,Le),Pt(h,e,k,de),Et(c,h,Q,de,k,Te,e,L,m,i,N,dt.rectangle,y,r),Xt(L,c,k,h,N,M,ye,Be,O,ne,!1,C)},We=()=>{const j=[],se=[];let Se=[],pe=-1/0,K=1/0,w=-1/0,_=1/0,ae=-1/0,re=1/0;L.forEach($=>{se.push($.properties.legendUniqueId),ae=-1/0,re=1/0,$.data.forEach(V=>{j.push(V),ae=Math.max(ae,V.value),re=Math.min(re,V.value),pe=Math.max(pe,V.value),K=Math.min(K,V.value)}),$.properties.setColorScale&&Pe.set($.properties.legendUniqueId,T.scaleSequential().domain([re,ae]).interpolator(T.interpolateRgb($.properties.startColor,$.properties.endColor)))}),O.chartData=j,O.legendList=se,O.yMaxLeft=pe,O.yMinLeft=K>0?0:K,O.yMaxRight=w,O.yMinRight=_>0?0:_,Se=t?vt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList).map($=>$):O.dimensionList,O.dimensionList.forEach(($,V)=>{O.formattedDimensionListMap.set($,Se[V])}),Me=JSON.parse(JSON.stringify(L)),e.plotArea.fitChart?ve=O.dimensionList:ve=O.dimensionList.slice(ne,ne+Be),e.plotArea.hideZeroValues&&(O.hideZeroValues=!0)},Ue=()=>{let j=ut(I||O.yMaxLeft,O.yMinLeft,x,e,O,G,I).yAxisLabelArray;O.yMaxLeft=j[j.length-1],O.yMinLeft=j[0],a=T.scaleLinear().domain([O.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:0:O.yMinLeft<0?O.yMinLeft*1.1:O.yMinLeft*.9,O.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:O.yMaxLeft*1.1]).range([i>0?x-i:x,0]),ce=[0,M]},xe=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,f]).paddingInner(O.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ve).range(ce).padding(.5)},ke=()=>{De();{let j=ut(I||O.yMaxLeft,O.yMinLeft,x,e,O,G,I);z=T.axisLeft(a).tickFormat(se=>qe(se,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,M)).tickValues(j.autoLabelFlag?void 0:j.yAxisLabelArray).ticks(j.customTickValue).tickPadding(8).tickSizeOuter(0)}},De=()=>{me=T.axisBottom(P).tickSize(ca(e,x,i)).tickSizeOuter(0).tickValues(At(ve,M,e))},$e=j=>{j.forEach(se=>{se.data.forEach(Se=>{Se.hideZero=se.properties.hideZeroValues,Se.properties=se.properties,Se.axis=se.properties.axis})}),j.forEach((se,Se)=>{let pe=v.selectAll(".parentGroup").filter(re=>re?.properties?.legendUniqueId===se.properties.legendUniqueId).data([se],re=>re.properties.legendUniqueId);pe=pe.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",se.properties.legendUniqueId).attr("clip-path",`url(#${m}-clip)`).merge(pe);let K=pe.selectAll(".column-group").data(se.data,re=>re.dimension+"_"+se.properties.legendUniqueId),w=K.enter().append("g").attr("class","column-group").attr("hoverId",(se.properties.alias||se.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",re=>Se===0?`translate(${P(re.dimension)-f/2}, 0)`:`translate(${P(re.dimension)-f/(2+Se*2)}, 0)`);K.attr("transform",re=>Se===0?`translate(${P(re.dimension)-f/2}, 0)`:`translate(${P(re.dimension)-f/(2+Se*2)}, 0)`),w.merge(K).attr("transform",re=>Se===0?`translate(${P(re.dimension)-f/2}, 0)`:`translate(${P(re.dimension)-f/(2+Se*2)}, 0)`);const _=w.append("rect").attr("x",()=>0).attr("width",Se===0?f:f/2+Se*2).attr("y",re=>(se.properties.axis===Oe.primary?a:g)(0)).attr("height",0).attr("fill",re=>Pe.get(se.properties.legendUniqueId)?.(re.value)??se.properties.color).attr("stroke-dasharray",()=>se.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${se.properties.stackBorderWidth}px`).attr("stroke",()=>se.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?se.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",re=>re.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(rt.SeriesId,()=>se.properties.legendUniqueId).attr(rt.DimValue,re=>Array.isArray(re.dimension)?String(re.dimension[0]):String(re.dimension));(e.animation.animationEnabled?_.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):_).attr("y",re=>{const $=se.properties.axis===Oe.primary?a:g;return re.value>0?$(re.value):$(0)}).attr("height",re=>{const $=se.properties.axis===Oe.primary?a:g;return Math.abs($(re.value)-$(0))}),K.select("rect").transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("y",re=>{const $=se.properties.axis===Oe.primary?a:g;return re.value>0?$(re.value):$(0)}).attr("height",re=>{const $=se.properties.axis===Oe.primary?a:g;return Math.abs($(re.value)-$(0))}),w.merge(K).on("mousemove",(re,$)=>{xt([{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:O.formattedDimensionListMap.get(Array.isArray($.dimension)?$.dimension[0]:$.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():$.properties?.currentMeasure?$.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||$.value,value:qe([ee.NormalizedStackLineChart,ee.NormalizedStackAreaChart,""].includes(y)?$[1]-$[0]:$.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:$.properties.alias}],e,re,$.properties,(()=>{const U=Array.isArray($.dimension)?$.dimension[0]:$.dimension;return Lt(p,String(U??""),{...$.properties,formattedDimensionValue:String(O.formattedDimensionListMap.get(U)??U??"")})})());let V=(se.properties.alias||se.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),T.selectAll('[hoverId="'+V+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseout",(re,$)=>{let V=(se.properties.alias||se.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+V+'"]').classed("highlight",!1).classed("unhighlight",!1),ct()}),w.merge(K).on("click",kt(Z,A,(re,$)=>({seriesId:se.properties.legendUniqueId,dimValue:Array.isArray($.dimension)?String($.dimension[0]):String($.dimension),legendUniqueId:se.properties.legendUniqueId,seriesDisplayName:se.properties.alias||se.properties.name||""}))),K.exit().remove()}),v.selectAll(".parentGroup").raise()},ge=j=>{M=k-j.left-j.right,x=c-j.bottom-j.top},we=()=>{xe(),De(),la(v,O,X,e,i,a,me,Q,c,f,t,M,x,ve,P),$e(Me),$a(L,P,a,void 0,N,bt,[],[],e,y,c,k,M,ve,x,m,h,u,void 0,f,s),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),Zt(e.plotArea.fitChart,h,v,d,f,a,P,void 0,void 0,void 0,i,ee.ColumnChart,e,R,le,O.dimensionList,M,ce,O.formattedDimensionListMap,m,N,x))},C=(j,se,Se)=>{Me=se,ve=j,Be=Se,we()};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},yr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,tooltipFormatter:n,onElementClick:o,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let f=0,y=!1;const S=ee.StackColumnChart,A=Ne.useRef(),Z=Ne.useRef(o);Z.current=o;const L=Ne.useRef(p);L.current=p;const Y=l.DimensionList,b=(ft(l.ChartData,l.DimensionList)||[]).reverse(),H=!1,B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=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,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g,P;const ce=new Map;let z,me,ve,Me=[],Pe=0,ne,Be=[],ye=[],Ye=new Map;const O=!1;let Fe={dimensionList:Y,chartType:S,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{We()}catch(w){Ce("StackStackColumnchart","createStackColumnChart",w)}},[e]);const We=()=>{({formatOptions:e,svg:i,width:x,height:k}=wt(A,e)),Ue(),{formatOptions:e,dataTableLegendsList:Be}=zt(e,b,l.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:q}=$t(e,Fe.yMinLeft,Fe.yMaxLeft,Fe.yMinRight,Fe.yMaxRight),{margin:D,yLabel:N,xLabel:R,yTitle:X,xTitle:le,dimensionHeightWidthArray:te,chartTitleHeight:Q,secondaryAxisTitleWidth:de,legendMargin:Le,secondaryYLabel:Te,visibleBars:ne,columnWidth:f,scrollbarVisible:y}=St(x,k,he,q,Fe.yMaxLeft,e,Fe.legendList,Fe.dimensionList,Fe.yMaxRight,B,O,t,!1,Fe,Be),we(D),{dataTable:c,dataTableHeight:d}=Wt(e,N,X,b,Fe.dimensionList,l),Ft(i,x,k,e),h=Dt(i,D),Ct(h,e,d,J,M,S,m),xe(),De(),Qt(h,e,d,N,z,M),Vt(e,H,i,D,R,k,le,Fe.chartType,N,J,M),Nt(M,e,d,H,i,D,X,N),Jt(i,B,D,e,d,M,J,Te,de),Pt(i,e,x,Q),Et(k,i,te,Q,x,Le,e,[...b].reverse(),m,d,D,dt.rectangle,S,r),Xt(b,k,x,i,D,J,y,ne,Fe,Pe,!1,C)},Ue=()=>{const w=[],_=[];let ae=-1/0,re=1/0;b.forEach((W,Ae)=>{const ue=`${Ae}~$~${W.properties.legend}`;W.properties.legend=ue,_.push(ue),ae=-1/0,re=1/0;for(const oe of W.data)ae=Math.max(ae,oe.value),re=Math.min(re,oe.value),w.push(oe);W.properties.setColorScale&&ce.set(W.properties.legendUniqueId,T.scaleSequential().domain([re,ae]).interpolator(ui.interpolateRgb(W.properties.startColor,W.properties.endColor)))}),Fe.chartData=w,Fe.legendList=_,Me=JSON.parse(JSON.stringify(b));let $=mt(Fe.dimensionList,b,O);ve=Fe.dimensionList;const V=T.stack().keys(Fe.legendList).offset(T.stackOffsetDiverging)($);se();let U=1/0,F=-1/0;for(const W of V)for(const[Ae,ue]of W)U=Math.min(U,Ae),F=Math.max(F,ue);Fe.yMinLeft=U>0?0:U,Fe.yMaxLeft=F;let E=t?vt(e.xAxisLabel.xAxisNumberFormat,Fe.dimensionList).map(W=>W):Fe.dimensionList;Fe.dimensionList.forEach((W,Ae)=>{Fe.formattedDimensionListMap.set(W,E[Ae])}),e.plotArea.hideZeroValues&&(Fe.hideZeroValues=!0)},xe=()=>{v=T.scaleLinear().domain([Fe.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:0:Fe.yMinLeft<0?Fe.yMinLeft*1.1:Fe.yMinLeft*.9,Fe.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:Fe.yMaxLeft*1.1]).range([d>0?M-d:M,0]),P=[0,J]},ke=()=>{g=T.scalePoint().domain(ve).range([0,J]).padding(.5)},De=()=>{{const w=ut(I||Fe.yMaxLeft,Fe.yMinLeft,M,e,Fe,G,I);z=T.axisLeft(v).tickFormat(_=>qe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,J)).tickValues(w.autoLabelFlag?void 0:w.yAxisLabelArray).ticks(w.customTickValue).tickPadding(8).tickSizeOuter(0)}},$e=()=>{me=T.axisBottom(g).tickSize(ca(e,M,d,!0)).tickSizeOuter(0).tickValues(At(ve,J,e))},ge=w=>{w.forEach(E=>{E.data.forEach(W=>{W.hideZero=E.properties.hideZeroValues,W.axis=E.properties.axis})}),ve.forEach(E=>{h.append("rect").attr("id",`dim-background-${E}`).attr("class","dimension-background").attr("x",g(E)-g.step()/2).attr("width",g.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let _=h.selectAll(".parentGroup").data([ye]);_=_.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(_);let ae=_.selectAll(".column-group").data(E=>E);ae=ae.enter().append("g").attr("class",E=>"column-group "+E.key.replace(/ /g,"-")).attr("hoverId",E=>E[0]?.properties.alias?qa(E[0]?.properties.alias):qa(E.key)).merge(ae);let $=ae.selectAll("rect").data(E=>E);const V=(E,W)=>{const Ae=Array.from(ae.nodes()).indexOf(E[W].parentNode);return{props:b[Ae]?.properties,groupIndex:Ae}},U=$.enter().append("rect").merge($).attr("x",E=>g(E.data.dimension)-f/2).attr("width",f).attr("y",E=>v(0)).attr("height",0).attr("fill",(E,W,Ae)=>{const{props:ue}=V(Ae,W);return ce.get(ue.legendUniqueId)?.(E.data[E.key])??ue?.color??"gray"}).attr("stroke",(E,W,Ae)=>{const{props:ue}=V(Ae,W);return ue?.stackBorderStyle==0?"none":e.column.stackBorderVisibility?ue.stackBorderColor:"none"}).attr("stroke-dasharray",(E,W,Ae)=>{const{props:ue}=V(Ae,W);return ue?.stackBorderStyle==2?"5,3":"0"}).attr("stroke-width",(E,W,Ae)=>{const{props:ue}=V(Ae,W);return(ue?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(E,W,Ae)=>{const{props:ue}=V(Ae,W);return E.data[E.key]==0&&ue?.hideZeroValues?"hidden":"visible"}).attr(rt.SeriesId,E=>E.key??"").attr(rt.DimValue,E=>Array.isArray(E.data.dimension)?String(E.data.dimension[0]):String(E.data.dimension)).on("mousemove",(E,W)=>{const Ae=String(Fe.formattedDimensionListMap.get(W.data.dimension)??W.data.dimension??""),ue=Lt(n,String(W.data.dimension??""),{...W.properties,formattedDimensionValue:Ae});xt([{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(W.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():W.properties?.currentMeasure?W.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||W.value,value:qe(W.data[W.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:W.properties.alias}],e,E,W.properties,ue)}).on("mouseout",(E,W)=>{ct()}).on("click",kt(L,Z,(E,W)=>({seriesId:W.key??"",dimValue:Array.isArray(W.data.dimension)?String(W.data.dimension[0]):String(W.data.dimension),legendUniqueId:W.key??"",seriesDisplayName:W.properties?.alias||W.key||""})));(e.animation.animationEnabled?U.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):U).attr("y",E=>E[1]>=E[0]?v(E[1]):v(E[0])).attr("height",E=>Math.abs(v(E[0])-v(E[1]))),ae.exit().remove(),h.selectAll(".parentGroup").raise()},we=w=>{J=x-w.left-w.right,M=k-w.bottom-w.top},C=(w,_,ae)=>{Me=_,ve=w,ne=ae,ri(l,Ye,ve),j()},j=()=>{ke(),$e(),la(h,Fe,R,e,d,v,me,te,k,f,t,J,M,ve,g),se();const w=new Map;ve.forEach((_,ae)=>{let re=0;ye.forEach($=>{const V=$[ae]?.[0]??0;V<re&&(re=V)}),w.set(_,re)}),ge(Me),Ya(ye,g,v,a,D,bt,[],[],e,S,k,x,J,ve,M,m,i,u,d,s),li(Ye,g,v,D,bt,[],e,S,k,x,i,s,!1,w),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),Zt(e.plotArea.fitChart,i,h,c,f,v,g,void 0,void 0,void 0,d,S,e,N,X,ve,J,P,Fe.formattedDimensionListMap,m,D,M)),Se()},se=()=>{let w=mt(ve,Me,O);ye=T.stack().keys(Fe.legendList).offset(T.stackOffsetDiverging)(w),Me.forEach((ae,re)=>ae.data.forEach(($,V)=>{$[0]=ye[re][V][0],$[1]=ye[re][V][1]}));let _=e.annotation.annotationSetLabelColor;ye.forEach((ae,re)=>ae.forEach($=>{$.key=ae.key,ae.color=JSON.parse(JSON.stringify(b[re].properties.color)),$.data.labelPosition=b[re].properties.dataLabelPosition,$.data.labelColor=_=="2"?JSON.parse(JSON.stringify(b[re].properties.color)):b[re].properties.labelColor,$.hideZero=JSON.parse(JSON.stringify(b[re].properties.hideZeroValues)),$.properties=b[re].properties}))},Se=()=>{try{const w=e?.connector,_=Number(w?.connectorVisibility);if(!w||_===2)return;let ae,re=[];_===1?ae=1:_===3&&(Number(w.connectorFollow)===1?ae=Number(w.connectorStepSize)||void 0:Number(w.connectorFollow)===2&&(re=w.connectorExclude??[],ae=1));const $=(re||[]).map(W=>String(W).split("-")[0]),V=(ye[0]??[]).map((W,Ae)=>({Dimension:W.data.dimension,Total:W.data.total,CustomTotal:W.data.total,Index:Ae})),U=[],F=[];let E=[];if(ae){if(ae===1)U.push(...V);else for(const W of V)W.Index%ae===0&&U.push(W);for(let W=ae;W<V.length;W+=ae){const Ae=Math.min(W+ae,V.length);let ue=V[W]?.Total??Number.NEGATIVE_INFINITY;for(let oe=W;oe<Ae;oe++)V[oe].Total>ue&&(ue=V[oe].Total);Number.isFinite(ue)&&F.push(ue)}E=U.slice(1)}else{const W=w.connectorCustomRange??[],Ae=new Map;V.forEach(ue=>Ae.set(String(ue.Dimension),ue.Index));for(const ue of W){if(!ue?.from||!ue?.to)continue;const oe=Ae.get(String(ue.from)),fe=Ae.get(String(ue.to));if(oe!=null&&fe!=null){U.push(V[oe]);const Re=Math.min(oe,fe),Ve=Math.max(oe,fe);let be=V[Re]?.Total??Number.NEGATIVE_INFINITY;for(let Ge=Re;Ge<=Ve;Ge++)V[Ge].Total>be&&(be=V[Ge].Total);Number.isFinite(be)&&F.push(be)}}for(const ue of W){if(!ue?.from||!ue?.to)continue;const oe=Ae.get(String(ue.to));oe!=null&&E.push(V[oe])}}h.selectAll("defs > #arrow").remove(),h.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",w.connectorMarkerColor!==ze.white?w.connectorMarkerColor:"none"),pe(U,F,E,ae,$),K(U,F,E,ae,$)}catch{}},pe=(w,_,ae,re,$)=>{try{const V=w.filter((W,Ae)=>re!=null?Ae<w.length-1:Ae<w.length);let U=h.selectAll("path.connector-path").data(V,W=>String(W.Dimension));U.exit().remove(),U.enter().append("path").attr("class","connector-path").style("shape-rendering","crispEdges").attr("fill","none").attr("marker-end","url(#arrow)").merge(U).attr("d",(W,Ae)=>e.total.totalVisibility?`M ${g(W.Dimension)+g.bandwidth()/2+5}, ${v(W.Total)-25} V ${-35+Math.min(v(_[Ae]),v(ae[Ae].Total),v(W.Total))} H ${g(ae[Ae].Dimension)+g.bandwidth()/2-10} V ${-27+v(ae[Ae].Total)}`:`M ${g(W.Dimension)+g.bandwidth()/2+5}, ${v(W.Total)-5} V ${-30+Math.min(v(ae[Ae].Total),v(W.Total))} H ${g(ae[Ae].Dimension)+g.bandwidth()/2-10} V ${-10+v(ae[Ae].Total)}`).style("stroke",e.connector.connectorLineColor!==ze.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",W=>$.includes(W.Dimension)||W.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible")}catch{}},K=(w,_,ae,re,$)=>{try{let V,U=e.connector.connectorFontStyle,F=e.connector.connectorNumberFormat,E=J/30;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(F=".2s");const W=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,Ae=Vi(W,f),ue=Ae*(typeof g.padding=="function"?g.padding():0),oe=w.map((be,Ge)=>({d:be,i:Ge})).filter(be=>re!=null?be.i<w.length-1:be.i<w.length);let fe=h.selectAll("text.connector-text").data(oe,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 Ge=be.d,it=be.i,st=ae[it];return g(st.Dimension)-Ae*re/2}).attr("y",be=>{const Ge=be.d,it=be.i,st=_[it],ja=ae[it],Ba=Math.min(v(ja?.Total??0),v(Ge.Total));return e.total.totalVisibility?E<8?-40+Ba:-41+Ba:E<8?-35+Ba:-40+Ba}).style("text-anchor","middle").text(be=>{const Ge=be.d,it=be.i;return ae[it]?(Ge.CustomTotal==0&&ae[it].CustomTotal!=0&&(Ge.CustomTotal=1),Ti(ae[it].Total,Ge.Total,parseInt(e.connector.connectorDecimalPrecision),F,parseInt(Ge.Dimension),parseInt(ae[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!==ze.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",U.includes("Italic")?"Italic":"").style("text-decoration",U.includes("Underline")?"Underline":"").style("font-weight",U.includes("Bold")?"Bold":"").style("visibility",be=>{const Ge=be.d;return $.includes(Ge.Dimension)||Ge.Total==0&&e.xAxisLabel.hideZeroValues?"hidden":"visible"}).raise()}catch{}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:A,id:m,style:{width:"100%",height:"100%"}})})},ur=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID();let f=0;const y=ee.NormalizedStackColumnChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList).reverse(),Y=l.DimensionList,b=!1,H=!1;let B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,N,R,X,le,te,Q,de,Le,Te,he,q=!1,J,M,x,k,c,d,i,h,v,a,g,P;const ce=new Map;let z,me,ve,Me=[],Pe=0,ne=0,Be=[],ye=[];const Ye=!0;let O={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Fe()}catch(se){Ce("StackNormalizedStackColumnChart","createNormalizedStackColumnChart",se)}},[e]);const Fe=()=>{({formatOptions:e,svg:i,width:x,height:k}=wt(S,e)),We(),{formatOptions:e,dataTableLegendsList:Be}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:Te,maxNumberForSecondaryAxis:he}=$t(e,O.yMinLeft,O.yMaxLeft,O.yMinRight,O.yMaxRight),{margin:I,yLabel:D,xLabel:N,yTitle:R,xTitle:X,dimensionHeightWidthArray:le,chartTitleHeight:te,secondaryAxisTitleWidth:Q,legendMargin:de,secondaryYLabel:Le,visibleBars:ne,columnWidth:f,scrollbarVisible:q}=St(x,k,Te,he,O.yMaxLeft,e,O.legendList,O.dimensionList,O.yMaxRight,H,Ye,t,!1,O,Be),ge(I),{dataTable:c,dataTableHeight:d}=Wt(e,D,R,L,O.dimensionList,l),Ft(i,x,k,e),h=Dt(i,I),Ct(h,e,d,J,M,y),Ue(),ke(),Qt(h,e,d,D,z,M),Vt(e,b,i,I,N,k,X,O.chartType,D,J,M),Nt(M,e,d,b,i,I,R,D),Jt(i,H,I,e,d,M,J,Le,Q),Pt(i,e,x,te),Et(k,i,le,te,x,de,e,[...L].reverse(),m,d,I,dt.rectangle,y,r),Xt(L,k,x,i,I,J,q,ne,O,Pe,!1,we)},We=()=>{const se=[],Se=[];let pe=-1/0,K=1/0;L.forEach(($,V)=>{const U=`${V}~$~${$.properties.legend}`;$.properties.legend=U,Se.push(U),pe=-1/0,K=1/0;for(const F of $.data)pe=Math.max(pe,F.value),K=Math.min(K,F.value),se.push(F);$.properties.setColorScale&&ce.set($.properties.legendUniqueId,T.scaleSequential().domain([K,pe]).interpolator(T.interpolateRgb($.properties.startColor,$.properties.endColor)))}),O.chartData=se,O.legendList=Se,Me=JSON.parse(JSON.stringify(L));let w=mt(O.dimensionList,L,Ye);ve=O.dimensionList;const _=T.stack().keys(O.legendList).offset(T.stackOffsetDiverging)(w);j();let ae=1/0;for(const $ of _)for(const[V]of $)ae=Math.min(ae,V);O.yMinLeft=ae>0?0:ae,O.yMaxLeft=1;let re=t?vt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList).map($=>$):O.dimensionList;O.dimensionList.forEach(($,V)=>{O.formattedDimensionListMap.set($,re[V])}),e.plotArea.hideZeroValues&&(O.hideZeroValues=!0)},Ue=()=>{let se=ut(G||O.yMaxLeft,O.yMinLeft,M,e,O,B,G).yAxisLabelArray;if(O.yMaxLeft=se[se.length-1],O.yMinLeft=se[0],v=T.scaleLinear().domain([O.yMinLeft<0?-1:0,1]).range([d>0?M-d:M,0]),P=[0,J],e.seriesLabel.seriesLabelVisibility){let Se=na(J,v,e,Me,void 0,H,M,!0);Se.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&Se.heightWidth[0],e.seriesLabel.seriesLabelPosition=="Right"?P=[0,J-Se.heightWidth[0]]:P=[Se.heightWidth[0],J]}},xe=()=>{g=T.scalePoint().domain(ve).range(P).padding(.5)},ke=()=>{{const se=e.yAxisLabel.yAxisTicksMode===Da.custom,Se=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0;z=T.axisLeft(v).tickFormat(T.format(`.${Se}%`)).tickSize(Yt(e,J)).tickValues(se?za(O.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null).ticks(d>0?(M-d)/80:M/80).tickPadding(8).tickSizeOuter(0)}},De=()=>{me=T.axisBottom(g).tickSize(ca(e,M,d,!0)).tickSizeOuter(0).tickValues(At(ve,J,e))},$e=se=>{ye.forEach((V,U)=>V.forEach((F,E)=>{se[U].data[E]&&se[U].data[E][0]!==void 0&&se[U].data[E][1]!==void 0&&(se[U].data[E][0]=F[0]=F.data.total===0?0:F[0]/F.data.total,se[U].data[E][1]=F[1]=F.data.total===0?0:F[1]/F.data.total)})),se.forEach(V=>{V.data.forEach(U=>{U.hideZero=V.properties.hideZeroValues,U.axis=V.properties.axis})}),ve.forEach(V=>{h.append("rect").attr("id",`dim-background-${V}`).attr("class","dimension-background").attr("x",g(V)-g.step()/2).attr("width",g.step()).attr("y",0).attr("height",M).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Se=h.selectAll(".parentGroup").data([ye]);Se=Se.enter().append("g").attr("class","columns parentGroup").merge(Se);let pe=Se.selectAll(".column-group").data(V=>V);pe=pe.enter().append("g").attr("class",V=>"column-group "+V.key.replace(/ /g,"-")).attr("hoverId",V=>(se[V.index].properties.alias||se[V.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(pe);let w=pe.selectAll("rect").data(V=>V);const _=(V,U)=>{const F=Array.from(pe.nodes()).indexOf(V[U].parentNode);return{props:L[F]?.properties,groupIndex:F}},ae=w.enter().append("rect").attr("x",V=>g(V.data.dimension)-f/2).attr("width",f).attr("y",v(0)).attr("height",0).attr("fill",(V,U,F)=>{const{props:E}=_(F,U);return ce.get(E.legendUniqueId)?.(V.data[V.key])??E?.color??"gray"}).attr("stroke",(V,U,F)=>{const{props:E}=_(F,U);return E?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?E.stackBorderColor:"none"}).attr("stroke-dasharray",(V,U,F)=>{const{props:E}=_(F,U);return E?.stackBorderStyle===2?"5,3":"0"}).attr("stroke-width",(V,U,F)=>{const{props:E}=_(F,U);return(E?.stackBorderWidth||0)+"px"}).style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",(V,U,F)=>{const{props:E}=_(F,U);return V.data[V.key]===0&&E?.hideZeroValues?"hidden":"visible"}).attr(rt.SeriesId,V=>V.key??"").attr(rt.DimValue,V=>Array.isArray(V.data.dimension)?String(V.data.dimension[0]):String(V.data.dimension)),re=e.animation.animationEnabled;(V=>re?V.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):V)(ae).attr("y",V=>V[1]>=V[0]?v(V[1]):v(V[0])).attr("height",V=>Math.abs(v(V[0])-v(V[1]))),ae.merge(w).on("mousemove",(V,U)=>{xt([{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:O.formattedDimensionListMap.get(U.data.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():U.properties?.currentMeasure?U.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||U.value,value:qe(U[1]-U[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:U.properties.alias}],e,V,U.properties,Lt(p,String(U.data.dimension??""),{...U.properties,formattedDimensionValue:String(O.formattedDimensionListMap.get(U.data.dimension)??U.data.dimension??"")}))}).on("mouseout",(V,U)=>{ct()}).on("click",kt(Z,A,(V,U)=>({seriesId:U.key??"",dimValue:Array.isArray(U.data.dimension)?String(U.data.dimension[0]):String(U.data.dimension),legendUniqueId:U.key??"",seriesDisplayName:U.properties?.alias||U.key||""}))),pe.exit().remove(),h.selectAll(".parentGroup").raise()},ge=se=>{J=x-se.left-se.right,M=k-se.bottom-se.top},we=(se,Se,pe)=>{Me=Se,ve=se,ne=pe,C()},C=()=>{xe(),De(),j(),la(h,O,N,e,d,v,me,le,k,f,t,J,M,ve,g),$e(Me),Ya(ye,g,v,a,I,bt,[],[],e,y,k,x,J,ve,M,m,i,u,d,s),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),Zt(e.plotArea.fitChart,i,h,c,g.bandwidth(),v,g,void 0,void 0,void 0,d,y,e,D,R,O.dimensionList,J,P,O.formattedDimensionListMap,m,I,M))},j=()=>{let se=mt(ve,Me,Ye);ye=T.stack().keys(O.legendList).offset(T.stackOffsetDiverging)(se),Me.forEach((pe,K)=>pe.data.forEach((w,_)=>{w[0]=ye[K][_][0],w[1]=ye[K][_][1]}));let Se=e.annotation.annotationSetLabelColor;ye.forEach((pe,K)=>pe.forEach(w=>{w.key=pe.key,pe.color=JSON.parse(JSON.stringify(L[K].properties.color)),pe.individualAnnotationVisibility=JSON.parse(JSON.stringify(L[K].properties.individualAnnotationVisibility)),w.data.labelPosition=L[K].properties.dataLabelPosition,w.data.labelColor=Se=="2"?JSON.parse(JSON.stringify(L[K].properties.color)):L[K].properties.labelColor,w.hideZero=JSON.parse(JSON.stringify(L[K].properties.hideZeroValues)),w.properties=L[K].properties}))};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ma="ChartsWithoutAxisFunctions.ts";function tl(t,e,l){if(!e?.plotArea?.plotAreaRangeFilter?.enabled)return t;const{condition:s,minVal:u,maxVal:r}=e.plotArea.plotAreaRangeFilter;return t.filter(n=>{const o=l(n);switch(s){case"lt":return o<=r;case"gt":return o>=u;case"in":return o>=u&&o<=r;case"not-in":return o<u||o>r;default:return!0}})}function al(t,e,l,s,u,r){try{s.xAxisLabel.xAxisDateFormat=s.xAxisLabel.xAxisDateFormat=="DD-MM-YYYY"?",":s.xAxisLabel.xAxisDateFormat;let n={top:0,left:0,right:0,bottom:0},o=t*.15*.8,p=r[0],m=o<p+10?o:p+10,f=s.plotArea.numberOfBubbles?20:0;const y=Qe(s.xAxisLabel.xAxisDisplayUnits,s.xAxisLabel.xAxisNumberFormat,s.xAxisLabel.xAxisLabelDecimalPrecision??"2")(u).toString();let A=It(y,s.xAxisLabel.xAxisLabelFontSize,s.xAxisLabel.xAxisLabelFontFamily,s.xAxisLabel.xAxisLabelRotation)[3]+10,Z=s.xAxisTitle.xAxisTitleVisibility?s.xAxisTitle.xAxisDynamicTitleText.length!==0?Ut(s.xAxisTitle.xAxisTitleHTML,void 0,void 0).height:Ut(s.xAxisTitle.xAxisTitleText,13,at).height:0;Z=Z>e*.1?e*.1:Z;let L=s.xAxisLabel.xAxisLabelVisibility?A:0,Y=s.yAxisTitle.yAxisTitleVisibility?s.yAxisTitle.yAxisDynamicTitleText.length!==0?Ut(s.yAxisTitle.yAxisTitleHTML,void 0,void 0).height:Ut(s.yAxisTitle.yAxisTitleText,13,at).height:0;Y=Y>t*.1?t*.1:Y;let b=s.yAxisLabel.yAxisLabelVisibility?Ut(Qe(s.yAxisLabel.yAxisDisplayUnits,s.yAxisLabel.yAxisNumberFormat,s.yAxisLabel.yAxisLabelDecimalPrecision??"2")(l).toString(),nt(s.yAxisLabel.yAxisLabelFontSize),s.yAxisLabel.yAxisLabelFontFamily,s.yAxisLabel.yAxisLabelRotation).width+10:0,H=s.chartTitle.chartTitleVisibility?s.chartTitle.dynamicTitleText.length!==0?Ut(s.chartTitle.chartTitleHTML,void 0,void 0).height:Ut(s.chartTitle.chartTitleText,16,at).height:0;H=H>e*.1?e*.1:H;let B=s.legends.legendPosition,G=s.legends.legendVisibility,I=!1;switch(G||(B="None"),B){case Ze.none:n.top=H+5,n.bottom=Z+L+5+f,n.right=15,n.left=Y+b+5;break;case Ze.top:n.top=40+H,n.bottom=Z+L+5+f,n.right=15,n.left=Y+b+5;break;case Ze.right:n.right=m+35,n.top=H+5,n.bottom=Z+L+5+f,n.left=Y+b+5;break;case Ze.bottom:n.bottom=40+L+Z+f,n.top=H+5,n.right=15,n.left=Y+b+5;break;case Ze.left:n.left=m+Y+b+33,n.top=H+5,n.bottom=Z+L+5+f,n.right=15}s.xAxisLabel.xAxisPosition&&s.xAxisLabel.xAxisPosition=="1"&&(n.bottom=n.bottom-L,n.top=n.top+L);let D=s.chartPadding.paddingArrayLTRB;D&&(n.top+=D[1],n.bottom+=D[3],n.right+=D[2],n.left+=D[0]);let N=e-n.top-n.bottom,R=t-n.left-n.right;return{margins:n,yLabel:b,xLabel:L,yTitle:Y,xTitle:Z,chartTitleHeight:H,legendMargin:m,innerHeight:N,innerWidth:R}}catch(n){Sa(Ma,"marginCalculationForBubbleScatter",n)}}function il(t,e,l){try{let s=parseFloat(t.yAxisLabel.yAxisIntervalText),u=parseFloat(t.yAxisLabel.yAxisMaxText),r=parseFloat(t.yAxisLabel.yAxisMinText);if(t.yAxisLabel.yAxisIntervalsVisibility){r=t.yAxisLabel.yAxisMinText!==""?parseFloat(t.yAxisLabel.yAxisMinText):e;let y=t.yAxisLabel.yAxisMaxText;u=y.length>0?parseFloat(y):l,u&&(l=u)}else u=l,r=e,s=void 0;let n=e?Qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(e).toString().length:0,o=l?Qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(l).toString().length:0,p=u?Qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(u).toString().length:0,m=r?Qe(t.yAxisLabel.yAxisDisplayUnits,t.yAxisLabel.yAxisNumberFormat,t.yAxisLabel.yAxisLabelDecimalPrecision??"2")(r).toString().length:0,f=n<o?l:e;if(r){let y=m<o?l:r;f=f<y?y:f}if(u){let y=p>n?u:e;f=f<y?y:f}return u&&r&&(f=p>m?u:r),{longestMeasure:f,customYaxisIntervalValue:s,customYaxisMaxValue:u,customYaxisMinValue:r}}catch(s){Sa(Ma,"customYscaleLabelFormatting",s)}}function ll(t,e,l){try{let s=parseFloat(t.xAxisLabel.xAxisIntervalText),u=parseFloat(t.xAxisLabel.xAxisMaxText),r=parseFloat(t.xAxisLabel.xAxisMinText);if(t.xAxisLabel.xAxisIntervalsVisibility){r=t.xAxisLabel.xAxisMinText!==""?parseFloat(t.xAxisLabel.xAxisMinText):e;let y=t.xAxisLabel.xAxisMaxText.toString();u=y.length>0?parseFloat(y):l,u&&(l=u)}else u=l,r=e,s=void 0;let n=e?Qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(e).toString().length:0,o=l?Qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(l).toString().length:0,p=u?Qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(u).toString().length:0,m=r?Qe(t.xAxisLabel.xAxisDisplayUnits,t.xAxisLabel.xAxisNumberFormat,t.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r).toString().length:0,f=n<o?l:e;if(r){let y=m<o?l:r;f=f<y?y:f}if(u){let y=p>n?u:e;f=f<y?y:f}return u&&r&&(f=p>m?u:r),{longestDimension:f,customXaxisIntervalValue:s,customXaxisMaxValue:u,customXaxisMinValue:r}}catch(s){Sa(Ma,"customXscaleLabelFormatting",s)}}function rl(t,e,l,s,u,r,n,o,p,m,f){try{let y=t.xAxisLabel.xAxisPosition,S=!0,Z=l.append("foreignObject").attr("visibility",e?t.yAxisTitle.yAxisTitleVisibility?"visible":"hidden":t.xAxisTitle.xAxisTitleVisibility?"visible":"hidden").attr("transform",!t.plotArea.fitChart&&S?`translate(${s.left},${s.top+f+(t?.xAxisLabel?.xAxisPosition=="1"?0:u)})`:!t.plotArea.fitChart&&!1?`translate(${s.left},${r-n-5})`:`translate(${s.left},${s.top+f+(S?t?.xAxisLabel?.xAxisPosition=="1"?0:u:o=="tornado"?u+5:p+5)})`).attr("class","xAxisTitle").attr("width",m).attr("height",n+"px").style("z-index","9999");t.xAxisTitle.xAxisDynamicTitleText.length!==0?Z.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):Z.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(y){Sa(Ma,"setXaxistitle",y)}}function nl(t,e,l,s,u,r,n,o){try{let p=l>0?t-l:t,m=u.append("foreignObject").attr("visibility",s?e.xAxisTitle.xAxisTitleVisibility?"visible":"hidden":e.yAxisTitle.yAxisTitleVisibility?"visible":"hidden").attr("x",`-${r.top+p}`).attr("y",r.left-n-o+5).attr("class","yAxisTitle").attr("transform","rotate(-90)").attr("width",p).attr("height",n+"px");return e.yAxisTitle.yAxisDynamicTitleText.length!==0?m.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):m.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),u}catch(p){Sa(Ma,"yAxistitle",p)}}function sl(t,e,l,s,u,r){try{let n=parseFloat(s.yAxisLabel.yAxisIntervalText),o=[],p;if(n&&n!==0&&n!==void 0){let m=u||u==0?u:e,f=r||r==0?r:t;m<0?p=Math.floor((f-m)/n):p=Math.floor(f/n);let y=18;(r||r==0)&&(t=r);let S=u||u==0?u:e<0?Math.round(e):0;if(o.push(S),p>100){let A="Tick count cannot exceed more than 100.";m<0?n=(f-S)/100:n=f/100}if(p=p<100?p:100,p>y)for(let A=0;A<parseInt(p)&&(S+=n,parseFloat(S.toFixed(5))<=t);A++)o.push(S);else for(let A=0;A<y&&(S+=n,S<=t);A++)o.push(S)}else if(s.yAxisLabel.yAxisTicksMode===Da.custom){let m=u||u==0?u:e;o=za(m,t,s.yAxisLabel.yAxisTicksCount),p=o.length}else p=l/60;return{yAxisLabelArray:o,customTickValue:p}}catch(n){Sa(Ma,"responsiveYaxisLabel",n)}}function vi(t,e,l,s,u,r,n,o){try{let p=!0,m=parseFloat(s.xAxisLabel.xAxisIntervalText),f=[],y;if(m&&m!==0&&m!==void 0){let S=u||u==0?u:e,A=r||r==0?r:t;S<0?y=Math.floor((A-S)/m):y=Math.floor(A/m);let Z=18;(r||r==0)&&(t=r);let L=u||u==0?u:e<0?Math.round(e):0;if(f.push(L),p=!1,y>100){let Y="Tick count cannot exceed more than 100.";S<0?m=(A-L)/100:m=A/100}if(y=y<100?y:100,y>Z)for(let Y=0;Y<parseInt(y)&&(L+=m,parseFloat(L.toFixed(5))<=t);Y++)f.push(L);else for(let Y=0;Y<Z&&(L+=m,L<=t);Y++)f.push(L)}else if(s.xAxisLabel.xAxisTicksMode===Da.custom){let S=u||u==0?u:e,A=r||r==0?r:t;f=za(S,A,s.xAxisLabel.xAxisTicksCount),p=!1,y=f.length}else{const S=Qe(s.xAxisLabel.xAxisDisplayUnits,s.xAxisLabel.xAxisDateFormat,s.xAxisLabel.xAxisLabelDecimalPrecision??"2")(r||t).toString();let A=It(S,s.xAxisLabel.xAxisLabelFontSize,s.xAxisLabel.xAxisLabelFontFamily,0);f=Wi(u||e,r||t,o?n:l,A[0]),y=l/30}return{xAxisLabelArray:f,customTickValue:y,autoLabelFlag:p}}catch(p){Sa(Ma,"responsiveXaxisLabel",p)}}function ol(t,e,l,s,u,r){try{let n=e.yAxisLabel.yAxisLabelFontStyle;t.append("rect").attr("transform",`translate(${-s},0)`).attr("height",l>0?r-l:r).attr("width",s).attr("fill",e.yAxisLabel.yAxisLabelVisibility&&e.yAxisLabel.yAxisBackgroundColor?e.yAxisLabel.yAxisBackgroundColor!==ze.white?e.yAxisLabel.yAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const o=t.append("g").call(u);o.selectAll("line").style("shape-rendering","crispEdges").attr("stroke",e.plotArea.gridLinesColor).attr("stroke-width","0.05em"),o.selectAll("text").style("fill",e.yAxisLabel.yAxisLabelColor!==ze.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",n.includes(ie.italic)?ie.italic:"").style("text-decoration",n.includes(ie.underline)?ie.underline:"").style("font-weight",n.includes(ie.bold)?ie.bold:"").attr("visibility",e.yAxisLabel.yAxisLabelVisibility?"visible":"hidden"),o.select(".domain").style("shape-rendering","crispEdges").style("stroke",e.yAxisLabel.yAxisColor).attr("stroke-width",e.yAxisLabel.yAxisWidth?e.yAxisLabel.yAxisWidth:e.plotArea.plotAreaBorderThickness)}catch(n){Sa(Ma,"initYaxis",n)}}function cl(t,e,l,s,u,r,n,o,p){try{let m=e.xAxisLabel.xAxisLabelFontStyle,f=e.xAxisLabel.xAxisPosition,y=e.xAxisLabel.xAxisLabelRotation;y=parseInt(y),t.append("rect").attr("transform",`translate(1,${f==="0"?l>0?r-l:r:f==="1"?-s:p(0)})`).attr("height",s).attr("width",n).attr("fill",e.xAxisLabel.xAxisLabelVisibility&&e.xAxisLabel.xAxisBackgroundColor?e.xAxisLabel.xAxisBackgroundColor!==ze.white?e.xAxisLabel.xAxisBackgroundColor:"none":e.chartArea.chartAreaColor);const S=t.append("g").attr("transform",`translate(0,${f==="0"?r:f==="1"?0:p(0)})`).call(u);let A=f==="1"?"5":"0";S.selectAll("g").append("foreignObject").attr("class","testingoverflowing").style("width",Math.round(s)).style("height","20px").attr("transform",(L,Y)=>`rotate(${f==="1"?-y:y!=0?180-y:0}) translate (${y!=0?A+", -5":-s/2+" , "+(f==="1"?"-15":"8")})`).append("xhtml:h3").style("transform",f==="1"?"":y!=0?"rotate(180deg)":"0").style("white-space","pre").style("text-overflow","ellipsis").style("text-align",y!=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",m.includes(ie.italic)?ie.italic:"").style("text-decoration",m.includes(ie.underline)?ie.underline:"").style("font-weight",m.includes(ie.bold)?ie.bold:"").style("visibility",e.xAxisLabel.xAxisLabelVisibility?"visible":"hidden").attr("title",(L,Y)=>Qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(L)).html((L,Y)=>Qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision)(L)),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(m){Sa(Ma,"initXaxis",m)}}function dl(t,e,l,s,u,r,n,o,p,m,f){try{if(!l.annotation.annotationVisibility)return;const y=l.plotArea.annotationType??"1",S=[y==="1"?"connector":""],A=l.plotArea.connectorType?.toLowerCase()??"none",Z=y==="5",L=l.plotArea.rotation??0,Y=u===ee.PieChart?1.06:1.1,b={1:"",2:T.curveLinear,3:T.curveStep},H=(q,J)=>[[0,0],[q/2,J/2],[q,J]],B={solid:"unset",dotted:"2,2",dashed:"6,4"};let G=t.annotation(),I=JSON.parse(JSON.stringify(l.plotArea.dataLabelsCoordinates||[]));I=I.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:r,height:n}));const D=e.reduce((q,J)=>q+(J?.data?.data?.[0]?.value??0),0),N=D===0?1:D,R=(q,J)=>{const M=q.data.data[0].value,x=(q.x0+q.x1)/2,k=q.x1-q.x0;return{note:{title:l.plotArea.dataLabelName?q.data.legend:"",label:l.plotArea.dataLabelValue&&M!==0?l.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(M/N)*100).toFixed(nt(l.plotArea.dataLabelDecimalPrecision))+"%":Qe(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(M):"",align:"middle",wrap:1e3},data:{x:{legend:q.data.legend},y:{value:M},midAngle:x,isVisible:!0,hoverId:q?.data?.legend?.replace(/\s+/g,"-")??""},legendUniqueId:q.data.legend,dx:0,dy:0,connector:{end:A,curve:b[l.plotArea.connectorCurve],points:Z?H(0,0):[[0,0],[0,0]]},disable:S,subject:{radius:3},type:xr(t,y),color:l.plotArea.connectorColor??"#ccc",width:r,height:n,index:J}};let X=e.filter(q=>q.x1-q.x0>1e-4).map(R);const le=q=>(q.data.y?.value??0)!==0;X=X.filter(le),X=Ht(X,l,q=>q.data.y.value);let te=new Map(I.map(q=>[q.data?.x?.legend,q])),Q=[];X.forEach(q=>{const J=q.data.x.legend,M=te.get(J);if(M){if(M.ratioDistance!=null&&M.ratioAngle!=null){const x=M.ratioDistance*p;q.dx=Math.cos(M.ratioAngle)*x,q.dy=Math.sin(M.ratioAngle)*x}else{const x=p/(M.radius||p);q.dx=M.dx*x,q.dy=M.dy*x}q.data.isVisible=M.data?.isVisible??!0,M.connectorPoints?.length>=(Z?3:2)?q.connector.points=M.connectorPoints:q.connector.points=Z?H(q.dx,q.dy):[[0,0],[0,0]]}Q.push(q)}),G.editMode(l.plotArea.annotationDraggable&&m).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){Q.forEach(M=>{if(M.data.x.legend===q.data.x.legend){const x=q._dx,k=q._dy,c=Math.sqrt(x*x+k*k),d=Math.atan2(k,x);M.dx=x,M.dy=k,M.ratioDistance=c/p,M.ratioAngle=d,M.width=r,M.height=n,M.connectorPoints=q.connector?.points||[]}});const J=Q.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:r,height:n,radius:p}));f&&f(J)}).annotations(Q);const de=o.append("g").attr("class","annotation-group parentGroup").attr("transform",s).call(G),Le=l.plotArea.dataLabelNameFontStyle??[];de.selectAll(".annotation-note-title").style("font-family",l.plotArea.dataLabelNameFontFamily).style("font-size",`${l.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",l.plotArea.dataLabelNameColor??"#000");const Te=l.plotArea.dataLabelValueFontStyle??[];if(de.selectAll(".annotation-note-label").style("font-family",l.plotArea.dataLabelValueFontFamily).style("font-size",`${l.plotArea.dataLabelValueFontSize}px`).style("font-style",Te.includes("Italic")?"italic":"").style("text-decoration",Te.includes("Underline")?"underline":"").style("font-weight",Te.includes("Bold")?"bold":"").style("fill",l.plotArea.dataLabelValueColor??"#000"),l.plotArea.plotAreaAbsoluteValue&&de.selectAll(".annotation-note-label").each(function(q){const J=T.select(this),M=T.format(".2s")(Math.abs(q.data.y.value));J.append("tspan").attr("x",J.attr("x")??"0").attr("dy","1.2em").attr("fill-opacity",.5).attr("font-weight","300").style("font-family",l.plotArea.dataLabelValueFontFamily).style("font-size",`${l.plotArea.dataLabelValueFontSize}px`).style("fill",l.plotArea.dataLabelValueColor??"#000").text(M)}),A==="diamond"){const q=l.plotArea.connectorColor??"#ccc",J=5;de.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,${-J} ${J},0 0,${J} ${-J},0`).style("fill",q).style("stroke",q)})}if(de.selectAll("rect,.annotation-subject").remove(),l.animation?.animationEnabled){const q=l.animation.animationDuration,J=tt[l.animation.animationEffect],M=de.selectAll(".annotation-note-label");M.interrupt().style("opacity",0),setTimeout(()=>{M.transition().delay((x,k)=>k*30).duration(q).ease(J).style("opacity",1)},50)}const he=l.plotArea.connectorColor??"#ccc";de.selectAll(".connector").style("stroke",he).attr("hoverId",q=>q.data.hoverId).attr("stroke-dasharray",B[l.plotArea.connectorStyle?.toLowerCase()]),de.selectAll(".connector-end").attr("hoverId",q=>q.data.hoverId).style("fill",he).style("stroke",he),de.selectAll(".annotation-note-title").attr("hoverId",q=>q.data.hoverId),de.selectAll(".annotation-note-label").attr("hoverId",q=>q.data.hoverId).filter(q=>!q.data.isVisible).style("display","none"),de.selectAll(".annotation-note-label").filter(q=>l.plotArea.hideInsignificantValue&&q.data.x1-q.data.x0<.09).style("visibility","hidden")}catch(y){throw y}}const xr=(t,e)=>{try{return{1:t.annotationLabel,2:t.annotationLabel,3:t.annotationCallout,4:t.annotationCalloutElbow,5:t.annotationCalloutCurve}[e]}catch(l){throw l}},yl=(t,e,l,s,u,r,n,o,p,m)=>{try{if(l.plotArea.numberOfBubbles){let f=e=="Bottom"?s-55:s-25;t.append("foreignObject").attr("transform",`translate(${r.left},${f})`).attr("width",u).attr("height","20px").append("xhtml:div").style("white-space","pre").style("color",ze.black).style("font-size","12px ").style("text-overflow","ellipsis").html((l.plotArea.totalAlias?l.plotArea.totalAliasText:"Total count : ")+m)}}catch(f){Sa(Ma,"setnumberOfBubbles",f)}};function Sa(t,e,l){console.error(`[${t}] [${e}]`,l)}const hr=({isDateType:t,formatOptions:e,data:l})=>{const s=crypto.randomUUID(),u=0,r=ee.ColumnHistogramChart,n=Ne.useRef(),o=l.ChartData,p=l.DimensionList,m=!1,f=!1,y=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,A=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Z=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,L=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,Y,b,H,B,G,I,D,N,R,X,le,te,Q,de,Le,Te=[],he=[],q,J,M,x,k,c,d,i,h,v,a,g,P,ce=[],z=0;const me=2;let ve=[],Me={dimensionList:p,chartType:r,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Pe()}catch(De){Ce("Columnchart","createColumnChart",De)}},[e]);const Pe=()=>{({formatOptions:e,svg:k,width:q,height:J}=wt(n,e)),{formatOptions:e,dataTableLegendsList:ve}=zt(e,o,l.DataTableData??[]),ne(),{maxNumberForPrimaryAxis:le,maxNumberForSecondaryAxis:te}=$t(e,Me.yMinLeft,Me.yMaxLeft,Me.yMinRight,Me.yMaxRight),{margin:Y,yLabel:b,xLabel:H,yTitle:B,xTitle:G,dimensionHeightWidthArray:I,chartTitleHeight:D,secondaryAxisTitleWidth:N,legendMargin:R,secondaryYLabel:X}=St(q,J,le,te,Me.yMaxLeft,e,Me.legendList,Me.dimensionList,Me.yMaxRight,f,y,t,m,Me,ve),Ue(Y),{dataTable:M,dataTableHeight:x}=Wt(e,b,B,o,Me.dimensionList),Ft(k,q,J,e),c=Dt(k,Y),Ct(c,e,x,Q,de,r),Be(),Ye(),O(),Qt(c,e,x,b,a,de),xe(o,J,k,Y,Q),e.dataTableProperties&&e.dataTableProperties.dataTable&&(e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1),Zt(e.plotArea.fitChart,k,c,M,u,d,i,h,void 0,void 0,x,r,e,b,B,Me.dimensionList,Q,v,Me.formattedDimensionListMap,s,Y,de)),Vt(e,m,k,Y,H,J,G,Me.chartType,b,Q,de),Nt(de,e,x,m,k,Y,B,b),Jt(k,f,Y,e,x,de,Q,X,N),Pt(k,e,q,D),Et(J,k,I,D,q,R,e,o,s,x,Y,dt.rectangle)},ne=()=>{const De=[],$e=[];let ge=[],we=-1/0,C=1/0;o.forEach(Se=>{$e.push(Se.legend),Se.data.forEach(pe=>{De.push(pe),we=Math.max(we,pe.value),C=Math.min(C,pe.value)})}),Me.chartData=De,Me.legendList=$e,Me.yMaxLeft=we,Me.yMinLeft=C>0?0:C,ce=JSON.parse(JSON.stringify(o)),ce.forEach(Se=>Se.data.forEach(pe=>ge.push(pe.value)));let j=S||S==0?S:0,se=A||A==0?A:ce[0]?.data?.length;if(Me.yMaxLeft=parseFloat((j+"").length>(se+"").length?j+"":se+""),Me.xMax=T.max(ge),Me.xMin=T.min(ge),Me.xMin===Me.xMax){const Se=Me.xMax===0?1:Math.abs(Me.xMax*.1);Me.xMin-=Se,Me.xMax+=Se}},Be=()=>{switch(e.bins.binsCalculation){case"Automatic":Le=Q/50;break;case"Number of Bins":ye(!1);break;case"Bin Width":ye(!0)}},ye=De=>{ce.forEach(C=>C.data.sort(function(j,se){return j.value-se.value}));let $e=Me.xMax-Me.xMin,ge;De?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ge=$e/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ge=$e/parseFloat(e.bins.binsCalculationValue));let we=Me.xMin;if(De)for(Te=[we];we<Me.xMax;)we+=ge,Te.push(we);else for(Te=[we];Math.round(we)<Math.round(Me.xMax);)we+=ge,Te.push(Math.round(we))},Ye=()=>{i=T.scaleLinear().domain([Me.xMin,Me.xMax]).range([0,Q]);const De=Te.length>0?Te:i.ticks(Le);let $e=T.bin().value(we=>we).domain(i.domain()).thresholds(De);ce.forEach(we=>{let C=$e(we.data.map(j=>j.value));he.push(C)}),ce.forEach((we,C)=>he[C].forEach(j=>{j.name=we.properties.legend,j.color=we.properties.color,j.opacity=we.properties.opacity}));let ge=[];he.forEach(we=>we.forEach(C=>ge.push(C.length))),Me.yMaxLeft=T.max(ge),Me.yMinLeft=T.min(ge),d=T.scaleLinear().range([de,0]).domain([S||S==0?S:0,A||A==0?A:Me.yMaxLeft+.2*Me.yMaxLeft])},O=()=>{Fe();{let De=ut(Me.yMaxLeft,Me.yMinLeft,de,e,Me,S,A,!1,Q);a=T.axisLeft(d).tickFormat($e=>qe($e,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,Q)).tickValues(De.autoLabelFlag?void 0:De.yAxisLabelArray).ticks(De.customTickValue).tickPadding(8).tickSizeOuter(0)}},Fe=()=>{let De=parseInt(e.xAxisLabel.xAxisPosition);vi(Me.xMax,Me.xMin,Q,e,Z,L,de,!1).xAxisLabelArray.shift(),g=(De==1?T.axisTop(i):T.axisBottom(i)).tickFormat(ge=>qe(ge,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(ca(e,de,x)).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?g.ticks(Le):g.tickValues(Te).ticks(Q/50)},We=De=>{const $e=e.animation.animationEnabled,ge=c.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+s+" .rect").data(he).enter().append("g").selectAll("rect").data(C=>C).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(C){return"translate("+i(C.x0)+","+de+")"}).attr("width",function(C){return i(C.x1)-i(C.x0)-parseFloat(e.bins.binsGapWidth)<0?0:i(C.x1)-i(C.x0)-parseFloat(e.bins.binsGapWidth)}).attr("height",0).style("fill",C=>C.color!==ze.white?C.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",(C,j)=>{xt([{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.x0}-${j.x1}`},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():j.properties?.currentMeasure?j.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:qe(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(j.length/ce[0].data.length):j.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,C)}).on("mouseout",ct);($e?ge.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):ge).attr("transform",function(C){return"translate("+i(C.x0)+","+(d(C.length)>0?d(C.length):0)+")"}).attr("height",function(C){return de-d(C.length)}),c.selectAll(".parentGroup").raise()},Ue=De=>{Q=q-De.left-De.right,de=J-De.bottom-De.top},xe=(De,$e,ge,we,C)=>{if(!e.plotArea.fitChart){const j=De[0].data.length-me,se=$e-20;P=Me.dimensionList.slice(z,z+me),ce=JSON.parse(JSON.stringify(De)),ce.forEach((K,w)=>ce[w].data=K.data.filter(_=>P.includes(_.dimension))),ge.append("rect").attr("x",we.left).attr("y",se).attr("width",C).attr("height",8).attr("fill","#ddd").attr("rx",4);const Se=C*me/Me.dimensionList.length,pe=ge.append("rect").attr("x",we.left).attr("y",se).attr("width",Se).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",K=>{let w=Math.min(Math.max(K.x,we.left),we.left+C-Se);pe.attr("x",w),z=Math.round((w-we.left)/(C-Se)*j),P=Me.dimensionList.slice(z,z+me),ce=JSON.parse(JSON.stringify(De)),ce.forEach((_,ae)=>ce[ae].data=_.data.filter(re=>P.includes(re.dimension))),Fe(),ke()}));ge.on("wheel",K=>{K.preventDefault();const w=Math.abs(K.deltaX)>Math.abs(K.deltaY)?K.deltaX:K.deltaY;z+=w>0?1:-1,z=Math.max(0,Math.min(z,j));const _=we.left+(C-Se)*z/j;pe.attr("x",_),ce=JSON.parse(JSON.stringify(De)),ce.forEach((ae,re)=>ce[re].data=ae.data.filter($=>P.includes($.dimension))),Fe(),ke()})}ke()},ke=()=>{la(c,Me,H,e,x,d,g,I,J,u,t,Q,de,P,i),We()};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:n,id:s,style:{width:"100%",height:"100%"}})})},pr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,tooltipFormatter:n,onElementClick:o,vfxPickModeActive:p})=>{const m=crypto.randomUUID(),f=0,y=ee.LineChart,S=Ne.useRef(),A=Ne.useRef(o);A.current=o;const Z=Ne.useRef(p);Z.current=p;const L=ft(l.ChartData,l.DimensionList),Y=l.DimensionList,b=!!e.swapAxis?.swapAxisEnabled;let H=!1;const B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,R,X,le,te,Q,de,Le,Te,he,q,J,M,x=!1,k,c,d,i,h,v,a=0,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe,We,Ue,xe,ke=[],De=0,$e=0,ge=0,we=[],C={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{j()}catch(V){Ce("Linechart","createLineChart",V)}},[e]);const j=()=>{({formatOptions:e,svg:g,width:d,height:i}=wt(S,e)),se(),{formatOptions:e,dataTableLegendsList:we}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:M,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:N}=$t(e,C.yMinLeft,C.yMaxLeft,C.yMinRight,C.yMaxRight),{margin:R,yLabel:X,xLabel:le,yTitle:te,xTitle:Q,dimensionHeightWidthArray:de,chartTitleHeight:Le,secondaryAxisTitleWidth:Te,legendMargin:he,secondaryYLabel:q,visibleBars:$e,columnWidth:ge,scrollbarVisible:x}=St(d,i,J,M,C.yMaxLeft,e,C.legendList,C.dimensionList,C.yMaxRight,H,B,t,b,C,we),{dataTable:h,dataTableHeight:v}=Wt(e,b?le:X,b?Q:te,L,C.dimensionList,l),b&&h.length>0&&(a=v,R.bottom+=a,v=0),re(R),Ft(g,d,i,e),P=Dt(g,R),Ct(P,e,v,k,c,y,m),Se(),w(),b?(sa(e,P,X,c,k,Fe),H&&Li(e,P,q,We,k)):(Qt(P,e,v,X,Pe,c),H&&gi(P,e,v,q,Be,c,k)),Vt(e,b,g,R,le,i,Q,C.chartType,X,k,c),Nt(c+a,e,v,b,g,R,te,X,k),H&&Jt(g,H,R,e,v,c,k,q,Te,b),Pt(g,e,d,Le),Et(i,g,de,Le,d,he,e,L,m,v,R,dt.line,y,r),Xt(L,i,d,g,R,k,x,$e,C,De,!1,pe,b)},se=()=>{const V=[],U=[];let F=[],E=-1/0,W=1/0,Ae=-1/0,ue=1/0;e.plotArea.hideZeroValues&&(C.hideZeroValues=!0),L.forEach(oe=>{U.push(oe.properties.alias?oe.properties.alias:oe.legend),oe.data.forEach(fe=>{V.push(fe),oe.properties.axis==="Secondary"?(H=!0,Ae=Math.max(Ae,fe.value),ue=Math.min(ue,fe.value)):(E=Math.max(E,fe.value),W=Math.min(W,fe.value))})}),C.chartData=V,C.legendList=U,C.yMaxLeft=E,C.yMinLeft=W,C.yMaxRight=Ae,C.yMinRight=ue,F=t?vt(e.xAxisLabel.xAxisNumberFormat,C.dimensionList).map(oe=>oe):C.dimensionList,C.dimensionList.forEach((oe,fe)=>{C.formattedDimensionListMap.set(oe,F[fe])}),ke=JSON.parse(JSON.stringify(L)),e.plotArea.fitChart?xe=C.dimensionList:xe=C.dimensionList.slice(De,De+$e)},Se=()=>{let V=ut(I||C.yMaxLeft,C.yMinLeft,c,e,C,G,I,b,k).yAxisLabelArray;C.yMaxLeft=V[V.length-1],C.yMinLeft=V[0];const U=b?[0,v>0?k-v:k]:[v>0?c-v:c,0];{const F=T.scaleLinear().domain([C.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:C.yMinLeft*.9:C.yMinLeft<0?C.yMinLeft*1.1:C.yMinLeft*.9,C.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:C.yMaxLeft*1.1]).range(U);b?Ye=F:ce=F}if(H){const F=T.scaleLinear().domain([C.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:C.yMinRight*1.1,C.yMaxRight<=0?N||0:N||C.yMaxRight*1.1]).range(U);b?O=F:z=F}if(ve=b?[c,0]:[0,k],!b&&e.seriesLabel.seriesLabelVisibility){let F=na(k,ce,e,ke,z,H,c,!1);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(Me=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?ve=[0,k-F.heightWidth[0]]:ve=[F.heightWidth[0],k]}},pe=(V,U,F)=>{ke=U,xe=V,$e=F,$()},K=()=>{const V=T.scalePoint().domain(xe).range(ve).padding(.5);b?ye=V:me=V},w=()=>{{let V=ut(I||C.yMaxLeft,C.yMinLeft,c,e,C,G,I,b,k);b?Fe=T.axisBottom(Ye).tickFormat(U=>qe(U,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-c:0).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/50).tickPadding(8).tickSizeOuter(0):Pe=T.axisLeft(ce).tickFormat(U=>qe(U,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,k,Me)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue).tickPadding(8).tickSizeOuter(0)}if(H){let V=ut(N||C.yMaxRight,D||C.yMinRight,c,e,C,D,N);b?We=T.axisTop(O).tickFormat(U=>qe(U,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/50).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-c:0).tickPadding(8).tickSizeOuter(0):Be=T.axisRight(z).tickFormat(U=>qe(U,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue).tickSize(Yt(e,k,Me)).tickPadding(8).tickSizeOuter(0)}},_=()=>{b?Ue=T.axisLeft(ye).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*k*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(xe,c,e)):ne=T.axisBottom(me).tickSize(ca(e,c,v,!0)).tickSizeOuter(0).tickValues(At(xe,k,e))},ae=V=>{const U=[...V].reverse();U.forEach(fe=>{fe.data.forEach(Re=>{Re.hideZero=fe.properties.hideZeroValues,Re.axis=fe.properties.axis})});const F=b?T.line().y(fe=>{const Re=ye(fe.dimension);return Re??0}).x(fe=>fe.axis===Oe.primary?Ye(fe.value):O(fe.value)).defined(fe=>fe.hideZero||C.hideZeroValues?!!fe.value:!0).curve(Tt(e)):T.line().x(fe=>{const Re=me(fe.dimension);return Re??0}).y(fe=>fe.axis===Oe.primary?ce(fe.value):z(fe.value)).defined(fe=>fe.hideZero||C.hideZeroValues?!!fe.value:!0).curve(Tt(e)),E=e.animation.animationEnabled,W=fe=>E?fe.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):fe;let Ae=P.selectAll(".parentGroup").data([U]);Ae=Ae.enter().append("g").attr("class","lines parentGroup").merge(Ae);let ue=Ae.selectAll(".line-group").data(fe=>fe),oe=ue.enter().append("g").attr("class","line-group");oe.append("path").attr("class","visibleLine").attr("fill","none"),oe.merge(ue).each(function(fe){const Ve=T.select(this).selectAll("path.visibleLine").data([fe]).join("path").attr("class","visibleLine").attr("d",be=>F(be.data)).attr("stroke",be=>be.properties.color!==ze.white?be.properties.color:"none").attr("stroke-dasharray",be=>{const Ge=parseInt(be.properties.lineWidth);switch(be.properties.lineStyle){case gt.dotted:return`0,${Ge+2}`;case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",be=>be.properties.lineStyle===gt.dotted?xa.round:"").attr("stroke-width",be=>be.properties.lineStyle!=="None"?be.properties.lineWidth:0).attr("hoverId",(fe.properties.alias||fe.properties.name||"Legend").replace(/\s+/g,"-")).attr("clip-path",`url(#${m}-clip)`).attr("d",be=>F(be.data)).attr(rt.SeriesId,be=>be.properties.legendUniqueId).attr(rt.DimValue,be=>be.properties.alias||be.properties.name||"").on("click",kt(Z,A,(be,Ge)=>({seriesId:Ge.properties.legendUniqueId,dimValue:Ge.properties.alias||Ge.properties.name||"",legendUniqueId:Ge.properties.legendUniqueId,seriesDisplayName:Ge.properties.alias||Ge.properties.name||""})));E&&Ve.each(function(){const be=T.select(this),Ge=this.getTotalLength();be.attr("stroke-dasharray",Ge+" "+Ge).attr("stroke-dashoffset",Ge),W(be).attr("stroke-dashoffset",0)})}),ue.exit().remove(),Na(Ae,U,"None",b?ye:me,b?Ye:ce,b?O:z,null,e,C,N,D,G,I,!1,n,b),P.selectAll(".parentGroup").raise()},re=V=>{k=d-V.left-V.right,c=i-V.bottom-V.top},$=()=>{if(K(),_(),b?oa(e,P,le,c,k,Ue,We,Ye,C.yMaxLeft,xe,y,t,d,de,ge,ye):la(P,C,le,e,v,ce,ne,de,i,k/xe.length,t,k,c,xe,me),ae(ke),$a(L,b?ye:me,b?Ye:ce,b?O:z,R,bt,[],[],e,y,i,d,k,xe,c,m,g,u,void 0,void 0,s,!1,b),!b){let V=na(k,ce,e,ke,z,H,c,!1).labelArray;Ja(e,P,V)}if(e.dataTableProperties&&e.dataTableProperties.dataTable){!b&&e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1);const V=b?T.scalePoint().domain(xe).range([0,k]).padding(.5):void 0;Zt(e.plotArea.fitChart,g,P,h,f,b?Ye:ce,V??me,void 0,void 0,void 0,a||v,y,e,X,te,b?xe:C.dimensionList,k,V?[0,k]:ve,C.formattedDimensionListMap,m,R,c,a>0?c+X:void 0)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},br=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID(),f=0,y=ee.StackLineChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=l.DimensionList,Y=(ft(l.ChartData,l.DimensionList)||[]).reverse(),b=!!e.swapAxis?.swapAxisEnabled,H=new Map,B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v=0,a,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe,We,Ue=[],xe=0,ke=2,De=!1,$e=0,ge=[],we=[];const C=!1;let j={dimensionList:L,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{se()}catch(F){Ce("StackLinechart","createStackLineChart",F)}},[e]);const se=()=>{({formatOptions:e,svg:a,width:c,height:d}=wt(S,e)),Se(),{formatOptions:e,dataTableLegendsList:ge}=zt(e,Y,l.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:M}=$t(e,j.yMinLeft,j.yMaxLeft,j.yMinRight,j.yMaxRight),{margin:R,yLabel:X,xLabel:le,yTitle:te,xTitle:Q,dimensionHeightWidthArray:de,chartTitleHeight:Le,secondaryAxisTitleWidth:Te,legendMargin:he,secondaryYLabel:q,visibleBars:ke,columnWidth:$e,scrollbarVisible:De}=St(c,d,J,M,j.yMaxLeft,e,j.legendList,j.dimensionList,j.yMaxRight,B,C,t,b,j,ge),{dataTable:i,dataTableHeight:h}=Wt(e,b?le:X,b?Q:te,Y,j.dimensionList,l),b&&i.length>0&&(v=h,R.bottom+=v,h=0),re(R),Ft(a,c,d,e),g=Dt(a,R),Ct(g,e,h,x,k+v,y,m),pe(),w(),b?sa(e,g,X,k,x,Ye):Qt(g,e,h,X,Me,k),Vt(e,b,a,R,le,d,Q,j.chartType,X,x,k),Nt(k+v,e,h,b,a,R,te,X,x),Jt(a,B,R,e,h,k,x,q,Te,b),Pt(a,e,c,Le),Et(d,a,de,Le,c,he,e,[...Y].reverse(),m,h,R,dt.line,y,r),Xt(Y,d,c,a,R,x,De,ke,j,xe,!1,U,b),li(H,b?ne:z,b?Be:P,R,bt,[],e,y,d,c,a,s,b)},Se=()=>{const F=[],E=[];e.plotArea.hideZeroValues&&(j.hideZeroValues=!0),Y.forEach((Re,Ve)=>{const be=`${Ve}~$~${Re.properties.alias?Re.properties.alias:Re.legend}`;Re.properties.legend=be,E.push(be);for(const Ge of Re.data)F.push(Ge)}),j.chartData=F,j.legendList=E,Ue=JSON.parse(JSON.stringify(Y));let W=mt(j.dimensionList,Y,C);e.plotArea.fitChart?We=j.dimensionList:(We=j.dimensionList.slice(xe,xe+ke),Ue.forEach((Re,Ve)=>Ue[Ve].data=Re.data.filter(be=>We.includes(be.dimension))));const Ae=T.stack().keys(j.legendList).offset(T.stackOffsetDiverging)(W);V();let ue=1/0,oe=-1/0;for(const Re of Ae)for(const[Ve,be]of Re)ue=Math.min(ue,Ve),oe=Math.max(oe,be);j.yMinLeft=ue>0?0:ue,j.yMaxLeft=oe;let fe=t?vt(e.xAxisLabel.xAxisNumberFormat,j.dimensionList).map(Re=>Re):j.dimensionList;j.dimensionList.forEach((Re,Ve)=>{j.formattedDimensionListMap.set(Re,fe[Ve])})},pe=()=>{let F=ut(I||j.yMaxLeft,j.yMinLeft,k,e,j,G,I,b,x).yAxisLabelArray;j.yMaxLeft=F[F.length-1],j.yMinLeft=F[0];const E=b?[0,h>0?x-h:x]:[h>0?k-h:k,0];{const W=T.scaleLinear().domain([j.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:0:j.yMinLeft<0?j.yMinLeft*1.1:j.yMinLeft*.9,j.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:j.yMaxLeft*1.1]).range(E);b?Be=W:P=W}if(me=b?[k,0]:[0,x],!b&&e.seriesLabel.seriesLabelVisibility){let W=na(x,P,e,Ue,void 0,B,k,!0);W.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(ve=W.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?me=[0,x-W.heightWidth[0]]:me=[W.heightWidth[0],x]}K()},K=()=>{const F=T.scalePoint().domain(We).range(me).padding(.5);b?ne=F:z=F},w=()=>{_();{let F=ut(I||j.yMaxLeft,j.yMinLeft,k,e,j,G,I,b,x);b?Ye=T.axisBottom(Be).tickFormat(E=>qe(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(F.autoLabelFlag?void 0:F.yAxisLabelArray).ticks(F.customTickValue??x/50).tickPadding(8).tickSizeOuter(0):Me=T.axisLeft(P).tickFormat(E=>qe(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,x,ve)).tickValues(F.autoLabelFlag?void 0:F.yAxisLabelArray).ticks(F.customTickValue).tickPadding(8).tickSizeOuter(0)}},_=()=>{b?Fe=T.axisLeft(ne).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*x*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(We,k,e)):Pe=T.axisBottom(z).tickSize(ca(e,k,h,!0)).tickSizeOuter(0).tickValues(At(We,x,e))},ae=F=>{F.forEach(oe=>{oe.data.forEach(fe=>{fe.hideZero=oe.properties.hideZeroValues,fe.axis=oe.properties.axis})});const E=b?T.line().y(oe=>{const fe=ne(oe.data.dimension);return fe??0}).x(oe=>oe[1]>0?Be(oe[1]):Be(oe[0])).defined(oe=>{const fe=oe;return fe.hideZero||j.hideZeroValues?fe.data[fe.key]:!0}).curve(Tt(e)):T.line().x(oe=>{const fe=z(oe.data.dimension);return fe??0}).y(oe=>oe[1]>0?P(oe[1]):P(oe[0])).defined(oe=>{const fe=oe;return fe.hideZero||j.hideZeroValues?fe.data[fe.key]:!0}).curve(Tt(e));let W=g.selectAll(".parentGroup").data([we]);W=W.enter().append("g").attr("class","lines parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(W);let Ae=W.selectAll(".line-group").data(oe=>oe);const ue=Ae.enter().append("g").attr("class",oe=>"line-group "+oe.key.replace(/ /g,"-"));ue.append("path").attr("class","line").attr("fill","none"),ue.merge(Ae).each(function(oe,fe){const Re=T.select(this),Ve=Re.selectAll("path.visibleLine").data([oe]).join("path").attr("class","visibleLine").attr("hoverId",it=>(Y[fe]?.properties?.alias||Y[fe]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",E(oe)).attr("stroke",oe.color!==ze.white?oe.color:"none").attr("stroke-dasharray",it=>{const st=parseInt(Y[fe].properties.lineWidth.toString());switch(Y[fe].properties.lineStyle){case gt.dotted:return`0,${st+2}`;case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",Y[fe].properties.lineStyle===gt.dotted?xa.round:"").attr("stroke-width",Y[fe].properties.lineStyle!==gt.none?Y[fe].properties.lineWidth:0).attr("fill","none").attr(rt.SeriesId,Y[fe].properties.legendUniqueId).attr(rt.DimValue,Y[fe].properties.alias||Y[fe].properties.name||"").on("click",kt(Z,A,()=>({seriesId:Y[fe].properties.legendUniqueId,dimValue:Y[fe].properties.alias||Y[fe].properties.name||"",legendUniqueId:Y[fe].properties.legendUniqueId,seriesDisplayName:Y[fe].properties.alias||Y[fe].properties.name||""}))),be=e.animation.animationEnabled,Ge=Ve.node().getTotalLength();be?Ve.attr("stroke-dasharray",Ge+" "+Ge).attr("stroke-dashoffset",Ge).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("stroke-dashoffset",0):Ve.attr("stroke-dasharray",Ge+" "+Ge).attr("stroke-dashoffset",0),Re.selectAll("path.hoverLine").data([oe]).join("path").attr("class","hoverLine").attr("d",E(oe)).attr("stroke",ze.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(){a.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),a.selectAll('[hoverId="'+fi(Y[fe].properties.alias||Y[fe].properties.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(){a.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1)})}),Ae.exit().remove(),Na(W,F,y,b?ne:z,b?Be:P,b?ye:ce,null,e,j,N,D,G,I,!1,p,b)},re=F=>{x=c-F.left-F.right,k=d-F.bottom-F.top},$=()=>{if(K(),_(),b?oa(e,g,le,k,x,Fe,O,Be,j.yMaxLeft,We,y,t,c,de,$e,ne):la(g,j,le,e,h,P,Pe,de,d,f,t,x,k,We,z),V(),ae(Ue),Ya(we,b?ne:z,b?Be:P,b?ye:ce,R,bt,[],[],e,y,d,c,x,We,k,m,a,u,h,s,b),!b){let F=na(x,P,e,Ue,void 0,B,k,!0).labelArray;Ja(e,g,F)}if(e.dataTableProperties&&e.dataTableProperties.dataTable){!b&&e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1);const F=b?T.scalePoint().domain(We).range([0,x]).padding(.5):void 0;Zt(e.plotArea.fitChart,a,g,i,f,b?Be:P,F??z,void 0,void 0,void 0,v||h,ee.LineChart,e,X,te,j.dimensionList,x,F?[0,x]:me,j.formattedDimensionListMap,m,R,k,v>0?k+X:void 0)}},V=()=>{let F=mt(We,Ue,C);we=T.stack().keys(j.legendList).offset(T.stackOffsetDiverging)(F),Ue.forEach((W,Ae)=>W.data.forEach((ue,oe)=>{ue[0]=we[Ae][oe][0],ue[1]=we[Ae][oe][1]}));let E=e.annotation.annotationSetLabelColor;we.forEach((W,Ae)=>W.forEach(ue=>{ue.key=W.key,W.color=JSON.parse(JSON.stringify(Y[Ae].properties.color)),W.individualAnnotationVisibility=JSON.parse(JSON.stringify(Y[Ae].properties.individualAnnotationVisibility)),ue.data.labelPosition=Y[Ae].properties.dataLabelPosition,ue.data.labelColor=E=="2"?JSON.parse(JSON.stringify(Y[Ae].properties.color)):Y[Ae].properties.labelColor,ue.hideZero=JSON.parse(JSON.stringify(Y[Ae].properties.hideZeroValues)),ue.properties=Y[Ae].properties}))},U=(F,E,W)=>{Ue=E,We=F,ke=W,ri(l,H,We),$()};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},gr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID(),f=0,y=ee.NormalizedStackLineChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList)?.reverse()||[],Y=l.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,H=!1;let B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h=0,v,a,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe,We=[],Ue=0,xe,ke=0,De=!1,$e=[],ge=[];const we=!0;let C={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{j()}catch(F){Ce("NormalizedLinechart","createNormalizedLinechart",F)}},[e]);const j=()=>{({formatOptions:e,svg:v,width:k,height:c}=wt(S,e)),se(),{formatOptions:e,dataTableLegendsList:$e}=zt(e,L,l.DataTableData??[]),{margin:N,yLabel:R,xLabel:X,yTitle:le,xTitle:te,dimensionHeightWidthArray:Q,chartTitleHeight:de,secondaryAxisTitleWidth:Le,legendMargin:Te,secondaryYLabel:he,visibleBars:xe,columnWidth:ke,scrollbarVisible:De}=St(k,c,q,J,C.yMaxLeft,e,C.legendList,C.dimensionList,C.yMaxRight,H,we,t,b,C,$e),{dataTable:d,dataTableHeight:i}=Wt(e,b?X:R,b?te:le,L,C.dimensionList,l),b&&d.length>0&&(h=i,N.bottom+=h,i=0),re(N),Ft(v,k,c,e),a=Dt(v,N),Ct(a,e,i,M,x+h,y,m),Se(),w(),b?sa(e,a,R,x,M,ye):Qt(a,e,i,R,ve,x),Vt(e,b,v,N,X,c,te,C.chartType,R,M,x),Nt(x+h,e,i,b,v,N,le,R,M),Jt(v,H,N,e,i,x,M,he,Le,b),Pt(v,e,k,de),Et(c,v,Q,de,k,Te,e,[...L].reverse(),m,i,N,dt.line,y,r),Xt(L,c,k,v,N,M,De,xe,C,Ue,!1,$,b)},se=()=>{const F=[],E=[];e.plotArea.hideZeroValues&&(C.hideZeroValues=!0,L.forEach(fe=>{fe.data=fe.data.filter(Re=>Re.value!==0)})),L.forEach((fe,Re)=>{const Ve=`${Re}~$~${fe.properties.legend}`;fe.properties.legend=Ve,E.push(Ve);for(const be of fe.data)F.push(be)}),C.chartData=F,C.legendList=E,We=JSON.parse(JSON.stringify(L)),Fe=C.dimensionList;const W=mt(C.dimensionList,L,we),Ae=T.stack().keys(C.legendList).offset(T.stackOffsetDiverging)(W);U();let ue=1/0;for(const fe of Ae)for(const[Re]of fe)ue=Math.min(ue,Re);C.yMinLeft=ue>0?0:ue,C.yMaxLeft=1;const oe=t?vt(e.xAxisLabel.xAxisNumberFormat,C.dimensionList).map(fe=>fe):C.dimensionList;C.formattedDimensionListMap=new Map(C.dimensionList.map((fe,Re)=>[fe,oe[Re]]))},Se=()=>{const F=b?[0,i>0?M-i:M]:[i>0?x-i:x,0];{const E=T.scaleLinear().domain([C.yMinLeft<0?-1:0,1]).range(F);b?ne=E:g=E}if(z=b?[x,0]:[0,M],!b&&e.seriesLabel.seriesLabelVisibility){K(ge,We);let E=na(M,g,e,We,void 0,H,x,!0);E.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=E.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?z=[0,M-E.heightWidth[0]]:z=[E.heightWidth[0],M]}},pe=()=>{const F=T.scalePoint().domain(Fe).range(z).padding(.5);b?Pe=F:ce=F};function K(F,E){F.forEach((W,Ae)=>W.forEach((ue,oe)=>{E[Ae]&&E[Ae].data[oe]&&(E[Ae].data[oe][0]=ue[0]=ue.data.total===0?0:ue[0]/ue.data.total,E[Ae].data[oe][1]=ue[1]=ue.data.total===0?0:ue[1]/ue.data.total)}))}const w=()=>{{const F=e.yAxisLabel.yAxisTicksMode===Da.custom,E=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0,W=F?za(C.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null;b?ye=T.axisBottom(ne).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-x:0).tickValues(W).tickFormat(T.format(`.${E}%`)).ticks(i>0?(M-i)/80:M/80).tickPadding(8).tickSizeOuter(0):ve=T.axisLeft(g).tickSize(Yt(e,M,me)).tickValues(W).tickFormat(T.format(`.${E}%`)).ticks(i>0?(x-i)/80:x/80).tickPadding(8).tickSizeOuter(0)}},_=()=>{b?O=T.axisLeft(Pe).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(Fe,x,e)):Me=T.axisBottom(ce).tickSize(ca(e,x,i,!0)).tickSizeOuter(0).tickValues(At(Fe,M,e))},ae=F=>{K(ge,We),F.forEach(oe=>{oe.data.forEach(fe=>{fe.hideZero=oe.properties.hideZeroValues,fe.axis=oe.properties.axis})});const E=b?T.line().y(oe=>{const fe=Pe(oe.data.dimension);return fe??0}).x(oe=>oe[1]>0?ne(oe[1]):ne(oe[0])).curve(Tt(e)):T.line().x(oe=>ce(oe.data.dimension)?ce(oe.data.dimension):null).y(oe=>oe[1]>0?g(oe[1]):g(oe[0])).curve(Tt(e));let W=a.selectAll(".parentGroup").data([ge]);W=W.enter().append("g").attr("class","lines parentGroup").merge(W);let Ae=W.selectAll(".line-group").data(oe=>oe),ue=Ae.enter().append("g").attr("class",oe=>"line-group "+oe.key.replace(/ /g,"-"));ue.attr("hoverId",oe=>(F[oe.index]?.properties?.alias||F[oe.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).append("path").attr("class","line").attr("fill","none"),ue.merge(Ae).each(function(oe,fe){const Re=T.select(this),Ve=Re.selectAll("path.visibleLine").data([oe]).join("path").attr("class","visibleLine").attr("d",E(oe)).attr("stroke",oe.color!==ze.white?oe.color:"none").attr("stroke-dasharray",it=>{const st=parseInt(L[fe].properties.lineWidth.toString());switch(L[fe].properties.lineStyle){case gt.dotted:return`0,${st+2}`;case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",L[fe].properties.lineStyle===gt.dotted?xa.round:"").attr("stroke-width",L[fe].properties.lineStyle!==gt.none?L[fe].properties.lineWidth:0).attr("fill","none").attr(rt.SeriesId,L[fe].properties.legendUniqueId).attr(rt.DimValue,L[fe].properties.alias||L[fe].properties.name||"").on("click",kt(Z,A,()=>({seriesId:L[fe].properties.legendUniqueId,dimValue:L[fe].properties.alias||L[fe].properties.name||"",legendUniqueId:L[fe].properties.legendUniqueId,seriesDisplayName:L[fe].properties.alias||L[fe].properties.name||""}))),be=e.animation.animationEnabled,Ge=Ve.node().getTotalLength();be?Ve.attr("stroke-dasharray",Ge+" "+Ge).attr("stroke-dashoffset",Ge).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("stroke-dashoffset",0):Ve.attr("stroke-dasharray",Ge+" "+Ge).attr("stroke-dashoffset",0),Re.selectAll("path.hoverLine").data([oe]).join("path").attr("class","hoverLine").attr("d",E(oe)).attr("stroke",ze.transparent).attr("stroke-width",20).attr("fill","none").style("pointer-events","stroke").on("mouseenter",function(it,st){v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),v.selectAll('[hoverId="'+fi(F[st.index]?.properties?.alias||F[st.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!0).classed("unhighlight",!1)}).on("mouseleave",function(it,st){v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll('[hoverId="'+fi(F[st.index]?.properties?.alias||st[st.index]?.properties?.name||"Legend").replace(/\s+/g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)})}),Ae.exit().remove(),Na(W,F,y,b?Pe:ce,b?ne:g,b?Be:P,null,e,C,D,I,B,G,!0,p,b)},re=F=>{M=k-F.left-F.right,x=c-F.bottom-F.top},$=(F,E,W)=>{We=E,Fe=F,xe=W,V()},V=()=>{if(pe(),U(),_(),b?oa(e,a,X,x,M,O,Ye,ne,C.yMaxLeft,Fe,y,t,k,Q,ke,Pe):la(a,C,X,e,i,g,Me,Q,c,f,t,M,x,Fe,ce),ae(We),Ya(ge,b?Pe:ce,b?ne:g,b?Be:P,N,bt,[],[],e,y,c,k,M,Fe,x,m,v,u,i,s,b),!b){let F=na(M,g,e,We,void 0,H,x,!0).labelArray;Ja(e,a,F)}if(e.dataTableProperties&&e.dataTableProperties.dataTable){!b&&e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1);const F=b?T.scalePoint().domain(Fe).range([0,M]).padding(.5):void 0;Zt(e.plotArea.fitChart,v,a,d,f,b?ne:g,F??ce,void 0,void 0,void 0,h||i,ee.LineChart,e,R,le,C.dimensionList,M,F?[0,M]:z,C.formattedDimensionListMap,m,N,x,h>0?x+R:void 0)}},U=()=>{let F=mt(Fe,We,we);ge=T.stack().keys(C.legendList).offset(T.stackOffsetDiverging)(F),We.forEach((W,Ae)=>W.data.forEach((ue,oe)=>{ue[0]=ge[Ae][oe][0],ue[1]=ge[Ae][oe][1]}));let E=e.annotation.annotationSetLabelColor;ge.forEach((W,Ae)=>W.forEach(ue=>{ue.key=W.key,W.color=JSON.parse(JSON.stringify(L[Ae].properties.color)),ue.data.labelPosition=L[Ae].properties.dataLabelPosition,ue.data.labelColor=E=="2"?JSON.parse(JSON.stringify(L[Ae].properties.color)):L[Ae].properties.labelColor,ue.hideZero=JSON.parse(JSON.stringify(L[Ae].properties.hideZeroValues)),ue.properties=L[Ae].properties}))};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Ar=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,tooltipFormatter:n,onElementClick:o,vfxPickModeActive:p})=>{const m=crypto.randomUUID();let f=0;const y=ee.HorizontalBarChart,S=Ne.useRef(),A=Ne.useRef(o);A.current=o;const Z=Ne.useRef(p);Z.current=p;const L=ft(l.ChartData,l.DimensionList),Y=l.DimensionList,b=!0;let H=!1;const B=!1,G=new Map;let I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,D=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,R=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,X,le,te,Q,de,Le,Te,he,q,J,M,x,k=new Map,c,d,i,h,v,a,g=0,P=[],ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe=[],We=0,Ue=2,xe=!1,ke={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{De()}catch(w){Ce("HorizontalBarchart","createHorizontalBarChart",w)}},[e]);const De=()=>{({formatOptions:e,svg:ce,width:i,height:h}=wt(S,e)),$e(),{formatOptions:e,dataTableLegendsList:P}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:M,maxNumberForSecondaryAxis:x,customYaxisMaxValue:D,secondaryCustomYaxisMaxValue:R}=$t(e,ke.yMinLeft,ke.yMaxLeft,ke.yMinRight,ke.yMaxRight),{margin:X,yLabel:le,xLabel:te,yTitle:Q,xTitle:de,dimensionHeightWidthArray:Le,chartTitleHeight:Te,secondaryAxisTitleWidth:he,legendMargin:q,secondaryYLabel:J,visibleBars:Ue,columnWidth:f,scrollbarVisible:xe}=St(i,h,M,x,ke.yMaxLeft,e,ke.legendList,ke.dimensionList,ke.yMaxRight,H,B,t,b,ke,P);const w=e.xAxisLabel.xAxisLabelVisibility;({dataTable:v,dataTableHeight:a}=Wt(e,te,de,L,ke.dimensionList,l)),e.xAxisLabel.xAxisLabelVisibility=w,v.length>0&&(g=a,X.bottom+=g,a=0),Se(X),Ft(ce,i,h,e),z=Dt(ce,X),Ct(z,e,a,c,d+g,y,m),ge(),C(),sa(e,z,le,d,c,Be),H&&Li(e,z,J,ye,c),Vt(e,b,ce,X,te,h,de,ke.chartType,le,c,d),Nt(d+g,e,a,b,ce,X,Q,le,c),Jt(ce,H,X,e,a,d,c,J,he,b),Pt(ce,e,i,Te),Et(h,ce,Le,Te,i,q,e,L,m,a,X,dt.rectangle,y,r),Xt(L,h,i,ce,X,c,xe,Ue,ke,We,!1,pe,b)},$e=()=>{const w=[],_=[];let ae=[],re=-1/0,$=1/0,V=-1/0,U=1/0,F=1/0,E=-1/0;L.forEach(W=>{_.push(W.properties.legendUniqueId),E=-1/0,F=1/0,W.data.forEach(Ae=>{w.push(Ae),W.properties.axis==="Secondary"?(H=!0,V=Math.max(V,Ae.value),U=Math.min(U,Ae.value)):(re=Math.max(re,Ae.value),$=Math.min($,Ae.value)),E=Math.max(E,Ae.value),F=Math.min(F,Ae.value)}),W.properties.setColorScale&&G.set(W.properties.legendUniqueId,T.scaleSequential().domain([F,E]).interpolator(ui.interpolateRgb(W.properties.startColor,W.properties.endColor)))}),ke.chartData=w,ke.legendList=_,ke.yMaxLeft=re,ke.yMinLeft=$>0?0:$,ke.yMaxRight=V,ke.yMinRight=U>0?0:U,ae=t?vt(e.xAxisLabel.xAxisNumberFormat,ke.dimensionList).map(W=>W):ke.dimensionList,ke.dimensionList.forEach((W,Ae)=>{ke.formattedDimensionListMap.set(W,ae[Ae])}),Fe=JSON.parse(JSON.stringify(L)),O=ke.dimensionList,e.plotArea.hideZeroValues&&(ke.hideZeroValues=!0)},ge=()=>{let w=ut(ke.yMaxLeft,ke.yMinLeft,d,e,ke,I,D,b,c).yAxisLabelArray;ke.yMaxLeft=w[w.length-1],ke.yMinLeft=w[0],Me=T.scaleLinear().domain([ke.yMinLeft>=0?I!==void 0&&!Number.isNaN(I)?I:0:ke.yMinLeft<0?ke.yMinLeft*1.1:ke.yMinLeft*.9,ke.yMaxLeft<=0?0:D!==void 0&&!Number.isNaN(D)?D:ke.yMaxLeft*1.1]).range([0,a>0?c-a:c]),H&&(Pe=T.scaleLinear().domain([ke.yMinRight>=0?(N||N==0)&&!Number.isNaN(N)?N:0:(N||N==0)&&!Number.isNaN(N)?N:ke.yMinRight*1.1,ke.yMaxRight<=0?R||0:R||ke.yMaxRight*1.1]).range([0,a>0?c-a:c])),ne=[d,0]},we=()=>{ve=T.scaleBand().domain(ke.legendList).range([0,f]).paddingInner(ke.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),me=T.scalePoint().domain(O).range(ne).padding(.5)},C=()=>{{let w=ut(D||ke.yMaxLeft,ke.yMinLeft,d,e,ke,I,D,b,c);Be=T.axisBottom(Me).tickFormat(_=>qe(_,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(H){let w=ut(R||ke.yMaxRight,N||ke.yMinRight,d,e,ke,N,R);ye=T.axisTop(Pe).tickFormat(_=>qe(_,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)}},j=()=>{Ye=T.axisLeft(me).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*c*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(O,d,e))},se=w=>{w.forEach(_=>{_.data.forEach(ae=>{ae.hideZero=_.properties.hideZeroValues,ae.axis=_.properties.axis,ae.legendUniqueId=_.properties.legendUniqueId})}),O.forEach(_=>{z.append("rect").attr("id",`dim-background-${_}`).attr("class","dimension-background").attr("y",me(_)-f/2).attr("height",f).attr("x",0).attr("width",c).attr("fill","#E5E5E5").attr("visibility","hidden").lower()}),w.forEach(_=>{let ae=z.selectAll(".parentGroup").data([_],F=>F.properties.legendUniqueId);ae=ae.enter().append("g").attr("class","column parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(ae);let re=ae.selectAll(".column-group").data(_.data.map(F=>({...F,properties:_.properties})),F=>F.legend+F.dimension),$=re.enter().append("g").attr("class","column-group").attr("hoverId",(_.properties.alias||_.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",F=>`translate(0, ${me(F.dimension)-f/2})`);re.attr("transform",F=>`translate(0, ${me(F.dimension)-f/2})`),$.merge(re).attr("transform",F=>`translate(0, ${me(F.dimension)-f/2})`);const V=$.append("rect").attr("y",F=>ve(F.legendUniqueId)).attr("height",ve.bandwidth()).attr("x",F=>{const E=_.properties.axis===Oe.primary?Me:Pe;return F.value>=0,E(0)}).attr("width",0).attr("fill",F=>G.get(_.properties.legendUniqueId)?.(F.value)??_.properties.color).attr("stroke-dasharray",F=>F.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",F=>`${F.properties.stackBorderWidth}px`).attr("stroke",F=>_.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?_.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("visibility",F=>F.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(rt.SeriesId,()=>_.properties.legendUniqueId).attr(rt.DimValue,F=>Array.isArray(F.dimension)?String(F.dimension[0]):String(F.dimension));(e.animation.animationEnabled?V.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):V).attr("x",F=>{const E=_.properties.axis===Oe.primary?Me:Pe;return F.value>=0?E(0):E(F.value)}).attr("width",F=>{const E=_.properties.axis===Oe.primary?Me:Pe,W=_.properties.axis===Oe.primary?D:R;return F.value>=0?W&&F.value>W?E(W)-E(0):E(F.value)-E(0):Math.abs(E(0)-E(F.value))}),$.merge(re).on("mousemove",(F,E)=>{(_.properties.alias||_.properties.name||"Legend").replace(/ /g,"-");const W=Array.isArray(E.dimension)?E.dimension[0]:E.dimension,Ae=String(ke.formattedDimensionListMap.get(W)??W??""),ue=Lt(n,String(W??""),{..._.properties,formattedDimensionValue:Ae});xt([{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(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:qe([ee.NormalizedStackLineChart,ee.NormalizedStackAreaChart,""].includes(y)?E[1]-E[0]:E.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:E.properties.alias}],e,F,_.properties,ue)}).on("mouseout",(F,E)=>{(_.properties.alias||_.properties.name||"Legend").replace(/ /g,"-"),ct()}).on("click",kt(Z,A,(F,E)=>({seriesId:_.properties.legendUniqueId,dimValue:Array.isArray(E.dimension)?String(E.dimension[0]):String(E.dimension),legendUniqueId:_.properties.legendUniqueId,seriesDisplayName:_.properties.alias||_.properties.name||""}))),re.exit().remove()}),z.selectAll(".parentGroup").raise()},Se=w=>{c=i-w.left-w.right,d=h-w.bottom-w.top},pe=(w,_,ae)=>{Fe=_,O=w,Ue=ae,ri(l,k,O),e.xAxisLabel.hideZeroValues&&(O=O.filter(re=>k.get(re)!==0)),K()},K=()=>{if(we(),j(),oa(e,z,te,d,c,Ye,ye,Me,ke.yMaxLeft,O,y,t,i,Le,f,me),se(Fe),$a(Fe,me,Me,Pe,X,bt,[],[],e,y,h,i,c,O,d,m,ce,u,ve,f,s,!1,b),e.dataTableProperties.dataTable){const w=T.scalePoint().domain(O).range([0,c]).padding(.5);Zt(e.plotArea.fitChart,ce,z,v,f,Me,w,void 0,void 0,void 0,g,y,e,le,Q,O,c,[0,c],ke.formattedDimensionListMap,m,X,d,d+le)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Lr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID();let f=0;const y=ee.StackHorizontalBarChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList)?.reverse(),Y=l.DimensionList,b=!0,H=!1;let B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,N,R,X,le,te,Q,de,Le,Te,he;const q=new Map;let J,M,x,k,c,d,i=0,h=[],v,a,g,P,ce,z,me,ve,Me=[],Pe=0,ne=2,Be=!1,ye=[];const Ye=!1;let O=new Map,Fe={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{We()}catch(w){Ce("StackStackHorizontalBarchart","createStackHorizontalBarChart",w)}},[e]);const We=()=>{({formatOptions:e,svg:v,width:x,height:k}=wt(S,e)),Ue(),{formatOptions:e,dataTableLegendsList:h}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:Te,maxNumberForSecondaryAxis:he}=$t(e,Fe.yMinLeft,Fe.yMaxLeft,Fe.yMinRight,Fe.yMaxRight),{margin:I,yLabel:D,xLabel:N,yTitle:R,xTitle:X,dimensionHeightWidthArray:le,chartTitleHeight:te,secondaryAxisTitleWidth:Q,legendMargin:de,secondaryYLabel:Le,visibleBars:ne,columnWidth:f,scrollbarVisible:Be}=St(x,k,Te,he,Fe.yMaxLeft,e,Fe.legendList,Fe.dimensionList,Fe.yMaxRight,H,Ye,t,b,Fe,h);const w=e.xAxisLabel.xAxisLabelVisibility;({dataTable:c,dataTableHeight:d}=Wt(e,N,X,L,Fe.dimensionList,l)),e.xAxisLabel.xAxisLabelVisibility=w,c.length>0&&(i=d,I.bottom+=i,d=0),we(I),Ft(v,x,k,e),a=Dt(v,I),Ct(a,e,0,J,M,y,m),xe(),De(),sa(e,a,D,M,J,z),Vt(e,b,v,I,N,k,X,Fe.chartType,D,J,M),Nt(M+i,e,0,b,v,I,R,D,x),Pt(v,e,x,te),Et(k,v,le,te,x,de,e,[...L].reverse(),m,0,I,dt.rectangle,y,r),Xt(L,k,x,v,I,J,Be,ne,Fe,Pe,!1,C,b)},Ue=()=>{const w=[],_=[];let ae=-1/0,re=1/0;L.forEach((W,Ae)=>{const ue=`${Ae}~$~${W.properties.legend}`;W.properties.legend=ue,_.push(ue),ae=-1/0,re=1/0;for(const oe of W.data)ae=Math.max(ae,oe.value),re=Math.min(re,oe.value),w.push(oe);W.properties.setColorScale&&q.set(W.properties.legendUniqueId,T.scaleSequential().domain([re,ae]).interpolator(T.interpolateRgb(W.properties.startColor,W.properties.endColor)))}),Fe.chartData=w,Fe.legendList=_,Me=JSON.parse(JSON.stringify(L));let $=mt(Fe.dimensionList,L,Ye);e.plotArea.fitChart?ve=Fe.dimensionList:(ve=Fe.dimensionList.slice(Pe,Pe+ne),Me.forEach((W,Ae)=>Me[Ae].data=W.data.filter(ue=>ve.includes(ue.dimension))));const V=T.stack().keys(Fe.legendList).offset(T.stackOffsetDiverging)($);se();let U=1/0,F=-1/0;for(const W of V)for(const[Ae,ue]of W)U=Math.min(U,Ae),F=Math.max(F,ue);Fe.yMinLeft=U>0?0:U,Fe.yMaxLeft=F;let E=t?vt(e.xAxisLabel.xAxisNumberFormat,Fe.dimensionList).map(W=>W):Fe.dimensionList;Fe.dimensionList.forEach((W,Ae)=>{Fe.formattedDimensionListMap.set(W,E[Ae])}),e.plotArea.hideZeroValues&&(Fe.hideZeroValues=!0)},xe=()=>{let w=ut(Fe.yMaxLeft,Fe.yMinLeft,M,e,Fe,B,G,b,J).yAxisLabelArray;Fe.yMaxLeft=w[w.length-1],Fe.yMinLeft=w[0],g=T.scaleLinear().domain([Fe.yMinLeft>=0?B!==void 0&&!Number.isNaN(B)?B:0:Fe.yMinLeft<0?Fe.yMinLeft*1.1:Fe.yMinLeft*.9,Fe.yMaxLeft<=0?0:G!==void 0&&!Number.isNaN(G)?G:Fe.yMaxLeft*1.1]).range([0,J]),ce=[M,0]},ke=()=>{P=T.scalePoint().domain(ve).range(ce).padding(.5)},De=()=>{{let w=ut(G||Fe.yMaxLeft,Fe.yMinLeft,M,e,Fe,B,G,b,J);z=T.axisBottom(g).tickFormat(_=>qe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-M:0).tickValues(w.autoLabelFlag?void 0:w.yAxisLabelArray).ticks(w.customTickValue).tickPadding(8).tickSizeOuter(0)}},$e=()=>{me=T.axisLeft(P).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*J*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(ve,M,e))},ge=w=>{w.forEach(E=>{E.data.forEach(W=>{W.hideZero=E.properties.hideZeroValues,W.axis=E.properties.axis})}),ve.forEach(E=>{a.append("rect").attr("id",`dim-background-${E}`).attr("class","dimension-background").attr("y",P(E)-f/2).attr("height",f).attr("x",0).attr("width",J).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let _=a.selectAll(".parentGroup").data([ye]);_=_.enter().append("g").attr("class","columns parentGroup").attr("clip-path",`url(#${m}-clip)`).merge(_);let ae=_.selectAll(".column-group").data(E=>E);ae=ae.enter().append("g").attr("class",E=>"column-group "+E.key.replace(/ /g,"-")).attr("hoverId",E=>(w[E.index].properties.alias||w[E.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(ae);let $=ae.selectAll("rect").data(E=>E);const V=(E,W)=>{const Ae=Array.from(ae.nodes()).indexOf(E[W].parentNode);return{props:L[Ae]?.properties,groupIndex:Ae}},U=$.enter().append("rect").merge($).attr("y",E=>P(E.data.dimension)-f/2).attr("height",f).attr("fill",(E,W,Ae)=>{const{props:ue}=V(Ae,W);return q.get(ue.legendUniqueId)?.(E.data[E.key])??ue?.color??"gray"}).attr("stroke",(E,W,Ae)=>{const ue=V(Ae,W).props;return ue?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?ue.stackBorderColor:"none"}).attr("stroke-dasharray",(E,W,Ae)=>V(Ae,W).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",(E,W,Ae)=>(V(Ae,W).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",E=>Math.min(g(E[0]),g(E[1]))).attr("width",0).attr("visibility",(E,W,Ae)=>{const ue=V(Ae,W).props;return E.data[E.key]===0&&ue?.hideZeroValues?"hidden":"visible"}).attr(rt.SeriesId,E=>E.key??"").attr(rt.DimValue,E=>Array.isArray(E.data.dimension)?String(E.data.dimension[0]):String(E.data.dimension)).on("mousemove",(E,W)=>{const Ae=W.data.dimension;xt([{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(Ae)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():W.properties?.currentMeasure?W.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||W.value,value:qe(W.data[W.key],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:W.properties.alias}],e,E,W.properties,Lt(p,String(Ae??""),{...W.properties,formattedDimensionValue:String(Fe.formattedDimensionListMap.get(Ae)??Ae??"")}))}).on("mouseout",(E,W)=>{W.data.dimension,ct()}).on("click",kt(Z,A,(E,W)=>({seriesId:W.key,dimValue:Array.isArray(W.data.dimension)?String(W.data.dimension[0]):String(W.data.dimension),legendUniqueId:W.key,seriesDisplayName:W.properties?.alias||W.properties?.name||""})));U.attr("x",E=>g(0)),(e.animation.animationEnabled?U.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):U).attr("x",E=>Math.min(g(E[0]),g(E[1]))).attr("width",E=>Math.abs(g(E[1])-g(E[0]))),ae.exit().remove(),a.selectAll(".parentGroup").raise()},we=w=>{J=x-w.left-w.right,M=k-w.bottom-w.top},C=(w,_,ae)=>{Me=_,ve=w,ne=ae,ri(l,O,ve),se(),j()},j=()=>{ke(),$e(),oa(e,a,N,M,J,me,void 0,g,Fe.yMaxLeft,ve,y,t,x,le,f,P);const w=new Map;if(ve.forEach((_,ae)=>{let re=0;ye.forEach($=>{const V=$[ae]?.[0]??0;V<re&&(re=V)}),w.set(_,re)}),ge(Me),Ya(ye,P,g,void 0,I,bt,[],[],e,y,k,x,J,ve,M,m,v,u,0,s,b),li(O,P,g,I,bt,[],e,y,k,x,v,s,b,w),Se(),a.selectAll(".connectors").raise(),e.dataTableProperties.dataTable){const _=T.scalePoint().domain(ve).range([0,J]).padding(.5);Zt(e.plotArea.fitChart,v,a,c,f,g,_,void 0,void 0,void 0,i,y,e,D,R,ve,J,[0,J],Fe.formattedDimensionListMap,m,I,M,M+D)}},se=()=>{let w=mt(ve,Me,Ye);ye=T.stack().keys(Fe.legendList).offset(T.stackOffsetDiverging)(w),Me.forEach((ae,re)=>ae.data.forEach(($,V)=>{$[0]=ye[re][V][0],$[1]=ye[re][V][1]}));let _=e.annotation.annotationSetLabelColor;ye.forEach((ae,re)=>ae.forEach($=>{$.key=ae.key,ae.color=JSON.parse(JSON.stringify(L[re].properties.color)),$.data.labelPosition=L[re].properties.dataLabelPosition,$.data.labelColor=_=="2"?JSON.parse(JSON.stringify(L[re].properties.color)):L[re].properties.labelColor,$.hideZero=JSON.parse(JSON.stringify(L[re].properties.hideZeroValues)),$.properties=L[re].properties}))},Se=()=>{try{const w=Number(e.connector?.connectorVisibility);if(!e.connector||w===2)return;const _=[],ae=[],re=[];let $;const V=[];if(w===1)$=1;else if(w===3){const oe=Number(e.connector.connectorFollow);oe===1?$=Number(e.connector.connectorStepSize):oe===2&&((e.connector.connectorExclude||[]).forEach(fe=>re.push(fe)),$=1)}const U=[],F=[],E=[],W=e.connector?.connectorCustomRange||[];re.forEach(oe=>{const fe=oe.split("-");fe.length&&U.push(fe[0])});const ue=(ye?.[0]||[]).map((oe,fe)=>({Dimension:oe.data.dimension,Total:oe.data.total,CustomTotal:oe.data.total-(E[fe]??0),Index:fe}));if($!=null){for(let oe=0;oe<ue.length;oe++)($===1||oe%$===0&&$!==1)&&_.push(ue[oe]);for(let oe=$;oe<ue.length;oe+=$){const fe=Math.min(oe+$,ue.length);let Re=-1/0;for(let Ve=oe;Ve<fe;Ve++)ue[Ve].Total>Re&&(Re=ue[Ve].Total);Re!==-1/0&&V.push(Re)}for(let oe=1;oe<_.length;oe++)ae.push(_[oe])}else{const oe=[];(W||[]).forEach(fe=>{if(fe?.from&&fe?.to){const Re=ue.some(be=>be.Dimension===fe.from),Ve=ue.some(be=>be.Dimension===fe.to);Re&&Ve&&oe.push({from:fe.from,to:fe.to})}}),oe.forEach(fe=>{const Re=ue.findIndex(be=>be.Dimension===fe.from),Ve=ue.findIndex(be=>be.Dimension===fe.to);if(Re>=0&&Ve>=0){const be=Math.min(Re,Ve),Ge=Math.max(Re,Ve);_.push(ue[be]);let it=ue[be]?.Total??-1/0;for(let st=be;st<=Ge;st++)ue[st].Total>it&&(it=ue[st].Total);it!==-1/0&&V.push(it),ae.push(ue[Ge])}})}a.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!==ze.white?e.connector.connectorMarkerColor:"none"),pe(_,V,ae,$,U),K(_,V,ae,$,U)}catch(w){console.error(w)}},pe=(w,_,ae,re,$)=>{try{const V=P.bandwidth()??0,U=a.selectAll(".connector-paths").data([0]),F=U.enter().append("g").attr("class","connector-paths connectors").merge(U),E=w.filter((ue,oe)=>re!=null?oe<w.length-1:oe<w.length),W=F.selectAll("path.connector-path").data(E,(ue,oe)=>ue?.Dimension??oe);W.exit().remove(),W.enter().append("path").attr("class","connector-path").attr("fill","none").attr("marker-end","url(#arrow)").merge(W).attr("d",(ue,oe)=>{const fe=ae?.[oe]??{Total:0,Dimension:ue.Dimension},Re=ue?.Total??0,Ve=typeof fe.Total=="number"?g(fe.Total):0,be=typeof Re=="number"?g(Re):0,Ge=Math.max(Ve,be);return e.total.totalVisibility?`M ${be+50},
74
+ ${P(ue.Dimension)+V/2-5}
75
+ H ${60+Ge}
76
+ V ${P(fe.Dimension)+V/2+5}
77
+ H ${30+Ve}`:`M ${be+30},
78
+ ${P(ue.Dimension)+V/2-5}
79
+ H ${45+Ge}
80
+ V ${P(fe.Dimension)+V/2+5}
81
+ H ${10+Ve}`}).style("stroke",e.connector.connectorLineColor!==ze.white?e.connector.connectorLineColor:"none").attr("stroke-width",e.connector.connectorLineThickness).style("visibility",(ue,oe)=>$.includes(ue.Dimension)||ue.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(V){console.error(V)}},K=(w,_,ae,re,$)=>{try{const V=isNaN(parseFloat(e?.plotArea?.plotAreaGapWidth??"0"))?0:parseFloat(e.plotArea.plotAreaGapWidth)/100,U=Vi(V,f);let F=e.connector.connectorFontStyle,E=e.connector.connectorNumberFormat,W=M/30<ve.length?Math.round(M/30):ve.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(E=".2s");const Ae=w.filter((Ve,be)=>re!=null?be<w.length-1:be<w.length),ue=a.selectAll(".connector-texts").data([0]),fe=ue.enter().append("g").attr("class","connector-texts connectors").merge(ue).selectAll("text.connector-text").data(Ae,Ve=>Ve?.Dimension??Ve);fe.exit().remove(),fe.enter().append("text").attr("class","connector-text").attr("dy","0.6em").attr("text-anchor","start").merge(fe).attr("y",(Ve,be)=>{const Ge=ae?.[be]??{Dimension:Ve.Dimension,Total:0},it=P(Ve.Dimension)??0;return(P(Ge.Dimension)??it)+re*U/2}).attr("x",(Ve,be)=>{const Ge=ae?.[be]??{Total:0},it=Ve?.Total??0,st=Math.max(g(Ge.Total),g(it));return e.total.totalVisibility?70+st:50+st}).text((Ve,be)=>{const Ge=ae?.[be]??{Total:0,CustomTotal:0,Dimension:Ve.Dimension};return Ve.CustomTotal==0&&Ge.CustomTotal!=0&&(Ve.CustomTotal=1),Ti(Ge.Total,Ve.Total,parseInt(e.connector.connectorDecimalPrecision),E,parseInt(Ve.Dimension),parseInt(Ge.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!==ze.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",(Ve,be)=>$.includes(Ve.Dimension)||Ve.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(V){console.error(V)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},mr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID();let f=0;const y=ee.NormalizedStackHorizontalBarChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList)?.reverse(),Y=l.DimensionList,b=!0,H=!1;let B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I,D,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d=0,i=[];const h=new Map;let v,a,g,P,ce,z,me,ve,Me=[],Pe=0,ne,Be=!1,ye=[];const Ye=!0;let O={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Fe()}catch(se){Ce("StackNormalizedStackBarchart","createNormalizedStackBarChart",se)}},[e]);const Fe=()=>{({formatOptions:e,svg:v,width:M,height:x}=wt(S,e)),We(),{formatOptions:e,dataTableLegendsList:i}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:Te,maxNumberForSecondaryAxis:he}=$t(e,O.yMinLeft,O.yMaxLeft,O.yMinRight,O.yMaxRight),{margin:I,yLabel:D,xLabel:N,yTitle:R,xTitle:X,dimensionHeightWidthArray:le,chartTitleHeight:te,secondaryAxisTitleWidth:Q,legendMargin:de,secondaryYLabel:Le,visibleBars:ne,columnWidth:f,scrollbarVisible:Be}=St(M,x,Te,he,O.yMaxLeft,e,O.legendList,O.dimensionList,O.yMaxRight,H,Ye,t,b,O,i);const se=e.xAxisLabel.xAxisLabelVisibility;({dataTable:k,dataTableHeight:c}=Wt(e,N,X,L,O.dimensionList,l)),e.xAxisLabel.xAxisLabelVisibility=se,k.length>0&&(d=c,I.bottom+=d,c=0),ge(I),Ft(v,M,x,e),a=Dt(v,I),Ct(a,e,0,q,J,y),Ue(),ke(),sa(e,a,D,J,q,z),Vt(e,b,v,I,N,x,X,O.chartType,D,q,J),Nt(J+d,e,0,b,v,I,R,D,q),Pt(v,e,M,te),Et(x,v,le,te,M,de,e,[...L].reverse(),m,0,I,dt.rectangle,y,r),Xt(L,x,M,v,I,q,Be,ne,O,Pe,!1,j,b)},We=()=>{const se=[],Se=[];let pe=-1/0,K=1/0;L.forEach(($,V)=>{const U=`${V}~$~${$.properties.legend}`;$.properties.legend=U,Se.push(U),pe=-1/0,K=1/0;for(const F of $.data)pe=Math.max(pe,F.value),K=Math.min(K,F.value),se.push(F);$.properties.setColorScale&&h.set($.properties.legendUniqueId,T.scaleSequential().domain([K,pe]).interpolator(T.interpolateRgb($.properties.startColor,$.properties.endColor)))}),O.chartData=se,O.legendList=Se,Me=JSON.parse(JSON.stringify(L));let w=mt(O.dimensionList,L,Ye);e.plotArea.fitChart?ve=O.dimensionList:(ve=O.dimensionList.slice(Pe,Pe+ne),Me.forEach(($,V)=>Me[V].data=$.data.filter(U=>ve.includes(U.dimension))));const _=T.stack().keys(O.legendList).offset(T.stackOffsetDiverging)(w);C();let ae=1/0;for(const $ of _)for(const[V,U]of $)ae=Math.min(ae,V);O.yMinLeft=ae>0?0:ae,O.yMaxLeft=1;let re=t?vt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList).map($=>$):O.dimensionList;O.dimensionList.forEach(($,V)=>{O.formattedDimensionListMap.set($,re[V])}),e.plotArea.hideZeroValues&&(O.hideZeroValues=!0)},Ue=()=>{let se=ut(G||O.yMaxLeft,O.yMinLeft,J,e,O,B,G,b,q).yAxisLabelArray;O.yMaxLeft=se[se.length-1],O.yMinLeft=se[0],g=T.scaleLinear().domain([O.yMinLeft<0?-1:0,1]).range([0,q]),ce=[J,0]},xe=()=>{P=T.scalePoint().domain(ve).range(ce).padding(.5)},ke=()=>{{const se=e.yAxisLabel.yAxisTicksMode===Da.custom,Se=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0;z=T.axisBottom(g).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-J:0).tickValues(se?za(O.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null).tickFormat(T.format(`.${Se}%`)).ticks(q/80).tickPadding(8).tickSizeOuter(0)}},De=()=>{me=T.axisLeft(P).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*q*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(ve,J,e))},$e=se=>{ye.forEach(($,V)=>$.forEach((U,F)=>{se[V].data[F][0]=U[0]=U.data.total===0?0:U[0]/U.data.total,se[V].data[F][1]=U[1]=U.data.total===0?0:U[1]/U.data.total})),se.forEach($=>{$.data.forEach(V=>{V.hideZero=$.properties.hideZeroValues,V.axis=$.properties.axis})}),ve.forEach($=>{a.append("rect").attr("id",`dim-background-${$}`).attr("class","dimension-background").attr("y",P($)-P.bandwidth()/2).attr("height",P.bandwidth()).attr("x",0).attr("width",q).attr("fill","#E5E5E5").attr("visibility","hidden").lower()});let Se=a.selectAll(".parentGroup").data([ye]);Se=Se.enter().append("g").attr("class","columns parentGroup").merge(Se);let pe=Se.selectAll(".column-group").data($=>$);pe=pe.enter().append("g").attr("class",$=>"column-group "+$.key.replace(/ /g,"-")).attr("hoverId",$=>(se[$.index].properties.alias||se[$.index].properties.name||"Legend").replace(/\s+/g,"-")).merge(pe);let w=pe.selectAll("rect").data($=>$);const _=($,V)=>{const U=Array.from(pe.nodes()).indexOf($[V].parentNode);return{props:L[U]?.properties,groupIndex:U}},ae=w.enter().append("rect").merge(w).attr("y",$=>P($.data.dimension)-f/2).attr("height",f).attr("fill",($,V,U)=>{const{props:F}=_(U,V);return h.get(F.legendUniqueId)?.($.data[$.key])??F?.color??"gray"}).attr("stroke",($,V,U)=>{const F=_(U,V).props;return F?.stackBorderStyle===0?"none":e.column.stackBorderVisibility?F.stackBorderColor:"none"}).attr("stroke-dasharray",($,V,U)=>_(U,V).props?.stackBorderStyle===2?"5,3":"0").attr("stroke-width",($,V,U)=>(_(U,V).props?.stackBorderWidth||0)+"px").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("x",$=>g(0)).attr("width",0).attr("visibility",($,V,U)=>{const F=_(U,V).props;return $.data[$.key]===0&&F?.hideZeroValues?"hidden":"visible"}).attr(rt.SeriesId,$=>$.key??"").attr(rt.DimValue,$=>Array.isArray($.data.dimension)?String($.data.dimension[0]):String($.data.dimension)).on("mousemove",($,V)=>{const U=V.data.dimension;xt([{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:O.formattedDimensionListMap.get(U)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():V.properties?.currentMeasure?V.properties.currentMeasure:e.yAxisTitle.yAxisTitleText||V.value,value:qe(V[1]-V[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:V.properties.alias}],e,$,V.properties,Lt(p,String(U??""),{...V.properties,formattedDimensionValue:String(O.formattedDimensionListMap.get(U)??U??"")}))}).on("mouseout",($,V)=>{let U=(V.properties.alias||V.properties.name||"Legend").replace(/ /g,"-");T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll('[hoverId="'+U+'"]').classed("highlight",!1).classed("unhighlight",!1),ct()}).on("click",kt(Z,A,($,V)=>({seriesId:V.key,dimValue:Array.isArray(V.data.dimension)?String(V.data.dimension[0]):String(V.data.dimension),legendUniqueId:V.key,seriesDisplayName:V.properties?.alias||V.properties?.name||""})));(e.animation.animationEnabled?ae.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):ae).attr("x",$=>Math.min(g($[0]),g($[1]))).attr("width",$=>Math.abs(g($[1])-g($[0]))),pe.exit().remove(),a.selectAll(".parentGroup").raise()},ge=se=>{q=M-se.left-se.right,J=x-se.bottom-se.top},we=()=>{if(xe(),De(),oa(e,a,N,J,q,me,void 0,g,O.yMaxLeft,ve,y,t,M,le,f,P),$e(Me),Ya(ye,P,g,void 0,I,bt,[],[],e,y,x,M,q,ve,J,m,v,u,0,s,b),e.dataTableProperties.dataTable){const se=T.scalePoint().domain(ve).range([0,q]).padding(.5);Zt(e.plotArea.fitChart,v,a,k,f,g,se,void 0,void 0,void 0,d,y,e,D,R,ve,q,[0,q],O.formattedDimensionListMap,m,I,J,J+D)}},C=()=>{let se=mt(ve,Me,Ye);ye=T.stack().keys(O.legendList).offset(T.stackOffsetDiverging)(se),Me.forEach((pe,K)=>pe.data.forEach((w,_)=>{w[0]=ye[K][_][0],w[1]=ye[K][_][1]}));let Se=e.annotation.annotationSetLabelColor;ye.forEach((pe,K)=>pe.forEach(w=>{w.key=pe.key,pe.color=JSON.parse(JSON.stringify(L[K].properties.color)),w.data.labelPosition=L[K].properties.dataLabelPosition,w.data.labelColor=Se=="2"?JSON.parse(JSON.stringify(L[K].properties.color)):L[K].properties.labelColor,w.hideZero=JSON.parse(JSON.stringify(L[K].properties.hideZeroValues)),w.properties=L[K].properties}))},j=(se,Se,pe)=>{Me=Se,ve=se,ne=pe,C(),we()};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},fr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID();let f=0;const y=ee.LayeredHorizontalBarChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList),Y=l.DimensionList,b=!0,H=!1,B=new Map;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i=0,h=[],v,a,g,P,ce,z,me,ve,Me=[],Pe=0,ne=2,Be=!1,ye=[];const Ye=!1;let O={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Fe()}catch(K){Ce("StackStackHorizontalBarchart","createStackHorizontalBarChart",K)}},[e]);const Fe=()=>{({formatOptions:e,svg:v,width:x,height:k}=wt(S,e)),We(),{formatOptions:e,dataTableLegendsList:h}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:q}=$t(e,O.yMinLeft,O.yMaxLeft,O.yMinRight,O.yMaxRight),{margin:D,yLabel:N,xLabel:R,yTitle:X,xTitle:le,dimensionHeightWidthArray:te,chartTitleHeight:Q,secondaryAxisTitleWidth:de,legendMargin:Le,secondaryYLabel:Te,visibleBars:ne,columnWidth:f,scrollbarVisible:Be}=St(x,k,he,q,O.yMaxLeft,e,O.legendList,O.dimensionList,O.yMaxRight,H,Ye,t,b,O,h);const K=e.xAxisLabel.xAxisLabelVisibility;({dataTable:c,dataTableHeight:d}=Wt(e,R,le,L,O.dimensionList,l)),e.xAxisLabel.xAxisLabelVisibility=K,c.length>0&&(i=d,D.bottom+=i,d=0),ge(D),Ft(v,x,k,e),a=Dt(v,D),Ct(a,e,0,J,M,y,m),Ue(),ke(),sa(e,a,N,M+i,J,z),Vt(e,b,v,D,R,k,le,O.chartType,N,J,M),Nt(M+i,e,0,b,v,D,X,N),Pt(v,e,x,Q),Et(k,v,te,Q,x,Le,e,L,m,0,D,dt.rectangle,y,r),Xt(L,k,x,v,D,J,Be,ne,O,Pe,!1,we,b)},We=()=>{const K=[],w=[];let _=[],ae=-1/0,re=1/0,$=-1/0,V=1/0,U=-1/0,F=1/0;L.forEach(E=>{w.push(E.properties.legendUniqueId),U=-1/0,F=1/0,E.data.forEach(W=>{K.push(W),U=Math.max(U,W.value),F=Math.min(F,W.value),ae=Math.max(ae,W.value),re=Math.min(re,W.value)}),E.properties.setColorScale&&B.set(E.properties.legendUniqueId,T.scaleSequential().domain([F,U]).interpolator(T.interpolateRgb(E.properties.startColor,E.properties.endColor)))}),O.chartData=K,O.legendList=w,O.yMaxLeft=ae,O.yMinLeft=re>0?0:re,O.yMaxRight=$,O.yMinRight=V,_=t?vt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList).map(E=>E):O.dimensionList,_=t?vt(e.xAxisLabel.xAxisNumberFormat,O.dimensionList).map(E=>E):O.dimensionList,O.dimensionList.forEach((E,W)=>{O.formattedDimensionListMap.set(E,_[W]),O.formattedDimensionListMap.set(E,_[W])}),Me=JSON.parse(JSON.stringify(L)),e.plotArea.fitChart?ve=O.dimensionList:ve=O.dimensionList.slice(Pe,Pe+ne),e.plotArea.hideZeroValues&&(O.hideZeroValues=!0)},Ue=()=>{let K=ut(I||O.yMaxLeft,O.yMinLeft,M,e,O,G,I,b,J).yAxisLabelArray;O.yMaxLeft=K[K.length-1],O.yMinLeft=K[0],g=T.scaleLinear().domain([O.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:0:O.yMinLeft<0?O.yMinLeft*1.1:O.yMinLeft*.9,O.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:O.yMaxLeft*1.1]).range([0,J]),ce=[M,0],xe()},xe=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,f]).paddingInner(O.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),P=T.scalePoint().domain(ve).range(ce).padding(.5)},ke=()=>{De();{let K=ut(I||O.yMaxLeft,O.yMinLeft,M,e,O,G,I,b,J);z=T.axisBottom(g).tickFormat(w=>qe(w,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-M:0).tickValues(K.autoLabelFlag?void 0:K.yAxisLabelArray).ticks(K.customTickValue).tickPadding(8).tickSizeOuter(0)}},De=()=>{me=T.axisLeft(P).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*J*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(ve,M,e))},$e=K=>{K.forEach(w=>{w.data.forEach(_=>{_.hideZero=w.properties.hideZeroValues,_.axis=w.properties.axis,_.properties=w.properties})}),K.forEach((w,_)=>{let ae=a.selectAll(".parentGroup").filter(F=>F?.properties?.legendUniqueId===w.properties.legendUniqueId).data([w],F=>F.properties.legendUniqueId);ae=ae.enter().append("g").attr("class","column parentGroup").attr("data-legend-id",w.properties.legendUniqueId).attr("clip-path",`url(#${m}-clip)`).merge(ae);let re=ae.selectAll(".column-group").data(w.data,F=>F.dimension+"_"+w.properties.legendUniqueId),$=re.enter().append("g").attr("class","column-group").attr("hoverId",(w.properties.alias||w.properties.name||"Legend").replace(/\s+/g,"-")).attr("transform",F=>_===0?`translate(0, ${P(F.dimension)-f/2})`:`translate(0, ${P(F.dimension)-f/(2+_*2)})`);re.attr("transform",F=>_===0?`translate(0, ${P(F.dimension)-f/2})`:`translate(0, ${P(F.dimension)-f/(2+_*2)})`),$.merge(re).attr("transform",F=>_===0?`translate(0, ${P(F.dimension)-f/2})`:`translate(0, ${P(F.dimension)-f/(2+_*2)})`);const V=$.append("rect").attr("y",0).attr("height",_===0?f:f/2).attr("x",()=>g(0)).attr("width",0).attr("fill",F=>B.get(w.properties.legendUniqueId)?.(F.value)??w.properties.color).attr("stroke-dasharray",()=>w.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",`${w.properties.stackBorderWidth}px`).attr("stroke",()=>w.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?w.properties.stackBorderColor:"none").style("clip-path","inset(0px) fill-box").style("shape-rendering","crispEdges").attr("opacity",.7).attr("visibility",F=>F.value===0&&e.xAxisLabel.hideZeroValues?"hidden":"visible").attr(rt.SeriesId,()=>w.properties.legendUniqueId).attr(rt.DimValue,F=>Array.isArray(F.dimension)?String(F.dimension[0]):String(F.dimension));(e.animation.animationEnabled?V.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):V).attr("x",F=>F.value>0?g(0):g(F.value)).attr("width",F=>F.value>0?g(F.value)-g(0):Math.abs(g(0)-g(F.value))),re.select("rect").transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("x",F=>F.value>0?g(0):g(F.value)).attr("width",F=>F.value>0?g(F.value)-g(0):Math.abs(g(0)-g(F.value))),$.merge(re).on("mousemove",(F,E)=>{xt([{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:O.formattedDimensionListMap.get(E.dimension)},{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():E.properties?.currentMeasure||e.yAxisTitle.yAxisTitleText||E.value,value:qe(E.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:w.properties.alias}],e,F,w.properties,Lt(p,String(E.dimension??""),{...w.properties,formattedDimensionValue:String(O.formattedDimensionListMap.get(E.dimension)??E.dimension??"")}))}).on("mouseout",()=>{ct()}).on("click",kt(Z,A,(F,E)=>({seriesId:w.properties.legendUniqueId,dimValue:Array.isArray(E.dimension)?String(E.dimension[0]):String(E.dimension),legendUniqueId:w.properties.legendUniqueId,seriesDisplayName:w.properties.alias||w.properties.name||""}))),re.exit().remove()}),a.selectAll(".parentGroup").raise()},ge=K=>{J=x-K.left-K.right,M=k-K.bottom-K.top},we=(K,w,_)=>{Me=w,ve=K,ne=_,C()},C=()=>{if(xe(),De(),oa(e,a,R,M,J,me,void 0,g,O.yMaxLeft,ve,y,t,x,te,f,P),j(),$e(Me),$a(Me,P,g,void 0,D,bt,[],[],e,y,k,x,J,ve,M,m,v,u,void 0,f,s,!1,b),se(),e.dataTableProperties.dataTable){const K=T.scalePoint().domain(ve).range([0,J]).padding(.5);Zt(e.plotArea.fitChart,v,a,c,f,g,K,void 0,void 0,void 0,i,y,e,N,X,ve,J,[0,J],O.formattedDimensionListMap,m,D,M,M+N)}},j=()=>{let K=mt(ve,Me,Ye);ye=T.stack().keys(O.legendList).offset(T.stackOffsetDiverging)(K),Me.forEach((_,ae)=>_.data.forEach((re,$)=>{re[0]=ye[ae][$][0],re[1]=ye[ae][$][1]}));let w=e.annotation.annotationSetLabelColor;ye.forEach((_,ae)=>_.forEach(re=>{re.key=_.key,_.color=JSON.parse(JSON.stringify(L[ae].properties.color)),re.data.labelPosition=L[ae].properties.dataLabelPosition,re.data.labelColor=w=="2"?JSON.parse(JSON.stringify(L[ae].properties.color)):L[ae].properties.labelColor,re.hideZero=JSON.parse(JSON.stringify(L[ae].properties.hideZeroValues))}))},se=()=>{try{const K=Number(e.connector?.connectorVisibility);if(!e.connector||K===2)return;const w=[],_=[],ae=[];let re;const $=[];if(K===1)re=1;else if(K===3){const ue=Number(e.connector.connectorFollow);ue===1?re=Number(e.connector.connectorStepSize):ue===2&&((e.connector.connectorExclude||[]).forEach(oe=>ae.push(oe)),re=1)}const V=[],U=[],F=[],E=e.connector?.connectorCustomRange||[];ae.forEach(ue=>{const oe=ue.split("-");oe.length&&V.push(oe[0])});const Ae=(ye?.[0]||[]).map((ue,oe)=>({Dimension:ue.data.Dimension,Total:ue.data.Total,CustomTotal:ue.data.Total-(F[oe]??0),Index:oe}));if(re!=null){for(let ue=0;ue<Ae.length;ue++)(re===1||ue%re===0&&re!==1)&&w.push(Ae[ue]);for(let ue=re;ue<Ae.length;ue+=re){const oe=Math.min(ue+re,Ae.length);let fe=-1/0;for(let Re=ue;Re<oe;Re++)Ae[Re].Total>fe&&(fe=Ae[Re].Total);fe!==-1/0&&$.push(fe)}for(let ue=1;ue<w.length;ue++)_.push(w[ue])}else{const ue=[];(E||[]).forEach(oe=>{if(oe?.from&&oe?.to){const fe=Ae.some(Ve=>Ve.Dimension===oe.from),Re=Ae.some(Ve=>Ve.Dimension===oe.to);fe&&Re&&ue.push({from:oe.from,to:oe.to})}}),ue.forEach(oe=>{const fe=Ae.findIndex(Ve=>Ve.Dimension===oe.from),Re=Ae.findIndex(Ve=>Ve.Dimension===oe.to);if(fe>=0&&Re>=0){const Ve=Math.min(fe,Re),be=Math.max(fe,Re);w.push(Ae[Ve]);let Ge=Ae[Ve]?.Total??-1/0;for(let it=Ve;it<=be;it++)Ae[it].Total>Ge&&(Ge=Ae[it].Total);Ge!==-1/0&&$.push(Ge),_.push(Ae[be])}})}a.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!==ze.white?e.connector.connectorMarkerColor:"none"),Se(w,$,_,re,V),pe(w,$,_,re,V)}catch(K){console.error(K)}},Se=(K,w,_,ae,re)=>{try{a.append("g").selectAll("path").data(K).enter().filter(($,V)=>ae!=null?V<K.length-1:V<K.length).append("path").attr("d",($,V)=>e.total.totalVisibility?`M ${g($.Total)+50},
82
+ ${P($.Dimension)+P.bandwidth()/2-5}
83
+ H ${60+Math.max(g(w[V]),g(_[V].Total),g($.Total))}
84
+ V ${P(_[V].Dimension)+P.bandwidth()/2+5}
85
+ H ${30+g(_[V].Total)}`:`M ${g($.Total)+30},
86
+ ${P($.Dimension)+P.bandwidth()/2-5}
87
+ H ${45+Math.max(g(w[V]),g(_[V].Total),g($.Total))}
88
+ V ${P(_[V].Dimension)+P.bandwidth()/2+5}
89
+ H ${10+g(_[V].Total)}
90
+ `).style("stroke",e.connector.connectorLineColor!==ze.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",$=>re.includes($.Dimension)||$.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch($){console.error($)}},pe=(K,w,_,ae,re)=>{try{let $=e.connector.connectorFontStyle,V=e.connector.connectorNumberFormat,U=M/30<ve.length?Math.round(M/30):ve.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(V=".2s"),a.append("g").selectAll("text1").data(K).enter().filter((F,E)=>ae!=null?E<K.length-1:E<K.length).append("text").attr("y",(F,E)=>ae==null?P(_[E].Dimension)/2+P(F.Dimension)/2+15:ae==1?U<6&&P.bandwidth()>40?P(_[E].Dimension)+P.bandwidth()/2+P.bandwidth()/2+13:P(_[E].Dimension)+P.bandwidth()/2+P.bandwidth()/2+7:P(_[E].Dimension)+P.bandwidth()/2+P.bandwidth()/2*ae+12).attr("x",(F,E)=>e.total.totalVisibility?70+Math.max(g(w[E]),g(_[E].Total),g(F.Total)):50+Math.max(g(w[E]),g(_[E].Total),g(F.Total))).text((F,E)=>(F.CustomTotal==0&&_[E].CustomTotal!=0&&(F.CustomTotal=1),Ti(_[E].Total,F.Total,parseInt(e.connector.connectorDecimalPrecision),V,parseInt(F.Dimension),parseInt(_[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!==ze.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",$.includes("Italic")?"Italic":"").style("text-decoration",$.includes("Underline")?"Underline":"").style("font-weight",$.includes("Bold")?"Bold":"").style("visibility",F=>re.includes(F.Dimension)||F.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch($){console.error($)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Tr=({isDateType:t,formatOptions:e,data:l})=>{const s=crypto.randomUUID(),u=0,r=ee.ColumnHistogramChart,n=Ne.useRef(),o=l.ChartData,p=l.DimensionList,m=!1,f=!1,y=!1;let S=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,A=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,Z=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMinText):void 0,L=e.xAxisLabel.xAxisIntervalsVisibility?parseFloat(e.xAxisLabel.xAxisMaxText):void 0,Y,b,H,B,G,I,D,N,R,X,le,te,Q,de,Le,Te=[],he=[],q,J,M,x,k,c,d,i,h,v,a,g=[],P=0;const ce=2;let z={dimensionList:p,chartType:r,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{me()}catch(Ue){Ce("HorizontalHistogramChart","createHorizontalChart",Ue)}},[e]);const me=()=>{({formatOptions:e,svg:k,width:q,height:J}=wt(n,e)),ve(),{formatOptions:e}=zt(e,o,l.DataTableData??[]),{maxNumberForPrimaryAxis:le,maxNumberForSecondaryAxis:te}=$t(e,z.yMinLeft,z.yMaxLeft,z.yMinRight,z.yMaxRight),{margin:Y,yLabel:b,xLabel:H,yTitle:B,xTitle:G,dimensionHeightWidthArray:I,chartTitleHeight:D,secondaryAxisTitleWidth:N,legendMargin:R,secondaryYLabel:X}=St(q,J,le,te,z.yMaxLeft,e,z.legendList,z.dimensionList,z.yMaxRight,f,y,t),O(Y),{dataTable:M,dataTableHeight:x}=Wt(e,b,B,o,z.dimensionList),Ft(k,q,J,e),c=Dt(k,Y),Ct(c,e,x,Q,de,r),Me(),ne(),Be(),la(c,z,H,e,x,d,v,I,J,u,t,Q,de,a,d),Qt(c,e,x,b,h,de),Fe(o,J,k,Y,Q),Vt(e,m,k,Y,H,J,G,z.chartType,b,Q,de),Nt(de,e,x,m,k,Y,B,b),Jt(k,f,Y,e,x,de,Q,X,N),Pt(k,e,q,D),Et(J,k,I,D,q,R,e,o,s,x,Y,dt.rectangle)},ve=()=>{const Ue=[],xe=[];let ke=[],De=-1/0,$e=1/0;o.forEach(C=>{xe.push(C.legend),C.data.forEach(j=>{Ue.push(j),De=Math.max(De,j.value),$e=Math.min($e,j.value)})}),z.chartData=Ue,z.legendList=xe,z.yMaxLeft=De,z.yMinLeft=$e>0?0:$e,g=JSON.parse(JSON.stringify(o)),g.forEach(C=>C.data.forEach(j=>ke.push(j.value)));let ge=S||S==0?S:0,we=A||A==0?A:g[0]?.data?.length;if(z.yMaxLeft=parseFloat((ge+"").length>(we+"").length?ge+"":we+""),z.xMax=T.max(ke),z.xMin=T.min(ke),z.xMin===z.xMax){const C=z.xMax===0?1:Math.abs(z.xMax*.1);z.xMin-=C,z.xMax+=C}},Me=()=>{switch(e.bins.binsCalculation){case"Automatic":Le=de/50;break;case"Number of Bins":Pe(!1);break;case"Bin Width":Pe(!0)}},Pe=Ue=>{g.forEach($e=>$e.data.sort((ge,we)=>ge.value-we.value));let xe=z.xMax-z.xMin,ke;Ue?(parseFloat(e.bins.binsCalculationValue)<=2&&(e.bins.binsCalculationValue="3"),ke=xe/parseFloat(e.bins.binsCalculationValue)):(parseFloat(e.bins.binsCalculationValue)<=1&&(e.bins.binsCalculationValue="1"),ke=xe/parseFloat(e.bins.binsCalculationValue));let De=z.xMin;if(Ue)for(Te=[De];De<z.xMax;)De+=ke,Te.push(De);else for(Te=[De];Math.round(De)<Math.round(z.xMax);)De+=ke,Te.push(Math.round(De))},ne=()=>{d=T.scaleLinear().domain([z.xMin,z.xMax]).range([de,0]);const Ue=Te.length>0?Te:d.ticks(Le);let xe=T.bin().value(De=>De).domain(d.domain()).thresholds(Ue);g.forEach(De=>{let $e=xe(De.data.map(ge=>ge.value));he.push($e)}),g.forEach((De,$e)=>he[$e].forEach(ge=>{ge.name=De.properties.legend,ge.color=De.properties.color,ge.opacity=De.properties.opacity}));let ke=[];he.forEach(De=>De.forEach($e=>ke.push($e.length))),z.yMaxLeft=T.max(ke),z.yMinLeft=T.min(ke),i=T.scaleLinear().domain([Z||Z==0?Z:0,L||L==0?L:z.yMaxLeft+.2*z.yMaxLeft]).range([0,Q])},Be=()=>{ye();{let Ue=ut(z.yMaxLeft,z.yMinLeft,Q,e,z,S,A,!1,de);v=T.axisBottom(i).tickFormat(xe=>qe(xe,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-de+0:0).tickValues(Ue.autoLabelFlag?void 0:Ue.yAxisLabelArray).ticks(Ue.customTickValue).tickPadding(8).tickSizeOuter(0)}},ye=()=>{vi(z.xMax,z.xMin,de,e,Z,L,Q,!1).xAxisLabelArray.shift(),h=T.axisLeft(d).tickFormat(xe=>qe(xe,e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision,!1)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-Q:0).tickSizeOuter(0),e.bins.binsCalculation==="Automatic"?h.ticks(Le):h.tickValues(Te).ticks(de/50)},Ye=Ue=>{const xe=e.animation.animationEnabled,ke=c.append("g").attr("class","parentGroup").selectAll("#scaling-svg"+s+" .rect").data(he).enter().append("g").selectAll("rect").data($e=>$e).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",$e=>{const ge=d($e.x0),we=d($e.x1);return Math.min(ge,we)}).attr("height",$e=>{const ge=d($e.x0),we=d($e.x1),C=parseFloat(e.bins.binsGapWidth)||0;return Math.max(1,Math.abs(we-ge)-C)}).attr("width",0).style("fill",$e=>$e.color!==ze.white?$e.color:"none").style("opacity",e.bins.binsFillOpacity).style("shape-rendering","crispEdges").on("mousemove",($e,ge)=>{xt([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():ge.properties?.currentMeasure?ge.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:`${ge.x0}-${ge.x1}`},{key:e.xAxisTitle.xAxisTitleHTML!==""?new DOMParser().parseFromString(e.xAxisTitle.xAxisTitleHTML,"text/html").body.textContent?.trim():e.xAxisTitle.xAxisTitleText,value:qe(e.toolTip.toolTipNumberFormat==",.0%"?Math.abs(ge.length/g[0].data.length):ge.length,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!1)}],e,$e)}).on("mouseout",ct);(xe?ke.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):ke).attr("width",$e=>i($e.length)),c.selectAll(".parentGroup").raise()},O=Ue=>{Q=q-Ue.left-Ue.right,de=J-Ue.bottom-Ue.top},Fe=(Ue,xe,ke,De,$e)=>{if(!e.plotArea.fitChart){const ge=Ue[0].data.length-ce,we=xe-20;a=z.dimensionList.slice(P,P+ce),g=JSON.parse(JSON.stringify(Ue)),g.forEach((se,Se)=>g[Se].data=se.data.filter(pe=>a.includes(pe.dimension))),ke.append("rect").attr("x",De.left).attr("y",we).attr("width",$e).attr("height",8).attr("fill","#ddd").attr("rx",4);const C=$e*ce/z.dimensionList.length,j=ke.append("rect").attr("x",De.left).attr("y",we).attr("width",C).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",se=>{let Se=Math.min(Math.max(se.x,De.left),De.left+$e-C);j.attr("x",Se),P=Math.round((Se-De.left)/($e-C)*ge),a=z.dimensionList.slice(P,P+ce),g=JSON.parse(JSON.stringify(Ue)),g.forEach((pe,K)=>g[K].data=pe.data.filter(w=>a.includes(w.dimension))),ye(),We()}));ke.on("wheel",se=>{se.preventDefault();const Se=Math.abs(se.deltaX)>Math.abs(se.deltaY)?se.deltaX:se.deltaY;P+=Se>0?1:-1,P=Math.max(0,Math.min(P,ge));const pe=De.left+($e-C)*P/ge;j.attr("x",pe),g=JSON.parse(JSON.stringify(Ue)),g.forEach((K,w)=>g[w].data=K.data.filter(_=>a.includes(_.dimension))),ye(),We()})}We()},We=()=>{Qt(c,e,x,b,h,de),Ye()};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"className",ref:n,id:s,style:{width:"100%",height:"100%"}})})},vr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,tooltipFormatter:n,onElementClick:o,vfxPickModeActive:p})=>{const m=crypto.randomUUID(),f=0,y=ee.AreaChart,S=Ne.useRef(),A=Ne.useRef(o);A.current=o;const Z=Ne.useRef(p);Z.current=p;const L=ft(l.ChartData,l.DimensionList),Y=l.DimensionList,b=!!e.swapAxis?.swapAxisEnabled;let H=!1;const B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,N=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v=0,a,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe,We,Ue,xe=[],ke=0,De,$e,ge,we=[],C={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{j()}catch(V){Ce("Linechart","createLineChart",V)}},[e]);const j=()=>{({formatOptions:e,svg:a,width:c,height:d}=wt(S,e)),se(),{formatOptions:e,dataTableLegendsList:we}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:J,maxNumberForSecondaryAxis:M,customYaxisMaxValue:I,secondaryCustomYaxisMaxValue:N}=$t(e,C.yMinLeft,C.yMaxLeft,C.yMinRight,C.yMaxRight),{margin:R,yLabel:X,xLabel:le,yTitle:te,xTitle:Q,dimensionHeightWidthArray:de,chartTitleHeight:Le,secondaryAxisTitleWidth:Te,legendMargin:he,secondaryYLabel:q,visibleBars:De,columnWidth:$e,scrollbarVisible:ge}=St(c,d,J,M,C.yMaxLeft,e,C.legendList,C.dimensionList,C.yMaxRight,H,B,t,b,C,we),{dataTable:i,dataTableHeight:h}=Wt(e,b?le:X,b?Q:te,L,C.dimensionList,l),b&&i.length>0&&(v=h,R.bottom+=v,h=0),ae(R),Ft(a,c,d,e),g=Dt(a,R),Ct(g,e,h,x,k+v,y,m),Se(),K(),b?(sa(e,g,X,k,x,O),H&&Li(e,g,q,Fe,x)):(Qt(g,e,h,X,Me,k),H&&gi(g,e,h,q,ne,k,x)),Vt(e,b,a,R,le,d,Q,C.chartType,X,x,k),Nt(k+v,e,h,b,a,R,te,X,x),Jt(a,H,R,e,h,k,x,q,Te,b),Pt(a,e,c,Le),Et(d,a,de,Le,c,he,e,L,m,h,R,dt.areaWithLine,y,r),Xt(L,d,c,a,R,x,ge,De,C,ke,!1,re,b)},se=()=>{const V=[],U=[];let F=[],E=-1/0,W=1/0,Ae=-1/0,ue=1/0;e.plotArea.hideZeroValues&&(C.hideZeroValues=!0,L.forEach(oe=>{oe.data=oe.data.filter(fe=>fe.value!==0)})),L.forEach(oe=>{U.push(oe.properties.alias?oe.properties.alias:oe.legend),oe.data.forEach(fe=>{V.push(fe),oe.properties.axis==="Secondary"?(H=!0,Ae=Math.max(Ae,fe.value),ue=Math.min(ue,fe.value)):(E=Math.max(E,fe.value),W=Math.min(W,fe.value))})}),C.chartData=V,C.legendList=U,C.yMaxLeft=E,C.yMinLeft=W>0?0:W,C.yMaxRight=Ae,C.yMinRight=ue>0?0:ue,F=t?vt(e.xAxisLabel.xAxisNumberFormat,C.dimensionList).map(oe=>oe):C.dimensionList,C.dimensionList.forEach((oe,fe)=>{C.formattedDimensionListMap.set(oe,F[fe])}),xe=JSON.parse(JSON.stringify(L)),e.plotArea.fitChart?Ue=C.dimensionList:Ue=C.dimensionList.slice(ke,ke+De)},Se=()=>{let V=ut(I||C.yMaxLeft,C.yMinLeft,k,e,C,G,I,b,x).yAxisLabelArray;C.yMaxLeft=V[V.length-1],C.yMinLeft=V[0];const U=b?[0,h>0?x-h:x]:[h>0?k-h:k,0];{const F=T.scaleLinear().domain([C.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:0:C.yMinLeft<0?C.yMinLeft*1.1:C.yMinLeft*.9,C.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:C.yMaxLeft*1.1]).range(U);b?ye=F:P=F}if(H){const F=T.scaleLinear().domain([C.yMinRight>=0?(D||D==0)&&!Number.isNaN(D)?D:0:(D||D==0)&&!Number.isNaN(D)?D:C.yMinRight*1.1,C.yMaxRight<=0?N||0:N||C.yMaxRight*1.1]).range(U);b?Ye=F:ce=F}if(me=b?[k,0]:[0,x],!b&&e.seriesLabel.seriesLabelVisibility){let F=na(x,P,e,xe,void 0,H,k);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(ve=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?me=[0,x-F.heightWidth[0]]:me=[F.heightWidth[0],x]}},pe=()=>{const V=T.scalePoint().domain(Ue).range(me).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?Be=V:z=V},K=()=>{w();{let V=ut(I||C.yMaxLeft,C.yMinLeft,k,e,C,G,I,b,x);b?O=T.axisBottom(ye).tickFormat(U=>qe(U,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??x/50).tickPadding(8).tickSizeOuter(0):Me=T.axisLeft(P).tickFormat(U=>qe(U,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,x,ve)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/30).tickPadding(8).tickSizeOuter(0)}if(H){let V=ut(N||C.yMaxRight,D||C.yMinRight,k,e,C,D,N);b?Fe=T.axisTop(Ye).tickFormat(U=>qe(U,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??x/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-k:0).tickSizeOuter(0):ne=T.axisRight(ce).tickFormat(U=>qe(U,e.secondaryYAxisLabel.secondaryYAxisDisplayUnits,e.secondaryYAxisLabel.secondaryYAxisNumberFormat,e.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision)).tickValues(V.autoLabelFlag?void 0:V.yAxisLabelArray).ticks(V.customTickValue??k/30).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-x:0).tickSizeOuter(0)}},w=()=>{b?We=T.axisLeft(Be).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*x*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(Ue,k,e)):Pe=T.axisBottom(z).tickSize(ca(e,k,h,!0)).tickSizeOuter(0).tickValues(At(Ue,x,e))},_=V=>{const U=e.plotArea.plotAreaHideLineAndMarkers;V.forEach(Re=>{Re.data.forEach(Ve=>{Ve.hideZero=Re.properties.hideZeroValues,Ve.axis=Re.properties.axis})});const F=b?T.area().y(Re=>{const Ve=Be(Re.dimension);return Ve??0}).x0(Re=>Re.axis===Oe.primary?ye(0):Ye(0)).x1(Re=>Re.axis===Oe.primary?ye(Re.value):Ye(Re.value)).defined(Re=>Re.hideZero?!!Re.value:!0).curve(Tt(e)):T.area().x(Re=>z(Re.dimension)?z(Re.dimension):null).y0(Re=>Re.axis===Oe.primary?P(0):ce(0)).y1(Re=>Re.axis===Oe.primary?P(Re.value):ce(Re.value)).defined(Re=>Re.hideZero?!!Re.value:!0).curve(Tt(e)),E=b?T.area().y(Re=>{const Ve=Be(Re.dimension);return Ve??0}).x0(()=>ye(0)).x1(()=>ye(0)).defined(Re=>Re.hideZero?!!Re.value:!0).curve(Tt(e)):T.area().x(Re=>z(Re.dimension)?z(Re.dimension):null).y0(()=>P(0)).y1(()=>P(0)).defined(Re=>Re.hideZero?!!Re.value:!0).curve(Tt(e)),W=e.animation.animationEnabled;let Ae=g.selectAll(".parentGroup").data([V]),ue=g.append("g").attr("class","focusClass");Ae=Ae.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(Ae);let oe=Ae.selectAll(".area-group").data(Re=>Re),fe=oe.enter().append("g").attr("class","area-group");fe.append("path").attr("class","area parentGroup").attr("fill",Re=>Re.properties.color!==ze.white?Re.properties.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("hoverId",Re=>(Re.properties?.alias||Re.properties?.name||"Legend").replace(/\s+/g,"-")).attr("d",Re=>E(Re.data)).attr(rt.SeriesId,Re=>Re.properties.legendUniqueId).attr(rt.DimValue,Re=>Re.properties.alias||Re.properties.name||"").on("click",kt(Z,A,(Re,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(Re){W?T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",F(Re.data)):T.select(this).attr("d",F(Re.data))}),fe.merge(oe).each(function(Re){const Ve=T.select(this);Ve.selectAll("path.visibleLine").data([Re]).join("path").attr("class","visibleLine parentGroup").attr("d",be=>W?E(be.data):F(be.data)).attr("stroke",be=>be.properties.areaBorderColor!==ze.white?be.properties.areaBorderColor:"none").attr("stroke-dasharray",be=>{const Ge=parseInt(be.properties.lineWidth);switch(be.properties.lineStyle){case gt.dotted:return`0,${Ge+2}`;case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",be=>be.properties.lineStyle===gt.dotted?xa.round:xa.butt).attr("stroke-width",be=>U?be.properties.lineStyle!==gt.none&&e.plotArea.plotAreaHideLineAndMarkers?be.properties.lineWidth:"0":0).attr("fill","none").each(function(be){W&&T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",F(be.data))}),Ve.selectAll("path.hoverLine").data([Re]).join("path").attr("class","hoverLine").attr("d",be=>F(be.data)).attr("fill",ze.transparent).attr("stroke","none").style("pointer-events","all").raise(),mi(e,Ae,ue,Ue,V,b?Be:z,b?ye:P,y,!1,b)}),oe.exit().remove(),Na(Ae,V,y,b?Be:z,b?ye:P,b?Ye:ce,null,e,C,N,D,G,I,!1,n,b),g.selectAll(".parentGroup").raise(),g.selectAll(".hoverLine").raise()},ae=V=>{x=c-V.left-V.right,k=d-V.bottom-V.top},re=(V,U,F)=>{xe=U,Ue=V,De=F,$()},$=()=>{if(pe(),w(),$a(L,b?Be:z,b?ye:P,b?Ye:ce,R,bt,[],[],e,y,d,c,x,Ue,k,m,a,u,void 0,void 0,s,!1,b),b?oa(e,g,le,k,x,We,Fe,ye,C.yMaxLeft,Ue,y,t,c,de,$e,Be):la(g,C,le,e,h,P,Pe,de,d,f,t,x,k,Ue,z),_(xe),!b){let V=na(x,P,e,xe,void 0,H,k).labelArray;Ja(e,g,V)}if(e.dataTableProperties&&e.dataTableProperties.dataTable){!b&&e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1);const V=b?T.scalePoint().domain(Ue).range([0,x]).padding(.5):void 0;Zt(e.plotArea.fitChart,a,g,i,f,b?ye:P,V??z,void 0,void 0,void 0,v||h,y,e,X,te,Ue,x,V?[0,x]:me,C.formattedDimensionListMap,m,R,k,v>0?k+X:void 0)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},kr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID(),f=0,y=ee.StackAreaChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList)?.reverse()||[],Y=l.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,H=!1;let B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,R,X,le,te,Q,de,Le,Te,he,q,J,M=new Map,x,k,c,d,i,h,v=0,a,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe,We,Ue=[],xe=0,ke,De,$e,ge=[],we=[];const C=!1;let j={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{se()}catch(F){Ce("StackAreaChart","createAreaChart",F)}},[e]);const se=()=>{({formatOptions:e,svg:a,width:c,height:d}=wt(S,e)),Se(),{formatOptions:e,dataTableLegendsList:ge}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:q,maxNumberForSecondaryAxis:J}=$t(e,j.yMinLeft,j.yMaxLeft,j.yMinRight,j.yMaxRight),{margin:N,yLabel:R,xLabel:X,yTitle:le,xTitle:te,dimensionHeightWidthArray:Q,chartTitleHeight:de,secondaryAxisTitleWidth:Le,legendMargin:Te,secondaryYLabel:he,visibleBars:ke,columnWidth:De,scrollbarVisible:$e}=St(c,d,q,J,j.yMaxLeft,e,j.legendList,j.dimensionList,j.yMaxRight,H,C,t,b,j,ge),{dataTable:i,dataTableHeight:h}=Wt(e,b?X:R,b?te:le,L,j.dimensionList,l),b&&i.length>0&&(v=h,N.bottom+=v,h=0),re(N),Ft(a,c,d,e),g=Dt(a,N),Ct(g,e,h,x,k+v,y,m),pe(),w(),b?sa(e,g,R,k,x,Ye):Qt(g,e,h,R,Me,k),Vt(e,b,a,N,X,d,te,j.chartType,R,x,k),Nt(k+v,e,h,b,a,N,le,R,x),Jt(a,H,N,e,h,k,x,he,Le,b),Pt(a,e,c,de),Et(d,a,Q,de,c,Te,e,[...L].reverse(),m,h,N,dt.areaWithLine,y,r),Xt(L,d,c,a,N,x,$e,ke,j,xe,!1,$,b)},Se=()=>{const F=[],E=[];e.plotArea.hideZeroValues&&(j.hideZeroValues=!0,L.forEach(Re=>{Re.data=Re.data.filter(Ve=>Ve.value!==0)})),L.forEach((Re,Ve)=>{const be=`${Ve}~$~${Re.properties.alias}`;Re.properties.legend=be,E.push(be);for(const Ge of Re.data)F.push(Ge)}),j.chartData=F,j.legendList=E,Ue=JSON.parse(JSON.stringify(L));let W=mt(j.dimensionList,L,C);e.plotArea.fitChart?We=j.dimensionList:(We=j.dimensionList.slice(xe,xe+ke),Ue.forEach((Re,Ve)=>Ue[Ve].data=Re.data.filter(be=>We.includes(be.dimension))));const Ae=T.stack().keys(j.legendList).offset(T.stackOffsetDiverging)(W);U();let ue=1/0,oe=-1/0;for(const Re of Ae)for(const[Ve,be]of Re)ue=Math.min(ue,Ve),oe=Math.max(oe,be);j.yMinLeft=ue>0?0:ue,j.yMaxLeft=oe;let fe=t?vt(e.xAxisLabel.xAxisNumberFormat,j.dimensionList).map(Re=>Re):j.dimensionList;j.dimensionList.forEach((Re,Ve)=>{j.formattedDimensionListMap.set(Re,fe[Ve])})},pe=()=>{let F=ut(G||j.yMaxLeft,j.yMinLeft,k,e,j,B,G,b,x).yAxisLabelArray;j.yMaxLeft=F[F.length-1],j.yMinLeft=F[0];const E=b?[0,h>0?x-h:x]:[h>0?k-h:k,0];{const W=T.scaleLinear().domain([j.yMinLeft>=0?B!==void 0&&!Number.isNaN(B)?B:0:j.yMinLeft<0?j.yMinLeft*1.1:j.yMinLeft*.9,j.yMaxLeft<=0?0:G!==void 0&&!Number.isNaN(G)?G:j.yMaxLeft*1.1]).range(E);b?Be=W:P=W}if(me=b?[k,0]:[0,x],!b&&e.seriesLabel.seriesLabelVisibility){let W=na(x,P,e,L,void 0,H,k,!0);W.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(ve=W.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?me=[0,x-W.heightWidth[0]]:me=[W.heightWidth[0],x]}},K=()=>{const F=T.scalePoint().domain(We).range(me).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?ne=F:z=F},w=()=>{{let F=ut(G||j.yMaxLeft,j.yMinLeft,k,e,j,B,G,b,x);b?Ye=T.axisBottom(Be).tickFormat(E=>qe(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-k:0).tickValues(F.autoLabelFlag?void 0:F.yAxisLabelArray).ticks(F.customTickValue??x/50).tickPadding(8).tickSizeOuter(0):Me=T.axisLeft(P).tickFormat(E=>qe(E,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(Yt(e,x,ve)).tickValues(F.autoLabelFlag?void 0:F.yAxisLabelArray).ticks(F.customTickValue).tickPadding(8).tickSizeOuter(0)}},_=()=>{b?Fe=T.axisLeft(ne).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*x*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(We,k,e)):Pe=T.axisBottom(z).tickSize(ca(e,k,h,!0)).tickSizeOuter(0).tickValues(At(We,x,e))},ae=F=>{const E=e.animation.animationEnabled,W=e.plotArea.plotAreaHideLineAndMarkers;F.forEach(be=>{be.data.forEach(Ge=>{Ge.hideZero=be.properties.hideZeroValues,Ge.axis=be.properties.axis})});const Ae=b?T.area().y(be=>{const Ge=ne(be.data.dimension);return Ge??0}).x0(be=>Be(be[0])).x1(be=>Be(be[1])).defined(be=>be.data.hideZero?!!be.data.key:!0).curve(Tt(e)):T.area().x(be=>z(be.data.dimension)?z(be.data.dimension):null).y0(be=>P(be[0])).y1(be=>P(be[1])).defined(be=>be.data.hideZero?!!be.data.key:!0).curve(Tt(e)),ue=b?T.area().y(be=>{const Ge=ne(be.data.dimension);return Ge??0}).x0(()=>Be(0)).x1(()=>Be(0)).defined(be=>be.data.hideZero?!!be.data.key:!0).curve(Tt(e)):T.area().x(be=>z(be.data.dimension)?z(be.data.dimension):null).y0(()=>P(0)).y1(()=>P(0)).defined(be=>be.data.hideZero?!!be.data.key:!0).curve(Tt(e));let oe=g.selectAll(".lineGroup").data([we]),fe=g.append("g").attr("class","focusClass");oe=oe.enter().append("g").attr("class","areas lineGroup").attr("clip-path",`url(#${m}-clip)`).merge(oe);let Re=oe.selectAll(".area-group").data(be=>be),Ve=Re.enter().append("g").attr("class",be=>"area-group "+be.key.replace(/ /g,"-"));Ve.append("path").attr("hoverId",be=>(F[be.index].properties.alias||F[be.index].properties.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",be=>be.color!==ze.white?be.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",be=>ue(be)).attr(rt.SeriesId,be=>L[be.index]?.properties?.legendUniqueId??be.key).attr(rt.DimValue,be=>L[be.index]?.properties?.alias||L[be.index]?.properties?.name||"").on("click",kt(Z,A,(be,Ge)=>{const it=L[Ge.index]?.properties?.legendUniqueId??Ge.key,st=L[Ge.index]?.properties?.alias||L[Ge.index]?.properties?.name||"";return{seriesId:it,dimValue:st,legendUniqueId:it,seriesDisplayName:st}})).each(function(be){E?T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",Ae(be)):T.select(this).attr("d",Ae(be))}),Ve.merge(Re).each(function(be,Ge){const it=T.select(this);it.selectAll("path.visibleLine").data([be]).join("path").attr("class","visibleLine parentGroup").attr("d",st=>E?ue(st):Ae(st)).attr("stroke",st=>st.color!==ze.white?L[Ge].properties.areaBorderColor:"none").attr("stroke-dasharray",st=>{const ja=parseInt(L[Ge].properties.lineWidth.toString());switch(L[Ge].properties.lineStyle){case gt.dotted:return`0,${ja+2}`;case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",()=>L[Ge]?.properties?.lineStyle===gt.dotted?xa.round:"").attr("stroke-width",()=>W?L[Ge].properties.lineStyle!==gt.none?L[Ge].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(st){E&&T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",Ae(st))}),it.selectAll("path.hoverLine").data([be]).join("path").attr("class","hoverLine").attr("d",st=>Ae(st)).attr("fill",ze.transparent).attr("stroke","none").style("pointer-events","all").raise(),a.selectAll('[hoverId="'+(L[be.index].properties.alias||L[be.index].properties.name||"Legend").replace(/ /g,"-")+'"]').classed("highlight",!1).classed("unhighlight",!1)}),Re.exit().remove(),mi(e,oe,fe,We,F,b?ne:z,b?Be:P,y,!0,b),Na(oe,F,y,b?ne:z,b?Be:P,b?ye:ce,null,e,j,D,I,B,G,!1,p,b),g.selectAll(".parentGroup").raise(),g.selectAll(".hoverLine").raise()},re=F=>{x=c-F.left-F.right,k=d-F.bottom-F.top},$=(F,E,W)=>{Ue=E,We=F,ke=W,ri(l,M,We),U(),V()},V=()=>{if(K(),_(),b?oa(e,g,X,k,x,Fe,O,Be,j.yMaxLeft,We,y,t,c,Q,De,ne):la(g,j,X,e,h,P,Pe,Q,d,f,t,x,k,We,z),ae(Ue),Ya(we,b?ne:z,b?Be:P,b?ye:ce,N,bt,[],[],e,y,d,c,x,We,k,m,a,u,h,s,b),li(M,b?ne:z,b?Be:P,N,bt,[],e,y,d,c,a,s,b),!b){let F=na(x,P,e,Ue,void 0,H,k,!0).labelArray;Ja(e,g,F)}if(e.dataTableProperties&&e.dataTableProperties.dataTable){!b&&e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1);const F=b?T.scalePoint().domain(We).range([0,x]).padding(.5):void 0;Zt(e.plotArea.fitChart,a,g,i,f,b?Be:P,F??z,void 0,void 0,void 0,v||h,y,e,R,le,j.dimensionList,x,F?[0,x]:me,j.formattedDimensionListMap,m,N,k,v>0?k+R:void 0)}},U=()=>{let F=mt(We,Ue,C);we=T.stack().keys(j.legendList).offset(T.stackOffsetDiverging)(F),Ue.forEach((W,Ae)=>W.data.forEach((ue,oe)=>{ue[0]=we[Ae][oe][0],ue[1]=we[Ae][oe][1]}));let E=e.annotation.annotationSetLabelColor;we.forEach((W,Ae)=>W.forEach(ue=>{ue.key=W.key,W.color=JSON.parse(JSON.stringify(L[Ae].properties.color)),ue.data.labelPosition=L[Ae].properties.dataLabelPosition,ue.data.labelColor=E=="2"?JSON.parse(JSON.stringify(L[Ae].properties.color)):L[Ae].properties.labelColor,ue.hideZero=JSON.parse(JSON.stringify(L[Ae].properties.hideZeroValues)),ue.properties=L[Ae].properties}))};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},Cr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=crypto.randomUUID(),f=0,y=ee.NormalizedStackAreaChart,S=Ne.useRef(),A=Ne.useRef(n);A.current=n;const Z=Ne.useRef(o);Z.current=o;const L=ft(l.ChartData,l.DimensionList)?.reverse()||[],Y=l.DimensionList,b=!!e.swapAxis?.swapAxisEnabled,H=!1;let B=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,I=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMinText):void 0,D=e.secondaryYAxisLabel.secondaryYAxisIntervalsVisibility?parseFloat(e.secondaryYAxisLabel.secondaryYAxisMaxText):void 0,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h=0,v,a,g,P,ce,z,me,ve,Me,Pe,ne,Be,ye,Ye,O,Fe,We=[],Ue=0,xe,ke,De,$e=[],ge=[];const we=!0;let C={dimensionList:Y,chartType:y,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{j()}catch(U){Ce("NormalizedLinechart","createLineChart",U)}},[e]);const j=()=>{({formatOptions:e,svg:v,width:k,height:c}=wt(S,e)),se(),{formatOptions:e,dataTableLegendsList:$e}=zt(e,L,l.DataTableData??[]),{margin:N,yLabel:R,xLabel:X,yTitle:le,xTitle:te,dimensionHeightWidthArray:Q,chartTitleHeight:de,secondaryAxisTitleWidth:Le,legendMargin:Te,secondaryYLabel:he,visibleBars:xe,columnWidth:De,scrollbarVisible:ke}=St(k,c,q,J,C.yMaxLeft,e,C.legendList,C.dimensionList,C.yMaxRight,H,we,t,b,C,$e),{dataTable:d,dataTableHeight:i}=Wt(e,b?X:R,b?te:le,L,C.dimensionList,l),b&&d.length>0&&(h=i,N.bottom+=h,i=0),ae(N),Ft(v,k,c,e),a=Dt(v,N),Ct(a,e,i,M,x+h,y),Se(),K(),b?sa(e,a,R,x,M,ye):Qt(a,e,i,R,ve,x),Vt(e,b,v,N,X,c,te,C.chartType,R,M,x),Nt(x+h,e,i,b,v,N,le,R,M),Jt(v,H,N,e,i,x,M,he,Le,b),Pt(v,e,k,de),Et(c,v,Q,de,k,Te,e,[...L].reverse(),m,i,N,dt.areaWithLine,y,r),Xt(L,c,k,v,N,M,ke,xe,C,Ue,!1,re,b)},se=()=>{const U=[],F=[];e.plotArea.hideZeroValues&&(C.hideZeroValues=!0,L.forEach(oe=>{oe.data=oe.data.filter(fe=>fe.value!==0)})),L.forEach((oe,fe)=>{const Re=`${fe}~$~${oe.properties.alias}`;oe.properties.legend=Re,F.push(Re);for(const Ve of oe.data)U.push(Ve)}),C.chartData=U,C.legendList=F,We=JSON.parse(JSON.stringify(L)),e.plotArea.fitChart?Fe=C.dimensionList:(Fe=C.dimensionList.slice(Ue,Ue+xe),We.forEach(oe=>{oe.data=oe.data.filter(fe=>Fe.includes(fe.dimension))}));const E=mt(C.dimensionList,L,we),W=T.stack().keys(C.legendList).offset(T.stackOffsetDiverging)(E);V();let Ae=1/0;for(const oe of W)for(const[fe]of oe)Ae=Math.min(Ae,fe);C.yMinLeft=Ae>0?0:Ae,C.yMaxLeft=1;const ue=t?vt(e.xAxisLabel.xAxisNumberFormat,C.dimensionList).map(oe=>oe):C.dimensionList;C.formattedDimensionListMap=new Map(C.dimensionList.map((oe,fe)=>[oe,ue[fe]]))},Se=()=>{const U=b?[0,i>0?M-i:M]:[i>0?x-i:x,0];{const F=T.scaleLinear().domain([C.yMinLeft<0?-1:0,1]).range(U);b?ne=F:g=F}if(z=b?[x,0]:[0,M],!b&&e.seriesLabel.seriesLabelVisibility){let F=na(M,g,e,L,void 0,H,x,!0);F.labelArray,e.seriesLabel.seriesLabelPosition=="Right"&&(me=F.heightWidth[0]),e.seriesLabel.seriesLabelPosition=="Right"?z=[0,M-F.heightWidth[0]]:z=[F.heightWidth[0],M]}},pe=()=>{const U=T.scalePoint().domain(Fe).range(z).padding(e.dataTableProperties&&e.dataTableProperties.dataTable?.5:0);b?Pe=U:ce=U},K=()=>{{const U=e.yAxisLabel.yAxisTicksMode===Da.custom,F=parseInt(e.yAxisLabel.yAxisLabelDecimalPrecision)||0,E=U?za(C.yMinLeft<0?-1:0,1,e.yAxisLabel.yAxisTicksCount):null;b?ye=T.axisBottom(ne).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesVertical?-x:0).tickValues(E).tickFormat(T.format(`.${F}%`)).ticks(i>0?(M-i)/80:M/80).tickPadding(8).tickSizeOuter(0):ve=T.axisLeft(g).tickSize(Yt(e,M,me)).tickValues(E).tickFormat(T.format(`.${F}%`)).ticks(i>0?(x-i)/80:x/80).tickPadding(8).tickSizeOuter(0)}},w=()=>{b?O=T.axisLeft(Pe).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*M*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(Fe,x,e)):Me=T.axisBottom(ce).tickSize(ca(e,x,i,!0)).tickSizeOuter(0).tickValues(At(Fe,M,e))},_=U=>{const F=e.animation.animationEnabled,E=e.plotArea.plotAreaHideLineAndMarkers;ge.forEach((Ve,be)=>Ve.forEach((Ge,it)=>{const st=Ge.data.total;U[be].data[it]&&(U[be].data[it][0]=Ge[0]=st===0?0:Ge[0]/st,U[be].data[it][1]=Ge[1]=st===0?0:Ge[1]/st)})),U.forEach(Ve=>{Ve.data.forEach(be=>{be.hideZero=Ve.properties.hideZeroValues,be.axis=Ve.properties.axis})});const W=b?T.area().y(Ve=>{const be=Pe(Ve.data.dimension);return be??0}).x0(Ve=>ne(Ve[0])).x1(Ve=>ne(Ve[1])).defined(Ve=>Ve.data.hideZero?!!Ve[0]:!0).curve(T.curveLinear):T.area().x(Ve=>ce(Ve.data.dimension)?ce(Ve.data.dimension):null).y0(Ve=>g(Ve[0])).y1(Ve=>g(Ve[1])).defined(Ve=>Ve.data.hideZero?!!Ve[0]:!0).curve(T.curveLinear),Ae=b?T.area().y(Ve=>{const be=Pe(Ve.data.dimension);return be??0}).x0(()=>ne(0)).x1(()=>ne(0)).defined(Ve=>Ve.data.hideZero?!!Ve.data.key:!0).curve(Tt(e)):T.area().x(Ve=>ce(Ve.data.dimension)?ce(Ve.data.dimension):null).y0(()=>g(0)).y1(()=>g(0)).defined(Ve=>Ve.data.hideZero?!!Ve.data.key:!0).curve(Tt(e));let ue=a.selectAll(".lineGroup").data([ge]),oe=a.append("g").attr("class","focusClass");ue=ue.enter().append("g").attr("class","areas lineGroup").merge(ue);let fe=ue.selectAll(".area-group").data(Ve=>Ve),Re=fe.enter().append("g").attr("class",Ve=>"area-group "+Ve.key.replace(/ /g,"-"));if(Re.append("path").attr("hoverId",Ve=>(U[Ve.index]?.properties?.alias||U[Ve.index]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("class","area parentGroup").attr("fill",Ve=>Ve.color!==ze.white?Ve.color:"none").style("fill-opacity",e.plotArea.fillOpacity).style("pointer-events","none").attr("d",Ve=>Ae(Ve)).attr(rt.SeriesId,Ve=>L[Ve.index]?.properties?.legendUniqueId??Ve.key).attr(rt.DimValue,Ve=>L[Ve.index]?.properties?.alias||L[Ve.index]?.properties?.name||"").on("click",kt(Z,A,(Ve,be)=>{const Ge=L[be.index]?.properties?.legendUniqueId??be.key,it=L[be.index]?.properties?.alias||L[be.index]?.properties?.name||"";return{seriesId:Ge,dimValue:it,legendUniqueId:Ge,seriesDisplayName:it}})).each(function(Ve){const be=T.select(this);F?be.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",W(Ve)):be.attr("d",W(Ve))}),Re.merge(fe).each(function(Ve,be){const Ge=T.select(this);Ge.selectAll("path.visibleLine").data([Ve]).join("path").attr("class","visibleLine parentGroup").attr("d",it=>F?Ae(it):W(it)).attr("stroke",it=>it.color!==ze.white?L[be].properties.areaBorderColor:"none").attr("stroke-dasharray",it=>{const st=parseInt(L[be].properties.lineWidth.toString());switch(L[be].properties.lineStyle){case gt.dotted:return`0,${st+2}`;case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",()=>L[be]?.properties?.lineStyle===gt.dotted?xa.round:"").attr("stroke-width",()=>E?L[be].properties.lineStyle!==gt.none?L[be].properties.lineWidth:"0":0).attr("fill","none").style("pointer-events","none").each(function(it){F&&T.select(this).transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("d",W(it))}),Ge.selectAll("path.hoverLine").data([Ve]).join("path").attr("class","hoverLine").attr("d",it=>W(it)).attr("fill",ze.transparent).style("pointer-events","all").raise(),v.selectAll('[hoverId="'+fi((U[Ve.index]?.properties?.alias||U[Ve.index]?.properties?.name||"Legend").replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)}),fe.exit().remove(),mi(e,ue,oe,Fe,U,b?Pe:ce,b?ne:g,y,!0,b),a.selectAll(".parentGroup").raise(),a.selectAll(".hoverLine").raise(),Na(ue,U,y,b?Pe:ce,b?ne:g,b?Be:P,null,e,C,D,I,B,G,!0,p,b),e.dataTableProperties&&e.dataTableProperties.dataTable){!b&&e.xAxisLabel.xAxisPosition!="1"&&(e.xAxisLabel.xAxisLabelVisibility=!1);const Ve=b?T.scalePoint().domain(Fe).range([0,M]).padding(.5):void 0;Zt(e.plotArea.fitChart,v,a,d,f,b?ne:g,Ve??ce,void 0,void 0,void 0,h||i,y,e,R,le,C.dimensionList,M,Ve?[0,M]:z,C.formattedDimensionListMap,m,N,x,h>0?x+R:void 0)}},ae=U=>{M=k-U.left-U.right,x=c-U.bottom-U.top},re=(U,F,E)=>{We=F,Fe=U,xe=E,V(),$()},$=()=>{if(pe(),w(),b?oa(e,a,X,x,M,O,Ye,ne,C.yMaxLeft,Fe,y,t,k,Q,De,Pe):la(a,C,X,e,i,g,Me,Q,c,f,t,M,x,Fe,ce),_(We),Ya(ge,b?Pe:ce,b?ne:g,b?Be:P,N,bt,[],[],e,y,c,k,M,Fe,x,m,v,u,i,s,b),!b){let U=na(M,g,e,We,void 0,H,x,!0).labelArray;Ja(e,a,U)}},V=()=>{let U=mt(Fe,We,we);ge=T.stack().keys(C.legendList).offset(T.stackOffsetDiverging)(U),We.forEach((E,W)=>E.data.forEach((Ae,ue)=>{ge[W][ue]&&(Ae[0]=ge[W][ue][0],Ae[1]=ge[W][ue][1])}));let F=e.annotation.annotationSetLabelColor;ge.forEach((E,W)=>E.forEach(Ae=>{Ae.key=E.key,E.color=JSON.parse(JSON.stringify(L[W].properties.color)),Ae.data.labelPosition=L[W].properties.dataLabelPosition,Ae.data.labelColor=F=="2"?JSON.parse(JSON.stringify(L[W].properties.color)):L[W].properties.labelColor,Ae.hideZero=JSON.parse(JSON.stringify(L[W].properties.hideZeroValues)),Ae.properties=L[W].properties}))};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:m,style:{width:"100%",height:"100%"}})})},si={left:"Left",right:"Right",center:"Center"},Gt={left:"left",right:"right",top:"top",bottom:"bottom"},Ka={solid:"solid",dashed:"Dashed",dotted:"Dotted"},oi={rounded:"rounded",pill:"pill",extra_rounded:"extra_rounded",squircle:"squircle",rectangle:"rectangle"},pa={curve:"curve",elbow:"elbow",diagonal:"diagonal",s_curve:"s-curve",arc:"arc",reverse_elbow:"reverse-elbow",zigzag:"zigzag"},ul="PieFamilyCommonFunctions.ts",Mr=(t,e,l,s)=>{try{let u=t.total.totalPosition,r=t.total.totalAlignment,n=t.legends.legendPosition,o=0;switch(u){case wa.top:switch(o=n=="Top"?35:0,r){case _t.start:return{x:5,y:e+o+10};case _t.middle:return{x:l/2,y:e+o+10};case _t.end:return{x:l-20,y:e+o+10}}break;case wa.bottom:switch(o=n=="Bottom"?30:0,r){case _t.start:return{x:10,y:s-o-10};case _t.middle:return{x:l/2,y:s-o-10};case _t.end:return{x:l-20,y:s-o-10}}break}}catch(u){Ce(ul,"getTotalValueCords",u)}},Ni=(t,e,l,s,u,r)=>{try{if(t.total&&t.total.totalVisibility){let n=t.total.totalFontStyle,o=t.total.totalAlignment,p=t.total.totalNumberFormat===",.0%"||t.total.totalNumberFormat==="Percentage"?"100%":Qe(t.total.totalDisplayUnits,t.total.totalNumberFormat,t.total.totalDecimalPrecision)(e),m=Mr(t,l,u,r);const f=s.append("g").attr("transform",`translate(${m.x}, ${m.y})`).style("user-select","none");f.append("text").text(t.total.showTotalLabel!==!1?`${t.total.editTotalTextToggle?t.total.editTotalText:"Total"} : ${p}`:p).style("fill",t.total.totalColor!==ze.white?t.total.totalColor:"none").style("font-family",t.total.totalFontFamily).style("font-size",t.total.totalFontSize).style("font-style",n.includes(ie.italic)?ie.italic:"").style("text-decoration",n.includes(ie.underline)?ie.underline:"").style("font-weight",n.includes(ie.bold)?ie.bold:"").attr("text-anchor",o===_t.start?"start":o===_t.middle?"middle":o===_t.end?"end":""),t.animation?.animationEnabled&&f.attr("opacity",0).transition().duration(t.animation.animationDuration).ease(tt[t.animation.animationEffect]).attr("opacity",1)}}catch(n){Ce(ul,"drawTotalValue",n)}},Ga="PieChart.tsx",Sr=({data:t,formatOptions:e,chartId:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=Ne.useRef(),f=Ne.useRef(n);f.current=n;const y=Ne.useRef(o);y.current=o;const S=ft(t.ChartData);let A,Z,L,Y=40,b=Kt,H=[0,0],B,G,I,D,N,R,X,le,te=!1;Ne.useEffect(()=>{Q()},[e]);const Q=()=>{({chartFormatOptions:A,svg:N,width:L,height:Z}=ta(m,e)),de(),H=Wa(A,S),{margins:b,innerHeight:B,innerWidth:G,legendListWidth:le,chartTitleHeight:Y}=Ua(A,L,Z,H,b),Le(),ea(m,L,Z,A),D=da(N,b),Ot(m,Y,L,A),Ha(A,N,S,L,Z,le,Y,l,b,dt.circle,void 0,r),Te(),he(),A.plotArea.annotationDraggable&&A.plotArea.dataLabels?dl(bt,R,A,q(),ee.PieChart,L,Z,D,Math.min(B*.5,G*.5),s,u):M(),Ni(A,X,Y,N,L,Z)},de=()=>{try{X=0,t.ChartData.forEach(x=>{x.properties.dataLabelPosition=="2"&&(te=!0),X+=x.data[0].value})}catch(x){Ce(Ga,"loopOverSeriesData",x)}},Le=()=>{try{I=Math.min(B*.5,G*.5),te&&(I=I*.9)}catch(x){Ce(Ga,"defineChartRadius",x)}},Te=()=>{try{let x=nt(A.plotArea.rotation);const k=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;R=T.pie().value(i=>Math.abs(k?100:i.data[0].value)).startAngle((x??0)*(Math.PI/180)%360).endAngle(((x??0)+360)*(Math.PI/180)%360)(t.ChartData).map((i,h)=>({...i,x0:i.startAngle,x1:i.endAngle,y0:0,y1:I,depth:2}))}catch(x){Ce(Ga,"initPieChartData",x)}},he=()=>{try{const x=T.arc().innerRadius(0).outerRadius(I),k=T.arc().innerRadius(0).outerRadius(I+10),c=D.append("g").attr("class","parentGroup").attr("fill-opacity",A.plotArea.opacity).attr("transform",`${q()}`).selectAll("path").data(R).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!==ze.white?d.data.properties.color:"none").attr(rt.SeriesId,d=>d.data.properties.legendUniqueId??d.data.properties.name??"").attr(rt.DimValue,d=>d.data.properties.alias||d.data.legend||"").on("click",kt(y,f,(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",k)}).on("mousemove. ",d=>{xt([{key:A.yAxisTitle.yAxisTitleText,value:A.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(d.currentTarget.__data__.data.data[0].value/X)*100).toFixed(nt(A.toolTip.toolTipDecimalPrecision))+"%":Qe(A.toolTip.toolTipDisplayUnits,A.toolTip.toolTipNumberFormat,A.toolTip.toolTipDecimalPrecision)(d.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:d.currentTarget.__data__.data.properties.alias}],A,void 0,d.currentTarget.__data__.data.properties,Lt(p,String(d.currentTarget.__data__.data.legend??""),d.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ct()}).on("mouseout.arc",function(d){T.select(this).transition().duration(100).attr("d",x),ct()});A.animation.animationEnabled?c.transition().duration(A.animation.animationDuration).ease(tt[A.animation.animationEffect]).attrTween("d",function(d){const i=T.interpolate({startAngle:d.startAngle,endAngle:d.startAngle},d);return h=>x(i(h))}):c.attr("d",d=>x(d))}catch(x){Ce(Ga,"drawPieChart",x)}},q=()=>{try{return`translate(${G/2},${B/2})`}catch(x){return Ce(Ga,"getPiePosition",x),""}},J=(x,k)=>{try{if(k)return"translate(0 0)";{const c=(x.startAngle+x.endAngle)/2,d=Math.cos(c-Math.PI/2)*(I*.65),i=Math.sin(c-Math.PI/2)*(I*.65);let h=c*180/Math.PI%360,v=0;return h>180&&h<360?v=90:v=-90,h+=v,`translate(${d},${i}) rotate(${h})`}}catch(c){return Ce(Ga,"getDataLabelTransformString",c),""}},M=()=>{try{if(A.plotArea.dataLabels){const x=R&&R.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(Ht(R.filter(d=>d.data.properties.dataLabelPosition=="1"),A,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??ze.black).attr("font-style",d=>d.data.properties?.labelFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",d=>d.data.properties?.labelFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",d=>d.data.properties?.labelFontStyle?.includes(ie.bold)?ie.bold:"").attr("font-family",d=>d.data.properties?.labelFont??at).attr("transform",d=>J(d,x)).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}=A;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(Ht(R.filter(d=>d.data.properties.dataLabelPosition=="1"),A,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??ze.black).attr("font-style",d=>d.data.properties?.valueFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",d=>d.data.properties?.valueFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ie.bold)?ie.bold:"300").attr("font-family",d=>d.data.properties?.valueFont??at).attr("transform",d=>J(d,x)).attr("visibility",d=>d.endAngle-d.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",A.plotArea.dataLabelName?"1.00em":"0em").text(d=>{if(A.plotArea.dataLabelValue){const i=d.data.data[0].value;return A.plotArea.dataLabelValue&&i!==void 0?A.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(i/X)*100).toFixed(nt(A.plotArea.dataLabelDecimalPrecision)??0)+"%":Qe(A.plotArea.plotAreaDisplayUnits,A.plotArea.dataLabelNumberFormat,A.plotArea.dataLabelDecimalPrecision)(i):i}}).append("tspan").attr("x",0).attr("y",A.plotArea.dataLabelValue?A.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",d=>d.data.properties?.valueFontStyle?.includes(ie.bold)?ie.bold:"300").attr("fill-opacity",.5).text(d=>{const i=Math.abs(d.data.data[0].value);return A.plotArea.plotAreaAbsoluteValue&&i!==void 0?T.format(".2s")(i):""});let k=T.arc().startAngle(d=>d.x0).endAngle(d=>d.x1).innerRadius(d=>d.depth>1?d.y1-1+I/7:0).outerRadius(d=>d.depth>1?d.y1-1+I/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+I/1.5);D.selectAll("polyline.pie-label-connector").data(Ht(R.filter(d=>d.data.properties.dataLabelPosition=="2"),A,d=>d.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",q()).style("stroke",d=>A.connector.connectorColorOption=="Uniform"?A.connector.connectorUniformLineColor:d.data.properties.color).style("fill","none").style("stroke-dasharray",A.connector.connectorStyle===Ka.solid?0:A.connector.connectorStyle===Ka.dotted?1:4).style("stroke-width",A.connector.connectorLineThickness).attr("points",d=>{const i=c.centroid(d),h=k.centroid(d);let v=d.x0+(d.x1-d.x0)/2;v=v%(2*Math.PI);const a=I*1.1*(v<Math.PI?1:-1),g=h[1];return[i,h,[a,g]].map(P=>P.join(",")).join(" ")}),D.append("g").attr("class","pie-label-group").attr("transform",q()).selectAll("foreignObject").data(Ht(R.filter(d=>d.data.properties.dataLabelPosition=="2"),A,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 v=i<Math.PI?0:-80;return I*1.1*(i<Math.PI?1:-1)+v}).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=A.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(d.data[0].value/X)*100).toFixed(nt(A.plotArea.dataLabelDecimalPrecision))+"%":Qe(A.plotArea.plotAreaDisplayUnits,A.plotArea.dataLabelNumberFormat,A.plotArea.dataLabelDecimalPrecision)(d.data.data[0].value));let h="";return A.plotArea.dataLabelName&&(h+=`<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(ce.italic)?ce.italic:""};
94
- text-decoration: ${d.data.properties.labelFontStyle.includes(ce.underline)?ce.underline:""};
95
- font-weight: ${d.data.properties.labelFontStyle.includes(ce.bold)?ce.bold:""};
93
+ font-style: ${d.data.properties.labelFontStyle.includes(ie.italic)?ie.italic:""};
94
+ text-decoration: ${d.data.properties.labelFontStyle.includes(ie.underline)?ie.underline:""};
95
+ font-weight: ${d.data.properties.labelFontStyle.includes(ie.bold)?ie.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
- </span>`),g.plotArea.dataLabelValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
99
+ </span>`),A.plotArea.dataLabelValue&&d.data.data[0].value!==void 0&&(h+=`<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(ce.italic)?ce.italic:""};
103
- text-decoration: ${d.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
104
- font-weight: ${d.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
102
+ font-style: ${d.data.properties.valueFontStyle.includes(ie.italic)?ie.italic:""};
103
+ text-decoration: ${d.data.properties.valueFontStyle.includes(ie.underline)?ie.underline:""};
104
+ font-weight: ${d.data.properties.valueFontStyle.includes(ie.bold)?ie.bold:"300"};
105
105
  font-family: ${d.data.properties.valueFont};
106
106
  display: block;">
107
107
  ${i}
108
- </span>`),g.plotArea.plotAreaAbsoluteValue&&d.data.data[0].value!==void 0&&(y+=`<span style="
108
+ </span>`),A.plotArea.plotAreaAbsoluteValue&&d.data.data[0].value!==void 0&&(h+=`<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(ce.italic)?ce.italic:""};
112
- text-decoration: ${d.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
113
- font-weight: ${d.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
111
+ font-style: ${d.data.properties.valueFontStyle.includes(ie.italic)?ie.italic:""};
112
+ text-decoration: ${d.data.properties.valueFontStyle.includes(ie.underline)?ie.underline:""};
113
+ font-weight: ${d.data.properties.valueFontStyle.includes(ie.bold)?ie.bold:"300"};
114
114
  font-family: ${d.data.properties.valueFont};
115
115
  display: block;">
116
- ${v.format(".2s")(d.data.data[0].value)}
117
- </span>`),y}),g.animation.animationEnabled&&D.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",1)}}catch(h){me(Ga,"drawPieDataLabels",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:m,id:n,style:{width:"100%",height:"100%"}})})},Na="DonutChart.tsx",Sr=({data:t,formatOptions:e,chartId:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,onElementClick:r,vfxPickModeActive:c,tooltipFormatter:p})=>{const m=Ce.useRef(),L=Ce.useRef(r);L.current=r;const u=Ce.useRef(c);u.current=c;const S=mt(t.ChartData);let g,W,A,E=40,b=Jt,U=[0,0],Y,H,I,D,w,z,K,ye,se=!1,te;Ce.useEffect(()=>{xe()},[e]);const xe=()=>{({chartFormatOptions:g,svg:te,width:W,height:A}=Kt(m,e)),ge(),U=Ha(g,S),{margins:b,innerHeight:Y,innerWidth:H,legendListWidth:w,chartTitleHeight:E}=Ua(g,W,A,U,b),pe(),qt(m,W,A,g),z=oa(te,b),Xt(m,E,W,g),Wa(g,te,S,W,A,w,E,n,b,ct.hollowCircle,!1,l),he(),O(),g.plotArea.annotationDraggable&&g.plotArea.dataLabels?ol(pt,K,g,X(),le.DonutChart,W,A,z,Math.min(Y*.5,H*.5),o,x):h(),k()},ge=()=>{try{ye=0,S.forEach(s=>{s.properties.dataLabelPosition=="2"&&(se=!0),ye+=s.data[0].value})}catch(s){me(Na,"loopOverSeriesData",s)}},pe=()=>{try{I=Math.min(Y*.4,H*.4),se&&(I=I*.9),D=Math.min(rt(g.plotArea.innerRadius)/100*I,I)}catch(s){me(Na,"defineChartRadius",s)}},he=()=>{try{let s=rt(g.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;K=v.pie().value(T=>Math.abs(d?100:T.data[0].value)).startAngle((s??0)*(Math.PI/180)%360).endAngle(((s??0)+360)*(Math.PI/180)%360)(S)?.map((T,a)=>({...T,x0:T.startAngle,x1:T.endAngle,y0:0,y1:I,depth:2}))}catch(s){me(Na,"initPieChartData",s)}},O=()=>{try{const s=g.animation.animationEnabled,d=v.arc().innerRadius(D).outerRadius(I),i=v.arc().innerRadius(D).outerRadius(I+10),T=z.append("g").attr("class","parentGroup").attr("fill-opacity",g.plotArea.opacity).attr("transform",`${X()}`).selectAll("path").data(K).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!==Ie.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",vt(u,L,(a,f)=>({seriesId:f.data.properties.legendUniqueId??f.data.properties.name??"",dimValue:f.data.properties.alias||f.data.legend||"",legendUniqueId:f.data.properties.legendUniqueId??f.data.properties.name??"",seriesDisplayName:f.data.properties.alias||f.data.properties.name||""}))).each(function(a){const f=a;f._current={startAngle:0,endAngle:0}}).on("mouseover.arc",function(){s?v.select(this).transition().duration(150).attr("d",i):v.select(this).attr("d",i)}).on("mousemove.text",a=>{ut([{key:g.yAxisTitle.yAxisTitleText,value:g.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/ye)*100).toFixed(rt(g.toolTip.toolTipDecimalPrecision))+"%":Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],g,void 0,a.currentTarget.__data__.data.properties,At(p,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>ot()).on("mouseout.arc",function(){s?v.select(this).transition().duration(150).attr("d",d):v.select(this).attr("d",d)});s?T.transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attrTween("d",function(a){const f=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(N){return d(f(N))}}):T.attr("d",a=>d(a))}catch(s){me(Na,"drawDonutChart",s)}},X=()=>{try{return`translate(${H/2},${Y/2})`}catch(s){return me(Na,"getPiePosition",s),""}},M=(s,d)=>{try{if(d)return"translate(0 0)";{const i=(s.startAngle+s.endAngle)/2,y=(D+I)/2,T=Math.cos(i-Math.PI/2)*y,a=Math.sin(i-Math.PI/2)*y;let f=i*180/Math.PI%360,N=0;return f>180&&f<360?N=90:N=-90,f+=N,`translate(${T},${a}) rotate(${f})`}}catch(i){return me(Na,"getDataLabelTransformString",i),""}},h=()=>{try{if(g.plotArea.dataLabels){const s=K&&K.length===1;z.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="1"),g,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??Ie.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,s)).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}=g;return T.dataLabelName?y.data?.properties?.alias||y.data.legend:""}),z.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="1"),g,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??Ie.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("fill",y=>y.data.properties?.valueFontColor??Ie.black).attr("transform",y=>M(y,s)).attr("visibility",y=>y.endAngle-y.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",g.plotArea.dataLabelName?"1.00em":"0em").text(y=>{if(g.plotArea.dataLabelValue){const T=y.data.data[0].value;return g.plotArea.dataLabelValue&&T!==void 0?g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/ye)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(T):T}}).append("tspan").attr("x",0).attr("y",g.plotArea.dataLabelValue?g.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("fill",y=>y.data.properties?.valueFontColor??Ie.black).attr("fill-opacity",.5).text(y=>{const T=Math.abs(y.data.data[0].value);return g.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+I/7:0).outerRadius(y=>y.depth>1?y.y1-1+I/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+I/1.5);z.selectAll("polyline.pie-label-connector").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="2"),g,y=>y.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",X()).style("stroke",y=>g.connector.connectorColorOption=="Uniform"?g.connector.connectorUniformLineColor:y.data.properties.color).style("fill","none").style("stroke-dasharray",g.connector.connectorStyle===qa.solid?0:g.connector.connectorStyle===qa.dotted?1:4).style("stroke-width",g.connector.connectorLineThickness).attr("points",y=>{const T=i.centroid(y),a=d.centroid(y);let f=y.x0+(y.x1-y.x0)/2;f=f%(2*Math.PI);const N=I*1.1*(f<Math.PI?1:-1),ne=a[1];return[T,a,[N,ne]].map(Z=>Z.join(",")).join(" ")}),z.append("g").attr("class","pie-label-group").attr("transform",X()).selectAll("foreignObject").data(Ut(K.filter(y=>y.data.properties.dataLabelPosition=="2"),g,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 f=T<Math.PI?0:-80;return I*1.1*(T<Math.PI?1:-1)+f}).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=g.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y.data.data[0].value/ye)*100).toFixed(rt(g.plotArea.dataLabelDecimalPrecision))+"%":Ke(g.plotArea.plotAreaDisplayUnits,g.plotArea.dataLabelNumberFormat,g.plotArea.dataLabelDecimalPrecision)(y.data.data[0].value));let a="";return g.plotArea.dataLabelName&&(a+=`<span style="
118
- font-size: ${y.data.properties.labelFontSize}px;
119
- color: ${y.data.properties.labelFontColor};
120
- font-style: ${y.data.properties.labelFontStyle.includes(ce.italic)?ce.italic:""};
121
- text-decoration: ${y.data.properties.labelFontStyle.includes(ce.underline)?ce.underline:""};
122
- font-weight: ${y.data.properties.labelFontStyle.includes(ce.bold)?ce.bold:""};
123
- font-family: ${y.data.properties.labelFont};
116
+ ${T.format(".2s")(d.data.data[0].value)}
117
+ </span>`),h}),A.animation.animationEnabled&&D.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(A.animation.animationDuration).ease(tt[A.animation.animationEffect]).attr("opacity",1)}}catch(x){Ce(Ga,"drawPieDataLabels",x)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:m,id:l,style:{width:"100%",height:"100%"}})})},Pa="DonutChart.tsx",Fr=({data:t,formatOptions:e,chartId:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,onElementClick:n,vfxPickModeActive:o,tooltipFormatter:p})=>{const m=Ne.useRef(),f=Ne.useRef(n);f.current=n;const y=Ne.useRef(o);y.current=o;const S=ft(t.ChartData);let A,Z,L,Y=40,b=Kt,H=[0,0],B,G,I,D,N,R,X,le,te=!1,Q;Ne.useEffect(()=>{de()},[e]);const de=()=>{({chartFormatOptions:A,svg:Q,width:Z,height:L}=ta(m,e)),Le(),H=Wa(A,S),{margins:b,innerHeight:B,innerWidth:G,legendListWidth:N,chartTitleHeight:Y}=Ua(A,Z,L,H,b),Te(),ea(m,Z,L,A),R=da(Q,b),Ot(m,Y,Z,A),Ha(A,Q,S,Z,L,N,Y,l,b,dt.hollowCircle,!1,r),he(),q(),A.plotArea.annotationDraggable&&A.plotArea.dataLabels?dl(bt,X,A,J(),ee.DonutChart,Z,L,R,Math.min(B*.5,G*.5),s,u):x(),k()},Le=()=>{try{le=0,S.forEach(c=>{c.properties.dataLabelPosition=="2"&&(te=!0),le+=c.data[0].value})}catch(c){Ce(Pa,"loopOverSeriesData",c)}},Te=()=>{try{I=Math.min(B*.4,G*.4),te&&(I=I*.9),D=Math.min(nt(A.plotArea.innerRadius)/100*I,I)}catch(c){Ce(Pa,"defineChartRadius",c)}},he=()=>{try{let c=nt(A.plotArea.rotation);const d=t.ChartData?.length===1&&t.ChartData[0]?.data[0]?.value===0;X=T.pie().value(v=>Math.abs(d?100:v.data[0].value)).startAngle((c??0)*(Math.PI/180)%360).endAngle(((c??0)+360)*(Math.PI/180)%360)(S)?.map((v,a)=>({...v,x0:v.startAngle,x1:v.endAngle,y0:0,y1:I,depth:2}))}catch(c){Ce(Pa,"initPieChartData",c)}},q=()=>{try{const c=A.animation.animationEnabled,d=T.arc().innerRadius(D).outerRadius(I),i=T.arc().innerRadius(D).outerRadius(I+10),v=R.append("g").attr("class","parentGroup").attr("fill-opacity",A.plotArea.opacity).attr("transform",`${J()}`).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!==ze.white?a.data.properties.color:"none").attr(rt.SeriesId,a=>a.data.properties.legendUniqueId??a.data.properties.name??"").attr(rt.DimValue,a=>a.data.properties.alias||a.data.legend||"").on("click",kt(y,f,(a,g)=>({seriesId:g.data.properties.legendUniqueId??g.data.properties.name??"",dimValue:g.data.properties.alias||g.data.legend||"",legendUniqueId:g.data.properties.legendUniqueId??g.data.properties.name??"",seriesDisplayName:g.data.properties.alias||g.data.properties.name||""}))).each(function(a){const g=a;g._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=>{xt([{key:A.yAxisTitle.yAxisTitleText,value:A.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/le)*100).toFixed(nt(A.toolTip.toolTipDecimalPrecision))+"%":Qe(A.toolTip.toolTipDisplayUnits,A.toolTip.toolTipNumberFormat,A.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.properties.alias}],A,void 0,a.currentTarget.__data__.data.properties,Lt(p,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>ct()).on("mouseout.arc",function(){c?T.select(this).transition().duration(150).attr("d",d):T.select(this).attr("d",d)});c?v.transition().duration(A.animation.animationDuration).ease(tt[A.animation.animationEffect]).attrTween("d",function(a){const g=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return function(P){return d(g(P))}}):v.attr("d",a=>d(a))}catch(c){Ce(Pa,"drawDonutChart",c)}},J=()=>{try{return`translate(${G/2},${B/2})`}catch(c){return Ce(Pa,"getPiePosition",c),""}},M=(c,d)=>{try{if(d)return"translate(0 0)";{const i=(c.startAngle+c.endAngle)/2,h=(D+I)/2,v=Math.cos(i-Math.PI/2)*h,a=Math.sin(i-Math.PI/2)*h;let g=i*180/Math.PI%360,P=0;return g>180&&g<360?P=90:P=-90,g+=P,`translate(${v},${a}) rotate(${g})`}}catch(i){return Ce(Pa,"getDataLabelTransformString",i),""}},x=()=>{try{if(A.plotArea.dataLabels){const c=X&&X.length===1;R.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ht(X.filter(h=>h.data.properties.dataLabelPosition=="1"),A,h=>h.data.data[0].value)).enter().append("text").attr("hoverId",h=>(h.data?.properties?.alias||h.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",h=>h.data.properties?.labelFontSize??11).attr("fill",h=>h.data.properties?.labelFontColor??ze.black).attr("font-style",h=>h.data.properties?.labelFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",h=>h.data.properties?.labelFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",h=>h.data.properties?.labelFontStyle?.includes(ie.bold)?ie.bold:"").attr("font-family",h=>h.data.properties?.labelFont??at).attr("transform",h=>M(h,c)).attr("visibility",h=>h.endAngle-h.startAngle<.17?"hidden":"visible").attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(h=>{const{plotArea:v}=A;return v.dataLabelName?h.data?.properties?.alias||h.data.legend:""}),R.append("g").attr("class","parentGroup pie-label-group").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ht(X.filter(h=>h.data.properties.dataLabelPosition=="1"),A,h=>h.data.data[0].value)).enter().append("text").attr("hoverId",h=>(h.data?.properties?.alias||h.data?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("font-size",h=>h.data.properties?.valueFontSize??11).attr("fill",h=>h.data.properties?.lableFontColor??ze.black).attr("font-style",h=>h.data.properties?.valueFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",h=>h.data.properties?.valueFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",h=>h.data.properties?.valueFontStyle?.includes(ie.bold)?ie.bold:"300").attr("font-family",h=>h.data.properties?.valueFont??at).attr("fill",h=>h.data.properties?.valueFontColor??ze.black).attr("transform",h=>M(h,c)).attr("visibility",h=>h.endAngle-h.startAngle<.17?"hidden":"visible").attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy",A.plotArea.dataLabelName?"1.00em":"0em").text(h=>{if(A.plotArea.dataLabelValue){const v=h.data.data[0].value;return A.plotArea.dataLabelValue&&v!==void 0?A.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(v/le)*100).toFixed(nt(A.plotArea.dataLabelDecimalPrecision)??0)+"%":Qe(A.plotArea.plotAreaDisplayUnits,A.plotArea.dataLabelNumberFormat,A.plotArea.dataLabelDecimalPrecision)(v):v}}).append("tspan").attr("x",0).attr("y",A.plotArea.dataLabelValue?A.plotArea.dataLabelName?"2.45em":"1.65em":null).attr("font-weight",h=>h.data.properties?.valueFontStyle?.includes(ie.bold)?ie.bold:"300").attr("fill",h=>h.data.properties?.valueFontColor??ze.black).attr("fill-opacity",.5).text(h=>{const v=Math.abs(h.data.data[0].value);return A.plotArea.plotAreaAbsoluteValue&&v!==void 0?T.format(".2s")(v):""});let d=T.arc().startAngle(h=>h.x0).endAngle(h=>h.x1).innerRadius(h=>h.depth>1?h.y1-1+I/7:0).outerRadius(h=>h.depth>1?h.y1-1+I/7:0),i=T.arc().startAngle(h=>h.x0).endAngle(h=>h.x1).innerRadius(h=>h.depth>2?h.y0:0).outerRadius(h=>h.y1+I/1.5);R.selectAll("polyline.pie-label-connector").data(Ht(X.filter(h=>h.data.properties.dataLabelPosition=="2"),A,h=>h.data.data[0].value)).join("polyline").attr("class","pie-label-connector").attr("transform",J()).style("stroke",h=>A.connector.connectorColorOption=="Uniform"?A.connector.connectorUniformLineColor:h.data.properties.color).style("fill","none").style("stroke-dasharray",A.connector.connectorStyle===Ka.solid?0:A.connector.connectorStyle===Ka.dotted?1:4).style("stroke-width",A.connector.connectorLineThickness).attr("points",h=>{const v=i.centroid(h),a=d.centroid(h);let g=h.x0+(h.x1-h.x0)/2;g=g%(2*Math.PI);const P=I*1.1*(g<Math.PI?1:-1),ce=a[1];return[v,a,[P,ce]].map(z=>z.join(",")).join(" ")}),R.append("g").attr("class","pie-label-group").attr("transform",J()).selectAll("foreignObject").data(Ht(X.filter(h=>h.data.properties.dataLabelPosition=="2"),A,h=>h.data.data[0].value)).join("foreignObject").attr("width",80).attr("height",60).attr("x",h=>{let v=h.x0+(h.x1-h.x0)/2;v=v%(2*Math.PI);const g=v<Math.PI?0:-80;return I*1.1*(v<Math.PI?1:-1)+g}).attr("y",h=>d.centroid(h)[1]-30).append("xhtml:div").attr("hoverId",h=>(h.data?.properties?.alias||h.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(h=>{try{let v=h.data.data[0].value.toString();h.data.data[0].value!==void 0&&(v=A.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(h.data.data[0].value/le)*100).toFixed(nt(A.plotArea.dataLabelDecimalPrecision))+"%":Qe(A.plotArea.plotAreaDisplayUnits,A.plotArea.dataLabelNumberFormat,A.plotArea.dataLabelDecimalPrecision)(h.data.data[0].value));let a="";return A.plotArea.dataLabelName&&(a+=`<span style="
118
+ font-size: ${h.data.properties.labelFontSize}px;
119
+ color: ${h.data.properties.labelFontColor};
120
+ font-style: ${h.data.properties.labelFontStyle.includes(ie.italic)?ie.italic:""};
121
+ text-decoration: ${h.data.properties.labelFontStyle.includes(ie.underline)?ie.underline:""};
122
+ font-weight: ${h.data.properties.labelFontStyle.includes(ie.bold)?ie.bold:""};
123
+ font-family: ${h.data.properties.labelFont};
124
124
  display: block; white-space: nowrap; width:80px; overflow:hidden; text-overflow:ellipsis; text-align: center;">
125
- ${y.data.legend}
126
- </span>`),g.plotArea.dataLabelValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
127
- font-size: ${y.data.properties.valueFontSize}px;
128
- color: ${y.data.properties.valueFontColor};
129
- font-style: ${y.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:""};
130
- text-decoration: ${y.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
131
- font-weight: ${y.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
132
- font-family: ${y.data.properties.valueFont};
125
+ ${h.data.legend}
126
+ </span>`),A.plotArea.dataLabelValue&&h.data.data[0].value!==void 0&&(a+=`<span style="
127
+ font-size: ${h.data.properties.valueFontSize}px;
128
+ color: ${h.data.properties.valueFontColor};
129
+ font-style: ${h.data.properties.valueFontStyle.includes(ie.italic)?ie.italic:""};
130
+ text-decoration: ${h.data.properties.valueFontStyle.includes(ie.underline)?ie.underline:""};
131
+ font-weight: ${h.data.properties.valueFontStyle.includes(ie.bold)?ie.bold:"300"};
132
+ font-family: ${h.data.properties.valueFont};
133
133
  display: block;">
134
- ${T}
135
- </span>`),g.plotArea.plotAreaAbsoluteValue&&y.data.data[0].value!==void 0&&(a+=`<span style="
136
- font-size: ${y.data.properties.valueFontSize}px;
137
- color: ${y.data.properties.valueFontColor};
138
- font-style: ${y.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:""};
139
- text-decoration: ${y.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:""};
140
- font-weight: ${y.data.properties.valueFontStyle.includes(ce.bold)?ce.bold:"300"};
141
- font-family: ${y.data.properties.valueFont};
134
+ ${v}
135
+ </span>`),A.plotArea.plotAreaAbsoluteValue&&h.data.data[0].value!==void 0&&(a+=`<span style="
136
+ font-size: ${h.data.properties.valueFontSize}px;
137
+ color: ${h.data.properties.valueFontColor};
138
+ font-style: ${h.data.properties.valueFontStyle.includes(ie.italic)?ie.italic:""};
139
+ text-decoration: ${h.data.properties.valueFontStyle.includes(ie.underline)?ie.underline:""};
140
+ font-weight: ${h.data.properties.valueFontStyle.includes(ie.bold)?ie.bold:"300"};
141
+ font-family: ${h.data.properties.valueFont};
142
142
  display: block;">
143
- ${v.format(".2s")(y.data.data[0].value)}
144
- </span>`),a}catch(T){return me(Na,"drawDonutDataLabels",T),""}}),g.animation.animationEnabled&&z.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",1)}}catch(s){me(Na,"drawDonutDataLabels",s)}},k=()=>{try{if(g.total&&g.total.totalVisibility){let s=ye,d=g.total.totalFontStyle;const i=z.append("g").attr("transform",X()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",g.total.totalColor!==Ie.white?g.total.totalColor:"none").style("font-family",g.total.totalFontFamily).style("font-size",g.total.totalFontSize).style("font-style",d.includes(ce.italic)?ce.italic:"").style("text-decoration",d.includes(ce.underline)?ce.underline:"").style("font-weight",d.includes(ce.bold)?ce.bold:"").attr("text-anchor","middle").attr("visibility",g.plotArea.dataLabelValue?"visible":"hidden").text(g.total.showTotalLabel!==!1?g.total.editTotalText:"").append("tspan").attr("x",0).attr("y",g.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(ce.bold)?ce.bold:300).text(g.total.totalNumberFormat===",.0%"||g.total.totalNumberFormat==="Percentage"?"100%":Ke(g.total.totalDisplayUnits,g.total.totalNumberFormat,g.total.totalDecimalPrecision)(s)),g.animation.animationEnabled&&i.attr("opacity",0).transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",1)}}catch(s){me(Na,"drawTotalValue",s)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:m,id:n,style:{width:"100%",height:"100%"}})})},Ka="TreemapChart.tsx",Fr=({data:t,formatOptions:e,chartId:n,onElementClick:o,vfxPickModeActive:x,tooltipFormatter:l})=>{const r=Ce.useRef(),c=Ce.useRef(o);c.current=o;const p=Ce.useRef(x);p.current=x;let m,L,u,S=40,g=Jt,W,A,E,b,U,Y;Ce.useEffect(()=>{H()},[e]);const H=()=>{({chartFormatOptions:m,svg:Y,width:L,height:u}=Kt(r,e)),{margins:g,chartTitleHeight:S,innerHeight:W,innerWidth:A}=ri(m,u,L,!0),qt(r,L,u,m),E=oa(Y,g),Xt(r,S,L,m),I(),D(),ye()},I=()=>{try{const se={name:"root",children:t.ChartData},te=v.hierarchy(se).sum(xe=>xe.data&&xe.data[0].value).sort((xe,ge)=>(ge.data.data[0].value??0)-(xe.data.data[0].value??0));b=v.treemap().tile(v.treemapSquarify).size([A,W]).padding(1).round(!0)(te).leaves(),U=b[0].data.properties.color}catch(se){me(Ka,"initChartData",se)}},D=()=>{try{if(m.colorScale.showColor===Ta.colorTheme){let te=b[0].data.data.length>1?1:0,xe=m.colorScale.startColor,ge=m.colorScale.endColor,pe=new Set(b.map(M=>M.data.data[te].value)),he=Array.from(pe).sort((M,h)=>M-h),O=he.length,X;if(O===1)X=()=>xe;else{const M=v.interpolateLab(xe,ge);X=v.scaleOrdinal().domain(he.map(String)).range(he.map((h,k)=>M(k/(O-1))))}b=b.map(M=>{let h=M.data.data[te].value;return{...M,data:{...M.data,properties:{...M.data.properties,themeColor:X(h.toString())}}}}),w(xe,ge,O,he)}}catch(se){me(Ka,"prepareTreeColors",se)}},w=(se,te,xe,ge)=>{try{let pe=v.scalePow().exponent(1).domain([0,xe-1]).range([se,te]),O=Y.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/xe}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(M,h)=>pe(h)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const X=Y.append("g").attr("transform",`translate(${L-120},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",m.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",m.yAxisTitle.yAxisTitleFontFamily).text("min");Y.append("g").attr("transform",`translate(${L-10},${u-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",m.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",m.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(pe){me(Ka,"appendColorScale",pe)}},z=se=>{try{switch(m.colorScale.showColor){case Ta.none:return U;case Ta.discrete:return se.properties.color;case Ta.colorTheme:return se.properties.themeColor;default:return}}catch(te){me(Ka,"getColor",te)}},K=se=>{try{const te=se?.currentTarget?.__data__?.data?.properties;if(!te)return;switch(m.colorScale.showColor){case Ta.none:return{...te,markerColor:U};case Ta.colorTheme:return{...te,markerColor:te.themeColor};case Ta.discrete:default:return te}}catch(te){me(Ka,"getMarkerColorForTooltip",te)}},ye=()=>{try{const se=m.animation.animationEnabled,te=E.selectAll("g").data(b).enter().append("g").attr("transform",ge=>`translate(${ge.x0},${ge.y0})`),xe=te.append("rect").attr("fill",ge=>z(ge.data)).attr("fill-opacity",se?0:.7).attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0).on("mousemove",(ge,pe)=>{ut([{key:m.yAxisTitle.yAxisTitleText,value:Ke(m.toolTip.toolTipDisplayUnits,m.toolTip.toolTipNumberFormat,m.toolTip.toolTipDecimalPrecision)(pe.data.data[0].value)},{key:"Legend",value:pe.data.data[0].legend}],m,void 0,K(ge),At(l,String(pe.data.data[0]?.legend??""),K(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",vt(p,c,(ge,pe)=>{const he=String(pe.data.properties?.legendUniqueId??pe.data.legend??""),O=String(pe.data.data[0].legend??"");return{seriesId:he,dimValue:O,legendUniqueId:he,seriesDisplayName:String(pe.data.properties?.alias||pe.data.properties?.name||O)}}));if(se&&xe.transition().duration(m.animation.animationDuration).ease(et[m.animation.animationEffect]).attr("fill-opacity",.7),te.append("clipPath").attr("id",(ge,pe)=>`clip-${pe}-${n}`).append("rect").attr("width",ge=>ge.x1-ge.x0).attr("height",ge=>ge.y1-ge.y0),m.plotArea.dataLabels){const ge=m.annotation.annotationRangeFilter;te.filter(pe=>{if(!ge?.enabled)return!0;const he=pe.data.data[0].value;switch(ge.condition){case"lt":return he<ge.maxVal;case"gt":return he>ge.minVal;case"in":return he>=ge.minVal&&he<=ge.maxVal;case"not-in":return he<ge.minVal||he>ge.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(ce.italic)?ce.italic:"").style("text-decoration",pe=>pe.data.properties.fontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",pe=>pe.data.properties.fontStyle.includes(ce.bold)?ce.bold:"").attr("clip-path",(pe,he)=>`url(#clip-${he}-${n})`),m.plotArea.dataLabelName&&te.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(pe=>pe.data.legend),m.plotArea.dataLabelValue&&te.selectAll("text").append("tspan").attr("x",5).attr("y",m.plotArea.dataLabelName?"2.1em":"1.1em").text(pe=>Ke(m.plotArea.plotAreaDisplayUnits,m.plotArea.dataLabelNumberFormat,m.plotArea.dataLabelDecimalPrecision)(pe.data.data[0].value)),se&&te.selectAll("text").attr("opacity",0).transition().duration(m.animation.animationDuration).ease(et[m.animation.animationEffect]).attr("opacity",1)}}catch(se){me(Ka,"initChartRect",se)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:r,id:n,style:{width:"100%",height:"100%"}})})},ca="PieofPieChart.tsx",wr=({data:t,formatOptions:e,chartId:n,legendProperties:o,tooltipFormatter:x})=>{const l=Ce.useRef();let r,c,p,m=40,L=Jt,u,S,g,W,A,E,b,U,Y,H,I,D,w,z=[0,0],K,ye;Ce.useEffect(()=>{se()},[e]);const se=()=>{({chartFormatOptions:r,svg:W,width:c,height:p}=Kt(l,e)),{plotArea:ye}=r,te(),{margins:L,innerHeight:u,innerWidth:S,legendListWidth:K,chartTitleHeight:m}=Ua(r,c,p,z,L),xe(),qt(l,c,p,r),g=oa(W,L),Xt(l,m,c,r),ge(),pe(),h(),Vi(r,U,m,W,c,p),d()},te=()=>{try{let i=$t(qi(o,"name"),rt(r.legends.legendFontSize),r.legends.legendFontFamily);z=[i.width,i.height]}catch(i){me(ca,"calculateMaxPossibleWidth",i)}},xe=()=>{try{E=Math.min(u*.4,S*.4),b=r.pieofPie.pieOfPieRadius}catch(i){me(ca,"calculatePieRadius",i)}},ge=()=>{try{let i=new Map;o.forEach(a=>{i.set(a.name,a)}),U=0,t.forEach(a=>{a.properties=i.get(a.legend),U+=a.data[0].value,a.children&&a.children.forEach(f=>f.properties=i.get(f.legend))}),A=v.pie().value(a=>a.data[0].value)(t).map((a,f)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:E,depth:2}))}catch(i){me(ca,"initChartData",i)}},pe=()=>{try{const i=v.arc().innerRadius(0).outerRadius(E),y=v.arc().innerRadius(0).outerRadius(E+10),T=g.append("g").attr("class","parentGroup").attr("fill-opacity",r.plotArea.opacity).attr("transform",`${O()}`).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!==Ie.white?a.data.properties.color:"none").on("mouseover.arc",function(a){v.select(this).transition().duration(100).attr("d",y)}).on("mousemove.text",a=>{ut([{key:r.yAxisTitle.yAxisTitleText,value:r.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/U)*100).toFixed(rt(r.toolTip.toolTipDecimalPrecision)??0)+"%":Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],r,void 0,a.currentTarget.__data__.data.properties,At(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,f)=>{try{let N=f;if(N.data.children&&N.data.children.length>1){g.selectAll(".childGroup").remove(),g.selectAll(".childLabels").remove(),g.selectAll("line").remove(),Y=N.data.legend;let ne=90-(f.x0+f.x1)/2/Math.PI*180;he(N.data.children,ne,f)}}catch(N){me(ca,"drawPieChart_onClick",N)}});r.animation.animationEnabled?T.transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attrTween("d",function(a){const f=v.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return N=>i(f(N))}):T.attr("d",a=>i(a))}catch(i){me(ca,"drawPieChart",i)}},he=(i,y,T)=>{try{g.select(".parentGroup").transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`),g.selectAll(".parentLabels").transition().duration(r.animation.animationDuration).ease(et[r.animation.animationEffect]).attr("transform",`${O()} rotate(${y})`);let f=v.pie().value(Z=>Z.data[0].value)(i).map((Z,fe)=>({...Z,x0:Z.startAngle,x1:Z.endAngle,y0:0,y1:b,depth:2}));const N=v.arc().innerRadius(0).outerRadius(b),ne=v.arc().innerRadius(0).outerRadius(b+10);g.append("g").attr("class","childGroup").attr("fill-opacity",r.plotArea.opacity).attr("transform",`${X()}`).selectAll("path").data(f).enter().append("path").attr("class",Z=>"path "+Z.data.legend).attr("hoverId",Z=>Z.data.legend.replace(/ /g,"-")).attr("fill",Z=>Z.data.properties.color!==Ie.white?Z.data.properties.color:"none").attr("d",Z=>N(Z)).on("mouseover.arc",function(Z){v.select(this).transition().duration(100).attr("d",ne)}).on("mousemove.text",Z=>{ut([{key:r.yAxisTitle.yAxisTitleText,value:r.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(Z.currentTarget.__data__.data.data[0].value/U)*100).toFixed(rt(r.toolTip.toolTipDecimalPrecision))+"%":Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(Z.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:Z.currentTarget.__data__.data.legend}],r,void 0,Z.currentTarget.__data__.data.properties,At(x,String(Z.currentTarget.__data__.data.legend??""),Z.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ot()}).on("mouseout.arc",function(Z){v.select(this).transition().duration(100).attr("d",N),ot()}),k(f),s(T,i)}catch(a){me(ca,"drawChildPie",a)}},O=()=>{try{return H=Y?3*S/8:S/2,I=u/2,`translate(${H},${I})`}catch(i){me(ca,"getParentPiePosition",i)}},X=()=>{try{return D=3*S/4,w=u/2,`translate(${D},${w})`}catch(i){me(ca,"getChildPiePosition",i)}},M=(i,y)=>{try{const T=(i.startAngle+i.endAngle)/2,a=Math.cos(T-Math.PI/2)*(y*.65),f=Math.sin(T-Math.PI/2)*(y*.65);let N=T*180/Math.PI-90;return`translate(${a},${f}) rotate(${N})`}catch(T){me(ca,"getDataLabelTransformString",T)}},h=()=>{try{r.plotArea.dataLabels&&(g.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(A,r,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??Ie.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",i=>i.data.properties?.labelFont??tt).attr("transform",i=>M(i,E)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:y}=r;return y.dataLabelName?i.data.legend:""}),g.append("g").attr("class","parentLabels parentGroup").attr("transform",`${O()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(A,r,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??Ie.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??tt).attr("transform",i=>M(i,E)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(r.plotArea.dataLabelValue){const y=i.data.data[0].value;return r.plotArea.dataLabelName&&r.plotArea.dataLabelValue&&y!==void 0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(y/U)*100).toFixed(rt(r.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(y):y}}))}catch(i){me(ca,"drawParentPieDataLabels",i)}},k=i=>{try{r.plotArea.dataLabels&&(g.append("g").attr("class","childLabels parentGroup").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(i,r,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??Ie.black).attr("font-style",y=>y.data.properties?.labelFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.labelFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.labelFontStyle?.includes(ce.bold)?ce.bold:"").attr("font-family",y=>y.data.properties?.labelFont??tt).attr("transform",y=>M(y,b)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(y=>{const{plotArea:T}=r;return T.dataLabelName?y.data.legend:""}),g.append("g").attr("class","childLabels parentGroup").attr("transform",`${X()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ut(i,r,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??Ie.black).attr("font-style",y=>y.data.properties?.valueFontStyle?.includes(ce.italic)?ce.italic:"").attr("text-decoration",y=>y.data.properties?.valueFontStyle?.includes(ce.underline)?ce.underline:"").attr("font-weight",y=>y.data.properties?.valueFontStyle?.includes(ce.bold)?ce.bold:"300").attr("font-family",y=>y.data.properties?.valueFont??tt).attr("transform",y=>M(y,b)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(y=>{if(r.plotArea.dataLabelValue){const T=y.data.data[0].value;return r.plotArea.dataLabelName&&r.plotArea.dataLabelValue&&T!==void 0?r.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(T/U)*100).toFixed(rt(r.plotArea.dataLabelDecimalPrecision)??0)+"%":Ke(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(T):T}}))}catch(y){me(ca,"drawChildPieDataLabels",y)}},s=(i,y)=>{try{let T=Math.abs(i.x0-i.x1)/2,f=i.y1*Math.sin(T),N=f/Math.tan(T);g.append("line").style("stroke",r.pieofPie.pieOfPieLineColor).style("stroke-width",r.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",H+N).attr("y1",I-f).attr("x2",D).attr("y2",w-b),g.append("line").style("stroke",r.pieofPie.pieOfPieLineColor).style("stroke-width",r.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",H+N).attr("y1",I+f).attr("x2",D).attr("y2",w+b)}catch(T){me(ca,"drawLines",T)}},d=()=>{try{let i=o.map(y=>({legend:y.name,properties:y,data:[]}))}catch(i){me(ca,"initLegendList",i)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:n,style:{width:"100%",height:"100%"}})})},pa="PyramidChart.tsx",Dr=({data:t,formatOptions:e,chartId:n,onDataLabelCoordinatesChange:o,addLocalFilterFromLib:x,tooltipFormatter:l})=>{const r=Ce.useRef();let c=mt(t.ChartData),p,m,L,u,S=40,g=Jt,W=[0,0],A,E,b,U,Y=[0],H,I,D,w;Ce.useEffect(()=>{z()},[e]);const z=()=>{({chartFormatOptions:p,svg:m,width:L,height:u}=Kt(r,e)),W=Ha(p,c),{margins:g,innerHeight:A,innerWidth:E,legendListWidth:D,chartTitleHeight:S}=Ua(p,L,u,W,g),K(),qt(r,L,u,p),H=ye(),Xt(r,S,L,p),Wa(p,m,c,L,u,D,S,n,g,ct.rectangle,!1,x),se(),te(),ge(),xe()},K=()=>{try{b=Math.min(A,E),U=.866*b}catch(he){me(pa,"initPyramidSideCalculations",he)}},ye=()=>{try{return m.append("g").attr("transform",`translate(${g.left},${g.top+(A-U)/2})`)}catch(he){return me(pa,"initChartArea",he),null}},se=()=>{try{c=c.sort((he,O)=>{const X=he.data[0].value,M=O.data[0].value;return p.plotArea.flipPyramid?M-X:X-M}),I=v.sum(c,he=>Math.abs(he.data[0].value)),Y=[0],c.forEach((he,O)=>{const X=Math.abs(he.data[0].value)/I*U;Y.push(Y[O]+X)})}catch(he){me(pa,"initPyramidData",he)}},te=()=>{try{c.forEach((he,O)=>{try{const X=Y[O],M=Y[O+1];let h=p.plotArea.flipPyramid?1:0;const k=b*(h-Y[O]/U),s=b*(h-Y[O+1]/U),d=E/2,i=H.append("g").attr("id","PyramidChart").attr("class","parentGroup"),y=p.animation.animationEnabled,T=i.append("polygon").attr("class","segment").attr("hoverId",he.legend.replace(/\s+/g,"-")).attr("data-series-id",he.legendUniqueId??he.legend).attr("data-dim-value",he.legend).attr("points",`
145
- ${d-k/2},${X}
146
- ${d+k/2},${X}
147
- ${d+s/2},${M}
148
- ${d-s/2},${M}
149
- `).attr("fill",he.properties.color||"#4cb2ff").attr("opacity",y?0:1).on("mousemove",function(){try{ut([{key:he.legend,value:p.toolTip.toolTipNumberFormat==",.0%"?he.data[0].value?(Math.abs(he.data[0].value/I)*100).toFixed(rt(p.toolTip.toolTipDecimalPrecision))+"%":"":Ke(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(he.data[0].value)}],p,void 0,he.properties,At(l,String(he.legend??""),he.properties)),v.select(this).style("opacity",.8).style("stroke",p.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){me(pa,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{ot(),v.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){me(pa,"drawPyramidChart.onMouseOut",a)}});y&&T.transition().duration(p.animation.animationDuration).ease(et[p.animation.animationEffect]).attr("opacity",1)}catch(X){me(pa,"drawPyramidChart.forEach",X)}})}catch(he){me(pa,"drawPyramidChart",he)}},xe=he=>{try{if(p.annotation.annotationVisibility){let O=pt.annotation(),X=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None",M=Ut(w,p,s=>s.data.measure);const h=p.annotation.connectorStyle?.toLowerCase();O.editMode(p.annotation.annotationDraggable).accessors({x:function(){return E*.5},y:function(s,d){return s.y}}).on("dragend",function(s){try{M.forEach(d=>{d.data.legend===s.data.legend&&(d.dx=s._dx,d.dy=s._dy,d.width=L,d.height=u)}),o&&o(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",Yt[h]),k.selectAll(`.connector-${X}`).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",Yt[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){me(pa,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(M);let k=H.append("g").attr("class","annotation-group parentGroup").call(O);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",Yt[h]),k.selectAll(`.connector-${X}`).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",Yt[h]).filter(s=>s._dx==0&&s._dy==0).remove(),k.selectAll(".connector-end").filter(s=>s.connector.end=="dot"&&s._dx==0&&s._dy==0).remove(),k.selectAll(".annotation-note-label").filter(s=>s.data&&!s.data.isVisible).style("display","none"),k.selectAll(".annotation-note-title").filter(s=>s.data&&!s.data.isVisible).style("display","none"),p.annotation.annotationType==jt.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",s=>s.data.legend.replace(/\s+/g,"-")).style("font-size",s=>s.data.labelFontSize).attr("font-family",s=>s.data.labelFontFamily).style("font-style",s=>s.data.labelFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",s=>s.data.labelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",s=>s.data.labelFontStyle.includes(ce.bold)?ce.bold:"300").style("fill",s=>s.data.labelFontColor),p.plotArea.dataLabelValue&&k.selectAll(".annotation-note-label").attr("hoverId",s=>s.data.legend.replace(/\s+/g,"-")).style("font-size",s=>s.data.valueFontSize).attr("font-family",s=>s.data.valueFontFamily).style("font-style",s=>s.data.valueFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",s=>s.data.valueFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",s=>s.data.valueFontStyle.includes(ce.bold)?ce.bold:"300").style("fill",s=>s.data.valueFontColor)}}catch(O){me(pa,"pyramidAnnotations",O)}},ge=()=>{try{let he=p.annotation.annotationType??"1",O=[he=="1"?"connector":""],X=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]));w=[],c.forEach((k,s)=>{try{const d=p.annotation.annotationVisibility,i=c.length-1;if(d===jt.none||d===jt.startOnly&&s!==0||d===jt.endOnly&&s!==i||d===jt.startAndEndBoth&&s!==0&&s!==i)return;let y={note:{title:p.plotArea.dataLabelName?k.properties.alias:"",label:p.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(k.data[0].value/I)*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":Ke(p.annotation.annotationDisplayUnits,p.plotArea.dataLabelNumberFormat,p.plotArea.dataLabelDecimalPrecision)(k.data[0].value):"",align:"middle"},data:{x:E/2,y:pe(k,s,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:X,curve:wl[p.annotation.connectorCurve]},disable:O,subject:{height:15,width:15},type:Dl[he],color:p.plotArea.dataLabelNameColor!=Ie.black?p.plotArea.dataLabelNameColor:Ie.black,height:L,width:L,index:s};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),w.push(y)}catch(d){me(pa,"prepareNewAnnotationsList.forEach",d)}})}catch(he){me(pa,"prepareNewAnnotationsList",he)}},pe=(he,O,X)=>{try{switch(X){case hi.top:return Y[O]+30;case hi.middle:return(Y[O]+Y[O+1])/2+15;case hi.bottom:return Y[O+1];default:return Y[O]+30}}catch(M){return me(pa,"getYCordinate",M),0}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:r,id:n,style:{width:"100%",height:"100%"}})})},Sa="ProgressChart.tsx",Vr=({data:{ChartData:t},formatOptions:e,chartId:n,addLocalFilterFromLib:o,tooltipFormatter:x})=>{const l=Ce.useRef();let r=mt(t),c,p,m,L=40,u=Jt,S=[0,0],g,W,A,E,b,U,Y,H;const I=1,D=0;Ce.useEffect(()=>{w()},[e]);const w=()=>{({chartFormatOptions:c,svg:b,width:p,height:m}=Kt(l,e)),S=Ha(c,r),{margins:u,innerHeight:g,innerWidth:W,legendListWidth:U,chartTitleHeight:L}=Ua(c,p,m,S,u),z(),qt(l,p,m,c),E=oa(b,u),Xt(l,L,p,c),Wa(c,b,r,p,m,U,L,n,u,ct.hollowCircle,!0,o),K(),ye(),Vi(c,A,L,b,p,m)},z=()=>{try{Y=Math.min(g*.45,W*.45),H=Math.min(rt(c.plotArea.innerRadius)/100*Y,Y)}catch(te){me(Sa,"setRadiusAndInnerRadius",te)}},K=()=>{try{A=t[I].data[0].value+t[D].data[0].value}catch(te){me(Sa,"initProgressChartData",te)}},ye=()=>{try{let te=t[I].data[0].value,xe=t[D].data[0].value,ge=Math.PI*2,pe=xe/te*Math.PI*2,he=c.plotArea.dataLabelValueFontStyle;const O=v.arc().innerRadius(H).outerRadius(Y).startAngle(0).cornerRadius(rt(c.plotArea.cornerRadius));E.append("path").attr("class","secondary-circle").attr("fill",t[I].properties.color).attr("fill-opacity",c.plotArea.opacityforProgressScale).attr("hoverId",M=>(t[I]?.properties?.alias||t[I]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[I].properties.legendUniqueId??t[I].properties.alias??"*").attr("data-dim-value",t[I].properties.alias??"*").attr("d",O({endAngle:ge})).on("mousemove",M=>{try{ut([{key:t[I].properties.alias,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(te)}],c,void 0,t[I].properties,At(x,String(t[I].properties?.alias??""),t[I].properties))}catch(h){me(Sa,"drawProgressChart.onMouseMove.secondary-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){me(Sa,"drawProgressChart.onMouseOut.secondary-circle",M)}}).attr("transform",se()),E.append("path").attr("class","progress-circle").attr("fill",t[D].properties.color).attr("fill-opacity",c.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",O({endAngle:pe})).on("mousemove",M=>{try{ut([{key:t[D].properties.alias,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(xe/te*100)+"%":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(te)},{key:t[I].properties.alias,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(xe)}],c,void 0,t[D].properties,At(x,String(t[D].properties?.alias??""),t[D].properties))}catch(h){me(Sa,"drawProgressChart.onMouseMove.progress-circle",h)}}).on("mouseout",()=>{try{ot()}catch(M){me(Sa,"drawProgressChart.onMouseOut.progress-circle",M)}}).attr("transform","translate("+W/2+","+g/2+")").transition().duration(c.animation.animationEnabled?c.animation.animationDuration:0).ease(et[c.animation.animationEffect]).attrTween("d",function(M){try{const h=v.interpolate(0,pe);return function(k){try{return O({endAngle:h(k)})}catch(s){return me(Sa,"drawProgressChart.attrTween.inner",s),""}}}catch(h){return me(Sa,"drawProgressChart.attrTween",h),()=>""}});const X=E.append("text").attr("transform",se()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>c.plotArea.dataLabels&&Oi([{value:xe}],c,h=>h?.value??0).length>0?"visible":"hidden").attr("fill",c.plotArea.dataLabelValueColor!==Ie.white?c.plotArea.dataLabelValueColor:c.toolTip.toolTipDisplayUnits).attr("font-style",he.includes(ce.italic)?ce.italic:"").attr("text-decoration",he.includes(ce.underline)?ce.underline:"").attr("font-weight",he.includes(ce.bold)?ce.bold:"").attr("font-family",c.plotArea.dataLabelValueFontFamily).attr("font-size",c.plotArea.dataLabelValueFontSize).text(()=>c.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(xe/te*100)+"%":Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.dataLabelNumberFormatProgress,c.plotArea.dataLabelDecimalPrecision)(xe));c.animation.animationEnabled&&X.attr("opacity",0).transition().duration(c.animation.animationDuration).ease(et[c.animation.animationEffect]).attr("opacity",1)}catch(te){me(Sa,"drawProgressChart",te)}},se=()=>{try{return"translate("+W/2+","+g/2+")"}catch(te){return me(Sa,"getTransformString",te),""}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:n,style:{width:"100%",height:"100%"}})})},Nr=({data:{ChartData:t},formatOptions:e,chartId:n})=>{const o=Ce.useRef(),x=mt(t);let l,r,c,p=40,m=Jt,L,u,S,g,W,A,E,b,U,Y,H,I={},D;const w="Speedometer.tsx";Ce.useEffect(()=>{z()},[e]);const z=()=>{({chartFormatOptions:l,svg:g,width:r,height:c}=Kt(o,e)),{margins:m,chartTitleHeight:p,innerHeight:L,innerWidth:u}=ri(l,c,r),K(),qt(o,r,c,l),S=oa(g,m),Xt(o,p,r,l),se(),te(),ge(),he()},K=()=>{try{let h;L*.8<u*.45?(W=L*.8,h="width"):(W=u*.45,h="height"),D=ye(h),A=rt(l.plotArea.innerRadiusForSpeedometer)/100*W}catch(h){me(w,"initChartRadius",h)}};function ye(h){try{return h=="height"?`translate(${u/2},${L/2+W/2})`:`translate(${u/2},${c-60})`}catch(k){return me(w,"centerTranslation",k),""}}const se=()=>{try{let h=t[0].data[0].value;h<0?(E=0,b=h):(E=h,b=0),l.customScaling.customScalingtoggle?Y=100:Y=rt(l.plotArea.ticks)}catch(h){me(w,"initSpeedometerData",h)}},te=()=>{try{U=[];let h=rt(l.plotArea.ticks);if(l.customScaling.customScalingtoggle){for(let k=1;k<=h;k++){let s=l.customScaling[`share${k}`];if(U.length<100)for(let d=0;d<s;d++)U.push(l.customScaling[`division${k}`])}if(U.length<101)for(let k=U.length;k<100;k++)U.push(Ie.black)}else if(l.colorScale.showColor==Ta.none){const k=t[0].properties?.color??"#bac8de";for(let s=1;s<=h;s++)U.push(k)}else if(l.colorScale.showColor==Ta.discrete)for(let k=1;k<=h;k++)U.push(l.colorScale["division"+k]);else{let k=l.colorScale.startColor,s=l.colorScale.endColor;const d=v.scaleLinear().domain([0,h]).range([k,s]);for(let i=0;i<h;i++)U.push(d(i))}}catch(h){me(w,"initColorTheme",h)}},xe=(h,k,s)=>{try{let d=[],i=Math.abs(h)-Math.abs(k),y=Math.abs(i)/s,T=k>0?0:k;d.push(T);for(let a=0;a<s-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 me(w,"setTickValues",d),[]}},ge=()=>{try{switch(l.plotArea.dataLabelsOptions){case jt.automatic:H=pe();break;case jt.startOnly:H=[b];break;case jt.endOnly:let k=Array(Y).fill("");k[Y]=E,H=k;break;case jt.startAndEndBoth:let s=Array(Y).fill("");s[Y]=E,s[0]=b,H=s;break;case jt.none:H=[];break}}catch(h){me(w,"setDataLabelsOptions",h)}},pe=()=>{try{let h,k=rt(l.plotArea.ticks),s=xe(E,b,Y);if(l.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=b;let i=0;for(let y=1;y<=k;y++){let T=parseInt(l.customScaling[`share${y}`]);if(i+=T,i>=100)break;d[i]=s[i]}d[99]=E,h=d}else h=s;return h}catch(h){return me(w,"initTicksValues",h),[]}},he=()=>{try{let k=function(s,d){try{let i=function(Ue){try{return Ue*Math.PI/180}catch(ve){return me(w,"deg2rad",ve),0}},y=function(Ue){try{let ve;for(ve in Ue)Le[ve]=Ue[ve];f=Le.maxAngle-Le.minAngle,ne=Math.round(W*Le.pointerHeadLengthPercent),Re=v.scaleLinear().range([0,1]).domain([Le.minValue,Le.maxValue]),fe=v.arc().innerRadius(A).outerRadius(W).startAngle((Pe,Ye)=>{let We=1/Le.majorTicks*Ye;return i(Le.minAngle+We*f)}).endAngle((Pe,Ye)=>{let We=1/Le.majorTicks*(Ye+1);return i(Le.minAngle+We*f)})}catch(ve){me(w,"configure",ve)}},T=function(Ue,ve){try{if(ve===0){S.append("g").attr("class","arc").attr("transform",D).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(U).enter().append("path").attr("fill",Se=>Se).attr("stroke",Se=>Se).attr("d",fe);let ze=E,ke=S.append("g").attr("class","label").attr("transform",D);if(ke.selectAll("text").data(H).enter().append("text").attr("transform",function(Se,oe){let $=f/Le.majorTicks*oe;return"rotate("+(Le.minAngle+$)+") translate(0,"+(Le.labelInset-W)+")"}).attr("text-anchor","middle").attr("font-size",l.plotArea.dataLabelValueFontSize).attr("fill",l.plotArea.dataLabelValueColor!==Ie.white?l.plotArea.dataLabelValueColor:"none").attr("font-style",l.plotArea.dataLabelValueFontStyle.includes(ce.italic)?ce.italic:"").attr("text-decoration",l.plotArea.dataLabelValueFontStyle.includes(ce.underline)?ce.underline:"").attr("font-weight",l.plotArea.dataLabelValueFontStyle.includes(ce.bold)?ce.bold:"").attr("font-family",l.plotArea.dataLabelValueFontFamily).text(Se=>l.plotArea.dataLabelNumberFormat==",.0%"?Z=Math.round(Se/ze*100)+"%":Ke(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(Se)).attr("visibility",Se=>Se===""?"hidden":"visible"),l.animation.animationEnabled){const Se=l.animation.animationDuration,oe=et[l.animation.animationEffect];ke.selectAll("text").attr("opacity",0).attr("transform",function($,R){const ae=f/Le.majorTicks*R;return`rotate(${Le.minAngle+ae}) translate(0, ${Le.labelInset-W+20})`}).transition().duration(Se).ease(oe).attr("opacity",1).attr("transform",function($,R){const ae=f/Le.majorTicks*R;return`rotate(${Le.minAngle+ae}) translate(0, ${Le.labelInset-W})`})}}l.pointerValue.showPointerValue&&x.length===2&&X(D);let Pe=[[Le.pointerWidth/2,0],[0,-ne],[-(Le.pointerWidth/2),0],[0,Le.pointerTailLength],[Le.pointerWidth/2,0]],Ye=v.line().curve(v.curveLinear);J=S.append("g").data([Pe]).attr("class","pointer").attr("transform",D).append("path").attr("d",ve>0?Ye:null).attr("transform","rotate("+Le.minAngle+")").attr("fill",l.plotArea.pointerColor).on("mousemove",(be,ze)=>{ut([{key:`${t[ve].data[0].legend}`,value:l.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[ve].data[0].value/Te[Te.length-1]*100)+"%":Ke(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(t[ve].data[0].value)}],l,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{ot()}),J.selectAll("text").append("text").text(Le.maxValue),a(Ue===void 0?0:Ue)}catch(Pe){me(w,"gauge.render",Pe)}},a=function(Ue,ve){try{ve!==void 0&&y(ve);let Pe=Re(Ue),Ye=Le.minAngle+Pe*f;J.transition().duration(l.animation.animationEnabled?l.animation.animationDuration:0).ease(et[l.animation.animationEffect]).attr("transform","rotate("+Ye+")")}catch(Pe){me(w,"gauge.update",Pe)}},f,N,ne,Z,fe,Re,Te,Me,J,Ee,Le={clipWidth:u,clipHeight:L,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:rt(l.plotArea.pointerHeadLength)/10,minValue:b,maxValue:E,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:Y,labelFormat:Ue=>Ke(l.plotArea.plotAreaDisplayUnits,l.plotArea.dataLabelNumberFormat,l.plotArea.dataLabelDecimalPrecision)(Ue),labelInset:-5};return I.configure=y,I.render=T,I.update=a,y(d),I}catch(i){me(w,"gauge",i)}}("#power-gauge",{clipWidth:u,clipHeight:L,ringWidth:2.75*rt(l.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:E,transitionMs:0});if(x.length>0)for(let s=0;s<x.length;s++)k.render(O(x[s],s),s)}catch(h){me(w,"initSpeedometer",h)}};function O(h,k){try{let s=E,d=h.data[0].value;return s<0&&d>0||s>0&&d<0?0:s<0&&d<0&&s>d?s:s<0&&d<0&&s<d||s>d?d:s}catch(s){return me(w,"setPointerofSpeedometer",s),0}}function X(h){try{let k="";if(l.pointerValue.kpiAlias)k=l.pointerValue.kpiAliasText;else switch(l.pointerValue.connectorKPIforSpeedometer){case ti.PointerValue:k="Pointer Value";break;case ti.Absolute:k="Absolute Value";break;case ti.CAGR:k="CAGR";break;case ti.PercentageGrowth:k="Percentage Growth";break}let s=l.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",l.pointerValue.pointerValueFontSize).attr("fill",l.pointerValue.pointerValueColor!==Ie.white?l.pointerValue.pointerValueColor:"none").attr("font-style",s.includes(ce.italic)?ce.italic:"").attr("text-decoration",s.includes(ce.underline)?ce.underline:"").attr("font-weight",s.includes(ce.bold)?ce.bold:"").attr("font-family",l.pointerValue.pointerValueFontFamily).text(i=>`${k}: ${!l.pointerValue.pointerValueAlias&&i!=0?M(t[0].data[0].value,t[1].data[0].value):l.pointerValue.pointerValueAliasText}`).attr("visibility",l.plotArea.dataLabels?"visible":"hidden")}catch(k){me(w,"setPointerValueText",k)}}function M(h,k){try{let s=h-k,d=1,i=parseInt(l.pointerValue.connectorKPIforSpeedometer),y,T;const a=l.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:s=k;break;case 2:s=Math.abs(s);break;case 3:return y=`.${a}%`,s=Math.pow(k/h,1/d)-1,T=v.format(y)(s),T;case 4:return y=`.${a}%`,s=Math.round(k/h*100-100)/100,T=v.format(y)(s),T}return isNaN(s)&&(s=0),Ke(l.pointerValue.pointerValueDisplayUnits,l.pointerValue.pointerValueNumberFormat,a)(s)}catch(s){return me(w,"connectorNumberFormat",s),""}}return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:o,id:n,style:{width:"100%",height:"100%"}})})};function Pa(t,e,n){console.error(`[${t}][${e}]`,n)}const Pr=({data:{ChartData:t},formatOptions:e,chartId:n,addLocalFilterFromLib:o,tooltipFormatter:x})=>{const l=Ce.useRef(),r=mt(t);let c,p,m,L=40,u=Jt,S=[0,0],g,W,A,E,b,U;Ce.useEffect(()=>{Y()},[e]);const Y=()=>{({chartFormatOptions:c,svg:E,width:p,height:m}=Kt(l,e)),H(),{margins:u,innerHeight:g,innerWidth:W,legendListWidth:U,chartTitleHeight:L}=Ua(c,p,m,S,u),S=Ha(c,r),qt(l,p,m,c),A=oa(E,u),Xt(l,L,p,c),Wa(c,E,r,p,m,U,L,n,u,ct.hollowCircle,!1,o),D()},H=()=>{try{b=0,r.forEach(z=>{b+=z.data[0].value})}catch(z){Pa("RadialBarChart.tsx","loopOverChartData",z)}},I=z=>{try{switch(c.plotArea.dataLabelsOptions){case jt.automatic:return z.map((ye,se)=>({...ye,index:se}));case jt.startOnly:return[{...z[0],index:0}];case jt.endOnly:return[{...z[z.length-1],index:z.length-1}];case jt.startAndEndBoth:return[{...z[0],index:0},{...z[z.length-1],index:z.length-1}];case jt.none:return[]}}catch(K){return Pa("RadialBarChart.tsx","getModifiedDataForLabels",K),z}},D=()=>{try{let z=function(Me,J){try{const Ee=v.interpolate(0,d(Math.abs(Me.data[0].value)));return Le=>ne({...Me,endAngle:Ee(Le)},J)}catch(Ee){Pa("RadialBarChart.tsx","arcTween",Ee)}},K=function(Me){try{return Me*180/M}catch(J){Pa("RadialBarChart.tsx","radTodeg",J)}},ye=function(Me){try{return Me*Math.PI/180}catch(J){Pa("RadialBarChart.tsx","degToRad",J)}},se=function(Me){try{return h+(f-(Me+1))*(N+k)}catch(J){Pa("RadialBarChart.tsx","getInnerRadius",J)}},te=function(Me){try{return se(Me)+N}catch(J){Pa("RadialBarChart.tsx","getOuterRadius",J)}},xe=r.length>1?v.max(r,Me=>Me.data[0].value)*1.1:t[0].data[0].value*1.1,ge=c.plotArea.dataLabelValueFontStyle,pe=Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.axialAxisDataLabelNumberFormat,c.plotArea.axialAxisDataLabelDecimalPrecision)(xe),he=c.plotArea.axialAxis?$t(pe,rt(c.plotArea.axialAxisDataLabelFontSize),c.plotArea.axialAxisDataLabelFontFamily).width+10:20;const O=Math.min(g*.5,W*.5)-he;let X=A.append("g").attr("transform",w()).attr("width",W).attr("height",g);const M=Math.PI,h=r.length>1?10:70,k=rt(c.plotArea.arcPadding),s=rt(c.plotArea.axialTicks);let d=v.scaleLinear().domain([0,xe]).range([0,ye(360)]),i=d.ticks(s);i[i.length-1]==xe&&i.pop();let y=i,T=r.map((Me,J)=>Me.data[0].legend),a=r.reduce((Me,J)=>Me+J.data[0].value,0);const f=T.length,N=(O-h-f*k)/f;let ne=v.arc().innerRadius((Me,J)=>se(J)).outerRadius((Me,J)=>te(J)).startAngle(0).endAngle(Me=>Me.endAngle),Z=v.arc().innerRadius((Me,J)=>se(J)).outerRadius((Me,J)=>te(J)).startAngle(0).endAngle(ye(360)),fe=X.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");c.plotArea.axialGrid&&fe.append("circle").attr("r",(Me,J)=>te(J)+k).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let Re=X.append("g").attr("class","a axis").selectAll("g").data(y).enter().append("g").attr("transform",Me=>"rotate("+(K(d(Me))-90)+")");c.plotArea.axialGrid&&Re.append("line").attr("x2",O).attr("stroke","#a9a9a9").attr("stroke-width",1),Re.append("text").attr("x",O+10).attr("class","text-xs text-gray-600").style("text-anchor",Me=>d(Me)>=M&&d(Me)<2*M?"end":null).attr("transform",Me=>"rotate("+(90-K(d(Me)))+","+(O+10)+",0)").text(Me=>Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.axialAxisDataLabelNumberFormat,c.plotArea.axialAxisDataLabelDecimalPrecision)(Me)).attr("fill",c.plotArea.axialAxisDataLabelColor!==Ie.white?c.plotArea.axialAxisDataLabelColor:"none").style("font-size",c.plotArea.axialAxisDataLabelFontSize).style("font-family",c.plotArea.axialAxisDataLabelFontFamily).attr("font-style",c.plotArea.axialAxisDataLabelFontStyle.includes(ce.italic)?ce.italic:"").attr("text-decoration",c.plotArea.axialAxisDataLabelFontStyle.includes(ce.underline)?ce.underline:"").attr("font-weight",c.plotArea.axialAxisDataLabelFontStyle.includes(ce.bold)?ce.bold:"").attr("visibility",c.plotArea.axialAxis?"visible":"hidden");let Te=X.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Me=>Me.data[0].legend.replaceAll(" ","-")).attr("data-series-id",Me=>Me.properties.legendUniqueId??Me.data[0].legend).attr("data-dim-value",Me=>Me.data[0].legend).attr("fill",Me=>Me.properties.color).attr("d",(Me,J)=>ne({...Me,endAngle:0},J)).on("mousemove",(Me,J)=>{ut([{key:c.yAxisTitle.yAxisTitleText,value:c.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(J.data[0].value/a)*100).toFixed(rt(c.toolTip.toolTipDecimalPrecision))+"%":Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormatProgress,c.toolTip.toolTipDecimalPrecision)(J.data[0].value)},{key:"Legend",value:J.properties.alias}],c,void 0,J.properties,At(x,String(J.data[0]?.legend??""),J.properties))}).on("mouseout",()=>{ot()});if(c.animation.animationEnabled?Te.transition().duration(c.animation.animationDuration).ease(et[c.animation.animationEffect]).attrTween("d",z):Te.attr("d",(Me,J)=>ne({...Me,endAngle:d(Math.abs(Me.data[0].value))},J)),c.plotArea.dataLabels){const Me=Oi(I(t),c,Ee=>Ee?.data?.[0]?.value??0),J=X.selectAll(".arc-label-"+n).data(Me).enter().append("text").attr("class","arc-label-"+n).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(Ee,Le)=>(te(Ee.index??Le)-se(Ee.index??Le))/1.75);J.append("textPath").attr("xlink:href",(Ee,Le)=>`#arc-path-${Ee.index??Le}-`+n).style("startOffset","50%").attr("hoverId",Ee=>Ee.legend.replaceAll(" ","-")).text(Ee=>`  ${Ee.properties.alias}
150
-  ${c.plotArea.dataLabelValue?Ke(c.plotArea.plotAreaDisplayUnits,c.plotArea.dataLabelNumberFormat,c.plotArea.dataLabelDecimalPrecision)(Ee.data[0].value):""}`).attr("fill",c.plotArea.dataLabelValueColor!==Ie.white?c.plotArea.dataLabelValueColor:"none").style("font-size",c.plotArea.dataLabelValueFontSize).style("font-family",c.plotArea.dataLabelValueFontFamily).attr("font-style",ge.includes(ce.italic)?ce.italic:"").attr("text-decoration",ge.includes(ce.underline)?ce.underline:"").attr("font-weight",ge.includes(ce.bold)?ce.bold:"").on("mousemove",(Ee,Le)=>{ut([{key:c.yAxisTitle.yAxisTitleText,value:Ke(c.toolTip.toolTipDisplayUnits,c.toolTip.toolTipNumberFormat,c.toolTip.toolTipDecimalPrecision)(Le.data[0].value)},{key:"Legend",value:Le.properties.alias}],c,Ee,Le.properties,At(x,String(Le.data[0]?.legend??""),Le.properties))}).on("mouseout",()=>{ot()}),c.animation.animationEnabled&&J.attr("opacity",0).transition().duration(c.animation.animationDuration).ease(et[c.animation.animationEffect]).attr("opacity",1),Te.each((Ee,Le)=>{X.append("path").attr("id",`arc-path-${Le}-`+n).attr("d",Z(Ee,Le)).attr("fill","none").attr("stroke","none")})}}catch(z){Pa("RadialBarChart.tsx","initRadialBarChart",z)}},w=()=>{try{return`translate(${W/2},${g/2})`}catch(z){Pa("RadialBarChart.tsx","getPiePosition",z)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:l,id:n,style:{width:"100%",height:"100%"}})})},ba="WordCloud.tsx",Ir=({data:{ChartData:t},formatOptions:e,chartId:n,tooltipFormatter:o})=>{const x=Ce.useRef();let l=mt(t),r,c,p,m=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=Jt,g,W,A,E,b,U=0;Ce.useEffect(()=>{Y()},[e]);const Y=()=>{({chartFormatOptions:r,svg:E,width:c,height:p}=Kt(x,e)),{margins:S,chartTitleHeight:u,innerHeight:g,innerWidth:W}=ri(r,p,c),qt(x,c,p,r),A=oa(E,S),Xt(x,u,c,r),H(),I()},H=()=>{try{U=0,l=l.map(D=>{let w=D.data[0].value;return U+=w,r.plotArea.hideZeroValues&&w==0?null:(w<m&&(m=w),w>L&&(L=w),D)}),l=l.filter(D=>D!==null),b=v.scaleLinear().domain([m,L]).range([12,70])}catch(D){me(ba,"calculateWordCloudData",D)}},I=()=>{try{let D=function(ye){try{A.append("g").attr("transform","translate("+K.size()[0]/2+","+K.size()[1]/2+")").selectAll("text").data(ye).enter().append("text").attr("font-size",function(se){try{return b(se.data[0].value)+"px"}catch(te){return me(ba,"draw-font-size",te),"12px"}}).attr("text-anchor","middle").style("font-family",r.text.textFontFamily).attr("fill",function(se){try{return se.properties.color!==Ie.white?se.properties.color:"none"}catch(te){return me(ba,"draw-fill",te),"none"}}).attr("transform",function(se){try{return"translate("+[se.x,se.y]+")rotate("+se.rotate+")"}catch(te){return me(ba,"draw-transform",te),""}}).text(function(se){try{return se.properties.alias}catch(te){return me(ba,"draw-text",te),""}}).attr("data-series-id",se=>se.properties.legendUniqueId??se.properties.alias).attr("data-dim-value",se=>se.properties.alias).on("mousemove.text",(se,te)=>{try{ut([{key:te.properties.alias,value:Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(te.data[0].value)},{key:te.properties.measureUniqueId,value:U}],r,void 0,te.properties,At(o,String(te.properties.alias??""),te.properties))}catch(xe){me(ba,"draw-mousemove",xe)}}).on("mouseout.text",()=>{try{ot()}catch(se){me(ba,"draw-mouseout",se)}})}catch(se){me(ba,"draw",se)}},w=r.text.textSpacing,z=r.text.textRotation,K=ml().size([W,g]).words(l).padding(w).rotate(function(){try{return Math.round(Math.random())*z}catch(ye){return me(ba,"rotate",ye),0}}).random(()=>.5).font(r.text.textFontFamily).fontWeight("bolder").fontSize(function(ye){try{return b(ye.data[0].value)}catch(se){return me(ba,"fontSize",se),12}}).text(function(ye){try{return ye.properties.alias}catch(se){return me(ba,"text",se),""}}).on("end",D);K.start()}catch(D){me(ba,"drawWordCloudChart",D)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:x,id:n,style:{width:"100%",height:"100%"}})})},Er=({data:t,formatOptions:e,chartId:n})=>{const o=Ce.useRef();let x=mt(t),l,r,c,p=40,m=Jt,L,u,S,g=[0,0],W,A;Ce.useEffect(()=>{E()},[e]);const E=()=>{({chartFormatOptions:l,svg:A,width:r,height:c}=Kt(o,e)),g=U(),{margins:m,innerHeight:L,innerWidth:u,legendListWidth:S,chartTitleHeight:p}=Ua(l,r,c,g,m,!0),qt(o,r,c,l),W=oa(A,m),Xt(o,p,r,l),b(),Y()},b=()=>{try{let H=l.plotArea.dataLabelNameFontStyle,I=l.plotArea.dataLabelValueFontStyle,D=W.attr("class","vennContainer");D&&D.datum(t).call(Cl.VennDiagram().width(u).height(L)),D&&D.selectAll(".venn-circle path").style("fill-opacity",l.plotArea.opacity),l.plotArea.dataLabelName?(D&&D.selectAll(".venn-circle text").html(""),D&&D.selectAll(".venn-circle text").append("tspan").style("font-family",l.plotArea.dataLabelNameFontFamily).style("fill",l.plotArea.dataLabelNameColor).style("font-size",l.plotArea.dataLabelNameFontSize+"px").style("font-style",H.includes(ce.italic)?ce.italic:"").attr("text-decoration",H.includes(ce.underline)?ce.underline:"").style("font-weight",H.includes(ce.bold)?ce.bold:"").html(w=>w.label).attr("visibility",l.plotArea.dataLabelName?"visible":"hidden")):(D&&D.selectAll(".venn-circle text").style("visibility","hidden"),D&&D.selectAll(".venn-circle text").html("")),l.plotArea.dataLabelValue&&D&&D.selectAll(".venn-circle text").append("tspan").attr("font-size",l.plotArea.dataLabelValueFontSize).attr("fill",l.plotArea.dataLabelValueColor!==Ie.white?l.plotArea.dataLabelValueColor:"none").style("font-style",I.includes(ce.italic)?ce.italic:"normal").attr("text-decoration",I.includes(ce.underline)?ce.underline:"none").style("font-weight",I.includes(ce.bold)?ce.bold:"normal").attr("font-family",l.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(w=>w.actualValue!==void 0?(l.plotArea.dataLabelName?" : ":"")+v.format(l.plotArea.dataLabelNumberFormat)(w.actualValue):"").attr("visibility",l.plotArea.dataLabelValue?"visible":"hidden"),l.plotArea.intersectionLabelVisibility?(D&&D.selectAll(".venn-intersection text").html(""),D&&D.selectAll(".venn-intersection text").append("tspan").style("font-family",l.plotArea.dataLabelNameFontFamily).style("fill",l.plotArea.dataLabelNameColor).style("font-size",l.plotArea.dataLabelNameFontSize+"px").style("font-style",H.includes(ce.italic)?ce.italic:"").attr("text-decoration",H.includes(ce.underline)?ce.underline:"").style("font-weight",H.includes(ce.bold)?ce.bold:"").html(w=>w.label).attr("visibility",l.plotArea.intersectionLabelVisibility?"visible":"hidden")):(D&&D.selectAll(".venn-intersection text").style("visibility","hidden"),D&&D.selectAll(".venn-intersection text").html("")),l.plotArea.intersectionValueVisibility&&D&&D.selectAll(".venn-intersection text").append("tspan").attr("font-size",l.plotArea.dataLabelValueFontSize).attr("fill",l.plotArea.dataLabelValueColor!==Ie.white?l.plotArea.dataLabelValueColor:"none").style("font-style",I.includes(ce.italic)?ce.italic:"normal").attr("text-decoration",I.includes(ce.underline)?ce.underline:"none").style("font-weight",I.includes(ce.bold)?ce.bold:"normal").attr("font-family",l.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(w=>w.actualValue!==void 0?(l.plotArea.dataLabelName?" : ":"")+v.format(l.plotArea.dataLabelNumberFormat)(w.actualValue):"").attr("visibility",l.plotArea.intersectionValueVisibility?"visible":"hidden"),D&&D.selectAll(".venn-circle path").style("fill",w=>w.properties?w.properties.color:null),D&&D.selectAll("g").on("mousemove",function(w,z){ut([{key:z.label,value:Ke(l.toolTip.toolTipDisplayUnits,l.toolTip.toolTipNumberFormat,l.toolTip.toolTipDecimalPrecision)(z.size)}],l,void 0,z.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(w,z){ot();var K=v.select(this).transition("tooltip").duration(400);K.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(H){me("VennChart.tsx","drawVennDiagramChart",H)}},U=()=>{try{let H=0,I=0;return x.forEach(D=>{if(D.legendDisplay){let w=$t(D.legendDisplay+" : "+D.actualValue,rt(l.legends.legendFontSize),l.legends.legendFontFamily);H=Math.max(H,w.width),I=Math.max(I,w.height)}}),[H,I]}catch(H){return me("VennChart.tsx","calculateLegendsMaxPossibleWidth",H),[0,0]}},Y=()=>{try{let H=l.legends.legendPosition,I=l.legends.legendAlignmentTopBottom,D=l.legends.legendAlignment;switch(H){case Je.none:break;case Je.right:xa(A,x,r-S-25,p+5,S+15,c-p-10,H,D,ct.none,l,n,!0);break;case Je.top:xa(A,x,5,p+5,r-10,30,H,I,ct.none,l,n,!0);break;case Je.left:xa(A,x,5,m.top,S+15,c-p-10,H,D,ct.none,l,n,!0);break;case Je.bottom:xa(A,x,5,c-35,r-10,30,H,I,ct.none,l,n,!0);break}}catch(H){me("VennChart.tsx","initLegendListWithTotalValueAllowance",H)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:o,id:n,style:{width:"100%",height:"100%"}})})},Rr=({formatOptions:t,data:e,chartId:n,onElementClick:o,vfxPickModeActive:x,tooltipFormatter:l})=>{if(!e)return null;let r=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],c=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const p=Ce.useRef(),m=Ce.useRef(o);m.current=o;const L=Ce.useRef(x);L.current=x;let u,S,g,W=40,A=Jt,E,b,U,Y,H=ni.left,I=0,D=!1,w=new Map,z=new Map,K=.8,ye=.8;Ce.useEffect(()=>{se()},[t]);const se=()=>{({chartFormatOptions:u,svg:Y,width:S,height:g}=Kt(p,t)),{margins:A,chartTitleHeight:W,innerHeight:E,innerWidth:b}=ri(u,g,S),te(),qt(p,S,g,u),U=oa(Y,A),Xt(p,W,S,u),pe()},te=()=>{try{K=rt(u.nodes.nodesFillOpacity),ye=rt(u.links.linksFillOpacity),c.forEach(h=>{h.totalValue=0}),c.forEach(h=>r.forEach(k=>(h.name==k.source||h.name==k.target)&&(h.totalValue=(h.totalValue||0)+k.value))),c=c.filter(h=>h.totalValue!=0),r=r.filter(h=>h.value!=0);let X=he(r),M=new Map;X.forEach(h=>{h.nodes.forEach(k=>{M.set(k,h.layer)})}),c.forEach(h=>{let k=M.get(h.name);w.set(k,(w.get(k)||0)+h.totalValue)}),c.forEach(h=>{z.set(h.name,h.totalValue/w.get(M.get(h.name))*100)}),xe(X)}catch(X){me("SankeyChart.tsx","prepareDataForSankey",X)}},xe=X=>{try{D=u.nodes.nodesLabelWrap,H=u.nodes.nodesLabelVisibility?u.nodes.sankeyChartType:"None";let M="",h=0;c.forEach(d=>{M=d.name.length>M.length?d.name:M,h=d.totalValue.toString().length>h.toString().length?d.totalValue:h});let k=$t(M,rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily),s=$t(Ke(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(h),rt(u.nodes.nodesLabelFontSize),u.nodes.nodesLabelFontFamily);I=Math.max(k.width,s.width)+6,D&&(I=Math.min(b*.1,I))}catch(M){me("SankeyChart.tsx","calculateMaxNodeValueWidth",M)}},ge=(X,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,s=[],d=[];switch(H){case ni.center:s=[1,5],d=[b,E];break;case ni.right:s=[1,5],d=[b-I,E];break;case ni.left:s=[I,5],d=[b,E];break;default:s=[1,5],d=[b,E];break}return Ni.sankey().nodeId(y=>y.name).nodeAlign(Ni.sankeyJustify).nodeWidth(k).nodePadding(h).extent([s,d]).nodeSort(null)({nodes:X.map(y=>Object.assign({},y)),links:M.map(y=>Object.assign({},y))})}catch(h){return me("SankeyChart.tsx","getsankey",h),{nodes:[],links:[]}}},pe=()=>{try{let X=function(){try{const T={};s.forEach(a=>{const f=a.x0;T[f]||(T[f]=[]),T[f].push(a)}),Object.keys(T).forEach(a=>{const f=T[a];if(f.length===0)return;f.sort((Re,Te)=>Re.y0-Te.y0);const N=f[0],ne=f[f.length-1],Z=N.y1-N.y0,fe=ne.y1-ne.y0;if(N.y0=0,N.y1=Z,ne.y1=E,ne.y0=E-fe,f.length>2){const Re=f.slice(1,f.length-1),Te=ne.y0-N.y1,Me=v.sum(Re,Le=>Le.y1-Le.y0),J=(Te-Me)/(Re.length+1);let Ee=N.y1+J;Re.forEach(Le=>{const Ue=Le.y1-Le.y0;Le.y0=Ee,Le.y1=Ee+Ue,Ee+=Ue+J})}})}catch(T){me("SankeyChart.tsx","centerAlignNodesByLayer",T)}},M=function(){try{s.forEach(T=>{let a=0,f=0;T.sourceLinks.forEach(N=>{N.sy=a,a+=N.width}),T.targetLinks.forEach(N=>{N.ty=f,f+=N.width})})}catch(T){me("SankeyChart.tsx","arrangeFlows",T)}},h=function(T){return function(a){try{const f=a.source.x1,N=a.source.y0+a.sy+a.width/2,ne=a.target.x0,Z=a.target.y0+a.ty+a.width/2,fe=ne-f,Re=f+fe*T,Te=ne-fe*T;return`M${f},${N} C${Re},${N} ${Te},${Z} ${ne},${Z}`}catch(f){return me("SankeyChart.tsx","sankeyLinkCustom",f),""}}},k=u.nodes.curviness!==void 0?u.nodes.curviness!=="0"?u.nodes.curviness:.1:.5;const{nodes:s,links:d}=ge(c,r);M(),X(),M(),M();const i=U.append("g").selectAll("rect").data(s).enter().append("rect").style("fill-opacity",K).attr("id",T=>"Node"+T.index).attr("class","sankey-nodes").attr("stroke",u.nodes.nodesBorderColor!==Ie.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:Ie.white).on("mousemove",function(T,a){try{u.toolTip.toolTipVisibility&&ut([{key:a.name.split("~$~")[1],value:u.toolTip.toolTipNumberFormat==",.0%"?z.get(a.name)+"%":Ke(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerShape:"square",markerColor:a.color},At(l,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),U.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),U.selectAll(".sankey-nodes-texts").style("opacity","0"),U.selectAll(".sankey-links").style("stroke-opacity",.1),U.select(`#Node${a.index}`).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none").style("fill-opacity",K).style("cursor","pointer"),U.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(f=>{U.select(`#Node${f.target.index}`).style("fill-opacity",K).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Link${f.index}`).style("stroke-opacity",ye),U.select(`#Label${f.target.index}`).style("opacity",1)}),a.targetLinks.forEach(f=>{U.select(`#Node${f.source.index}`).style("fill-opacity",K).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Link${f.index}`).style("stroke-opacity",ye),U.select(`#Label${f.source.index}`).style("opacity",1)})}catch(f){me("SankeyChart.tsx","Nodes.onMouseMove",f)}}).on("mouseout",function(T){try{U.selectAll(".sankey-nodes").style("fill-opacity",K).style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.selectAll(".sankey-links").style("stroke-opacity",ye),U.selectAll(".sankey-nodes-texts").style("opacity","1"),u.toolTip.toolTipVisibility&&ot()}catch(a){me("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(lt.SeriesId,T=>String(T.name??"")).attr(lt.DimValue,T=>String(T.name??"")).on("click",vt(L,m,(T,a)=>{const f=String(a.name??"");return{seriesId:f,dimValue:f,legendUniqueId:f,seriesDisplayName:f.includes("~$~")?f.split("~$~")[1]:f}}));if(U.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",ye).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{U.selectAll(".sankey-links").style("stroke-opacity",.1),U.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),U.selectAll(".sankey-nodes-texts").style("opacity","0"),U.select(`#Link${a.index}`).style("stroke-opacity",ye).style("cursor","pointer"),U.select(`#Node${a.target.index}`).style("fill-opacity",K).style("Stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Node${a.source.index}`).style("fill-opacity",K).style("Stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.select(`#Label${a.target.index}`).style("opacity",1),U.select(`#Label${a.source.index}`).style("opacity",1),u.toolTip.toolTipVisibility&&ut([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:Ke(u.toolTip.toolTipDisplayUnits,u.toolTip.toolTipNumberFormat,u.toolTip.toolTipDecimalPrecision)(a.value)}],u,void 0,{markerColor:a.source.color,markerShape:"circle"},At(l,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(f){me("SankeyChart.tsx","link.onMouseMove",f)}}).on("mouseout",function(T){try{u.toolTip.toolTipVisibility&&ot(),U.selectAll(".sankey-nodes").style("fill-opacity",K),U.selectAll(".sankey-nodes").style("stroke",u.nodes.nodesBorderColor!==Ie.white?u.nodes.nodesBorderColor:"none"),U.selectAll(".sankey-links").style("stroke-opacity",ye),U.selectAll(".sankey-nodes-texts").style("opacity","1"),v.select(this).select("rect").style("pointer-events","all"),v.select(this).style("cursor","none")}catch(a){me("SankeyChart.tsx","link.onMouseOut",a)}}),u.nodes.nodesLabelVisibility)try{const T=U.append("g").attr("font-family",u.nodes.nodesLabelFontFamily).attr("font-size",u.nodes.nodesLabelFontSize).style("font-style",u.nodes.nodesLabelFontStyle.includes(ce.italic)?ce.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ce.bold)?ce.bold:"").attr("display",u.nodes.nodesLabelVisibility?"visible":"none").selectAll("text").data(s).enter().append("g").attr("class","sankey-nodes-texts").attr("id",a=>"Label"+a.index).each(function(a){try{if(u.nodes.sankeyChartType!=="None"){const f=u.nodes.sankeyNodeWidth,N=H===ni.center;v.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y-16).attr("width",fe=>N?f:I).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",fe=>N?"100px":I+"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(ce.italic)?ce.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ce.bold)?ce.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",fe=>z.get(fe.name)>0?fe.alias?fe.alias.includes("~$~")?fe.alias.split("~$~")[1]:fe.alias:fe.name.includes("~$~")?fe.name.split("~$~")[1]:fe.name:"").text(fe=>z.get(fe.name)>0?fe.alias?fe.alias.includes("~$~")?fe.alias.split("~$~")[1]:fe.alias:fe.name.includes("~$~")?fe.name.split("~$~")[1]:fe.name:""),v.select(this).append("foreignObject").attr("x",O(a).x).attr("y",O(a).y).attr("width",fe=>N?f:I).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",fe=>N?"100px":I+"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(ce.italic)?ce.italic:"").style("text-decoration",u.nodes.nodesLabelFontStyle.includes(ce.underline)?ce.underline:"").style("font-weight",u.nodes.nodesLabelFontStyle.includes(ce.bold)?ce.bold:"").style("text-align",u.nodes.sankeyChartType==="Left"?"right":u.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",fe=>z.get(fe.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?z.get(fe.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":Ke(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(fe.totalValue):"").text(fe=>z.get(fe.name)>0?u.nodes.nodeLabelNumberFormat===",.0%"?z.get(fe.name).toFixed(parseFloat(u.nodes.nodeLabelDecimalPrecision))+"%":Ke(u.nodes.nodesLabelDisplayUnits,u.nodes.nodeLabelNumberFormat,u.nodes.nodeLabelDecimalPrecision)(fe.totalValue):"")}}catch(f){me("SankeyChart.tsx","texts.each",f)}})}catch(T){me("SankeyChart.tsx","inittree.texts",T)}}catch(X){me("SankeyChart.tsx","inittree",X)}};function he(X){try{const M=new Map,h=new Map,k=new Set;for(const{source:T,target:a}of X)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 s=new Map,d=[];for(const T of k)M.has(T)||(s.set(T,0),d.push(T));for(;d.length>0;){const T=d.shift(),a=s.get(T),f=h.get(T)||[];for(const N of f){const ne=a+1;(!s.has(N)||s.get(N)<ne)&&(s.set(N,ne),d.push(N))}}const i=new Map;for(const[T,a]of s.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 me("SankeyChart.tsx","assignNodeLayers",M),[]}}const O=X=>{try{let M={};const h=Number(u.nodes.sankeyNodeWidth),k=h/2;switch(H){case"Right":M.x=X.x1+6;break;default:case"Left":M.x=X.x0-I;break;case"Center":M.x=X.x0+k-h/2;break}return M.y=(X.y1+X.y0)/2,M}catch(M){return me("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:n,style:{width:"100%",height:"100%"}})})},zr={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]]]}}]},$r=({data:t,geoJsonNode:e,formatOptions:n,chartId:o})=>{const x=Ce.useRef();let l=mt(t),r,c,p,m=Number.MAX_VALUE,L=Number.MIN_VALUE,u=40,S=Jt,g,W,A,E,b=0,U=1,Y,H=new Map,I=new Map,D=new Map,w=Number.MAX_VALUE,z=Number.MIN_VALUE,K=0,ye=0,se,te;Ce.useEffect(()=>{xe()},[n,o]);const xe=()=>{({chartFormatOptions:r,svg:E,width:c,height:p}=Kt(x,n)),{margins:S,chartTitleHeight:u,innerHeight:g,innerWidth:W}=ri(r,p,c),qt(x,c,p,r),A=oa(E,S),Xt(x,u,c,r),ge(t),pe(),he(),O()},ge=M=>{try{let h=new Set,k=new Set;M.forEach(i=>{i.data.forEach((y,T)=>{T===b&&(h.add(y.value.toString()),K+=y.value),T===U&&(k.add(y.value.toString()),ye+=y.value)})});let s=r.colorScaleForMaps&&r.colorScaleForMaps.startColorForMaps?r.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=r.colorScaleForMaps&&r.colorScaleForMaps.endColorForMaps?r.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(h.size===1)se=()=>s;else{const i=v.interpolateLab(s,d);se=v.scaleOrdinal().domain(Array.from(h)).range(Array.from(h).map((y,T)=>i(T/(h.size-1))))}if(k.size===1)te=()=>s;else{const i=v.interpolateLab(r.colorScaleForMapsBubble.startColorForMapsBubble,r.colorScaleForMapsBubble.endColorForMapsBubble);te=v.scaleOrdinal().domain(Array.from(k)).range(Array.from(k).map((y,T)=>i(T/(k.size-1))))}}catch(h){me("Maps.tsx","dataPreparation",h)}},pe=M=>{Y=zr},he=()=>{try{l?.forEach(M=>{D.set(M.legend,M)}),e.mappings.forEach(M=>{I.set(M.actualName,M.mappedName)}),e.groups.forEach(M=>{M.groupedRegions.forEach(h=>{H.set(h,M.groupName)})}),Y.features.forEach(M=>{const h=M.properties.name;let k;if(I.has(h)){const s=I.get(h);M.properties.displayName=s,k=s}if(H.has(h)){const s=H.get(h);M.properties.displayName=s,k=s}else k=h;if(D.has(k)){const s=D.get(k);M.properties.data=s;let d;s.data&&s.data[1]&&(d=s.data[1]?s.data[1].value:0,w=Math.min(w,d),z=Math.max(z,d)),s.data&&s.data[0]&&(d=s.data[0].value,m=Math.min(m,d),L=Math.max(L,d))}else M.properties.data=void 0})}catch(M){me("Maps.tsx","generateDataForMaps",M)}},O=()=>{try{let M=0;const h=v.geoAlbersUsa().fitSize([W,g],Y),k=v.geoPath().projection(h),s=A.append("g").attr("class","paths");if(s.selectAll(o+" .path-group").data(Y.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>X(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",r.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:Ke("None",r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(a.value)}));ut([{key:"Region",value:y.properties.alias},...T],r,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{ot()}),r.plotArea.dataLabels){const d=M/Y.features.length,i=r.plotArea.dataLabelName,y=r.plotArea.dataLabelValue,T=a=>r.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?k.area(a)<d*.25:!1;s.selectAll(".text-container").data(Y.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>k.centroid(a)[0]-50).attr("y",a=>{const f=k.centroid(a);return i&&y?f[1]-15:f[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let f=a.properties.data;if((i||y)&&f&&!T(a)){if(T(a))return null;const N=f?.properties.alias||a.properties.displayName,ne=r.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/K*100)+"%":Ke(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let Z="";return r.plotArea.dataLabelName&&(Z+=`<div style=
143
+ ${T.format(".2s")(h.data.data[0].value)}
144
+ </span>`),a}catch(v){return Ce(Pa,"drawDonutDataLabels",v),""}}),A.animation.animationEnabled&&R.selectAll(".pie-label-group, .pie-label-connector").attr("opacity",0).transition().duration(A.animation.animationDuration).ease(tt[A.animation.animationEffect]).attr("opacity",1)}}catch(c){Ce(Pa,"drawDonutDataLabels",c)}},k=()=>{try{if(A.total&&A.total.totalVisibility){let c=le,d=A.total.totalFontStyle;const i=R.append("g").attr("transform",J()).attr("pointer-events","none").attr("text-anchor","middle");i.append("text").style("fill",A.total.totalColor!==ze.white?A.total.totalColor:"none").style("font-family",A.total.totalFontFamily).style("font-size",A.total.totalFontSize).style("font-style",d.includes(ie.italic)?ie.italic:"").style("text-decoration",d.includes(ie.underline)?ie.underline:"").style("font-weight",d.includes(ie.bold)?ie.bold:"").attr("text-anchor","middle").attr("visibility",A.plotArea.dataLabelValue?"visible":"hidden").text(A.total.showTotalLabel!==!1?A.total.editTotalText:"").append("tspan").attr("x",0).attr("y",A.total.showTotalLabel!==!1?"1.3em":"0").attr("font-weight",d.includes(ie.bold)?ie.bold:300).text(A.total.totalNumberFormat===",.0%"||A.total.totalNumberFormat==="Percentage"?"100%":Qe(A.total.totalDisplayUnits,A.total.totalNumberFormat,A.total.totalDecimalPrecision)(c)),A.animation.animationEnabled&&i.attr("opacity",0).transition().duration(A.animation.animationDuration).ease(tt[A.animation.animationEffect]).attr("opacity",1)}}catch(c){Ce(Pa,"drawTotalValue",c)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:m,id:l,style:{width:"100%",height:"100%"}})})},Qa="TreemapChart.tsx",wr=({data:t,formatOptions:e,chartId:l,onElementClick:s,vfxPickModeActive:u,tooltipFormatter:r})=>{const n=Ne.useRef(),o=Ne.useRef(s);o.current=s;const p=Ne.useRef(u);p.current=u;let m,f,y,S=40,A=Kt,Z,L,Y,b,H,B;Ne.useEffect(()=>{G()},[e]);const G=()=>{({chartFormatOptions:m,svg:B,width:f,height:y}=ta(n,e)),{margins:A,chartTitleHeight:S,innerHeight:Z,innerWidth:L}=ni(m,y,f,!0),ea(n,f,y,m),Y=da(B,A),Ot(n,S,f,m),I(),D(),le()},I=()=>{try{const te={name:"root",children:t.ChartData},Q=T.hierarchy(te).sum(de=>de.data&&de.data[0].value).sort((de,Le)=>(Le.data.data[0].value??0)-(de.data.data[0].value??0));b=T.treemap().tile(T.treemapSquarify).size([L,Z]).padding(1).round(!0)(Q).leaves(),H=b[0].data.properties.color}catch(te){Ce(Qa,"initChartData",te)}},D=()=>{try{if(m.colorScale.showColor===va.colorTheme){let Q=b[0].data.data.length>1?1:0,de=m.colorScale.startColor,Le=m.colorScale.endColor,Te=new Set(b.map(M=>M.data.data[Q].value)),he=Array.from(Te).sort((M,x)=>M-x),q=he.length,J;if(q===1)J=()=>de;else{const M=T.interpolateLab(de,Le);J=T.scaleOrdinal().domain(he.map(String)).range(he.map((x,k)=>M(k/(q-1))))}b=b.map(M=>{let x=M.data.data[Q].value;return{...M,data:{...M.data,properties:{...M.data.properties,themeColor:J(x.toString())}}}}),N(de,Le,q,he)}}catch(te){Ce(Qa,"prepareTreeColors",te)}},N=(te,Q,de,Le)=>{try{let Te=T.scalePow().exponent(1).domain([0,de-1]).range([te,Q]),q=B.append("foreignObject").attr("class","parentGroup").attr("x",f-130).attr("y",y-30).attr("width",115).attr("height",10).selectAll(null).data(Le).enter().append("xhtml:div").style("width",`${100/de}%`).style("height","100%").style("flex-direction","row").style("display","inline-block").attr("width","20px").attr("height","10px").style("background-color",(M,x)=>Te(x)).append("div").attr("width","20px").attr("height","10px").style("display","inline-block");const J=B.append("g").attr("transform",`translate(${f-120},${y-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",m.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",m.yAxisTitle.yAxisTitleFontFamily).text("min");B.append("g").attr("transform",`translate(${f-10},${y-10})`).append("text").attr("text-anchor","end").attr("class","DisplayUnit").style("fill",m.yAxisTitle.yAxisTitleColor).style("font-size","10px").style("font-family",m.yAxisTitle.yAxisTitleFontFamily).text("max")}catch(Te){Ce(Qa,"appendColorScale",Te)}},R=te=>{try{switch(m.colorScale.showColor){case va.none:return H;case va.discrete:return te.properties.color;case va.colorTheme:return te.properties.themeColor;default:return}}catch(Q){Ce(Qa,"getColor",Q)}},X=te=>{try{const Q=te?.currentTarget?.__data__?.data?.properties;if(!Q)return;switch(m.colorScale.showColor){case va.none:return{...Q,markerColor:H};case va.colorTheme:return{...Q,markerColor:Q.themeColor};case va.discrete:default:return Q}}catch(Q){Ce(Qa,"getMarkerColorForTooltip",Q)}},le=()=>{try{const te=m.animation.animationEnabled,Q=Y.selectAll("g").data(b).enter().append("g").attr("transform",Le=>`translate(${Le.x0},${Le.y0})`),de=Q.append("rect").attr("fill",Le=>R(Le.data)).attr("fill-opacity",te?0:.7).attr("width",Le=>Le.x1-Le.x0).attr("height",Le=>Le.y1-Le.y0).on("mousemove",(Le,Te)=>{xt([{key:m.yAxisTitle.yAxisTitleText,value:Qe(m.toolTip.toolTipDisplayUnits,m.toolTip.toolTipNumberFormat,m.toolTip.toolTipDecimalPrecision)(Te.data.data[0].value)},{key:"Legend",value:Te.data.data[0].legend}],m,void 0,X(Le),Lt(r,String(Te.data.data[0]?.legend??""),X(Le)))}).on("mouseout",()=>ct()).attr(rt.SeriesId,Le=>String(Le.data.properties?.legendUniqueId??Le.data.legend??"")).attr(rt.DimValue,Le=>String(Le.data.data[0].legend??"")).on("click",kt(p,o,(Le,Te)=>{const he=String(Te.data.properties?.legendUniqueId??Te.data.legend??""),q=String(Te.data.data[0].legend??"");return{seriesId:he,dimValue:q,legendUniqueId:he,seriesDisplayName:String(Te.data.properties?.alias||Te.data.properties?.name||q)}}));if(te&&de.transition().duration(m.animation.animationDuration).ease(tt[m.animation.animationEffect]).attr("fill-opacity",.7),Q.append("clipPath").attr("id",(Le,Te)=>`clip-${Te}-${l}`).append("rect").attr("width",Le=>Le.x1-Le.x0).attr("height",Le=>Le.y1-Le.y0),m.plotArea.dataLabels){const Le=m.annotation.annotationRangeFilter;Q.filter(Te=>{if(!Le?.enabled)return!0;const he=Te.data.data[0].value;switch(Le.condition){case"lt":return he<Le.maxVal;case"gt":return he>Le.minVal;case"in":return he>=Le.minVal&&he<=Le.maxVal;case"not-in":return he<Le.minVal||he>Le.maxVal;default:return!0}}).append("text").style("fill",Te=>Te.data.properties.labelFontColor).style("font-family",Te=>Te.data.properties.fontFamily).style("font-size",Te=>Te.data.properties.fontSize).style("font-style",Te=>Te.data.properties.fontStyle.includes(ie.italic)?ie.italic:"").style("text-decoration",Te=>Te.data.properties.fontStyle.includes(ie.underline)?ie.underline:"").style("font-weight",Te=>Te.data.properties.fontStyle.includes(ie.bold)?ie.bold:"").attr("clip-path",(Te,he)=>`url(#clip-${he}-${l})`),m.plotArea.dataLabelName&&Q.selectAll("text").append("tspan").attr("x",5).attr("y","1.1em").text(Te=>Te.data.legend),m.plotArea.dataLabelValue&&Q.selectAll("text").append("tspan").attr("x",5).attr("y",m.plotArea.dataLabelName?"2.1em":"1.1em").text(Te=>Qe(m.plotArea.plotAreaDisplayUnits,m.plotArea.dataLabelNumberFormat,m.plotArea.dataLabelDecimalPrecision)(Te.data.data[0].value)),te&&Q.selectAll("text").attr("opacity",0).transition().duration(m.animation.animationDuration).ease(tt[m.animation.animationEffect]).attr("opacity",1)}}catch(te){Ce(Qa,"initChartRect",te)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:n,id:l,style:{width:"100%",height:"100%"}})})},ya="PieofPieChart.tsx",Dr=({data:t,formatOptions:e,chartId:l,legendProperties:s,tooltipFormatter:u})=>{const r=Ne.useRef();let n,o,p,m=40,f=Kt,y,S,A,Z,L,Y,b,H,B,G,I,D,N,R=[0,0],X,le;Ne.useEffect(()=>{te()},[e]);const te=()=>{({chartFormatOptions:n,svg:Z,width:o,height:p}=ta(r,e)),{plotArea:le}=n,Q(),{margins:f,innerHeight:y,innerWidth:S,legendListWidth:X,chartTitleHeight:m}=Ua(n,o,p,R,f),de(),ea(r,o,p,n),A=da(Z,f),Ot(r,m,o,n),Le(),Te(),x(),Ni(n,H,m,Z,o,p),d()},Q=()=>{try{let i=Ut(Qi(s,"name"),nt(n.legends.legendFontSize),n.legends.legendFontFamily);R=[i.width,i.height]}catch(i){Ce(ya,"calculateMaxPossibleWidth",i)}},de=()=>{try{Y=Math.min(y*.4,S*.4),b=n.pieofPie.pieOfPieRadius}catch(i){Ce(ya,"calculatePieRadius",i)}},Le=()=>{try{let i=new Map;s.forEach(a=>{i.set(a.name,a)}),H=0,t.forEach(a=>{a.properties=i.get(a.legend),H+=a.data[0].value,a.children&&a.children.forEach(g=>g.properties=i.get(g.legend))}),L=T.pie().value(a=>a.data[0].value)(t).map((a,g)=>({...a,x0:a.startAngle,x1:a.endAngle,y0:0,y1:Y,depth:2}))}catch(i){Ce(ya,"initChartData",i)}},Te=()=>{try{const i=T.arc().innerRadius(0).outerRadius(Y),h=T.arc().innerRadius(0).outerRadius(Y+10),v=A.append("g").attr("class","parentGroup").attr("fill-opacity",n.plotArea.opacity).attr("transform",`${q()}`).selectAll("path").data(L).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!==ze.white?a.data.properties.color:"none").on("mouseover.arc",function(a){T.select(this).transition().duration(100).attr("d",h)}).on("mousemove.text",a=>{xt([{key:n.yAxisTitle.yAxisTitleText,value:n.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(a.currentTarget.__data__.data.data[0].value/H)*100).toFixed(nt(n.toolTip.toolTipDecimalPrecision)??0)+"%":Qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(a.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:a.currentTarget.__data__.data.legend}],n,void 0,a.currentTarget.__data__.data.properties,Lt(u,String(a.currentTarget.__data__.data.legend??""),a.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ct()}).on("mouseout.arc",function(a){T.select(this).transition().duration(100).attr("d",i),ct()}).on("click",(a,g)=>{try{let P=g;if(P.data.children&&P.data.children.length>1){A.selectAll(".childGroup").remove(),A.selectAll(".childLabels").remove(),A.selectAll("line").remove(),B=P.data.legend;let ce=90-(g.x0+g.x1)/2/Math.PI*180;he(P.data.children,ce,g)}}catch(P){Ce(ya,"drawPieChart_onClick",P)}});n.animation.animationEnabled?v.transition().duration(n.animation.animationDuration).ease(tt[n.animation.animationEffect]).attrTween("d",function(a){const g=T.interpolate({startAngle:a.startAngle,endAngle:a.startAngle},a);return P=>i(g(P))}):v.attr("d",a=>i(a))}catch(i){Ce(ya,"drawPieChart",i)}},he=(i,h,v)=>{try{A.select(".parentGroup").transition().duration(n.animation.animationDuration).ease(tt[n.animation.animationEffect]).attr("transform",`${q()} rotate(${h})`),A.selectAll(".parentLabels").transition().duration(n.animation.animationDuration).ease(tt[n.animation.animationEffect]).attr("transform",`${q()} rotate(${h})`);let g=T.pie().value(z=>z.data[0].value)(i).map((z,me)=>({...z,x0:z.startAngle,x1:z.endAngle,y0:0,y1:b,depth:2}));const P=T.arc().innerRadius(0).outerRadius(b),ce=T.arc().innerRadius(0).outerRadius(b+10);A.append("g").attr("class","childGroup").attr("fill-opacity",n.plotArea.opacity).attr("transform",`${J()}`).selectAll("path").data(g).enter().append("path").attr("class",z=>"path "+z.data.legend).attr("hoverId",z=>z.data.legend.replace(/ /g,"-")).attr("fill",z=>z.data.properties.color!==ze.white?z.data.properties.color:"none").attr("d",z=>P(z)).on("mouseover.arc",function(z){T.select(this).transition().duration(100).attr("d",ce)}).on("mousemove.text",z=>{xt([{key:n.yAxisTitle.yAxisTitleText,value:n.toolTip.toolTipNumberFormat==",.0%"?(Math.abs(z.currentTarget.__data__.data.data[0].value/H)*100).toFixed(nt(n.toolTip.toolTipDecimalPrecision))+"%":Qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(z.currentTarget.__data__.data.data[0].value)},{key:"Legend",value:z.currentTarget.__data__.data.legend}],n,void 0,z.currentTarget.__data__.data.properties,Lt(u,String(z.currentTarget.__data__.data.legend??""),z.currentTarget.__data__.data.properties))}).on("mouseout.text",()=>{ct()}).on("mouseout.arc",function(z){T.select(this).transition().duration(100).attr("d",P),ct()}),k(g),c(v,i)}catch(a){Ce(ya,"drawChildPie",a)}},q=()=>{try{return G=B?3*S/8:S/2,I=y/2,`translate(${G},${I})`}catch(i){Ce(ya,"getParentPiePosition",i)}},J=()=>{try{return D=3*S/4,N=y/2,`translate(${D},${N})`}catch(i){Ce(ya,"getChildPiePosition",i)}},M=(i,h)=>{try{const v=(i.startAngle+i.endAngle)/2,a=Math.cos(v-Math.PI/2)*(h*.65),g=Math.sin(v-Math.PI/2)*(h*.65);let P=v*180/Math.PI-90;return`translate(${a},${g}) rotate(${P})`}catch(v){Ce(ya,"getDataLabelTransformString",v)}},x=()=>{try{n.plotArea.dataLabels&&(A.append("g").attr("class","parentLabels parentGroup").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ht(L,n,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??ze.black).attr("font-style",i=>i.data.properties?.labelFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",i=>i.data.properties?.labelFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",i=>i.data.properties?.labelFontStyle?.includes(ie.bold)?ie.bold:"").attr("font-family",i=>i.data.properties?.labelFont??at).attr("transform",i=>M(i,Y)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(i=>{const{plotArea:h}=n;return h.dataLabelName?i.data.legend:""}),A.append("g").attr("class","parentLabels parentGroup").attr("transform",`${q()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ht(L,n,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??ze.black).attr("font-style",i=>i.data.properties?.valueFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",i=>i.data.properties?.valueFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",i=>i.data.properties?.valueFontStyle?.includes(ie.bold)?ie.bold:"300").attr("font-family",i=>i.data.properties?.valueFont??at).attr("transform",i=>M(i,Y)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(i=>{if(n.plotArea.dataLabelValue){const h=i.data.data[0].value;return n.plotArea.dataLabelName&&n.plotArea.dataLabelValue&&h!==void 0?n.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(h/H)*100).toFixed(nt(n.plotArea.dataLabelDecimalPrecision)??0)+"%":Qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(h):h}}))}catch(i){Ce(ya,"drawParentPieDataLabels",i)}},k=i=>{try{n.plotArea.dataLabels&&(A.append("g").attr("class","childLabels parentGroup").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ht(i,n,h=>h.data.data[0].value)).enter().append("text").attr("hoverId",h=>h.data.legend.replace(/ /g,"-")).attr("font-size",h=>h.data.properties?.labelFontSize??11).attr("fill",h=>h.data.properties?.labelFontColor??ze.black).attr("font-style",h=>h.data.properties?.labelFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",h=>h.data.properties?.labelFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",h=>h.data.properties?.labelFontStyle?.includes(ie.bold)?ie.bold:"").attr("font-family",h=>h.data.properties?.labelFont??at).attr("transform",h=>M(h,b)).attr("dy","-0.35em").attr("text-anchor","middle").attr("alignment-baseline","middle").text(h=>{const{plotArea:v}=n;return v.dataLabelName?h.data.legend:""}),A.append("g").attr("class","childLabels parentGroup").attr("transform",`${J()}`).attr("pointer-events","none").attr("text-anchor","middle").selectAll("text").data(Ht(i,n,h=>h.data.data[0].value)).enter().append("text").attr("hoverId",h=>h.data.legend.replace(/ /g,"-")).attr("font-size",h=>h.data.properties?.valueFontSize??11).attr("fill",h=>h.data.properties?.valueFontColor??ze.black).attr("font-style",h=>h.data.properties?.valueFontStyle?.includes(ie.italic)?ie.italic:"").attr("text-decoration",h=>h.data.properties?.valueFontStyle?.includes(ie.underline)?ie.underline:"").attr("font-weight",h=>h.data.properties?.valueFontStyle?.includes(ie.bold)?ie.bold:"300").attr("font-family",h=>h.data.properties?.valueFont??at).attr("transform",h=>M(h,b)).attr("text-anchor","middle").attr("alignment-baseline","middle").attr("dy","1.00em").text(h=>{if(n.plotArea.dataLabelValue){const v=h.data.data[0].value;return n.plotArea.dataLabelName&&n.plotArea.dataLabelValue&&v!==void 0?n.plotArea.dataLabelNumberFormat===",.0%"?(Math.abs(v/H)*100).toFixed(nt(n.plotArea.dataLabelDecimalPrecision)??0)+"%":Qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(v):v}}))}catch(h){Ce(ya,"drawChildPieDataLabels",h)}},c=(i,h)=>{try{let v=Math.abs(i.x0-i.x1)/2,g=i.y1*Math.sin(v),P=g/Math.tan(v);A.append("line").style("stroke",n.pieofPie.pieOfPieLineColor).style("stroke-width",n.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",G+P).attr("y1",I-g).attr("x2",D).attr("y2",N-b),A.append("line").style("stroke",n.pieofPie.pieOfPieLineColor).style("stroke-width",n.pieofPie.pieOfPieLineWidth).style("stroke-dasharray","3, 3").attr("opacity",.5).attr("x1",G+P).attr("y1",I+g).attr("x2",D).attr("y2",N+b)}catch(v){Ce(ya,"drawLines",v)}},d=()=>{try{let i=s.map(h=>({legend:h.name,properties:h,data:[]}))}catch(i){Ce(ya,"initLegendList",i)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:r,id:l,style:{width:"100%",height:"100%"}})})},ba="PyramidChart.tsx",Vr=({data:t,formatOptions:e,chartId:l,onDataLabelCoordinatesChange:s,addLocalFilterFromLib:u,tooltipFormatter:r})=>{const n=Ne.useRef();let o=ft(t.ChartData),p,m,f,y,S=40,A=Kt,Z=[0,0],L,Y,b,H,B=[0],G,I,D,N;Ne.useEffect(()=>{R()},[e]);const R=()=>{({chartFormatOptions:p,svg:m,width:f,height:y}=ta(n,e)),Z=Wa(p,o),{margins:A,innerHeight:L,innerWidth:Y,legendListWidth:D,chartTitleHeight:S}=Ua(p,f,y,Z,A),X(),ea(n,f,y,p),G=le(),Ot(n,S,f,p),Ha(p,m,o,f,y,D,S,l,A,dt.rectangle,!1,u),te(),Q(),Le(),de()},X=()=>{try{b=Math.min(L,Y),H=.866*b}catch(he){Ce(ba,"initPyramidSideCalculations",he)}},le=()=>{try{return m.append("g").attr("transform",`translate(${A.left},${A.top+(L-H)/2})`)}catch(he){return Ce(ba,"initChartArea",he),null}},te=()=>{try{o=o.sort((he,q)=>{const J=he.data[0].value,M=q.data[0].value;return p.plotArea.flipPyramid?M-J:J-M}),I=T.sum(o,he=>Math.abs(he.data[0].value)),B=[0],o.forEach((he,q)=>{const J=Math.abs(he.data[0].value)/I*H;B.push(B[q]+J)})}catch(he){Ce(ba,"initPyramidData",he)}},Q=()=>{try{o.forEach((he,q)=>{try{const J=B[q],M=B[q+1];let x=p.plotArea.flipPyramid?1:0;const k=b*(x-B[q]/H),c=b*(x-B[q+1]/H),d=Y/2,i=G.append("g").attr("id","PyramidChart").attr("class","parentGroup"),h=p.animation.animationEnabled,v=i.append("polygon").attr("class","segment").attr("hoverId",he.legend.replace(/\s+/g,"-")).attr("data-series-id",he.legendUniqueId??he.legend).attr("data-dim-value",he.legend).attr("points",`
145
+ ${d-k/2},${J}
146
+ ${d+k/2},${J}
147
+ ${d+c/2},${M}
148
+ ${d-c/2},${M}
149
+ `).attr("fill",he.properties.color||"#4cb2ff").attr("opacity",h?0:1).on("mousemove",function(){try{xt([{key:he.legend,value:p.toolTip.toolTipNumberFormat==",.0%"?he.data[0].value?(Math.abs(he.data[0].value/I)*100).toFixed(nt(p.toolTip.toolTipDecimalPrecision))+"%":"":Qe(p.toolTip.toolTipDisplayUnits,p.toolTip.toolTipNumberFormat,p.toolTip.toolTipDecimalPrecision)(he.data[0].value)}],p,void 0,he.properties,Lt(r,String(he.legend??""),he.properties)),T.select(this).style("opacity",.8).style("stroke",p.chartArea.chartAreaColor).style("stroke-width","3px")}catch(a){Ce(ba,"drawPyramidChart.onMouseMove",a)}}).on("mouseout",function(){try{ct(),T.select(this).style("opacity",1).style("stroke","unset").style("stroke-width","unset")}catch(a){Ce(ba,"drawPyramidChart.onMouseOut",a)}});h&&v.transition().duration(p.animation.animationDuration).ease(tt[p.animation.animationEffect]).attr("opacity",1)}catch(J){Ce(ba,"drawPyramidChart.forEach",J)}})}catch(he){Ce(ba,"drawPyramidChart",he)}},de=he=>{try{if(p.annotation.annotationVisibility){let q=bt.annotation(),J=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"None",M=Ht(N,p,c=>c.data.measure);const x=p.annotation.connectorStyle?.toLowerCase();q.editMode(p.annotation.annotationDraggable).accessors({x:function(){return Y*.5},y:function(c,d){return c.y}}).on("dragend",function(c){try{M.forEach(d=>{d.data.legend===c.data.legend&&(d.dx=c._dx,d.dy=c._dy,d.width=f,d.height=y)}),s&&s(M.map(d=>({data:{legend:d.data.legend,isVisible:d.data.isVisible??!0},dx:d.dx,dy:d.dy,width:f,height:y}))),k.selectAll(".connector").attr("hoverId",d=>d.data.legend.replace(/\s+/g,"-")).style("stroke",p.annotation.connectorColor||"#ccc").attr("stroke-dasharray",Bt[x]),k.selectAll(`.connector-${J}`).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",Bt[x]).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){Ce(ba,"pyramidAnnotations.onDragEnd",d)}}).notePadding(0).annotations(M);let k=G.append("g").attr("class","annotation-group parentGroup").call(q);p.animation.animationEnabled&&k.attr("opacity",0).transition().duration(p.animation.animationDuration).ease(tt[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",Bt[x]),k.selectAll(`.connector-${J}`).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",Bt[x]).filter(c=>c._dx==0&&c._dy==0).remove(),k.selectAll(".connector-end").filter(c=>c.connector.end=="dot"&&c._dx==0&&c._dy==0).remove(),k.selectAll(".annotation-note-label").filter(c=>c.data&&!c.data.isVisible).style("display","none"),k.selectAll(".annotation-note-title").filter(c=>c.data&&!c.data.isVisible).style("display","none"),p.annotation.annotationType==qt.automatic&&k.selectAll(".annotation-note-content").attr("transform",function(){const d=T.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",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(ie.italic)?ie.italic:"").style("text-decoration",c=>c.data.labelFontStyle.includes(ie.underline)?ie.underline:"").style("font-weight",c=>c.data.labelFontStyle.includes(ie.bold)?ie.bold:"300").style("fill",c=>c.data.labelFontColor),p.plotArea.dataLabelValue&&k.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(ie.italic)?ie.italic:"").style("text-decoration",c=>c.data.valueFontStyle.includes(ie.underline)?ie.underline:"").style("font-weight",c=>c.data.valueFontStyle.includes(ie.bold)?ie.bold:"300").style("fill",c=>c.data.valueFontColor)}}catch(q){Ce(ba,"pyramidAnnotations",q)}},Le=()=>{try{let he=p.annotation.annotationType??"1",q=[he=="1"?"connector":""],J=p.annotation.connectorType?p.annotation.connectorType.toLowerCase():"none";const M=JSON.parse(JSON.stringify(p.plotArea.dataLabelsCoordinates||[])),x=new Map(M.map(k=>[k.data?.legend,k]));N=[],o.forEach((k,c)=>{try{const d=p.annotation.annotationVisibility,i=o.length-1;if(d===qt.none||d===qt.startOnly&&c!==0||d===qt.endOnly&&c!==i||d===qt.startAndEndBoth&&c!==0&&c!==i)return;let h={note:{title:p.plotArea.dataLabelName?k.properties.alias:"",label:p.plotArea.dataLabelNumberFormat==",.0%"?(Math.abs(k.data[0].value/I)*100).toFixed(nt(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:Y/2,y:Te(k,c,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:J,curve:Vl[p.annotation.connectorCurve]},disable:q,subject:{height:15,width:15},type:Nl[he],color:p.plotArea.dataLabelNameColor!=ze.black?p.plotArea.dataLabelNameColor:ze.black,height:f,width:f,index:c};const v=x.get(k.legend);v&&(h.dx=v.dx*f/(v.width||f),h.dy=v.dy*y/(v.height||y),h.data.isVisible=v.data?.isVisible??!0),N.push(h)}catch(d){Ce(ba,"prepareNewAnnotationsList.forEach",d)}})}catch(he){Ce(ba,"prepareNewAnnotationsList",he)}},Te=(he,q,J)=>{try{switch(J){case pi.top:return B[q]+30;case pi.middle:return(B[q]+B[q+1])/2+15;case pi.bottom:return B[q+1];default:return B[q]+30}}catch(M){return Ce(ba,"getYCordinate",M),0}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:n,id:l,style:{width:"100%",height:"100%"}})})},Fa="ProgressChart.tsx",Nr=({data:{ChartData:t},formatOptions:e,chartId:l,addLocalFilterFromLib:s,tooltipFormatter:u})=>{const r=Ne.useRef();let n=ft(t),o,p,m,f=40,y=Kt,S=[0,0],A,Z,L,Y,b,H,B,G;const I=1,D=0;Ne.useEffect(()=>{N()},[e]);const N=()=>{({chartFormatOptions:o,svg:b,width:p,height:m}=ta(r,e)),S=Wa(o,n),{margins:y,innerHeight:A,innerWidth:Z,legendListWidth:H,chartTitleHeight:f}=Ua(o,p,m,S,y),R(),ea(r,p,m,o),Y=da(b,y),Ot(r,f,p,o),Ha(o,b,n,p,m,H,f,l,y,dt.hollowCircle,!0,s),X(),le(),Ni(o,L,f,b,p,m)},R=()=>{try{B=Math.min(A*.45,Z*.45),G=Math.min(nt(o.plotArea.innerRadius)/100*B,B)}catch(Q){Ce(Fa,"setRadiusAndInnerRadius",Q)}},X=()=>{try{L=t[I].data[0].value+t[D].data[0].value}catch(Q){Ce(Fa,"initProgressChartData",Q)}},le=()=>{try{let Q=t[I].data[0].value,de=t[D].data[0].value,Le=Math.PI*2,Te=de/Q*Math.PI*2,he=o.plotArea.dataLabelValueFontStyle;const q=T.arc().innerRadius(G).outerRadius(B).startAngle(0).cornerRadius(nt(o.plotArea.cornerRadius));Y.append("path").attr("class","secondary-circle").attr("fill",t[I].properties.color).attr("fill-opacity",o.plotArea.opacityforProgressScale).attr("hoverId",M=>(t[I]?.properties?.alias||t[I]?.properties?.name||"Legend").replace(/\s+/g,"-")).attr("data-series-id",t[I].properties.legendUniqueId??t[I].properties.alias??"*").attr("data-dim-value",t[I].properties.alias??"*").attr("d",q({endAngle:Le})).on("mousemove",M=>{try{xt([{key:t[I].properties.alias,value:o.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":Qe(o.toolTip.toolTipDisplayUnits,o.toolTip.toolTipNumberFormatProgress,o.toolTip.toolTipDecimalPrecision)(Q)}],o,void 0,t[I].properties,Lt(u,String(t[I].properties?.alias??""),t[I].properties))}catch(x){Ce(Fa,"drawProgressChart.onMouseMove.secondary-circle",x)}}).on("mouseout",()=>{try{ct()}catch(M){Ce(Fa,"drawProgressChart.onMouseOut.secondary-circle",M)}}).attr("transform",te()),Y.append("path").attr("class","progress-circle").attr("fill",t[D].properties.color).attr("fill-opacity",o.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:Te})).on("mousemove",M=>{try{xt([{key:t[D].properties.alias,value:o.toolTip.toolTipNumberFormatProgress==",.0%"?Math.round(de/Q*100)+"%":Qe(o.toolTip.toolTipDisplayUnits,o.toolTip.toolTipNumberFormatProgress,o.toolTip.toolTipDecimalPrecision)(Q)},{key:t[I].properties.alias,value:o.toolTip.toolTipNumberFormatProgress==",.0%"?"100 %":Qe(o.toolTip.toolTipDisplayUnits,o.toolTip.toolTipNumberFormatProgress,o.toolTip.toolTipDecimalPrecision)(de)}],o,void 0,t[D].properties,Lt(u,String(t[D].properties?.alias??""),t[D].properties))}catch(x){Ce(Fa,"drawProgressChart.onMouseMove.progress-circle",x)}}).on("mouseout",()=>{try{ct()}catch(M){Ce(Fa,"drawProgressChart.onMouseOut.progress-circle",M)}}).attr("transform","translate("+Z/2+","+A/2+")").transition().duration(o.animation.animationEnabled?o.animation.animationDuration:0).ease(tt[o.animation.animationEffect]).attrTween("d",function(M){try{const x=T.interpolate(0,Te);return function(k){try{return q({endAngle:x(k)})}catch(c){return Ce(Fa,"drawProgressChart.attrTween.inner",c),""}}}catch(x){return Ce(Fa,"drawProgressChart.attrTween",x),()=>""}});const J=Y.append("text").attr("transform",te()).attr("dy","0.35em").attr("text-anchor","middle").attr("visibility",()=>o.plotArea.dataLabels&&tl([{value:de}],o,x=>x?.value??0).length>0?"visible":"hidden").attr("fill",o.plotArea.dataLabelValueColor!==ze.white?o.plotArea.dataLabelValueColor:o.toolTip.toolTipDisplayUnits).attr("font-style",he.includes(ie.italic)?ie.italic:"").attr("text-decoration",he.includes(ie.underline)?ie.underline:"").attr("font-weight",he.includes(ie.bold)?ie.bold:"").attr("font-family",o.plotArea.dataLabelValueFontFamily).attr("font-size",o.plotArea.dataLabelValueFontSize).text(()=>o.plotArea.dataLabelNumberFormatProgress==",.0%"?Math.round(de/Q*100)+"%":Qe(o.plotArea.plotAreaDisplayUnits,o.plotArea.dataLabelNumberFormatProgress,o.plotArea.dataLabelDecimalPrecision)(de));o.animation.animationEnabled&&J.attr("opacity",0).transition().duration(o.animation.animationDuration).ease(tt[o.animation.animationEffect]).attr("opacity",1)}catch(Q){Ce(Fa,"drawProgressChart",Q)}},te=()=>{try{return"translate("+Z/2+","+A/2+")"}catch(Q){return Ce(Fa,"getTransformString",Q),""}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:r,id:l,style:{width:"100%",height:"100%"}})})},Pr=({data:{ChartData:t},formatOptions:e,chartId:l})=>{const s=Ne.useRef(),u=ft(t);let r,n,o,p=40,m=Kt,f,y,S,A,Z,L,Y,b,H,B,G,I={},D;const N="Speedometer.tsx";Ne.useEffect(()=>{R()},[e]);const R=()=>{({chartFormatOptions:r,svg:A,width:n,height:o}=ta(s,e)),{margins:m,chartTitleHeight:p,innerHeight:f,innerWidth:y}=ni(r,o,n),X(),ea(s,n,o,r),S=da(A,m),Ot(s,p,n,r),te(),Q(),Le(),he()},X=()=>{try{let x;f*.8<y*.45?(Z=f*.8,x="width"):(Z=y*.45,x="height"),D=le(x),L=nt(r.plotArea.innerRadiusForSpeedometer)/100*Z}catch(x){Ce(N,"initChartRadius",x)}};function le(x){try{return x=="height"?`translate(${y/2},${f/2+Z/2})`:`translate(${y/2},${o-60})`}catch(k){return Ce(N,"centerTranslation",k),""}}const te=()=>{try{let x=t[0].data[0].value;x<0?(Y=0,b=x):(Y=x,b=0),r.customScaling.customScalingtoggle?B=100:B=nt(r.plotArea.ticks)}catch(x){Ce(N,"initSpeedometerData",x)}},Q=()=>{try{H=[];let x=nt(r.plotArea.ticks);if(r.customScaling.customScalingtoggle){for(let k=1;k<=x;k++){let c=r.customScaling[`share${k}`];if(H.length<100)for(let d=0;d<c;d++)H.push(r.customScaling[`division${k}`])}if(H.length<101)for(let k=H.length;k<100;k++)H.push(ze.black)}else if(r.colorScale.showColor==va.none){const k=t[0].properties?.color??"#bac8de";for(let c=1;c<=x;c++)H.push(k)}else if(r.colorScale.showColor==va.discrete)for(let k=1;k<=x;k++)H.push(r.colorScale["division"+k]);else{let k=r.colorScale.startColor,c=r.colorScale.endColor;const d=T.scaleLinear().domain([0,x]).range([k,c]);for(let i=0;i<x;i++)H.push(d(i))}}catch(x){Ce(N,"initColorTheme",x)}},de=(x,k,c)=>{try{let d=[],i=Math.abs(x)-Math.abs(k),h=Math.abs(i)/c,v=k>0?0:k;d.push(v);for(let a=0;a<c-1;a++)v+=parseFloat(h.toFixed(5)),v.toFixed(5)<=Math.abs(x)&&d.push(v);return d.push(d.includes(x)?0:x),d}catch(d){return Ce(N,"setTickValues",d),[]}},Le=()=>{try{switch(r.plotArea.dataLabelsOptions){case qt.automatic:G=Te();break;case qt.startOnly:G=[b];break;case qt.endOnly:let k=Array(B).fill("");k[B]=Y,G=k;break;case qt.startAndEndBoth:let c=Array(B).fill("");c[B]=Y,c[0]=b,G=c;break;case qt.none:G=[];break}}catch(x){Ce(N,"setDataLabelsOptions",x)}},Te=()=>{try{let x,k=nt(r.plotArea.ticks),c=de(Y,b,B);if(r.customScaling.customScalingtoggle){let d=Array(100).fill("");d[0]=b;let i=0;for(let h=1;h<=k;h++){let v=parseInt(r.customScaling[`share${h}`]);if(i+=v,i>=100)break;d[i]=c[i]}d[99]=Y,x=d}else x=c;return x}catch(x){return Ce(N,"initTicksValues",x),[]}},he=()=>{try{let k=function(c,d){try{let i=function(Ye){try{return Ye*Math.PI/180}catch(O){return Ce(N,"deg2rad",O),0}},h=function(Ye){try{let O;for(O in Ye)ye[O]=Ye[O];g=ye.maxAngle-ye.minAngle,ce=Math.round(Z*ye.pointerHeadLengthPercent),ve=T.scaleLinear().range([0,1]).domain([ye.minValue,ye.maxValue]),me=T.arc().innerRadius(L).outerRadius(Z).startAngle((Fe,We)=>{let Ue=1/ye.majorTicks*We;return i(ye.minAngle+Ue*g)}).endAngle((Fe,We)=>{let Ue=1/ye.majorTicks*(We+1);return i(ye.minAngle+Ue*g)})}catch(O){Ce(N,"configure",O)}},v=function(Ye,O){try{if(O===0){S.append("g").attr("class","arc").attr("transform",D).attr("data-series-id","*").attr("data-dim-value","*").selectAll("path").data(H).enter().append("path").attr("fill",$e=>$e).attr("stroke",$e=>$e).attr("d",me);let ke=Y,De=S.append("g").attr("class","label").attr("transform",D);if(De.selectAll("text").data(G).enter().append("text").attr("transform",function($e,ge){let we=g/ye.majorTicks*ge;return"rotate("+(ye.minAngle+we)+") translate(0,"+(ye.labelInset-Z)+")"}).attr("text-anchor","middle").attr("font-size",r.plotArea.dataLabelValueFontSize).attr("fill",r.plotArea.dataLabelValueColor!==ze.white?r.plotArea.dataLabelValueColor:"none").attr("font-style",r.plotArea.dataLabelValueFontStyle.includes(ie.italic)?ie.italic:"").attr("text-decoration",r.plotArea.dataLabelValueFontStyle.includes(ie.underline)?ie.underline:"").attr("font-weight",r.plotArea.dataLabelValueFontStyle.includes(ie.bold)?ie.bold:"").attr("font-family",r.plotArea.dataLabelValueFontFamily).text($e=>r.plotArea.dataLabelNumberFormat==",.0%"?z=Math.round($e/ke*100)+"%":Qe(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)($e)).attr("visibility",$e=>$e===""?"hidden":"visible"),r.animation.animationEnabled){const $e=r.animation.animationDuration,ge=tt[r.animation.animationEffect];De.selectAll("text").attr("opacity",0).attr("transform",function(we,C){const j=g/ye.majorTicks*C;return`rotate(${ye.minAngle+j}) translate(0, ${ye.labelInset-Z+20})`}).transition().duration($e).ease(ge).attr("opacity",1).attr("transform",function(we,C){const j=g/ye.majorTicks*C;return`rotate(${ye.minAngle+j}) translate(0, ${ye.labelInset-Z})`})}}r.pointerValue.showPointerValue&&u.length===2&&J(D);let Fe=[[ye.pointerWidth/2,0],[0,-ce],[-(ye.pointerWidth/2),0],[0,ye.pointerTailLength],[ye.pointerWidth/2,0]],We=T.line().curve(T.curveLinear);ne=S.append("g").data([Fe]).attr("class","pointer").attr("transform",D).append("path").attr("d",O>0?We:null).attr("transform","rotate("+ye.minAngle+")").attr("fill",r.plotArea.pointerColor).on("mousemove",(xe,ke)=>{xt([{key:`${t[O].data[0].legend}`,value:r.plotArea.dataLabelNumberFormat==",.0%"?Math.round(t[O].data[0].value/Me[Me.length-1]*100)+"%":Qe(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(t[O].data[0].value)}],r,void 0,{markerColor:"blue",markerShape:"circle"})}).on("mouseout",()=>{ct()}),ne.selectAll("text").append("text").text(ye.maxValue),a(Ye===void 0?0:Ye)}catch(Fe){Ce(N,"gauge.render",Fe)}},a=function(Ye,O){try{O!==void 0&&h(O);let Fe=ve(Ye),We=ye.minAngle+Fe*g;ne.transition().duration(r.animation.animationEnabled?r.animation.animationDuration:0).ease(tt[r.animation.animationEffect]).attr("transform","rotate("+We+")")}catch(Fe){Ce(N,"gauge.update",Fe)}},g,P,ce,z,me,ve,Me,Pe,ne,Be,ye={clipWidth:y,clipHeight:f,ringInset:20,ringWidth:20,pointerWidth:10,pointerTailLength:5,pointerHeadLengthPercent:nt(r.plotArea.pointerHeadLength)/10,minValue:b,maxValue:Y,minAngle:-90,maxAngle:90,transitionMs:0,majorTicks:B,labelFormat:Ye=>Qe(r.plotArea.plotAreaDisplayUnits,r.plotArea.dataLabelNumberFormat,r.plotArea.dataLabelDecimalPrecision)(Ye),labelInset:-5};return I.configure=h,I.render=v,I.update=a,h(d),I}catch(i){Ce(N,"gauge",i)}}("#power-gauge",{clipWidth:y,clipHeight:f,ringWidth:2.75*nt(r.plotArea.innerRadiusForSpeedometer),ringInset:20,maxValue:Y,transitionMs:0});if(u.length>0)for(let c=0;c<u.length;c++)k.render(q(u[c],c),c)}catch(x){Ce(N,"initSpeedometer",x)}};function q(x,k){try{let c=Y,d=x.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 Ce(N,"setPointerofSpeedometer",c),0}}function J(x){try{let k="";if(r.pointerValue.kpiAlias)k=r.pointerValue.kpiAliasText;else switch(r.pointerValue.connectorKPIforSpeedometer){case ai.PointerValue:k="Pointer Value";break;case ai.Absolute:k="Absolute Value";break;case ai.CAGR:k="CAGR";break;case ai.PercentageGrowth:k="Percentage Growth";break}let c=r.pointerValue.pointerValueFontStyle;S.selectAll(".pointerValueText").remove(),S.append("g").attr("class","pointerValueText").attr("transform",x).selectAll("text").data(["chartData.dataArray[1].maximumMeasure"]).enter().append("text").attr("dy","24").attr("text-anchor","middle").attr("font-size",r.pointerValue.pointerValueFontSize).attr("fill",r.pointerValue.pointerValueColor!==ze.white?r.pointerValue.pointerValueColor:"none").attr("font-style",c.includes(ie.italic)?ie.italic:"").attr("text-decoration",c.includes(ie.underline)?ie.underline:"").attr("font-weight",c.includes(ie.bold)?ie.bold:"").attr("font-family",r.pointerValue.pointerValueFontFamily).text(i=>`${k}: ${!r.pointerValue.pointerValueAlias&&i!=0?M(t[0].data[0].value,t[1].data[0].value):r.pointerValue.pointerValueAliasText}`).attr("visibility",r.plotArea.dataLabels?"visible":"hidden")}catch(k){Ce(N,"setPointerValueText",k)}}function M(x,k){try{let c=x-k,d=1,i=parseInt(r.pointerValue.connectorKPIforSpeedometer),h,v;const a=r.pointerValue.pointerValueDecimalPrecision;switch(i){case 1:c=k;break;case 2:c=Math.abs(c);break;case 3:return h=`.${a}%`,c=Math.pow(k/x,1/d)-1,v=T.format(h)(c),v;case 4:return h=`.${a}%`,c=Math.round(k/x*100-100)/100,v=T.format(h)(c),v}return isNaN(c)&&(c=0),Qe(r.pointerValue.pointerValueDisplayUnits,r.pointerValue.pointerValueNumberFormat,a)(c)}catch(c){return Ce(N,"connectorNumberFormat",c),""}}return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:s,id:l,style:{width:"100%",height:"100%"}})})};function Ia(t,e,l){console.error(`[${t}][${e}]`,l)}const Ir=({data:{ChartData:t},formatOptions:e,chartId:l,addLocalFilterFromLib:s,tooltipFormatter:u})=>{const r=Ne.useRef(),n=ft(t);let o,p,m,f=40,y=Kt,S=[0,0],A,Z,L,Y,b,H;Ne.useEffect(()=>{B()},[e]);const B=()=>{({chartFormatOptions:o,svg:Y,width:p,height:m}=ta(r,e)),G(),{margins:y,innerHeight:A,innerWidth:Z,legendListWidth:H,chartTitleHeight:f}=Ua(o,p,m,S,y),S=Wa(o,n),ea(r,p,m,o),L=da(Y,y),Ot(r,f,p,o),Ha(o,Y,n,p,m,H,f,l,y,dt.hollowCircle,!1,s),D()},G=()=>{try{b=0,n.forEach(R=>{b+=R.data[0].value})}catch(R){Ia("RadialBarChart.tsx","loopOverChartData",R)}},I=R=>{try{switch(o.plotArea.dataLabelsOptions){case qt.automatic:return R.map((le,te)=>({...le,index:te}));case qt.startOnly:return[{...R[0],index:0}];case qt.endOnly:return[{...R[R.length-1],index:R.length-1}];case qt.startAndEndBoth:return[{...R[0],index:0},{...R[R.length-1],index:R.length-1}];case qt.none:return[]}}catch(X){return Ia("RadialBarChart.tsx","getModifiedDataForLabels",X),R}},D=()=>{try{let R=function(Pe,ne){try{const Be=T.interpolate(0,d(Math.abs(Pe.data[0].value)));return ye=>ce({...Pe,endAngle:Be(ye)},ne)}catch(Be){Ia("RadialBarChart.tsx","arcTween",Be)}},X=function(Pe){try{return Pe*180/M}catch(ne){Ia("RadialBarChart.tsx","radTodeg",ne)}},le=function(Pe){try{return Pe*Math.PI/180}catch(ne){Ia("RadialBarChart.tsx","degToRad",ne)}},te=function(Pe){try{return x+(g-(Pe+1))*(P+k)}catch(ne){Ia("RadialBarChart.tsx","getInnerRadius",ne)}},Q=function(Pe){try{return te(Pe)+P}catch(ne){Ia("RadialBarChart.tsx","getOuterRadius",ne)}},de=n.length>1?T.max(n,Pe=>Pe.data[0].value)*1.1:t[0].data[0].value*1.1,Le=o.plotArea.dataLabelValueFontStyle,Te=Qe(o.plotArea.plotAreaDisplayUnits,o.plotArea.axialAxisDataLabelNumberFormat,o.plotArea.axialAxisDataLabelDecimalPrecision)(de),he=o.plotArea.axialAxis?Ut(Te,nt(o.plotArea.axialAxisDataLabelFontSize),o.plotArea.axialAxisDataLabelFontFamily).width+10:20;const q=Math.min(A*.5,Z*.5)-he;let J=L.append("g").attr("transform",N()).attr("width",Z).attr("height",A);const M=Math.PI,x=n.length>1?10:70,k=nt(o.plotArea.arcPadding),c=nt(o.plotArea.axialTicks);let d=T.scaleLinear().domain([0,de]).range([0,le(360)]),i=d.ticks(c);i[i.length-1]==de&&i.pop();let h=i,v=n.map((Pe,ne)=>Pe.data[0].legend),a=n.reduce((Pe,ne)=>Pe+ne.data[0].value,0);const g=v.length,P=(q-x-g*k)/g;let ce=T.arc().innerRadius((Pe,ne)=>te(ne)).outerRadius((Pe,ne)=>Q(ne)).startAngle(0).endAngle(Pe=>Pe.endAngle),z=T.arc().innerRadius((Pe,ne)=>te(ne)).outerRadius((Pe,ne)=>Q(ne)).startAngle(0).endAngle(le(360)),me=J.append("g").attr("class","r axis").selectAll("g").data(t).enter().append("g");o.plotArea.axialGrid&&me.append("circle").attr("r",(Pe,ne)=>Q(ne)+k).attr("stroke","#d3d3d3").attr("stroke-width",1).attr("fill","none");let ve=J.append("g").attr("class","a axis").selectAll("g").data(h).enter().append("g").attr("transform",Pe=>"rotate("+(X(d(Pe))-90)+")");o.plotArea.axialGrid&&ve.append("line").attr("x2",q).attr("stroke","#a9a9a9").attr("stroke-width",1),ve.append("text").attr("x",q+10).attr("class","text-xs text-gray-600").style("text-anchor",Pe=>d(Pe)>=M&&d(Pe)<2*M?"end":null).attr("transform",Pe=>"rotate("+(90-X(d(Pe)))+","+(q+10)+",0)").text(Pe=>Qe(o.plotArea.plotAreaDisplayUnits,o.plotArea.axialAxisDataLabelNumberFormat,o.plotArea.axialAxisDataLabelDecimalPrecision)(Pe)).attr("fill",o.plotArea.axialAxisDataLabelColor!==ze.white?o.plotArea.axialAxisDataLabelColor:"none").style("font-size",o.plotArea.axialAxisDataLabelFontSize).style("font-family",o.plotArea.axialAxisDataLabelFontFamily).attr("font-style",o.plotArea.axialAxisDataLabelFontStyle.includes(ie.italic)?ie.italic:"").attr("text-decoration",o.plotArea.axialAxisDataLabelFontStyle.includes(ie.underline)?ie.underline:"").attr("font-weight",o.plotArea.axialAxisDataLabelFontStyle.includes(ie.bold)?ie.bold:"").attr("visibility",o.plotArea.axialAxis?"visible":"hidden");let Me=J.attr("class","data").selectAll("path").data(t).enter().append("path").attr("class","parentGroup").attr("hoverId",Pe=>Pe.data[0].legend.replaceAll(" ","-")).attr("data-series-id",Pe=>Pe.properties.legendUniqueId??Pe.data[0].legend).attr("data-dim-value",Pe=>Pe.data[0].legend).attr("fill",Pe=>Pe.properties.color).attr("d",(Pe,ne)=>ce({...Pe,endAngle:0},ne)).on("mousemove",(Pe,ne)=>{xt([{key:o.yAxisTitle.yAxisTitleText,value:o.toolTip.toolTipNumberFormatProgress==",.0%"?(Math.abs(ne.data[0].value/a)*100).toFixed(nt(o.toolTip.toolTipDecimalPrecision))+"%":Qe(o.toolTip.toolTipDisplayUnits,o.toolTip.toolTipNumberFormatProgress,o.toolTip.toolTipDecimalPrecision)(ne.data[0].value)},{key:"Legend",value:ne.properties.alias}],o,void 0,ne.properties,Lt(u,String(ne.data[0]?.legend??""),ne.properties))}).on("mouseout",()=>{ct()});if(o.animation.animationEnabled?Me.transition().duration(o.animation.animationDuration).ease(tt[o.animation.animationEffect]).attrTween("d",R):Me.attr("d",(Pe,ne)=>ce({...Pe,endAngle:d(Math.abs(Pe.data[0].value))},ne)),o.plotArea.dataLabels){const Pe=tl(I(t),o,Be=>Be?.data?.[0]?.value??0),ne=J.selectAll(".arc-label-"+l).data(Pe).enter().append("text").attr("class","arc-label-"+l).attr("class","parentGroup").attr("text-anchor","start").attr("dy",(Be,ye)=>(Q(Be.index??ye)-te(Be.index??ye))/1.75);ne.append("textPath").attr("xlink:href",(Be,ye)=>`#arc-path-${Be.index??ye}-`+l).style("startOffset","50%").attr("hoverId",Be=>Be.legend.replaceAll(" ","-")).text(Be=>`  ${Be.properties.alias}
150
+  ${o.plotArea.dataLabelValue?Qe(o.plotArea.plotAreaDisplayUnits,o.plotArea.dataLabelNumberFormat,o.plotArea.dataLabelDecimalPrecision)(Be.data[0].value):""}`).attr("fill",o.plotArea.dataLabelValueColor!==ze.white?o.plotArea.dataLabelValueColor:"none").style("font-size",o.plotArea.dataLabelValueFontSize).style("font-family",o.plotArea.dataLabelValueFontFamily).attr("font-style",Le.includes(ie.italic)?ie.italic:"").attr("text-decoration",Le.includes(ie.underline)?ie.underline:"").attr("font-weight",Le.includes(ie.bold)?ie.bold:"").on("mousemove",(Be,ye)=>{xt([{key:o.yAxisTitle.yAxisTitleText,value:Qe(o.toolTip.toolTipDisplayUnits,o.toolTip.toolTipNumberFormat,o.toolTip.toolTipDecimalPrecision)(ye.data[0].value)},{key:"Legend",value:ye.properties.alias}],o,Be,ye.properties,Lt(u,String(ye.data[0]?.legend??""),ye.properties))}).on("mouseout",()=>{ct()}),o.animation.animationEnabled&&ne.attr("opacity",0).transition().duration(o.animation.animationDuration).ease(tt[o.animation.animationEffect]).attr("opacity",1),Me.each((Be,ye)=>{J.append("path").attr("id",`arc-path-${ye}-`+l).attr("d",z(Be,ye)).attr("fill","none").attr("stroke","none")})}}catch(R){Ia("RadialBarChart.tsx","initRadialBarChart",R)}},N=()=>{try{return`translate(${Z/2},${A/2})`}catch(R){Ia("RadialBarChart.tsx","getPiePosition",R)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:r,id:l,style:{width:"100%",height:"100%"}})})},ga="WordCloud.tsx",Er=({data:{ChartData:t},formatOptions:e,chartId:l,tooltipFormatter:s})=>{const u=Ne.useRef();let r=ft(t),n,o,p,m=Number.MAX_VALUE,f=Number.MIN_VALUE,y=40,S=Kt,A,Z,L,Y,b,H=0;Ne.useEffect(()=>{B()},[e]);const B=()=>{({chartFormatOptions:n,svg:Y,width:o,height:p}=ta(u,e)),{margins:S,chartTitleHeight:y,innerHeight:A,innerWidth:Z}=ni(n,p,o),ea(u,o,p,n),L=da(Y,S),Ot(u,y,o,n),G(),I()},G=()=>{try{H=0,r=r.map(D=>{let N=D.data[0].value;return H+=N,n.plotArea.hideZeroValues&&N==0?null:(N<m&&(m=N),N>f&&(f=N),D)}),r=r.filter(D=>D!==null),b=T.scaleLinear().domain([m,f]).range([12,70])}catch(D){Ce(ga,"calculateWordCloudData",D)}},I=()=>{try{let D=function(le){try{L.append("g").attr("transform","translate("+X.size()[0]/2+","+X.size()[1]/2+")").selectAll("text").data(le).enter().append("text").attr("font-size",function(te){try{return b(te.data[0].value)+"px"}catch(Q){return Ce(ga,"draw-font-size",Q),"12px"}}).attr("text-anchor","middle").style("font-family",n.text.textFontFamily).attr("fill",function(te){try{return te.properties.color!==ze.white?te.properties.color:"none"}catch(Q){return Ce(ga,"draw-fill",Q),"none"}}).attr("transform",function(te){try{return"translate("+[te.x,te.y]+")rotate("+te.rotate+")"}catch(Q){return Ce(ga,"draw-transform",Q),""}}).text(function(te){try{return te.properties.alias}catch(Q){return Ce(ga,"draw-text",Q),""}}).attr("data-series-id",te=>te.properties.legendUniqueId??te.properties.alias).attr("data-dim-value",te=>te.properties.alias).on("mousemove.text",(te,Q)=>{try{xt([{key:Q.properties.alias,value:Qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(Q.data[0].value)},{key:Q.properties.measureUniqueId,value:H}],n,void 0,Q.properties,Lt(s,String(Q.properties.alias??""),Q.properties))}catch(de){Ce(ga,"draw-mousemove",de)}}).on("mouseout.text",()=>{try{ct()}catch(te){Ce(ga,"draw-mouseout",te)}})}catch(te){Ce(ga,"draw",te)}},N=n.text.textSpacing,R=n.text.textRotation,X=Tl().size([Z,A]).words(r).padding(N).rotate(function(){try{return Math.round(Math.random())*R}catch(le){return Ce(ga,"rotate",le),0}}).random(()=>.5).font(n.text.textFontFamily).fontWeight("bolder").fontSize(function(le){try{return b(le.data[0].value)}catch(te){return Ce(ga,"fontSize",te),12}}).text(function(le){try{return le.properties.alias}catch(te){return Ce(ga,"text",te),""}}).on("end",D);X.start()}catch(D){Ce(ga,"drawWordCloudChart",D)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:u,id:l,style:{width:"100%",height:"100%"}})})},Rr=({data:t,formatOptions:e,chartId:l})=>{const s=Ne.useRef();let u=ft(t),r,n,o,p=40,m=Kt,f,y,S,A=[0,0],Z,L;Ne.useEffect(()=>{Y()},[e]);const Y=()=>{({chartFormatOptions:r,svg:L,width:n,height:o}=ta(s,e)),A=H(),{margins:m,innerHeight:f,innerWidth:y,legendListWidth:S,chartTitleHeight:p}=Ua(r,n,o,A,m,!0),ea(s,n,o,r),Z=da(L,m),Ot(s,p,n,r),b(),B()},b=()=>{try{let G=r.plotArea.dataLabelNameFontStyle,I=r.plotArea.dataLabelValueFontStyle,D=Z.attr("class","vennContainer");D&&D.datum(t).call(Sl.VennDiagram().width(y).height(f)),D&&D.selectAll(".venn-circle path").style("fill-opacity",r.plotArea.opacity),r.plotArea.dataLabelName?(D&&D.selectAll(".venn-circle text").html(""),D&&D.selectAll(".venn-circle text").append("tspan").style("font-family",r.plotArea.dataLabelNameFontFamily).style("fill",r.plotArea.dataLabelNameColor).style("font-size",r.plotArea.dataLabelNameFontSize+"px").style("font-style",G.includes(ie.italic)?ie.italic:"").attr("text-decoration",G.includes(ie.underline)?ie.underline:"").style("font-weight",G.includes(ie.bold)?ie.bold:"").html(N=>N.label).attr("visibility",r.plotArea.dataLabelName?"visible":"hidden")):(D&&D.selectAll(".venn-circle text").style("visibility","hidden"),D&&D.selectAll(".venn-circle text").html("")),r.plotArea.dataLabelValue&&D&&D.selectAll(".venn-circle text").append("tspan").attr("font-size",r.plotArea.dataLabelValueFontSize).attr("fill",r.plotArea.dataLabelValueColor!==ze.white?r.plotArea.dataLabelValueColor:"none").style("font-style",I.includes(ie.italic)?ie.italic:"normal").attr("text-decoration",I.includes(ie.underline)?ie.underline:"none").style("font-weight",I.includes(ie.bold)?ie.bold:"normal").attr("font-family",r.plotArea.dataLabelValueFontFamily).attr("fill-opacity",.5).html(N=>N.actualValue!==void 0?(r.plotArea.dataLabelName?" : ":"")+T.format(r.plotArea.dataLabelNumberFormat)(N.actualValue):"").attr("visibility",r.plotArea.dataLabelValue?"visible":"hidden"),r.plotArea.intersectionLabelVisibility?(D&&D.selectAll(".venn-intersection text").html(""),D&&D.selectAll(".venn-intersection text").append("tspan").style("font-family",r.plotArea.dataLabelNameFontFamily).style("fill",r.plotArea.dataLabelNameColor).style("font-size",r.plotArea.dataLabelNameFontSize+"px").style("font-style",G.includes(ie.italic)?ie.italic:"").attr("text-decoration",G.includes(ie.underline)?ie.underline:"").style("font-weight",G.includes(ie.bold)?ie.bold:"").html(N=>N.label).attr("visibility",r.plotArea.intersectionLabelVisibility?"visible":"hidden")):(D&&D.selectAll(".venn-intersection text").style("visibility","hidden"),D&&D.selectAll(".venn-intersection text").html("")),r.plotArea.intersectionValueVisibility&&D&&D.selectAll(".venn-intersection text").append("tspan").attr("font-size",r.plotArea.dataLabelValueFontSize).attr("fill",r.plotArea.dataLabelValueColor!==ze.white?r.plotArea.dataLabelValueColor:"none").style("font-style",I.includes(ie.italic)?ie.italic:"normal").attr("text-decoration",I.includes(ie.underline)?ie.underline:"none").style("font-weight",I.includes(ie.bold)?ie.bold:"normal").attr("font-family",r.plotArea.dataLabelValueFontFamily).attr("font-weight",300).attr("fill-opacity",.5).html(N=>N.actualValue!==void 0?(r.plotArea.dataLabelName?" : ":"")+T.format(r.plotArea.dataLabelNumberFormat)(N.actualValue):"").attr("visibility",r.plotArea.intersectionValueVisibility?"visible":"hidden"),D&&D.selectAll(".venn-circle path").style("fill",N=>N.properties?N.properties.color:null),D&&D.selectAll("g").on("mousemove",function(N,R){xt([{key:R.label,value:Qe(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(R.size)}],r,void 0,R.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,R){ct();var X=T.select(this).transition("tooltip").duration(400);X.select("path").style("stroke-width",0).style("stroke-opacity",0)})}catch(G){Ce("VennChart.tsx","drawVennDiagramChart",G)}},H=()=>{try{let G=0,I=0;return u.forEach(D=>{if(D.legendDisplay){let N=Ut(D.legendDisplay+" : "+D.actualValue,nt(r.legends.legendFontSize),r.legends.legendFontFamily);G=Math.max(G,N.width),I=Math.max(I,N.height)}}),[G,I]}catch(G){return Ce("VennChart.tsx","calculateLegendsMaxPossibleWidth",G),[0,0]}},B=()=>{try{let G=r.legends.legendPosition,I=r.legends.legendAlignmentTopBottom,D=r.legends.legendAlignment;switch(G){case Ze.none:break;case Ze.right:ha(L,u,n-S-25,p+5,S+15,o-p-10,G,D,dt.none,r,l,!0);break;case Ze.top:ha(L,u,5,p+5,n-10,30,G,I,dt.none,r,l,!0);break;case Ze.left:ha(L,u,5,m.top,S+15,o-p-10,G,D,dt.none,r,l,!0);break;case Ze.bottom:ha(L,u,5,o-35,n-10,30,G,I,dt.none,r,l,!0);break}}catch(G){Ce("VennChart.tsx","initLegendListWithTotalValueAllowance",G)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:s,id:l,style:{width:"100%",height:"100%"}})})},zr=({formatOptions:t,data:e,chartId:l,onElementClick:s,vfxPickModeActive:u,tooltipFormatter:r})=>{if(!e)return null;let n=e?.sankeyLinks?JSON.parse(JSON.stringify(e.sankeyLinks)):[],o=e?.sankeyNodes?JSON.parse(JSON.stringify(e.sankeyNodes)):[];const p=Ne.useRef(),m=Ne.useRef(s);m.current=s;const f=Ne.useRef(u);f.current=u;let y,S,A,Z=40,L=Kt,Y,b,H,B,G=si.left,I=0,D=!1,N=new Map,R=new Map,X=.8,le=.8;Ne.useEffect(()=>{te()},[t]);const te=()=>{({chartFormatOptions:y,svg:B,width:S,height:A}=ta(p,t)),{margins:L,chartTitleHeight:Z,innerHeight:Y,innerWidth:b}=ni(y,A,S),Q(),ea(p,S,A,y),H=da(B,L),Ot(p,Z,S,y),Te()},Q=()=>{try{X=nt(y.nodes.nodesFillOpacity),le=nt(y.links.linksFillOpacity),o.forEach(x=>{x.totalValue=0}),o.forEach(x=>n.forEach(k=>(x.name==k.source||x.name==k.target)&&(x.totalValue=(x.totalValue||0)+k.value))),o=o.filter(x=>x.totalValue!=0),n=n.filter(x=>x.value!=0);let J=he(n),M=new Map;J.forEach(x=>{x.nodes.forEach(k=>{M.set(k,x.layer)})}),o.forEach(x=>{let k=M.get(x.name);N.set(k,(N.get(k)||0)+x.totalValue)}),o.forEach(x=>{R.set(x.name,x.totalValue/N.get(M.get(x.name))*100)}),de(J)}catch(J){Ce("SankeyChart.tsx","prepareDataForSankey",J)}},de=J=>{try{D=y.nodes.nodesLabelWrap,G=y.nodes.nodesLabelVisibility?y.nodes.sankeyChartType:"None";let M="",x=0;o.forEach(d=>{M=d.name.length>M.length?d.name:M,x=d.totalValue.toString().length>x.toString().length?d.totalValue:x});let k=Ut(M,nt(y.nodes.nodesLabelFontSize),y.nodes.nodesLabelFontFamily),c=Ut(Qe(y.nodes.nodesLabelDisplayUnits,y.nodes.nodeLabelNumberFormat,y.nodes.nodeLabelDecimalPrecision)(x),nt(y.nodes.nodesLabelFontSize),y.nodes.nodesLabelFontFamily);I=Math.max(k.width,c.width)+6,D&&(I=Math.min(b*.1,I))}catch(M){Ce("SankeyChart.tsx","calculateMaxNodeValueWidth",M)}},Le=(J,M)=>{try{let x=y.nodes.spacing!==void 0?nt(y.nodes.spacing)*1.5:15,k=y.nodes.sankeyNodeWidth!==void 0?y.nodes.sankeyNodeWidth:10,c=[],d=[];switch(G){case si.center:c=[1,5],d=[b,Y];break;case si.right:c=[1,5],d=[b-I,Y];break;case si.left:c=[I,5],d=[b,Y];break;default:c=[1,5],d=[b,Y];break}return Pi.sankey().nodeId(h=>h.name).nodeAlign(Pi.sankeyJustify).nodeWidth(k).nodePadding(x).extent([c,d]).nodeSort(null)({nodes:J.map(h=>Object.assign({},h)),links:M.map(h=>Object.assign({},h))})}catch(x){return Ce("SankeyChart.tsx","getsankey",x),{nodes:[],links:[]}}},Te=()=>{try{let J=function(){try{const v={};c.forEach(a=>{const g=a.x0;v[g]||(v[g]=[]),v[g].push(a)}),Object.keys(v).forEach(a=>{const g=v[a];if(g.length===0)return;g.sort((ve,Me)=>ve.y0-Me.y0);const P=g[0],ce=g[g.length-1],z=P.y1-P.y0,me=ce.y1-ce.y0;if(P.y0=0,P.y1=z,ce.y1=Y,ce.y0=Y-me,g.length>2){const ve=g.slice(1,g.length-1),Me=ce.y0-P.y1,Pe=T.sum(ve,ye=>ye.y1-ye.y0),ne=(Me-Pe)/(ve.length+1);let Be=P.y1+ne;ve.forEach(ye=>{const Ye=ye.y1-ye.y0;ye.y0=Be,ye.y1=Be+Ye,Be+=Ye+ne})}})}catch(v){Ce("SankeyChart.tsx","centerAlignNodesByLayer",v)}},M=function(){try{c.forEach(v=>{let a=0,g=0;v.sourceLinks.forEach(P=>{P.sy=a,a+=P.width}),v.targetLinks.forEach(P=>{P.ty=g,g+=P.width})})}catch(v){Ce("SankeyChart.tsx","arrangeFlows",v)}},x=function(v){return function(a){try{const g=a.source.x1,P=a.source.y0+a.sy+a.width/2,ce=a.target.x0,z=a.target.y0+a.ty+a.width/2,me=ce-g,ve=g+me*v,Me=ce-me*v;return`M${g},${P} C${ve},${P} ${Me},${z} ${ce},${z}`}catch(g){return Ce("SankeyChart.tsx","sankeyLinkCustom",g),""}}},k=y.nodes.curviness!==void 0?y.nodes.curviness!=="0"?y.nodes.curviness:.1:.5;const{nodes:c,links:d}=Le(o,n);M(),J(),M(),M();const i=H.append("g").selectAll("rect").data(c).enter().append("rect").style("fill-opacity",X).attr("id",v=>"Node"+v.index).attr("class","sankey-nodes").attr("stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none").attr("stroke-width",y.nodes.nodesBorderVisibility?y.nodes.nodesBorderThickness:0).attr("x",v=>v.x0).attr("y",v=>v.y0).attr("height",v=>v.y1-v.y0).attr("width",v=>v.x1-v.x0).attr("fill",v=>v.color?v.color:ze.white).on("mousemove",function(v,a){try{y.toolTip.toolTipVisibility&&xt([{key:a.name.split("~$~")[1],value:y.toolTip.toolTipNumberFormat==",.0%"?R.get(a.name)+"%":Qe(y.toolTip.toolTipDisplayUnits,y.toolTip.toolTipNumberFormat,y.toolTip.toolTipDecimalPrecision)(a.value)}],y,void 0,{markerShape:"square",markerColor:a.color},Lt(r,String(a.name.split("~$~")[1]??""),{alias:a.name.split("~$~")[1],markerColor:a.color})),H.selectAll(".sankey-nodes").style("fill-opacity",.1).style("stroke","none"),H.selectAll(".sankey-nodes-texts").style("opacity","0"),H.selectAll(".sankey-links").style("stroke-opacity",.1),H.select(`#Node${a.index}`).style("stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none").style("fill-opacity",X).style("cursor","pointer"),H.select(`#Label${a.index}`).style("opacity",1),a.sourceLinks.forEach(g=>{H.select(`#Node${g.target.index}`).style("fill-opacity",X).style("stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none"),H.select(`#Link${g.index}`).style("stroke-opacity",le),H.select(`#Label${g.target.index}`).style("opacity",1)}),a.targetLinks.forEach(g=>{H.select(`#Node${g.source.index}`).style("fill-opacity",X).style("stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none"),H.select(`#Link${g.index}`).style("stroke-opacity",le),H.select(`#Label${g.source.index}`).style("opacity",1)})}catch(g){Ce("SankeyChart.tsx","Nodes.onMouseMove",g)}}).on("mouseout",function(v){try{H.selectAll(".sankey-nodes").style("fill-opacity",X).style("stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none"),H.selectAll(".sankey-links").style("stroke-opacity",le),H.selectAll(".sankey-nodes-texts").style("opacity","1"),y.toolTip.toolTipVisibility&&ct()}catch(a){Ce("SankeyChart.tsx","Nodes.onMouseOut",a)}}).attr(rt.SeriesId,v=>String(v.name??"")).attr(rt.DimValue,v=>String(v.name??"")).on("click",kt(f,m,(v,a)=>{const g=String(a.name??"");return{seriesId:g,dimValue:g,legendUniqueId:g,seriesDisplayName:g.includes("~$~")?g.split("~$~")[1]:g}}));if(H.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",le).attr("id",v=>"Link"+v.index).attr("d",x(k)).attr("stroke",v=>y.links.linksColor==="Source"?v.source.color:v.target.color).attr("stroke-width",v=>Math.max(1,v.width)).on("mousemove",function(v,a){try{H.selectAll(".sankey-links").style("stroke-opacity",.1),H.selectAll(".sankey-nodes").style("stroke","none").style("fill-opacity",.1),H.selectAll(".sankey-nodes-texts").style("opacity","0"),H.select(`#Link${a.index}`).style("stroke-opacity",le).style("cursor","pointer"),H.select(`#Node${a.target.index}`).style("fill-opacity",X).style("Stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none"),H.select(`#Node${a.source.index}`).style("fill-opacity",X).style("Stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none"),H.select(`#Label${a.target.index}`).style("opacity",1),H.select(`#Label${a.source.index}`).style("opacity",1),y.toolTip.toolTipVisibility&&xt([{key:a.source.name.split("~$~")[1]+"→"+a.target.name.split("~$~")[1],value:Qe(y.toolTip.toolTipDisplayUnits,y.toolTip.toolTipNumberFormat,y.toolTip.toolTipDecimalPrecision)(a.value)}],y,void 0,{markerColor:a.source.color,markerShape:"circle"},Lt(r,String(a.source.name.split("~$~")[1]??""),{alias:a.source.name.split("~$~")[1],markerColor:a.source.color}))}catch(g){Ce("SankeyChart.tsx","link.onMouseMove",g)}}).on("mouseout",function(v){try{y.toolTip.toolTipVisibility&&ct(),H.selectAll(".sankey-nodes").style("fill-opacity",X),H.selectAll(".sankey-nodes").style("stroke",y.nodes.nodesBorderColor!==ze.white?y.nodes.nodesBorderColor:"none"),H.selectAll(".sankey-links").style("stroke-opacity",le),H.selectAll(".sankey-nodes-texts").style("opacity","1"),T.select(this).select("rect").style("pointer-events","all"),T.select(this).style("cursor","none")}catch(a){Ce("SankeyChart.tsx","link.onMouseOut",a)}}),y.nodes.nodesLabelVisibility)try{const v=H.append("g").attr("font-family",y.nodes.nodesLabelFontFamily).attr("font-size",y.nodes.nodesLabelFontSize).style("font-style",y.nodes.nodesLabelFontStyle.includes(ie.italic)?ie.italic:"").style("text-decoration",y.nodes.nodesLabelFontStyle.includes(ie.underline)?ie.underline:"").style("font-weight",y.nodes.nodesLabelFontStyle.includes(ie.bold)?ie.bold:"").attr("display",y.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(y.nodes.sankeyChartType!=="None"){const g=y.nodes.sankeyNodeWidth,P=G===si.center;T.select(this).append("foreignObject").attr("x",q(a).x).attr("y",q(a).y-16).attr("width",me=>P?g:I).attr("height",20).append("xhtml:div").style("white-space",P||D?"nowrap":"normal").style("overflow",P||D?"hidden":"visible").style("text-overflow",P||D?"ellipsis":"clip").style("display","block").style("max-width",me=>P?"100px":I+"px").style("padding","0 3px").style("color",y.nodes.nodesLabelColor).style("font-family",y.nodes.nodesLabelFontFamily).style("font-size",y.nodes.nodesLabelFontSize+"px").style("font-style",y.nodes.nodesLabelFontStyle.includes(ie.italic)?ie.italic:"").style("text-decoration",y.nodes.nodesLabelFontStyle.includes(ie.underline)?ie.underline:"").style("font-weight",y.nodes.nodesLabelFontStyle.includes(ie.bold)?ie.bold:"").style("text-align",y.nodes.sankeyChartType==="Left"?"right":y.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",me=>R.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=>R.get(me.name)>0?me.alias?me.alias.includes("~$~")?me.alias.split("~$~")[1]:me.alias:me.name.includes("~$~")?me.name.split("~$~")[1]:me.name:""),T.select(this).append("foreignObject").attr("x",q(a).x).attr("y",q(a).y).attr("width",me=>P?g:I).attr("height",20).append("xhtml:div").style("white-space",P||D?"nowrap":"normal").style("overflow",P||D?"hidden":"visible").style("text-overflow",P||D?"ellipsis":"clip").style("display","block").style("max-width",me=>P?"100px":I+"px").style("padding","0 3px").style("color",y.nodes.nodesLabelColor).style("font-family",y.nodes.nodesLabelFontFamily).style("font-size",y.nodes.nodesLabelFontSize+"px").style("font-style",y.nodes.nodesLabelFontStyle.includes(ie.italic)?ie.italic:"").style("text-decoration",y.nodes.nodesLabelFontStyle.includes(ie.underline)?ie.underline:"").style("font-weight",y.nodes.nodesLabelFontStyle.includes(ie.bold)?ie.bold:"").style("text-align",y.nodes.sankeyChartType==="Left"?"right":y.nodes.sankeyChartType==="Center"?"center":"left").style("line-height","20px").attr("title",me=>R.get(me.name)>0?y.nodes.nodeLabelNumberFormat===",.0%"?R.get(me.name).toFixed(parseFloat(y.nodes.nodeLabelDecimalPrecision))+"%":Qe(y.nodes.nodesLabelDisplayUnits,y.nodes.nodeLabelNumberFormat,y.nodes.nodeLabelDecimalPrecision)(me.totalValue):"").text(me=>R.get(me.name)>0?y.nodes.nodeLabelNumberFormat===",.0%"?R.get(me.name).toFixed(parseFloat(y.nodes.nodeLabelDecimalPrecision))+"%":Qe(y.nodes.nodesLabelDisplayUnits,y.nodes.nodeLabelNumberFormat,y.nodes.nodeLabelDecimalPrecision)(me.totalValue):"")}}catch(g){Ce("SankeyChart.tsx","texts.each",g)}})}catch(v){Ce("SankeyChart.tsx","inittree.texts",v)}}catch(J){Ce("SankeyChart.tsx","inittree",J)}};function he(J){try{const M=new Map,x=new Map,k=new Set;for(const{source:v,target:a}of J)k.add(v),k.add(a),M.has(a)||M.set(a,new Set),x.has(v)||x.set(v,new Set),M.get(a).add(v),x.get(v).add(a);const c=new Map,d=[];for(const v of k)M.has(v)||(c.set(v,0),d.push(v));for(;d.length>0;){const v=d.shift(),a=c.get(v),g=x.get(v)||[];for(const P of g){const ce=a+1;(!c.has(P)||c.get(P)<ce)&&(c.set(P,ce),d.push(P))}}const i=new Map;for(const[v,a]of c.entries())i.has(a)||i.set(a,[]),i.get(a).push(v);return[...i.entries()].sort((v,a)=>v[0]-a[0]).map(([v,a])=>({layer:v,nodes:a}))}catch(M){return Ce("SankeyChart.tsx","assignNodeLayers",M),[]}}const q=J=>{try{let M={};const x=Number(y.nodes.sankeyNodeWidth),k=x/2;switch(G){case"Right":M.x=J.x1+6;break;default:case"Left":M.x=J.x0-I;break;case"Center":M.x=J.x0+k-x/2;break}return M.y=(J.y1+J.y0)/2,M}catch(M){return Ce("SankeyChart.tsx","getXandYPositionOfLables",M),{x:0,y:0}}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:p,id:l,style:{width:"100%",height:"100%"}})})},$r={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]]]}}]},Yr=({data:t,geoJsonNode:e,formatOptions:l,chartId:s})=>{const u=Ne.useRef();let r=ft(t),n,o,p,m=Number.MAX_VALUE,f=Number.MIN_VALUE,y=40,S=Kt,A,Z,L,Y,b=0,H=1,B,G=new Map,I=new Map,D=new Map,N=Number.MAX_VALUE,R=Number.MIN_VALUE,X=0,le=0,te,Q;Ne.useEffect(()=>{de()},[l,s]);const de=()=>{({chartFormatOptions:n,svg:Y,width:o,height:p}=ta(u,l)),{margins:S,chartTitleHeight:y,innerHeight:A,innerWidth:Z}=ni(n,p,o),ea(u,o,p,n),L=da(Y,S),Ot(u,y,o,n),Le(t),Te(),he(),q()},Le=M=>{try{let x=new Set,k=new Set;M.forEach(i=>{i.data.forEach((h,v)=>{v===b&&(x.add(h.value.toString()),X+=h.value),v===H&&(k.add(h.value.toString()),le+=h.value)})});let c=n.colorScaleForMaps&&n.colorScaleForMaps.startColorForMaps?n.colorScaleForMaps.startColorForMaps:"#c1d8f3",d=n.colorScaleForMaps&&n.colorScaleForMaps.endColorForMaps?n.colorScaleForMaps.endColorForMaps:"#4c6ba5";if(x.size===1)te=()=>c;else{const i=T.interpolateLab(c,d);te=T.scaleOrdinal().domain(Array.from(x)).range(Array.from(x).map((h,v)=>i(v/(x.size-1))))}if(k.size===1)Q=()=>c;else{const i=T.interpolateLab(n.colorScaleForMapsBubble.startColorForMapsBubble,n.colorScaleForMapsBubble.endColorForMapsBubble);Q=T.scaleOrdinal().domain(Array.from(k)).range(Array.from(k).map((h,v)=>i(v/(k.size-1))))}}catch(x){Ce("Maps.tsx","dataPreparation",x)}},Te=M=>{B=$r},he=()=>{try{r?.forEach(M=>{D.set(M.legend,M)}),e.mappings.forEach(M=>{I.set(M.actualName,M.mappedName)}),e.groups.forEach(M=>{M.groupedRegions.forEach(x=>{G.set(x,M.groupName)})}),B.features.forEach(M=>{const x=M.properties.name;let k;if(I.has(x)){const c=I.get(x);M.properties.displayName=c,k=c}if(G.has(x)){const c=G.get(x);M.properties.displayName=c,k=c}else k=x;if(D.has(k)){const c=D.get(k);M.properties.data=c;let d;c.data&&c.data[1]&&(d=c.data[1]?c.data[1].value:0,N=Math.min(N,d),R=Math.max(R,d)),c.data&&c.data[0]&&(d=c.data[0].value,m=Math.min(m,d),f=Math.max(f,d))}else M.properties.data=void 0})}catch(M){Ce("Maps.tsx","generateDataForMaps",M)}},q=()=>{try{let M=0;const x=T.geoAlbersUsa().fitSize([Z,A],B),k=T.geoPath().projection(x),c=L.append("g").attr("class","paths");if(c.selectAll(s+" .path-group").data(B.features).enter().append("path").attr("id",d=>d.properties.name).attr("fill",(d,i)=>J(d)).attr("stroke",d=>d.properties.data?"unset":"#CCCCCC").attr("fill-opacity",n.plotArea.opacity).attr("stroke-width","0.4px").attr("d",d=>(M+=k.area(d),k(d))).on("mousemove",(d,i)=>{let h=i.properties.data;if(h){let v=h.data.map(a=>({key:a.dimension,value:Qe("None",n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(a.value)}));xt([{key:"Region",value:h.properties.alias},...v],n,void 0,i.currentTarget.__data__.data.properties)}}).on("mouseout",(d,i)=>{ct()}),n.plotArea.dataLabels){const d=M/B.features.length,i=n.plotArea.dataLabelName,h=n.plotArea.dataLabelValue,v=a=>n.dataLabelOverlappingToggle.dataLabelOverlap&&a.geometry.type==="Polygon"?k.area(a)<d*.25:!1;c.selectAll(".text-container").data(B.features).enter().append("foreignObject").style("pointer-events","none").attr("class","text-container").attr("x",a=>k.centroid(a)[0]-50).attr("y",a=>{const g=k.centroid(a);return i&&h?g[1]-15:g[1]-10}).attr("width",100).attr("height",40).append("xhtml:div").html(a=>{let g=a.properties.data;if((i||h)&&g&&!v(a)){if(v(a))return null;const P=g?.properties.alias||a.properties.displayName,ce=n.plotArea.dataLabelNumberFormat==",.0%"?Math.round(a.properties.data.data[0].value/X*100)+"%":Qe(n.plotArea.plotAreaDisplayUnits,n.plotArea.dataLabelNumberFormat,n.plotArea.dataLabelDecimalPrecision)(a.properties.data.data[0].value);let z="";return n.plotArea.dataLabelName&&(z+=`<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(ce.bold)?ce.bold:"normal"};
155
- font-style:${a.properties.data.properties.labelFontStyle.includes(ce.italic)?ce.italic:"normal"};
156
- text-decoration:${a.properties.data.properties.labelFontStyle.includes(ce.underline)?ce.underline:"none"};
154
+ font-weight:${a.properties.data.properties.labelFontStyle.includes(ie.bold)?ie.bold:"normal"};
155
+ font-style:${a.properties.data.properties.labelFontStyle.includes(ie.italic)?ie.italic:"normal"};
156
+ text-decoration:${a.properties.data.properties.labelFontStyle.includes(ie.underline)?ie.underline:"none"};
157
157
  color:${a.properties.data.properties.labelFontColor};">
158
- ${N??""}
159
- </div>`),r.plotArea.dataLabelValue&&(Z+=`<div style=
158
+ ${P??""}
159
+ </div>`),n.plotArea.dataLabelValue&&(z+=`<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(ce.bold)?ce.bold:"normal"};
163
- font-style:${a.properties.data.properties.valueFontStyle.includes(ce.italic)?ce.italic:"normal"};
164
- text-decoration:${a.properties.data.properties.valueFontStyle.includes(ce.underline)?ce.underline:"none"};
162
+ font-weight:${a.properties.data.properties.valueFontStyle.includes(ie.bold)?ie.bold:"normal"};
163
+ font-style:${a.properties.data.properties.valueFontStyle.includes(ie.italic)?ie.italic:"normal"};
164
+ text-decoration:${a.properties.data.properties.valueFontStyle.includes(ie.underline)?ie.underline:"none"};
165
165
  color:${a.properties.data.properties.valueFontColor};">
166
- ${ne??""}
167
- </div>`),Z}return null})}if(r.bubbleformatting.showBubble){let d=Math.min(W,g);const i=v.scaleLinear().domain([w,z]).range([d*.01,d*.07]);A.selectAll("myCircles").data(Y.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)=>r.colorScaleForMapsBubble.showColorForMapsBubble=="2"?te(y.properties.data&&y.properties.data.data[U]?.value||0):r.bubbleformatting.bubbleColor).attr("stroke",r.bubbleformatting&&r.bubbleformatting.bubbleBorderColor).attr("stroke-width",r.bubbleformatting&&r.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",r.bubbleformatting&&rt(r.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(y,T){ut([{key:"Region",value:T.properties?.data?.propeties?.Alias},{key:T.properties.data?.data[1]?.dimension,value:r.toolTip.toolTipNumberFormat==",.0%"?Math.round(T.properties.data?.data[1]?.value/ye*100)+"%":Ke(r.toolTip.toolTipDisplayUnits,r.toolTip.toolTipNumberFormat,r.toolTip.toolTipDecimalPrecision)(T.properties.data?.data[1]?.value)}],r,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){me("Maps.tsx","drawMap",M)}},X=M=>{try{let h=M.properties.data;switch(parseInt(r.colorScaleForMaps.showColorForMaps)){case 1:return h?h.properties.color:"#E6E6E6";case 2:return r.colorScaleForMaps.defaultColor;case 3:return M.properties.data?se(M.properties.data?.data[b]?.value):"#E6E6E6"}}catch(h){me("Maps.tsx","getMapColor",h)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{id:o,className:"chartSVG",style:{width:"100%",height:"100%"},ref:x})})},da="OrganizationChart.tsx",Yr=({data:t,formatOptions:e,legendSequence:n})=>{let o=t.LegendList??[];const x=crypto.randomUUID(),l=Ce.useRef(),r=Ce.useRef();let c,p,m,L=40,u=Jt,S,g=new Map,W=new Map,A=Bt.left,E=[],b=0,U=0,Y,H=new Map,I,D=Number.NEGATIVE_INFINITY,w=Number.POSITIVE_INFINITY,z;Ce.useEffect(()=>{K()},[x,t,e]);const K=()=>{({chartFormatOptions:c,svg:S,width:p,height:m}=Kt(l,e)),te(),I=ye(H),{margins:u,innerHeight,innerWidth,legendListWidth:Y,chartTitleHeight:L}=Ua(c,p,m,I,u),qt(l,p,m,c),Xt(l,L,p,c),xe(),X(E),se()},ye=s=>{const d=[];s.forEach((T,a)=>{d.push(a)});const i=d.reduce((T,a)=>T.length>a.length?T:a,""),y=$t(i,rt(c.legends.legendFontSize),c.legends.legendFontFamily);return[y.width,y.height]},se=()=>{let s=[];H.forEach((d,i)=>{const y=`linear-gradient(90deg, ${d.join(", ")})`;s.push({properties:{...o[0],name:i,alias:i,color:y}})}),Wa(c,S,s,p,m,Y,L,x,u,ct.rectangle,void 0)},te=()=>{try{const i=e?.plotArea?.sortBy??"default";A=c.plotArea.chartDirection||Bt.left;var s=0,d=0;const y={...t.ChartData,UID:void 0};let T=O(y).filter(a=>a.value!==null);i!=="default"&&(T=T.sort((a,f)=>i==="asc"?a.value-f.value:f.value-a.value)),he(T),ge(T),E=pe(T),c.heatMap.showHeatMap&&(z=v.scaleSequential().domain([w,D]).interpolator(v.interpolateRgb(c.heatMap.heatMapMinColor,c.heatMap.heatMapMaxColor)))}catch(i){me(da,"dataPreparation",i)}},xe=()=>{try{if(c.plotArea.fitChart)U=m,b=p,r.current.style.width="calc(100% - 10px)",r.current.style.height="calc(100% - 10px)";else{let s=function(){let d=this;var i=d.scrollLeft,y=d.scrollTop;v.select(`#clipPath${x}`).select("rect").attr("x",i).attr("y",y)};b=0,E.forEach(d=>{d.label==n[n.length-1]&&(b+=h(d,!1))}),U=(n.length+1)*rt(c.nodes.nodeHeight)*10+(n.length+1)*70,r.current.style.width=`${b}px`,r.current.style.height=`${U}px`,v.select(r.current).append("defs").attr("id",`defs${x}`).append("clipPath").attr("id",`clipPath${x}`).append("rect").attr("width",p-u.left-u.right).attr("height",m-u.top-u.bottom-15).attr("transform",`translate(${u.left},${u.top})`),document.querySelector("#floating-div"+x).addEventListener("scroll",s),v.select(r.current).attr("clip-path",`url(#clipPath${x})`)}}catch(s){me(da,"scrollWidthHeightCalculation",s)}},ge=s=>{try{s.forEach((d,i)=>{if(d.id!=0){let y=s[g.get(d.parentId)].UID;y===void 0?d.UID=d.nodeLabel:d.UID=y+"-"+d.nodeLabel}})}catch(d){me(da,"generateUID",d)}},pe=s=>{try{return o.forEach(d=>{W.set(d.name,d)}),Object.keys(s).forEach(d=>{const i=s[d],y=W.get(i.UID??i.nodeLabel)??o[0];if(s[d]={...i,styleObject:y},i.label)if(H.has(i.label)){const T=H.get(i.label);H.set(i.label,[...T,y.color??"#eedddd"])}else H.set(i.label,[y.color??"#eedddd"]);D=Math.max(D,i.value),w=Math.min(w,i.value)}),s}catch(d){me(da,"addStyleObjectToChartData",d)}},he=s=>{try{s.forEach((d,i)=>{g.set(d.id,i)})}catch(d){me(da,"createIdIndexMap",d)}},O=s=>{try{const d=v.hierarchy(s).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){me(da,"getFlattenedData",d)}},X=s=>{try{let d=c.connector.lineType||"straight",i=c.nodes.nodeType||si.rectangle,y=parseInt(c.connector.connectorLineThickness);v.select(r.current).selectAll("*").remove(),new vl.OrgChart().container(`#floating-${x}`).svgWidth(b).svgHeight(U).nodeHeight(a=>M(a)).nodeWidth(a=>h(a,!0)).layout(A).diagonal((a,f,N,ne={sy:0})=>{if(A=="top"||A=="bottom"||!A)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+f.x)/2} ${a.y}, ${(a.x+f.x)/2} ${f.y}, ${f.x} ${f.y}`;case ha.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${f.y} H ${f.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+f.x)/2} ${a.y} L ${(a.x+f.x)/2} ${f.y} L ${f.x} ${f.y}`;case ha.s_curve:const Z=(a.y+f.y)/2;return`M ${a.x},${a.y} C ${a.x},${Z} ${f.x},${Z} ${f.x},${f.y}`;case ha.arc:const fe=f.x-a.x,Re=f.y-a.y,Te=Math.sqrt(fe*fe+Re*Re);return`M ${a.x},${a.y} A ${Te},${Te} 0 0,1 ${f.x},${f.y}`;case ha.reverse_elbow:if(A==Bt.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${f.x} V ${f.y}`;if(A==Bt.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${f.x} V ${f.y}`;case ha.zigzag:if(A==Bt.top){const Me=(a.y+f.y)/2;return`M ${a.x},${a.y} L ${a.x},${Me-10} L ${f.x},${Me+10} L ${f.x},${f.y}`}else if(A==Bt.bottom){const Me=(a.y+f.y)/2;return`
166
+ ${ce??""}
167
+ </div>`),z}return null})}if(n.bubbleformatting.showBubble){let d=Math.min(Z,A);const i=T.scaleLinear().domain([N,R]).range([d*.01,d*.07]);L.selectAll("myCircles").data(B.features).join("circle").attr("cx",h=>k.centroid(h)[0]).attr("cy",h=>k.centroid(h)[1]).attr("r",h=>h.properties.data?i(h.properties.data?.data[1]?.value||0):0).attr("fill",(h,v)=>n.colorScaleForMapsBubble.showColorForMapsBubble=="2"?Q(h.properties.data&&h.properties.data.data[H]?.value||0):n.bubbleformatting.bubbleColor).attr("stroke",n.bubbleformatting&&n.bubbleformatting.bubbleBorderColor).attr("stroke-width",n.bubbleformatting&&n.bubbleformatting.bubbleBorderWidth).attr("fill-opacity",n.bubbleformatting&&nt(n.bubbleformatting.bubbleOpacity)/10).on("mousemove",function(h,v){xt([{key:"Region",value:v.properties?.data?.propeties?.Alias},{key:v.properties.data?.data[1]?.dimension,value:n.toolTip.toolTipNumberFormat==",.0%"?Math.round(v.properties.data?.data[1]?.value/le*100)+"%":Qe(n.toolTip.toolTipDisplayUnits,n.toolTip.toolTipNumberFormat,n.toolTip.toolTipDecimalPrecision)(v.properties.data?.data[1]?.value)}],n,void 0,v.currentTarget.__data__.data.properties),T.select(this).style("r",(v.properties.data?i(v.properties.data?.data[1]?.value||0):0)*1.2)}).on("mouseout",function(h,v){ct(),T.select(this).style("r",v.properties.data?i(v.properties.data?.data[1]?.value||0):0)})}}catch(M){Ce("Maps.tsx","drawMap",M)}},J=M=>{try{let x=M.properties.data;switch(parseInt(n.colorScaleForMaps.showColorForMaps)){case 1:return x?x.properties.color:"#E6E6E6";case 2:return n.colorScaleForMaps.defaultColor;case 3:return M.properties.data?te(M.properties.data?.data[b]?.value):"#E6E6E6"}}catch(x){Ce("Maps.tsx","getMapColor",x)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{id:s,className:"chartSVG",style:{width:"100%",height:"100%"},ref:u})})},ua="OrganizationChart.tsx",Ur=({data:t,formatOptions:e,legendSequence:l})=>{let s=t.LegendList??[];const u=crypto.randomUUID(),r=Ne.useRef(),n=Ne.useRef();let o,p,m,f=40,y=Kt,S,A=new Map,Z=new Map,L=Gt.left,Y=[],b=0,H=0,B,G=new Map,I,D=Number.NEGATIVE_INFINITY,N=Number.POSITIVE_INFINITY,R;Ne.useEffect(()=>{X()},[u,t,e]);const X=()=>{({chartFormatOptions:o,svg:S,width:p,height:m}=ta(r,e)),Q(),I=le(G),{margins:y,innerHeight,innerWidth,legendListWidth:B,chartTitleHeight:f}=Ua(o,p,m,I,y),ea(r,p,m,o),Ot(r,f,p,o),de(),J(Y),te()},le=c=>{const d=[];c.forEach((v,a)=>{d.push(a)});const i=d.reduce((v,a)=>v.length>a.length?v:a,""),h=Ut(i,nt(o.legends.legendFontSize),o.legends.legendFontFamily);return[h.width,h.height]},te=()=>{let c=[];G.forEach((d,i)=>{const h=`linear-gradient(90deg, ${d.join(", ")})`;c.push({properties:{...s[0],name:i,alias:i,color:h}})}),Ha(o,S,c,p,m,B,f,u,y,dt.rectangle,void 0)},Q=()=>{try{const i=e?.plotArea?.sortBy??"default";L=o.plotArea.chartDirection||Gt.left;var c=0,d=0;const h={...t.ChartData,UID:void 0};let v=q(h).filter(a=>a.value!==null);i!=="default"&&(v=v.sort((a,g)=>i==="asc"?a.value-g.value:g.value-a.value)),he(v),Le(v),Y=Te(v),o.heatMap.showHeatMap&&(R=T.scaleSequential().domain([N,D]).interpolator(T.interpolateRgb(o.heatMap.heatMapMinColor,o.heatMap.heatMapMaxColor)))}catch(i){Ce(ua,"dataPreparation",i)}},de=()=>{try{if(o.plotArea.fitChart)H=m,b=p,n.current.style.width="calc(100% - 10px)",n.current.style.height="calc(100% - 10px)";else{let c=function(){let d=this;var i=d.scrollLeft,h=d.scrollTop;T.select(`#clipPath${u}`).select("rect").attr("x",i).attr("y",h)};b=0,Y.forEach(d=>{d.label==l[l.length-1]&&(b+=x(d,!1))}),H=(l.length+1)*nt(o.nodes.nodeHeight)*10+(l.length+1)*70,n.current.style.width=`${b}px`,n.current.style.height=`${H}px`,T.select(n.current).append("defs").attr("id",`defs${u}`).append("clipPath").attr("id",`clipPath${u}`).append("rect").attr("width",p-y.left-y.right).attr("height",m-y.top-y.bottom-15).attr("transform",`translate(${y.left},${y.top})`),document.querySelector("#floating-div"+u).addEventListener("scroll",c),T.select(n.current).attr("clip-path",`url(#clipPath${u})`)}}catch(c){Ce(ua,"scrollWidthHeightCalculation",c)}},Le=c=>{try{c.forEach((d,i)=>{if(d.id!=0){let h=c[A.get(d.parentId)].UID;h===void 0?d.UID=d.nodeLabel:d.UID=h+"-"+d.nodeLabel}})}catch(d){Ce(ua,"generateUID",d)}},Te=c=>{try{return s.forEach(d=>{Z.set(d.name,d)}),Object.keys(c).forEach(d=>{const i=c[d],h=Z.get(i.UID??i.nodeLabel)??s[0];if(c[d]={...i,styleObject:h},i.label)if(G.has(i.label)){const v=G.get(i.label);G.set(i.label,[...v,h.color??"#eedddd"])}else G.set(i.label,[h.color??"#eedddd"]);D=Math.max(D,i.value),N=Math.min(N,i.value)}),c}catch(d){Ce(ua,"addStyleObjectToChartData",d)}},he=c=>{try{c.forEach((d,i)=>{A.set(d.id,i)})}catch(d){Ce(ua,"createIdIndexMap",d)}},q=c=>{try{const d=T.hierarchy(c).descendants();return d.forEach((i,h)=>{i.id=i.id||"id"+h}),d.map((i,h)=>{const v={...i.data};return delete v.children,i.parent&&(v.parentValue=i.parent.data.value||0),{...v,parentId:i.parent?.data?.id}})}catch(d){Ce(ua,"getFlattenedData",d)}},J=c=>{try{let d=o.connector.lineType||"straight",i=o.nodes.nodeType||oi.rectangle,h=parseInt(o.connector.connectorLineThickness);T.select(n.current).selectAll("*").remove(),new Cl.OrgChart().container(`#floating-${u}`).svgWidth(b).svgHeight(H).nodeHeight(a=>M(a)).nodeWidth(a=>x(a,!0)).layout(L).diagonal((a,g,P,ce={sy:0})=>{if(L=="top"||L=="bottom"||!L)switch(d){case pa.curve:return`M ${a.x} ${a.y} C ${(a.x+g.x)/2} ${a.y}, ${(a.x+g.x)/2} ${g.y}, ${g.x} ${g.y}`;case pa.elbow:return`M ${a.x} ${a.y} H ${a.x} V ${g.y} H ${g.x}`;case pa.diagonal:return`M ${a.x} ${a.y} L ${(a.x+g.x)/2} ${a.y} L ${(a.x+g.x)/2} ${g.y} L ${g.x} ${g.y}`;case pa.s_curve:const z=(a.y+g.y)/2;return`M ${a.x},${a.y} C ${a.x},${z} ${g.x},${z} ${g.x},${g.y}`;case pa.arc:const me=g.x-a.x,ve=g.y-a.y,Me=Math.sqrt(me*me+ve*ve);return`M ${a.x},${a.y} A ${Me},${Me} 0 0,1 ${g.x},${g.y}`;case pa.reverse_elbow:if(L==Gt.bottom)return`M ${a.x} ${a.y} V ${a.y-20} H ${g.x} V ${g.y}`;if(L==Gt.top)return`M ${a.x} ${a.y} V ${a.y+20} H ${g.x} V ${g.y}`;case pa.zigzag:if(L==Gt.top){const Pe=(a.y+g.y)/2;return`M ${a.x},${a.y} L ${a.x},${Pe-10} L ${g.x},${Pe+10} L ${g.x},${g.y}`}else if(L==Gt.bottom){const Pe=(a.y+g.y)/2;return`
168
168
  M ${a.x},${a.y}
169
- L ${a.x},${Me+10}
170
- L ${f.x},${Me-10}
171
- L ${f.x},${f.y}
172
- `}default:if(A==Bt.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${f.x} V ${f.y}`;if(A=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${f.x} V ${f.y}`}}).hdiagonal((a,f,N,ne={sx:0})=>{if(A===Bt.left||A===Bt.right)switch(d){case ha.curve:return`M ${a.x} ${a.y} C ${(a.x+f.x)/2} ${a.y}, ${(a.x+f.x)/2} ${f.y}, ${f.x} ${f.y}`;case ha.elbow:if(A==Bt.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${f.y} H ${f.x}`;if(A==Bt.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${f.y} H ${f.x}`;case ha.diagonal:return`M ${a.x} ${a.y} L ${(a.x+f.x)/2} ${a.y} L ${(a.x+f.x)/2} ${f.y} L ${f.x} ${f.y}`;case ha.s_curve:const Z=(a.x+f.x)/2;return`M ${a.x},${a.y} C ${Z},${a.y} ${Z},${f.y} ${f.x},${f.y}`;case ha.arc:if(A==Bt.left){const fe=f.x-a.x,Re=f.y-a.y,Te=Math.sqrt(fe*fe+Re*Re);return`M ${a.x},${a.y} A ${Te},${Te} 0 0,1 ${f.x},${f.y}`}else if(A==Bt.right){const fe=a.x-f.x,Re=f.y-a.y,Te=Math.sqrt(fe*fe+Re*Re);return`M ${a.x},${a.y} A ${Te},${Te} 0 0,0 ${f.x},${f.y}`}case"reverse-elbow":if(A==Bt.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${f.y} H ${f.x}`;if(A==Bt.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${f.y} H ${f.x}`;case"zigzag":if(A==Bt.left){const fe=(a.x+f.x)/2;return`
169
+ L ${a.x},${Pe+10}
170
+ L ${g.x},${Pe-10}
171
+ L ${g.x},${g.y}
172
+ `}default:if(L==Gt.bottom)return`M ${a.x} ${a.y} V ${a.y+25} H ${g.x} V ${g.y}`;if(L=="top")return`M ${a.x} ${a.y} V ${a.y-25} H ${g.x} V ${g.y}`}}).hdiagonal((a,g,P,ce={sx:0})=>{if(L===Gt.left||L===Gt.right)switch(d){case pa.curve:return`M ${a.x} ${a.y} C ${(a.x+g.x)/2} ${a.y}, ${(a.x+g.x)/2} ${g.y}, ${g.x} ${g.y}`;case pa.elbow:if(L==Gt.left)return`M ${a.x} ${a.y} H ${a.x-50} V ${g.y} H ${g.x}`;if(L==Gt.right)return`M ${a.x} ${a.y} H ${a.x+50} V ${g.y} H ${g.x}`;case pa.diagonal:return`M ${a.x} ${a.y} L ${(a.x+g.x)/2} ${a.y} L ${(a.x+g.x)/2} ${g.y} L ${g.x} ${g.y}`;case pa.s_curve:const z=(a.x+g.x)/2;return`M ${a.x},${a.y} C ${z},${a.y} ${z},${g.y} ${g.x},${g.y}`;case pa.arc:if(L==Gt.left){const me=g.x-a.x,ve=g.y-a.y,Me=Math.sqrt(me*me+ve*ve);return`M ${a.x},${a.y} A ${Me},${Me} 0 0,1 ${g.x},${g.y}`}else if(L==Gt.right){const me=a.x-g.x,ve=g.y-a.y,Me=Math.sqrt(me*me+ve*ve);return`M ${a.x},${a.y} A ${Me},${Me} 0 0,0 ${g.x},${g.y}`}case"reverse-elbow":if(L==Gt.left)return`M ${a.x} ${a.y} H ${a.x+60} V ${g.y} H ${g.x}`;if(L==Gt.right)return`M ${a.x} ${a.y} H ${a.x-60} V ${g.y} H ${g.x}`;case"zigzag":if(L==Gt.left){const me=(a.x+g.x)/2;return`
173
173
  M ${a.x},${a.y}
174
- L ${fe-10},${a.y}
175
- L ${fe+10},${f.y}
176
- L ${f.x},${f.y}
177
- `}else{const fe=(a.x+f.x)/2;return`
174
+ L ${me-10},${a.y}
175
+ L ${me+10},${g.y}
176
+ L ${g.x},${g.y}
177
+ `}else{const me=(a.x+g.x)/2;return`
178
178
  M ${a.x},${a.y}
179
- L ${fe+10},${a.y}
180
- L ${fe-10},${f.y}
181
- L ${f.x},${f.y}
182
- `}default:return A==Bt.left?`M ${a.x} ${a.y} H ${a.x-25} V ${f.y} H ${f.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${f.y} H ${f.x}`}else return`M ${a.x} ${a.y} L ${f.x} ${f.y}`}).linkUpdate(function(a){try{if(y){const f=c.plotArea.connectorType||"arrow",N=["arrow","diamond","dot"].includes(f)&&c.connector.lineType!=="reverse-elbow";v.select(this).attr("stroke-width",c.connector.connectorLineThickness).attr("stroke-dasharray",c.connector.connectorStyle===qa.solid?0:c.connector.connectorStyle===qa.dotted?1:4).style("stroke",c.connector.connectorLineColor).attr("marker-start",N?`url(#${f})`:null).attr("marker-end",null)}else v.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(f){me(da,"drawOrganizationChart.linkUpdate",f)}}).nodeContent((a,f)=>{try{let N=`${a.data.styleObject.borderRadius}px`,ne="",Z="",fe="",Re="",Te="";switch(i){case si.rounded:N="10px";break;case si.pill:N="999px";break;case si.extra_rounded:N="20px";break;case si.squircle:N="25%";break;default:N="1px";break}return Te=`
179
+ L ${me+10},${a.y}
180
+ L ${me-10},${g.y}
181
+ L ${g.x},${g.y}
182
+ `}default:return L==Gt.left?`M ${a.x} ${a.y} H ${a.x-25} V ${g.y} H ${g.x}`:`M ${a.x} ${a.y} H ${a.x+25} V ${g.y} H ${g.x}`}else return`M ${a.x} ${a.y} L ${g.x} ${g.y}`}).linkUpdate(function(a){try{if(h){const g=o.plotArea.connectorType||"arrow",P=["arrow","diamond","dot"].includes(g)&&o.connector.lineType!=="reverse-elbow";T.select(this).attr("stroke-width",o.connector.connectorLineThickness).attr("stroke-dasharray",o.connector.connectorStyle===Ka.solid?0:o.connector.connectorStyle===Ka.dotted?1:4).style("stroke",o.connector.connectorLineColor).attr("marker-start",P?`url(#${g})`:null).attr("marker-end",null)}else T.select(this).attr("stroke-width",0).attr("marker-start",null).attr("marker-end",null)}catch(g){Ce(ua,"drawOrganizationChart.linkUpdate",g)}}).nodeContent((a,g)=>{try{let P=`${a.data.styleObject.borderRadius}px`,ce="",z="",me="",ve="",Me="";switch(i){case oi.rounded:P="10px";break;case oi.pill:P="999px";break;case oi.extra_rounded:P="20px";break;case oi.squircle:P="25%";break;default:P="1px";break}return Me=`
183
183
  border-width: ${a.data.styleObject.borderWidth}px
184
- border-style:${c.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
184
+ border-style:${o.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"}
185
185
  border-color:${a.data.styleObject.borderColor};
186
- border-radius: ${N};
186
+ border-radius: ${P};
187
187
  `,`<div hoverId="${a.data.label}" style="
188
188
  border-width: ${a.data.styleObject.borderWidth}px;
189
- border-style:${c.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"} ;
189
+ border-style:${o.nodes.nodesBorderVisibility?a.data.styleObject.borderStyle:"none"} ;
190
190
  border-color:${a.data.styleObject.borderColor};
191
- border-radius: ${N};
191
+ border-radius: ${P};
192
192
  width: ${a.width}px;
193
193
  height: ${a.height}px;
194
194
  padding: 5px;
@@ -197,40 +197,40 @@ let E=t<200?200:S?e:t,b=e<200?200:S?t:e,U=E*.15*.8,Y=Ol(r,l),H=U<Y[0]+10?U:Y[0]+
197
197
  justify-content: center;
198
198
  align-items: center;
199
199
  text-align: center;
200
- background-color: ${c.heatMap.showHeatMap?z(a.data.value):c.nodes.nodesSingleColor?c.nodes.nodesColor:a.data.styleObject.color};
200
+ background-color: ${o.heatMap.showHeatMap?R(a.data.value):o.nodes.nodesSingleColor?o.nodes.nodesColor:a.data.styleObject.color};
201
201
  z-index: 99;
202
- transform: ${ne};
202
+ transform: ${ce};
203
203
  transition: unset;">
204
204
 
205
- ${Z}
205
+ ${z}
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(ce.bold)?"Bolder":"normal"};
211
- font-style:${a.data.styleObject.labelFontStyle.includes(ce.italic)?ce.italic:"normal"};
212
- text-decoration:${a.data.styleObject.labelFontStyle.includes(ce.underline)?ce.underline:"none"};
210
+ font-weight:${a.data.styleObject.labelFontStyle.includes(ie.bold)?"Bolder":"normal"};
211
+ font-style:${a.data.styleObject.labelFontStyle.includes(ie.italic)?ie.italic:"normal"};
212
+ text-decoration:${a.data.styleObject.labelFontStyle.includes(ie.underline)?ie.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
- ${f===0?a.data.styleObject.alias:c.nodes.nodesLabelVisibility?`${a.data.label} : ${k(a.data.styleObject.alias)}`:`${k(a.data.styleObject.alias)}`}
218
+ ${g===0?a.data.styleObject.alias:o.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(ce.bold)?"Bolder":"normal"};
224
- font-style:${a.data.styleObject.valueFontStyle.includes(ce.italic)?ce.italic:"normal"};
225
- text-decoration:${a.data.styleObject.valueFontStyle.includes(ce.underline)?ce.underline:"none"};
223
+ font-weight:${a.data.styleObject.valueFontStyle.includes(ie.bold)?"Bolder":"normal"};
224
+ font-style:${a.data.styleObject.valueFontStyle.includes(ie.italic)?ie.italic:"normal"};
225
+ text-decoration:${a.data.styleObject.valueFontStyle.includes(ie.underline)?ie.underline:"none"};
226
226
  font-size:${a.data.styleObject.valueFontSize}px;">
227
- ${c.nodes.dataLabelNumberFormat==",.0%"?a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":Ke(c.nodes.nodesDisplayUnits,c.nodes.dataLabelNumberFormat,c.nodes.dataLabelDecimalPrecision)(a.data.value)}
227
+ ${o.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(o.nodes.nodesDisplayUnits,o.nodes.dataLabelNumberFormat,o.nodes.dataLabelDecimalPrecision)(a.data.value)}
228
228
  <br>
229
- ${c.nodes.percentageVisibility?+a.data.parentValue?Math.round(a.data.value/a.data.parentValue*100)+"%":Math.round(a.data.value/a.data.value*100)+"%":""}
229
+ ${o.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
- ${fe}
233
- </div>`}catch(N){return me(da,"drawOrganizationChart.nodeContent",N),""}}).buttonContent(({node:a,state:f})=>{try{if(y)return`
232
+ ${me}
233
+ </div>`}catch(P){return Ce(ua,"drawOrganizationChart.nodeContent",P),""}}).buttonContent(({node:a,state:g})=>{try{if(h)return`
234
234
  <div
235
235
  style="
236
236
  color: black;
@@ -256,14 +256,14 @@ let E=t<200?200:S?e:t,b=e<200?200:S?t:e,U=E*.15*.8,Y=Ol(r,l),H=U<Y[0]+10?U:Y[0]+
256
256
  font-size: 7px;
257
257
  font-weight: bold;
258
258
  ">${a.data._directSubordinates}</span>`}
259
- </div>`}catch(N){return me(da,"drawOrganizationChart.buttonContent",N),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,f)=>20).duration(0).setActiveNodeCentered(!1).data(s).compact(!1).expandAll().fit(!1).render()}catch(d){me(da,"drawOrganizationChart",d)}},M=s=>{try{let d;if(s.data.styleObject)return c.nodes.percentageVisibility?d=s.data.styleObject.nodeHeight*10+10:d=s.data.styleObject.nodeHeight*10,d}catch(d){me(da,"calculateNodeHeight",d)}},h=(s,d)=>{try{let i={};d?i=s.data:i=s;let y,T;if(c.nodes.nodesLabelVisibility?T=50:T=20,i.styleObject)return c.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){me(da,"calculateNodeWidth",i)}},k=s=>{try{let d=s.split("-");return d[d.length-1]}catch(d){me(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:l}),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:r})})]})},Ur=({data:t,formatOptions:e,chartId:n,addLocalFilterFromLib:o,onElementClick:x,vfxPickModeActive:l,tooltipFormatter:r})=>{const c=Ce.useRef(x);c.current=x;const p=Ce.useRef(l);p.current=l;const m=new Map((t.ChartData??[]).map((Le,Ue)=>[Le.legend,Ue]));let L=t.LegendList;const u=Ce.useRef();let S,g=[0,0];const W=le.BubbleChart;let A,E,b=40,U=Jt,Y,H,I,D,w=[],z=[],K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a;Ce.useEffect(()=>{f()},[e,t,n]);const f=()=>{({chartFormatOptions:S,svg:D,width:A,height:E}=Kt(u,e)),g=Ha(S,L??[],"alias"),t=Ee(t),Z(),{longestMeasure:s,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=tl(S,se,te),{longestDimension:X,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=al(S,K,ye),{margins:U,yLabel:xe,xLabel:ge,yTitle:pe,xTitle:he,chartTitleHeight:b,legendMargin:O,innerHeight:Y,innerWidth:H}=el(A,E,s,S,X,g),qt(u,A,E,S),I=oa(D,U),kt(I,e,0,H,Y,W),Xt(u,b,A,S),fe(),Re(),Te(),il(e,!1,D,U,ge,E,he,"Bubble",xe,H,Y),ll(Y,e,0,!1,D,U,pe,xe),Me(),J(),N(),cl(D,S.legends.legendPosition,S,E,A,U,Y,he,ge,t.length)},N=()=>{try{let Le=5,Ue=30,ve={minimumValue:se,maximumValue:te};const Pe=I.append("g").attr("class","circles").attr("class","parentGroup"),Ye=S.animation.animationEnabled,We=Pe.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",be=>be.legendName.replace(/ /g,"-")).attr("fill",be=>be.legendColor!==Ie.white?be.legendColor:"none").append("path").attr("class","path").attr("id",function(be,ze){v.select(this).attr("d",v.symbol().type(v.symbolCircle).size(ne(Le,Ue,ve,be.measure,10)*rt(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(be){return`translate(${T(be.dimension)}, ${a(be.measure)})`}).attr(lt.SeriesId,be=>`${m.get(be.legendName)}_${be.legendName}`).attr(lt.DimValue,be=>String(be.dimension)).attr("opacity",Ye?0:S.plotArea.fillOpacity).style("visibility",(be,ze)=>be.dimension[0]===0||be.measure===0&&S.plotArea.hideZeroValues||be.dimension<k||be.dimension>h||be.measure<y||be.measure>i?"hidden":"visible").on("click",vt(p,c,(be,ze)=>({seriesId:`${m.get(ze.legendName)}_${ze.legendName}`,dimValue:String(ze.dimension),legendUniqueId:`${m.get(ze.legendName)}_${ze.legendName}`,seriesDisplayName:ze.legendName}))).on("mousemove",(be,ze)=>{ut([{key:S.xAxisTitle.xAxisTitleText,value:Ke(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(ze.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:Ke(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(ze.measure)},{key:"Legend",value:ze.legendName}],S,be,{alias:ze.legendName},At(r,String(ze.dimension),{alias:ze.legendName}))}).on("mouseout",()=>{ot()});Ye&&We.transition().duration(S.animation.animationDuration).ease(et[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(Le){me("BubbleChart","initCircles",Le)}};function ne(Le,Ue,ve,Pe,Ye){try{if(Pe==null)return Ye;var We=ve.minimumValue,be=ve.maximumValue,ze=Ue*Ue*2*Math.PI,ke=Le*Le*2*Math.PI,Se=Ye;if(We==be)Se=Ue;else{var oe=Pe,$=(oe-We)/(be-We)*(ze-ke)+ke;$<ke&&($=ke),Se=Math.sqrt($/(Math.PI*2))}return Se}catch(R){return me("BubbleChart","getBubbleSize",R),Ye}}const Z=()=>{try{w=[],z=[],se=void 0,te=void 0,K=void 0,ye=void 0,t.forEach(Le=>{Le.measureName&&(w.push(Le.measure),(Le.measure<se||se===void 0)&&(se=Le.measure),(Le.measure>te||te===void 0)&&(te=Le.measure)),Le.dimensionName&&(z.push(Le.dimension),(Le.dimension<K||K===void 0)&&(K=Le.dimension),(Le.dimension>ye||ye===void 0)&&(ye=Le.dimension))})}catch(Le){me("BubbleChart","iterateOverChartData",Le)}},fe=()=>{try{let Le=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):K>0?0:K*1.1,Ue=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):ye*1.1,ve=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):se>0?0:se*1.1,Pe=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):te*1.1;T=v.scaleLinear().domain([Le,Ue]).range([0,H]),a=v.scaleLinear().domain([ve,Pe]).range([Y,0])}catch(Le){me("BubbleChart","initScale",Le)}},Re=()=>{try{let{xAxisLabelArray:Le,customTickValue:Ue,autoLabelFlag:ve}=Ti(ye,K,H,e,k,h,H,!1);const Pe=v.axisBottom(T).tickFormat(Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(sa(e,Y,0,!0)).tickValues(Le.length>0?Le:null).ticks(Ue).tickPadding(8).tickSizeOuter(0);sl(I,S,0,ge,Pe,Y,H,U,a)}catch(Le){me("BubbleChart","drawXAxis",Le)}},Te=()=>{try{let{yAxisLabelArray:Le,customTickValue:Ue}=rl(te,se,Y,e,y,i);const ve=v.axisLeft(a).tickFormat(Ke(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(zt(e,H)).tickValues(Le.length>0?Le:null).ticks(Ue).tickPadding(8).tickSizeOuter(0);nl(I,S,0,xe,ve,Y)}catch(Le){me("BubbleChart","drawYAxis",Le)}},Me=()=>{try{if(S.plotArea.xCoordinate!=Ht.None){let Le;switch(S.plotArea.xCoordinate){case Ht.Mean:Le=v.mean(t,Ue=>Ue.dimension);break;case Ht.Median:Le=v.median(t,Ue=>Ue.dimension);break;case Ht.Custom:Le=rt(S.plotArea.xscaleposition);break}I.append("line").attr("x1",T(Le)).attr("y1",0).attr("x2",T(Le)).attr("y2",Y).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=Ht.None){let Le;switch(S.plotArea.yCoordinate){case Ht.Mean:Le=v.mean(t,Ue=>Ue.measure);break;case Ht.Median:Le=v.median(t,Ue=>Ue.measure);break;case Ht.Custom:Le=rt(S.plotArea.yscaleposition);break}I.append("line").attr("x1",0).attr("y1",a(Le)).attr("x2",H).attr("y2",a(Le)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(Le){me("BubbleChart","drawReferenceLines",Le)}},J=()=>{try{let Le=L?.map(Ue=>{let ve={...Ue,legendFontStyle:Ue.fontStyle,fontSize:Ue.fontSize+"px",legendFontFamily:Ue.fontFamily};return{legend:Ue.name,properties:ve,data:{}}});Wa(S,D,Le||[],A,E,g[0],b,n,U,ct.circle,!1,o)}catch(Le){me("BubbleChart","initLegendList",Le)}},Ee=Le=>{try{if(!Le||!Le.ChartData||!Le.ChartData[0])return[];const Ue=[];return Le.ChartData.forEach(Pe=>{Pe.data.forEach(Ye=>{Ue.push({dimension:parseFloat(Ye.dimension),dimensionName:Pe.legend??"Dimension",measure:Ye.value,measureName:Pe.legend??"Measure",legendName:Pe.legend,legendColor:Pe.properties?.color??Ie.black,tooltip:""})})}),Ue}catch(Ue){return console.error("BubbleChart - Data conversion failed",Ue),[]}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:n,style:{width:"100%",height:"100%"}})})},ga="ScatterChart.tsx",Br=({data:t,formatOptions:e,chartId:n,onElementClick:o,vfxPickModeActive:x,tooltipFormatter:l})=>{const r=Ce.useRef(o);r.current=o;const c=Ce.useRef(x);c.current=x;const p=t.ColorElements??[],m=t.ShapeElements??[],L=new Map(p.map((be,ze)=>[be.name,ze]));let u=[];const S=Ce.useRef();let g,W=[0,0],A,E,b=40,U=Jt,Y,H,I,D,w=Number.POSITIVE_INFINITY,z=Number.NEGATIVE_INFINITY,K=Number.POSITIVE_INFINITY,ye=Number.NEGATIVE_INFINITY,se=Number.POSITIVE_INFINITY,te=Number.NEGATIVE_INFINITY,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N=new Map,ne=new Map;Ce.useEffect(()=>{Z()},[e,t,n]);const Z=()=>{({chartFormatOptions:g,svg:D,width:A,height:E}=Kt(S,e));let be=[...m,...p];W=Ha(g,be,"alias"),Re(),{longestMeasure:s,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:y}=tl(g,K,ye),{longestDimension:X,customXaxisIntervalValue:M,customXaxisMaxValue:h,customXaxisMinValue:k}=al(g,w,z),{margins:U,yLabel:xe,xLabel:ge,yTitle:pe,xTitle:he,chartTitleHeight:b,legendMargin:O,innerHeight:Y,innerWidth:H}=el(A,E,s,g,X,W),qt(S,A,E,g),I=oa(D,U),kt(I,e,0,H,Y,"Scatter",n),Xt(S,b,A,g),Te(),Me(),J(),il(e,!1,D,U,ge,E,he,"Scatter",xe,H,Y),ll(Y,e,0,!1,D,U,pe,xe),Ee(),fe(),Le(),Ue(),cl(D,g.legends.legendPosition,g,E,A,U,Y,he,ge,u.length)},fe=()=>{try{let be=function(oe){return oe=="Square"?v.symbolSquare:oe=="Circle"?v.symbolCircle:oe=="Cross"?v.symbolCross:oe=="Triangle"?v.symbolTriangle:oe=="Star"?v.symbolStar:oe=="Diamond"?v.symbolDiamond:oe=="Wye"?v.symbolWye:v.symbolCircle};const ze=I.append("g").attr("class","circles").attr("class","parentGroup"),ke=g.animation.animationEnabled,Se=ze.append("g").selectAll(".bubbleScatter").data(u).enter().append("g").attr("fill",oe=>oe.color).attr("colorId",oe=>oe.colorName.replace(/ /g,"-")).attr("shapeId",oe=>oe.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(oe,$){v.select(this).attr("d",v.symbol().type(be(oe.shape)).size((oe.sizeValue?f(oe.sizeValue):10)*2*rt(g.plotArea.scatterSizeIndex)))}).attr("transform",function(oe){return`translate(${T(oe.dimension)}, ${a(oe.measure)})`}).attr(lt.SeriesId,oe=>`${L.get(oe.colorName)}_${oe.colorName}`).attr(lt.DimValue,oe=>String(oe.dimension)).attr("opacity",ke?0:g.plotArea.fillOpacity).style("visibility",(oe,$)=>oe.dimension[0]===0||oe.measure===0&&g.plotArea.hideZeroValues||oe.dimension<k||oe.dimension>h||oe.measure<y||oe.measure>i?"hidden":"visible").on("click",vt(c,r,(oe,$)=>({seriesId:`${L.get($.colorName)}_${$.colorName}`,dimValue:String($.dimension),legendUniqueId:`${L.get($.colorName)}_${$.colorName}`,seriesDisplayName:$.colorName}))).on("mousemove",(oe,$)=>{ut([{key:g.xAxisTitle.xAxisTitleText,value:Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)($.dimension)},{key:g.yAxisTitle.yAxisTitleText,value:Ke(g.toolTip.toolTipDisplayUnits,g.toolTip.toolTipNumberFormat,g.toolTip.toolTipDecimalPrecision)($.measure)},{key:"Color",value:$.colorName},...$.shapeName?[{key:"Shape",value:$.shapeName}]:[]],g,oe,{alias:$.colorName},At(l,String($.dimension),{alias:$.colorName}))}).on("mouseout",()=>{ot()});ke&&Se.transition().duration(g.animation.animationDuration).ease(et[g.animation.animationEffect]).attr("opacity",g.plotArea.fillOpacity)}catch(be){me(ga,"initCircles",be)}},Re=()=>{try{let be=function(ze,ke,Se){K=Math.min(K,ze.value),ye=Math.max(ye,ze.value),w=Math.min(w,ze.dimension),z=Math.max(z,ze.dimension),se=Math.min(se,ze.value2??10),te=Math.max(te,ze.value2??10),u.push({dimension:ze.dimension,measure:ze.value,sizeValue:ze.value2,colorName:ke,shapeName:Se,shape:ne.get(Se)||"Circle",color:N.get(ke)||"#6ba2b8ff"})};p.forEach(ze=>{N.set(ze.name,ze.color)}),m.forEach(ze=>{ne.set(ze.name,ze.markerShape)}),t.ChartData.forEach(ze=>{ze.children&&ze.children.length>0&&ze.children.forEach(ke=>{ke.data.forEach(Se=>{be(Se,ze.legend,ke.legend)})}),ze.data&&ze.data.length>0&&ze.data.forEach(ke=>{be(ke,ze.legend)})})}catch(be){me(ga,"iterateOverChartData",be)}},Te=()=>{try{let be=g.yAxisLabel.yAxisIntervalsVisibility&&g.yAxisLabel.yAxisMinText!==""?parseFloat(g.yAxisLabel.yAxisMinText):K>0?0:K*1.1,ze=g.yAxisLabel.yAxisIntervalsVisibility&&g.yAxisLabel.yAxisMaxText!==""?parseFloat(g.yAxisLabel.yAxisMaxText):ye*1.1;a=v.scaleLinear().domain([be,ze]).range([Y,0]),f=v.scaleLinear().domain([se,te]).range([1,10])}catch(be){me(ga,"initScale",be)}},Me=()=>{try{const ze=(parseFloat(e.plotArea.ticksHeight)||100)/100*Y;let{xAxisLabelArray:ke,customTickValue:Se}=Ti(z,w,H,e,k,h,Y,!1);ke.length>0?T=v.scaleLinear().domain([ke[0],ke[ke.length-1]]).range([0,H]):T=v.scaleLinear().domain([k,h]).range([0,H]);const oe=v.axisBottom(T).tickFormat(Ke(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(g.plotArea.gridLinesVisibility&&g.plotArea.gridLinesVertical?g.xAxisLabel.xAxisPosition==="0"?-ze:g.xAxisLabel.xAxisPosition==="1"?ze:0:0).tickValues(ke.length>0?ke:null).ticks(Se).tickPadding(8).tickSizeOuter(0);sl(I,g,0,ge,oe,Y,H,U,a)}catch(be){me(ga,"drawXAxis",be)}},J=()=>{try{const ze=(parseFloat(e.plotArea.ticksWidth)||100)/100*H;let{yAxisLabelArray:ke,customTickValue:Se}=rl(ye,K,Y,e,y,i);const oe=v.axisLeft(a).tickFormat(Ke(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(g.plotArea.gridLinesVisibility&&g.plotArea.gridLinesHorizontal?-ze:0).tickValues(ke.length>0?ke:null).ticks(Se).tickPadding(8).tickSizeOuter(0);nl(I,g,0,xe,oe,Y)}catch(be){me(ga,"drawYAxis",be)}},Ee=()=>{try{if(g.plotArea.xCoordinate!=Ht.None){let be;switch(g.plotArea.xCoordinate){case Ht.Mean:be=v.mean(u,ze=>ze.dimension);break;case Ht.Median:be=v.median(u,ze=>ze.dimension);break;case Ht.Custom:be=rt(g.plotArea.xscaleposition);break}I.append("line").attr("x1",T(be)).attr("y1",0).attr("x2",T(be)).attr("y2",Y).attr("stroke",g.plotArea.refLineBorderColor).attr("stroke-width",g.plotArea.refLineBorderThickness)}if(g.plotArea.yCoordinate!=Ht.None){let be;switch(g.plotArea.yCoordinate){case Ht.Mean:be=v.mean(u,ze=>ze.value);break;case Ht.Median:be=v.median(u,ze=>ze.value);break;case Ht.Custom:be=rt(g.plotArea.yscaleposition);break}I.append("line").attr("x1",0).attr("y1",a(be)).attr("x2",H).attr("y2",a(be)).attr("stroke",g.plotArea.refLineBorderColor).attr("stroke-width",g.plotArea.refLineBorderThickness)}}catch(be){me(ga,"drawReferenceLines",be)}},Le=()=>{try{g.legends.legendAlignment===void 0&&(g.legends.legendAlignment="Top"),g.legends.legendAlignmentTopBottom===void 0&&(g.legends.legendAlignmentTopBottom="Start");let be=g.legends.legendPosition,ze=g.legends.legendAlignment,ke=g.legends.legendAlignmentTopBottom;switch(be){case Je.none:break;case Je.right:ve(p,A-O-30,b+5,O+25,E-b-10);break;case Je.top:ve(p,5,b+5,A-10,30);break;case Je.left:ve(p,5,b+5,O+25,E-b-10);break;case Je.bottom:ve(p,5,E-35,A-10,30);break}}catch(be){me(ga,"drawColors",be)}},Ue=()=>{try{g.legends.legendAlignment===void 0&&(g.legends.legendAlignment=Ea.top),g.legends.legendAlignmentTopBottom===void 0&&(g.legends.legendAlignmentTopBottom=Ra.start);let be=g.legends.legendPosition;if(m.length>0)switch(be){case Je.none:break;case Je.right:Pe(m,A-O-30,E/2+10,O+25,E-b-10);break;case Je.top:Pe(m,A/2+5,b+5,A-10,30);break;case Je.left:Pe(m,5,E/2+10,O+25,E-b-10);break;case Je.bottom:Pe(m,A/2+5,E-35,A-10,30);break}}catch(be){me(ga,"drawShapes",be)}},ve=(be,ze,ke,Se,oe)=>{try{let R=g.legends.legendPosition,ae=g.legends.legendFontStyle,_=D.append("foreignObject").attr("visibility",g.legends.legendVisibility?"visible":"hidden").attr("x",ze).attr("y",ke).attr("width",Se).attr("height",oe).style("user-select","none"),G=(R==Je.top||R==Je.bottom)&&m.length>0?"50%":"100%";var $=_.append("xhtml:div").style("width",G).style("display","flex").style("height",R==Je.top||R==Je.bottom?oe-1+"px":"calc(50% - 5px)").style("border",g.legends.legendBorder?`${g.legends.legendBorderThickness+"px solid"+g.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+n).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",R==Je.top||R==Je.bottom?g.legends.legendAlignmentTopBottom==Ra.start?"flex-Start":g.legends.legendAlignmentTopBottom==Ra.middle?"center":"flex-end":g.legends.legendAlignment==Ea.top?"flex-Start":g.legends.legendAlignment==Ea.middle?"center":"flex-end").style("flex-direction",R==Je.top||R==Je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");be.forEach((Q,ee)=>{let F=$.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",g.legends.legendFontSize+"px").style("font-family",g.legends.legendFontFamily).on("mousemove",function(ue){g.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[colorId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(ue){D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[colorId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(R==Je.bottom||R==Je.top)&&F.style("margin-right","16px").style("white-space","nowrap"),F.append("div").style("height","10px").style("width","10px").style("background",Q.color).style("border-radius","1px");let q=g.legends.legendColorMode=="1"?Q.color?Q.color:Ie.black:g.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",q).attr("title",Q.name).style("font-size",g.legends.legendFontSize+"px").style("font-family",g.legends.legendFontFamily).style("font-style",ae.includes(ce.italic)?ce.italic:"").style("text-decoration",ae.includes(ce.underline)?ce.underline:"").style("font-weight",ae.includes(ce.bold)?ce.bold:"").style("white-space","nowrap").html(Q.name)})}catch(R){me(ga,"colorListWithScroll",R)}},Pe=(be,ze,ke,Se,oe)=>{try{let R=g.legends.legendPosition,ae=g.legends.legendFontStyle,_=D.append("foreignObject").attr("visibility",g.legends.legendVisibility?"visible":"hidden").attr("x",ze).attr("y",ke).attr("width",Se).attr("height",oe).style("user-select","none"),G=g.legends.legendPosition==Je.top||g.legends.legendPosition==Je.bottom?"calc(50% - 5px)":"calc(100%)";var $=_.append("xhtml:div").style("width",G).style("display","flex").style("height",R==Je.top||R==Je.bottom?oe-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",g.legends.legendBorder?`${g.legends.legendBorderThickness+"px solid"+g.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+n).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",R==Je.top||R==Je.bottom?g.legends.legendAlignmentTopBottom==Ra.start?"flex-Start":g.legends.legendAlignmentTopBottom==Ra.middle?"center":"flex-end":g.legends.legendAlignment==Ea.top?"flex-Start":g.legends.legendAlignment==Ea.middle?"center":"flex-end").style("flex-direction",R==Je.top||R==Je.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");be.forEach((Q,ee)=>{let F=$.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(ue){g.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[shapeId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(ue){g.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[shapeId="'+We(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(R==Je.top||R==Je.bottom)&&F.style("margin-right","16px").style("white-space","nowrap"),Ye(F,Q.markerShape);let q=g.legends.legendColorMode=="1"?Ie.black:g.legends.legendSelectedUnicolor;F.append("div").style("margin-left","5px").style("color",q).attr("title",Q.name).style("font-size",g.legends.legendFontSize+"px").style("font-family",g.legends.legendFontFamily).style("font-style",ae.includes(ce.italic)?ce.italic:"").style("text-decoration",ae.includes(ce.underline)?ce.underline:"").style("font-weight",ae.includes(ce.bold)?ce.bold:"").style("white-space","nowrap").html(Q.name)})}catch(R){me(ga,"shapeListWithScroll",R)}},Ye=(be,ze)=>{try{const Se={none:v.symbolCircle,circle:v.symbolCircle,square:v.symbolSquare,triangle:v.symbolTriangle,cross:v.symbolCross,diamond:v.symbolDiamond,star:v.symbolStar,wye:v.symbolWye}[ze?.toLowerCase()]||v.symbolCircle;be.append("svg").attr("width",14).attr("height",14).append("path").attr("d",v.symbol().type(Se).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(ke){me(ga,"shapesForScatterPlot",ke)}},We=(be="")=>{try{return be.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(ze){me(ga,"getJQuerySelector",ze)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:S,id:n,style:{width:"100%",height:"100%"}})})},Wr=({isDateType:t,formatOptions:e,data:n,isAdvancedAnalyticsWaterFall:o=!1,onElementClick:x,vfxPickModeActive:l,tooltipFormatter:r})=>{const c=crypto.randomUUID?.();let p=0,m;const L=le.WaterfallChart,u=Ce.useRef(),S=Ce.useRef(x);S.current=x;const g=Ce.useRef(l);g.current=l;const W=o??!1,A=W?[]:mt(n.ChartData,n.DimensionList),E=n.DimensionList,b=!1,U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z=[],fe=[],Re,Te=0;const Me=2;let J={dimensionList:E,chartType:L,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(ae){me("WaterfallChart","createWaterfallChart",ae)}},[e]);const Ee=()=>{({formatOptions:e,svg:d,width:h,height:k}=Ft(u,e)),Le(),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe}=Mt(h,k,he,O,J.yMaxLeft,e,J.legendList,J.dimensionList,J.yMaxRight,U,Y,t),ze(D),St(d,h,k,e),i=wt(d,D),kt(i,e,s,X,M,L,c),ve(),Ye(),Zt(i,e,s,w,f,M),ke(A,k,d,D,X),Dt(e,b,d,D,z,k,ye,J.chartType,w,X,M),Vt(M,e,s,b,d,D,K,w),Gt(d,U,D,e,s,M,X,pe,xe),Nt(d,e,h,te)},Le=()=>{if(W){let ee=R(n);ee=ee.filter(q=>q.up+q.down+q.base!=0),J.dimensionList=ee.map(q=>q.xKey),J.legendList=J.dimensionList,fe=v.stack().keys(["base","dimensionTotal","up","down"])(ee);const F=[];fe.forEach(q=>q.forEach(ue=>F.push(ue[1]))),J.yMaxLeft=v.max(F)??0,J.yMinLeft=v.min(F)??0;return}A.forEach(ee=>{ee.data.forEach(F=>{})}),Z=JSON.parse(JSON.stringify(A)),e.plotArea.fitChart?ne=J.dimensionList:ne=J.dimensionList.slice(Te,Te+Me),e.plotArea.hideZeroValues&&(J.hideZeroValues=!0);let ae=W?R(n):oe(),_=JSON.parse(JSON.stringify(ae));ae.forEach(ee=>{if(!ee.Dimension&&(ee.Up<1e-9&&ee.Up!==0||ee.Down<1e-9&&ee.Down!==0)){let F=_.findIndex(q=>q.Legend===ee.Legend);F!==-1&&_.splice(F,1)}}),ae=_,ae.forEach(ee=>ee.dimension?J.legendList.push(ee.dimension):J.legendList.push(ee.legend)),fe=v.stack().keys(["base","dimensionTotal","up","down"])(ae);let G=[],Q=[];fe.forEach(ee=>{ee.key=="base"?ee.opacity=0:ee.opacity=1,ee.forEach(F=>G.push(F)),!Q.includes(ee.dimension)&&ee.dimensionTotal===0&&ee.total===0&&Q.push(ee.dimension)}),J.yMaxLeft=v.max(G,ee=>ee[1]),J.yMinLeft=v.min(G,ee=>ee[1]),e.xAxisLabel.hideZeroValues&&(Q.length>0&&Q.forEach(ee=>{J.legendList=J.legendList.filter(F=>F!==ee)}),J.dimensionList=J.legendList),t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(ee=>ee):J.dimensionList,Ue(ae)},Ue=ae=>{try{let _=[],G=[],Q=[];ae&&ae.forEach((F,q)=>{F.dimension&&(_.push(F.dimension),G.push({dimension:F.dimension,chartDataIndex:q,selfIndex:G.length}))}),t?Q=Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList).map(F=>F):Q=_;let ee=JSON.parse(JSON.stringify(J.legendList));G.forEach((F,q)=>{ee[F.chartDataIndex]=Q[F.selfIndex]}),J.legendList.forEach((F,q)=>{J.formattedDimensionListMap.set(F,ee[q])})}catch(_){throw _}},ve=()=>{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I).yAxisLabelArray;J.yMaxLeft=ae[ae.length-1],J.yMinLeft=ae[0],y=v.scaleLinear().domain([J.yMinLeft>=0?H!==void 0&&!Number.isNaN(H)?H:0:J.yMinLeft<0?J.yMinLeft*1.1:J.yMinLeft*.9,J.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:J.yMaxLeft*1.1]).range([M,0]),a=[0,X],Pe()},Pe=()=>{p=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(X/J.legendList.length),T=v.scaleBand().domain(J.legendList).range(a).padding(.4)},Ye=()=>{We();{let ae=yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I);f=v.axisLeft(y).tickFormat(_=>Xe(_,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-X+0:0).tickValues(ae.autoLabelFlag?void 0:ae.yAxisLabelArray).ticks(ae.customTickValue).tickPadding(8).tickSizeOuter(0)}m=v.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,W?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},We=()=>{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(gt(J.legendList,X,e))},be=ae=>{let _;if(fe.forEach((G,Q)=>G.forEach(ee=>ee.key=G.key)),Re){let G=Z.map(Q=>Q.legend);_=v.stack().keys(G)(Re),_.forEach((Q,ee)=>{_[ee].color=Z[ee].properties.color})}_&&_.forEach(G=>{G.forEach(Q=>{Q.Key=G.key})}),[0,1].forEach(G=>{if(G===1&&(fe=_),fe){let Q=i.selectAll(`.parentGroup-${G}`).data([null]);Q=Q.enter().append("g").attr("class",`parentGroup parentGroup-${G}`).merge(Q);let ee=Q.selectAll(`.bar-group-${G}`).data(fe);ee=ee.enter().append("g").attr("class",`bar-group-${G}`).attr("fill",P=>P.color?P.color:m(P.key)!==Ie.white?m(P.key):"none").attr("opacity",P=>P.opacity).merge(ee);let q=ee.selectAll("rect").data(P=>P,P=>P.key||P.Key);const ue=e.animation.animationEnabled,B=q.enter().append("rect").attr("class","rect").attr("class",P=>P.key?P.key.replace(/ /g,"-"):P.Key.replace(/ /g,"-")).attr("x",P=>T(W?P.data.xKey:P.data.dimension||P.data.legend)).attr("y",y(0)??0).attr("clip-path",`url(#${c}-clip)`).attr("height",0).attr("width",T.bandwidth()).attr("visibility",P=>G===0&&P.data.dimension&&Re?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(P,C)=>{const re=W?va.base:va.dimensionTotal,j={markerShape:"square",markerColor:C.key===re?e.plotArea.totalColor:C.key===va.down?e.plotArea.negativeColor:e.plotArea.positiveColor};ut([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():C.properties?.currentMeasure?C.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(C.key===va.up?"+":C.key===va.down?"-":"")+Xe(C.key===va.dimensionTotal?C.data.dimensionTotal:C[1]-C[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(W?C.key!==va.base?C.data.xKey:va.total:C.Key?C.Key.includes("~$~")?C.Key.split("~$~")[1]:C.Key:C.data.legend?C.data.legend.includes("~$~")?C.data.legend.split("~$~")[1]:C.data.legend:va.total).trim()||""}],e,void 0,j,At(r,String(J.formattedDimensionListMap.get(W?C.data.xKey:C.data.dimension||C.data.legend)??(W?C.data.xKey:C.data.dimension||C.data.legend)??""),{...j,alias:C.properties?.alias??C.properties?.currentMeasure??String(C.Key??C.key??"")}))}).on("mouseout",()=>{ot()}).attr(lt.SeriesId,P=>String(P.key??P.Key??"")).attr(lt.DimValue,P=>String(W?P.data.xKey||"":P.data.dimension||P.data.legend||"")).on("click",vt(g,S,(P,C)=>{const re=String(C.key??C.Key??""),j=String(W?C.data.xKey||"":C.data.dimension||C.data.legend||"");return{seriesId:re,dimValue:j,legendUniqueId:re,seriesDisplayName:re}}));if((ue?B.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):B).attr("y",P=>P[1]?y(P[1]):0).attr("height",P=>P[1]?y(P[0])-y(P[1]):0),q.exit().remove(),q=B.merge(q),e.plotArea.plotAreaDataLabel=="2"&&G!=1){const P=ee.selectAll("text").data(j=>j),C=P.enter().append("text").text(j=>Xe(j[1]-j[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",j=>T(W?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");(ue?C.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):C).attr("y",j=>j[1]?y(j[1])-15:0),P.exit().remove()}}}),i.selectAll(".parentGroup").raise()},ze=ae=>{X=h-ae.left-ae.right,M=k-ae.bottom-ae.top},ke=(ae,_,G,Q,ee)=>{if(!e.plotArea.fitChart){const F=ae[0].data.length-Me,q=_-20;ne=J.dimensionList.slice(Te,Te+Me),Pe(),Z=JSON.parse(JSON.stringify(ae)),Z.forEach((V,P)=>Z[P].data=V.data.filter(C=>ne.includes(C.dimension))),We(),G.append("rect").attr("x",Q.left).attr("y",q).attr("width",ee).attr("height",8).attr("fill","#ddd").attr("rx",4);const ue=ee*Me/J.dimensionList.length,B=G.append("rect").attr("x",Q.left).attr("y",q).attr("width",ue).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(v.drag().on("drag",V=>{let P=Math.min(Math.max(V.x,Q.left),Q.left+ee-ue);B.attr("x",P),Te=Math.round((P-Q.left)/(ee-ue)*F),ne=J.dimensionList.slice(Te,Te+Me),Pe(),Z=JSON.parse(JSON.stringify(ae)),Z.forEach((C,re)=>Z[re].data=C.data.filter(j=>ne.includes(j.dimension))),We(),Se()}));G.on("wheel",V=>{V.preventDefault();const P=Math.abs(V.deltaX)>Math.abs(V.deltaY)?V.deltaX:V.deltaY;Te+=P>0?1:-1,Te=Math.max(0,Math.min(Te,F));const C=Q.left+(ee-ue)*Te/F;B.attr("x",C),Pe(),Z=JSON.parse(JSON.stringify(ae)),Z.forEach((re,j)=>Z[j].data=re.data.filter(ie=>ne.includes(ie.dimension))),We(),Se()})}Se()},Se=()=>{ta(i,J,z,e,s,y,N,se,k,p,t,X,M,J.legendList,T),be()},oe=()=>{try{if(A.length<1)return[];if(J.dimensionList.length<2)return[];let ae=[],_=[],G=[],Q="";if(Q.length>1){let B=Q;A.forEach(V=>{B===V.properties.currentLegend?_.push(V):G.push(V)})}_.length>0&&(Z=_);let ee=0,F=0;for(let B=0;B<Z.length;++B)ee=ee+Z[B].data[0].value;let q="";for(let B=1;B<ne.length;++B){let V={};V.dimension=ne[B-1],V.total=ee,V.base=0,V.dimensionTotal=ee,V.up=0,V.down=0,ae.push(V);for(let P=0;P<Z.length;++P){let C={};for(let re=0;re<P;re++)q=q+" ";F=Z[P].data[B].value-Z[P].data[B-1].value,F!==0&&(C.legend=q+Z[P].properties.legend,C.dimensionTotal=0,F<0?(C.base=ee+F,C.down=-F,C.up=0,C.total=ee-F):(C.base=ee,C.down=0,C.up=F,C.total=ee+F),ee=ee+F,ae.push(C))}}let ue={};return ue.dimension=ne[ne.length-1],ue.dimensionTotal=ee,ue.base=0,ue.total=ee,ue.up=0,ue.down=0,ae.push(ue),G.length>0&&(Z=G,Re=Lt(ne,G,!1)),ae}catch(ae){throw ae}},$=ae=>ae==null||ae===""?0:Number(ae),R=ae=>(ae[0]?.Column1==""?ae.filter(G=>G.Column1&&G.Column1!=="*"):o?ae.Data:ae).map(G=>({xKey:G.Column1||G.Dimension||G.Legend,base:$(G.Column3||G.Total),up:$(G.Column4||G.Up),down:$(G.Column5||G.Down),total:$(G.Column6||G.total),dimensionTotal:$(G.Column2||G.Base)}));return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:u,id:c,style:{width:"100%",height:"100%"}})})},Hr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,onElementClick:l,vfxPickModeActive:r,tooltipFormatter:c})=>{const p=crypto.randomUUID();let m=0;const L=le.TornadoChart,u=n.IsadvanceanalyticsChart??n.IsCalCSensitivity,S=Ce.useRef(),g=Ce.useRef(l);g.current=l;const W=Ce.useRef(r);W.current=r;let A=mt(n.ChartData,n.DimensionList,!0);A=nr(A,n,u);const E=n.DimensionList,b=!0,U=!1,Y=!1;let H=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y,T,a,f,N,ne,Z,fe=[],Re=0,Te=2,Me=!1,J={dimensionList:E,chartType:L,chartData:[],formatOptions:e,legendList:n.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{Ee()}catch(R){me("Tornadochart","createTornadoChart",R)}},[e]);const Ee=()=>{({formatOptions:e,svg:d,width:h,height:k}=Ft(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ue(),{formatOptions:e}=ea(e,A,n.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:O}=Rt(e,J.yMinLeft,J.yMaxLeft,J.yMinRight,J.yMaxRight),{margin:D,yLabel:w,xLabel:z,yTitle:K,xTitle:ye,dimensionHeightWidthArray:se,chartTitleHeight:te,secondaryAxisTitleWidth:xe,legendMargin:ge,secondaryYLabel:pe,visibleBars:Te,columnWidth:m,scrollbarVisible:Me}=Mt(h,k,he,O,J.yMaxLeft,e,u?J.legendList.map(R=>R.alias.split(" - ")[0]):J.legendList.map(R=>R.alias),J.dimensionList,J.yMaxRight,U,Y,t,!0,J),ze(D),St(d,h,k,e),i=wt(d,D),kt(i,e,s,X,M,L),ve(),We(),ra(e,i,z,M,X,N),Dt(e,b,d,D,z,k,ye,J.chartType,w,X,M),Vt(M,e,s,b,d,D,K,w,X),Gt(d,U,D,e,s,M,X,pe,xe),Nt(d,e,h,te),It(k,d,se,te,h,ge,e,Le(A,J.legendList,u,e),p,s,D,ct.rectangle),oe(A,k,h,d,D,X,Me,Te,J,Re,!1,ke,b)},Le=(R,ae,_,G)=>R.map((Q,ee)=>{const F=ae[ee];if(!F)return{...Q,properties:{}};let q=F.alias;_&&F.alias&&(q=F.alias.split(" - ")[0].trim());let ue=F.color;return _&&q&&(q.includes("+ve")?ue=G.plotArea.plotAreaCalculatedHigh:q.includes("-ve")&&(ue=G.plotArea.plotAreaCalculatedLow)),{...Q,properties:{...F,alias:q,color:ue}}}).filter(Q=>Q.properties&&Object.keys(Q.properties).length>0),Ue=()=>{let R;if(u)J.chartData=A,J.yMaxLeft=Math.min(...A.map(_=>_.data[0].value)),J.yMaxRight=Math.max(...A.map(_=>_.data[0].value));else{const _=A[0]?.properties?.measureUniqueId;let G=0,Q=-1/0;R=A.map((ee,F)=>{const q=ee.properties.measureUniqueId===_,ue=ee.data.map(V=>{const P=q?-Math.abs(V.value):Math.abs(V.value);return{...V,value:P}}),B=ue.map(V=>V.value);return q?G=Math.min(G,Math.min(...B)):Q=Math.max(Q,Math.max(...B)),{...ee,data:ue}}),J.chartData=R,J.yMaxLeft=G,J.yMaxRight=Q}const ae=t?Tt(e.xAxisLabel.xAxisNumberFormat,J.dimensionList):J.dimensionList;J.dimensionList.forEach((_,G)=>{J.formattedDimensionListMap.set(_,ae[G])}),fe=JSON.parse(JSON.stringify(u?A:R)),A=fe,Z=J.dimensionList,e.plotArea.hideZeroValues&&(J.hideZeroValues=!0)},ve=()=>{let R=J.yMaxLeft,ae=J.yMaxRight,_=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,G,Q=!1,ee=!1;R>ae?(G=R,Q=!0):(G=ae,ee=!0);let F=e.annotation.annotationVisibility!="5"?R/G!==1?Math.abs(R/G)*100<10?3:0:Math.abs(ae/G)*100<10?3:0:0,q=0,ue=0;R<0&&ae>0?(q=R*(1.2+(ee?F:0)),ue=ae*(1.2+(Q?F:0))):R>=0&&ae>=0?(q=0,ue=ae*(1.2+(Q?F:0))):R<=0&&ae<=0?(q=R*(1.2+(ee?F:0)),ue=0):(q=R*1.2,ue=ae*1.2),q=Math.floor(q),ue=Math.ceil(ue),a=v.scaleLinear().domain([q,ue]).range([_,X-_]),T=a,Pe()},Pe=()=>{y=v.scalePoint().domain(Z).range([M,0]).padding(.5)},Ye=()=>{f=v.axisLeft(y).tickSize(zt(e,X-a(0),0)).tickSizeOuter(0).tickValues(gt(Z,M,e)),ne=v.axisRight(y).tickSize(zt(e,a(0),0)).tickSizeOuter(0).tickValues(gt(Z,X,e))},We=()=>{N=v.axisBottom(a).tickFormat(R=>Xe(R,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(yt(J.yMaxRight,J.yMaxLeft,M,e,J,H,I,b,X).yAxisLabelArray).ticks(yt(I||J.yMaxLeft,J.yMinLeft,M,e,J,H,I,b,X).customTickValue??X/30).tickPadding(8).tickSizeOuter(0)},be=()=>{i.selectAll(".parentGroup").remove();const R=e.plotArea.plotAreaCalculatedHigh,ae=e.plotArea.plotAreaCalculatedLow,_=i.append("g").attr("class","parentGroup"),G=e.animation.animationEnabled,Q=_.selectAll("rect").data(fe.flatMap(F=>F.data.map(q=>({...q,legendText:u?F.legend.split("ve) - ")[1]?.trim()??F.legend:J.dimensionList[0]==le.TornadoDefaultEntry?Ci.default:F.legend.split("-")[1]?.trim()??F.legend,properties:F.properties})))).enter().append("rect").attr("class","rect").attr("y",F=>(F.legendText?y(F.legendText):y(le.TornadoDefaultEntry))-m/2).attr("height",m).attr("x",T(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",F=>F.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",F=>`${F.properties.stackBorderWidth}px`).attr("hoverId",F=>((u?F.legend.split(" - ")[0]:F.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",F=>F.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?F.properties.stackBorderColor:"none").style("fill",F=>u?F.value>0?R!==Ie.white?R:"none":ae!==Ie.white?ae:"none":F.properties.color).on("mousemove",(F,q)=>{ut([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():n.IsCalCSensitivity?q.properties.currentMeasure.split("~$~")[1]:q.dimension},{key:"Legend",value:q.legendText},{key:"Value",value:Xe(Math.abs(q.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,F,n.IsCalCSensitivity?q.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:q.properties,At(c,String(J.formattedDimensionListMap.get(q.legend)??q.legend??""),q.properties))}).on("mouseout",ot).attr(lt.SeriesId,F=>String(F.properties?.legendUniqueId??"")).attr(lt.DimValue,F=>String(F.legend??F.legendText??"")).on("click",vt(W,g,(F,q)=>({seriesId:String(q.properties?.legendUniqueId??""),dimValue:String(q.legend??q.legendText??""),legendUniqueId:String(q.properties?.legendUniqueId??""),seriesDisplayName:String(q.properties?.alias||q.properties?.name||q.legendText||"")})));(G?Q.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]):Q).attr("x",F=>F.value>=0?T(0):T(F.value)).attr("width",F=>Math.abs(T(F.value)-T(0)))},ze=R=>{X=h-R.left-R.right,M=k-R.bottom-R.top},ke=(R,ae,_)=>{fe=ae,Z=R,Te=_,$()};function Se(R){const ae=new Map;return R.forEach(_=>{let G=ae.get(_.properties.legendUniqueId);if(G){let Q=G.data??[];Q.push(_.data[0]),ae.set(_.properties.legendUniqueId,{...G,data:Q})}else G={..._,data:[_.data[0]]},ae.set(_.properties.legendUniqueId,G)}),ae.size>0?Array.from(ae.keys()).map(_=>ae.get(_)):R}function oe(R,ae,_,G,Q,ee,F,q,ue,B,V,P,C=!1){const re=(j,ie,we,de,Ae)=>{try{if(Ae&&(j=B+j),!ue||!Array.isArray(ue.dimensionList)||!Array.isArray(R))return;j=j==null?0:Number(j),ie=ie==null?0:Number(ie),we=we==null?0:Number(we),B=Za(Math.round(j),0,Math.max(0,ie)),q=typeof q=="number"?q:0;const De=B,$e=De+q;let Fe=ue.dimensionList.slice(De,$e);const _e=Fe[0]==le.TornadoDefaultEntry;let it=JSON.parse(JSON.stringify(R||[]));it=it.filter(qe=>_e?!0:Fe.includes(qe.legend.split(" - ")[1]));const nt=Q?.left??0,Ba=Q?.top??0,di=Number(ee)||0,Ia=Number(M)||0,vi=Number(we)||0,Be=ie===0?1:ie;if(C){const qe=Ba+(Ia-vi)*(ie===0?0:B)/Be;de&&typeof de.attr=="function"&&de.attr("y",qe)}else{const qe=nt+(di-vi)*(ie===0?0:B)/Be;de&&typeof de.attr=="function"&&de.attr("x",qe)}P(Fe,it,q)}catch(De){typeof me=="function"&&me("ColumnChart","updateFromScrollPosition",De)}};if(F){const j=ae-Q.top-Q.bottom,ie=Math.max(0,E.length-q),we=ae-8;G.append("rect").attr("id","scrollbarTrack").attr("x",C?_-8:Q.left).attr("y",C?Q.top:we).attr("width",C?8:ee).attr("height",C?j:8).attr("fill","#ccc");const de=(C?j:ee)*q/ue.dimensionList.length,Ae=G.append("rect").attr("x",C?_-8:Q.left).attr("y",C?Q.top:we).attr("width",C?8:de).attr("height",C?de:8).attr("fill","#999").style("cursor",C?"ns-resize":"ew-resize");Ae.call(v.drag().on("drag",De=>{if(C){const Fe=(Za(De.y,Q.top,Q.top+j-de)-Q.top)/(j-de)*(ie||1);re(Fe,ie,de,Ae,!1),Ae.attr("y",Q.top+(j-de)*(ie===0?0:B)/(ie===0?1:ie))}else{const Fe=(Za(De.x,Q.left,Q.left+ee-de)-Q.left)/(ee-de)*(ie||1);re(Fe,ie,de,Ae,!1),Ae.attr("x",Q.left+(ee-de)*(ie===0?0:B)/(ie===0?1:ie))}})),G.on("wheel",De=>{De.preventDefault();const Fe=(Math.abs(De.deltaX)>Math.abs(De.deltaY)?De.deltaX:De.deltaY)>0?1:-1;if(re(Fe,ie,de,Ae,!0),C){const _e=Q.top+(j-de)*(ie===0?0:B)/(ie===0?1:ie);Ae.attr("y",_e)}else{const _e=Q.left+(ee-de)*(ie===0?0:B)/(ie===0?1:ie);Ae.attr("x",_e)}})}else G.on("wheel",null);re(0,0,0,null,!0)}const $=()=>{Pe(),Ye(),na(e,i,z,M,X,f,ne,T,J.yMaxLeft,Z,L,t,h,se,m,y),be();const R=Se(fe);$a(R??[],y,T,null,D,pt,[],[],e,L,k,h,X,Z,M,p,d,x,y,m,o,u,b,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%"}})})},Gr=({isDateType:t,formatOptions:e,data:n,isReportEditable:o,onDataLabelCoordinatesChange:x,addLocalFilterFromLib:l,tooltipFormatter:r})=>{const c=crypto.randomUUID();let p=0;const m=le.DotPlot,L=Ce.useRef(),u=mt(n.ChartData,n.DimensionList),S=n.DimensionList,g=!0,W=!1;let A=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,E=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,b,U,Y,H,I,D,w,z,K,ye,se,te,xe,ge,pe,he,O,X,M,h,k,s,d,i,y=[],T=0,a=2,f=!1,N=[];const ne=!1;let Z={dimensionList:S,chartType:m,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ce.useEffect(()=>{try{fe()}catch(ke){me("StackStackHorizontalBarchart","createDotPlot",ke)}},[e]);const fe=()=>{({formatOptions:e,svg:O,width:pe,height:he}=Ft(L,e)),Re(),{maxNumberForPrimaryAxis:se,maxNumberForSecondaryAxis:te}=Rt(e,Z.yMinLeft,Z.yMaxLeft,Z.yMinRight,Z.yMaxRight),{margin:b,yLabel:U,xLabel:Y,yTitle:H,xTitle:I,dimensionHeightWidthArray:D,chartTitleHeight:w,secondaryAxisTitleWidth:z,legendMargin:K,secondaryYLabel:ye,visibleBars:a,columnWidth:p,scrollbarVisible:f}=Mt(pe,he,se,te,Z.yMaxLeft,e,Z.legendList,Z.dimensionList,Z.yMaxRight,W,ne,t,g,Z),Ue(b),St(O,pe,he,e),X=wt(O,b),kt(X,e,0,xe,ge,m),Te(),J(),ra(e,X,U,ge,xe,s),Dt(e,g,O,b,Y,he,I,Z.chartType,U,xe,ge),Vt(ge,e,0,g,O,b,H,U),Nt(O,e,pe,w),It(he,O,D,w,pe,K,e,u,c,0,b,ct.rectangle,m,l),_t(u,he,pe,O,b,xe,f,a,Z,T,!1,ve,g)},Re=()=>{const ke=[],Se=[];let oe=[],$=-1/0,R=1/0,ae=-1/0,_=1/0;u.forEach(G=>{Se.push(G.properties.legendUniqueId),G.data.forEach(Q=>{ke.push(Q),$=Math.max($,Q.value),R=Math.min(R,Q.value)})}),Z.chartData=ke,Z.legendList=Se,Z.yMaxLeft=$,Z.yMinLeft=R>0?0:R,Z.yMaxRight=ae,Z.yMinRight=_,oe=t?Tt(e.xAxisLabel.xAxisNumberFormat,Z.dimensionList).map(G=>G):Z.dimensionList,oe=t?Tt(e.xAxisLabel.xAxisNumberFormat,Z.dimensionList).map(G=>G):Z.dimensionList,Z.dimensionList.forEach((G,Q)=>{Z.formattedDimensionListMap.set(G,oe[Q]),Z.formattedDimensionListMap.set(G,oe[Q])}),y=JSON.parse(JSON.stringify(u)),e.plotArea.fitChart?i=Z.dimensionList:i=Z.dimensionList.slice(T,T+a),e.plotArea.hideZeroValues&&(Z.hideZeroValues=!0)},Te=()=>{let ke=yt(E||Z.yMaxLeft,Z.yMinLeft,ge,e,Z,A,E,g,xe).yAxisLabelArray;Z.yMaxLeft=ke[ke.length-1],Z.yMinLeft=ke[0],M=v.scaleLinear().domain([Z.yMinLeft>=0?A!==void 0&&!Number.isNaN(A)?A:0:Z.yMinLeft<0?Z.yMinLeft*1.1:Z.yMinLeft*.9,Z.yMaxLeft<=0?0:E!==void 0&&!Number.isNaN(E)?E:Z.yMaxLeft*1.1]).range([0,xe]),k=[ge,0],Me()},Me=()=>{v.scaleBand().domain(["layeredLegend"]).range([0,p]).paddingInner(Z.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),h=v.scalePoint().domain(i).range(k).padding(.5)},J=()=>{Ee();{let ke=yt(E||Z.yMaxLeft,Z.yMinLeft,ge,e,Z,A,E,g,xe);s=v.axisBottom(M).tickFormat(Se=>Xe(Se,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-ge:0).tickValues(ke.autoLabelFlag?void 0:ke.yAxisLabelArray).ticks(ke.customTickValue).tickPadding(8).tickSizeOuter(0)}},Ee=()=>{d=v.axisLeft(h).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*xe*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(gt(i,ge,e))},Le=ke=>{ke.forEach(R=>{R.data.forEach(ae=>{ae.markerShape=R.properties.markerShape||"Circle",ae.markerSize=R.properties.markerSize||6,ae.markerColor=R.properties.markerColor||R.properties.color,ae.alias=R.properties.alias,ae.lineStyle=R.properties.lineStyle,ae.lineWidth=R.properties.lineWidth,ae.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const Se=v.group(ke.flatMap(R=>R.data.map(ae=>({...ae,color:R.properties.color}))),R=>R.dimension),oe=X.selectAll(".cleveland-line-group").data(Array.from(Se),([R])=>R);oe.enter().append("g").attr("class","cleveland-line-group").append("line").merge(oe.select("line")).attr("y1",([R])=>h(R)).attr("y2",([R])=>h(R)).attr("x1",([,R])=>M(Math.min(R[0]?.value??0,R[1]?.value??0))).attr("x2",([,R])=>M(Math.max(R[0]?.value??0,R[1]?.value??0))).attr("stroke",R=>R[1][0].lineColor).attr("stroke-width",R=>R[1][0].lineStyle!=="None"?R[1][0].lineWidth:0).attr("stroke-dasharray",R=>{switch(R[1][0].lineStyle){case bt.dotted:return"1,4";case bt.dashed:return fa;default:return""}}).attr("stroke-linecap",R=>R[1][0].lineStyle===bt.dotted?ya.round:""),oe.exit().remove(),ke.forEach(R=>{let ae=X.selectAll(".parentGroup").data([R],F=>F.properties.legendUniqueId);ae=ae.enter().append("g").attr("class","parentGroup").attr("hoverId",(R.properties.alias||R.properties.name||"Legend").replace(/\s+/g,"-")).merge(ae);let _=ae.selectAll(".column-group").data(R.data,F=>F.dimension),G=_.enter().append("g").attr("class","column-group");const Q=e.animation.animationEnabled,ee=G.append("path").attr("class","cleveland-dot").attr("opacity",Q?0:.9);ee.merge(_.select("path")).attr("d",F=>v.symbol().type(Ji(F.markerShape)).size((F.markerSize||6)*70)()).attr("transform",F=>{const q=M(F.value),ue=h(F.dimension);return`translate(${q},${ue})`}).attr("fill",F=>R.properties.color).attr("data-series-id",()=>R.properties.legendUniqueId??R.properties.alias).attr("data-dim-value",F=>String(F.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(F,q)=>{ut([{key:e.xAxisTitle.xAxisTitleText,value:Z.formattedDimensionListMap.get(q.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:Xe(q.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:q.alias}],e,F,R.properties,At(r,String(q.dimension??""),{...R.properties,formattedDimensionValue:String(Z.formattedDimensionListMap.get(q.dimension)??q.dimension??"")}))}).on("mouseout",()=>{v.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),v.selectAll(".halo").remove(),ot()}),Q&&ee.transition().duration(e.animation.animationDuration).ease(et[e.animation.animationEffect]).attr("opacity",.9),_.exit().remove()}),X.selectAll(".parentGroup").raise()},Ue=ke=>{xe=pe-ke.left-ke.right,ge=he-ke.bottom-ke.top},ve=(ke,Se,oe)=>{y=Se,i=ke,a=oe,Pe()},Pe=()=>{Me(),Ee(),na(e,X,Y,ge,xe,d,void 0,M,Z.yMaxLeft,i,m,t,pe,D,p,h),Ye(),Le(y),$a(y,h,M,void 0,b,pt,[],[],e,m,he,pe,xe,i,ge,c,O,x,h,p,o,!1,g),We()},Ye=()=>{let ke=Lt(i,y,ne);N=v.stack().keys(Z.legendList).offset(v.stackOffsetDiverging)(ke),y.forEach((oe,$)=>oe.data.forEach((R,ae)=>{R[0]=N[$][ae][0],R[1]=N[$][ae][1]}));let Se=e.annotation.annotationSetLabelColor;N.forEach((oe,$)=>oe.forEach(R=>{R.key=oe.key,oe.color=JSON.parse(JSON.stringify(u[$].properties.color)),R.data.labelPosition=u[$].properties.dataLabelPosition,R.data.labelColor=Se=="2"?JSON.parse(JSON.stringify(u[$].properties.color)):u[$].properties.labelColor,R.hideZero=JSON.parse(JSON.stringify(u[$].properties.hideZeroValues))}))},We=()=>{try{const ke=Number(e.connector?.connectorVisibility);if(!e.connector||ke===2)return;const Se=[],oe=[],$=[];let R;const ae=[];if(ke===1)R=1;else if(ke===3){const ue=Number(e.connector.connectorFollow);ue===1?R=Number(e.connector.connectorStepSize):ue===2&&((e.connector.connectorExclude||[]).forEach(B=>$.push(B)),R=1)}const _=[],G=[],Q=[],ee=e.connector?.connectorCustomRange||[];$.forEach(ue=>{const B=ue.split("-");B.length&&_.push(B[0])});const q=(N?.[0]||[]).map((ue,B)=>({Dimension:ue.data.Dimension,Total:ue.data.Total,CustomTotal:ue.data.Total-(Q[B]??0),Index:B}));if(R!=null){for(let ue=0;ue<q.length;ue++)(R===1||ue%R===0&&R!==1)&&Se.push(q[ue]);for(let ue=R;ue<q.length;ue+=R){const B=Math.min(ue+R,q.length);let V=-1/0;for(let P=ue;P<B;P++)q[P].Total>V&&(V=q[P].Total);V!==-1/0&&ae.push(V)}for(let ue=1;ue<Se.length;ue++)oe.push(Se[ue])}else{const ue=[];(ee||[]).forEach(B=>{if(B?.from&&B?.to){const V=q.some(C=>C.Dimension===B.from),P=q.some(C=>C.Dimension===B.to);V&&P&&ue.push({from:B.from,to:B.to})}}),ue.forEach(B=>{const V=q.findIndex(C=>C.Dimension===B.from),P=q.findIndex(C=>C.Dimension===B.to);if(V>=0&&P>=0){const C=Math.min(V,P),re=Math.max(V,P);Se.push(q[C]);let j=q[C]?.Total??-1/0;for(let ie=C;ie<=re;ie++)q[ie].Total>j&&(j=q[ie].Total);j!==-1/0&&ae.push(j),oe.push(q[re])}})}X.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!==Ie.white?e.connector.connectorMarkerColor:"none"),be(Se,ae,oe,R,_),ze(Se,ae,oe,R,_)}catch(ke){console.error(ke)}},be=(ke,Se,oe,$,R)=>{try{X.append("g").selectAll("path").data(ke).enter().filter((ae,_)=>$!=null?_<ke.length-1:_<ke.length).append("path").attr("d",(ae,_)=>e.total.totalVisibility?`M ${M(ae.Total)+50},
260
- ${h(ae.Dimension)+h.bandwidth()/2-5}
261
- H ${60+Math.max(M(Se[_]),M(oe[_].Total),M(ae.Total))}
262
- V ${h(oe[_].Dimension)+h.bandwidth()/2+5}
263
- H ${30+M(oe[_].Total)}`:`M ${M(ae.Total)+30},
264
- ${h(ae.Dimension)+h.bandwidth()/2-5}
265
- H ${45+Math.max(M(Se[_]),M(oe[_].Total),M(ae.Total))}
266
- V ${h(oe[_].Dimension)+h.bandwidth()/2+5}
267
- H ${10+M(oe[_].Total)}
268
- `).style("stroke",e.connector.connectorLineColor!==Ie.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",ae=>R.includes(ae.Dimension)||ae.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ae){console.error(ae)}},ze=(ke,Se,oe,$,R)=>{try{let ae=e.connector.connectorFontStyle,_=e.connector.connectorNumberFormat,G=ge/30<i.length?Math.round(ge/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(_=".2s"),X.append("g").selectAll("text1").data(ke).enter().filter((Q,ee)=>$!=null?ee<ke.length-1:ee<ke.length).append("text").attr("y",(Q,ee)=>$==null?h(oe[ee].Dimension)/2+h(Q.Dimension)/2+15:$==1?G<6&&h.bandwidth()>40?h(oe[ee].Dimension)+h.bandwidth()/2+h.bandwidth()/2+13:h(oe[ee].Dimension)+h.bandwidth()/2+h.bandwidth()/2+7:h(oe[ee].Dimension)+h.bandwidth()/2+h.bandwidth()/2*$+12).attr("x",(Q,ee)=>e.total.totalVisibility?70+Math.max(M(Se[ee]),M(oe[ee].Total),M(Q.Total)):50+Math.max(M(Se[ee]),M(oe[ee].Total),M(Q.Total))).text((Q,ee)=>(Q.CustomTotal==0&&oe[ee].CustomTotal!=0&&(Q.CustomTotal=1),fi(oe[ee].Total,Q.Total,parseInt(e.connector.connectorDecimalPrecision),_,parseInt(Q.Dimension),parseInt(oe[ee].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!==Ie.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",ae.includes("Italic")?"Italic":"").style("text-decoration",ae.includes("Underline")?"Underline":"").style("font-weight",ae.includes("Bold")?"Bold":"").style("visibility",Q=>R.includes(Q.Dimension)||Q.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(ae){console.error(ae)}};return Ge.jsx("div",{style:{width:"100%",height:"100%"},children:Ge.jsx("svg",{className:"chartSVG",ref:L,id:c,style:{width:"100%",height:"100%"}})})},aa=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function La(t,e=1){const n=t.replace("#",""),o=parseInt(n.substring(0,2),16),x=parseInt(n.substring(2,4),16),l=parseInt(n.substring(4,6),16);return isNaN(o)||isNaN(x)||isNaN(l)?t:`rgba(${o},${x},${l},${e})`}function yl(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function ma(t,e,n,o=aa){const{ChartData:x,DimensionList:l,LegendList:r}=t,c=l?.length?l:x[0]?.data?.map(m=>m.dimension)??[],p=Number(n.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?jr(x,c,p,o,r):e==="scatter"?Jr(x,o):e==="bubble"?Zr(x,o):_r(x,c,e,n,p,o)}function _r(t,e,n,o,x,l){const r=t.map((c,p)=>{const m=c.properties?.color??l[p%l.length],L=c.properties?.opacity??1,u=new Map;c.data?.forEach(E=>u.set(E.dimension,E.value));const S=e.map(E=>u.get(E)??0),g=c.Axis==="Secondary"||c.properties?.axis==="Secondary"?"y1":"y",W=Number(c.properties?.lineWidth??o.plotArea?.lineWidth??2);return n==="line"||n==="area"?{type:"line",label:c.properties.alias,data:S,borderColor:m,backgroundColor:n==="area"?La(m,x*L):La(m,.1),fill:n==="area",borderWidth:W,borderDash:yl(c.properties?.lineStyle),pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3,tension:Number(o.cjsOptions?.cjsTension??.4),yAxisID:g}:n==="radar"?{label:c.properties.alias,data:S,borderColor:m,backgroundColor:La(m,x*L),fill:!0,borderWidth:W,pointRadius:o.marker?.markerVisibility?Number(o.marker?.markerSize??4):3}:{type:"bar",label:c.properties.alias,data:S,backgroundColor:La(m,x*L),borderColor:m,borderWidth:Number(c.properties?.stackBorderWidth??0),borderRadius:Number(o.cjsOptions?.cjsBorderRadius??o.plotArea?.cornerRadius??0),yAxisID:g}});return{labels:e,datasets:r}}function jr(t,e,n,o,x){const r=(t.length?t:[]).map(c=>{const p=e.map(L=>c.data?.find(S=>S.dimension===L)?.value??0),m=e.map((L,u)=>{const S=x?.[u]?.color;return La(S??o[u%o.length],n)});return{label:c.properties.alias,data:p,backgroundColor:m,borderColor:m.map(L=>L.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:r}}function Jr(t,e){return{datasets:t.map((o,x)=>{const l=o.properties?.color??e[x%e.length],r=o.data?.map(c=>({x:typeof c[0]=="number"?c[0]:parseFloat(c.dimension)||x,y:c.value??0}))??[];return{label:o.properties.alias,data:r,backgroundColor:La(l,.7),borderColor:l,pointRadius:5}})}}function Zr(t,e){return{datasets:t.map((o,x)=>{const l=o.properties?.color??e[x%e.length],r=o.data?.map(c=>({x:typeof c[0]=="number"?c[0]:parseFloat(c.dimension)||x,y:c.value??0,r:Number(c.markerSize??o.properties?.markerSize??8)}))??[];return{label:o.properties.alias,data:r,backgroundColor:La(l,.6),borderColor:l}})}}function oi(t,e,n,o=aa){const{ChartData:x,DimensionList:l}=t,r=l?.length?l:x[0]?.data?.map(L=>L.dimension)??[],c=new Map;r.forEach(L=>{const u=x.reduce((S,g)=>{const W=g.data?.find(A=>A.dimension===L);return S+Math.abs(W?.value??0)},0);c.set(L,u)});const p=Number(n.plotArea?.fillOpacity??.8),m=x.map((L,u)=>{const S=L.properties?.color??o[u%o.length],g=L.properties?.opacity??1,W=new Map;L.data?.forEach(b=>W.set(b.dimension,b.value));const A=r.map(b=>{const U=W.get(b)??0,Y=c.get(b)??0;return Y>0?parseFloat((U/Y*100).toFixed(4)):0}),E=Number(L.properties?.lineWidth??n.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:L.properties.alias,data:A,borderColor:S,backgroundColor:e==="area"?La(S,p*g):La(S,.1),fill:e==="area",borderWidth:E,borderDash:yl(L.properties?.lineStyle),pointRadius:n.marker?.markerVisibility?Number(n.marker?.markerSize??4):3,tension:Number(n.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:L.properties.alias,data:A,backgroundColor:La(S,p*g),borderColor:S,borderWidth:Number(L.properties?.stackBorderWidth??0),borderRadius:Number(n.cjsOptions?.cjsBorderRadius??n.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:r,datasets:m}}function _a(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function ci(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function Xr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function qr(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function ul(t,e,n){const o=parseInt(n??"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 Kr(t,e){return t.find(n=>n.alias==e)}function Qr(t,e){const n=Math.max(2,e||3);if(n>=t)return new Set(Array.from({length:t},(l,r)=>r));const o=t-1,x=new Set;for(let l=0;l<n;l++)x.add(Math.round(l*o/(n-1)));return x}function Qt(t,e,n=!1,o,x){const l=e==="pie"||e==="doughnut"||e==="polarArea",r=e==="horizontalBar";let c=0;const p=300,m=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:qr(t.legends?.legendPosition),labels:{color:L,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??tt,style:_a(t.legends?.legendFontStyle),weight:ci(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,g,W){if(o){const A=new Date().getTime();if(A-c<p){const b=Kr(x,g.text);b&&o(b),c=0}else c=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:m,borderWidth:1,padding:10,callbacks:{label(S){const g=typeof S.raw=="number"?S.raw:S.raw?.y??0,W=Xe(g,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${W}`}}},datalabels:Or(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:Xr(t.animation?.animationEffect)}:!1};if(!l){const S=e==="scatter"||e==="bubble",g=t.xAxisLabel?.xAxisTicksMode==="Custom",W=Math.max(2,parseInt(t.xAxisLabel?.xAxisTicksCount)||3),A={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:_a(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:_a(t.xAxisLabel?.xAxisLabelFontStyle),weight:ci(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0,...S&&g?{count:W}:{}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:m},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")},...!S&&g?{afterBuildTicks:U=>{const Y=Qr(U.ticks.length,W);U.ticks=U.ticks.filter((H,I)=>Y.has(I))}}:{}},E={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:_a(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:_a(t.yAxisLabel?.yAxisLabelFontStyle),weight:ci(t.yAxisLabel?.yAxisLabelFontStyle)},callback(U){return ul(U,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)},...t.yAxisLabel?.yAxisTicksMode==="Custom"?{count:Math.max(2,parseInt(t.yAxisLabel?.yAxisTicksCount)||3)}:{}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:m},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};r?(u.scales={x:{...E,position:"bottom"},y:{...A,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:A,y:E},n&&(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:_a(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:ci(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(U){return ul(U,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 xl(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 Or(t,e="bar"){const n=t.annotation,o=e==="pie"||e==="doughnut"||e==="polarArea",x=e==="horizontalBar",l=n?.annotationVisibility??"5";if(l==="5"||!l)return{display:!1};const r=n?.annotationPosition??"1",c=n?.annotationHideZeroValues!==!1,p=parseInt(n?.annotationFontSize??"9",10)||9,m=n?.annotationFontFamily??tt,L=_a(n?.annotationFontStyle),u=ci(n?.annotationFontStyle),S=n?.annotationColor??"#000000",g=n?.annotationSetLabelColor==="2",W=n?.annotationDecimalPrecision??"2",A=n?.annotationNumberFormat??",",E=n?.annotationDisplayUnits??"None";function b(D){const w=D.dataset?.data?.length??0,z=D.dataIndex??0;switch(l){case"1":return!0;case"2":return z===0;case"3":return z===w-1;case"4":return z===0||z===w-1;default:return!1}}function U(D){const w=D.dataset?.data?.[D.dataIndex];return xl(w)}function Y(D){if(o)return r==="2"?"center":"end";const w=U(D);switch(r){case"2":return"center";case"3":return w<0?"end":"start";case"1":return w>0?"end":"start";case"4":default:return w>0?"end":"start"}}function H(D){if(o)return r==="2"?"center":"end";const w=U(D);if(x)switch(r){case"2":return"center";case"3":return"right";case"1":case"4":default:return w<0?"left":"right"}switch(r){case"2":return"center";case"3":return w>0?"top":"bottom";case"1":case"4":default:return w<0?"bottom":"top"}}function I(D,w){const z=xl(D);if(c&&z===0)return null;const K=Xe(z,E,A,W);if(o){const ye=w?.chart?.data?.labels?.[w.dataIndex]??"";return ye?`${ye}
269
- ${K}`:K}return K}return{display:b,anchor:Y,align:H,offset:o?r==="2"?0:8:r==="2"?0:4,color:g?D=>{const w=D.dataset?.backgroundColor,z=D.dataset?.borderColor,K=Array.isArray(w)?w[D.dataIndex]:w;return typeof K=="string"&&K?K:typeof z=="string"&&z?z:S}:S,font:{size:p,family:m,style:L,weight:u},formatter:I,clip:!1}}Ct.Chart.register(Ct.BarController,Ct.LineController,Ct.PieController,Ct.DoughnutController,Ct.ScatterController,Ct.BubbleController,Ct.RadarController,Ct.PolarAreaController,Ct.CategoryScale,Ct.LinearScale,Ct.RadialLinearScale,Ct.PointElement,Ct.BarElement,Ct.LineElement,Ct.ArcElement,Ct.Title,Ct.Tooltip,Ct.Legend,Ct.Filler,kl);const Ot=({chartType:t,data:e,options:n,formatOptions:o,clientWidth:x,clientHeight:l,className:r,isChartStacked:c})=>{const p=Ce.useRef(null),m=Ce.useRef(null),L=Ce.useRef(!1);Ce.useEffect(()=>{if(p.current)return m.current?.destroy(),m.current=new Ct.Chart(p.current,{type:t,data:e,options:n}),L.current=!0,()=>{m.current?.destroy(),m.current=null}},[t,c]),Ce.useEffect(()=>{if(L.current){L.current=!1;return}const U=m.current;U&&(U.data=e,U.options=n,U.update())},[e,n]);const u=o.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(o.chartTitle?.chartTitleFontStyle)?o.chartTitle.chartTitleFontStyle:[],g=o.chartTitle?.chartTitleColor&&o.chartTitle.chartTitleColor!=="#ffffff"&&o.chartTitle.chartTitleColor!=="#FFFFFF00"?o.chartTitle.chartTitleColor:"rgba(119,119,119)",W=o.chartTitle?.chartTitleFontSize?`${o.chartTitle.chartTitleFontSize}px`:"16px",A=o.chartTitle?.dynamicTitleText||o.chartTitle?.chartTitleText||"",E=o.chartTitle?.chartTitleHTML||A,b=o.chartTitle?.chartTitleVisibility!==!1;return Ge.jsxs("div",{className:r,style:{width:"100%",height:"100%",backgroundColor:u,position:"relative",display:"flex",flexDirection:"column"},children:[b&&A&&Ge.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:o.chartTitle?.chartTitleText,style:{color:g,fontSize:W,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:E}}),Ge.jsx("div",{style:{flex:1,minHeight:0},children:Ge.jsx("canvas",{ref:p,style:{width:"100%",height:"100%"}})})]})},hl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"bar",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"bar",p,r,c);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(Ot,{chartType:"bar",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},en=t=>Ge.jsx(hl,{...t,isChartStacked:!0}),pl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l=aa,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"bar",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"horizontalBar",p,r,c);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(Ot,{chartType:"bar",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},tn=t=>Ge.jsx(pl,{...t,isChartStacked:!0}),bl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l=aa,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"line",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"line",p,r,c);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Ot,{chartType:"line",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},an=t=>Ge.jsx(bl,{...t,isChartStacked:!0}),gl=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,isChartStacked:x,colorBank:l,addLocalFilterFromLib:r})=>{const c=Ce.useMemo(()=>t.ChartData?.map(u=>u.properties),[t]),p=Ce.useMemo(()=>t.ChartData?.some(u=>u.Axis==="Secondary"||u.properties?.axis==="Secondary"),[t]),m=Ce.useMemo(()=>ma(t,"area",e,l),[t,e,l]),L=Ce.useMemo(()=>{const u=Qt(e,"area",p,r,c);return x&&(u.scales??={},u.scales.y??={},u.scales.y.stacked=!0),u},[e,p,x]);return Ge.jsx(Ot,{chartType:"line",data:m,options:L,formatOptions:e,clientWidth:n,clientHeight:o})},ln=t=>Ge.jsx(gl,{...t,isChartStacked:!0}),rn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.LegendList??[],[t]),c=Ce.useMemo(()=>ma(t,"pie",e,x),[t,e,x]),p=Ce.useMemo(()=>Qt(e,"pie",!1,l,r),[e]);return Ge.jsx(Ot,{chartType:"pie",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},nn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.LegendList??[],[t]),c=Ce.useMemo(()=>ma(t,"doughnut",e,x),[t,e,x]),p=Ce.useMemo(()=>{const m=Qt(e,"doughnut",!1,l,r),L=e.plotArea?.innerRadius;return L!=null&&(m.cutout=`${L}%`),m},[e]);return Ge.jsx(Ot,{chartType:"doughnut",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},sn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa})=>{const l=Ce.useMemo(()=>ma(t,"scatter",e,x),[t,e,x]),r=Ce.useMemo(()=>Qt(e,"scatter",!1),[e]);return Ge.jsx(Ot,{chartType:"scatter",data:l,options:r,formatOptions:e,clientWidth:n,clientHeight:o})},on=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(m=>m.properties),[t]),c=Ce.useMemo(()=>ma(t,"bubble",e,x),[t,e,x]),p=Ce.useMemo(()=>Qt(e,"bubble",!1,l,r),[e]);return Ge.jsx(Ot,{chartType:"bubble",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},cn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa})=>{const l=Ce.useMemo(()=>ma(t,"radar",e,x),[t,e,x]),r=Ce.useMemo(()=>{const c=Qt(e,"radar",!1);return delete c.scales,c.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}}}},c},[e]);return Ge.jsx(Ot,{chartType:"radar",data:l,options:r,formatOptions:e,clientWidth:n,clientHeight:o})},dn=({data:t,formatOptions:e,clientWidth:n,clientHeight:o,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.LegendList??[],[t]),c=Ce.useMemo(()=>ma(t,"polarArea",e,x),[t,e,x]),p=Ce.useMemo(()=>{const m=Qt(e,"polarArea",!1,l,r);delete m.scales;const L=e.xAxisLabel?.xAxisLabelFontStyle,u=Array.isArray(L)?L.includes("Italic")||L.includes("italic"):!1;return m.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"}}}},m},[e]);return Ge.jsx(Ot,{chartType:"polarArea",data:c,options:p,formatOptions:e,clientWidth:n,clientHeight:o})},yn=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"bar",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"bar",!1,l,r);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(Ot,{chartType:"bar",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})},un=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"horizontalBar",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"horizontalBar",!1,l,r);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(Ot,{chartType:"bar",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})},xn=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"line",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"line",!1,l,r);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(Ot,{chartType:"line",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})},hn=({data:t,formatOptions:e,clientWidth:n=0,clientHeight:o=0,colorBank:x=aa,addLocalFilterFromLib:l})=>{const r=Ce.useMemo(()=>t.ChartData?.map(L=>L.properties),[t]),c=Ce.useMemo(()=>oi(t,"area",e,x),[t,e,x]),p=Ce.useMemo(()=>c.datasets.some(L=>L.data.some(u=>u<0)),[c]),m=Ce.useMemo(()=>{const L=Qt(e,"area",!1,l,r);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(Ot,{chartType:"line",data:c,options:m,formatOptions:e,clientWidth:n,clientHeight:o})};Ze.AreaChart=Tr,Ze.BubbleChart=Ur,Ze.CJSAreaChart=gl,Ze.CJSBubbleChart=on,Ze.CJSColumnChart=hl,Ze.CJSDonutChart=nn,Ze.CJSHorizontalBarChart=pl,Ze.CJSLineChart=bl,Ze.CJSNormalizedStackAreaChart=hn,Ze.CJSNormalizedStackColumnChart=yn,Ze.CJSNormalizedStackHorizontalBarChart=un,Ze.CJSNormalizedStackLineChart=xn,Ze.CJSPieChart=rn,Ze.CJSPolarAreaChart=dn,Ze.CJSRadarChart=cn,Ze.CJSScatterChart=sn,Ze.CJSStackAreaChart=ln,Ze.CJSStackColumnChart=en,Ze.CJSStackHorizontalBarChart=tn,Ze.CJSStackLineChart=an,Ze.CJS_DEFAULT_COLORS=aa,Ze.ChartJSWrapper=Ot,Ze.ColumnChart=sr,Ze.ColumnHistogramChart=xr,Ze.CustomColumnChart=or,Ze.DonutChart=Sr,Ze.DotPlot=Gr,Ze.HorizontalBarChart=gr,Ze.HorizontalHistogramChart=fr,Ze.LayeredColumnChart=cr,Ze.LayeredHorizontalBarChart=mr,Ze.LineChart=hr,Ze.Maps=$r,Ze.NormalizedStackAreaChart=kr,Ze.NormalizedStackColumnChart=yr,Ze.NormalizedStackHorizontalBarChart=Lr,Ze.NormalizedStackLineChart=br,Ze.OrganizationChart=Yr,Ze.PieChart=Mr,Ze.PieofPie=wr,Ze.ProgressChart=Vr,Ze.PyramidChart=Dr,Ze.RadialBarChart=Pr,Ze.SankeyChart=Rr,Ze.ScatterChart=Br,Ze.Speedometer=Nr,Ze.StackAreaChart=vr,Ze.StackColumnChart=dr,Ze.StackHorizontalBarChart=Ar,Ze.StackLineChart=pr,Ze.TornadoChart=Hr,Ze.Treemap=Fr,Ze.VennChart=Er,Ze.WaterfallChart=Wr,Ze.WordCloud=Ir,Ze.hexToRgba=La,Ze.mapFormatOptionsToChartJS=Qt,Ze.transformToChartJSData=ma,Ze.transformToNormalizedChartJSData=oi,Object.defineProperty(Ze,Symbol.toStringTag,{value:"Module"})}));
259
+ </div>`}catch(P){return Ce(ua,"drawOrganizationChart.buttonContent",P),""}}).childrenMargin(a=>50).siblingsMargin(a=>20).neighbourMargin((a,g)=>20).duration(0).setActiveNodeCentered(!1).data(c).compact(!1).expandAll().fit(!1).render()}catch(d){Ce(ua,"drawOrganizationChart",d)}},M=c=>{try{let d;if(c.data.styleObject)return o.nodes.percentageVisibility?d=c.data.styleObject.nodeHeight*10+10:d=c.data.styleObject.nodeHeight*10,d}catch(d){Ce(ua,"calculateNodeHeight",d)}},x=(c,d)=>{try{let i={};d?i=c.data:i=c;let h,v;if(o.nodes.nodesLabelVisibility?v=50:v=20,i.styleObject)return o.nodes.nodesLabelOverflow?i.id==0?h=i.styleObject.nodeWidth*10+50:h=i.styleObject.nodeWidth*10:h=v+k(i.styleObject.alias).length*10+i.styleObject.labelFontSize*5,h}catch(i){Ce(ua,"calculateNodeWidth",i)}},k=c=>{try{let d=c.split("-");return d[d.length-1]}catch(d){Ce(ua,"getLabelText",d)}};return je.jsxs("div",{style:{width:"100%",height:"100%",position:"relative"},children:[je.jsx("svg",{id:u,className:"chartSVG",style:{width:"100%",height:"100%"},ref:r}),je.jsx("div",{id:`floating-div${u}`,className:"floatingDiv",style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",overflow:"auto"},children:je.jsx("svg",{id:`floating-${u}`,className:"chartSVG",ref:n})})]})},Br=({data:t,formatOptions:e,chartId:l,addLocalFilterFromLib:s,onElementClick:u,vfxPickModeActive:r,tooltipFormatter:n})=>{const o=Ne.useRef(u);o.current=u;const p=Ne.useRef(r);p.current=r;const m=new Map((t.ChartData??[]).map((ye,Ye)=>[ye.legend,Ye]));let f=t.LegendList;const y=Ne.useRef();let S,A=[0,0];const Z=ee.BubbleChart;let L,Y,b=40,H=Kt,B,G,I,D,N=[],R=[],X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a;Ne.useEffect(()=>{g()},[e,t,l]);const g=()=>{({chartFormatOptions:S,svg:D,width:L,height:Y}=ta(y,e)),A=Wa(S,f??[],"alias"),t=Be(t),z(),{longestMeasure:c,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:h}=il(S,te,Q),{longestDimension:J,customXaxisIntervalValue:M,customXaxisMaxValue:x,customXaxisMinValue:k}=ll(S,X,le),{margins:H,yLabel:de,xLabel:Le,yTitle:Te,xTitle:he,chartTitleHeight:b,legendMargin:q,innerHeight:B,innerWidth:G}=al(L,Y,c,S,J,A),ea(y,L,Y,S),I=da(D,H),Ct(I,e,0,G,B,Z),Ot(y,b,L,S),me(),ve(),Me(),rl(e,!1,D,H,Le,Y,he,"Bubble",de,G,B),nl(B,e,0,!1,D,H,Te,de),Pe(),ne(),P(),yl(D,S.legends.legendPosition,S,Y,L,H,B,he,Le,t.length)},P=()=>{try{let ye=5,Ye=30,O={minimumValue:te,maximumValue:Q};const Fe=I.append("g").attr("class","circles").attr("class","parentGroup"),We=S.animation.animationEnabled,Ue=Fe.append("g").selectAll(".bubbleScatter").data(t).enter().append("g").attr("hoverId",xe=>xe.legendName.replace(/ /g,"-")).attr("fill",xe=>xe.legendColor!==ze.white?xe.legendColor:"none").append("path").attr("class","path").attr("id",function(xe,ke){T.select(this).attr("d",T.symbol().type(T.symbolCircle).size(ce(ye,Ye,O,xe.measure,10)*nt(S.plotArea.bubbleSizeIndex)*3))}).attr("transform",function(xe){return`translate(${v(xe.dimension)}, ${a(xe.measure)})`}).attr(rt.SeriesId,xe=>`${m.get(xe.legendName)}_${xe.legendName}`).attr(rt.DimValue,xe=>String(xe.dimension)).attr("opacity",We?0:S.plotArea.fillOpacity).style("visibility",(xe,ke)=>xe.dimension[0]===0||xe.measure===0&&S.plotArea.hideZeroValues||xe.dimension<k||xe.dimension>x||xe.measure<h||xe.measure>i?"hidden":"visible").on("click",kt(p,o,(xe,ke)=>({seriesId:`${m.get(ke.legendName)}_${ke.legendName}`,dimValue:String(ke.dimension),legendUniqueId:`${m.get(ke.legendName)}_${ke.legendName}`,seriesDisplayName:ke.legendName}))).on("mousemove",(xe,ke)=>{xt([{key:S.xAxisTitle.xAxisTitleText,value:Qe(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(ke.dimension)},{key:S.yAxisTitle.yAxisTitleText,value:Qe(S.toolTip.toolTipDisplayUnits,S.toolTip.toolTipNumberFormat,S.toolTip.toolTipDecimalPrecision)(ke.measure)},{key:"Legend",value:ke.legendName}],S,xe,{alias:ke.legendName},Lt(n,String(ke.dimension),{alias:ke.legendName}))}).on("mouseout",()=>{ct()});We&&Ue.transition().duration(S.animation.animationDuration).ease(tt[S.animation.animationEffect]).attr("opacity",S.plotArea.fillOpacity)}catch(ye){Ce("BubbleChart","initCircles",ye)}};function ce(ye,Ye,O,Fe,We){try{if(Fe==null)return We;var Ue=O.minimumValue,xe=O.maximumValue,ke=Ye*Ye*2*Math.PI,De=ye*ye*2*Math.PI,$e=We;if(Ue==xe)$e=Ye;else{var ge=Fe,we=(ge-Ue)/(xe-Ue)*(ke-De)+De;we<De&&(we=De),$e=Math.sqrt(we/(Math.PI*2))}return $e}catch(C){return Ce("BubbleChart","getBubbleSize",C),We}}const z=()=>{try{N=[],R=[],te=void 0,Q=void 0,X=void 0,le=void 0,t.forEach(ye=>{ye.measureName&&(N.push(ye.measure),(ye.measure<te||te===void 0)&&(te=ye.measure),(ye.measure>Q||Q===void 0)&&(Q=ye.measure)),ye.dimensionName&&(R.push(ye.dimension),(ye.dimension<X||X===void 0)&&(X=ye.dimension),(ye.dimension>le||le===void 0)&&(le=ye.dimension))})}catch(ye){Ce("BubbleChart","iterateOverChartData",ye)}},me=()=>{try{let ye=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMinText!==""?parseFloat(S.xAxisLabel.xAxisMinText):X>0?0:X*1.1,Ye=S.xAxisLabel.xAxisIntervalsVisibility&&S.xAxisLabel.xAxisMaxText!==""?parseFloat(S.xAxisLabel.xAxisMaxText):le*1.1,O=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMinText!==""?parseFloat(S.yAxisLabel.yAxisMinText):te>0?0:te*1.1,Fe=S.yAxisLabel.yAxisIntervalsVisibility&&S.yAxisLabel.yAxisMaxText!==""?parseFloat(S.yAxisLabel.yAxisMaxText):Q*1.1;v=T.scaleLinear().domain([ye,Ye]).range([0,G]),a=T.scaleLinear().domain([O,Fe]).range([B,0])}catch(ye){Ce("BubbleChart","initScale",ye)}},ve=()=>{try{let{xAxisLabelArray:ye,customTickValue:Ye,autoLabelFlag:O}=vi(le,X,G,e,k,x,G,!1);const Fe=T.axisBottom(v).tickFormat(Qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(ca(e,B,0,!0)).tickValues(ye.length>0?ye:null).ticks(Ye).tickPadding(8).tickSizeOuter(0);cl(I,S,0,Le,Fe,B,G,H,a)}catch(ye){Ce("BubbleChart","drawXAxis",ye)}},Me=()=>{try{let{yAxisLabelArray:ye,customTickValue:Ye}=sl(Q,te,B,e,h,i);const O=T.axisLeft(a).tickFormat(Qe(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(Yt(e,G)).tickValues(ye.length>0?ye:null).ticks(Ye).tickPadding(8).tickSizeOuter(0);ol(I,S,0,de,O,B)}catch(ye){Ce("BubbleChart","drawYAxis",ye)}},Pe=()=>{try{if(S.plotArea.xCoordinate!=jt.None){let ye;switch(S.plotArea.xCoordinate){case jt.Mean:ye=T.mean(t,Ye=>Ye.dimension);break;case jt.Median:ye=T.median(t,Ye=>Ye.dimension);break;case jt.Custom:ye=nt(S.plotArea.xscaleposition);break}I.append("line").attr("x1",v(ye)).attr("y1",0).attr("x2",v(ye)).attr("y2",B).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}if(S.plotArea.yCoordinate!=jt.None){let ye;switch(S.plotArea.yCoordinate){case jt.Mean:ye=T.mean(t,Ye=>Ye.measure);break;case jt.Median:ye=T.median(t,Ye=>Ye.measure);break;case jt.Custom:ye=nt(S.plotArea.yscaleposition);break}I.append("line").attr("x1",0).attr("y1",a(ye)).attr("x2",G).attr("y2",a(ye)).attr("stroke",S.plotArea.refLineBorderColor).attr("stroke-width",S.plotArea.refLineBorderThickness)}}catch(ye){Ce("BubbleChart","drawReferenceLines",ye)}},ne=()=>{try{let ye=f?.map(Ye=>{let O={...Ye,legendFontStyle:Ye.fontStyle,fontSize:Ye.fontSize+"px",legendFontFamily:Ye.fontFamily};return{legend:Ye.name,properties:O,data:{}}});Ha(S,D,ye||[],L,Y,A[0],b,l,H,dt.circle,!1,s)}catch(ye){Ce("BubbleChart","initLegendList",ye)}},Be=ye=>{try{if(!ye||!ye.ChartData||!ye.ChartData[0])return[];const Ye=[];return ye.ChartData.forEach(Fe=>{Fe.data.forEach(We=>{Ye.push({dimension:parseFloat(We.dimension),dimensionName:Fe.legend??"Dimension",measure:We.value,measureName:Fe.legend??"Measure",legendName:Fe.legend,legendColor:Fe.properties?.color??ze.black,tooltip:""})})}),Ye}catch(Ye){return console.error("BubbleChart - Data conversion failed",Ye),[]}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:y,id:l,style:{width:"100%",height:"100%"}})})},Aa="ScatterChart.tsx",Hr=({data:t,formatOptions:e,chartId:l,onElementClick:s,vfxPickModeActive:u,tooltipFormatter:r})=>{const n=Ne.useRef(s);n.current=s;const o=Ne.useRef(u);o.current=u;const p=t.ColorElements??[],m=t.ShapeElements??[],f=new Map(p.map((xe,ke)=>[xe.name,ke]));let y=[];const S=Ne.useRef();let A,Z=[0,0],L,Y,b=40,H=Kt,B,G,I,D,N=Number.POSITIVE_INFINITY,R=Number.NEGATIVE_INFINITY,X=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,te=Number.POSITIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g,P=new Map,ce=new Map;Ne.useEffect(()=>{z()},[e,t,l]);const z=()=>{({chartFormatOptions:A,svg:D,width:L,height:Y}=ta(S,e));let xe=[...m,...p];Z=Wa(A,xe,"alias"),ve(),{longestMeasure:c,customYaxisIntervalValue:d,customYaxisMaxValue:i,customYaxisMinValue:h}=il(A,X,le),{longestDimension:J,customXaxisIntervalValue:M,customXaxisMaxValue:x,customXaxisMinValue:k}=ll(A,N,R),{margins:H,yLabel:de,xLabel:Le,yTitle:Te,xTitle:he,chartTitleHeight:b,legendMargin:q,innerHeight:B,innerWidth:G}=al(L,Y,c,A,J,Z),ea(S,L,Y,A),I=da(D,H),Ct(I,e,0,G,B,"Scatter",l),Ot(S,b,L,A),Me(),Pe(),ne(),rl(e,!1,D,H,Le,Y,he,"Scatter",de,G,B),nl(B,e,0,!1,D,H,Te,de),Be(),me(),ye(),Ye(),yl(D,A.legends.legendPosition,A,Y,L,H,B,he,Le,y.length)},me=()=>{try{let xe=function(ge){return ge=="Square"?T.symbolSquare:ge=="Circle"?T.symbolCircle:ge=="Cross"?T.symbolCross:ge=="Triangle"?T.symbolTriangle:ge=="Star"?T.symbolStar:ge=="Diamond"?T.symbolDiamond:ge=="Wye"?T.symbolWye:T.symbolCircle};const ke=I.append("g").attr("class","circles").attr("class","parentGroup"),De=A.animation.animationEnabled,$e=ke.append("g").selectAll(".bubbleScatter").data(y).enter().append("g").attr("fill",ge=>ge.color).attr("colorId",ge=>ge.colorName.replace(/ /g,"-")).attr("shapeId",ge=>ge.shapeName?.replace(/ /g,"-")).append("path").attr("class","path").attr("id",function(ge,we){T.select(this).attr("d",T.symbol().type(xe(ge.shape)).size((ge.sizeValue?g(ge.sizeValue):10)*2*nt(A.plotArea.scatterSizeIndex)))}).attr("transform",function(ge){return`translate(${v(ge.dimension)}, ${a(ge.measure)})`}).attr(rt.SeriesId,ge=>`${f.get(ge.colorName)}_${ge.colorName}`).attr(rt.DimValue,ge=>String(ge.dimension)).attr("opacity",De?0:A.plotArea.fillOpacity).style("visibility",(ge,we)=>ge.dimension[0]===0||ge.measure===0&&A.plotArea.hideZeroValues||ge.dimension<k||ge.dimension>x||ge.measure<h||ge.measure>i?"hidden":"visible").on("click",kt(o,n,(ge,we)=>({seriesId:`${f.get(we.colorName)}_${we.colorName}`,dimValue:String(we.dimension),legendUniqueId:`${f.get(we.colorName)}_${we.colorName}`,seriesDisplayName:we.colorName}))).on("mousemove",(ge,we)=>{xt([{key:A.xAxisTitle.xAxisTitleText,value:Qe(A.toolTip.toolTipDisplayUnits,A.toolTip.toolTipNumberFormat,A.toolTip.toolTipDecimalPrecision)(we.dimension)},{key:A.yAxisTitle.yAxisTitleText,value:Qe(A.toolTip.toolTipDisplayUnits,A.toolTip.toolTipNumberFormat,A.toolTip.toolTipDecimalPrecision)(we.measure)},{key:"Color",value:we.colorName},...we.shapeName?[{key:"Shape",value:we.shapeName}]:[]],A,ge,{alias:we.colorName},Lt(r,String(we.dimension),{alias:we.colorName}))}).on("mouseout",()=>{ct()});De&&$e.transition().duration(A.animation.animationDuration).ease(tt[A.animation.animationEffect]).attr("opacity",A.plotArea.fillOpacity)}catch(xe){Ce(Aa,"initCircles",xe)}},ve=()=>{try{let xe=function(ke,De,$e){X=Math.min(X,ke.value),le=Math.max(le,ke.value),N=Math.min(N,ke.dimension),R=Math.max(R,ke.dimension),te=Math.min(te,ke.value2??10),Q=Math.max(Q,ke.value2??10),y.push({dimension:ke.dimension,measure:ke.value,sizeValue:ke.value2,colorName:De,shapeName:$e,shape:ce.get($e)||"Circle",color:P.get(De)||"#6ba2b8ff"})};p.forEach(ke=>{P.set(ke.name,ke.color)}),m.forEach(ke=>{ce.set(ke.name,ke.markerShape)}),t.ChartData.forEach(ke=>{ke.children&&ke.children.length>0&&ke.children.forEach(De=>{De.data.forEach($e=>{xe($e,ke.legend,De.legend)})}),ke.data&&ke.data.length>0&&ke.data.forEach(De=>{xe(De,ke.legend)})})}catch(xe){Ce(Aa,"iterateOverChartData",xe)}},Me=()=>{try{let xe=A.yAxisLabel.yAxisIntervalsVisibility&&A.yAxisLabel.yAxisMinText!==""?parseFloat(A.yAxisLabel.yAxisMinText):X>0?0:X*1.1,ke=A.yAxisLabel.yAxisIntervalsVisibility&&A.yAxisLabel.yAxisMaxText!==""?parseFloat(A.yAxisLabel.yAxisMaxText):le*1.1;a=T.scaleLinear().domain([xe,ke]).range([B,0]),g=T.scaleLinear().domain([te,Q]).range([1,10])}catch(xe){Ce(Aa,"initScale",xe)}},Pe=()=>{try{const ke=(parseFloat(e.plotArea.ticksHeight)||100)/100*B;let{xAxisLabelArray:De,customTickValue:$e}=vi(R,N,G,e,k,x,B,!1);De.length>0?v=T.scaleLinear().domain([De[0],De[De.length-1]]).range([0,G]):v=T.scaleLinear().domain([k,x]).range([0,G]);const ge=T.axisBottom(v).tickFormat(Qe(e.xAxisLabel.xAxisDisplayUnits,e.xAxisLabel.xAxisNumberFormat,e.xAxisLabel.xAxisLabelDecimalPrecision??"2")).tickSize(A.plotArea.gridLinesVisibility&&A.plotArea.gridLinesVertical?A.xAxisLabel.xAxisPosition==="0"?-ke:A.xAxisLabel.xAxisPosition==="1"?ke:0:0).tickValues(De.length>0?De:null).ticks($e).tickPadding(8).tickSizeOuter(0);cl(I,A,0,Le,ge,B,G,H,a)}catch(xe){Ce(Aa,"drawXAxis",xe)}},ne=()=>{try{const ke=(parseFloat(e.plotArea.ticksWidth)||100)/100*G;let{yAxisLabelArray:De,customTickValue:$e}=sl(le,X,B,e,h,i);const ge=T.axisLeft(a).tickFormat(Qe(e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision??"2")).tickSize(A.plotArea.gridLinesVisibility&&A.plotArea.gridLinesHorizontal?-ke:0).tickValues(De.length>0?De:null).ticks($e).tickPadding(8).tickSizeOuter(0);ol(I,A,0,de,ge,B)}catch(xe){Ce(Aa,"drawYAxis",xe)}},Be=()=>{try{if(A.plotArea.xCoordinate!=jt.None){let xe;switch(A.plotArea.xCoordinate){case jt.Mean:xe=T.mean(y,ke=>ke.dimension);break;case jt.Median:xe=T.median(y,ke=>ke.dimension);break;case jt.Custom:xe=nt(A.plotArea.xscaleposition);break}I.append("line").attr("x1",v(xe)).attr("y1",0).attr("x2",v(xe)).attr("y2",B).attr("stroke",A.plotArea.refLineBorderColor).attr("stroke-width",A.plotArea.refLineBorderThickness)}if(A.plotArea.yCoordinate!=jt.None){let xe;switch(A.plotArea.yCoordinate){case jt.Mean:xe=T.mean(y,ke=>ke.value);break;case jt.Median:xe=T.median(y,ke=>ke.value);break;case jt.Custom:xe=nt(A.plotArea.yscaleposition);break}I.append("line").attr("x1",0).attr("y1",a(xe)).attr("x2",G).attr("y2",a(xe)).attr("stroke",A.plotArea.refLineBorderColor).attr("stroke-width",A.plotArea.refLineBorderThickness)}}catch(xe){Ce(Aa,"drawReferenceLines",xe)}},ye=()=>{try{A.legends.legendAlignment===void 0&&(A.legends.legendAlignment="Top"),A.legends.legendAlignmentTopBottom===void 0&&(A.legends.legendAlignmentTopBottom="Start");let xe=A.legends.legendPosition,ke=A.legends.legendAlignment,De=A.legends.legendAlignmentTopBottom;switch(xe){case Ze.none:break;case Ze.right:O(p,L-q-30,b+5,q+25,Y-b-10);break;case Ze.top:O(p,5,b+5,L-10,30);break;case Ze.left:O(p,5,b+5,q+25,Y-b-10);break;case Ze.bottom:O(p,5,Y-35,L-10,30);break}}catch(xe){Ce(Aa,"drawColors",xe)}},Ye=()=>{try{A.legends.legendAlignment===void 0&&(A.legends.legendAlignment=Ea.top),A.legends.legendAlignmentTopBottom===void 0&&(A.legends.legendAlignmentTopBottom=Ra.start);let xe=A.legends.legendPosition;if(m.length>0)switch(xe){case Ze.none:break;case Ze.right:Fe(m,L-q-30,Y/2+10,q+25,Y-b-10);break;case Ze.top:Fe(m,L/2+5,b+5,L-10,30);break;case Ze.left:Fe(m,5,Y/2+10,q+25,Y-b-10);break;case Ze.bottom:Fe(m,L/2+5,Y-35,L-10,30);break}}catch(xe){Ce(Aa,"drawShapes",xe)}},O=(xe,ke,De,$e,ge)=>{try{let C=A.legends.legendPosition,j=A.legends.legendFontStyle,se=D.append("foreignObject").attr("visibility",A.legends.legendVisibility?"visible":"hidden").attr("x",ke).attr("y",De).attr("width",$e).attr("height",ge).style("user-select","none"),Se=(C==Ze.top||C==Ze.bottom)&&m.length>0?"50%":"100%";var we=se.append("xhtml:div").style("width",Se).style("display","flex").style("height",C==Ze.top||C==Ze.bottom?ge-1+"px":"calc(50% - 5px)").style("border",A.legends.legendBorder?`${A.legends.legendBorderThickness+"px solid"+A.legends.legendBorderColor}`:"none").append("div").attr("id","colorsObject"+l).style("width","100%").attr("class","scrollbar").style("display","flex").style("overflow","auto").style("justify-content",C==Ze.top||C==Ze.bottom?A.legends.legendAlignmentTopBottom==Ra.start?"flex-Start":A.legends.legendAlignmentTopBottom==Ra.middle?"center":"flex-end":A.legends.legendAlignment==Ea.top?"flex-Start":A.legends.legendAlignment==Ea.middle?"center":"flex-end").style("flex-direction",C==Ze.top||C==Ze.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");xe.forEach((pe,K)=>{let w=we.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",A.legends.legendFontSize+"px").style("font-family",A.legends.legendFontFamily).on("mousemove",function(ae){A.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[colorId="'+Ue(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(ae){D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[colorId="'+Ue(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1)});(C==Ze.bottom||C==Ze.top)&&w.style("margin-right","16px").style("white-space","nowrap"),w.append("div").style("height","10px").style("width","10px").style("background",pe.color).style("border-radius","1px");let _=A.legends.legendColorMode=="1"?pe.color?pe.color:ze.black:A.legends.legendSelectedUnicolor;w.append("div").style("margin-left","5px").style("color",_).attr("title",pe.name).style("font-size",A.legends.legendFontSize+"px").style("font-family",A.legends.legendFontFamily).style("font-style",j.includes(ie.italic)?ie.italic:"").style("text-decoration",j.includes(ie.underline)?ie.underline:"").style("font-weight",j.includes(ie.bold)?ie.bold:"").style("white-space","nowrap").html(pe.name)})}catch(C){Ce(Aa,"colorListWithScroll",C)}},Fe=(xe,ke,De,$e,ge)=>{try{let C=A.legends.legendPosition,j=A.legends.legendFontStyle,se=D.append("foreignObject").attr("visibility",A.legends.legendVisibility?"visible":"hidden").attr("x",ke).attr("y",De).attr("width",$e).attr("height",ge).style("user-select","none"),Se=A.legends.legendPosition==Ze.top||A.legends.legendPosition==Ze.bottom?"calc(50% - 5px)":"calc(100%)";var we=se.append("xhtml:div").style("width",Se).style("display","flex").style("height",C==Ze.top||C==Ze.bottom?ge-1+"px":"50%").style("padding","2px").style("position","absolute").style("border",A.legends.legendBorder?`${A.legends.legendBorderThickness+"px solid"+A.legends.legendBorderColor}`:"none").append("div").attr("id","shapesObject"+l).style("width","100%").attr("class","scrollbar").style("overflow","auto").style("display","flex").style("justify-content",C==Ze.top||C==Ze.bottom?A.legends.legendAlignmentTopBottom==Ra.start?"flex-Start":A.legends.legendAlignmentTopBottom==Ra.middle?"center":"flex-end":A.legends.legendAlignment==Ea.top?"flex-Start":A.legends.legendAlignment==Ea.middle?"center":"flex-end").style("flex-direction",C==Ze.top||C==Ze.bottom?"row":"column").style("flex-wrap","nowrap").style("padding-left","3px");xe.forEach((pe,K)=>{let w=we.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(ae){A.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!0),D.selectAll('[shapeId="'+Ue(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!0).classed("unhighlight",!1))}).on("mouseout",function(ae){A.legends.onHoverEffect&&(D.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),D.selectAll('[shapeId="'+Ue(this.textContent.replace(/ /g,"-"))+'"]').classed("highlight",!1).classed("unhighlight",!1))});(C==Ze.top||C==Ze.bottom)&&w.style("margin-right","16px").style("white-space","nowrap"),We(w,pe.markerShape);let _=A.legends.legendColorMode=="1"?ze.black:A.legends.legendSelectedUnicolor;w.append("div").style("margin-left","5px").style("color",_).attr("title",pe.name).style("font-size",A.legends.legendFontSize+"px").style("font-family",A.legends.legendFontFamily).style("font-style",j.includes(ie.italic)?ie.italic:"").style("text-decoration",j.includes(ie.underline)?ie.underline:"").style("font-weight",j.includes(ie.bold)?ie.bold:"").style("white-space","nowrap").html(pe.name)})}catch(C){Ce(Aa,"shapeListWithScroll",C)}},We=(xe,ke)=>{try{const $e={none:T.symbolCircle,circle:T.symbolCircle,square:T.symbolSquare,triangle:T.symbolTriangle,cross:T.symbolCross,diamond:T.symbolDiamond,star:T.symbolStar,wye:T.symbolWye}[ke?.toLowerCase()]||T.symbolCircle;xe.append("svg").attr("width",14).attr("height",14).append("path").attr("d",T.symbol().type($e).size(80)()).attr("transform","translate(7,7)").attr("fill","black")}catch(De){Ce(Aa,"shapesForScatterPlot",De)}},Ue=(xe="")=>{try{return xe.replace(/(#|;|&|,|\.|\+|\*|~|'|:|"|!|\^|\$|\[|\]|\(|\)|=|<|>|\||\/)/g,"\\$1")}catch(ke){Ce(Aa,"getJQuerySelector",ke)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:l,style:{width:"100%",height:"100%"}})})},Wr=({isDateType:t,formatOptions:e,data:l,isAdvancedAnalyticsWaterFall:s=!1,onElementClick:u,vfxPickModeActive:r,tooltipFormatter:n})=>{const o=crypto.randomUUID?.();let p=0,m;const f=ee.WaterfallChart,y=Ne.useRef(),S=Ne.useRef(u);S.current=u;const A=Ne.useRef(r);A.current=r;const Z=s??!1,L=Z?[]:ft(l.ChartData,l.DimensionList),Y=l.DimensionList,b=!1,H=!1,B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g,P,ce,z=[],me=[],ve,Me=0;const Pe=2;let ne={dimensionList:Y,chartType:f,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Be()}catch(j){Ce("WaterfallChart","createWaterfallChart",j)}},[e]);const Be=()=>{({formatOptions:e,svg:d,width:x,height:k}=wt(y,e)),ye(),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:q}=$t(e,ne.yMinLeft,ne.yMaxLeft,ne.yMinRight,ne.yMaxRight),{margin:D,yLabel:N,xLabel:R,yTitle:X,xTitle:le,dimensionHeightWidthArray:te,chartTitleHeight:Q,secondaryAxisTitleWidth:de,legendMargin:Le,secondaryYLabel:Te}=St(x,k,he,q,ne.yMaxLeft,e,ne.legendList,ne.dimensionList,ne.yMaxRight,H,B,t),ke(D),Ft(d,x,k,e),i=Dt(d,D),Ct(i,e,c,J,M,f,o),O(),We(),Qt(i,e,c,N,g,M),De(L,k,d,D,J),Vt(e,b,d,D,R,k,le,ne.chartType,N,J,M),Nt(M,e,c,b,d,D,X,N),Jt(d,H,D,e,c,M,J,Te,de),Pt(d,e,x,Q)},ye=()=>{if(Z){let K=C(l);K=K.filter(_=>_.up+_.down+_.base!=0),ne.dimensionList=K.map(_=>_.xKey),ne.legendList=ne.dimensionList,me=T.stack().keys(["base","dimensionTotal","up","down"])(K);const w=[];me.forEach(_=>_.forEach(ae=>w.push(ae[1]))),ne.yMaxLeft=T.max(w)??0,ne.yMinLeft=T.min(w)??0;return}L.forEach(K=>{K.data.forEach(w=>{})}),z=JSON.parse(JSON.stringify(L)),e.plotArea.fitChart?ce=ne.dimensionList:ce=ne.dimensionList.slice(Me,Me+Pe),e.plotArea.hideZeroValues&&(ne.hideZeroValues=!0);let j=Z?C(l):ge(),se=JSON.parse(JSON.stringify(j));j.forEach(K=>{if(!K.Dimension&&(K.Up<1e-9&&K.Up!==0||K.Down<1e-9&&K.Down!==0)){let w=se.findIndex(_=>_.Legend===K.Legend);w!==-1&&se.splice(w,1)}}),j=se,j.forEach(K=>K.dimension?ne.legendList.push(K.dimension):ne.legendList.push(K.legend)),me=T.stack().keys(["base","dimensionTotal","up","down"])(j);let Se=[],pe=[];me.forEach(K=>{K.key=="base"?K.opacity=0:K.opacity=1,K.forEach(w=>Se.push(w)),!pe.includes(K.dimension)&&K.dimensionTotal===0&&K.total===0&&pe.push(K.dimension)}),ne.yMaxLeft=T.max(Se,K=>K[1]),ne.yMinLeft=T.min(Se,K=>K[1]),e.xAxisLabel.hideZeroValues&&(pe.length>0&&pe.forEach(K=>{ne.legendList=ne.legendList.filter(w=>w!==K)}),ne.dimensionList=ne.legendList),t?vt(e.xAxisLabel.xAxisNumberFormat,ne.dimensionList).map(K=>K):ne.dimensionList,Ye(j)},Ye=j=>{try{let se=[],Se=[],pe=[];j&&j.forEach((w,_)=>{w.dimension&&(se.push(w.dimension),Se.push({dimension:w.dimension,chartDataIndex:_,selfIndex:Se.length}))}),t?pe=vt(e.xAxisLabel.xAxisNumberFormat,ne.dimensionList).map(w=>w):pe=se;let K=JSON.parse(JSON.stringify(ne.legendList));Se.forEach((w,_)=>{K[w.chartDataIndex]=pe[w.selfIndex]}),ne.legendList.forEach((w,_)=>{ne.formattedDimensionListMap.set(w,K[_])})}catch(se){throw se}},O=()=>{let j=ut(I||ne.yMaxLeft,ne.yMinLeft,M,e,ne,G,I).yAxisLabelArray;ne.yMaxLeft=j[j.length-1],ne.yMinLeft=j[0],h=T.scaleLinear().domain([ne.yMinLeft>=0?G!==void 0&&!Number.isNaN(G)?G:0:ne.yMinLeft<0?ne.yMinLeft*1.1:ne.yMinLeft*.9,ne.yMaxLeft<=0?0:I!==void 0&&!Number.isNaN(I)?I:ne.yMaxLeft*1.1]).range([M,0]),a=[0,J],Fe()},Fe=()=>{p=(.51+.61*(100-parseFloat(e.plotArea.plotAreaGapWidth))/100)*(J/ne.legendList.length),v=T.scaleBand().domain(ne.legendList).range(a).padding(.4)},We=()=>{Ue();{let j=ut(I||ne.yMaxLeft,ne.yMinLeft,M,e,ne,G,I);g=T.axisLeft(h).tickFormat(se=>qe(se,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-J+0:0).tickValues(j.autoLabelFlag?void 0:j.yAxisLabelArray).ticks(j.customTickValue).tickPadding(8).tickSizeOuter(0)}m=T.scaleOrdinal().domain(["base","dimensionTotal","up","down"]).range([e.plotArea.totalColor,Z?"#34558800":e.plotArea.totalColor??"#345588ff",e.plotArea.positiveColor,e.plotArea.negativeColor])},Ue=()=>{P=T.axisBottom(v).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(At(ne.legendList,J,e))},xe=j=>{let se;if(me.forEach((Se,pe)=>Se.forEach(K=>K.key=Se.key)),ve){let Se=z.map(pe=>pe.legend);se=T.stack().keys(Se)(ve),se.forEach((pe,K)=>{se[K].color=z[K].properties.color})}se&&se.forEach(Se=>{Se.forEach(pe=>{pe.Key=Se.key})}),[0,1].forEach(Se=>{if(Se===1&&(me=se),me){let pe=i.selectAll(`.parentGroup-${Se}`).data([null]);pe=pe.enter().append("g").attr("class",`parentGroup parentGroup-${Se}`).merge(pe);let K=pe.selectAll(`.bar-group-${Se}`).data(me);K=K.enter().append("g").attr("class",`bar-group-${Se}`).attr("fill",V=>V.color?V.color:m(V.key)!==ze.white?m(V.key):"none").attr("opacity",V=>V.opacity).merge(K);let _=K.selectAll("rect").data(V=>V,V=>V.key||V.Key);const ae=e.animation.animationEnabled,re=_.enter().append("rect").attr("class","rect").attr("class",V=>V.key?V.key.replace(/ /g,"-"):V.Key.replace(/ /g,"-")).attr("x",V=>v(Z?V.data.xKey:V.data.dimension||V.data.legend)).attr("y",h(0)??0).attr("clip-path",`url(#${o}-clip)`).attr("height",0).attr("width",v.bandwidth()).attr("visibility",V=>Se===0&&V.data.dimension&&ve?"hidden":"visible").style("shape-rendering","crispEdges").on("mousemove",(V,U)=>{const F=Z?ka.base:ka.dimensionTotal,E={markerShape:"square",markerColor:U.key===F?e.plotArea.totalColor:U.key===ka.down?e.plotArea.negativeColor:e.plotArea.positiveColor};xt([{key:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():U.properties?.currentMeasure?U.properties.currentMeasure:e.yAxisTitle.yAxisTitleText,value:(U.key===ka.up?"+":U.key===ka.down?"-":"")+qe(U.key===ka.dimensionTotal?U.data.dimensionTotal:U[1]-U[0],e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:(Z?U.key!==ka.base?U.data.xKey:ka.total:U.Key?U.Key.includes("~$~")?U.Key.split("~$~")[1]:U.Key:U.data.legend?U.data.legend.includes("~$~")?U.data.legend.split("~$~")[1]:U.data.legend:ka.total).trim()||""}],e,void 0,E,Lt(n,String(ne.formattedDimensionListMap.get(Z?U.data.xKey:U.data.dimension||U.data.legend)??(Z?U.data.xKey:U.data.dimension||U.data.legend)??""),{...E,alias:U.properties?.alias??U.properties?.currentMeasure??String(U.Key??U.key??"")}))}).on("mouseout",()=>{ct()}).attr(rt.SeriesId,V=>String(V.key??V.Key??"")).attr(rt.DimValue,V=>String(Z?V.data.xKey||"":V.data.dimension||V.data.legend||"")).on("click",kt(A,S,(V,U)=>{const F=String(U.key??U.Key??""),E=String(Z?U.data.xKey||"":U.data.dimension||U.data.legend||"");return{seriesId:F,dimValue:E,legendUniqueId:F,seriesDisplayName:F}}));if((ae?re.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):re).attr("y",V=>V[1]?h(V[1]):0).attr("height",V=>V[1]?h(V[0])-h(V[1]):0),_.exit().remove(),_=re.merge(_),e.plotArea.plotAreaDataLabel=="2"&&Se!=1){const V=K.selectAll("text").data(E=>E),U=V.enter().append("text").text(E=>qe(E[1]-E[0],e.plotArea.plotAreaDisplayUnits,e.plotArea.dataLabelNumberFormat,e.plotArea.dataLabelDecimalPrecision)).attr("x",E=>v(Z?E.data.xKey:E.data.dimension||E.data.legend)+v.bandwidth()/2).attr("y",h(0)??0).style("font-size","11px").attr("text-anchor","middle").attr("visibility",E=>E[1]-E[0]!==0&&h(E[1])?"visible":"hidden");(ae?U.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):U).attr("y",E=>E[1]?h(E[1])-15:0),V.exit().remove()}}}),i.selectAll(".parentGroup").raise()},ke=j=>{J=x-j.left-j.right,M=k-j.bottom-j.top},De=(j,se,Se,pe,K)=>{if(!e.plotArea.fitChart){const w=j[0].data.length-Pe,_=se-20;ce=ne.dimensionList.slice(Me,Me+Pe),Fe(),z=JSON.parse(JSON.stringify(j)),z.forEach(($,V)=>z[V].data=$.data.filter(U=>ce.includes(U.dimension))),Ue(),Se.append("rect").attr("x",pe.left).attr("y",_).attr("width",K).attr("height",8).attr("fill","#ddd").attr("rx",4);const ae=K*Pe/ne.dimensionList.length,re=Se.append("rect").attr("x",pe.left).attr("y",_).attr("width",ae).attr("height",8).attr("fill","#999").attr("rx",4).style("cursor","ew-resize").call(T.drag().on("drag",$=>{let V=Math.min(Math.max($.x,pe.left),pe.left+K-ae);re.attr("x",V),Me=Math.round((V-pe.left)/(K-ae)*w),ce=ne.dimensionList.slice(Me,Me+Pe),Fe(),z=JSON.parse(JSON.stringify(j)),z.forEach((U,F)=>z[F].data=U.data.filter(E=>ce.includes(E.dimension))),Ue(),$e()}));Se.on("wheel",$=>{$.preventDefault();const V=Math.abs($.deltaX)>Math.abs($.deltaY)?$.deltaX:$.deltaY;Me+=V>0?1:-1,Me=Math.max(0,Math.min(Me,w));const U=pe.left+(K-ae)*Me/w;re.attr("x",U),Fe(),z=JSON.parse(JSON.stringify(j)),z.forEach((F,E)=>z[E].data=F.data.filter(W=>ce.includes(W.dimension))),Ue(),$e()})}$e()},$e=()=>{la(i,ne,R,e,c,h,P,te,k,p,t,J,M,ne.legendList,v),xe()},ge=()=>{try{if(L.length<1)return[];if(ne.dimensionList.length<2)return[];let j=[],se=[],Se=[],pe="";if(pe.length>1){let re=pe;L.forEach($=>{re===$.properties.currentLegend?se.push($):Se.push($)})}se.length>0&&(z=se);let K=0,w=0;for(let re=0;re<z.length;++re)K=K+z[re].data[0].value;let _="";for(let re=1;re<ce.length;++re){let $={};$.dimension=ce[re-1],$.total=K,$.base=0,$.dimensionTotal=K,$.up=0,$.down=0,j.push($);for(let V=0;V<z.length;++V){let U={};for(let F=0;F<V;F++)_=_+" ";w=z[V].data[re].value-z[V].data[re-1].value,w!==0&&(U.legend=_+z[V].properties.legend,U.dimensionTotal=0,w<0?(U.base=K+w,U.down=-w,U.up=0,U.total=K-w):(U.base=K,U.down=0,U.up=w,U.total=K+w),K=K+w,j.push(U))}}let ae={};return ae.dimension=ce[ce.length-1],ae.dimensionTotal=K,ae.base=0,ae.total=K,ae.up=0,ae.down=0,j.push(ae),Se.length>0&&(z=Se,ve=mt(ce,Se,!1)),j}catch(j){throw j}},we=j=>j==null||j===""?0:Number(j),C=j=>(j[0]?.Column1==""?j.filter(Se=>Se.Column1&&Se.Column1!=="*"):s?j.Data:j).map(Se=>({xKey:Se.Column1||Se.Dimension||Se.Legend,base:we(Se.Column3||Se.Total),up:we(Se.Column4||Se.Up),down:we(Se.Column5||Se.Down),total:we(Se.Column6||Se.total),dimensionTotal:we(Se.Column2||Se.Base)}));return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:y,id:o,style:{width:"100%",height:"100%"}})})},Gr=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,onElementClick:r,vfxPickModeActive:n,tooltipFormatter:o})=>{const p=crypto.randomUUID();let m=0;const f=ee.TornadoChart,y=l.IsadvanceanalyticsChart??l.IsCalCSensitivity,S=Ne.useRef(),A=Ne.useRef(r);A.current=r;const Z=Ne.useRef(n);Z.current=n;let L=ft(l.ChartData,l.DimensionList,!0);L=sr(L,l,y);const Y=l.DimensionList,b=!0,H=!1,B=!1;let G=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,I=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,D,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h,v,a,g,P,ce,z,me=[],ve=0,Me=2,Pe=!1,ne={dimensionList:Y,chartType:f,chartData:[],formatOptions:e,legendList:l.LegendList,secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{Be()}catch(C){Ce("Tornadochart","createTornadoChart",C)}},[e]);const Be=()=>{({formatOptions:e,svg:d,width:x,height:k}=wt(S,e)),e.xAxisLabel.labelTextWrap=!1,e.xAxisLabel.xAxisLabelRotation=90,Ye(),{formatOptions:e}=zt(e,L,l.DataTableData??[]),{maxNumberForPrimaryAxis:he,maxNumberForSecondaryAxis:q}=$t(e,ne.yMinLeft,ne.yMaxLeft,ne.yMinRight,ne.yMaxRight),{margin:D,yLabel:N,xLabel:R,yTitle:X,xTitle:le,dimensionHeightWidthArray:te,chartTitleHeight:Q,secondaryAxisTitleWidth:de,legendMargin:Le,secondaryYLabel:Te,visibleBars:Me,columnWidth:m,scrollbarVisible:Pe}=St(x,k,he,q,ne.yMaxLeft,e,y?ne.legendList.map(C=>C.alias.split(" - ")[0]):ne.legendList.map(C=>C.alias),ne.dimensionList,ne.yMaxRight,H,B,t,!0,ne),ke(D),Ft(d,x,k,e),i=Dt(d,D),Ct(i,e,c,J,M,f),O(),Ue(),sa(e,i,R,M,J,P),Vt(e,b,d,D,R,k,le,ne.chartType,N,J,M),Nt(M,e,c,b,d,D,X,N,J),Jt(d,H,D,e,c,M,J,Te,de),Pt(d,e,x,Q),Et(k,d,te,Q,x,Le,e,ye(L,ne.legendList,y,e),p,c,D,dt.rectangle),ge(L,k,x,d,D,J,Pe,Me,ne,ve,!1,De,b)},ye=(C,j,se,Se)=>C.map((pe,K)=>{const w=j[K];if(!w)return{...pe,properties:{}};let _=w.alias;se&&w.alias&&(_=w.alias.split(" - ")[0].trim());let ae=w.color;return se&&_&&(_.includes("+ve")?ae=Se.plotArea.plotAreaCalculatedHigh:_.includes("-ve")&&(ae=Se.plotArea.plotAreaCalculatedLow)),{...pe,properties:{...w,alias:_,color:ae}}}).filter(pe=>pe.properties&&Object.keys(pe.properties).length>0),Ye=()=>{let C;if(y)ne.chartData=L,ne.yMaxLeft=Math.min(...L.map(se=>se.data[0].value)),ne.yMaxRight=Math.max(...L.map(se=>se.data[0].value));else{const se=L[0]?.properties?.measureUniqueId;let Se=0,pe=-1/0;C=L.map((K,w)=>{const _=K.properties.measureUniqueId===se,ae=K.data.map($=>{const V=_?-Math.abs($.value):Math.abs($.value);return{...$,value:V}}),re=ae.map($=>$.value);return _?Se=Math.min(Se,Math.min(...re)):pe=Math.max(pe,Math.max(...re)),{...K,data:ae}}),ne.chartData=C,ne.yMaxLeft=Se,ne.yMaxRight=pe}const j=t?vt(e.xAxisLabel.xAxisNumberFormat,ne.dimensionList):ne.dimensionList;ne.dimensionList.forEach((se,Se)=>{ne.formattedDimensionListMap.set(se,j[Se])}),me=JSON.parse(JSON.stringify(y?L:C)),L=me,z=ne.dimensionList,e.plotArea.hideZeroValues&&(ne.hideZeroValues=!0)},O=()=>{let C=ne.yMaxLeft,j=ne.yMaxRight,se=e.annotation.annotationVisibility!="5"&&e.annotation.annotationPosition=="1"?20:0,Se,pe=!1,K=!1;C>j?(Se=C,pe=!0):(Se=j,K=!0);let w=e.annotation.annotationVisibility!="5"?C/Se!==1?Math.abs(C/Se)*100<10?3:0:Math.abs(j/Se)*100<10?3:0:0,_=0,ae=0;C<0&&j>0?(_=C*(1.2+(K?w:0)),ae=j*(1.2+(pe?w:0))):C>=0&&j>=0?(_=0,ae=j*(1.2+(pe?w:0))):C<=0&&j<=0?(_=C*(1.2+(K?w:0)),ae=0):(_=C*1.2,ae=j*1.2),_=Math.floor(_),ae=Math.ceil(ae),a=T.scaleLinear().domain([_,ae]).range([se,J-se]),v=a,Fe()},Fe=()=>{h=T.scalePoint().domain(z).range([M,0]).padding(.5)},We=()=>{g=T.axisLeft(h).tickSize(Yt(e,J-a(0),0)).tickSizeOuter(0).tickValues(At(z,M,e)),ce=T.axisRight(h).tickSize(Yt(e,a(0),0)).tickSizeOuter(0).tickValues(At(z,J,e))},Ue=()=>{P=T.axisBottom(a).tickFormat(C=>qe(C,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(ut(ne.yMaxRight,ne.yMaxLeft,M,e,ne,G,I,b,J).yAxisLabelArray).ticks(ut(I||ne.yMaxLeft,ne.yMinLeft,M,e,ne,G,I,b,J).customTickValue??J/30).tickPadding(8).tickSizeOuter(0)},xe=()=>{i.selectAll(".parentGroup").remove();const C=e.plotArea.plotAreaCalculatedHigh,j=e.plotArea.plotAreaCalculatedLow,se=i.append("g").attr("class","parentGroup"),Se=e.animation.animationEnabled,pe=se.selectAll("rect").data(me.flatMap(w=>w.data.map(_=>({..._,legendText:y?w.legend.split("ve) - ")[1]?.trim()??w.legend:ne.dimensionList[0]==ee.TornadoDefaultEntry?Mi.default:w.legend.split("-")[1]?.trim()??w.legend,properties:w.properties})))).enter().append("rect").attr("class","rect").attr("y",w=>(w.legendText?h(w.legendText):h(ee.TornadoDefaultEntry))-m/2).attr("height",m).attr("x",v(0)).attr("width",0).style("shape-rendering","crispEdges").attr("stroke-dasharray",w=>w.properties.stackBorderStyle==2?"5,3":"0").attr("stroke-width",w=>`${w.properties.stackBorderWidth}px`).attr("hoverId",w=>((y?w.legend.split(" - ")[0]:w.dimension)||"Legend").replace(/\s+/g,"-")).attr("stroke",w=>w.properties.stackBorderStyle==0?"none":e.column.stackBorderVisibility?w.properties.stackBorderColor:"none").style("fill",w=>y?w.value>0?C!==ze.white?C:"none":j!==ze.white?j:"none":w.properties.color).on("mousemove",(w,_)=>{xt([{key:"Measure",value:e.yAxisTitle.yAxisTitleHTML!==""?new DOMParser().parseFromString(e.yAxisTitle.yAxisTitleHTML,"text/html").body.textContent?.trim():l.IsCalCSensitivity?_.properties.currentMeasure.split("~$~")[1]:_.dimension},{key:"Legend",value:_.legendText},{key:"Value",value:qe(Math.abs(_.value),e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision,!0)}],e,w,l.IsCalCSensitivity?_.properties.legend==="Calculated Low(-ve)"?{markerColor:e.plotArea.plotAreaCalculatedLow}:{markerColor:e.plotArea.plotAreaCalculatedHigh}:_.properties,Lt(o,String(ne.formattedDimensionListMap.get(_.legend)??_.legend??""),_.properties))}).on("mouseout",ct).attr(rt.SeriesId,w=>String(w.properties?.legendUniqueId??"")).attr(rt.DimValue,w=>String(w.legend??w.legendText??"")).on("click",kt(Z,A,(w,_)=>({seriesId:String(_.properties?.legendUniqueId??""),dimValue:String(_.legend??_.legendText??""),legendUniqueId:String(_.properties?.legendUniqueId??""),seriesDisplayName:String(_.properties?.alias||_.properties?.name||_.legendText||"")})));(Se?pe.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]):pe).attr("x",w=>w.value>=0?v(0):v(w.value)).attr("width",w=>Math.abs(v(w.value)-v(0)))},ke=C=>{J=x-C.left-C.right,M=k-C.bottom-C.top},De=(C,j,se)=>{me=j,z=C,Me=se,we()};function $e(C){const j=new Map;return C.forEach(se=>{let Se=j.get(se.properties.legendUniqueId);if(Se){let pe=Se.data??[];pe.push(se.data[0]),j.set(se.properties.legendUniqueId,{...Se,data:pe})}else Se={...se,data:[se.data[0]]},j.set(se.properties.legendUniqueId,Se)}),j.size>0?Array.from(j.keys()).map(se=>j.get(se)):C}function ge(C,j,se,Se,pe,K,w,_,ae,re,$,V,U=!1){const F=(E,W,Ae,ue,oe)=>{try{if(oe&&(E=re+E),!ae||!Array.isArray(ae.dimensionList)||!Array.isArray(C))return;E=E==null?0:Number(E),W=W==null?0:Number(W),Ae=Ae==null?0:Number(Ae),re=Xa(Math.round(E),0,Math.max(0,W)),_=typeof _=="number"?_:0;const fe=re,Re=fe+_;let Ve=ae.dimensionList.slice(fe,Re);const be=Ve[0]==ee.TornadoDefaultEntry;let Ge=JSON.parse(JSON.stringify(C||[]));Ge=Ge.filter(He=>be?!0:Ve.includes(He.legend.split(" - ")[1]));const it=pe?.left??0,st=pe?.top??0,ja=Number(K)||0,Ba=Number(M)||0,yi=Number(Ae)||0,ki=W===0?1:W;if(U){const He=st+(Ba-yi)*(W===0?0:re)/ki;ue&&typeof ue.attr=="function"&&ue.attr("y",He)}else{const He=it+(ja-yi)*(W===0?0:re)/ki;ue&&typeof ue.attr=="function"&&ue.attr("x",He)}V(Ve,Ge,_)}catch(fe){typeof Ce=="function"&&Ce("ColumnChart","updateFromScrollPosition",fe)}};if(w){const E=j-pe.top-pe.bottom,W=Math.max(0,Y.length-_),Ae=j-8;Se.append("rect").attr("id","scrollbarTrack").attr("x",U?se-8:pe.left).attr("y",U?pe.top:Ae).attr("width",U?8:K).attr("height",U?E:8).attr("fill","#ccc");const ue=(U?E:K)*_/ae.dimensionList.length,oe=Se.append("rect").attr("x",U?se-8:pe.left).attr("y",U?pe.top:Ae).attr("width",U?8:ue).attr("height",U?ue:8).attr("fill","#999").style("cursor",U?"ns-resize":"ew-resize");oe.call(T.drag().on("drag",fe=>{if(U){const Ve=(Xa(fe.y,pe.top,pe.top+E-ue)-pe.top)/(E-ue)*(W||1);F(Ve,W,ue,oe,!1),oe.attr("y",pe.top+(E-ue)*(W===0?0:re)/(W===0?1:W))}else{const Ve=(Xa(fe.x,pe.left,pe.left+K-ue)-pe.left)/(K-ue)*(W||1);F(Ve,W,ue,oe,!1),oe.attr("x",pe.left+(K-ue)*(W===0?0:re)/(W===0?1:W))}})),Se.on("wheel",fe=>{fe.preventDefault();const Ve=(Math.abs(fe.deltaX)>Math.abs(fe.deltaY)?fe.deltaX:fe.deltaY)>0?1:-1;if(F(Ve,W,ue,oe,!0),U){const be=pe.top+(E-ue)*(W===0?0:re)/(W===0?1:W);oe.attr("y",be)}else{const be=pe.left+(K-ue)*(W===0?0:re)/(W===0?1:W);oe.attr("x",be)}})}else Se.on("wheel",null);F(0,0,0,null,!0)}const we=()=>{Fe(),We(),oa(e,i,R,M,J,g,ce,v,ne.yMaxLeft,z,f,t,x,te,m,h),xe();const C=$e(me);$a(C??[],h,v,null,D,bt,[],[],e,f,k,x,J,z,M,p,d,u,h,m,s,y,b,y)};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:S,id:p,style:{width:"100%",height:"100%"}})})},_r=({isDateType:t,formatOptions:e,data:l,isReportEditable:s,onDataLabelCoordinatesChange:u,addLocalFilterFromLib:r,tooltipFormatter:n})=>{const o=crypto.randomUUID();let p=0;const m=ee.DotPlot,f=Ne.useRef(),y=ft(l.ChartData,l.DimensionList),S=l.DimensionList,A=!0,Z=!1;let L=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMinText):void 0,Y=e.yAxisLabel.yAxisIntervalsVisibility?parseFloat(e.yAxisLabel.yAxisMaxText):void 0,b,H,B,G,I,D,N,R,X,le,te,Q,de,Le,Te,he,q,J,M,x,k,c,d,i,h=[],v=0,a=2,g=!1,P=[];const ce=!1;let z={dimensionList:S,chartType:m,chartData:[],formatOptions:e,legendList:[],secondaryAxisDrawn:!1,yMaxLeft:0,yMaxRight:0,yMinLeft:0,yMinRight:0,hideZeroValues:!1,formattedDimensionListMap:new Map};Ne.useEffect(()=>{try{me()}catch(De){Ce("StackStackHorizontalBarchart","createDotPlot",De)}},[e]);const me=()=>{({formatOptions:e,svg:q,width:Te,height:he}=wt(f,e)),ve(),{maxNumberForPrimaryAxis:te,maxNumberForSecondaryAxis:Q}=$t(e,z.yMinLeft,z.yMaxLeft,z.yMinRight,z.yMaxRight),{margin:b,yLabel:H,xLabel:B,yTitle:G,xTitle:I,dimensionHeightWidthArray:D,chartTitleHeight:N,secondaryAxisTitleWidth:R,legendMargin:X,secondaryYLabel:le,visibleBars:a,columnWidth:p,scrollbarVisible:g}=St(Te,he,te,Q,z.yMaxLeft,e,z.legendList,z.dimensionList,z.yMaxRight,Z,ce,t,A,z),Ye(b),Ft(q,Te,he,e),J=Dt(q,b),Ct(J,e,0,de,Le,m),Me(),ne(),sa(e,J,H,Le,de,c),Vt(e,A,q,b,B,he,I,z.chartType,H,de,Le),Nt(Le,e,0,A,q,b,G,H),Pt(q,e,Te,N),Et(he,q,D,N,Te,X,e,y,o,0,b,dt.rectangle,m,r),Xt(y,he,Te,q,b,de,g,a,z,v,!1,O,A)},ve=()=>{const De=[],$e=[];let ge=[],we=-1/0,C=1/0,j=-1/0,se=1/0;y.forEach(Se=>{$e.push(Se.properties.legendUniqueId),Se.data.forEach(pe=>{De.push(pe),we=Math.max(we,pe.value),C=Math.min(C,pe.value)})}),z.chartData=De,z.legendList=$e,z.yMaxLeft=we,z.yMinLeft=C>0?0:C,z.yMaxRight=j,z.yMinRight=se,ge=t?vt(e.xAxisLabel.xAxisNumberFormat,z.dimensionList).map(Se=>Se):z.dimensionList,ge=t?vt(e.xAxisLabel.xAxisNumberFormat,z.dimensionList).map(Se=>Se):z.dimensionList,z.dimensionList.forEach((Se,pe)=>{z.formattedDimensionListMap.set(Se,ge[pe]),z.formattedDimensionListMap.set(Se,ge[pe])}),h=JSON.parse(JSON.stringify(y)),e.plotArea.fitChart?i=z.dimensionList:i=z.dimensionList.slice(v,v+a),e.plotArea.hideZeroValues&&(z.hideZeroValues=!0)},Me=()=>{let De=ut(Y||z.yMaxLeft,z.yMinLeft,Le,e,z,L,Y,A,de).yAxisLabelArray;z.yMaxLeft=De[De.length-1],z.yMinLeft=De[0],M=T.scaleLinear().domain([z.yMinLeft>=0?L!==void 0&&!Number.isNaN(L)?L:0:z.yMinLeft<0?z.yMinLeft*1.1:z.yMinLeft*.9,z.yMaxLeft<=0?0:Y!==void 0&&!Number.isNaN(Y)?Y:z.yMaxLeft*1.1]).range([0,de]),k=[Le,0],Pe()},Pe=()=>{T.scaleBand().domain(["layeredLegend"]).range([0,p]).paddingInner(z.legendList.length>1?.3*parseFloat(e.plotArea.plotAreaSeriesWidth)/100:0),x=T.scalePoint().domain(i).range(k).padding(.5)},ne=()=>{Be();{let De=ut(Y||z.yMaxLeft,z.yMinLeft,Le,e,z,L,Y,A,de);c=T.axisBottom(M).tickFormat($e=>qe($e,e.yAxisLabel.yAxisDisplayUnits,e.yAxisLabel.yAxisNumberFormat,e.yAxisLabel.yAxisLabelDecimalPrecision)).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?-Le:0).tickValues(De.autoLabelFlag?void 0:De.yAxisLabelArray).ticks(De.customTickValue).tickPadding(8).tickSizeOuter(0)}},Be=()=>{d=T.axisLeft(x).tickSize(e.plotArea.gridLinesVisibility&&e.plotArea.gridLinesHorizontal?parseFloat(e.plotArea.ticksHeight)*de*(e.xAxisLabel.xAxisPosition=="1"?1:-1)*.01:0).tickSizeOuter(0).tickValues(At(i,Le,e))},ye=De=>{De.forEach(C=>{C.data.forEach(j=>{j.markerShape=C.properties.markerShape||"Circle",j.markerSize=C.properties.markerSize||6,j.markerColor=C.properties.markerColor||C.properties.color,j.alias=C.properties.alias,j.lineStyle=C.properties.lineStyle,j.lineWidth=C.properties.lineWidth,j.lineColor=e.plotArea.dotPlotLineColor??"#c7c7c7"})});const $e=T.group(De.flatMap(C=>C.data.map(j=>({...j,color:C.properties.color}))),C=>C.dimension),ge=J.selectAll(".cleveland-line-group").data(Array.from($e),([C])=>C);ge.enter().append("g").attr("class","cleveland-line-group").append("line").merge(ge.select("line")).attr("y1",([C])=>x(C)).attr("y2",([C])=>x(C)).attr("x1",([,C])=>M(Math.min(C[0]?.value??0,C[1]?.value??0))).attr("x2",([,C])=>M(Math.max(C[0]?.value??0,C[1]?.value??0))).attr("stroke",C=>C[1][0].lineColor).attr("stroke-width",C=>C[1][0].lineStyle!=="None"?C[1][0].lineWidth:0).attr("stroke-dasharray",C=>{switch(C[1][0].lineStyle){case gt.dotted:return"1,4";case gt.dashed:return Ta;default:return""}}).attr("stroke-linecap",C=>C[1][0].lineStyle===gt.dotted?xa.round:""),ge.exit().remove(),De.forEach(C=>{let j=J.selectAll(".parentGroup").data([C],w=>w.properties.legendUniqueId);j=j.enter().append("g").attr("class","parentGroup").attr("hoverId",(C.properties.alias||C.properties.name||"Legend").replace(/\s+/g,"-")).merge(j);let se=j.selectAll(".column-group").data(C.data,w=>w.dimension),Se=se.enter().append("g").attr("class","column-group");const pe=e.animation.animationEnabled,K=Se.append("path").attr("class","cleveland-dot").attr("opacity",pe?0:.9);K.merge(se.select("path")).attr("d",w=>T.symbol().type(Xi(w.markerShape)).size((w.markerSize||6)*70)()).attr("transform",w=>{const _=M(w.value),ae=x(w.dimension);return`translate(${_},${ae})`}).attr("fill",w=>C.properties.color).attr("data-series-id",()=>C.properties.legendUniqueId??C.properties.alias).attr("data-dim-value",w=>String(w.dimension??"")).attr("visibility",()=>e.marker?.markerVisibility?"visible":"hidden").on("mousemove",(w,_)=>{xt([{key:e.xAxisTitle.xAxisTitleText,value:z.formattedDimensionListMap.get(_.dimension)},{key:e.yAxisTitle.yAxisTitleText,value:qe(_.value,e.toolTip.toolTipDisplayUnits,e.toolTip.toolTipNumberFormat,e.toolTip.toolTipDecimalPrecision)},{key:"Legend",value:_.alias}],e,w,C.properties,Lt(n,String(_.dimension??""),{...C.properties,formattedDimensionValue:String(z.formattedDimensionListMap.get(_.dimension)??_.dimension??"")}))}).on("mouseout",()=>{T.selectAll(".parentGroup").classed("highlight",!1).classed("unhighlight",!1),T.selectAll(".halo").remove(),ct()}),pe&&K.transition().duration(e.animation.animationDuration).ease(tt[e.animation.animationEffect]).attr("opacity",.9),se.exit().remove()}),J.selectAll(".parentGroup").raise()},Ye=De=>{de=Te-De.left-De.right,Le=he-De.bottom-De.top},O=(De,$e,ge)=>{h=$e,i=De,a=ge,Fe()},Fe=()=>{Pe(),Be(),oa(e,J,B,Le,de,d,void 0,M,z.yMaxLeft,i,m,t,Te,D,p,x),We(),ye(h),$a(h,x,M,void 0,b,bt,[],[],e,m,he,Te,de,i,Le,o,q,u,x,p,s,!1,A),Ue()},We=()=>{let De=mt(i,h,ce);P=T.stack().keys(z.legendList).offset(T.stackOffsetDiverging)(De),h.forEach((ge,we)=>ge.data.forEach((C,j)=>{C[0]=P[we][j][0],C[1]=P[we][j][1]}));let $e=e.annotation.annotationSetLabelColor;P.forEach((ge,we)=>ge.forEach(C=>{C.key=ge.key,ge.color=JSON.parse(JSON.stringify(y[we].properties.color)),C.data.labelPosition=y[we].properties.dataLabelPosition,C.data.labelColor=$e=="2"?JSON.parse(JSON.stringify(y[we].properties.color)):y[we].properties.labelColor,C.hideZero=JSON.parse(JSON.stringify(y[we].properties.hideZeroValues))}))},Ue=()=>{try{const De=Number(e.connector?.connectorVisibility);if(!e.connector||De===2)return;const $e=[],ge=[],we=[];let C;const j=[];if(De===1)C=1;else if(De===3){const ae=Number(e.connector.connectorFollow);ae===1?C=Number(e.connector.connectorStepSize):ae===2&&((e.connector.connectorExclude||[]).forEach(re=>we.push(re)),C=1)}const se=[],Se=[],pe=[],K=e.connector?.connectorCustomRange||[];we.forEach(ae=>{const re=ae.split("-");re.length&&se.push(re[0])});const _=(P?.[0]||[]).map((ae,re)=>({Dimension:ae.data.Dimension,Total:ae.data.Total,CustomTotal:ae.data.Total-(pe[re]??0),Index:re}));if(C!=null){for(let ae=0;ae<_.length;ae++)(C===1||ae%C===0&&C!==1)&&$e.push(_[ae]);for(let ae=C;ae<_.length;ae+=C){const re=Math.min(ae+C,_.length);let $=-1/0;for(let V=ae;V<re;V++)_[V].Total>$&&($=_[V].Total);$!==-1/0&&j.push($)}for(let ae=1;ae<$e.length;ae++)ge.push($e[ae])}else{const ae=[];(K||[]).forEach(re=>{if(re?.from&&re?.to){const $=_.some(U=>U.Dimension===re.from),V=_.some(U=>U.Dimension===re.to);$&&V&&ae.push({from:re.from,to:re.to})}}),ae.forEach(re=>{const $=_.findIndex(U=>U.Dimension===re.from),V=_.findIndex(U=>U.Dimension===re.to);if($>=0&&V>=0){const U=Math.min($,V),F=Math.max($,V);$e.push(_[U]);let E=_[U]?.Total??-1/0;for(let W=U;W<=F;W++)_[W].Total>E&&(E=_[W].Total);E!==-1/0&&j.push(E),ge.push(_[F])}})}J.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!==ze.white?e.connector.connectorMarkerColor:"none"),xe($e,j,ge,C,se),ke($e,j,ge,C,se)}catch(De){console.error(De)}},xe=(De,$e,ge,we,C)=>{try{J.append("g").selectAll("path").data(De).enter().filter((j,se)=>we!=null?se<De.length-1:se<De.length).append("path").attr("d",(j,se)=>e.total.totalVisibility?`M ${M(j.Total)+50},
260
+ ${x(j.Dimension)+x.bandwidth()/2-5}
261
+ H ${60+Math.max(M($e[se]),M(ge[se].Total),M(j.Total))}
262
+ V ${x(ge[se].Dimension)+x.bandwidth()/2+5}
263
+ H ${30+M(ge[se].Total)}`:`M ${M(j.Total)+30},
264
+ ${x(j.Dimension)+x.bandwidth()/2-5}
265
+ H ${45+Math.max(M($e[se]),M(ge[se].Total),M(j.Total))}
266
+ V ${x(ge[se].Dimension)+x.bandwidth()/2+5}
267
+ H ${10+M(ge[se].Total)}
268
+ `).style("stroke",e.connector.connectorLineColor!==ze.white?e.connector.connectorLineColor:"none").attr("fill","none").attr("stroke-width",e.connector.connectorLineThickness).attr("marker-end","url(#arrow)").style("visibility",j=>C.includes(j.Dimension)||j.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(j){console.error(j)}},ke=(De,$e,ge,we,C)=>{try{let j=e.connector.connectorFontStyle,se=e.connector.connectorNumberFormat,Se=Le/30<i.length?Math.round(Le/30):i.length;(e.connector.connectorKPI=="2"||e.connector.connectorKPI=="3")&&(se=".2s"),J.append("g").selectAll("text1").data(De).enter().filter((pe,K)=>we!=null?K<De.length-1:K<De.length).append("text").attr("y",(pe,K)=>we==null?x(ge[K].Dimension)/2+x(pe.Dimension)/2+15:we==1?Se<6&&x.bandwidth()>40?x(ge[K].Dimension)+x.bandwidth()/2+x.bandwidth()/2+13:x(ge[K].Dimension)+x.bandwidth()/2+x.bandwidth()/2+7:x(ge[K].Dimension)+x.bandwidth()/2+x.bandwidth()/2*we+12).attr("x",(pe,K)=>e.total.totalVisibility?70+Math.max(M($e[K]),M(ge[K].Total),M(pe.Total)):50+Math.max(M($e[K]),M(ge[K].Total),M(pe.Total))).text((pe,K)=>(pe.CustomTotal==0&&ge[K].CustomTotal!=0&&(pe.CustomTotal=1),Ti(ge[K].Total,pe.Total,parseInt(e.connector.connectorDecimalPrecision),se,parseInt(pe.Dimension),parseInt(ge[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!==ze.white?e.connector.connectorFontColor:"none").style("font-weight","lighter").style("font-style",j.includes("Italic")?"Italic":"").style("text-decoration",j.includes("Underline")?"Underline":"").style("font-weight",j.includes("Bold")?"Bold":"").style("visibility",pe=>C.includes(pe.Dimension)||pe.Total==0&&e.yAxisLabel.hideZeroValues?"hidden":"visible")}catch(j){console.error(j)}};return je.jsx("div",{style:{width:"100%",height:"100%"},children:je.jsx("svg",{className:"chartSVG",ref:f,id:o,style:{width:"100%",height:"100%"}})})},ra=["#4472C4","#ED7D31","#A9D18E","#FFC000","#5B9BD5","#70AD47","#FF0000","#7030A0","#00B0F0","#92D050","#F4B942","#D55E00","#CC79A7","#0072B2","#009E73"];function ma(t,e=1){const l=t.replace("#",""),s=parseInt(l.substring(0,2),16),u=parseInt(l.substring(2,4),16),r=parseInt(l.substring(4,6),16);return isNaN(s)||isNaN(u)||isNaN(r)?t:`rgba(${s},${u},${r},${e})`}function xl(t){return t==="Dotted"?[2,4]:t==="Dashed"?[8,4]:[]}function fa(t,e,l,s=ra){const{ChartData:u,DimensionList:r,LegendList:n}=t,o=r?.length?r:u[0]?.data?.map(m=>m.dimension)??[],p=Number(l.plotArea?.fillOpacity??.8);return e==="pie"||e==="doughnut"||e==="polarArea"?Jr(u,o,p,s,n):e==="scatter"?Zr(u,s):e==="bubble"?Xr(u,s):jr(u,o,e,l,p,s)}function jr(t,e,l,s,u,r){const n=t.map((o,p)=>{const m=o.properties?.color??r[p%r.length],f=o.properties?.opacity??1,y=new Map;o.data?.forEach(Y=>y.set(Y.dimension,Y.value));const S=e.map(Y=>y.get(Y)??0),A=o.Axis==="Secondary"||o.properties?.axis==="Secondary"?"y1":"y",Z=Number(o.properties?.lineWidth??s.plotArea?.lineWidth??2);return l==="line"||l==="area"?{type:"line",label:o.properties.alias,data:S,borderColor:m,backgroundColor:l==="area"?ma(m,u*f):ma(m,.1),fill:l==="area",borderWidth:Z,borderDash:xl(o.properties?.lineStyle),pointRadius:s.marker?.markerVisibility?Number(s.marker?.markerSize??4):3,tension:Number(s.cjsOptions?.cjsTension??.4),yAxisID:A}:l==="radar"?{label:o.properties.alias,data:S,borderColor:m,backgroundColor:ma(m,u*f),fill:!0,borderWidth:Z,pointRadius:s.marker?.markerVisibility?Number(s.marker?.markerSize??4):3}:{type:"bar",label:o.properties.alias,data:S,backgroundColor:ma(m,u*f),borderColor:m,borderWidth:Number(o.properties?.stackBorderWidth??0),borderRadius:Number(s.cjsOptions?.cjsBorderRadius??s.plotArea?.cornerRadius??0),yAxisID:A}});return{labels:e,datasets:n}}function Jr(t,e,l,s,u){const n=(t.length?t:[]).map(o=>{const p=e.map(f=>o.data?.find(S=>S.dimension===f)?.value??0),m=e.map((f,y)=>{const S=u?.[y]?.color;return ma(S??s[y%s.length],l)});return{label:o.properties.alias,data:p,backgroundColor:m,borderColor:m.map(f=>f.replace(/,[^,]+\)$/,",1)")),borderWidth:1}});return{labels:e,datasets:n}}function Zr(t,e){return{datasets:t.map((s,u)=>{const r=s.properties?.color??e[u%e.length],n=s.data?.map(o=>({x:typeof o[0]=="number"?o[0]:parseFloat(o.dimension)||u,y:o.value??0}))??[];return{label:s.properties.alias,data:n,backgroundColor:ma(r,.7),borderColor:r,pointRadius:5}})}}function Xr(t,e){return{datasets:t.map((s,u)=>{const r=s.properties?.color??e[u%e.length],n=s.data?.map(o=>({x:typeof o[0]=="number"?o[0]:parseFloat(o.dimension)||u,y:o.value??0,r:Number(o.markerSize??s.properties?.markerSize??8)}))??[];return{label:s.properties.alias,data:n,backgroundColor:ma(r,.6),borderColor:r}})}}function ci(t,e,l,s=ra){const{ChartData:u,DimensionList:r}=t,n=r?.length?r:u[0]?.data?.map(f=>f.dimension)??[],o=new Map;n.forEach(f=>{const y=u.reduce((S,A)=>{const Z=A.data?.find(L=>L.dimension===f);return S+Math.abs(Z?.value??0)},0);o.set(f,y)});const p=Number(l.plotArea?.fillOpacity??.8),m=u.map((f,y)=>{const S=f.properties?.color??s[y%s.length],A=f.properties?.opacity??1,Z=new Map;f.data?.forEach(b=>Z.set(b.dimension,b.value));const L=n.map(b=>{const H=Z.get(b)??0,B=o.get(b)??0;return B>0?parseFloat((H/B*100).toFixed(4)):0}),Y=Number(f.properties?.lineWidth??l.plotArea?.lineWidth??2);return e==="line"||e==="area"?{type:"line",label:f.properties.alias,data:L,borderColor:S,backgroundColor:e==="area"?ma(S,p*A):ma(S,.1),fill:e==="area",borderWidth:Y,borderDash:xl(f.properties?.lineStyle),pointRadius:l.marker?.markerVisibility?Number(l.marker?.markerSize??4):3,tension:Number(l.cjsOptions?.cjsTension??.4),yAxisID:"y"}:{type:"bar",label:f.properties.alias,data:L,backgroundColor:ma(S,p*A),borderColor:S,borderWidth:Number(f.properties?.stackBorderWidth??0),borderRadius:Number(l.cjsOptions?.cjsBorderRadius??l.plotArea?.cornerRadius??0),yAxisID:"y"}});return{labels:n,datasets:m}}function _a(t){return t&&(t.includes("Italic")||t.includes("italic"))?"italic":"normal"}function di(t){return t&&(t.includes("Bold")||t.includes("bold"))?"bold":"normal"}function qr(t){return{easeLinear:"linear",easeCubicIn:"easeInCubic",easeCubicOut:"easeOutCubic",easeCubicInOut:"easeInOutCubic",easeBounceOut:"easeOutBounce",easeElasticOut:"easeOutElastic",easeBackOut:"easeOutBack"}[t??""]??"easeOutCubic"}function Kr(t){switch(t){case"Top":return"top";case"Bottom":return"bottom";case"Left":return"left";case"Right":return"right";default:return"top"}}function hl(t,e,l){const s=parseInt(l??"0",10);return e==="Thousands"?(t/1e3).toFixed(s)+"K":e==="Millions"?(t/1e6).toFixed(s)+"M":e==="Billions"?(t/1e9).toFixed(s)+"B":t.toFixed(s)}function Qr(t,e){return t.find(l=>l.alias==e)}function Or(t,e){const l=Math.max(2,e||3);if(l>=t)return new Set(Array.from({length:t},(r,n)=>n));const s=t-1,u=new Set;for(let r=0;r<l;r++)u.add(Math.round(r*s/(l-1)));return u}function aa(t,e,l=!1,s,u){const r=e==="pie"||e==="doughnut"||e==="polarArea",n=e==="horizontalBar";let o=0;const p=300,m=t.plotArea?.gridLinesColor??"#e0e0e0",f=t.legends?.legendFontColor??"#333333",y={responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!1},legend:{display:t.legends?.legendVisibility!==!1&&t.legends?.legendPosition!=="None",position:Kr(t.legends?.legendPosition),labels:{color:f,font:{size:parseInt(t.legends?.legendFontSize??"12",10),family:t.legends?.legendFontFamily??at,style:_a(t.legends?.legendFontStyle),weight:di(t.legends?.legendFontStyle)},usePointStyle:!1,boxWidth:12,padding:16},onClick:function(S,A,Z){if(s){const L=new Date().getTime();if(L-o<p){const b=Qr(u,A.text);b&&s(b),o=0}else o=L}}},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:m,borderWidth:1,padding:10,callbacks:{label(S){const A=typeof S.raw=="number"?S.raw:S.raw?.y??0,Z=qe(A,t.toolTip?.toolTipDisplayUnits??"None",t.toolTip?.toolTipNumberFormat??",",t.toolTip?.toolTipDecimalPrecision??"2");return` ${S.dataset.label}: ${Z}`}}},datalabels:en(t,e)},animation:t.animation?.animationEnabled?{duration:t.animation?.animationDuration??1e3,easing:qr(t.animation?.animationEffect)}:!1};if(!r){const S=e==="scatter"||e==="bubble",A=t.xAxisLabel?.xAxisTicksMode==="Custom",Z=Math.max(2,parseInt(t.xAxisLabel?.xAxisTicksCount)||3),L={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??at,style:_a(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??at,style:_a(t.xAxisLabel?.xAxisLabelFontStyle),weight:di(t.xAxisLabel?.xAxisLabelFontStyle)},maxRotation:t.xAxisLabel?.xAxisLabelRotation??0,minRotation:t.xAxisLabel?.xAxisLabelRotation??0,...S&&A?{count:Z}:{}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesVertical!==!1,color:m},border:{color:t.xAxisLabel?.xAxisColor??"#000000",width:parseFloat(t.xAxisLabel?.xAxisWidth??"0.5")},...!S&&A?{afterBuildTicks:H=>{const B=Or(H.ticks.length,Z);H.ticks=H.ticks.filter((G,I)=>B.has(I))}}:{}},Y={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??at,style:_a(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??at,style:_a(t.yAxisLabel?.yAxisLabelFontStyle),weight:di(t.yAxisLabel?.yAxisLabelFontStyle)},callback(H){return hl(H,t.yAxisLabel?.yAxisDisplayUnits,t.yAxisLabel?.yAxisLabelDecimalPrecision)},...t.yAxisLabel?.yAxisTicksMode==="Custom"?{count:Math.max(2,parseInt(t.yAxisLabel?.yAxisTicksCount)||3)}:{}},grid:{display:t.plotArea?.gridLinesVisibility!==!1&&t.plotArea?.gridLinesHorizontal!==!1,color:m},border:{color:t.yAxisLabel?.yAxisColor??"#cccccc",width:parseFloat(t.yAxisLabel?.yAxisWidth??"0.5")}};n?(y.scales={x:{...Y,position:"bottom"},y:{...L,position:"left",reverse:!0}},y.scales.x.title&&(y.scales.x.title.text=t.yAxisTitle?.yAxisTitleText??"Measure"),y.scales.y.title&&(y.scales.y.title.text=t.xAxisTitle?.xAxisTitleText??"Dimension")):y.scales={x:L,y:Y},l&&(y.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??at}},ticks:{display:t.secondaryYAxisLabel?.secondaryYAxisLabelVisibility!==!1,color:t.secondaryYAxisLabel?.secondaryYAxisLabelColor??"#000000",font:{size:parseInt(t.secondaryYAxisLabel?.secondaryYAxisLabelFontSize??"11",10),family:t.secondaryYAxisLabel?.secondaryYAxisLabelFontFamily??at,style:_a(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle),weight:di(t.secondaryYAxisLabel?.secondaryYAxisLabelFontStyle)},callback(H){return hl(H,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")&&(y.scales?.x&&(y.scales.x.stacked=!0),y.scales?.y&&(y.scales.y.stacked=!0))}return y}function pl(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 en(t,e="bar"){const l=t.annotation,s=e==="pie"||e==="doughnut"||e==="polarArea",u=e==="horizontalBar",r=l?.annotationVisibility??"5";if(r==="5"||!r)return{display:!1};const n=l?.annotationPosition??"1",o=l?.annotationHideZeroValues!==!1,p=parseInt(l?.annotationFontSize??"9",10)||9,m=l?.annotationFontFamily??at,f=_a(l?.annotationFontStyle),y=di(l?.annotationFontStyle),S=l?.annotationColor??"#000000",A=l?.annotationSetLabelColor==="2",Z=l?.annotationDecimalPrecision??"2",L=l?.annotationNumberFormat??",",Y=l?.annotationDisplayUnits??"None";function b(D){const N=D.dataset?.data?.length??0,R=D.dataIndex??0;switch(r){case"1":return!0;case"2":return R===0;case"3":return R===N-1;case"4":return R===0||R===N-1;default:return!1}}function H(D){const N=D.dataset?.data?.[D.dataIndex];return pl(N)}function B(D){if(s)return n==="2"?"center":"end";const N=H(D);switch(n){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 G(D){if(s)return n==="2"?"center":"end";const N=H(D);if(u)switch(n){case"2":return"center";case"3":return"right";case"1":case"4":default:return N<0?"left":"right"}switch(n){case"2":return"center";case"3":return N>0?"top":"bottom";case"1":case"4":default:return N<0?"bottom":"top"}}function I(D,N){const R=pl(D);if(o&&R===0)return null;const X=qe(R,Y,L,Z);if(s){const le=N?.chart?.data?.labels?.[N.dataIndex]??"";return le?`${le}
269
+ ${X}`:X}return X}return{display:b,anchor:B,align:G,offset:s?n==="2"?0:8:n==="2"?0:4,color:A?D=>{const N=D.dataset?.backgroundColor,R=D.dataset?.borderColor,X=Array.isArray(N)?N[D.dataIndex]:N;return typeof X=="string"&&X?X:typeof R=="string"&&R?R:S}:S,font:{size:p,family:m,style:f,weight:y},formatter:I,clip:!1}}Mt.Chart.register(Mt.BarController,Mt.LineController,Mt.PieController,Mt.DoughnutController,Mt.ScatterController,Mt.BubbleController,Mt.RadarController,Mt.PolarAreaController,Mt.CategoryScale,Mt.LinearScale,Mt.RadialLinearScale,Mt.PointElement,Mt.BarElement,Mt.LineElement,Mt.ArcElement,Mt.Title,Mt.Tooltip,Mt.Legend,Mt.Filler,Ml);const ia=({chartType:t,data:e,options:l,formatOptions:s,clientWidth:u,clientHeight:r,className:n,isChartStacked:o})=>{const p=Ne.useRef(null),m=Ne.useRef(null),f=Ne.useRef(!1);Ne.useEffect(()=>{if(p.current)return m.current?.destroy(),m.current=new Mt.Chart(p.current,{type:t,data:e,options:l}),f.current=!0,()=>{m.current?.destroy(),m.current=null}},[t,o]),Ne.useEffect(()=>{if(f.current){f.current=!1;return}const H=m.current;H&&(H.data=e,H.options=l,H.update())},[e,l]);const y=s.chartArea?.chartAreaColor??"#ffffff",S=Array.isArray(s.chartTitle?.chartTitleFontStyle)?s.chartTitle.chartTitleFontStyle:[],A=s.chartTitle?.chartTitleColor&&s.chartTitle.chartTitleColor!=="#ffffff"&&s.chartTitle.chartTitleColor!=="#FFFFFF00"?s.chartTitle.chartTitleColor:"rgba(119,119,119)",Z=s.chartTitle?.chartTitleFontSize?`${s.chartTitle.chartTitleFontSize}px`:"16px",L=s.chartTitle?.dynamicTitleText||s.chartTitle?.chartTitleText||"",Y=s.chartTitle?.chartTitleHTML||L,b=s.chartTitle?.chartTitleVisibility!==!1;return je.jsxs("div",{className:n,style:{width:"100%",height:"100%",backgroundColor:y,position:"relative",display:"flex",flexDirection:"column"},children:[b&&L&&je.jsx("div",{id:"chartTitleId",className:"chartTiltle",title:s.chartTitle?.chartTitleText,style:{color:A,fontSize:Z,fontFamily:s.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:Y}}),je.jsx("div",{style:{flex:1,minHeight:0},children:je.jsx("canvas",{ref:p,style:{width:"100%",height:"100%"}})})]})},bl=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,isChartStacked:u,colorBank:r,addLocalFilterFromLib:n})=>{const o=Ne.useMemo(()=>t.ChartData?.map(y=>y.properties),[t]),p=Ne.useMemo(()=>t.ChartData?.some(y=>y.Axis==="Secondary"||y.properties?.axis==="Secondary"),[t]),m=Ne.useMemo(()=>fa(t,"bar",e,r),[t,e,r]),f=Ne.useMemo(()=>{const y=aa(e,"bar",p,n,o);return u&&(y.scales??={},y.scales.x??={},y.scales.y??={},y.scales.x.stacked=!0,y.scales.y.stacked=!0),y},[e,p,u]);return je.jsx(ia,{chartType:"bar",data:m,options:f,formatOptions:e,clientWidth:l,clientHeight:s})},tn=t=>je.jsx(bl,{...t,isChartStacked:!0}),gl=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,isChartStacked:u,colorBank:r=ra,addLocalFilterFromLib:n})=>{const o=Ne.useMemo(()=>t.ChartData?.map(y=>y.properties),[t]),p=Ne.useMemo(()=>t.ChartData?.some(y=>y.Axis==="Secondary"||y.properties?.axis==="Secondary"),[t]),m=Ne.useMemo(()=>fa(t,"bar",e,r),[t,e,r]),f=Ne.useMemo(()=>{const y=aa(e,"horizontalBar",p,n,o);return y.indexAxis="y",u&&(y.scales??={},y.scales.x??={},y.scales.y??={},y.scales.x.stacked=!0,y.scales.y.stacked=!0),y},[e,p,u]);return je.jsx(ia,{chartType:"bar",data:m,options:f,formatOptions:e,clientWidth:l,clientHeight:s})},an=t=>je.jsx(gl,{...t,isChartStacked:!0}),Al=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,isChartStacked:u,colorBank:r=ra,addLocalFilterFromLib:n})=>{const o=Ne.useMemo(()=>t.ChartData?.map(y=>y.properties),[t]),p=Ne.useMemo(()=>t.ChartData?.some(y=>y.Axis==="Secondary"||y.properties?.axis==="Secondary"),[t]),m=Ne.useMemo(()=>fa(t,"line",e,r),[t,e,r]),f=Ne.useMemo(()=>{const y=aa(e,"line",p,n,o);return u&&(y.scales??={},y.scales.y??={},y.scales.y.stacked=!0),y},[e,p,u]);return je.jsx(ia,{chartType:"line",data:m,options:f,formatOptions:e,clientWidth:l,clientHeight:s})},ln=t=>je.jsx(Al,{...t,isChartStacked:!0}),Ll=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,isChartStacked:u,colorBank:r,addLocalFilterFromLib:n})=>{const o=Ne.useMemo(()=>t.ChartData?.map(y=>y.properties),[t]),p=Ne.useMemo(()=>t.ChartData?.some(y=>y.Axis==="Secondary"||y.properties?.axis==="Secondary"),[t]),m=Ne.useMemo(()=>fa(t,"area",e,r),[t,e,r]),f=Ne.useMemo(()=>{const y=aa(e,"area",p,n,o);return u&&(y.scales??={},y.scales.y??={},y.scales.y.stacked=!0),y},[e,p,u]);return je.jsx(ia,{chartType:"line",data:m,options:f,formatOptions:e,clientWidth:l,clientHeight:s})},rn=t=>je.jsx(Ll,{...t,isChartStacked:!0}),nn=({data:t,formatOptions:e,clientWidth:l,clientHeight:s,colorBank:u,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.LegendList??[],[t]),o=Ne.useMemo(()=>fa(t,"pie",e,u),[t,e,u]),p=Ne.useMemo(()=>aa(e,"pie",!1,r,n),[e]);return je.jsx(ia,{chartType:"pie",data:o,options:p,formatOptions:e,clientWidth:l,clientHeight:s})},sn=({data:t,formatOptions:e,clientWidth:l,clientHeight:s,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.LegendList??[],[t]),o=Ne.useMemo(()=>fa(t,"doughnut",e,u),[t,e,u]),p=Ne.useMemo(()=>{const m=aa(e,"doughnut",!1,r,n),f=e.plotArea?.innerRadius;return f!=null&&(m.cutout=`${f}%`),m},[e]);return je.jsx(ia,{chartType:"doughnut",data:o,options:p,formatOptions:e,clientWidth:l,clientHeight:s})},on=({data:t,formatOptions:e,clientWidth:l,clientHeight:s,colorBank:u=ra})=>{const r=Ne.useMemo(()=>fa(t,"scatter",e,u),[t,e,u]),n=Ne.useMemo(()=>aa(e,"scatter",!1),[e]);return je.jsx(ia,{chartType:"scatter",data:r,options:n,formatOptions:e,clientWidth:l,clientHeight:s})},cn=({data:t,formatOptions:e,clientWidth:l,clientHeight:s,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.ChartData?.map(m=>m.properties),[t]),o=Ne.useMemo(()=>fa(t,"bubble",e,u),[t,e,u]),p=Ne.useMemo(()=>aa(e,"bubble",!1,r,n),[e]);return je.jsx(ia,{chartType:"bubble",data:o,options:p,formatOptions:e,clientWidth:l,clientHeight:s})},dn=({data:t,formatOptions:e,clientWidth:l,clientHeight:s,colorBank:u=ra})=>{const r=Ne.useMemo(()=>fa(t,"radar",e,u),[t,e,u]),n=Ne.useMemo(()=>{const o=aa(e,"radar",!1);return delete o.scales,o.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??at}},pointLabels:{color:e.xAxisLabel?.xAxisLabelColor??"#333333",font:{size:parseInt(e.xAxisLabel?.xAxisLabelFontSize??"11",10),family:e.xAxisLabel?.xAxisLabelFontFamily??at}}}},o},[e]);return je.jsx(ia,{chartType:"radar",data:r,options:n,formatOptions:e,clientWidth:l,clientHeight:s})},yn=({data:t,formatOptions:e,clientWidth:l,clientHeight:s,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.LegendList??[],[t]),o=Ne.useMemo(()=>fa(t,"polarArea",e,u),[t,e,u]),p=Ne.useMemo(()=>{const m=aa(e,"polarArea",!1,r,n);delete m.scales;const f=e.xAxisLabel?.xAxisLabelFontStyle,y=Array.isArray(f)?f.includes("Italic")||f.includes("italic"):!1;return m.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??at,style:y?"italic":"normal"}}}},m},[e]);return je.jsx(ia,{chartType:"polarArea",data:o,options:p,formatOptions:e,clientWidth:l,clientHeight:s})},un=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.ChartData?.map(f=>f.properties),[t]),o=Ne.useMemo(()=>ci(t,"bar",e,u),[t,e,u]),p=Ne.useMemo(()=>o.datasets.some(f=>f.data.some(y=>y<0)),[o]),m=Ne.useMemo(()=>{const f=aa(e,"bar",!1,r,n);return f.scales??={},f.scales.x??={},f.scales.y??={},f.scales.x.stacked=!0,f.scales.y.stacked=!0,f.scales.y.min=p?-100:0,f.scales.y.max=100,f.scales.y.ticks={...f.scales.y.ticks,callback:y=>`${y}%`},f},[e,p]);return je.jsx(ia,{chartType:"bar",data:o,options:m,formatOptions:e,clientWidth:l,clientHeight:s})},xn=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.ChartData?.map(f=>f.properties),[t]),o=Ne.useMemo(()=>ci(t,"horizontalBar",e,u),[t,e,u]),p=Ne.useMemo(()=>o.datasets.some(f=>f.data.some(y=>y<0)),[o]),m=Ne.useMemo(()=>{const f=aa(e,"horizontalBar",!1,r,n);return f.indexAxis="y",f.scales??={},f.scales.x??={},f.scales.y??={},f.scales.x.stacked=!0,f.scales.y.stacked=!0,f.scales.x.min=p?-100:0,f.scales.x.max=100,f.scales.x.ticks={...f.scales.x.ticks,callback:y=>`${y}%`},f},[e,p]);return je.jsx(ia,{chartType:"bar",data:o,options:m,formatOptions:e,clientWidth:l,clientHeight:s})},hn=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.ChartData?.map(f=>f.properties),[t]),o=Ne.useMemo(()=>ci(t,"line",e,u),[t,e,u]),p=Ne.useMemo(()=>o.datasets.some(f=>f.data.some(y=>y<0)),[o]),m=Ne.useMemo(()=>{const f=aa(e,"line",!1,r,n);return f.scales??={},f.scales.y??={},f.scales.y.stacked=!0,f.scales.y.min=p?-100:0,f.scales.y.max=100,f.scales.y.ticks={...f.scales.y.ticks,callback:y=>`${y}%`},f},[e,p]);return je.jsx(ia,{chartType:"line",data:o,options:m,formatOptions:e,clientWidth:l,clientHeight:s})},pn=({data:t,formatOptions:e,clientWidth:l=0,clientHeight:s=0,colorBank:u=ra,addLocalFilterFromLib:r})=>{const n=Ne.useMemo(()=>t.ChartData?.map(f=>f.properties),[t]),o=Ne.useMemo(()=>ci(t,"area",e,u),[t,e,u]),p=Ne.useMemo(()=>o.datasets.some(f=>f.data.some(y=>y<0)),[o]),m=Ne.useMemo(()=>{const f=aa(e,"area",!1,r,n);return f.scales??={},f.scales.y??={},f.scales.y.stacked=!0,f.scales.y.min=p?-100:0,f.scales.y.max=100,f.scales.y.ticks={...f.scales.y.ticks,callback:y=>`${y}%`},f},[e,p]);return je.jsx(ia,{chartType:"line",data:o,options:m,formatOptions:e,clientWidth:l,clientHeight:s})};Xe.AreaChart=vr,Xe.BubbleChart=Br,Xe.CJSAreaChart=Ll,Xe.CJSBubbleChart=cn,Xe.CJSColumnChart=bl,Xe.CJSDonutChart=sn,Xe.CJSHorizontalBarChart=gl,Xe.CJSLineChart=Al,Xe.CJSNormalizedStackAreaChart=pn,Xe.CJSNormalizedStackColumnChart=un,Xe.CJSNormalizedStackHorizontalBarChart=xn,Xe.CJSNormalizedStackLineChart=hn,Xe.CJSPieChart=nn,Xe.CJSPolarAreaChart=yn,Xe.CJSRadarChart=dn,Xe.CJSScatterChart=on,Xe.CJSStackAreaChart=rn,Xe.CJSStackColumnChart=tn,Xe.CJSStackHorizontalBarChart=an,Xe.CJSStackLineChart=ln,Xe.CJS_DEFAULT_COLORS=ra,Xe.ChartJSWrapper=ia,Xe.ColumnChart=or,Xe.ColumnHistogramChart=hr,Xe.CustomColumnChart=cr,Xe.DonutChart=Fr,Xe.DotPlot=_r,Xe.HorizontalBarChart=Ar,Xe.HorizontalHistogramChart=Tr,Xe.LayeredColumnChart=dr,Xe.LayeredHorizontalBarChart=fr,Xe.LineChart=pr,Xe.Maps=Yr,Xe.NormalizedStackAreaChart=Cr,Xe.NormalizedStackColumnChart=ur,Xe.NormalizedStackHorizontalBarChart=mr,Xe.NormalizedStackLineChart=gr,Xe.OrganizationChart=Ur,Xe.PieChart=Sr,Xe.PieofPie=Dr,Xe.ProgressChart=Nr,Xe.PyramidChart=Vr,Xe.RadialBarChart=Ir,Xe.SankeyChart=zr,Xe.ScatterChart=Hr,Xe.Speedometer=Pr,Xe.StackAreaChart=kr,Xe.StackColumnChart=yr,Xe.StackHorizontalBarChart=Lr,Xe.StackLineChart=br,Xe.TornadoChart=Gr,Xe.Treemap=wr,Xe.VennChart=Rr,Xe.WaterfallChart=Wr,Xe.WordCloud=Er,Xe.hexToRgba=ma,Xe.mapFormatOptionsToChartJS=aa,Xe.transformToChartJSData=fa,Xe.transformToNormalizedChartJSData=ci,Object.defineProperty(Xe,Symbol.toStringTag,{value:"Module"})}));